@devpad/api 2.2.17 → 2.3.1

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 (3) hide show
  1. package/dist/index.d.ts +643 -7
  2. package/dist/index.js +322 -239
  3. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -15,6 +15,68 @@ import {
15
15
  PostUpdateSchema
16
16
  } from "./chunk-5L3AUVMM.js";
17
17
 
18
+ // ../schema/dist/pulse/types.js
19
+ import { z } from "zod";
20
+ var PulseEventRowSchema = z.object({
21
+ id: z.number(),
22
+ project_id: z.string(),
23
+ name: z.string(),
24
+ ts: z.number(),
25
+ session_id: z.string(),
26
+ url: z.string().nullable(),
27
+ referrer: z.string().nullable(),
28
+ user_agent: z.string().nullable(),
29
+ country: z.string().nullable(),
30
+ level: z.string().nullable(),
31
+ release: z.string().nullable(),
32
+ error_fingerprint: z.string().nullable(),
33
+ properties: z.record(z.string(), z.unknown()).nullable()
34
+ });
35
+ var PulseSummaryByDaySchema = z.object({
36
+ date: z.string(),
37
+ pageviews: z.number(),
38
+ sessions: z.number(),
39
+ errors: z.number()
40
+ });
41
+ var PulseSummarySchema = z.object({
42
+ pageviews: z.number(),
43
+ sessions: z.number(),
44
+ events_total: z.number(),
45
+ errors: z.number(),
46
+ request_count: z.number(),
47
+ p95_latency_ms: z.number().nullable(),
48
+ by_day: z.array(PulseSummaryByDaySchema)
49
+ });
50
+ var PulseEventsPageSchema = z.object({
51
+ events: z.array(PulseEventRowSchema),
52
+ next_cursor: z.string().optional()
53
+ });
54
+ var PulseErrorIssueSchema = z.object({
55
+ fingerprint: z.string(),
56
+ count: z.number(),
57
+ first_seen: z.number(),
58
+ last_seen: z.number(),
59
+ sample: PulseEventRowSchema
60
+ });
61
+ var PulseErrorsResultSchema = z.union([
62
+ z.object({ issues: z.array(PulseErrorIssueSchema) }),
63
+ z.object({ errors: z.array(PulseEventRowSchema) })
64
+ ]);
65
+ var PulseLogsResultSchema = z.object({
66
+ logs: z.array(PulseEventRowSchema)
67
+ });
68
+ var PulseLatencyByMinuteSchema = z.object({
69
+ ts: z.number(),
70
+ p50: z.number().nullable(),
71
+ p95: z.number().nullable(),
72
+ p99: z.number().nullable()
73
+ });
74
+ var PulseLatencyResultSchema = z.object({
75
+ percentiles: z.record(z.string(), z.number().nullable()),
76
+ by_minute: z.array(PulseLatencyByMinuteSchema)
77
+ });
78
+ var pulseSummaryHasData = (summary) => Boolean(summary && (summary.pageviews || summary.sessions || summary.events_total || summary.errors || summary.request_count));
79
+
18
80
  // src/errors.ts
19
81
  var ApiError = class _ApiError extends Error {
20
82
  constructor(message, options = {}) {
@@ -1001,15 +1063,19 @@ var ApiClient2 = class {
1001
1063
  /**
1002
1064
  * Get summary analytics for a project
1003
1065
  */
1004
- summary: (input) => wrap(
1005
- () => this.clients.pulse.get("/summary/:project_id".replace(":project_id", input.project_id), {
1006
- query: typeof input.range === "string" ? { range: input.range } : { from: String(input.range.from), to: String(input.range.to) }
1007
- })
1008
- ),
1066
+ summary: (input) => wrap(async () => {
1067
+ const raw = await this.clients.pulse.get(
1068
+ "/summary/:project_id".replace(":project_id", input.project_id),
1069
+ {
1070
+ query: typeof input.range === "string" ? { range: input.range } : { from: String(input.range.from), to: String(input.range.to) }
1071
+ }
1072
+ );
1073
+ return PulseSummarySchema.parse(raw);
1074
+ }),
1009
1075
  /**
1010
1076
  * List events for a project
1011
1077
  */
1012
- events: (input) => wrap(() => {
1078
+ events: (input) => wrap(async () => {
1013
1079
  const query = {};
1014
1080
  if (input.name) query.name = input.name;
1015
1081
  if (input.level) query.level = input.level;
@@ -1018,14 +1084,18 @@ var ApiClient2 = class {
1018
1084
  if (input.search) query.search = input.search;
1019
1085
  if (input.limit) query.limit = String(input.limit);
1020
1086
  if (input.cursor) query.cursor = input.cursor;
1021
- return this.clients.pulse.get("/events/:project_id".replace(":project_id", input.project_id), {
1022
- query
1023
- });
1087
+ const raw = await this.clients.pulse.get(
1088
+ "/events/:project_id".replace(":project_id", input.project_id),
1089
+ {
1090
+ query
1091
+ }
1092
+ );
1093
+ return PulseEventsPageSchema.parse(raw);
1024
1094
  }),
1025
1095
  /**
1026
1096
  * List error issues for a project
1027
1097
  */
1028
- errors: (input) => wrap(() => {
1098
+ errors: (input) => wrap(async () => {
1029
1099
  const query = {};
1030
1100
  if (typeof input.range === "string") {
1031
1101
  query.range = input.range;
@@ -1034,14 +1104,18 @@ var ApiClient2 = class {
1034
1104
  query.to = String(input.range.to);
1035
1105
  }
1036
1106
  if (input.group_by_fingerprint) query.group_by_fingerprint = "true";
1037
- return this.clients.pulse.get("/errors/:project_id".replace(":project_id", input.project_id), {
1038
- query
1039
- });
1107
+ const raw = await this.clients.pulse.get(
1108
+ "/errors/:project_id".replace(":project_id", input.project_id),
1109
+ {
1110
+ query
1111
+ }
1112
+ );
1113
+ return PulseErrorsResultSchema.parse(raw);
1040
1114
  }),
1041
1115
  /**
1042
1116
  * List logs for a project
1043
1117
  */
1044
- logs: (input) => wrap(() => {
1118
+ logs: (input) => wrap(async () => {
1045
1119
  const query = {};
1046
1120
  if (typeof input.range === "string") {
1047
1121
  query.range = input.range;
@@ -1051,12 +1125,16 @@ var ApiClient2 = class {
1051
1125
  }
1052
1126
  if (input.level) query.level = input.level;
1053
1127
  if (input.search) query.search = input.search;
1054
- return this.clients.pulse.get("/logs/:project_id".replace(":project_id", input.project_id), { query });
1128
+ const raw = await this.clients.pulse.get(
1129
+ "/logs/:project_id".replace(":project_id", input.project_id),
1130
+ { query }
1131
+ );
1132
+ return PulseLogsResultSchema.parse(raw);
1055
1133
  }),
1056
1134
  /**
1057
1135
  * Get latency metrics for a project
1058
1136
  */
1059
- latency: (input) => wrap(() => {
1137
+ latency: (input) => wrap(async () => {
1060
1138
  const query = {};
1061
1139
  if (typeof input.range === "string") {
1062
1140
  query.range = input.range;
@@ -1066,9 +1144,13 @@ var ApiClient2 = class {
1066
1144
  }
1067
1145
  if (input.route) query.route = input.route;
1068
1146
  if (input.percentiles && input.percentiles.length > 0) query.percentiles = input.percentiles.join(",");
1069
- return this.clients.pulse.get("/latency/:project_id".replace(":project_id", input.project_id), {
1070
- query
1071
- });
1147
+ const raw = await this.clients.pulse.get(
1148
+ "/latency/:project_id".replace(":project_id", input.project_id),
1149
+ {
1150
+ query
1151
+ }
1152
+ );
1153
+ return PulseLatencyResultSchema.parse(raw);
1072
1154
  }),
1073
1155
  /**
1074
1156
  * Subscription management
@@ -1496,39 +1578,39 @@ var blog_post_projects = sqliteTable("blog_post_projects", {
1496
1578
  }, (table) => [primaryKey({ columns: [table.post_id, table.project_id] })]);
1497
1579
 
1498
1580
  // src/tools.ts
1499
- import { z } from "zod";
1581
+ import { z as z2 } from "zod";
1500
1582
  function unwrap(result) {
1501
1583
  if (!result.ok) throw new Error(result.error?.message ?? "Unknown error");
1502
1584
  return result.value;
1503
1585
  }
1504
- var project_filters = z.object({
1505
- private: z.boolean().optional().describe("Include private projects (default: true)")
1586
+ var project_filters = z2.object({
1587
+ private: z2.boolean().optional().describe("Include private projects (default: true)")
1506
1588
  });
1507
- var project_by_id_or_name = z.object({
1508
- id: z.string().optional().describe("Project ID"),
1509
- name: z.string().optional().describe("Project name")
1589
+ var project_by_id_or_name = z2.object({
1590
+ id: z2.string().optional().describe("Project ID"),
1591
+ name: z2.string().optional().describe("Project name")
1510
1592
  }).refine((data) => data.id || data.name, {
1511
1593
  message: "Either 'id' or 'name' must be provided"
1512
1594
  });
1513
- var task_filters = z.object({
1514
- project_id: z.string().optional().describe("Filter by project ID"),
1515
- tag_id: z.string().optional().describe("Filter by tag ID")
1595
+ var task_filters = z2.object({
1596
+ project_id: z2.string().optional().describe("Filter by project ID"),
1597
+ tag_id: z2.string().optional().describe("Filter by tag ID")
1516
1598
  });
1517
- var task_by_id = z.object({
1518
- id: z.string().describe("Task ID")
1599
+ var task_by_id = z2.object({
1600
+ id: z2.string().describe("Task ID")
1519
1601
  });
1520
- var milestone_filters = z.object({
1521
- project_id: z.string().optional().describe("Filter by project ID")
1602
+ var milestone_filters = z2.object({
1603
+ project_id: z2.string().optional().describe("Filter by project ID")
1522
1604
  });
1523
- var milestone_by_id = z.object({
1524
- id: z.string().describe("Milestone ID")
1605
+ var milestone_by_id = z2.object({
1606
+ id: z2.string().describe("Milestone ID")
1525
1607
  });
1526
- var goal_by_id = z.object({
1527
- id: z.string().describe("Goal ID")
1608
+ var goal_by_id = z2.object({
1609
+ id: z2.string().describe("Goal ID")
1528
1610
  });
1529
- var github_branches = z.object({
1530
- owner: z.string().describe("Repository owner"),
1531
- repo: z.string().describe("Repository name")
1611
+ var github_branches = z2.object({
1612
+ owner: z2.string().describe("Repository owner"),
1613
+ repo: z2.string().describe("Repository name")
1532
1614
  });
1533
1615
  var define_tool = (def) => def;
1534
1616
  var tools = {
@@ -1632,7 +1714,7 @@ var tools = {
1632
1714
  devpad_goals_list: define_tool({
1633
1715
  name: "devpad_goals_list",
1634
1716
  description: "List goals for authenticated user",
1635
- inputSchema: z.object({}),
1717
+ inputSchema: z2.object({}),
1636
1718
  execute: async (client) => unwrap(await client.goals.list())
1637
1719
  }),
1638
1720
  devpad_goals_get: define_tool({
@@ -1664,14 +1746,14 @@ var tools = {
1664
1746
  devpad_tags_list: define_tool({
1665
1747
  name: "devpad_tags_list",
1666
1748
  description: "List tags for authenticated user",
1667
- inputSchema: z.object({}),
1749
+ inputSchema: z2.object({}),
1668
1750
  execute: async (client) => unwrap(await client.tags.list())
1669
1751
  }),
1670
1752
  // GitHub integration
1671
1753
  devpad_github_repos: define_tool({
1672
1754
  name: "devpad_github_repos",
1673
1755
  description: "List GitHub repositories for authenticated user",
1674
- inputSchema: z.object({}),
1756
+ inputSchema: z2.object({}),
1675
1757
  execute: async (client) => unwrap(await client.github.repos())
1676
1758
  }),
1677
1759
  devpad_github_branches: define_tool({
@@ -1684,8 +1766,8 @@ var tools = {
1684
1766
  devpad_projects_delete: define_tool({
1685
1767
  name: "devpad_projects_delete",
1686
1768
  description: "Delete a project",
1687
- inputSchema: z.object({
1688
- id: z.string().describe("Project ID")
1769
+ inputSchema: z2.object({
1770
+ id: z2.string().describe("Project ID")
1689
1771
  }),
1690
1772
  execute: async (client, input) => {
1691
1773
  const project = unwrap(await client.projects.find(input.id));
@@ -1697,24 +1779,24 @@ var tools = {
1697
1779
  devpad_projects_history: define_tool({
1698
1780
  name: "devpad_projects_history",
1699
1781
  description: "Get project history",
1700
- inputSchema: z.object({
1701
- project_id: z.string().describe("Project ID")
1782
+ inputSchema: z2.object({
1783
+ project_id: z2.string().describe("Project ID")
1702
1784
  }),
1703
1785
  execute: async (client, input) => unwrap(await client.projects.history(input.project_id))
1704
1786
  }),
1705
1787
  devpad_projects_specification: define_tool({
1706
1788
  name: "devpad_projects_specification",
1707
1789
  description: "Fetch project specification from GitHub",
1708
- inputSchema: z.object({
1709
- project_id: z.string().describe("Project ID")
1790
+ inputSchema: z2.object({
1791
+ project_id: z2.string().describe("Project ID")
1710
1792
  }),
1711
1793
  execute: async (client, input) => unwrap(await client.projects.specification(input.project_id))
1712
1794
  }),
1713
1795
  devpad_projects_config_load: define_tool({
1714
1796
  name: "devpad_projects_config_load",
1715
1797
  description: "Load project configuration",
1716
- inputSchema: z.object({
1717
- project_id: z.string().describe("Project ID")
1798
+ inputSchema: z2.object({
1799
+ project_id: z2.string().describe("Project ID")
1718
1800
  }),
1719
1801
  execute: async (client, input) => unwrap(await client.projects.config.load(input.project_id))
1720
1802
  }),
@@ -1722,16 +1804,16 @@ var tools = {
1722
1804
  devpad_milestones_delete: define_tool({
1723
1805
  name: "devpad_milestones_delete",
1724
1806
  description: "Delete a milestone",
1725
- inputSchema: z.object({
1726
- id: z.string().describe("Milestone ID")
1807
+ inputSchema: z2.object({
1808
+ id: z2.string().describe("Milestone ID")
1727
1809
  }),
1728
1810
  execute: async (client, input) => unwrap(await client.milestones.delete(input.id))
1729
1811
  }),
1730
1812
  devpad_milestones_goals: define_tool({
1731
1813
  name: "devpad_milestones_goals",
1732
1814
  description: "Get goals for a milestone",
1733
- inputSchema: z.object({
1734
- id: z.string().describe("Milestone ID")
1815
+ inputSchema: z2.object({
1816
+ id: z2.string().describe("Milestone ID")
1735
1817
  }),
1736
1818
  execute: async (client, input) => unwrap(await client.milestones.goals(input.id))
1737
1819
  }),
@@ -1739,8 +1821,8 @@ var tools = {
1739
1821
  devpad_goals_delete: define_tool({
1740
1822
  name: "devpad_goals_delete",
1741
1823
  description: "Delete a goal",
1742
- inputSchema: z.object({
1743
- id: z.string().describe("Goal ID")
1824
+ inputSchema: z2.object({
1825
+ id: z2.string().describe("Goal ID")
1744
1826
  }),
1745
1827
  execute: async (client, input) => unwrap(await client.goals.delete(input.id))
1746
1828
  }),
@@ -1748,8 +1830,8 @@ var tools = {
1748
1830
  devpad_tasks_delete: define_tool({
1749
1831
  name: "devpad_tasks_delete",
1750
1832
  description: "Delete a task",
1751
- inputSchema: z.object({
1752
- id: z.string().describe("Task ID")
1833
+ inputSchema: z2.object({
1834
+ id: z2.string().describe("Task ID")
1753
1835
  }),
1754
1836
  execute: async (client, input) => {
1755
1837
  const task = unwrap(await client.tasks.find(input.id));
@@ -1761,8 +1843,8 @@ var tools = {
1761
1843
  devpad_tasks_history: define_tool({
1762
1844
  name: "devpad_tasks_history",
1763
1845
  description: "Get task history",
1764
- inputSchema: z.object({
1765
- task_id: z.string().describe("Task ID")
1846
+ inputSchema: z2.object({
1847
+ task_id: z2.string().describe("Task ID")
1766
1848
  }),
1767
1849
  execute: async (client, input) => unwrap(await client.tasks.history.get(input.task_id))
1768
1850
  }),
@@ -1770,30 +1852,30 @@ var tools = {
1770
1852
  devpad_user_me: define_tool({
1771
1853
  name: "devpad_user_me",
1772
1854
  description: "Get the authenticated user's identity (id, name, github_id, task_view)",
1773
- inputSchema: z.object({}),
1855
+ inputSchema: z2.object({}),
1774
1856
  execute: async (client) => unwrap(await client.user.me())
1775
1857
  }),
1776
1858
  devpad_user_history: define_tool({
1777
1859
  name: "devpad_user_history",
1778
1860
  description: "Get user activity history",
1779
- inputSchema: z.object({}),
1861
+ inputSchema: z2.object({}),
1780
1862
  execute: async (client) => unwrap(await client.user.history())
1781
1863
  }),
1782
1864
  devpad_user_preferences: define_tool({
1783
1865
  name: "devpad_user_preferences",
1784
1866
  description: "Update user preferences",
1785
- inputSchema: z.object({
1786
- id: z.string().describe("User ID"),
1787
- task_view: z.enum(["list", "grid"]).describe("Task view preference")
1867
+ inputSchema: z2.object({
1868
+ id: z2.string().describe("User ID"),
1869
+ task_view: z2.enum(["list", "grid"]).describe("Task view preference")
1788
1870
  }),
1789
1871
  execute: async (client, input) => unwrap(await client.user.preferences(input))
1790
1872
  }),
1791
1873
  devpad_activity_ai: define_tool({
1792
1874
  name: "devpad_activity_ai",
1793
1875
  description: "Get AI activity feed - shows recent actions made via API/MCP grouped into sessions by time window",
1794
- inputSchema: z.object({
1795
- limit: z.number().optional().describe("Max sessions to return (default 20)"),
1796
- since: z.string().optional().describe("Only show activity after this ISO date")
1876
+ inputSchema: z2.object({
1877
+ limit: z2.number().optional().describe("Max sessions to return (default 20)"),
1878
+ since: z2.string().optional().describe("Only show activity after this ISO date")
1797
1879
  }),
1798
1880
  execute: async (client, input) => unwrap(await client.activity.ai(input))
1799
1881
  }),
@@ -1806,8 +1888,8 @@ var tools = {
1806
1888
  devpad_blog_posts_get: define_tool({
1807
1889
  name: "devpad_blog_posts_get",
1808
1890
  description: "Get a blog post by slug",
1809
- inputSchema: z.object({
1810
- slug: z.string().describe("Post slug")
1891
+ inputSchema: z2.object({
1892
+ slug: z2.string().describe("Post slug")
1811
1893
  }),
1812
1894
  execute: async (client, input) => unwrap(await client.blog.posts.getBySlug(input.slug))
1813
1895
  }),
@@ -1820,7 +1902,7 @@ var tools = {
1820
1902
  devpad_blog_posts_update: define_tool({
1821
1903
  name: "devpad_blog_posts_update",
1822
1904
  description: "Update a blog post by UUID",
1823
- inputSchema: PostUpdateSchema.extend({ uuid: z.string().describe("Post UUID") }),
1905
+ inputSchema: PostUpdateSchema.extend({ uuid: z2.string().describe("Post UUID") }),
1824
1906
  execute: async (client, input) => {
1825
1907
  const { uuid, ...data } = input;
1826
1908
  return unwrap(await client.blog.posts.update(uuid, data));
@@ -1829,21 +1911,21 @@ var tools = {
1829
1911
  devpad_blog_posts_delete: define_tool({
1830
1912
  name: "devpad_blog_posts_delete",
1831
1913
  description: "Delete a blog post by UUID",
1832
- inputSchema: z.object({
1833
- uuid: z.string().describe("Post UUID")
1914
+ inputSchema: z2.object({
1915
+ uuid: z2.string().describe("Post UUID")
1834
1916
  }),
1835
1917
  execute: async (client, input) => unwrap(await client.blog.posts.delete(input.uuid))
1836
1918
  }),
1837
1919
  devpad_blog_tags_list: define_tool({
1838
1920
  name: "devpad_blog_tags_list",
1839
1921
  description: "List all blog tags with post counts",
1840
- inputSchema: z.object({}),
1922
+ inputSchema: z2.object({}),
1841
1923
  execute: async (client) => unwrap(await client.blog.tags.list())
1842
1924
  }),
1843
1925
  devpad_blog_categories_tree: define_tool({
1844
1926
  name: "devpad_blog_categories_tree",
1845
1927
  description: "Get the blog category tree",
1846
- inputSchema: z.object({}),
1928
+ inputSchema: z2.object({}),
1847
1929
  execute: async (client) => unwrap(await client.blog.categories.tree())
1848
1930
  }),
1849
1931
  devpad_blog_categories_create: define_tool({
@@ -1855,48 +1937,48 @@ var tools = {
1855
1937
  devpad_blog_tokens_list: define_tool({
1856
1938
  name: "devpad_blog_tokens_list",
1857
1939
  description: "List blog access tokens",
1858
- inputSchema: z.object({}),
1940
+ inputSchema: z2.object({}),
1859
1941
  execute: async (client) => unwrap(await client.blog.tokens.list())
1860
1942
  }),
1861
1943
  devpad_blog_tokens_create: define_tool({
1862
1944
  name: "devpad_blog_tokens_create",
1863
1945
  description: "Create a blog access token",
1864
- inputSchema: z.object({
1865
- name: z.string().describe("Token name"),
1866
- note: z.string().optional().describe("Optional note")
1946
+ inputSchema: z2.object({
1947
+ name: z2.string().describe("Token name"),
1948
+ note: z2.string().optional().describe("Optional note")
1867
1949
  }),
1868
1950
  execute: async (client, input) => unwrap(await client.blog.tokens.create(input))
1869
1951
  }),
1870
1952
  devpad_media_profiles_list: define_tool({
1871
1953
  name: "devpad_media_profiles_list",
1872
1954
  description: "List media profiles",
1873
- inputSchema: z.object({}),
1955
+ inputSchema: z2.object({}),
1874
1956
  execute: async (client) => unwrap(await client.media.profiles.list())
1875
1957
  }),
1876
1958
  devpad_media_profiles_create: define_tool({
1877
1959
  name: "devpad_media_profiles_create",
1878
1960
  description: "Create a media profile",
1879
- inputSchema: z.object({
1880
- name: z.string().describe("Profile name"),
1881
- slug: z.string().describe("Profile slug")
1961
+ inputSchema: z2.object({
1962
+ name: z2.string().describe("Profile name"),
1963
+ slug: z2.string().describe("Profile slug")
1882
1964
  }),
1883
1965
  execute: async (client, input) => unwrap(await client.media.profiles.create(input))
1884
1966
  }),
1885
1967
  devpad_media_profiles_get: define_tool({
1886
1968
  name: "devpad_media_profiles_get",
1887
1969
  description: "Get a media profile by ID",
1888
- inputSchema: z.object({
1889
- id: z.string().describe("Profile ID")
1970
+ inputSchema: z2.object({
1971
+ id: z2.string().describe("Profile ID")
1890
1972
  }),
1891
1973
  execute: async (client, input) => unwrap(await client.media.profiles.get(input.id))
1892
1974
  }),
1893
1975
  devpad_media_profiles_update: define_tool({
1894
1976
  name: "devpad_media_profiles_update",
1895
1977
  description: "Update a media profile by ID",
1896
- inputSchema: z.object({
1897
- id: z.string().describe("Profile ID"),
1898
- name: z.string().optional().describe("Profile name"),
1899
- slug: z.string().optional().describe("Profile slug")
1978
+ inputSchema: z2.object({
1979
+ id: z2.string().describe("Profile ID"),
1980
+ name: z2.string().optional().describe("Profile name"),
1981
+ slug: z2.string().optional().describe("Profile slug")
1900
1982
  }),
1901
1983
  execute: async (client, input) => {
1902
1984
  const { id, ...data } = input;
@@ -1906,34 +1988,34 @@ var tools = {
1906
1988
  devpad_media_profiles_delete: define_tool({
1907
1989
  name: "devpad_media_profiles_delete",
1908
1990
  description: "Delete a media profile by ID",
1909
- inputSchema: z.object({
1910
- id: z.string().describe("Profile ID")
1991
+ inputSchema: z2.object({
1992
+ id: z2.string().describe("Profile ID")
1911
1993
  }),
1912
1994
  execute: async (client, input) => unwrap(await client.media.profiles.delete(input.id))
1913
1995
  }),
1914
1996
  devpad_media_connections_list: define_tool({
1915
1997
  name: "devpad_media_connections_list",
1916
1998
  description: "List connections for a media profile",
1917
- inputSchema: z.object({
1918
- profile_id: z.string().describe("Profile ID")
1999
+ inputSchema: z2.object({
2000
+ profile_id: z2.string().describe("Profile ID")
1919
2001
  }),
1920
2002
  execute: async (client, input) => unwrap(await client.media.connections.list(input.profile_id))
1921
2003
  }),
1922
2004
  devpad_media_connections_refresh: define_tool({
1923
2005
  name: "devpad_media_connections_refresh",
1924
2006
  description: "Refresh a media connection",
1925
- inputSchema: z.object({
1926
- account_id: z.string().describe("Account/connection ID")
2007
+ inputSchema: z2.object({
2008
+ account_id: z2.string().describe("Account/connection ID")
1927
2009
  }),
1928
2010
  execute: async (client, input) => unwrap(await client.media.connections.refresh(input.account_id))
1929
2011
  }),
1930
2012
  devpad_media_timeline_get: define_tool({
1931
2013
  name: "devpad_media_timeline_get",
1932
2014
  description: "Get media timeline for a user",
1933
- inputSchema: z.object({
1934
- user_id: z.string().describe("User ID"),
1935
- from: z.string().optional().describe("Start date (ISO string)"),
1936
- to: z.string().optional().describe("End date (ISO string)")
2015
+ inputSchema: z2.object({
2016
+ user_id: z2.string().describe("User ID"),
2017
+ from: z2.string().optional().describe("Start date (ISO string)"),
2018
+ to: z2.string().optional().describe("End date (ISO string)")
1937
2019
  }),
1938
2020
  execute: async (client, input) => {
1939
2021
  const { user_id, ...params } = input;
@@ -1944,34 +2026,34 @@ var tools = {
1944
2026
  devpad_pulse_summary: define_tool({
1945
2027
  name: "devpad_pulse_summary",
1946
2028
  description: "Get summary analytics for a project (pageviews, sessions, errors, latency)",
1947
- inputSchema: z.object({
1948
- project_id: z.string().describe("Project ID"),
1949
- range: z.enum(["24h", "7d", "30d", "90d"]).describe("Time range")
2029
+ inputSchema: z2.object({
2030
+ project_id: z2.string().describe("Project ID"),
2031
+ range: z2.enum(["24h", "7d", "30d", "90d"]).describe("Time range")
1950
2032
  }),
1951
2033
  execute: async (client, input) => unwrap(await client.pulse.summary({ project_id: input.project_id, range: input.range }))
1952
2034
  }),
1953
2035
  devpad_pulse_events: define_tool({
1954
2036
  name: "devpad_pulse_events",
1955
2037
  description: "List events for a project with optional filtering",
1956
- inputSchema: z.object({
1957
- project_id: z.string().describe("Project ID"),
1958
- name: z.string().optional().describe("Event name filter (pageview, error, log, etc)"),
1959
- level: z.string().optional().describe("Log level filter (debug, info, warn, error, critical)"),
1960
- ts_from: z.number().optional().describe("Start timestamp (unix ms)"),
1961
- ts_to: z.number().optional().describe("End timestamp (unix ms)"),
1962
- search: z.string().optional().describe("Search substring in event properties"),
1963
- limit: z.number().optional().describe("Max events to return (max 500)"),
1964
- cursor: z.string().optional().describe("Pagination cursor")
2038
+ inputSchema: z2.object({
2039
+ project_id: z2.string().describe("Project ID"),
2040
+ name: z2.string().optional().describe("Event name filter (pageview, error, log, etc)"),
2041
+ level: z2.string().optional().describe("Log level filter (debug, info, warn, error, critical)"),
2042
+ ts_from: z2.number().optional().describe("Start timestamp (unix ms)"),
2043
+ ts_to: z2.number().optional().describe("End timestamp (unix ms)"),
2044
+ search: z2.string().optional().describe("Search substring in event properties"),
2045
+ limit: z2.number().optional().describe("Max events to return (max 500)"),
2046
+ cursor: z2.string().optional().describe("Pagination cursor")
1965
2047
  }),
1966
2048
  execute: async (client, input) => unwrap(await client.pulse.events(input))
1967
2049
  }),
1968
2050
  devpad_pulse_errors: define_tool({
1969
2051
  name: "devpad_pulse_errors",
1970
2052
  description: "List error issues for a project, optionally grouped by fingerprint",
1971
- inputSchema: z.object({
1972
- project_id: z.string().describe("Project ID"),
1973
- range: z.enum(["24h", "7d", "30d", "90d"]).describe("Time range"),
1974
- group_by_fingerprint: z.boolean().optional().describe("Group by error fingerprint (true) or list all (false)")
2053
+ inputSchema: z2.object({
2054
+ project_id: z2.string().describe("Project ID"),
2055
+ range: z2.enum(["24h", "7d", "30d", "90d"]).describe("Time range"),
2056
+ group_by_fingerprint: z2.boolean().optional().describe("Group by error fingerprint (true) or list all (false)")
1975
2057
  }),
1976
2058
  execute: async (client, input) => unwrap(
1977
2059
  await client.pulse.errors({
@@ -1984,99 +2066,99 @@ var tools = {
1984
2066
  devpad_pulse_logs: define_tool({
1985
2067
  name: "devpad_pulse_logs",
1986
2068
  description: "List logs for a project with optional level and message filtering",
1987
- inputSchema: z.object({
1988
- project_id: z.string().describe("Project ID"),
1989
- range: z.enum(["24h", "7d", "30d", "90d"]).describe("Time range"),
1990
- level: z.string().optional().describe("Log level filter"),
1991
- search: z.string().optional().describe("Search in log messages")
2069
+ inputSchema: z2.object({
2070
+ project_id: z2.string().describe("Project ID"),
2071
+ range: z2.enum(["24h", "7d", "30d", "90d"]).describe("Time range"),
2072
+ level: z2.string().optional().describe("Log level filter"),
2073
+ search: z2.string().optional().describe("Search in log messages")
1992
2074
  }),
1993
2075
  execute: async (client, input) => unwrap(await client.pulse.logs(input))
1994
2076
  }),
1995
2077
  devpad_pulse_latency: define_tool({
1996
2078
  name: "devpad_pulse_latency",
1997
2079
  description: "Get request latency metrics (p50, p95, p99) for a project",
1998
- inputSchema: z.object({
1999
- project_id: z.string().describe("Project ID"),
2000
- range: z.enum(["24h", "7d", "30d", "90d"]).describe("Time range"),
2001
- route: z.string().optional().describe("Filter by HTTP route"),
2002
- percentiles: z.array(z.number()).optional().describe("Percentiles to compute (default [50, 95, 99])")
2080
+ inputSchema: z2.object({
2081
+ project_id: z2.string().describe("Project ID"),
2082
+ range: z2.enum(["24h", "7d", "30d", "90d"]).describe("Time range"),
2083
+ route: z2.string().optional().describe("Filter by HTTP route"),
2084
+ percentiles: z2.array(z2.number()).optional().describe("Percentiles to compute (default [50, 95, 99])")
2003
2085
  }),
2004
2086
  execute: async (client, input) => unwrap(await client.pulse.latency(input))
2005
2087
  }),
2006
2088
  devpad_alerts_list: define_tool({
2007
2089
  name: "devpad_alerts_list",
2008
2090
  description: "List notification subscriptions (alerts) for a project",
2009
- inputSchema: z.object({
2010
- project_id: z.string().describe("Project ID")
2091
+ inputSchema: z2.object({
2092
+ project_id: z2.string().describe("Project ID")
2011
2093
  }),
2012
2094
  execute: async (client, input) => unwrap(await client.pulse.subs.list(input))
2013
2095
  }),
2014
2096
  devpad_alerts_subscribe: define_tool({
2015
2097
  name: "devpad_alerts_subscribe",
2016
2098
  description: "Create a new notification subscription (alert) for events",
2017
- inputSchema: z.object({
2018
- project_id: z.string().describe("Project ID"),
2019
- name: z.string().describe("Subscription name"),
2020
- filter: z.record(z.any()).describe("Event filter (name, level, url_pattern, properties)"),
2021
- channel: z.record(z.any()).describe("Notification channel (kind + config: discord, ntfy, email)"),
2022
- cooldown_seconds: z.number().optional().describe("Cooldown between notifications (default 60)")
2099
+ inputSchema: z2.object({
2100
+ project_id: z2.string().describe("Project ID"),
2101
+ name: z2.string().describe("Subscription name"),
2102
+ filter: z2.record(z2.any()).describe("Event filter (name, level, url_pattern, properties)"),
2103
+ channel: z2.record(z2.any()).describe("Notification channel (kind + config: discord, ntfy, email)"),
2104
+ cooldown_seconds: z2.number().optional().describe("Cooldown between notifications (default 60)")
2023
2105
  }),
2024
2106
  execute: async (client, input) => unwrap(await client.pulse.subs.create(input))
2025
2107
  }),
2026
2108
  devpad_alerts_unsubscribe: define_tool({
2027
2109
  name: "devpad_alerts_unsubscribe",
2028
2110
  description: "Delete a notification subscription by ID",
2029
- inputSchema: z.object({
2030
- id: z.string().describe("Subscription ID")
2111
+ inputSchema: z2.object({
2112
+ id: z2.string().describe("Subscription ID")
2031
2113
  }),
2032
2114
  execute: async (client, input) => unwrap(await client.pulse.subs.delete(input.id))
2033
2115
  }),
2034
2116
  devpad_pulse_key_create: define_tool({
2035
2117
  name: "devpad_pulse_key_create",
2036
2118
  description: "Create a new ingest key for a project (returns plaintext once)",
2037
- inputSchema: z.object({
2038
- project_id: z.string().describe("Project ID"),
2039
- name: z.string().optional().describe("Key name/label"),
2040
- rate_limit_per_min: z.number().optional().describe("Rate limit in requests per minute (default 600)")
2119
+ inputSchema: z2.object({
2120
+ project_id: z2.string().describe("Project ID"),
2121
+ name: z2.string().optional().describe("Key name/label"),
2122
+ rate_limit_per_min: z2.number().optional().describe("Rate limit in requests per minute (default 600)")
2041
2123
  }),
2042
2124
  execute: async (client, input) => unwrap(await client.pulse.keys.create(input))
2043
2125
  }),
2044
2126
  devpad_pipelines_list: define_tool({
2045
2127
  name: "devpad_pipelines_list",
2046
2128
  description: "List pipeline runs (newest first). Optionally filter by package and/or status; cap limit at 200.",
2047
- inputSchema: z.object({
2048
- package_id: z.string().optional().describe("Filter runs to a specific package"),
2049
- status: z.enum(RUN_STATUSES).optional().describe("Filter by run status"),
2050
- limit: z.number().int().positive().max(200).optional().describe("Max rows to return (default 50, cap 200)")
2129
+ inputSchema: z2.object({
2130
+ package_id: z2.string().optional().describe("Filter runs to a specific package"),
2131
+ status: z2.enum(RUN_STATUSES).optional().describe("Filter by run status"),
2132
+ limit: z2.number().int().positive().max(200).optional().describe("Max rows to return (default 50, cap 200)")
2051
2133
  }),
2052
2134
  execute: async (client, input) => unwrap(await client.pipelines.list(input))
2053
2135
  }),
2054
2136
  devpad_pipelines_get: define_tool({
2055
2137
  name: "devpad_pipelines_get",
2056
2138
  description: "Get a pipeline run by ID",
2057
- inputSchema: z.object({
2058
- run_id: z.string().describe("Pipeline run ID")
2139
+ inputSchema: z2.object({
2140
+ run_id: z2.string().describe("Pipeline run ID")
2059
2141
  }),
2060
2142
  execute: async (client, input) => unwrap(await client.pipelines.get(input.run_id))
2061
2143
  }),
2062
2144
  devpad_pipelines_create: define_tool({
2063
2145
  name: "devpad_pipelines_create",
2064
2146
  description: "Create a new pipeline run",
2065
- inputSchema: z.object({
2066
- package_id: z.string().describe("Package ID"),
2067
- version_set_id: z.string().describe("Version set ID to deploy")
2147
+ inputSchema: z2.object({
2148
+ package_id: z2.string().describe("Package ID"),
2149
+ version_set_id: z2.string().describe("Version set ID to deploy")
2068
2150
  }),
2069
2151
  execute: async (client, input) => unwrap(await client.pipelines.create(input))
2070
2152
  }),
2071
2153
  devpad_pipelines_approve: define_tool({
2072
2154
  name: "devpad_pipelines_approve",
2073
2155
  description: "Approve or deny a stage in a pipeline run",
2074
- inputSchema: z.object({
2075
- run_id: z.string().describe("Pipeline run ID"),
2076
- stage_name: z.string().describe("Stage name to approve"),
2077
- decision: z.enum(["approved", "denied"]).describe("Approval decision"),
2078
- user_id: z.string().describe("User ID making the decision"),
2079
- reason: z.string().optional().describe("Optional reason for the decision")
2156
+ inputSchema: z2.object({
2157
+ run_id: z2.string().describe("Pipeline run ID"),
2158
+ stage_name: z2.string().describe("Stage name to approve"),
2159
+ decision: z2.enum(["approved", "denied"]).describe("Approval decision"),
2160
+ user_id: z2.string().describe("User ID making the decision"),
2161
+ reason: z2.string().optional().describe("Optional reason for the decision")
2080
2162
  }),
2081
2163
  execute: async (client, input) => {
2082
2164
  unwrap(await client.pipelines.approve(input.run_id, input));
@@ -2086,8 +2168,8 @@ var tools = {
2086
2168
  devpad_pipelines_cancel: define_tool({
2087
2169
  name: "devpad_pipelines_cancel",
2088
2170
  description: "Cancel a pipeline run",
2089
- inputSchema: z.object({
2090
- run_id: z.string().describe("Pipeline run ID")
2171
+ inputSchema: z2.object({
2172
+ run_id: z2.string().describe("Pipeline run ID")
2091
2173
  }),
2092
2174
  execute: async (client, input) => {
2093
2175
  unwrap(await client.pipelines.cancel(input.run_id));
@@ -2097,8 +2179,8 @@ var tools = {
2097
2179
  devpad_pipelines_rollback: define_tool({
2098
2180
  name: "devpad_pipelines_rollback",
2099
2181
  description: "Rollback a completed or failed pipeline run",
2100
- inputSchema: z.object({
2101
- run_id: z.string().describe("Pipeline run ID")
2182
+ inputSchema: z2.object({
2183
+ run_id: z2.string().describe("Pipeline run ID")
2102
2184
  }),
2103
2185
  execute: async (client, input) => {
2104
2186
  unwrap(await client.pipelines.rollback(input.run_id));
@@ -2108,12 +2190,12 @@ var tools = {
2108
2190
  devpad_pipelines_runs_events_ingest: define_tool({
2109
2191
  name: "devpad_pipelines_runs_events_ingest",
2110
2192
  description: 'Ingest an external webhook event against an in-flight pipeline run. Idempotent on (idempotency_key, payload). Server-side stamps payload.source = "external".',
2111
- inputSchema: z.object({
2112
- run_id: z.string().describe("Pipeline run ID"),
2113
- stage_name: z.string().min(1).describe("Stage the event is associated with"),
2114
- kind: z.enum(STAGE_EVENT_KINDS).describe("Event kind from STAGE_EVENT_KINDS"),
2115
- payload: z.unknown().optional().describe("Arbitrary JSON payload \u2014 server-side stamps source = external"),
2116
- idempotency_key: z.string().uuid().describe("UUID idempotency key; reuse with the same payload returns duplicated:true")
2193
+ inputSchema: z2.object({
2194
+ run_id: z2.string().describe("Pipeline run ID"),
2195
+ stage_name: z2.string().min(1).describe("Stage the event is associated with"),
2196
+ kind: z2.enum(STAGE_EVENT_KINDS).describe("Event kind from STAGE_EVENT_KINDS"),
2197
+ payload: z2.unknown().optional().describe("Arbitrary JSON payload \u2014 server-side stamps source = external"),
2198
+ idempotency_key: z2.string().uuid().describe("UUID idempotency key; reuse with the same payload returns duplicated:true")
2117
2199
  }),
2118
2200
  execute: async (client, input) => unwrap(
2119
2201
  await client.pipelines.events.ingest(input.run_id, {
@@ -2127,76 +2209,76 @@ var tools = {
2127
2209
  devpad_pipelines_runs_events_list: define_tool({
2128
2210
  name: "devpad_pipelines_runs_events_list",
2129
2211
  description: "List stored stage events for a pipeline run, newest-first",
2130
- inputSchema: z.object({
2131
- run_id: z.string().describe("Pipeline run ID")
2212
+ inputSchema: z2.object({
2213
+ run_id: z2.string().describe("Pipeline run ID")
2132
2214
  }),
2133
2215
  execute: async (client, input) => unwrap(await client.pipelines.events.list(input.run_id))
2134
2216
  }),
2135
2217
  devpad_pipelines_grants_list: define_tool({
2136
2218
  name: "devpad_pipelines_grants_list",
2137
2219
  description: "List vault grants for a pipeline package",
2138
- inputSchema: z.object({
2139
- package_id: z.string().describe("Package ID to filter grants by")
2220
+ inputSchema: z2.object({
2221
+ package_id: z2.string().describe("Package ID to filter grants by")
2140
2222
  }),
2141
2223
  execute: async (client, input) => unwrap(await client.pipelines.grants.list(input.package_id))
2142
2224
  }),
2143
2225
  devpad_pipelines_grants_approve: define_tool({
2144
2226
  name: "devpad_pipelines_grants_approve",
2145
2227
  description: "Approve a pending vault grant request for a pipeline package",
2146
- inputSchema: z.object({
2147
- grant_id: z.string().describe("Grant ID to approve"),
2148
- user_id: z.string().describe("User ID making the approval decision")
2228
+ inputSchema: z2.object({
2229
+ grant_id: z2.string().describe("Grant ID to approve"),
2230
+ user_id: z2.string().describe("User ID making the approval decision")
2149
2231
  }),
2150
2232
  execute: async (client, input) => unwrap(await client.pipelines.grants.approve(input.grant_id, input.user_id))
2151
2233
  }),
2152
2234
  devpad_pipelines_grants_deny: define_tool({
2153
2235
  name: "devpad_pipelines_grants_deny",
2154
2236
  description: "Deny a pending vault grant request for a pipeline package",
2155
- inputSchema: z.object({
2156
- grant_id: z.string().describe("Grant ID to deny"),
2157
- user_id: z.string().describe("User ID making the denial decision"),
2158
- reason: z.string().optional().describe("Optional reason for the denial")
2237
+ inputSchema: z2.object({
2238
+ grant_id: z2.string().describe("Grant ID to deny"),
2239
+ user_id: z2.string().describe("User ID making the denial decision"),
2240
+ reason: z2.string().optional().describe("Optional reason for the denial")
2159
2241
  }),
2160
2242
  execute: async (client, input) => unwrap(await client.pipelines.grants.deny(input.grant_id, input.user_id, input.reason))
2161
2243
  }),
2162
2244
  devpad_pipelines_packages_list: define_tool({
2163
2245
  name: "devpad_pipelines_packages_list",
2164
2246
  description: "List pipeline packages. Optionally filter by linked devpad project_id; unlinked packages have project_id = null.",
2165
- inputSchema: z.object({
2166
- project_id: z.string().optional().describe("Filter packages by linked devpad project")
2247
+ inputSchema: z2.object({
2248
+ project_id: z2.string().optional().describe("Filter packages by linked devpad project")
2167
2249
  }),
2168
2250
  execute: async (client, input) => unwrap(await client.pipelines.packages.list(input))
2169
2251
  }),
2170
2252
  devpad_pipelines_packages_get: define_tool({
2171
2253
  name: "devpad_pipelines_packages_get",
2172
2254
  description: "Get a pipeline package by ID",
2173
- inputSchema: z.object({
2174
- package_id: z.string().describe("Pipeline package ID")
2255
+ inputSchema: z2.object({
2256
+ package_id: z2.string().describe("Pipeline package ID")
2175
2257
  }),
2176
2258
  execute: async (client, input) => unwrap(await client.pipelines.packages.get(input.package_id))
2177
2259
  }),
2178
2260
  devpad_pipelines_packages_create: define_tool({
2179
2261
  name: "devpad_pipelines_packages_create",
2180
2262
  description: "Register a new pipeline-managed package. By convention `id` equals the package `name`. `project_id` optionally links the package to a devpad project.",
2181
- inputSchema: z.object({
2182
- id: z.string().describe("Canonical package ID (typically the same as name)"),
2183
- name: z.string().describe("Package name"),
2184
- owner_id: z.string().describe("User ID of the owner"),
2185
- repo_url: z.string().optional().describe("Optional git repo URL"),
2186
- project_id: z.string().optional().describe("Optional devpad project ID to link"),
2187
- default_template_ref: z.string().optional().describe("Optional default pipeline template ref")
2263
+ inputSchema: z2.object({
2264
+ id: z2.string().describe("Canonical package ID (typically the same as name)"),
2265
+ name: z2.string().describe("Package name"),
2266
+ owner_id: z2.string().describe("User ID of the owner"),
2267
+ repo_url: z2.string().optional().describe("Optional git repo URL"),
2268
+ project_id: z2.string().optional().describe("Optional devpad project ID to link"),
2269
+ default_template_ref: z2.string().optional().describe("Optional default pipeline template ref")
2188
2270
  }),
2189
2271
  execute: async (client, input) => unwrap(await client.pipelines.packages.create(input))
2190
2272
  }),
2191
2273
  devpad_pipelines_packages_update: define_tool({
2192
2274
  name: "devpad_pipelines_packages_update",
2193
2275
  description: "Partially update a pipeline package. Only the provided fields are touched.",
2194
- inputSchema: z.object({
2195
- id: z.string().describe("Pipeline package ID"),
2196
- repo_url: z.string().nullable().optional(),
2197
- project_id: z.string().nullable().optional(),
2198
- default_template_ref: z.string().nullable().optional(),
2199
- script_name_overrides: z.record(z.string(), z.string()).nullable().optional()
2276
+ inputSchema: z2.object({
2277
+ id: z2.string().describe("Pipeline package ID"),
2278
+ repo_url: z2.string().nullable().optional(),
2279
+ project_id: z2.string().nullable().optional(),
2280
+ default_template_ref: z2.string().nullable().optional(),
2281
+ script_name_overrides: z2.record(z2.string(), z2.string()).nullable().optional()
2200
2282
  }),
2201
2283
  execute: async (client, input) => {
2202
2284
  const { id, ...patch } = input;
@@ -2206,50 +2288,50 @@ var tools = {
2206
2288
  devpad_pipelines_packages_delete: define_tool({
2207
2289
  name: "devpad_pipelines_packages_delete",
2208
2290
  description: "Delete a pipeline package. Refuses with conflict if existing pipeline_run rows still reference the package.",
2209
- inputSchema: z.object({
2210
- id: z.string().describe("Pipeline package ID")
2291
+ inputSchema: z2.object({
2292
+ id: z2.string().describe("Pipeline package ID")
2211
2293
  }),
2212
2294
  execute: async (client, input) => unwrap(await client.pipelines.packages.delete(input.id))
2213
2295
  }),
2214
2296
  devpad_pipelines_analysis_templates_list: define_tool({
2215
2297
  name: "devpad_pipelines_analysis_templates_list",
2216
2298
  description: "List pipeline analysis templates for an owner. Each row encodes the threshold DSL + window referenced by analysis-gate evaluations.",
2217
- inputSchema: z.object({
2218
- owner_id: z.string().describe("Devpad user ID whose templates to list")
2299
+ inputSchema: z2.object({
2300
+ owner_id: z2.string().describe("Devpad user ID whose templates to list")
2219
2301
  }),
2220
2302
  execute: async (client, input) => unwrap(await client.pipelines.analysis_templates.list(input))
2221
2303
  }),
2222
2304
  devpad_pipelines_analysis_templates_get: define_tool({
2223
2305
  name: "devpad_pipelines_analysis_templates_get",
2224
2306
  description: "Get a single pipeline analysis template by id, scoped to its owner.",
2225
- inputSchema: z.object({
2226
- id: z.string().describe("Pipeline analysis template ID"),
2227
- owner_id: z.string().describe("Owner ID (must match the template's owner)")
2307
+ inputSchema: z2.object({
2308
+ id: z2.string().describe("Pipeline analysis template ID"),
2309
+ owner_id: z2.string().describe("Owner ID (must match the template's owner)")
2228
2310
  }),
2229
2311
  execute: async (client, input) => unwrap(await client.pipelines.analysis_templates.get(input.id, { owner_id: input.owner_id }))
2230
2312
  }),
2231
2313
  devpad_pipelines_analysis_templates_create: define_tool({
2232
2314
  name: "devpad_pipelines_analysis_templates_create",
2233
2315
  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).',
2234
- inputSchema: z.object({
2235
- owner_id: z.string().describe("Devpad user ID who owns this template"),
2236
- name: z.string().describe('Human-readable name (e.g. "default-analysis")'),
2237
- threshold_dsl: z.string().describe("Multi-line threshold DSL"),
2238
- query_dsl: z.unknown().optional().describe("Optional structured query DSL stored alongside thresholds"),
2239
- window_ms: z.number().int().positive().optional().describe("Analysis window in milliseconds. Default: 600000")
2316
+ inputSchema: z2.object({
2317
+ owner_id: z2.string().describe("Devpad user ID who owns this template"),
2318
+ name: z2.string().describe('Human-readable name (e.g. "default-analysis")'),
2319
+ threshold_dsl: z2.string().describe("Multi-line threshold DSL"),
2320
+ query_dsl: z2.unknown().optional().describe("Optional structured query DSL stored alongside thresholds"),
2321
+ window_ms: z2.number().int().positive().optional().describe("Analysis window in milliseconds. Default: 600000")
2240
2322
  }),
2241
2323
  execute: async (client, input) => unwrap(await client.pipelines.analysis_templates.create(input))
2242
2324
  }),
2243
2325
  devpad_pipelines_analysis_templates_update: define_tool({
2244
2326
  name: "devpad_pipelines_analysis_templates_update",
2245
2327
  description: "Partially update a pipeline analysis template. Only the supplied fields are touched. Re-validates threshold_dsl when present.",
2246
- inputSchema: z.object({
2247
- id: z.string().describe("Pipeline analysis template ID"),
2248
- owner_id: z.string().describe("Owner ID (must match the template's owner)"),
2249
- name: z.string().optional(),
2250
- threshold_dsl: z.string().optional(),
2251
- query_dsl: z.unknown().optional(),
2252
- window_ms: z.number().int().positive().optional()
2328
+ inputSchema: z2.object({
2329
+ id: z2.string().describe("Pipeline analysis template ID"),
2330
+ owner_id: z2.string().describe("Owner ID (must match the template's owner)"),
2331
+ name: z2.string().optional(),
2332
+ threshold_dsl: z2.string().optional(),
2333
+ query_dsl: z2.unknown().optional(),
2334
+ window_ms: z2.number().int().positive().optional()
2253
2335
  }),
2254
2336
  execute: async (client, input) => {
2255
2337
  const { id, ...patch } = input;
@@ -2259,48 +2341,48 @@ var tools = {
2259
2341
  devpad_pipelines_analysis_templates_delete: define_tool({
2260
2342
  name: "devpad_pipelines_analysis_templates_delete",
2261
2343
  description: "Hard-delete a pipeline analysis template. Does NOT consult pipeline_run.resolved_gates \u2014 runs snapshot their gate template at resolve-time, so deletion never orphans in-flight runs.",
2262
- inputSchema: z.object({
2263
- id: z.string().describe("Pipeline analysis template ID"),
2264
- owner_id: z.string().describe("Owner ID (must match the template's owner)")
2344
+ inputSchema: z2.object({
2345
+ id: z2.string().describe("Pipeline analysis template ID"),
2346
+ owner_id: z2.string().describe("Owner ID (must match the template's owner)")
2265
2347
  }),
2266
2348
  execute: async (client, input) => unwrap(await client.pipelines.analysis_templates.delete(input.id, { owner_id: input.owner_id }))
2267
2349
  }),
2268
2350
  devpad_pipelines_oidc_trust_list: define_tool({
2269
2351
  name: "devpad_pipelines_oidc_trust_list",
2270
2352
  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.",
2271
- inputSchema: z.object({
2272
- owner_id: z.string().describe("User ID whose trust policies to list")
2353
+ inputSchema: z2.object({
2354
+ owner_id: z2.string().describe("User ID whose trust policies to list")
2273
2355
  }),
2274
2356
  execute: async (client, input) => unwrap(await client.pipelines.oidc_trust.list(input))
2275
2357
  }),
2276
2358
  devpad_pipelines_oidc_trust_create: define_tool({
2277
2359
  name: "devpad_pipelines_oidc_trust_create",
2278
2360
  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.',
2279
- inputSchema: z.object({
2280
- owner_id: z.string().describe("Devpad user ID who owns this policy"),
2281
- github_owner: z.string().describe('GitHub `repository_owner` claim to trust (e.g. "f0rbit")'),
2282
- expected_audience: z.string().describe("Required `aud` claim on the OIDC token \u2014 typically the orchestrator URL"),
2283
- repo_pattern: z.string().optional().describe('Glob matched against the repo name ("*" matches all). Default: "*"'),
2284
- allowed_refs: z.array(z.string()).optional().describe('Allowed Git refs (e.g. ["refs/heads/main"]). Empty/omitted = any ref'),
2285
- allowed_environments: z.array(z.string()).optional().describe("Allowed GitHub environments. Empty/omitted = any"),
2286
- allowed_actions: z.array(z.string()).optional().describe('Scope strings granted to session tokens. Default: ["artifacts:upload","runs:start"]'),
2287
- session_ttl_seconds: z.number().int().positive().optional().describe("Session token TTL. Default: 900 (15 min)")
2361
+ inputSchema: z2.object({
2362
+ owner_id: z2.string().describe("Devpad user ID who owns this policy"),
2363
+ github_owner: z2.string().describe('GitHub `repository_owner` claim to trust (e.g. "f0rbit")'),
2364
+ expected_audience: z2.string().describe("Required `aud` claim on the OIDC token \u2014 typically the orchestrator URL"),
2365
+ repo_pattern: z2.string().optional().describe('Glob matched against the repo name ("*" matches all). Default: "*"'),
2366
+ allowed_refs: z2.array(z2.string()).optional().describe('Allowed Git refs (e.g. ["refs/heads/main"]). Empty/omitted = any ref'),
2367
+ allowed_environments: z2.array(z2.string()).optional().describe("Allowed GitHub environments. Empty/omitted = any"),
2368
+ allowed_actions: z2.array(z2.string()).optional().describe('Scope strings granted to session tokens. Default: ["artifacts:upload","runs:start"]'),
2369
+ session_ttl_seconds: z2.number().int().positive().optional().describe("Session token TTL. Default: 900 (15 min)")
2288
2370
  }),
2289
2371
  execute: async (client, input) => unwrap(await client.pipelines.oidc_trust.create(input))
2290
2372
  }),
2291
2373
  devpad_pipelines_oidc_trust_update: define_tool({
2292
2374
  name: "devpad_pipelines_oidc_trust_update",
2293
2375
  description: "Partially update a GitHub Actions OIDC trust policy. Only the supplied fields are touched; validation runs server-side against the merged record.",
2294
- inputSchema: z.object({
2295
- id: z.string().describe("Trust policy ID"),
2296
- owner_id: z.string().describe("Owner ID (must match the policy's owner)"),
2297
- github_owner: z.string().optional(),
2298
- expected_audience: z.string().optional(),
2299
- repo_pattern: z.string().optional(),
2300
- allowed_refs: z.array(z.string()).optional(),
2301
- allowed_environments: z.array(z.string()).optional(),
2302
- allowed_actions: z.array(z.string()).optional(),
2303
- session_ttl_seconds: z.number().int().positive().optional()
2376
+ inputSchema: z2.object({
2377
+ id: z2.string().describe("Trust policy ID"),
2378
+ owner_id: z2.string().describe("Owner ID (must match the policy's owner)"),
2379
+ github_owner: z2.string().optional(),
2380
+ expected_audience: z2.string().optional(),
2381
+ repo_pattern: z2.string().optional(),
2382
+ allowed_refs: z2.array(z2.string()).optional(),
2383
+ allowed_environments: z2.array(z2.string()).optional(),
2384
+ allowed_actions: z2.array(z2.string()).optional(),
2385
+ session_ttl_seconds: z2.number().int().positive().optional()
2304
2386
  }),
2305
2387
  execute: async (client, input) => {
2306
2388
  const { id, ...patch } = input;
@@ -2310,9 +2392,9 @@ var tools = {
2310
2392
  devpad_pipelines_oidc_trust_delete: define_tool({
2311
2393
  name: "devpad_pipelines_oidc_trust_delete",
2312
2394
  description: "Soft-delete a GitHub Actions OIDC trust policy. The row is preserved for audit; the matcher and list operations skip soft-deleted rows.",
2313
- inputSchema: z.object({
2314
- id: z.string().describe("Trust policy ID"),
2315
- owner_id: z.string().describe("Owner ID (must match the policy's owner)")
2395
+ inputSchema: z2.object({
2396
+ id: z2.string().describe("Trust policy ID"),
2397
+ owner_id: z2.string().describe("Owner ID (must match the policy's owner)")
2316
2398
  }),
2317
2399
  execute: async (client, input) => unwrap(await client.pipelines.oidc_trust.delete(input.id, { owner_id: input.owner_id }))
2318
2400
  })
@@ -2332,6 +2414,7 @@ export {
2332
2414
  getUserFriendlyErrorMessage,
2333
2415
  ok,
2334
2416
  parseZodErrors,
2417
+ pulseSummaryHasData,
2335
2418
  toolNames,
2336
2419
  tools,
2337
2420
  wrap