@devpad/mcp 2.3.4 → 2.3.6

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 +470 -15
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -12265,7 +12265,7 @@ var coerce = {
12265
12265
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
12266
12266
  };
12267
12267
  var NEVER = INVALID;
12268
- // ../api/dist/chunk-XHTCNYWS.js
12268
+ // ../api/dist/chunk-KRYLGBPJ.js
12269
12269
  var timestamps = () => ({
12270
12270
  created_at: text("created_at").notNull().default(sql`(CURRENT_TIMESTAMP)`),
12271
12271
  updated_at: text("updated_at").notNull().default(sql`(CURRENT_TIMESTAMP)`)
@@ -12316,6 +12316,7 @@ var api_keys = sqliteTable("api_keys", {
12316
12316
  name: text("name"),
12317
12317
  note: text("note"),
12318
12318
  scope: text("scope", { enum: ["devpad", "blog", "media", "pulse", "all"] }).notNull().default("all"),
12319
+ project_id: text("project_id").references(() => project.id),
12319
12320
  enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
12320
12321
  last_used_at: text("last_used_at"),
12321
12322
  ...timestamps(),
@@ -12335,7 +12336,8 @@ var project = sqliteTable("project", {
12335
12336
  link_text: text("link_text"),
12336
12337
  visibility: text("visibility", { enum: ["PUBLIC", "PRIVATE", "HIDDEN", "ARCHIVED", "DRAFT", "DELETED"] }).notNull().default("PRIVATE"),
12337
12338
  current_version: text("current_version"),
12338
- scan_branch: text("scan_branch")
12339
+ scan_branch: text("scan_branch"),
12340
+ github_autoclose: integer("github_autoclose", { mode: "boolean" }).notNull().default(false)
12339
12341
  });
12340
12342
  var ACTIONS = [
12341
12343
  "CREATE_TASK",
@@ -12355,7 +12357,8 @@ var ACTIONS = [
12355
12357
  "DELETE_MILESTONE",
12356
12358
  "CREATE_CHECKLIST",
12357
12359
  "UPDATE_CHECKLIST",
12358
- "DELETE_CHECKLIST"
12360
+ "DELETE_CHECKLIST",
12361
+ "ADVANCE_STAGE"
12359
12362
  ];
12360
12363
  var action = sqliteTable("action", {
12361
12364
  ...owned_entity("action"),
@@ -12410,6 +12413,7 @@ var TASK_KINDS = ["task", "phase", "approval"];
12410
12413
  var COMPLETION_POLICIES = ["manual", "auto_children"];
12411
12414
  var COMPLETED_VIA_VALUES = ["user", "api", "policy"];
12412
12415
  var TASK_LINK_KINDS = ["blocks", "relates_to", "references", "discovered_from", "tracks_metric"];
12416
+ var SDLC_STAGES = ["ideate", "plan", "build", "review", "deploy", "live"];
12413
12417
  var task = sqliteTable("task", {
12414
12418
  ...owned_entity("task"),
12415
12419
  title: text("title").notNull(),
@@ -12430,7 +12434,8 @@ var task = sqliteTable("task", {
12430
12434
  completion_policy: text("completion_policy", { enum: COMPLETION_POLICIES }).notNull().default("manual"),
12431
12435
  completed_via: text("completed_via", { enum: COMPLETED_VIA_VALUES }),
12432
12436
  claimed_by: text("claimed_by"),
12433
- claimed_at: text("claimed_at")
12437
+ claimed_at: text("claimed_at"),
12438
+ stage: text("stage", { enum: SDLC_STAGES })
12434
12439
  }, (table) => [index("task_parent_id_idx").on(table.parent_id)]);
12435
12440
  var task_link = sqliteTable("task_link", {
12436
12441
  ...entity("link"),
@@ -12467,7 +12472,13 @@ var TASK_EVENT_KINDS = [
12467
12472
  "edge.removed",
12468
12473
  "node.children_all_done",
12469
12474
  "policy.fired",
12470
- "node.completion_stale"
12475
+ "node.completion_stale",
12476
+ "doc.pushed",
12477
+ "thread.opened",
12478
+ "thread.resolved",
12479
+ "signoff.requested",
12480
+ "signoff.decided",
12481
+ "stage.advanced"
12471
12482
  ];
12472
12483
  var TASK_EVENT_ACTORS = ["user", "api", "policy", "github"];
12473
12484
  var TASK_EVENT_DISPATCH_STATUSES = ["pending", "dispatched"];
@@ -12486,6 +12497,74 @@ var task_event = sqliteTable("task_event", {
12486
12497
  index("task_event_subject_id_idx").on(table.subject_id),
12487
12498
  index("task_event_dispatch_status_idx").on(table.dispatch_status)
12488
12499
  ]);
12500
+ var hook = sqliteTable("hook", {
12501
+ ...entity("hook"),
12502
+ project_id: text("project_id").notNull().references(() => project.id),
12503
+ enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
12504
+ trigger: text("trigger", { mode: "json" }).notNull(),
12505
+ action: text("action", { mode: "json" }).notNull()
12506
+ }, (table) => [index("hook_project_id_idx").on(table.project_id)]);
12507
+ var HOOK_DELIVERY_STATUSES = ["pending", "delivered", "failed_transient", "failed_permanent"];
12508
+ var hook_delivery = sqliteTable("hook_delivery", {
12509
+ id: text("id").primaryKey(),
12510
+ hook_id: text("hook_id").notNull().references(() => hook.id),
12511
+ event_id: text("event_id").notNull(),
12512
+ status: text("status", { enum: HOOK_DELIVERY_STATUSES }).notNull().default("pending"),
12513
+ attempts: integer("attempts").notNull().default(0),
12514
+ last_error: text("last_error"),
12515
+ ...timestamps()
12516
+ }, (table) => [
12517
+ index("hook_delivery_hook_id_idx").on(table.hook_id),
12518
+ index("hook_delivery_status_idx").on(table.status)
12519
+ ]);
12520
+ var github_webhook_event = sqliteTable("github_webhook_event", {
12521
+ id: text("id").primaryKey(),
12522
+ delivery_guid: text("delivery_guid").notNull(),
12523
+ event_type: text("event_type").notNull(),
12524
+ processed_at: text("processed_at").notNull().default(sql`(CURRENT_TIMESTAMP)`)
12525
+ }, (table) => [index("github_webhook_event_delivery_guid_idx").on(table.delivery_guid)]);
12526
+ var DOCUMENT_KINDS = ["plan", "design", "interface"];
12527
+ var DOCUMENT_STATUSES = ["draft", "in_review", "approved"];
12528
+ var document = sqliteTable("document", {
12529
+ ...entity("doc"),
12530
+ project_id: text("project_id").notNull().references(() => project.id),
12531
+ task_id: text("task_id").references(() => task.id),
12532
+ kind: text("kind", { enum: DOCUMENT_KINDS }).notNull(),
12533
+ title: text("title").notNull(),
12534
+ head_version: text("head_version"),
12535
+ status: text("status", { enum: DOCUMENT_STATUSES }).notNull().default("draft")
12536
+ }, (table) => [index("document_project_id_idx").on(table.project_id), index("document_task_id_idx").on(table.task_id)]);
12537
+ var THREAD_STATUSES = ["open", "addressed", "resolved", "orphaned"];
12538
+ var annotation_thread = sqliteTable("annotation_thread", {
12539
+ ...id("thread"),
12540
+ document_id: text("document_id").notNull().references(() => document.id),
12541
+ thread_id: text("thread_id").notNull(),
12542
+ status: text("status", { enum: THREAD_STATUSES }).notNull().default("open"),
12543
+ blocking: int("blocking", { mode: "boolean" }).notNull().default(false),
12544
+ ...timestamps()
12545
+ }, (table) => [
12546
+ unique("annotation_thread_unique").on(table.document_id, table.thread_id),
12547
+ index("annotation_thread_document_id_idx").on(table.document_id),
12548
+ index("annotation_thread_status_idx").on(table.status)
12549
+ ]);
12550
+ var SIGNOFF_SUBJECT_KINDS = ["doc_version", "stage", "pipeline_gate"];
12551
+ var SIGNOFF_CHECKPOINTS = ["plan", "types", "design"];
12552
+ var SIGNOFF_DECISIONS = ["approved", "changes_requested", "auto"];
12553
+ var signoff = sqliteTable("signoff", {
12554
+ ...entity("signoff"),
12555
+ subject_kind: text("subject_kind", { enum: SIGNOFF_SUBJECT_KINDS }).notNull(),
12556
+ subject_id: text("subject_id").notNull(),
12557
+ checkpoint: text("checkpoint", { enum: SIGNOFF_CHECKPOINTS }).notNull(),
12558
+ task_id: text("task_id").references(() => task.id),
12559
+ decision: text("decision", { enum: SIGNOFF_DECISIONS }),
12560
+ decided_by: text("decided_by").references(() => user.id),
12561
+ decided_at: text("decided_at"),
12562
+ reason: text("reason"),
12563
+ content_hash: text("content_hash")
12564
+ }, (table) => [
12565
+ index("signoff_subject_idx").on(table.subject_kind, table.subject_id),
12566
+ index("signoff_task_id_idx").on(table.task_id)
12567
+ ]);
12489
12568
  var checklist = sqliteTable("checklist", {
12490
12569
  ...entity("checklist"),
12491
12570
  task_id: text("task_id").notNull().references(() => task.id),
@@ -12679,6 +12758,13 @@ var task_rollup_relations = relations(task_rollup, ({ one }) => ({
12679
12758
  var task_event_relations = relations(task_event, ({ one }) => ({
12680
12759
  subject: one(task, { fields: [task_event.subject_id], references: [task.id] })
12681
12760
  }));
12761
+ var hook_relations = relations(hook, ({ one, many }) => ({
12762
+ project: one(project, { fields: [hook.project_id], references: [project.id] }),
12763
+ deliveries: many(hook_delivery)
12764
+ }));
12765
+ var hook_delivery_relations = relations(hook_delivery, ({ one }) => ({
12766
+ hook: one(hook, { fields: [hook_delivery.hook_id], references: [hook.id] })
12767
+ }));
12682
12768
  var checklist_relations = relations(checklist, ({ one, many }) => ({
12683
12769
  task: one(task, { fields: [checklist.task_id], references: [task.id] }),
12684
12770
  items: many(checklist_item)
@@ -12720,6 +12806,18 @@ var pipeline_analysis_template_relations = relations(pipeline_analysis_template,
12720
12806
  var pipeline_oidc_trust_relations = relations(pipeline_oidc_trust, ({ one }) => ({
12721
12807
  owner: one(user, { fields: [pipeline_oidc_trust.owner_id], references: [user.id] })
12722
12808
  }));
12809
+ var document_relations = relations(document, ({ one, many }) => ({
12810
+ project: one(project, { fields: [document.project_id], references: [project.id] }),
12811
+ task: one(task, { fields: [document.task_id], references: [task.id] }),
12812
+ threads: many(annotation_thread)
12813
+ }));
12814
+ var annotation_thread_relations = relations(annotation_thread, ({ one }) => ({
12815
+ document: one(document, { fields: [annotation_thread.document_id], references: [document.id] })
12816
+ }));
12817
+ var signoff_relations = relations(signoff, ({ one }) => ({
12818
+ task: one(task, { fields: [signoff.task_id], references: [task.id] }),
12819
+ decided_by_user: one(user, { fields: [signoff.decided_by], references: [user.id] })
12820
+ }));
12723
12821
  var upsert_project = exports_external.object({
12724
12822
  id: exports_external.string().optional().nullable(),
12725
12823
  project_id: exports_external.string(),
@@ -13051,8 +13149,153 @@ var task_event_payload = exports_external.discriminatedUnion("kind", [
13051
13149
  exports_external.object({ kind: exports_external.literal("edge.removed"), link_kind: task_link_kind, dst_id: exports_external.string().nullable() }),
13052
13150
  exports_external.object({ kind: exports_external.literal("node.children_all_done") }),
13053
13151
  exports_external.object({ kind: exports_external.literal("policy.fired"), policy: exports_external.enum(COMPLETION_POLICIES) }),
13054
- exports_external.object({ kind: exports_external.literal("node.completion_stale"), child_id: exports_external.string() })
13152
+ exports_external.object({ kind: exports_external.literal("node.completion_stale"), child_id: exports_external.string() }),
13153
+ exports_external.object({ kind: exports_external.literal("doc.pushed"), document_id: exports_external.string(), version: exports_external.string() }),
13154
+ exports_external.object({ kind: exports_external.literal("thread.opened"), document_id: exports_external.string(), thread_id: exports_external.string() }),
13155
+ exports_external.object({ kind: exports_external.literal("thread.resolved"), document_id: exports_external.string(), thread_id: exports_external.string() }),
13156
+ exports_external.object({
13157
+ kind: exports_external.literal("signoff.requested"),
13158
+ subject_kind: exports_external.enum(SIGNOFF_SUBJECT_KINDS),
13159
+ subject_id: exports_external.string(),
13160
+ checkpoint: exports_external.enum(SIGNOFF_CHECKPOINTS)
13161
+ }),
13162
+ exports_external.object({
13163
+ kind: exports_external.literal("signoff.decided"),
13164
+ subject_kind: exports_external.enum(SIGNOFF_SUBJECT_KINDS),
13165
+ subject_id: exports_external.string(),
13166
+ checkpoint: exports_external.enum(SIGNOFF_CHECKPOINTS),
13167
+ decision: exports_external.enum(SIGNOFF_DECISIONS)
13168
+ }),
13169
+ exports_external.object({
13170
+ kind: exports_external.literal("stage.advanced"),
13171
+ from: exports_external.enum(SDLC_STAGES).nullable(),
13172
+ to: exports_external.enum(SDLC_STAGES),
13173
+ override: exports_external.boolean()
13174
+ })
13175
+ ]);
13176
+ var document_kind = exports_external.enum(DOCUMENT_KINDS);
13177
+ var push_doc_request = exports_external.object({
13178
+ document_id: exports_external.string().optional(),
13179
+ project_id: exports_external.string(),
13180
+ task_id: exports_external.string().nullable().optional(),
13181
+ kind: document_kind,
13182
+ title: exports_external.string().min(1),
13183
+ html: exports_external.string()
13184
+ });
13185
+ var thread_anchor = exports_external.object({
13186
+ quote: exports_external.string().min(1),
13187
+ prefix: exports_external.string(),
13188
+ suffix: exports_external.string(),
13189
+ start: exports_external.number().int().nonnegative(),
13190
+ end: exports_external.number().int().nonnegative()
13191
+ });
13192
+ var thread_entry = exports_external.object({
13193
+ author: exports_external.string().min(1),
13194
+ channel: exports_external.enum(["user", "api"]),
13195
+ body: exports_external.string().min(1),
13196
+ at: exports_external.string()
13197
+ });
13198
+ var thread_status = exports_external.enum(THREAD_STATUSES);
13199
+ var thread_marker = exports_external.object({
13200
+ id: exports_external.string().min(1),
13201
+ anchor: thread_anchor,
13202
+ status: thread_status,
13203
+ blocking: exports_external.boolean(),
13204
+ entries: exports_external.array(thread_entry).min(1)
13205
+ });
13206
+ var create_thread_request = exports_external.object({
13207
+ quote: exports_external.string().min(1),
13208
+ prefix: exports_external.string(),
13209
+ suffix: exports_external.string(),
13210
+ start: exports_external.number().int().nonnegative(),
13211
+ end: exports_external.number().int().nonnegative(),
13212
+ body: exports_external.string().min(1),
13213
+ blocking: exports_external.boolean().optional().default(false)
13214
+ });
13215
+ var reply_thread_request = exports_external.object({ body: exports_external.string().min(1) });
13216
+ var toggle_blocking_request = exports_external.object({ blocking: exports_external.boolean() });
13217
+ var signoff_subject_kind = exports_external.enum(SIGNOFF_SUBJECT_KINDS);
13218
+ var signoff_checkpoint = exports_external.enum(SIGNOFF_CHECKPOINTS);
13219
+ var request_checkpoint_request = exports_external.object({
13220
+ project_id: exports_external.string(),
13221
+ subject_kind: signoff_subject_kind,
13222
+ subject_id: exports_external.string(),
13223
+ checkpoint: signoff_checkpoint,
13224
+ blocks: exports_external.array(exports_external.string()).default([])
13225
+ });
13226
+ var decide_checkpoint_request = exports_external.object({
13227
+ decision: exports_external.union([exports_external.literal("approved"), exports_external.literal("changes_requested")]),
13228
+ reason: exports_external.string().optional()
13229
+ });
13230
+ var sdlc_stage = exports_external.enum(SDLC_STAGES);
13231
+ var advance_stage_request = exports_external.object({
13232
+ to: sdlc_stage,
13233
+ override: exports_external.boolean().optional().default(false),
13234
+ reason: exports_external.string().optional()
13235
+ });
13236
+ var push_interface_report_request = exports_external.object({
13237
+ document_id: exports_external.string().optional(),
13238
+ project_id: exports_external.string(),
13239
+ task_id: exports_external.string().nullable().optional(),
13240
+ title: exports_external.string().min(1),
13241
+ normalized: exports_external.string()
13242
+ });
13243
+ var REVIEW_ITEM_KINDS = ["signoff", "annotation", "pipeline_gate", "scan_diff"];
13244
+ var review_item = exports_external.object({
13245
+ kind: exports_external.enum(REVIEW_ITEM_KINDS),
13246
+ subject_id: exports_external.string(),
13247
+ title: exports_external.string(),
13248
+ project_id: exports_external.string().nullable(),
13249
+ created_at: exports_external.string(),
13250
+ path: exports_external.string()
13251
+ });
13252
+ var reviews_pending_response = exports_external.object({ items: exports_external.array(review_item) });
13253
+ var hook_selector = exports_external.object({
13254
+ subject_kind: exports_external.enum(TASK_KINDS).optional(),
13255
+ tag: exports_external.string().optional(),
13256
+ ancestor_id: exports_external.string().optional()
13257
+ });
13258
+ var hook_trigger = exports_external.object({
13259
+ kinds: exports_external.array(exports_external.enum(TASK_EVENT_KINDS)).min(1),
13260
+ selector: hook_selector.default({})
13261
+ });
13262
+ var hook_action_input = exports_external.discriminatedUnion("kind", [
13263
+ exports_external.object({ kind: exports_external.literal("webhook"), url: exports_external.string().url(), secret: exports_external.string().min(1).optional() }),
13264
+ exports_external.object({
13265
+ kind: exports_external.literal("vault"),
13266
+ scope: exports_external.string().min(1),
13267
+ op: exports_external.string().min(1),
13268
+ args: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
13269
+ }),
13270
+ exports_external.object({ kind: exports_external.literal("pipeline"), package_id: exports_external.string().min(1) })
13271
+ ]);
13272
+ var hook_action_stored = exports_external.discriminatedUnion("kind", [
13273
+ exports_external.object({ kind: exports_external.literal("webhook"), url: exports_external.string().url(), secret_encrypted: exports_external.string().optional() }),
13274
+ exports_external.object({
13275
+ kind: exports_external.literal("vault"),
13276
+ scope: exports_external.string().min(1),
13277
+ op: exports_external.string().min(1),
13278
+ args: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
13279
+ }),
13280
+ exports_external.object({ kind: exports_external.literal("pipeline"), package_id: exports_external.string().min(1) })
13281
+ ]);
13282
+ var hook_action_public = exports_external.discriminatedUnion("kind", [
13283
+ exports_external.object({ kind: exports_external.literal("webhook"), url: exports_external.string().url(), has_secret: exports_external.boolean() }),
13284
+ exports_external.object({
13285
+ kind: exports_external.literal("vault"),
13286
+ scope: exports_external.string().min(1),
13287
+ op: exports_external.string().min(1),
13288
+ args: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
13289
+ }),
13290
+ exports_external.object({ kind: exports_external.literal("pipeline"), package_id: exports_external.string().min(1) })
13055
13291
  ]);
13292
+ var upsert_hook = exports_external.object({
13293
+ id: exports_external.string().optional(),
13294
+ project_id: exports_external.string(),
13295
+ enabled: exports_external.boolean().default(true),
13296
+ trigger: hook_trigger,
13297
+ action: hook_action_input
13298
+ });
13056
13299
 
13057
13300
  // ../../node_modules/@f0rbit/corpus/dist/types.js
13058
13301
  var ok = (value) => ({ ok: true, value });
@@ -13547,12 +13790,8 @@ function handleHttpResponse(response) {
13547
13790
  throw new AuthenticationError("Invalid or expired API key");
13548
13791
  case HTTP_STATUS.NOT_FOUND:
13549
13792
  throw new ApiError("Resource not found", { statusCode: HTTP_STATUS.NOT_FOUND });
13550
- case HTTP_STATUS.BAD_REQUEST:
13551
- break;
13552
13793
  default:
13553
- if (!response.ok) {
13554
- throw new ApiError(`Request failed: ${response.statusText}`, { statusCode: response.status });
13555
- }
13794
+ break;
13556
13795
  }
13557
13796
  }
13558
13797
  async function handleResponseError(response) {
@@ -13563,11 +13802,13 @@ async function handleResponseError(response) {
13563
13802
  const raw = JSON.parse(errorText);
13564
13803
  parsedError = raw;
13565
13804
  } catch {}
13566
- if (response.status === HTTP_STATUS.BAD_REQUEST && parsedError?.error?.name === "ZodError") {
13567
- const zodErrorDetails = parsedError.error.issues ? JSON.stringify(parsedError.error) : errorMessage;
13805
+ const structuredError = typeof parsedError?.error === "object" ? parsedError.error : undefined;
13806
+ if (response.status === HTTP_STATUS.BAD_REQUEST && structuredError?.name === "ZodError") {
13807
+ const zodErrorDetails = structuredError.issues ? JSON.stringify(structuredError) : errorMessage;
13568
13808
  throw new ValidationError(zodErrorDetails);
13569
13809
  }
13570
- throw new ApiError(errorMessage, { statusCode: response.status });
13810
+ const message = typeof parsedError?.error === "string" ? parsedError.error : errorMessage;
13811
+ throw new ApiError(message, { statusCode: response.status });
13571
13812
  }
13572
13813
  function handleNetworkError(error) {
13573
13814
  const message = error instanceof Error ? error.message : "Unknown network error";
@@ -13946,6 +14187,12 @@ var ApiClient2 = class {
13946
14187
  delete: (id2) => wrap(() => this.clients.milestones.delete(`/milestones/${id2}`)),
13947
14188
  goals: (id2) => wrap(() => this.clients.milestones.get(`/milestones/${id2}/goals`))
13948
14189
  };
14190
+ this.hooks = {
14191
+ list: (project_id) => wrap(() => this.clients.hooks.get("/hooks", { query: { project_id } })),
14192
+ upsert: (data) => wrap(() => data.id ? this.clients.hooks.patch(`/hooks/${data.id}`, { body: data }) : this.clients.hooks.post("/hooks", { body: data })),
14193
+ delete: (id2) => wrap(() => this.clients.hooks.delete(`/hooks/${id2}`)),
14194
+ deliveries: (id2, status) => wrap(() => this.clients.hooks.get(`/hooks/${id2}/deliveries`, status ? { query: { status } } : {}))
14195
+ };
13949
14196
  this.goals = {
13950
14197
  list: () => wrap(() => this.clients.goals.get("/goals")),
13951
14198
  find: (id2) => wrap(() => this.clients.goals.get(`/goals/${id2}`)),
@@ -14032,6 +14279,7 @@ var ApiClient2 = class {
14032
14279
  near: (id2) => wrap(() => this.clients.tasks.get(`/tasks/${id2}/near`)),
14033
14280
  claim: (id2, data) => wrap(() => this.clients.tasks.post(`/tasks/${id2}/claim`, { body: data })),
14034
14281
  done: (id2, data) => wrap(() => this.clients.tasks.post(`/tasks/${id2}/done`, { body: data })),
14282
+ advanceStage: (id2, data) => wrap(() => this.clients.tasks.post(`/tasks/${id2}/stage`, { body: data })),
14035
14283
  link: (data) => wrap(() => this.clients.tasks.post("/tasks/link", { body: data })),
14036
14284
  unlink: (link_id) => wrap(() => this.clients.tasks.delete(`/tasks/link/${link_id}`)),
14037
14285
  apply: (data) => wrap(() => this.clients.tasks.post("/tasks/apply", { body: data }))
@@ -14039,6 +14287,44 @@ var ApiClient2 = class {
14039
14287
  this.tags = {
14040
14288
  list: () => wrap(() => this.clients.tags.get("/tags"))
14041
14289
  };
14290
+ this.docs = {
14291
+ list: (filters) => wrap(() => {
14292
+ const query = { project_id: filters.project_id };
14293
+ if (filters.task_id)
14294
+ query.task_id = filters.task_id;
14295
+ return this.clients.docs.get("/docs", { query });
14296
+ }),
14297
+ push: (data) => wrap(() => this.clients.docs.post("/docs", { body: data })),
14298
+ pull: (id2, version2) => wrap(() => this.clients.docs.get(`/docs/${id2}`, version2 ? { query: { version: version2 } } : {})),
14299
+ versions: (id2) => wrap(() => this.clients.docs.get(`/docs/${id2}/versions`)),
14300
+ createThread: (document_id, data) => wrap(() => this.clients.docs.post(`/docs/${document_id}/threads`, { body: data })),
14301
+ replyThread: (document_id, thread_id, body) => wrap(() => this.clients.docs.post(`/docs/${document_id}/threads/${thread_id}/reply`, { body: { body } })),
14302
+ resolveThread: (document_id, thread_id) => wrap(() => this.clients.docs.post(`/docs/${document_id}/threads/${thread_id}/resolve`, {})),
14303
+ toggleBlocking: (document_id, thread_id, blocking) => wrap(() => this.clients.docs.post(`/docs/${document_id}/threads/${thread_id}/blocking`, { body: { blocking } })),
14304
+ unresolved: (filters) => wrap(() => {
14305
+ const query = {};
14306
+ if (filters.project_id)
14307
+ query.project_id = filters.project_id;
14308
+ if (filters.document_id)
14309
+ query.document_id = filters.document_id;
14310
+ return this.clients.docs.get("/docs/annotations/unresolved", { query });
14311
+ }),
14312
+ pushInterfaceReport: (data) => wrap(() => this.clients.docs.post("/docs/interface", { body: data })),
14313
+ interfaceStatus: (filters) => wrap(() => {
14314
+ const query = { project_id: filters.project_id, title: filters.title };
14315
+ if (filters.task_id)
14316
+ query.task_id = filters.task_id;
14317
+ return this.clients.docs.get("/docs/interface/status", { query });
14318
+ })
14319
+ };
14320
+ this.signoffs = {
14321
+ request: (data) => wrap(() => this.clients.signoffs.post("/signoffs", { body: data })),
14322
+ find: (id2) => wrap(() => this.clients.signoffs.get(`/signoffs/${id2}`)),
14323
+ decide: (id2, data) => wrap(() => this.clients.signoffs.post(`/signoffs/${id2}/decide`, { body: data }))
14324
+ };
14325
+ this.reviews = {
14326
+ pending: () => wrap(() => this.clients.reviews.get("/reviews/pending"))
14327
+ };
14042
14328
  this.github = {
14043
14329
  repos: () => wrap(() => this.clients.github.get("/repos")),
14044
14330
  branches: (owner, repo) => wrap(() => this.clients.github.get(`/repos/${owner}/${repo}/branches`))
@@ -14403,7 +14689,11 @@ var ApiClient2 = class {
14403
14689
  blog: new ApiClient({ ...clientOptions, category: "blog" }),
14404
14690
  media: new ApiClient({ ...clientOptions, category: "media" }),
14405
14691
  pulse: new ApiClient({ ...clientOptions, base_url: `${base_url}/pulse`, category: "pulse" }),
14406
- pipelines: new ApiClient({ ...clientOptions, category: "pipelines" })
14692
+ pipelines: new ApiClient({ ...clientOptions, category: "pipelines" }),
14693
+ hooks: new ApiClient({ ...clientOptions, category: "hooks" }),
14694
+ docs: new ApiClient({ ...clientOptions, category: "docs" }),
14695
+ signoffs: new ApiClient({ ...clientOptions, category: "signoffs" }),
14696
+ reviews: new ApiClient({ ...clientOptions, category: "reviews" })
14407
14697
  };
14408
14698
  }
14409
14699
  history() {
@@ -14489,6 +14779,16 @@ var milestone_by_id = exports_external.object({
14489
14779
  var goal_by_id = exports_external.object({
14490
14780
  id: exports_external.string().describe("Goal ID")
14491
14781
  });
14782
+ var hook_filters = exports_external.object({
14783
+ project_id: exports_external.string().describe("Project ID to list hooks for")
14784
+ });
14785
+ var hook_by_id = exports_external.object({
14786
+ id: exports_external.string().describe("Hook ID")
14787
+ });
14788
+ var hook_deliveries_input = exports_external.object({
14789
+ id: exports_external.string().describe("Hook ID"),
14790
+ status: exports_external.enum(["pending", "delivered", "failed_transient", "failed_permanent"]).optional().describe("Filter by delivery status — use failed_permanent to see the DLQ")
14791
+ });
14492
14792
  var github_branches = exports_external.object({
14493
14793
  owner: exports_external.string().describe("Repository owner"),
14494
14794
  repo: exports_external.string().describe("Repository name")
@@ -14586,6 +14886,30 @@ var tools = {
14586
14886
  finished_at: input.finished_at
14587
14887
  }))
14588
14888
  }),
14889
+ devpad_hooks_list: define_tool({
14890
+ name: "devpad_hooks_list",
14891
+ description: "List hooks configured for a project",
14892
+ inputSchema: hook_filters,
14893
+ execute: async (client, input) => unwrap2(await client.hooks.list(input.project_id))
14894
+ }),
14895
+ devpad_hooks_upsert: define_tool({
14896
+ name: "devpad_hooks_upsert",
14897
+ description: "Create or update a hook (webhook/vault/pipeline action fired on matching task_event kinds). Pass 'id' to update.",
14898
+ inputSchema: upsert_hook,
14899
+ execute: async (client, input) => unwrap2(await client.hooks.upsert(input))
14900
+ }),
14901
+ devpad_hooks_delete: define_tool({
14902
+ name: "devpad_hooks_delete",
14903
+ description: "Delete a hook",
14904
+ inputSchema: hook_by_id,
14905
+ execute: async (client, input) => unwrap2(await client.hooks.delete(input.id))
14906
+ }),
14907
+ devpad_hooks_deliveries: define_tool({
14908
+ name: "devpad_hooks_deliveries",
14909
+ description: "List delivery attempts for a hook, optionally filtered by status (the DLQ is status=failed_permanent)",
14910
+ inputSchema: hook_deliveries_input,
14911
+ execute: async (client, input) => unwrap2(await client.hooks.deliveries(input.id, input.status))
14912
+ }),
14589
14913
  devpad_goals_list: define_tool({
14590
14914
  name: "devpad_goals_list",
14591
14915
  description: "List goals for authenticated user",
@@ -14777,6 +15101,15 @@ var tools = {
14777
15101
  }),
14778
15102
  execute: async (client, input) => unwrap2(await client.tasks.unlink(input.id))
14779
15103
  }),
15104
+ devpad_tasks_advance_stage: define_tool({
15105
+ name: "devpad_tasks_advance_stage",
15106
+ description: "Advance a task's SDLC stage (ideate|plan|build|review|deploy|live). Gated hops (plan->build needs an approved plan checkpoint; review->deploy needs approved types + design when a design doc exists) 409 naming what's missing unless override:true, which always succeeds but is audited.",
15107
+ inputSchema: advance_stage_request.extend({ id: exports_external.string().describe("Task ID") }),
15108
+ execute: async (client, input) => {
15109
+ const { id: id2, ...rest } = input;
15110
+ return unwrap2(await client.tasks.advanceStage(id2, rest));
15111
+ }
15112
+ }),
14780
15113
  devpad_tasks_apply: define_tool({
14781
15114
  name: "devpad_tasks_apply",
14782
15115
  description: "Batch apply create/update/reparent/link/unlink/claim/complete ops atomically, with $0/$1… temp handles for subtree creation. Replaying the same idempotency_key returns the prior response verbatim.",
@@ -15326,6 +15659,128 @@ var tools = {
15326
15659
  owner_id: exports_external.string().describe("Owner ID (must match the policy's owner)")
15327
15660
  }),
15328
15661
  execute: async (client, input) => unwrap2(await client.pipelines.oidc_trust.delete(input.id, { owner_id: input.owner_id }))
15662
+ }),
15663
+ devpad_docs_list: define_tool({
15664
+ name: "devpad_docs_list",
15665
+ description: "List documents for a project (optionally filtered to one task)",
15666
+ inputSchema: exports_external.object({
15667
+ project_id: exports_external.string().describe("Project ID"),
15668
+ task_id: exports_external.string().optional().describe("Filter to documents attached to this task")
15669
+ }),
15670
+ execute: async (client, input) => unwrap2(await client.docs.list(input))
15671
+ }),
15672
+ devpad_docs_push: define_tool({
15673
+ name: "devpad_docs_push",
15674
+ description: "Push HTML content as a new document (omit document_id) or a new version on an existing one. HTML is sanitized server-side before storage — script/iframe/object/embed/form, event handlers, and javascript:/data: URLs never survive.",
15675
+ inputSchema: push_doc_request,
15676
+ execute: async (client, input) => unwrap2(await client.docs.push(input))
15677
+ }),
15678
+ devpad_docs_pull: define_tool({
15679
+ name: "devpad_docs_pull",
15680
+ description: "Pull a document's content at a specific version (default: head)",
15681
+ inputSchema: exports_external.object({
15682
+ id: exports_external.string().describe("Document ID"),
15683
+ version: exports_external.string().optional().describe("Corpus version — defaults to head")
15684
+ }),
15685
+ execute: async (client, input) => unwrap2(await client.docs.pull(input.id, input.version))
15686
+ }),
15687
+ devpad_docs_versions: define_tool({
15688
+ name: "devpad_docs_versions",
15689
+ description: "Full version history for a document, newest first (the lineage walk)",
15690
+ inputSchema: exports_external.object({
15691
+ id: exports_external.string().describe("Document ID")
15692
+ }),
15693
+ execute: async (client, input) => unwrap2(await client.docs.versions(input.id))
15694
+ }),
15695
+ devpad_annotations_create: define_tool({
15696
+ name: "devpad_annotations_create",
15697
+ description: "Open a new annotation thread on a document, anchored to an exact quote (with prefix/suffix context + char offsets for re-anchoring across edits)",
15698
+ inputSchema: create_thread_request.extend({ document_id: exports_external.string().describe("Document ID") }),
15699
+ execute: async (client, input) => {
15700
+ const { document_id, ...rest } = input;
15701
+ return unwrap2(await client.docs.createThread(document_id, rest));
15702
+ }
15703
+ }),
15704
+ devpad_annotations_reply: define_tool({
15705
+ name: "devpad_annotations_reply",
15706
+ description: "Reply to an existing annotation thread",
15707
+ inputSchema: exports_external.object({
15708
+ document_id: exports_external.string().describe("Document ID"),
15709
+ thread_id: exports_external.string().describe("Thread ID (from the marker JSON, not the document ID)"),
15710
+ body: exports_external.string().min(1).describe("Reply text")
15711
+ }),
15712
+ execute: async (client, input) => unwrap2(await client.docs.replyThread(input.document_id, input.thread_id, input.body))
15713
+ }),
15714
+ devpad_annotations_resolve: define_tool({
15715
+ name: "devpad_annotations_resolve",
15716
+ description: "Mark an annotation thread resolved",
15717
+ inputSchema: exports_external.object({
15718
+ document_id: exports_external.string().describe("Document ID"),
15719
+ thread_id: exports_external.string().describe("Thread ID")
15720
+ }),
15721
+ execute: async (client, input) => unwrap2(await client.docs.resolveThread(input.document_id, input.thread_id))
15722
+ }),
15723
+ devpad_annotations_toggle_blocking: define_tool({
15724
+ name: "devpad_annotations_toggle_blocking",
15725
+ description: "Toggle whether an annotation thread blocks approval",
15726
+ inputSchema: exports_external.object({
15727
+ document_id: exports_external.string().describe("Document ID"),
15728
+ thread_id: exports_external.string().describe("Thread ID"),
15729
+ blocking: exports_external.boolean()
15730
+ }),
15731
+ execute: async (client, input) => unwrap2(await client.docs.toggleBlocking(input.document_id, input.thread_id, input.blocking))
15732
+ }),
15733
+ devpad_interface_push: define_tool({
15734
+ name: "devpad_interface_push",
15735
+ description: "Push already-normalized declaration text as a new interface-doc version. The server independently recomputes additive-vs-breaking against its own stored previous content and auto-approves additive diffs against an approved base.",
15736
+ inputSchema: push_interface_report_request,
15737
+ execute: async (client, input) => unwrap2(await client.docs.pushInterfaceReport(input))
15738
+ }),
15739
+ devpad_interface_status: define_tool({
15740
+ name: "devpad_interface_status",
15741
+ description: "Get the approved/auto content_hash for an interface doc, for a client-side hash comparison (the `check` verb)",
15742
+ inputSchema: exports_external.object({
15743
+ project_id: exports_external.string().describe("Project ID"),
15744
+ task_id: exports_external.string().optional().describe("Task ID"),
15745
+ title: exports_external.string().describe("The interface document's title (package name)")
15746
+ }),
15747
+ execute: async (client, input) => unwrap2(await client.docs.interfaceStatus(input))
15748
+ }),
15749
+ devpad_reviews_pending: define_tool({
15750
+ name: "devpad_reviews_pending",
15751
+ description: "The human's queue — one typed aggregate across pending signoff checkpoints, open blocking annotation threads, pending pipeline manual gates, and pending scanner diffs, scoped to the authenticated user",
15752
+ inputSchema: exports_external.object({}),
15753
+ execute: async (client) => unwrap2(await client.reviews.pending())
15754
+ }),
15755
+ devpad_annotations_unresolved: define_tool({
15756
+ name: "devpad_annotations_unresolved",
15757
+ description: "List pending annotation threads (anything not resolved) for a project or a specific document",
15758
+ inputSchema: exports_external.object({
15759
+ project_id: exports_external.string().optional().describe("Project ID"),
15760
+ document_id: exports_external.string().optional().describe("Document ID")
15761
+ }),
15762
+ execute: async (client, input) => unwrap2(await client.docs.unresolved(input))
15763
+ }),
15764
+ devpad_signoffs_request: define_tool({
15765
+ name: "devpad_signoffs_request",
15766
+ description: "Request a human signoff checkpoint — creates a pending approval node that blocks the named downstream tasks until decided",
15767
+ inputSchema: request_checkpoint_request,
15768
+ execute: async (client, input) => unwrap2(await client.signoffs.request(input))
15769
+ }),
15770
+ devpad_signoffs_get: define_tool({
15771
+ name: "devpad_signoffs_get",
15772
+ description: "Get a signoff checkpoint's current state",
15773
+ inputSchema: exports_external.object({ id: exports_external.string().describe("Signoff ID") }),
15774
+ execute: async (client, input) => unwrap2(await client.signoffs.find(input.id))
15775
+ }),
15776
+ devpad_signoffs_decide: define_tool({
15777
+ name: "devpad_signoffs_decide",
15778
+ description: "Decide a signoff checkpoint (approved | changes_requested). Human-only — an api-channel key gets 403. Approving a doc_version subject is vetoed by any open blocking annotation thread.",
15779
+ inputSchema: decide_checkpoint_request.extend({ id: exports_external.string().describe("Signoff ID") }),
15780
+ execute: async (client, input) => {
15781
+ const { id: id2, ...rest } = input;
15782
+ return unwrap2(await client.signoffs.decide(id2, rest));
15783
+ }
15329
15784
  })
15330
15785
  };
15331
15786
  var toolNames = Object.keys(tools);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devpad/mcp",
3
- "version": "2.3.4",
3
+ "version": "2.3.6",
4
4
  "description": "MCP server for devpad - exposes devpad API functionality via Model Context Protocol",
5
5
  "keywords": [
6
6
  "ai-tools",
@@ -50,7 +50,7 @@
50
50
  "zod-to-json-schema": "^3.24.6"
51
51
  },
52
52
  "devDependencies": {
53
- "@devpad/api": "^2.3.4",
53
+ "@devpad/api": "^2.3.6",
54
54
  "@types/node": "^24.3.0",
55
55
  "typescript": "^5.0.0"
56
56
  },