@papicandela/mcx-adapters 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,268 @@
1
+ import { AdapterDefinition, AdapterTool } from './base.js';
2
+ import { z } from 'zod';
3
+
4
+ /**
5
+ * Configuration schema for GitHub adapter
6
+ */
7
+ declare const GitHubConfigSchema: z.ZodObject<{
8
+ token: z.ZodString;
9
+ baseUrl: z.ZodOptional<z.ZodString>;
10
+ debug: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ debug: boolean;
13
+ token: string;
14
+ baseUrl?: string | undefined;
15
+ }, {
16
+ token: string;
17
+ debug?: boolean | undefined;
18
+ baseUrl?: string | undefined;
19
+ }>;
20
+ type GitHubConfig = z.infer<typeof GitHubConfigSchema>;
21
+ /**
22
+ * Repository information
23
+ */
24
+ interface Repository {
25
+ id: number;
26
+ name: string;
27
+ full_name: string;
28
+ description: string | null;
29
+ private: boolean;
30
+ html_url: string;
31
+ clone_url: string;
32
+ default_branch: string;
33
+ stargazers_count: number;
34
+ forks_count: number;
35
+ open_issues_count: number;
36
+ language: string | null;
37
+ created_at: string;
38
+ updated_at: string;
39
+ }
40
+ /**
41
+ * Issue information
42
+ */
43
+ interface Issue {
44
+ id: number;
45
+ number: number;
46
+ title: string;
47
+ body: string | null;
48
+ state: "open" | "closed";
49
+ html_url: string;
50
+ user: {
51
+ login: string;
52
+ id: number;
53
+ } | null;
54
+ labels: Array<{
55
+ name: string;
56
+ color: string;
57
+ }>;
58
+ assignees: Array<{
59
+ login: string;
60
+ id: number;
61
+ }>;
62
+ milestone: {
63
+ title: string;
64
+ number: number;
65
+ } | null;
66
+ created_at: string;
67
+ updated_at: string;
68
+ closed_at: string | null;
69
+ }
70
+ /**
71
+ * Pull request information
72
+ */
73
+ interface PullRequest {
74
+ id: number;
75
+ number: number;
76
+ title: string;
77
+ body: string | null;
78
+ state: "open" | "closed";
79
+ html_url: string;
80
+ user: {
81
+ login: string;
82
+ id: number;
83
+ } | null;
84
+ head: {
85
+ ref: string;
86
+ sha: string;
87
+ };
88
+ base: {
89
+ ref: string;
90
+ sha: string;
91
+ };
92
+ merged: boolean;
93
+ mergeable: boolean | null;
94
+ draft: boolean;
95
+ labels: Array<{
96
+ name: string;
97
+ color: string;
98
+ }>;
99
+ assignees: Array<{
100
+ login: string;
101
+ id: number;
102
+ }>;
103
+ created_at: string;
104
+ updated_at: string;
105
+ merged_at: string | null;
106
+ closed_at: string | null;
107
+ }
108
+ /**
109
+ * Options for listing issues
110
+ */
111
+ interface ListIssuesOptions {
112
+ state?: "open" | "closed" | "all";
113
+ labels?: string[];
114
+ assignee?: string;
115
+ creator?: string;
116
+ milestone?: string | number;
117
+ sort?: "created" | "updated" | "comments";
118
+ direction?: "asc" | "desc";
119
+ since?: string;
120
+ per_page?: number;
121
+ page?: number;
122
+ }
123
+ /**
124
+ * Options for listing pull requests
125
+ */
126
+ interface ListPRsOptions {
127
+ state?: "open" | "closed" | "all";
128
+ head?: string;
129
+ base?: string;
130
+ sort?: "created" | "updated" | "popularity" | "long-running";
131
+ direction?: "asc" | "desc";
132
+ per_page?: number;
133
+ page?: number;
134
+ }
135
+ /**
136
+ * Create a GitHub adapter instance
137
+ */
138
+ declare function createGitHubAdapter(config: GitHubConfig): AdapterDefinition<z.ZodObject<{
139
+ token: z.ZodString;
140
+ baseUrl: z.ZodOptional<z.ZodString>;
141
+ debug: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
142
+ }, "strip", z.ZodTypeAny, {
143
+ debug: boolean;
144
+ token: string;
145
+ baseUrl?: string | undefined;
146
+ }, {
147
+ token: string;
148
+ debug?: boolean | undefined;
149
+ baseUrl?: string | undefined;
150
+ }>, Record<string, AdapterTool<unknown, unknown>>>;
151
+ /**
152
+ * Pre-configured GitHub adapter definition
153
+ * Use createGitHubAdapter() for runtime instantiation
154
+ */
155
+ declare const github: AdapterDefinition<z.ZodObject<{
156
+ token: z.ZodString;
157
+ baseUrl: z.ZodOptional<z.ZodString>;
158
+ debug: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
159
+ }, "strip", z.ZodTypeAny, {
160
+ debug: boolean;
161
+ token: string;
162
+ baseUrl?: string | undefined;
163
+ }, {
164
+ token: string;
165
+ debug?: boolean | undefined;
166
+ baseUrl?: string | undefined;
167
+ }>, {
168
+ getRepo: {
169
+ description: string;
170
+ parameters: {
171
+ owner: {
172
+ type: "string";
173
+ required: true;
174
+ };
175
+ repo: {
176
+ type: "string";
177
+ required: true;
178
+ };
179
+ };
180
+ execute: () => Promise<never>;
181
+ };
182
+ listIssues: {
183
+ description: string;
184
+ parameters: {
185
+ owner: {
186
+ type: "string";
187
+ required: true;
188
+ };
189
+ repo: {
190
+ type: "string";
191
+ required: true;
192
+ };
193
+ options: {
194
+ type: "object";
195
+ };
196
+ };
197
+ execute: () => Promise<never>;
198
+ };
199
+ createIssue: {
200
+ description: string;
201
+ parameters: {
202
+ owner: {
203
+ type: "string";
204
+ required: true;
205
+ };
206
+ repo: {
207
+ type: "string";
208
+ required: true;
209
+ };
210
+ title: {
211
+ type: "string";
212
+ required: true;
213
+ };
214
+ body: {
215
+ type: "string";
216
+ };
217
+ };
218
+ execute: () => Promise<never>;
219
+ };
220
+ listPRs: {
221
+ description: string;
222
+ parameters: {
223
+ owner: {
224
+ type: "string";
225
+ required: true;
226
+ };
227
+ repo: {
228
+ type: "string";
229
+ required: true;
230
+ };
231
+ options: {
232
+ type: "object";
233
+ };
234
+ };
235
+ execute: () => Promise<never>;
236
+ };
237
+ createPR: {
238
+ description: string;
239
+ parameters: {
240
+ owner: {
241
+ type: "string";
242
+ required: true;
243
+ };
244
+ repo: {
245
+ type: "string";
246
+ required: true;
247
+ };
248
+ title: {
249
+ type: "string";
250
+ required: true;
251
+ };
252
+ body: {
253
+ type: "string";
254
+ };
255
+ head: {
256
+ type: "string";
257
+ required: true;
258
+ };
259
+ base: {
260
+ type: "string";
261
+ required: true;
262
+ };
263
+ };
264
+ execute: () => Promise<never>;
265
+ };
266
+ }>;
267
+
268
+ export { type GitHubConfig, GitHubConfigSchema, type Issue, type ListIssuesOptions, type ListPRsOptions, type PullRequest, type Repository, createGitHubAdapter, github };