@devpad/mcp 2.2.11 → 2.2.13

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 +492 -256
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -11921,7 +11921,7 @@ class PrimaryKey {
11921
11921
  }
11922
11922
  }
11923
11923
 
11924
- // ../api/dist/chunk-UIFZ5MOM.js
11924
+ // ../api/dist/chunk-DIX4XVUQ.js
11925
11925
  var timestamps = () => ({
11926
11926
  created_at: text("created_at").notNull().default(sql`(CURRENT_TIMESTAMP)`),
11927
11927
  updated_at: text("updated_at").notNull().default(sql`(CURRENT_TIMESTAMP)`)
@@ -12106,16 +12106,12 @@ var tag = sqliteTable("tag", {
12106
12106
  title: text("title").notNull(),
12107
12107
  color: text("color"),
12108
12108
  render: int("render", { mode: "boolean" }).notNull().default(true)
12109
- }, (table) => ({
12110
- tag_unique: unique("tag_unique").on(table.owner_id, table.title)
12111
- }));
12109
+ }, (table) => [unique("tag_unique").on(table.owner_id, table.title)]);
12112
12110
  var task_tag = sqliteTable("task_tag", {
12113
12111
  task_id: text("task_id").notNull().references(() => task.id),
12114
12112
  tag_id: text("tag_id").notNull().references(() => tag.id),
12115
12113
  ...timestamps()
12116
- }, (table) => ({
12117
- task_tag_unique: primaryKey({ columns: [table.task_id, table.tag_id] })
12118
- }));
12114
+ }, (table) => [primaryKey({ columns: [table.task_id, table.tag_id] })]);
12119
12115
  var commit_detail = sqliteTable("commit_detail", {
12120
12116
  sha: text("sha").primaryKey(),
12121
12117
  message: text("message").notNull(),
@@ -12584,8 +12580,21 @@ var dashboard_response = exports_external.object({
12584
12580
  // ../../node_modules/@f0rbit/corpus/dist/types.js
12585
12581
  var ok = (value) => ({ ok: true, value });
12586
12582
  var err = (error) => ({ ok: false, error });
12583
+ function define_store(id2, codec, opts) {
12584
+ if (typeof opts === "string") {
12585
+ return { id: id2, codec, description: opts };
12586
+ }
12587
+ return { id: id2, codec, description: opts?.description, data_key_fn: opts?.data_key_fn };
12588
+ }
12587
12589
 
12588
12590
  // ../../node_modules/@f0rbit/corpus/dist/utils.js
12591
+ function json_codec(schema) {
12592
+ return {
12593
+ content_type: "application/json",
12594
+ encode: async (value) => new TextEncoder().encode(JSON.stringify(value)),
12595
+ decode: async (bytes) => schema.parse(JSON.parse(new TextDecoder().decode(bytes)))
12596
+ };
12597
+ }
12589
12598
  function create_filter_pipeline(config) {
12590
12599
  return (items, opts) => {
12591
12600
  let filtered = items;
@@ -12771,6 +12780,193 @@ var VersionSetManifestSchema = exports_external.object({
12771
12780
  grants_ref: exports_external.string().optional(),
12772
12781
  template_ref: exports_external.string().optional()
12773
12782
  });
12783
+ // ../api/dist/chunk-5L3AUVMM.js
12784
+ var PostContentSchema = exports_external.object({
12785
+ title: exports_external.string().min(1),
12786
+ content: exports_external.string(),
12787
+ description: exports_external.string().optional(),
12788
+ format: exports_external.enum(["md", "adoc"])
12789
+ });
12790
+ var postsStoreDefinition = define_store("posts", json_codec(PostContentSchema));
12791
+ var VersionInfoSchema = exports_external.object({
12792
+ hash: exports_external.string(),
12793
+ parent: exports_external.string().nullable(),
12794
+ created_at: exports_external.date()
12795
+ });
12796
+ var parsePostContent = PostContentSchema.parse.bind(PostContentSchema);
12797
+ var PostRowSchema = exports_external.object({
12798
+ id: exports_external.number(),
12799
+ uuid: exports_external.string(),
12800
+ author_id: exports_external.string(),
12801
+ slug: exports_external.string(),
12802
+ corpus_version: exports_external.string().nullable(),
12803
+ category: exports_external.string(),
12804
+ archived: exports_external.boolean(),
12805
+ publish_at: exports_external.coerce.date().nullable(),
12806
+ created_at: exports_external.coerce.date(),
12807
+ updated_at: exports_external.coerce.date()
12808
+ });
12809
+ var PostRowInsertSchema = exports_external.object({
12810
+ id: exports_external.number().optional(),
12811
+ uuid: exports_external.string(),
12812
+ author_id: exports_external.string(),
12813
+ slug: exports_external.string(),
12814
+ corpus_version: exports_external.string().nullable().optional(),
12815
+ category: exports_external.string().optional(),
12816
+ archived: exports_external.boolean().optional(),
12817
+ publish_at: exports_external.coerce.date().nullable().optional(),
12818
+ created_at: exports_external.coerce.date().optional(),
12819
+ updated_at: exports_external.coerce.date().optional()
12820
+ });
12821
+ var CategorySchema = exports_external.object({
12822
+ id: exports_external.number(),
12823
+ owner_id: exports_external.string(),
12824
+ name: exports_external.string(),
12825
+ parent: exports_external.string().nullable()
12826
+ });
12827
+ var CategoryInsertSchema = exports_external.object({
12828
+ id: exports_external.number().optional(),
12829
+ owner_id: exports_external.string(),
12830
+ name: exports_external.string(),
12831
+ parent: exports_external.string().nullable().optional()
12832
+ });
12833
+ var TagSchema = exports_external.object({
12834
+ post_id: exports_external.number(),
12835
+ tag: exports_external.string()
12836
+ });
12837
+ var TagInsertSchema = exports_external.object({
12838
+ post_id: exports_external.number(),
12839
+ tag: exports_external.string()
12840
+ });
12841
+ var AccessKeyRowSchema = exports_external.object({
12842
+ id: exports_external.number(),
12843
+ user_id: exports_external.string(),
12844
+ key_hash: exports_external.string(),
12845
+ name: exports_external.string(),
12846
+ note: exports_external.string().nullable(),
12847
+ enabled: exports_external.boolean(),
12848
+ created_at: exports_external.coerce.date()
12849
+ });
12850
+ var AccessKeySchema = AccessKeyRowSchema.omit({ key_hash: true });
12851
+ var AccessKeyInsertSchema = exports_external.object({
12852
+ id: exports_external.number().optional(),
12853
+ user_id: exports_external.string(),
12854
+ key_hash: exports_external.string(),
12855
+ name: exports_external.string(),
12856
+ note: exports_external.string().nullable().optional(),
12857
+ enabled: exports_external.boolean().optional(),
12858
+ created_at: exports_external.coerce.date().optional()
12859
+ });
12860
+ var IntegrationSchema = exports_external.object({
12861
+ id: exports_external.number(),
12862
+ user_id: exports_external.string(),
12863
+ source: exports_external.string(),
12864
+ location: exports_external.string(),
12865
+ data: exports_external.record(exports_external.unknown()).nullable(),
12866
+ last_fetch: exports_external.coerce.date().nullable(),
12867
+ status: exports_external.string().nullable(),
12868
+ created_at: exports_external.coerce.date()
12869
+ });
12870
+ var IntegrationInsertSchema = exports_external.object({
12871
+ id: exports_external.number().optional(),
12872
+ user_id: exports_external.string(),
12873
+ source: exports_external.string(),
12874
+ location: exports_external.string(),
12875
+ data: exports_external.record(exports_external.unknown()).nullable().optional(),
12876
+ last_fetch: exports_external.coerce.date().nullable().optional(),
12877
+ status: exports_external.string().nullable().optional(),
12878
+ created_at: exports_external.coerce.date().optional()
12879
+ });
12880
+ var FetchLinkSchema = exports_external.object({
12881
+ id: exports_external.number(),
12882
+ post_id: exports_external.number(),
12883
+ integration_id: exports_external.number(),
12884
+ identifier: exports_external.string()
12885
+ });
12886
+ var FetchLinkInsertSchema = exports_external.object({
12887
+ id: exports_external.number().optional(),
12888
+ post_id: exports_external.number(),
12889
+ integration_id: exports_external.number(),
12890
+ identifier: exports_external.string()
12891
+ });
12892
+ var PostSchema = exports_external.object({
12893
+ id: exports_external.number(),
12894
+ uuid: exports_external.string().uuid(),
12895
+ author_id: exports_external.string(),
12896
+ slug: exports_external.string(),
12897
+ title: exports_external.string(),
12898
+ content: exports_external.string(),
12899
+ description: exports_external.string().optional(),
12900
+ format: exports_external.enum(["md", "adoc"]),
12901
+ category: exports_external.string(),
12902
+ tags: exports_external.array(exports_external.string()),
12903
+ archived: exports_external.boolean(),
12904
+ publish_at: exports_external.coerce.date().nullable(),
12905
+ created_at: exports_external.coerce.date(),
12906
+ updated_at: exports_external.coerce.date(),
12907
+ project_ids: exports_external.array(exports_external.string()),
12908
+ corpus_version: exports_external.string().nullable()
12909
+ });
12910
+ var SlugPattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
12911
+ var PostCreateSchema = exports_external.object({
12912
+ slug: exports_external.string().regex(SlugPattern, "Slug must be lowercase alphanumeric with hyphens"),
12913
+ title: exports_external.string().min(1),
12914
+ content: exports_external.string(),
12915
+ description: exports_external.string().optional(),
12916
+ format: exports_external.enum(["md", "adoc"]).default("md"),
12917
+ category: exports_external.string().default("root"),
12918
+ tags: exports_external.array(exports_external.string()).default([]),
12919
+ publish_at: exports_external.coerce.date().nullable().optional(),
12920
+ project_ids: exports_external.array(exports_external.string()).optional()
12921
+ });
12922
+ var PostUpdateSchema = exports_external.object({
12923
+ slug: exports_external.string().regex(SlugPattern, "Slug must be lowercase alphanumeric with hyphens").optional(),
12924
+ title: exports_external.string().min(1).optional(),
12925
+ content: exports_external.string().optional(),
12926
+ description: exports_external.string().optional(),
12927
+ format: exports_external.enum(["md", "adoc"]).optional(),
12928
+ category: exports_external.string().optional(),
12929
+ tags: exports_external.array(exports_external.string()).optional(),
12930
+ archived: exports_external.boolean().optional(),
12931
+ publish_at: exports_external.coerce.date().nullable().optional(),
12932
+ project_ids: exports_external.array(exports_external.string()).optional()
12933
+ });
12934
+ var PostListParamsSchema = exports_external.object({
12935
+ category: exports_external.string().optional(),
12936
+ tag: exports_external.string().optional(),
12937
+ project: exports_external.string().optional(),
12938
+ status: exports_external.enum(["published", "scheduled", "draft", "all"]).default("all"),
12939
+ archived: exports_external.boolean().default(false),
12940
+ limit: exports_external.coerce.number().min(1).max(100).default(10),
12941
+ offset: exports_external.coerce.number().min(0).default(0),
12942
+ sort: exports_external.enum(["created", "updated", "published"]).default("updated")
12943
+ });
12944
+ var PostsResponseSchema = exports_external.object({
12945
+ posts: exports_external.array(PostSchema),
12946
+ total_posts: exports_external.number(),
12947
+ total_pages: exports_external.number(),
12948
+ per_page: exports_external.number(),
12949
+ current_page: exports_external.number()
12950
+ });
12951
+ var CategoryCreateSchema = exports_external.object({
12952
+ name: exports_external.string().min(1),
12953
+ parent: exports_external.string().default("root")
12954
+ });
12955
+ var AccessKeyCreateSchema = exports_external.object({
12956
+ name: exports_external.string().min(1),
12957
+ note: exports_external.string().optional()
12958
+ });
12959
+ var AccessKeyUpdateSchema = exports_external.object({
12960
+ name: exports_external.string().min(1).optional(),
12961
+ note: exports_external.string().optional(),
12962
+ enabled: exports_external.boolean().optional()
12963
+ });
12964
+ var IntegrationUpsertSchema = exports_external.object({
12965
+ source: exports_external.string().min(1),
12966
+ location: exports_external.string().min(1),
12967
+ data: exports_external.record(exports_external.unknown()).optional()
12968
+ });
12969
+
12774
12970
  // ../api/dist/index.js
12775
12971
  var ApiError = class _ApiError extends Error {
12776
12972
  constructor(message, options = {}) {
@@ -12829,10 +13025,11 @@ async function handleResponseError(response) {
12829
13025
  const errorMessage = errorText || "Request failed";
12830
13026
  let parsedError = null;
12831
13027
  try {
12832
- parsedError = JSON.parse(errorText);
13028
+ const raw = JSON.parse(errorText);
13029
+ parsedError = raw;
12833
13030
  } catch {}
12834
13031
  if (response.status === HTTP_STATUS.BAD_REQUEST && parsedError?.error?.name === "ZodError") {
12835
- const zodErrorDetails = parsedError.error?.issues ? JSON.stringify(parsedError.error) : errorMessage;
13032
+ const zodErrorDetails = parsedError.error.issues ? JSON.stringify(parsedError.error) : errorMessage;
12836
13033
  throw new ValidationError(zodErrorDetails);
12837
13034
  }
12838
13035
  throw new ApiError(errorMessage, { statusCode: response.status });
@@ -12842,43 +13039,43 @@ function handleNetworkError(error) {
12842
13039
  throw new NetworkError(message);
12843
13040
  }
12844
13041
  var ArrayBufferedQueue = class {
12845
- constructor(_capacity) {
12846
- this._capacity = _capacity;
12847
- this._entries = [];
12848
- this._head = 0;
12849
- this._tail = 0;
12850
- this._size = 0;
13042
+ constructor(capacity) {
13043
+ this.capacity = capacity;
13044
+ this.entries = [];
13045
+ this.head = 0;
13046
+ this.tail = 0;
13047
+ this.count = 0;
12851
13048
  }
12852
13049
  latest() {
12853
- if (this._size === 0)
13050
+ if (this.count === 0)
12854
13051
  return null;
12855
- return this._entries[this._tail - 1] ?? null;
13052
+ return this.entries[this.tail - 1] ?? null;
12856
13053
  }
12857
13054
  list() {
12858
- if (this._size === 0)
13055
+ if (this.count === 0)
12859
13056
  return [];
12860
- if (this._head < this._tail) {
12861
- return this._entries.slice(this._head, this._tail);
13057
+ if (this.head < this.tail) {
13058
+ return this.entries.slice(this.head, this.tail);
12862
13059
  }
12863
- return this._entries.slice(this._head).concat(this._entries.slice(0, this._tail));
13060
+ return this.entries.slice(this.head).concat(this.entries.slice(0, this.tail));
12864
13061
  }
12865
13062
  add(item) {
12866
- if (this._size === this._capacity) {
12867
- this._head = (this._head + 1) % this._capacity;
13063
+ if (this.count === this.capacity) {
13064
+ this.head = (this.head + 1) % this.capacity;
12868
13065
  } else {
12869
- this._size++;
13066
+ this.count++;
12870
13067
  }
12871
- this._entries[this._tail] = item;
12872
- this._tail = (this._tail + 1) % this._capacity;
13068
+ this.entries[this.tail] = item;
13069
+ this.tail = (this.tail + 1) % this.capacity;
12873
13070
  }
12874
13071
  size() {
12875
- return this._size;
13072
+ return this.count;
12876
13073
  }
12877
13074
  clear() {
12878
- this._entries = [];
12879
- this._head = 0;
12880
- this._tail = 0;
12881
- this._size = 0;
13075
+ this.entries = [];
13076
+ this.head = 0;
13077
+ this.tail = 0;
13078
+ this.count = 0;
12882
13079
  }
12883
13080
  };
12884
13081
  var ApiClient = class {
@@ -12911,7 +13108,7 @@ var ApiClient = class {
12911
13108
  return url.toString();
12912
13109
  }
12913
13110
  generateRequestId() {
12914
- return `${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
13111
+ return `${String(Date.now())}-${Math.random().toString(36).substring(2, 11)}`;
12915
13112
  }
12916
13113
  async request(path, options = {}) {
12917
13114
  const { method = "GET", headers = {}, body, query } = options;
@@ -12962,7 +13159,7 @@ var ApiClient = class {
12962
13159
  if (this.debug) {
12963
13160
  console.log(`[ERROR][${this.category}] ${method} ${path} [${requestId}] failed`, {
12964
13161
  status: response.status,
12965
- duration: `${duration}ms`,
13162
+ duration: `${String(duration)}ms`,
12966
13163
  body,
12967
13164
  query
12968
13165
  });
@@ -12987,8 +13184,9 @@ var ApiClient = class {
12987
13184
  result = undefined;
12988
13185
  } else {
12989
13186
  try {
12990
- result = JSON.parse(text2);
12991
- } catch (parseError) {
13187
+ const raw = JSON.parse(text2);
13188
+ result = raw;
13189
+ } catch {
12992
13190
  result = text2;
12993
13191
  }
12994
13192
  }
@@ -12996,7 +13194,7 @@ var ApiClient = class {
12996
13194
  if (this.debug) {
12997
13195
  console.log(`[INFO][${this.category}] ${method} ${path} [${requestId}] completed`, {
12998
13196
  status: response.status,
12999
- duration: `${duration}ms`
13197
+ duration: `${String(duration)}ms`
13000
13198
  });
13001
13199
  }
13002
13200
  return result;
@@ -13005,7 +13203,7 @@ var ApiClient = class {
13005
13203
  if (this.debug) {
13006
13204
  console.log(`[ERROR][${this.category}] ${method} ${path} [${requestId}] failed`, {
13007
13205
  url,
13008
- duration: `${duration}ms`,
13206
+ duration: `${String(duration)}ms`,
13009
13207
  error: error instanceof Error ? error.message : String(error),
13010
13208
  body,
13011
13209
  query
@@ -13058,11 +13256,23 @@ var ApiClient = class {
13058
13256
  return headers;
13059
13257
  }
13060
13258
  };
13259
+ var string_field = (value, key) => {
13260
+ if (typeof value !== "object" || value === null || !(key in value))
13261
+ return;
13262
+ const field = value[key];
13263
+ return typeof field === "string" ? field : undefined;
13264
+ };
13265
+ var number_field = (value, key) => {
13266
+ if (typeof value !== "object" || value === null || !(key in value))
13267
+ return;
13268
+ const field = value[key];
13269
+ return typeof field === "number" ? field : undefined;
13270
+ };
13061
13271
  function wrap(fn) {
13062
13272
  return fn().then((data) => ok(data)).catch((error) => err({
13063
- message: error.message || "Unknown error",
13064
- code: error.code,
13065
- status_code: error.statusCode || error.status_code
13273
+ message: error instanceof Error ? error.message : "Unknown error",
13274
+ code: string_field(error, "code"),
13275
+ status_code: number_field(error, "statusCode") ?? number_field(error, "status_code")
13066
13276
  }));
13067
13277
  }
13068
13278
  var ApiClient2 = class {
@@ -13173,7 +13383,7 @@ var ApiClient2 = class {
13173
13383
  find: (id2) => wrap(async () => {
13174
13384
  try {
13175
13385
  return await this.clients.milestones.get(`/milestones/${id2}`);
13176
- } catch (error) {
13386
+ } catch {
13177
13387
  return null;
13178
13388
  }
13179
13389
  }),
@@ -13423,7 +13633,9 @@ var ApiClient2 = class {
13423
13633
  };
13424
13634
  this.user = {
13425
13635
  history: () => wrap(() => this.clients.auth.get("/user/history")),
13426
- preferences: (data) => wrap(() => this.clients.auth.patch("/user/preferences", { body: data }))
13636
+ preferences: (data) => wrap(() => this.clients.auth.patch("/user/preferences", {
13637
+ body: data
13638
+ }))
13427
13639
  };
13428
13640
  this.pulse = {
13429
13641
  summary: (input) => wrap(() => this.clients.pulse.get("/summary/:project_id".replace(":project_id", input.project_id), {
@@ -13445,7 +13657,9 @@ var ApiClient2 = class {
13445
13657
  query.limit = String(input.limit);
13446
13658
  if (input.cursor)
13447
13659
  query.cursor = input.cursor;
13448
- return this.clients.pulse.get("/events/:project_id".replace(":project_id", input.project_id), { query });
13660
+ return this.clients.pulse.get("/events/:project_id".replace(":project_id", input.project_id), {
13661
+ query
13662
+ });
13449
13663
  }),
13450
13664
  errors: (input) => wrap(() => {
13451
13665
  const query = {};
@@ -13457,7 +13671,9 @@ var ApiClient2 = class {
13457
13671
  }
13458
13672
  if (input.group_by_fingerprint)
13459
13673
  query.group_by_fingerprint = "true";
13460
- return this.clients.pulse.get("/errors/:project_id".replace(":project_id", input.project_id), { query });
13674
+ return this.clients.pulse.get("/errors/:project_id".replace(":project_id", input.project_id), {
13675
+ query
13676
+ });
13461
13677
  }),
13462
13678
  logs: (input) => wrap(() => {
13463
13679
  const query = {};
@@ -13485,7 +13701,9 @@ var ApiClient2 = class {
13485
13701
  query.route = input.route;
13486
13702
  if (input.percentiles && input.percentiles.length > 0)
13487
13703
  query.percentiles = input.percentiles.join(",");
13488
- return this.clients.pulse.get("/latency/:project_id".replace(":project_id", input.project_id), { query });
13704
+ return this.clients.pulse.get("/latency/:project_id".replace(":project_id", input.project_id), {
13705
+ query
13706
+ });
13489
13707
  }),
13490
13708
  subs: {
13491
13709
  list: (input) => wrap(() => this.clients.pulse.get("/admin/subs", { query: { project_id: input.project_id } })),
@@ -13597,13 +13815,13 @@ var ApiClient2 = class {
13597
13815
  }
13598
13816
  };
13599
13817
  const base_url = options.base_url || "http://localhost:4321/api/v1";
13600
- this._api_key = options.api_key ?? "";
13601
- this._auth_mode = options.auth_mode ?? (options.api_key?.startsWith("jwt:") ? "session" : options.api_key ? "key" : "cookie");
13818
+ this.api_key_field = options.api_key ?? "";
13819
+ this.auth_mode_field = options.auth_mode ?? (options.api_key?.startsWith("jwt:") ? "session" : options.api_key ? "key" : "cookie");
13602
13820
  const clientOptions = {
13603
13821
  base_url,
13604
13822
  api_key: options.api_key,
13605
13823
  max_history_size: options.max_history_size,
13606
- auth_mode: this._auth_mode,
13824
+ auth_mode: this.auth_mode_field,
13607
13825
  credentials: options.credentials,
13608
13826
  default_headers: options.default_headers,
13609
13827
  custom_fetch: options.custom_fetch
@@ -13632,12 +13850,55 @@ var ApiClient2 = class {
13632
13850
  return this.clients.projects.history();
13633
13851
  }
13634
13852
  getApiKey() {
13635
- return this._api_key;
13853
+ return this.api_key_field;
13636
13854
  }
13637
13855
  getAuthMode() {
13638
- return this._auth_mode;
13856
+ return this.auth_mode_field;
13639
13857
  }
13640
13858
  };
13859
+ var blog_posts = sqliteTable("blog_posts", {
13860
+ id: integer("id").primaryKey({ autoIncrement: true }),
13861
+ uuid: text("uuid").notNull().unique(),
13862
+ author_id: text("author_id").notNull(),
13863
+ slug: text("slug").notNull(),
13864
+ corpus_version: text("corpus_version"),
13865
+ category: text("category").notNull().default("root"),
13866
+ archived: integer("archived", { mode: "boolean" }).notNull().default(false),
13867
+ publish_at: integer("publish_at", { mode: "timestamp" }),
13868
+ created_at: integer("created_at", { mode: "timestamp" }).notNull().default(sql`(unixepoch())`),
13869
+ updated_at: integer("updated_at", { mode: "timestamp" }).notNull().default(sql`(unixepoch())`)
13870
+ }, (table) => [unique("posts_author_slug_unique").on(table.author_id, table.slug)]);
13871
+ var blog_categories = sqliteTable("blog_categories", {
13872
+ id: integer("id").primaryKey({ autoIncrement: true }),
13873
+ owner_id: text("owner_id").notNull(),
13874
+ name: text("name").notNull(),
13875
+ parent: text("parent").default("root")
13876
+ }, (table) => [unique("categories_owner_name_unique").on(table.owner_id, table.name)]);
13877
+ var blog_tags = sqliteTable("blog_tags", {
13878
+ post_id: integer("post_id").notNull().references(() => blog_posts.id, { onDelete: "cascade" }),
13879
+ tag: text("tag").notNull()
13880
+ }, (table) => [primaryKey({ columns: [table.post_id, table.tag] })]);
13881
+ var blog_integrations = sqliteTable("blog_integrations", {
13882
+ id: integer("id").primaryKey({ autoIncrement: true }),
13883
+ user_id: text("user_id").notNull(),
13884
+ source: text("source").notNull(),
13885
+ location: text("location").notNull(),
13886
+ data: text("data", { mode: "json" }).$type(),
13887
+ last_fetch: integer("last_fetch", { mode: "timestamp" }),
13888
+ status: text("status").default("pending"),
13889
+ created_at: integer("created_at", { mode: "timestamp" }).notNull().default(sql`(unixepoch())`)
13890
+ });
13891
+ var blog_fetch_links = sqliteTable("blog_fetch_links", {
13892
+ id: integer("id").primaryKey({ autoIncrement: true }),
13893
+ post_id: integer("post_id").notNull().references(() => blog_posts.id, { onDelete: "cascade" }),
13894
+ integration_id: integer("integration_id").notNull().references(() => blog_integrations.id, { onDelete: "cascade" }),
13895
+ identifier: text("identifier").notNull()
13896
+ }, (table) => [unique("fetch_links_integration_identifier_unique").on(table.integration_id, table.identifier)]);
13897
+ var blog_post_projects = sqliteTable("blog_post_projects", {
13898
+ post_id: integer("post_id").notNull().references(() => blog_posts.id, { onDelete: "cascade" }),
13899
+ project_id: text("project_id").notNull(),
13900
+ created_at: integer("created_at", { mode: "timestamp" }).notNull().default(sql`(unixepoch())`)
13901
+ }, (table) => [primaryKey({ columns: [table.post_id, table.project_id] })]);
13641
13902
  function unwrap2(result) {
13642
13903
  if (!result.ok)
13643
13904
  throw new Error(result.error?.message ?? "Unknown error");
@@ -13672,26 +13933,33 @@ var github_branches = exports_external.object({
13672
13933
  owner: exports_external.string().describe("Repository owner"),
13673
13934
  repo: exports_external.string().describe("Repository name")
13674
13935
  });
13936
+ var define_tool = (def) => def;
13675
13937
  var tools = {
13676
- devpad_projects_list: {
13938
+ devpad_projects_list: define_tool({
13677
13939
  name: "devpad_projects_list",
13678
13940
  description: "List all projects (or only public ones)",
13679
13941
  inputSchema: project_filters,
13680
13942
  execute: async (client, input) => unwrap2(await client.projects.list(input))
13681
- },
13682
- devpad_projects_get: {
13943
+ }),
13944
+ devpad_projects_get: define_tool({
13683
13945
  name: "devpad_projects_get",
13684
13946
  description: "Get project by ID or name",
13685
13947
  inputSchema: project_by_id_or_name,
13686
- execute: async (client, input) => unwrap2(input.id ? await client.projects.getById(input.id) : await client.projects.getByName(input.name))
13687
- },
13688
- devpad_projects_upsert: {
13948
+ execute: async (client, input) => {
13949
+ if (input.id)
13950
+ return unwrap2(await client.projects.getById(input.id));
13951
+ if (!input.name)
13952
+ throw new Error("either id or name must be provided");
13953
+ return unwrap2(await client.projects.getByName(input.name));
13954
+ }
13955
+ }),
13956
+ devpad_projects_upsert: define_tool({
13689
13957
  name: "devpad_projects_upsert",
13690
13958
  description: "Create or update a project (set deleted=true to delete). Returns 409 if entity is protected by user - pass force=true to override.",
13691
13959
  inputSchema: upsert_project,
13692
13960
  execute: async (client, input) => unwrap2(await client.projects.upsert(input))
13693
- },
13694
- devpad_projects_config_save: {
13961
+ }),
13962
+ devpad_projects_config_save: define_tool({
13695
13963
  name: "devpad_projects_config_save",
13696
13964
  description: "Save project configuration",
13697
13965
  inputSchema: save_config_request,
@@ -13699,26 +13967,26 @@ var tools = {
13699
13967
  unwrap2(await client.projects.config.save(input));
13700
13968
  return { success: true };
13701
13969
  }
13702
- },
13703
- devpad_tasks_list: {
13970
+ }),
13971
+ devpad_tasks_list: define_tool({
13704
13972
  name: "devpad_tasks_list",
13705
13973
  description: "List tasks, optionally filtered by project or tag",
13706
13974
  inputSchema: task_filters,
13707
13975
  execute: async (client, input) => unwrap2(await client.tasks.list(input))
13708
- },
13709
- devpad_tasks_get: {
13976
+ }),
13977
+ devpad_tasks_get: define_tool({
13710
13978
  name: "devpad_tasks_get",
13711
13979
  description: "Get task by ID",
13712
13980
  inputSchema: task_by_id,
13713
13981
  execute: async (client, input) => unwrap2(await client.tasks.find(input.id))
13714
- },
13715
- devpad_tasks_upsert: {
13982
+ }),
13983
+ devpad_tasks_upsert: define_tool({
13716
13984
  name: "devpad_tasks_upsert",
13717
13985
  description: "Create or update a task (set deleted=true to delete). Returns 409 if entity is protected by user - pass force=true to override.",
13718
13986
  inputSchema: upsert_todo,
13719
13987
  execute: async (client, input) => unwrap2(await client.tasks.upsert(input))
13720
- },
13721
- devpad_tasks_save_tags: {
13988
+ }),
13989
+ devpad_tasks_save_tags: define_tool({
13722
13990
  name: "devpad_tasks_save_tags",
13723
13991
  description: "Save tags for tasks",
13724
13992
  inputSchema: save_tags_request,
@@ -13726,20 +13994,20 @@ var tools = {
13726
13994
  unwrap2(await client.tasks.saveTags(input));
13727
13995
  return { success: true };
13728
13996
  }
13729
- },
13730
- devpad_milestones_list: {
13997
+ }),
13998
+ devpad_milestones_list: define_tool({
13731
13999
  name: "devpad_milestones_list",
13732
14000
  description: "List milestones for authenticated user or by project",
13733
14001
  inputSchema: milestone_filters,
13734
14002
  execute: async (client, input) => unwrap2(input.project_id ? await client.milestones.getByProject(input.project_id) : await client.milestones.list())
13735
- },
13736
- devpad_milestones_get: {
14003
+ }),
14004
+ devpad_milestones_get: define_tool({
13737
14005
  name: "devpad_milestones_get",
13738
14006
  description: "Get milestone by ID",
13739
14007
  inputSchema: milestone_by_id,
13740
14008
  execute: async (client, input) => unwrap2(await client.milestones.find(input.id))
13741
- },
13742
- devpad_milestones_upsert: {
14009
+ }),
14010
+ devpad_milestones_upsert: define_tool({
13743
14011
  name: "devpad_milestones_upsert",
13744
14012
  description: "Create or update a milestone. Returns 409 if entity is protected by user - pass force=true to override.",
13745
14013
  inputSchema: upsert_milestone,
@@ -13757,20 +14025,20 @@ var tools = {
13757
14025
  target_version: input.target_version,
13758
14026
  finished_at: input.finished_at
13759
14027
  }))
13760
- },
13761
- devpad_goals_list: {
14028
+ }),
14029
+ devpad_goals_list: define_tool({
13762
14030
  name: "devpad_goals_list",
13763
14031
  description: "List goals for authenticated user",
13764
14032
  inputSchema: exports_external.object({}),
13765
14033
  execute: async (client) => unwrap2(await client.goals.list())
13766
- },
13767
- devpad_goals_get: {
14034
+ }),
14035
+ devpad_goals_get: define_tool({
13768
14036
  name: "devpad_goals_get",
13769
14037
  description: "Get goal by ID",
13770
14038
  inputSchema: goal_by_id,
13771
14039
  execute: async (client, input) => unwrap2(await client.goals.find(input.id))
13772
- },
13773
- devpad_goals_upsert: {
14040
+ }),
14041
+ devpad_goals_upsert: define_tool({
13774
14042
  name: "devpad_goals_upsert",
13775
14043
  description: "Create or update a goal. Returns 409 if entity is protected by user - pass force=true to override.",
13776
14044
  inputSchema: upsert_goal,
@@ -13786,26 +14054,26 @@ var tools = {
13786
14054
  target_time: input.target_time,
13787
14055
  finished_at: input.finished_at
13788
14056
  }))
13789
- },
13790
- devpad_tags_list: {
14057
+ }),
14058
+ devpad_tags_list: define_tool({
13791
14059
  name: "devpad_tags_list",
13792
14060
  description: "List tags for authenticated user",
13793
14061
  inputSchema: exports_external.object({}),
13794
14062
  execute: async (client) => unwrap2(await client.tags.list())
13795
- },
13796
- devpad_github_repos: {
14063
+ }),
14064
+ devpad_github_repos: define_tool({
13797
14065
  name: "devpad_github_repos",
13798
14066
  description: "List GitHub repositories for authenticated user",
13799
14067
  inputSchema: exports_external.object({}),
13800
14068
  execute: async (client) => unwrap2(await client.github.repos())
13801
- },
13802
- devpad_github_branches: {
14069
+ }),
14070
+ devpad_github_branches: define_tool({
13803
14071
  name: "devpad_github_branches",
13804
14072
  description: "List branches for a GitHub repository",
13805
14073
  inputSchema: github_branches,
13806
14074
  execute: async (client, input) => unwrap2(await client.github.branches(input.owner, input.repo))
13807
- },
13808
- devpad_projects_delete: {
14075
+ }),
14076
+ devpad_projects_delete: define_tool({
13809
14077
  name: "devpad_projects_delete",
13810
14078
  description: "Delete a project",
13811
14079
  inputSchema: exports_external.object({
@@ -13818,56 +14086,56 @@ var tools = {
13818
14086
  unwrap2(await client.projects.deleteProject(project2));
13819
14087
  return { success: true };
13820
14088
  }
13821
- },
13822
- devpad_projects_history: {
14089
+ }),
14090
+ devpad_projects_history: define_tool({
13823
14091
  name: "devpad_projects_history",
13824
14092
  description: "Get project history",
13825
14093
  inputSchema: exports_external.object({
13826
14094
  project_id: exports_external.string().describe("Project ID")
13827
14095
  }),
13828
14096
  execute: async (client, input) => unwrap2(await client.projects.history(input.project_id))
13829
- },
13830
- devpad_projects_specification: {
14097
+ }),
14098
+ devpad_projects_specification: define_tool({
13831
14099
  name: "devpad_projects_specification",
13832
14100
  description: "Fetch project specification from GitHub",
13833
14101
  inputSchema: exports_external.object({
13834
14102
  project_id: exports_external.string().describe("Project ID")
13835
14103
  }),
13836
14104
  execute: async (client, input) => unwrap2(await client.projects.specification(input.project_id))
13837
- },
13838
- devpad_projects_config_load: {
14105
+ }),
14106
+ devpad_projects_config_load: define_tool({
13839
14107
  name: "devpad_projects_config_load",
13840
14108
  description: "Load project configuration",
13841
14109
  inputSchema: exports_external.object({
13842
14110
  project_id: exports_external.string().describe("Project ID")
13843
14111
  }),
13844
14112
  execute: async (client, input) => unwrap2(await client.projects.config.load(input.project_id))
13845
- },
13846
- devpad_milestones_delete: {
14113
+ }),
14114
+ devpad_milestones_delete: define_tool({
13847
14115
  name: "devpad_milestones_delete",
13848
14116
  description: "Delete a milestone",
13849
14117
  inputSchema: exports_external.object({
13850
14118
  id: exports_external.string().describe("Milestone ID")
13851
14119
  }),
13852
14120
  execute: async (client, input) => unwrap2(await client.milestones.delete(input.id))
13853
- },
13854
- devpad_milestones_goals: {
14121
+ }),
14122
+ devpad_milestones_goals: define_tool({
13855
14123
  name: "devpad_milestones_goals",
13856
14124
  description: "Get goals for a milestone",
13857
14125
  inputSchema: exports_external.object({
13858
14126
  id: exports_external.string().describe("Milestone ID")
13859
14127
  }),
13860
14128
  execute: async (client, input) => unwrap2(await client.milestones.goals(input.id))
13861
- },
13862
- devpad_goals_delete: {
14129
+ }),
14130
+ devpad_goals_delete: define_tool({
13863
14131
  name: "devpad_goals_delete",
13864
14132
  description: "Delete a goal",
13865
14133
  inputSchema: exports_external.object({
13866
14134
  id: exports_external.string().describe("Goal ID")
13867
14135
  }),
13868
14136
  execute: async (client, input) => unwrap2(await client.goals.delete(input.id))
13869
- },
13870
- devpad_tasks_delete: {
14137
+ }),
14138
+ devpad_tasks_delete: define_tool({
13871
14139
  name: "devpad_tasks_delete",
13872
14140
  description: "Delete a task",
13873
14141
  inputSchema: exports_external.object({
@@ -13880,22 +14148,22 @@ var tools = {
13880
14148
  unwrap2(await client.tasks.deleteTask(task2));
13881
14149
  return { success: true };
13882
14150
  }
13883
- },
13884
- devpad_tasks_history: {
14151
+ }),
14152
+ devpad_tasks_history: define_tool({
13885
14153
  name: "devpad_tasks_history",
13886
14154
  description: "Get task history",
13887
14155
  inputSchema: exports_external.object({
13888
14156
  task_id: exports_external.string().describe("Task ID")
13889
14157
  }),
13890
14158
  execute: async (client, input) => unwrap2(await client.tasks.history.get(input.task_id))
13891
- },
13892
- devpad_user_history: {
14159
+ }),
14160
+ devpad_user_history: define_tool({
13893
14161
  name: "devpad_user_history",
13894
14162
  description: "Get user activity history",
13895
14163
  inputSchema: exports_external.object({}),
13896
14164
  execute: async (client) => unwrap2(await client.user.history())
13897
- },
13898
- devpad_user_preferences: {
14165
+ }),
14166
+ devpad_user_preferences: define_tool({
13899
14167
  name: "devpad_user_preferences",
13900
14168
  description: "Update user preferences",
13901
14169
  inputSchema: exports_external.object({
@@ -13903,8 +14171,8 @@ var tools = {
13903
14171
  task_view: exports_external.enum(["list", "grid"]).describe("Task view preference")
13904
14172
  }),
13905
14173
  execute: async (client, input) => unwrap2(await client.user.preferences(input))
13906
- },
13907
- devpad_activity_ai: {
14174
+ }),
14175
+ devpad_activity_ai: define_tool({
13908
14176
  name: "devpad_activity_ai",
13909
14177
  description: "Get AI activity feed - shows recent actions made via API/MCP grouped into sessions by time window",
13910
14178
  inputSchema: exports_external.object({
@@ -13912,104 +14180,69 @@ var tools = {
13912
14180
  since: exports_external.string().optional().describe("Only show activity after this ISO date")
13913
14181
  }),
13914
14182
  execute: async (client, input) => unwrap2(await client.activity.ai(input))
13915
- },
13916
- devpad_blog_posts_list: {
14183
+ }),
14184
+ devpad_blog_posts_list: define_tool({
13917
14185
  name: "devpad_blog_posts_list",
13918
14186
  description: "List blog posts with optional filters",
13919
- inputSchema: exports_external.object({
13920
- category: exports_external.string().optional().describe("Filter by category"),
13921
- tag: exports_external.string().optional().describe("Filter by tag"),
13922
- project: exports_external.string().optional().describe("Filter by project ID"),
13923
- status: exports_external.enum(["draft", "published"]).optional().describe("Filter by status"),
13924
- archived: exports_external.boolean().optional().describe("Filter by archived state"),
13925
- limit: exports_external.number().optional().describe("Max posts to return"),
13926
- offset: exports_external.number().optional().describe("Offset for pagination"),
13927
- sort: exports_external.string().optional().describe("Sort order")
13928
- }),
14187
+ inputSchema: PostListParamsSchema.partial(),
13929
14188
  execute: async (client, input) => unwrap2(await client.blog.posts.list(input))
13930
- },
13931
- devpad_blog_posts_get: {
14189
+ }),
14190
+ devpad_blog_posts_get: define_tool({
13932
14191
  name: "devpad_blog_posts_get",
13933
14192
  description: "Get a blog post by slug",
13934
14193
  inputSchema: exports_external.object({
13935
14194
  slug: exports_external.string().describe("Post slug")
13936
14195
  }),
13937
14196
  execute: async (client, input) => unwrap2(await client.blog.posts.getBySlug(input.slug))
13938
- },
13939
- devpad_blog_posts_create: {
14197
+ }),
14198
+ devpad_blog_posts_create: define_tool({
13940
14199
  name: "devpad_blog_posts_create",
13941
14200
  description: "Create a new blog post",
13942
- inputSchema: exports_external.object({
13943
- title: exports_external.string().describe("Post title"),
13944
- content: exports_external.string().describe("Post content"),
13945
- format: exports_external.enum(["markdown", "html"]).describe("Content format"),
13946
- slug: exports_external.string().optional().describe("Custom slug"),
13947
- category: exports_external.string().optional().describe("Category name"),
13948
- tags: exports_external.array(exports_external.string()).optional().describe("Tag names"),
13949
- description: exports_external.string().optional().describe("Post description"),
13950
- publish_at: exports_external.string().optional().describe("Scheduled publish date (ISO string)"),
13951
- project_ids: exports_external.array(exports_external.string()).optional().describe("Associated project IDs"),
13952
- archived: exports_external.boolean().optional().describe("Whether post is archived")
13953
- }),
14201
+ inputSchema: PostCreateSchema,
13954
14202
  execute: async (client, input) => unwrap2(await client.blog.posts.create(input))
13955
- },
13956
- devpad_blog_posts_update: {
14203
+ }),
14204
+ devpad_blog_posts_update: define_tool({
13957
14205
  name: "devpad_blog_posts_update",
13958
14206
  description: "Update a blog post by UUID",
13959
- inputSchema: exports_external.object({
13960
- uuid: exports_external.string().describe("Post UUID"),
13961
- title: exports_external.string().optional().describe("Post title"),
13962
- content: exports_external.string().optional().describe("Post content"),
13963
- format: exports_external.enum(["markdown", "html"]).optional().describe("Content format"),
13964
- slug: exports_external.string().optional().describe("Custom slug"),
13965
- category: exports_external.string().optional().describe("Category name"),
13966
- tags: exports_external.array(exports_external.string()).optional().describe("Tag names"),
13967
- description: exports_external.string().optional().describe("Post description"),
13968
- publish_at: exports_external.string().optional().describe("Scheduled publish date (ISO string)"),
13969
- project_ids: exports_external.array(exports_external.string()).optional().describe("Associated project IDs"),
13970
- archived: exports_external.boolean().optional().describe("Whether post is archived")
13971
- }),
14207
+ inputSchema: PostUpdateSchema.extend({ uuid: exports_external.string().describe("Post UUID") }),
13972
14208
  execute: async (client, input) => {
13973
14209
  const { uuid, ...data } = input;
13974
14210
  return unwrap2(await client.blog.posts.update(uuid, data));
13975
14211
  }
13976
- },
13977
- devpad_blog_posts_delete: {
14212
+ }),
14213
+ devpad_blog_posts_delete: define_tool({
13978
14214
  name: "devpad_blog_posts_delete",
13979
14215
  description: "Delete a blog post by UUID",
13980
14216
  inputSchema: exports_external.object({
13981
14217
  uuid: exports_external.string().describe("Post UUID")
13982
14218
  }),
13983
14219
  execute: async (client, input) => unwrap2(await client.blog.posts.delete(input.uuid))
13984
- },
13985
- devpad_blog_tags_list: {
14220
+ }),
14221
+ devpad_blog_tags_list: define_tool({
13986
14222
  name: "devpad_blog_tags_list",
13987
14223
  description: "List all blog tags with post counts",
13988
14224
  inputSchema: exports_external.object({}),
13989
14225
  execute: async (client) => unwrap2(await client.blog.tags.list())
13990
- },
13991
- devpad_blog_categories_tree: {
14226
+ }),
14227
+ devpad_blog_categories_tree: define_tool({
13992
14228
  name: "devpad_blog_categories_tree",
13993
14229
  description: "Get the blog category tree",
13994
14230
  inputSchema: exports_external.object({}),
13995
14231
  execute: async (client) => unwrap2(await client.blog.categories.tree())
13996
- },
13997
- devpad_blog_categories_create: {
14232
+ }),
14233
+ devpad_blog_categories_create: define_tool({
13998
14234
  name: "devpad_blog_categories_create",
13999
14235
  description: "Create a blog category",
14000
- inputSchema: exports_external.object({
14001
- name: exports_external.string().describe("Category name"),
14002
- parent: exports_external.string().optional().describe("Parent category name")
14003
- }),
14236
+ inputSchema: CategoryCreateSchema,
14004
14237
  execute: async (client, input) => unwrap2(await client.blog.categories.create(input))
14005
- },
14006
- devpad_blog_tokens_list: {
14238
+ }),
14239
+ devpad_blog_tokens_list: define_tool({
14007
14240
  name: "devpad_blog_tokens_list",
14008
14241
  description: "List blog access tokens",
14009
14242
  inputSchema: exports_external.object({}),
14010
14243
  execute: async (client) => unwrap2(await client.blog.tokens.list())
14011
- },
14012
- devpad_blog_tokens_create: {
14244
+ }),
14245
+ devpad_blog_tokens_create: define_tool({
14013
14246
  name: "devpad_blog_tokens_create",
14014
14247
  description: "Create a blog access token",
14015
14248
  inputSchema: exports_external.object({
@@ -14017,14 +14250,14 @@ var tools = {
14017
14250
  note: exports_external.string().optional().describe("Optional note")
14018
14251
  }),
14019
14252
  execute: async (client, input) => unwrap2(await client.blog.tokens.create(input))
14020
- },
14021
- devpad_media_profiles_list: {
14253
+ }),
14254
+ devpad_media_profiles_list: define_tool({
14022
14255
  name: "devpad_media_profiles_list",
14023
14256
  description: "List media profiles",
14024
14257
  inputSchema: exports_external.object({}),
14025
14258
  execute: async (client) => unwrap2(await client.media.profiles.list())
14026
- },
14027
- devpad_media_profiles_create: {
14259
+ }),
14260
+ devpad_media_profiles_create: define_tool({
14028
14261
  name: "devpad_media_profiles_create",
14029
14262
  description: "Create a media profile",
14030
14263
  inputSchema: exports_external.object({
@@ -14032,16 +14265,16 @@ var tools = {
14032
14265
  slug: exports_external.string().describe("Profile slug")
14033
14266
  }),
14034
14267
  execute: async (client, input) => unwrap2(await client.media.profiles.create(input))
14035
- },
14036
- devpad_media_profiles_get: {
14268
+ }),
14269
+ devpad_media_profiles_get: define_tool({
14037
14270
  name: "devpad_media_profiles_get",
14038
14271
  description: "Get a media profile by ID",
14039
14272
  inputSchema: exports_external.object({
14040
14273
  id: exports_external.string().describe("Profile ID")
14041
14274
  }),
14042
14275
  execute: async (client, input) => unwrap2(await client.media.profiles.get(input.id))
14043
- },
14044
- devpad_media_profiles_update: {
14276
+ }),
14277
+ devpad_media_profiles_update: define_tool({
14045
14278
  name: "devpad_media_profiles_update",
14046
14279
  description: "Update a media profile by ID",
14047
14280
  inputSchema: exports_external.object({
@@ -14053,32 +14286,32 @@ var tools = {
14053
14286
  const { id: id2, ...data } = input;
14054
14287
  return unwrap2(await client.media.profiles.update(id2, data));
14055
14288
  }
14056
- },
14057
- devpad_media_profiles_delete: {
14289
+ }),
14290
+ devpad_media_profiles_delete: define_tool({
14058
14291
  name: "devpad_media_profiles_delete",
14059
14292
  description: "Delete a media profile by ID",
14060
14293
  inputSchema: exports_external.object({
14061
14294
  id: exports_external.string().describe("Profile ID")
14062
14295
  }),
14063
14296
  execute: async (client, input) => unwrap2(await client.media.profiles.delete(input.id))
14064
- },
14065
- devpad_media_connections_list: {
14297
+ }),
14298
+ devpad_media_connections_list: define_tool({
14066
14299
  name: "devpad_media_connections_list",
14067
14300
  description: "List connections for a media profile",
14068
14301
  inputSchema: exports_external.object({
14069
14302
  profile_id: exports_external.string().describe("Profile ID")
14070
14303
  }),
14071
14304
  execute: async (client, input) => unwrap2(await client.media.connections.list(input.profile_id))
14072
- },
14073
- devpad_media_connections_refresh: {
14305
+ }),
14306
+ devpad_media_connections_refresh: define_tool({
14074
14307
  name: "devpad_media_connections_refresh",
14075
14308
  description: "Refresh a media connection",
14076
14309
  inputSchema: exports_external.object({
14077
14310
  account_id: exports_external.string().describe("Account/connection ID")
14078
14311
  }),
14079
14312
  execute: async (client, input) => unwrap2(await client.media.connections.refresh(input.account_id))
14080
- },
14081
- devpad_media_timeline_get: {
14313
+ }),
14314
+ devpad_media_timeline_get: define_tool({
14082
14315
  name: "devpad_media_timeline_get",
14083
14316
  description: "Get media timeline for a user",
14084
14317
  inputSchema: exports_external.object({
@@ -14090,8 +14323,8 @@ var tools = {
14090
14323
  const { user_id, ...params } = input;
14091
14324
  return unwrap2(await client.media.timeline.get(user_id, params));
14092
14325
  }
14093
- },
14094
- devpad_pulse_summary: {
14326
+ }),
14327
+ devpad_pulse_summary: define_tool({
14095
14328
  name: "devpad_pulse_summary",
14096
14329
  description: "Get summary analytics for a project (pageviews, sessions, errors, latency)",
14097
14330
  inputSchema: exports_external.object({
@@ -14099,8 +14332,8 @@ var tools = {
14099
14332
  range: exports_external.enum(["24h", "7d", "30d", "90d"]).describe("Time range")
14100
14333
  }),
14101
14334
  execute: async (client, input) => unwrap2(await client.pulse.summary({ project_id: input.project_id, range: input.range }))
14102
- },
14103
- devpad_pulse_events: {
14335
+ }),
14336
+ devpad_pulse_events: define_tool({
14104
14337
  name: "devpad_pulse_events",
14105
14338
  description: "List events for a project with optional filtering",
14106
14339
  inputSchema: exports_external.object({
@@ -14114,8 +14347,8 @@ var tools = {
14114
14347
  cursor: exports_external.string().optional().describe("Pagination cursor")
14115
14348
  }),
14116
14349
  execute: async (client, input) => unwrap2(await client.pulse.events(input))
14117
- },
14118
- devpad_pulse_errors: {
14350
+ }),
14351
+ devpad_pulse_errors: define_tool({
14119
14352
  name: "devpad_pulse_errors",
14120
14353
  description: "List error issues for a project, optionally grouped by fingerprint",
14121
14354
  inputSchema: exports_external.object({
@@ -14128,8 +14361,8 @@ var tools = {
14128
14361
  range: input.range,
14129
14362
  group_by_fingerprint: input.group_by_fingerprint
14130
14363
  }))
14131
- },
14132
- devpad_pulse_logs: {
14364
+ }),
14365
+ devpad_pulse_logs: define_tool({
14133
14366
  name: "devpad_pulse_logs",
14134
14367
  description: "List logs for a project with optional level and message filtering",
14135
14368
  inputSchema: exports_external.object({
@@ -14139,8 +14372,8 @@ var tools = {
14139
14372
  search: exports_external.string().optional().describe("Search in log messages")
14140
14373
  }),
14141
14374
  execute: async (client, input) => unwrap2(await client.pulse.logs(input))
14142
- },
14143
- devpad_pulse_latency: {
14375
+ }),
14376
+ devpad_pulse_latency: define_tool({
14144
14377
  name: "devpad_pulse_latency",
14145
14378
  description: "Get request latency metrics (p50, p95, p99) for a project",
14146
14379
  inputSchema: exports_external.object({
@@ -14150,16 +14383,16 @@ var tools = {
14150
14383
  percentiles: exports_external.array(exports_external.number()).optional().describe("Percentiles to compute (default [50, 95, 99])")
14151
14384
  }),
14152
14385
  execute: async (client, input) => unwrap2(await client.pulse.latency(input))
14153
- },
14154
- devpad_alerts_list: {
14386
+ }),
14387
+ devpad_alerts_list: define_tool({
14155
14388
  name: "devpad_alerts_list",
14156
14389
  description: "List notification subscriptions (alerts) for a project",
14157
14390
  inputSchema: exports_external.object({
14158
14391
  project_id: exports_external.string().describe("Project ID")
14159
14392
  }),
14160
14393
  execute: async (client, input) => unwrap2(await client.pulse.subs.list(input))
14161
- },
14162
- devpad_alerts_subscribe: {
14394
+ }),
14395
+ devpad_alerts_subscribe: define_tool({
14163
14396
  name: "devpad_alerts_subscribe",
14164
14397
  description: "Create a new notification subscription (alert) for events",
14165
14398
  inputSchema: exports_external.object({
@@ -14170,16 +14403,16 @@ var tools = {
14170
14403
  cooldown_seconds: exports_external.number().optional().describe("Cooldown between notifications (default 60)")
14171
14404
  }),
14172
14405
  execute: async (client, input) => unwrap2(await client.pulse.subs.create(input))
14173
- },
14174
- devpad_alerts_unsubscribe: {
14406
+ }),
14407
+ devpad_alerts_unsubscribe: define_tool({
14175
14408
  name: "devpad_alerts_unsubscribe",
14176
14409
  description: "Delete a notification subscription by ID",
14177
14410
  inputSchema: exports_external.object({
14178
14411
  id: exports_external.string().describe("Subscription ID")
14179
14412
  }),
14180
14413
  execute: async (client, input) => unwrap2(await client.pulse.subs.delete(input.id))
14181
- },
14182
- devpad_pulse_key_create: {
14414
+ }),
14415
+ devpad_pulse_key_create: define_tool({
14183
14416
  name: "devpad_pulse_key_create",
14184
14417
  description: "Create a new ingest key for a project (returns plaintext once)",
14185
14418
  inputSchema: exports_external.object({
@@ -14188,8 +14421,8 @@ var tools = {
14188
14421
  rate_limit_per_min: exports_external.number().optional().describe("Rate limit in requests per minute (default 600)")
14189
14422
  }),
14190
14423
  execute: async (client, input) => unwrap2(await client.pulse.keys.create(input))
14191
- },
14192
- devpad_pipelines_list: {
14424
+ }),
14425
+ devpad_pipelines_list: define_tool({
14193
14426
  name: "devpad_pipelines_list",
14194
14427
  description: "List pipeline runs (newest first). Optionally filter by package and/or status; cap limit at 200.",
14195
14428
  inputSchema: exports_external.object({
@@ -14198,16 +14431,16 @@ var tools = {
14198
14431
  limit: exports_external.number().int().positive().max(200).optional().describe("Max rows to return (default 50, cap 200)")
14199
14432
  }),
14200
14433
  execute: async (client, input) => unwrap2(await client.pipelines.list(input))
14201
- },
14202
- devpad_pipelines_get: {
14434
+ }),
14435
+ devpad_pipelines_get: define_tool({
14203
14436
  name: "devpad_pipelines_get",
14204
14437
  description: "Get a pipeline run by ID",
14205
14438
  inputSchema: exports_external.object({
14206
14439
  run_id: exports_external.string().describe("Pipeline run ID")
14207
14440
  }),
14208
14441
  execute: async (client, input) => unwrap2(await client.pipelines.get(input.run_id))
14209
- },
14210
- devpad_pipelines_create: {
14442
+ }),
14443
+ devpad_pipelines_create: define_tool({
14211
14444
  name: "devpad_pipelines_create",
14212
14445
  description: "Create a new pipeline run",
14213
14446
  inputSchema: exports_external.object({
@@ -14215,8 +14448,8 @@ var tools = {
14215
14448
  version_set_id: exports_external.string().describe("Version set ID to deploy")
14216
14449
  }),
14217
14450
  execute: async (client, input) => unwrap2(await client.pipelines.create(input))
14218
- },
14219
- devpad_pipelines_approve: {
14451
+ }),
14452
+ devpad_pipelines_approve: define_tool({
14220
14453
  name: "devpad_pipelines_approve",
14221
14454
  description: "Approve or deny a stage in a pipeline run",
14222
14455
  inputSchema: exports_external.object({
@@ -14230,8 +14463,8 @@ var tools = {
14230
14463
  unwrap2(await client.pipelines.approve(input.run_id, input));
14231
14464
  return { success: true };
14232
14465
  }
14233
- },
14234
- devpad_pipelines_cancel: {
14466
+ }),
14467
+ devpad_pipelines_cancel: define_tool({
14235
14468
  name: "devpad_pipelines_cancel",
14236
14469
  description: "Cancel a pipeline run",
14237
14470
  inputSchema: exports_external.object({
@@ -14241,8 +14474,8 @@ var tools = {
14241
14474
  unwrap2(await client.pipelines.cancel(input.run_id));
14242
14475
  return { success: true };
14243
14476
  }
14244
- },
14245
- devpad_pipelines_rollback: {
14477
+ }),
14478
+ devpad_pipelines_rollback: define_tool({
14246
14479
  name: "devpad_pipelines_rollback",
14247
14480
  description: "Rollback a completed or failed pipeline run",
14248
14481
  inputSchema: exports_external.object({
@@ -14252,8 +14485,8 @@ var tools = {
14252
14485
  unwrap2(await client.pipelines.rollback(input.run_id));
14253
14486
  return { success: true };
14254
14487
  }
14255
- },
14256
- devpad_pipelines_runs_events_ingest: {
14488
+ }),
14489
+ devpad_pipelines_runs_events_ingest: define_tool({
14257
14490
  name: "devpad_pipelines_runs_events_ingest",
14258
14491
  description: 'Ingest an external webhook event against an in-flight pipeline run. Idempotent on (idempotency_key, payload). Server-side stamps payload.source = "external".',
14259
14492
  inputSchema: exports_external.object({
@@ -14269,24 +14502,24 @@ var tools = {
14269
14502
  payload: input.payload,
14270
14503
  idempotency_key: input.idempotency_key
14271
14504
  }))
14272
- },
14273
- devpad_pipelines_runs_events_list: {
14505
+ }),
14506
+ devpad_pipelines_runs_events_list: define_tool({
14274
14507
  name: "devpad_pipelines_runs_events_list",
14275
14508
  description: "List stored stage events for a pipeline run, newest-first",
14276
14509
  inputSchema: exports_external.object({
14277
14510
  run_id: exports_external.string().describe("Pipeline run ID")
14278
14511
  }),
14279
14512
  execute: async (client, input) => unwrap2(await client.pipelines.events.list(input.run_id))
14280
- },
14281
- devpad_pipelines_grants_list: {
14513
+ }),
14514
+ devpad_pipelines_grants_list: define_tool({
14282
14515
  name: "devpad_pipelines_grants_list",
14283
14516
  description: "List vault grants for a pipeline package",
14284
14517
  inputSchema: exports_external.object({
14285
14518
  package_id: exports_external.string().describe("Package ID to filter grants by")
14286
14519
  }),
14287
14520
  execute: async (client, input) => unwrap2(await client.pipelines.grants.list(input.package_id))
14288
- },
14289
- devpad_pipelines_grants_approve: {
14521
+ }),
14522
+ devpad_pipelines_grants_approve: define_tool({
14290
14523
  name: "devpad_pipelines_grants_approve",
14291
14524
  description: "Approve a pending vault grant request for a pipeline package",
14292
14525
  inputSchema: exports_external.object({
@@ -14294,8 +14527,8 @@ var tools = {
14294
14527
  user_id: exports_external.string().describe("User ID making the approval decision")
14295
14528
  }),
14296
14529
  execute: async (client, input) => unwrap2(await client.pipelines.grants.approve(input.grant_id, input.user_id))
14297
- },
14298
- devpad_pipelines_grants_deny: {
14530
+ }),
14531
+ devpad_pipelines_grants_deny: define_tool({
14299
14532
  name: "devpad_pipelines_grants_deny",
14300
14533
  description: "Deny a pending vault grant request for a pipeline package",
14301
14534
  inputSchema: exports_external.object({
@@ -14304,24 +14537,24 @@ var tools = {
14304
14537
  reason: exports_external.string().optional().describe("Optional reason for the denial")
14305
14538
  }),
14306
14539
  execute: async (client, input) => unwrap2(await client.pipelines.grants.deny(input.grant_id, input.user_id, input.reason))
14307
- },
14308
- devpad_pipelines_packages_list: {
14540
+ }),
14541
+ devpad_pipelines_packages_list: define_tool({
14309
14542
  name: "devpad_pipelines_packages_list",
14310
14543
  description: "List pipeline packages. Optionally filter by linked devpad project_id; unlinked packages have project_id = null.",
14311
14544
  inputSchema: exports_external.object({
14312
14545
  project_id: exports_external.string().optional().describe("Filter packages by linked devpad project")
14313
14546
  }),
14314
14547
  execute: async (client, input) => unwrap2(await client.pipelines.packages.list(input))
14315
- },
14316
- devpad_pipelines_packages_get: {
14548
+ }),
14549
+ devpad_pipelines_packages_get: define_tool({
14317
14550
  name: "devpad_pipelines_packages_get",
14318
14551
  description: "Get a pipeline package by ID",
14319
14552
  inputSchema: exports_external.object({
14320
14553
  package_id: exports_external.string().describe("Pipeline package ID")
14321
14554
  }),
14322
14555
  execute: async (client, input) => unwrap2(await client.pipelines.packages.get(input.package_id))
14323
- },
14324
- devpad_pipelines_packages_create: {
14556
+ }),
14557
+ devpad_pipelines_packages_create: define_tool({
14325
14558
  name: "devpad_pipelines_packages_create",
14326
14559
  description: "Register a new pipeline-managed package. By convention `id` equals the package `name`. `project_id` optionally links the package to a devpad project.",
14327
14560
  inputSchema: exports_external.object({
@@ -14333,8 +14566,8 @@ var tools = {
14333
14566
  default_template_ref: exports_external.string().optional().describe("Optional default pipeline template ref")
14334
14567
  }),
14335
14568
  execute: async (client, input) => unwrap2(await client.pipelines.packages.create(input))
14336
- },
14337
- devpad_pipelines_packages_update: {
14569
+ }),
14570
+ devpad_pipelines_packages_update: define_tool({
14338
14571
  name: "devpad_pipelines_packages_update",
14339
14572
  description: "Partially update a pipeline package. Only the provided fields are touched.",
14340
14573
  inputSchema: exports_external.object({
@@ -14348,24 +14581,24 @@ var tools = {
14348
14581
  const { id: id2, ...patch } = input;
14349
14582
  return unwrap2(await client.pipelines.packages.update(id2, patch));
14350
14583
  }
14351
- },
14352
- devpad_pipelines_packages_delete: {
14584
+ }),
14585
+ devpad_pipelines_packages_delete: define_tool({
14353
14586
  name: "devpad_pipelines_packages_delete",
14354
14587
  description: "Delete a pipeline package. Refuses with conflict if existing pipeline_run rows still reference the package.",
14355
14588
  inputSchema: exports_external.object({
14356
14589
  id: exports_external.string().describe("Pipeline package ID")
14357
14590
  }),
14358
14591
  execute: async (client, input) => unwrap2(await client.pipelines.packages.delete(input.id))
14359
- },
14360
- devpad_pipelines_analysis_templates_list: {
14592
+ }),
14593
+ devpad_pipelines_analysis_templates_list: define_tool({
14361
14594
  name: "devpad_pipelines_analysis_templates_list",
14362
14595
  description: "List pipeline analysis templates for an owner. Each row encodes the threshold DSL + window referenced by analysis-gate evaluations.",
14363
14596
  inputSchema: exports_external.object({
14364
14597
  owner_id: exports_external.string().describe("Devpad user ID whose templates to list")
14365
14598
  }),
14366
14599
  execute: async (client, input) => unwrap2(await client.pipelines.analysis_templates.list(input))
14367
- },
14368
- devpad_pipelines_analysis_templates_get: {
14600
+ }),
14601
+ devpad_pipelines_analysis_templates_get: define_tool({
14369
14602
  name: "devpad_pipelines_analysis_templates_get",
14370
14603
  description: "Get a single pipeline analysis template by id, scoped to its owner.",
14371
14604
  inputSchema: exports_external.object({
@@ -14373,8 +14606,8 @@ var tools = {
14373
14606
  owner_id: exports_external.string().describe("Owner ID (must match the template's owner)")
14374
14607
  }),
14375
14608
  execute: async (client, input) => unwrap2(await client.pipelines.analysis_templates.get(input.id, { owner_id: input.owner_id }))
14376
- },
14377
- devpad_pipelines_analysis_templates_create: {
14609
+ }),
14610
+ devpad_pipelines_analysis_templates_create: define_tool({
14378
14611
  name: "devpad_pipelines_analysis_templates_create",
14379
14612
  description: 'Create a new pipeline analysis template. `threshold_dsl` is a multi-line DSL: `metric_name OP value [: pending]` (OPs: > < >= <= =). Trailing ": pending" marks a breach as Pending rather than Fail. Server-side parse failure surfaces as `validation_error` with field=threshold_dsl. `window_ms` defaults to 600000 (10 min).',
14380
14613
  inputSchema: exports_external.object({
@@ -14385,8 +14618,8 @@ var tools = {
14385
14618
  window_ms: exports_external.number().int().positive().optional().describe("Analysis window in milliseconds. Default: 600000")
14386
14619
  }),
14387
14620
  execute: async (client, input) => unwrap2(await client.pipelines.analysis_templates.create(input))
14388
- },
14389
- devpad_pipelines_analysis_templates_update: {
14621
+ }),
14622
+ devpad_pipelines_analysis_templates_update: define_tool({
14390
14623
  name: "devpad_pipelines_analysis_templates_update",
14391
14624
  description: "Partially update a pipeline analysis template. Only the supplied fields are touched. Re-validates threshold_dsl when present.",
14392
14625
  inputSchema: exports_external.object({
@@ -14401,8 +14634,8 @@ var tools = {
14401
14634
  const { id: id2, ...patch } = input;
14402
14635
  return unwrap2(await client.pipelines.analysis_templates.update(id2, patch));
14403
14636
  }
14404
- },
14405
- devpad_pipelines_analysis_templates_delete: {
14637
+ }),
14638
+ devpad_pipelines_analysis_templates_delete: define_tool({
14406
14639
  name: "devpad_pipelines_analysis_templates_delete",
14407
14640
  description: "Hard-delete a pipeline analysis template. Does NOT consult pipeline_run.resolved_gates — runs snapshot their gate template at resolve-time, so deletion never orphans in-flight runs.",
14408
14641
  inputSchema: exports_external.object({
@@ -14410,16 +14643,16 @@ var tools = {
14410
14643
  owner_id: exports_external.string().describe("Owner ID (must match the template's owner)")
14411
14644
  }),
14412
14645
  execute: async (client, input) => unwrap2(await client.pipelines.analysis_templates.delete(input.id, { owner_id: input.owner_id }))
14413
- },
14414
- devpad_pipelines_oidc_trust_list: {
14646
+ }),
14647
+ devpad_pipelines_oidc_trust_list: define_tool({
14415
14648
  name: "devpad_pipelines_oidc_trust_list",
14416
14649
  description: "List GitHub Actions OIDC trust policies for an owner. Returned ordered by created_at DESC, id ASC to match the orchestrator's trust-matcher resolution order.",
14417
14650
  inputSchema: exports_external.object({
14418
14651
  owner_id: exports_external.string().describe("User ID whose trust policies to list")
14419
14652
  }),
14420
14653
  execute: async (client, input) => unwrap2(await client.pipelines.oidc_trust.list(input))
14421
- },
14422
- devpad_pipelines_oidc_trust_create: {
14654
+ }),
14655
+ devpad_pipelines_oidc_trust_create: define_tool({
14423
14656
  name: "devpad_pipelines_oidc_trust_create",
14424
14657
  description: 'Create a GitHub Actions OIDC trust policy. Authorises CI in repos owned by `github_owner` (filtered by `repo_pattern` and optional ref/environment lists) to mint orchestrator session tokens. Defaults: repo_pattern="*", allowed_actions=["artifacts:upload","runs:start"], session_ttl_seconds=900.',
14425
14658
  inputSchema: exports_external.object({
@@ -14433,8 +14666,8 @@ var tools = {
14433
14666
  session_ttl_seconds: exports_external.number().int().positive().optional().describe("Session token TTL. Default: 900 (15 min)")
14434
14667
  }),
14435
14668
  execute: async (client, input) => unwrap2(await client.pipelines.oidc_trust.create(input))
14436
- },
14437
- devpad_pipelines_oidc_trust_update: {
14669
+ }),
14670
+ devpad_pipelines_oidc_trust_update: define_tool({
14438
14671
  name: "devpad_pipelines_oidc_trust_update",
14439
14672
  description: "Partially update a GitHub Actions OIDC trust policy. Only the supplied fields are touched; validation runs server-side against the merged record.",
14440
14673
  inputSchema: exports_external.object({
@@ -14452,8 +14685,8 @@ var tools = {
14452
14685
  const { id: id2, ...patch } = input;
14453
14686
  return unwrap2(await client.pipelines.oidc_trust.update(id2, patch));
14454
14687
  }
14455
- },
14456
- devpad_pipelines_oidc_trust_delete: {
14688
+ }),
14689
+ devpad_pipelines_oidc_trust_delete: define_tool({
14457
14690
  name: "devpad_pipelines_oidc_trust_delete",
14458
14691
  description: "Soft-delete a GitHub Actions OIDC trust policy. The row is preserved for audit; the matcher and list operations skip soft-deleted rows.",
14459
14692
  inputSchema: exports_external.object({
@@ -14461,7 +14694,7 @@ var tools = {
14461
14694
  owner_id: exports_external.string().describe("Owner ID (must match the policy's owner)")
14462
14695
  }),
14463
14696
  execute: async (client, input) => unwrap2(await client.pipelines.oidc_trust.delete(input.id, { owner_id: input.owner_id }))
14464
- }
14697
+ })
14465
14698
  };
14466
14699
  var toolNames = Object.keys(tools);
14467
14700
  function getTool(name) {
@@ -21753,7 +21986,7 @@ function zodToMCPSchema(schema) {
21753
21986
  target: "openApi3",
21754
21987
  $refStrategy: "none"
21755
21988
  });
21756
- const { $schema, ...cleanSchema } = jsonSchema;
21989
+ const { $schema: _, ...cleanSchema } = jsonSchema;
21757
21990
  if (jsonSchema.type === "object")
21758
21991
  return jsonSchema;
21759
21992
  return {
@@ -21763,7 +21996,7 @@ function zodToMCPSchema(schema) {
21763
21996
  },
21764
21997
  required: []
21765
21998
  };
21766
- } catch (error2) {
21999
+ } catch {
21767
22000
  return {
21768
22001
  type: "object",
21769
22002
  properties: {},
@@ -21774,7 +22007,7 @@ function zodToMCPSchema(schema) {
21774
22007
  function assertObjectRootSchema(tools2) {
21775
22008
  tools2.forEach((tool, i) => {
21776
22009
  if (tool.inputSchema.type !== "object") {
21777
- console.error(`! Tool ${i} (${tool.name}) has non-object root type: ${tool.inputSchema.type}`);
22010
+ console.error(`! Tool ${String(i)} (${tool.name}) has non-object root type: ${String(tool.inputSchema.type)}`);
21778
22011
  }
21779
22012
  });
21780
22013
  return tools2;
@@ -21854,7 +22087,10 @@ class DevpadMCPServer {
21854
22087
  if (request.method === "tools/list") {
21855
22088
  result = { tools: tools2 };
21856
22089
  } else if (request.method === "tools/call") {
21857
- const { name, arguments: args } = request.params;
22090
+ const params = request.params;
22091
+ if (!params)
22092
+ throw new Error("Missing params for tools/call");
22093
+ const { name, arguments: args } = params;
21858
22094
  const tool = getTool(name);
21859
22095
  if (!tool) {
21860
22096
  throw new Error(`Unknown tool: ${name}`);