@github-tools/sdk 1.9.0 → 1.11.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.
Files changed (44) hide show
  1. package/README.md +86 -27
  2. package/dist/connect/eve.d.mts +16 -10
  3. package/dist/connect/eve.d.mts.map +1 -1
  4. package/dist/connect/eve.mjs +21 -11
  5. package/dist/connect/eve.mjs.map +1 -1
  6. package/dist/connect.d.mts +123 -10
  7. package/dist/connect.d.mts.map +1 -1
  8. package/dist/connect.mjs +3 -3
  9. package/dist/eve-runtime-BqfQZAP7.d.mts +54 -0
  10. package/dist/eve-runtime-BqfQZAP7.d.mts.map +1 -0
  11. package/dist/eve-runtime-DXZgfCMb.mjs +701 -0
  12. package/dist/eve-runtime-DXZgfCMb.mjs.map +1 -0
  13. package/dist/eve-runtime.d.mts +4 -0
  14. package/dist/eve-runtime.mjs +3 -0
  15. package/dist/eve.d.mts +33 -34
  16. package/dist/eve.d.mts.map +1 -1
  17. package/dist/eve.mjs +384 -3
  18. package/dist/eve.mjs.map +1 -0
  19. package/dist/{index-CtID5dUi.d.mts → index-BNeMjmgp.d.mts} +183 -19
  20. package/dist/index-BNeMjmgp.d.mts.map +1 -0
  21. package/dist/index.d.mts +2 -2
  22. package/dist/index.mjs +3 -3
  23. package/dist/{src-D6vC3V8r.mjs → src-jQWS2Txw.mjs} +414 -68
  24. package/dist/src-jQWS2Txw.mjs.map +1 -0
  25. package/dist/token-OPdZa0t3.mjs +390 -0
  26. package/dist/token-OPdZa0t3.mjs.map +1 -0
  27. package/dist/{types-BVLof-5R.d.mts → types-BD5YvGxm.d.mts} +7 -3
  28. package/dist/types-BD5YvGxm.d.mts.map +1 -0
  29. package/dist/{types-BOnJ0Rou.d.mts → types-BDO-Mmn6.d.mts} +4 -3
  30. package/dist/types-BDO-Mmn6.d.mts.map +1 -0
  31. package/dist/workflow.d.mts +1 -1
  32. package/dist/workflow.mjs +2 -2
  33. package/dist/{write-tools-cg_ialNd.mjs → write-tools-Dk32V9Hl.mjs} +885 -26
  34. package/dist/write-tools-Dk32V9Hl.mjs.map +1 -0
  35. package/package.json +5 -1
  36. package/dist/eve-DmiXBuli.mjs +0 -864
  37. package/dist/eve-DmiXBuli.mjs.map +0 -1
  38. package/dist/index-CtID5dUi.d.mts.map +0 -1
  39. package/dist/src-D6vC3V8r.mjs.map +0 -1
  40. package/dist/token-sbepWIkd.mjs +0 -138
  41. package/dist/token-sbepWIkd.mjs.map +0 -1
  42. package/dist/types-BOnJ0Rou.d.mts.map +0 -1
  43. package/dist/types-BVLof-5R.d.mts.map +0 -1
  44. package/dist/write-tools-cg_ialNd.mjs.map +0 -1
@@ -0,0 +1,701 @@
1
+ import { $ as listWorkflowJobsDescription, $n as getIssueDescription, $r as requestReviewersDescription, $t as searchRepositoriesDescription, A as getLatestReleaseInputSchema, Ai as getRepositoryDescription, An as addAssigneesInputSchema, Ar as createPullRequestInputSchema, At as listGistsInputSchema, B as getCombinedStatusCore, Bn as createIssueCore, Br as listPullRequestFilesCore, Bt as getCommitCore, C as createReleaseDescription, Ci as forkRepositoryCore, Cn as listCommentReactionsDescription, Cr as updateLabelDescription, Ct as getGistDescription, D as deleteReleaseInputSchema, Di as getFileContentDescription, Dn as listIssueReactionsInputSchema, Dr as addPullRequestCommentInputSchema, Dt as listGistCommentsInputSchema, E as deleteReleaseDescription, Ei as getFileContentCore, En as listIssueReactionsDescription, Er as addPullRequestCommentDescription, Et as listGistCommentsDescription, F as listReleasesDescription, Fi as listBranchesCore, Fn as addLabelsDescription, Fr as deletePullRequestCommentDescription, Ft as compareCommitsDescription, G as listCheckRunsInputSchema, Gn as createLabelInputSchema, Gr as listPullRequestReviewsInputSchema, Gt as listCommitsInputSchema, H as getCombinedStatusInputSchema, Hn as createIssueInputSchema, Hr as listPullRequestFilesInputSchema, Ht as getCommitInputSchema, I as listReleasesInputSchema, Ii as listBranchesDescription, In as addLabelsInputSchema, Ir as deletePullRequestCommentInputSchema, It as compareCommitsInputSchema, J as cancelWorkflowRunInputSchema, Jn as deleteIssueCommentInputSchema, Jr as listPullRequestsInputSchema, Jt as searchCodeInputSchema, K as cancelWorkflowRunCore, Kn as deleteIssueCommentCore, Kr as listPullRequestsCore, Kt as searchCodeCore, L as updateReleaseCore, Li as listBranchesInputSchema, Ln as closeIssueCore, Lr as getPullRequestCore, Lt as getBlameCore, M as getReleaseDescription, Mi as getRepositoryTreeCore, Mn as addIssueCommentDescription, Mr as createPullRequestReviewDescription, Mt as updateGistDescription, N as getReleaseInputSchema, Ni as getRepositoryTreeDescription, Nn as addIssueCommentInputSchema, Nr as createPullRequestReviewInputSchema, Nt as updateGistInputSchema, O as getLatestReleaseCore, Oi as getFileContentInputSchema, On as addAssigneesCore, Or as createPullRequestCore, Ot as listGistsCore, P as listReleasesCore, Pi as getRepositoryTreeInputSchema, Pn as addLabelsCore, Pr as deletePullRequestCommentCore, Pt as compareCommitsCore, Q as listWorkflowJobsCore, Qn as getIssueCore, Qr as requestReviewersCore, Qt as searchRepositoriesCore, R as updateReleaseDescription, Rn as closeIssueDescription, Rr as getPullRequestDescription, Rt as getBlameDescription, S as createReleaseCore, Si as createRepositoryInputSchema, Sn as listCommentReactionsCore, Sr as updateLabelCore, St as getGistCore, T as deleteReleaseCore, Ti as forkRepositoryInputSchema, Tn as listIssueReactionsCore, Tr as addPullRequestCommentCore, Tt as listGistCommentsCore, U as listCheckRunsCore, Un as createLabelCore, Ur as listPullRequestReviewsCore, Ut as listCommitsCore, V as getCombinedStatusDescription, Vn as createIssueDescription, Vr as listPullRequestFilesDescription, Vt as getCommitDescription, W as listCheckRunsDescription, Wn as createLabelDescription, Wr as listPullRequestReviewsDescription, Wt as listCommitsDescription, X as getWorkflowRunDescription, Xn as deleteLabelDescription, Xr as mergePullRequestDescription, Xt as searchIssuesDescription, Y as getWorkflowRunCore, Yn as deleteLabelCore, Yr as mergePullRequestCore, Yt as searchIssuesCore, Z as getWorkflowRunInputSchema, Zn as deleteLabelInputSchema, Zr as mergePullRequestInputSchema, Zt as searchIssuesInputSchema, _ as getPullRequestContextDescription, _i as createOrUpdateFileCore, _n as addCommentReactionDescription, _r as updateIssueCommentDescription, _t as createGistDescription, a as resolvePresetTools, ai as updatePullRequestDescription, an as markNotificationReadDescription, ar as listIssuesDescription, at as listWorkflowsDescription, b as getReleaseContextDescription, bi as createRepositoryCore, bn as addIssueReactionDescription, br as updateIssueDescription, bt as deleteGistDescription, c as mergeContextArgs, ci as resolveGithubToken, cn as addDiscussionCommentDescription, cr as listLabelsDescription, ct as rerunWorkflowRunDescription, d as getCiFailureContextDescription, di as getFileContentToModelOutput, dn as getDiscussionDescription, dr as removeAssigneesDescription, dt as triggerWorkflowDescription, ei as requestReviewersInputSchema, en as searchRepositoriesInputSchema, er as getIssueInputSchema, et as listWorkflowJobsInputSchema, f as getCiFailureContextInputSchema, fi as getPullRequestContextToModelOutput, fn as getDiscussionInputSchema, fr as removeAssigneesInputSchema, ft as triggerWorkflowInputSchema, g as getPullRequestContextCore, gi as createBranchInputSchema, gn as addCommentReactionCore, gr as updateIssueCommentCore, gt as createGistCore, h as getIssueContextInputSchema, hi as createBranchDescription, hn as listDiscussionsInputSchema, hr as removeLabelInputSchema, ht as createGistCommentInputSchema, ii as updatePullRequestCore, in as markNotificationReadCore, ir as listIssuesCore, it as listWorkflowsCore, j as getReleaseCore, ji as getRepositoryInputSchema, jn as addIssueCommentCore, jr as createPullRequestReviewCore, jt as updateGistCore, k as getLatestReleaseDescription, ki as getRepositoryCore, kn as addAssigneesDescription, kr as createPullRequestDescription, kt as listGistsDescription, l as softenContextSchema, li as compareCommitsToModelOutput, ln as addDiscussionCommentInputSchema, lr as listLabelsInputSchema, lt as rerunWorkflowRunInputSchema, m as getIssueContextDescription, mi as createBranchCore, mn as listDiscussionsDescription, mr as removeLabelDescription, mt as createGistCommentDescription, n as ALL_GITHUB_TOOL_NAMES, ni as updatePullRequestCommentDescription, nn as listNotificationsDescription, nr as listIssueCommentsDescription, nt as listWorkflowRunsDescription, oi as updatePullRequestInputSchema, on as markNotificationReadInputSchema, or as listIssuesInputSchema, ot as listWorkflowsInputSchema, p as getIssueContextCore, pi as listPullRequestFilesToModelOutput, pn as listDiscussionsCore, pr as removeLabelCore, pt as createGistCommentCore, q as cancelWorkflowRunDescription, qn as deleteIssueCommentDescription, qr as listPullRequestsDescription, qt as searchCodeDescription, ri as updatePullRequestCommentInputSchema, rn as listNotificationsInputSchema, rr as listIssueCommentsInputSchema, rt as listWorkflowRunsInputSchema, si as createGithubTokenResolver, sn as addDiscussionCommentCore, sr as listLabelsCore, st as rerunWorkflowRunCore, ti as updatePullRequestCommentCore, tn as listNotificationsCore, tr as listIssueCommentsCore, tt as listWorkflowRunsCore, u as getCiFailureContextCore, ui as getCommitToModelOutput, un as getDiscussionCore, ur as removeAssigneesCore, ut as triggerWorkflowCore, v as getPullRequestContextInputSchema, vi as createOrUpdateFileDescription, vn as addCommentReactionInputSchema, vr as updateIssueCommentInputSchema, vt as createGistInputSchema, w as createReleaseInputSchema, wi as forkRepositoryDescription, wn as listCommentReactionsInputSchema, wr as updateLabelInputSchema, wt as getGistInputSchema, x as getReleaseContextInputSchema, xi as createRepositoryDescription, xn as addIssueReactionInputSchema, xr as updateIssueInputSchema, xt as deleteGistInputSchema, y as getReleaseContextCore, yi as createOrUpdateFileInputSchema, yn as addIssueReactionCore, yr as updateIssueCore, yt as deleteGistCore, z as updateReleaseInputSchema, zn as closeIssueInputSchema, zr as getPullRequestInputSchema, zt as getBlameInputSchema } from "./write-tools-Dk32V9Hl.mjs";
2
+ import * as eveTools from "eve/tools";
3
+ import * as eveApproval from "eve/tools/approval";
4
+ //#region src/eve/load-eve.ts
5
+ const MISSING_EVE_MESSAGE = "The \"eve\" package is required to use @github-tools/sdk/eve. Install it with: pnpm add eve";
6
+ function getEveTools() {
7
+ return eveTools;
8
+ }
9
+ function getEveApprovalHelpers() {
10
+ return eveApproval;
11
+ }
12
+ //#endregion
13
+ //#region src/eve/approval.ts
14
+ function mapEveApprovalValue(value) {
15
+ if (typeof value === "function") return value;
16
+ const { always, never, once } = getEveApprovalHelpers();
17
+ if (value === true || value === "always") return always();
18
+ if (value === false || value === "never") return never();
19
+ if (value === "once") return once();
20
+ return always();
21
+ }
22
+ function resolveEveApproval(toolName, config) {
23
+ if (config === void 0) return getEveApprovalHelpers().always();
24
+ if (config === true) return getEveApprovalHelpers().always();
25
+ if (config === false) return getEveApprovalHelpers().never();
26
+ const value = config[toolName];
27
+ if (value === void 0) return getEveApprovalHelpers().always();
28
+ return mapEveApprovalValue(value);
29
+ }
30
+ //#endregion
31
+ //#region src/eve/registry.ts
32
+ function withToken(core, ctx, extra) {
33
+ return async (input) => core({
34
+ token: await resolveGithubToken(ctx.token),
35
+ ...extra,
36
+ ...mergeContextArgs(input, ctx.context ?? {})
37
+ });
38
+ }
39
+ function modelOutputAdapter(fn) {
40
+ return (output) => fn({
41
+ toolCallId: "",
42
+ input: {},
43
+ output
44
+ });
45
+ }
46
+ function createToolRegistry(ctx) {
47
+ const entries = [
48
+ {
49
+ name: "getRepository",
50
+ description: getRepositoryDescription,
51
+ inputSchema: getRepositoryInputSchema,
52
+ execute: withToken(getRepositoryCore, ctx)
53
+ },
54
+ {
55
+ name: "listBranches",
56
+ description: listBranchesDescription,
57
+ inputSchema: listBranchesInputSchema,
58
+ execute: withToken(listBranchesCore, ctx)
59
+ },
60
+ {
61
+ name: "getFileContent",
62
+ description: getFileContentDescription,
63
+ inputSchema: getFileContentInputSchema,
64
+ execute: withToken(getFileContentCore, ctx),
65
+ toModelOutput: modelOutputAdapter(getFileContentToModelOutput)
66
+ },
67
+ {
68
+ name: "getRepositoryTree",
69
+ description: getRepositoryTreeDescription,
70
+ inputSchema: getRepositoryTreeInputSchema,
71
+ execute: withToken(getRepositoryTreeCore, ctx)
72
+ },
73
+ {
74
+ name: "createBranch",
75
+ writeTool: "createBranch",
76
+ description: createBranchDescription,
77
+ inputSchema: createBranchInputSchema,
78
+ execute: withToken(createBranchCore, ctx)
79
+ },
80
+ {
81
+ name: "forkRepository",
82
+ writeTool: "forkRepository",
83
+ description: forkRepositoryDescription,
84
+ inputSchema: forkRepositoryInputSchema,
85
+ execute: withToken(forkRepositoryCore, ctx)
86
+ },
87
+ {
88
+ name: "createRepository",
89
+ writeTool: "createRepository",
90
+ description: createRepositoryDescription,
91
+ inputSchema: createRepositoryInputSchema,
92
+ execute: withToken(createRepositoryCore, ctx)
93
+ },
94
+ {
95
+ name: "createOrUpdateFile",
96
+ writeTool: "createOrUpdateFile",
97
+ description: createOrUpdateFileDescription,
98
+ inputSchema: createOrUpdateFileInputSchema,
99
+ execute: withToken(createOrUpdateFileCore, ctx, {
100
+ author: ctx.author,
101
+ committer: ctx.committer,
102
+ coAuthors: ctx.coAuthors
103
+ })
104
+ },
105
+ {
106
+ name: "listPullRequests",
107
+ description: listPullRequestsDescription,
108
+ inputSchema: listPullRequestsInputSchema,
109
+ execute: withToken(listPullRequestsCore, ctx)
110
+ },
111
+ {
112
+ name: "getPullRequest",
113
+ description: getPullRequestDescription,
114
+ inputSchema: getPullRequestInputSchema,
115
+ execute: withToken(getPullRequestCore, ctx)
116
+ },
117
+ {
118
+ name: "createPullRequest",
119
+ writeTool: "createPullRequest",
120
+ description: createPullRequestDescription,
121
+ inputSchema: createPullRequestInputSchema,
122
+ execute: withToken(createPullRequestCore, ctx)
123
+ },
124
+ {
125
+ name: "mergePullRequest",
126
+ writeTool: "mergePullRequest",
127
+ description: mergePullRequestDescription,
128
+ inputSchema: mergePullRequestInputSchema,
129
+ execute: withToken(mergePullRequestCore, ctx, { coAuthors: ctx.coAuthors })
130
+ },
131
+ {
132
+ name: "updatePullRequest",
133
+ writeTool: "updatePullRequest",
134
+ description: updatePullRequestDescription,
135
+ inputSchema: updatePullRequestInputSchema,
136
+ execute: withToken(updatePullRequestCore, ctx)
137
+ },
138
+ {
139
+ name: "addPullRequestComment",
140
+ writeTool: "addPullRequestComment",
141
+ description: addPullRequestCommentDescription,
142
+ inputSchema: addPullRequestCommentInputSchema,
143
+ execute: withToken(addPullRequestCommentCore, ctx)
144
+ },
145
+ {
146
+ name: "updatePullRequestComment",
147
+ writeTool: "updatePullRequestComment",
148
+ description: updatePullRequestCommentDescription,
149
+ inputSchema: updatePullRequestCommentInputSchema,
150
+ execute: withToken(updatePullRequestCommentCore, ctx)
151
+ },
152
+ {
153
+ name: "deletePullRequestComment",
154
+ writeTool: "deletePullRequestComment",
155
+ description: deletePullRequestCommentDescription,
156
+ inputSchema: deletePullRequestCommentInputSchema,
157
+ execute: withToken(deletePullRequestCommentCore, ctx)
158
+ },
159
+ {
160
+ name: "listPullRequestFiles",
161
+ description: listPullRequestFilesDescription,
162
+ inputSchema: listPullRequestFilesInputSchema,
163
+ execute: withToken(listPullRequestFilesCore, ctx),
164
+ toModelOutput: modelOutputAdapter(listPullRequestFilesToModelOutput)
165
+ },
166
+ {
167
+ name: "listPullRequestReviews",
168
+ description: listPullRequestReviewsDescription,
169
+ inputSchema: listPullRequestReviewsInputSchema,
170
+ execute: withToken(listPullRequestReviewsCore, ctx)
171
+ },
172
+ {
173
+ name: "createPullRequestReview",
174
+ writeTool: "createPullRequestReview",
175
+ description: createPullRequestReviewDescription,
176
+ inputSchema: createPullRequestReviewInputSchema,
177
+ execute: withToken(createPullRequestReviewCore, ctx)
178
+ },
179
+ {
180
+ name: "requestReviewers",
181
+ writeTool: "requestReviewers",
182
+ description: requestReviewersDescription,
183
+ inputSchema: requestReviewersInputSchema,
184
+ execute: withToken(requestReviewersCore, ctx)
185
+ },
186
+ {
187
+ name: "getPullRequestContext",
188
+ description: getPullRequestContextDescription,
189
+ inputSchema: getPullRequestContextInputSchema,
190
+ execute: withToken(getPullRequestContextCore, ctx),
191
+ toModelOutput: modelOutputAdapter(getPullRequestContextToModelOutput)
192
+ },
193
+ {
194
+ name: "getIssueContext",
195
+ description: getIssueContextDescription,
196
+ inputSchema: getIssueContextInputSchema,
197
+ execute: withToken(getIssueContextCore, ctx)
198
+ },
199
+ {
200
+ name: "listIssues",
201
+ description: listIssuesDescription,
202
+ inputSchema: listIssuesInputSchema,
203
+ execute: withToken(listIssuesCore, ctx)
204
+ },
205
+ {
206
+ name: "getIssue",
207
+ description: getIssueDescription,
208
+ inputSchema: getIssueInputSchema,
209
+ execute: withToken(getIssueCore, ctx)
210
+ },
211
+ {
212
+ name: "listIssueComments",
213
+ description: listIssueCommentsDescription,
214
+ inputSchema: listIssueCommentsInputSchema,
215
+ execute: withToken(listIssueCommentsCore, ctx)
216
+ },
217
+ {
218
+ name: "createIssue",
219
+ writeTool: "createIssue",
220
+ description: createIssueDescription,
221
+ inputSchema: createIssueInputSchema,
222
+ execute: withToken(createIssueCore, ctx)
223
+ },
224
+ {
225
+ name: "addIssueComment",
226
+ writeTool: "addIssueComment",
227
+ description: addIssueCommentDescription,
228
+ inputSchema: addIssueCommentInputSchema,
229
+ execute: withToken(addIssueCommentCore, ctx)
230
+ },
231
+ {
232
+ name: "updateIssueComment",
233
+ writeTool: "updateIssueComment",
234
+ description: updateIssueCommentDescription,
235
+ inputSchema: updateIssueCommentInputSchema,
236
+ execute: withToken(updateIssueCommentCore, ctx)
237
+ },
238
+ {
239
+ name: "deleteIssueComment",
240
+ writeTool: "deleteIssueComment",
241
+ description: deleteIssueCommentDescription,
242
+ inputSchema: deleteIssueCommentInputSchema,
243
+ execute: withToken(deleteIssueCommentCore, ctx)
244
+ },
245
+ {
246
+ name: "closeIssue",
247
+ writeTool: "closeIssue",
248
+ description: closeIssueDescription,
249
+ inputSchema: closeIssueInputSchema,
250
+ execute: withToken(closeIssueCore, ctx)
251
+ },
252
+ {
253
+ name: "updateIssue",
254
+ writeTool: "updateIssue",
255
+ description: updateIssueDescription,
256
+ inputSchema: updateIssueInputSchema,
257
+ execute: withToken(updateIssueCore, ctx)
258
+ },
259
+ {
260
+ name: "listLabels",
261
+ description: listLabelsDescription,
262
+ inputSchema: listLabelsInputSchema,
263
+ execute: withToken(listLabelsCore, ctx)
264
+ },
265
+ {
266
+ name: "addLabels",
267
+ writeTool: "addLabels",
268
+ description: addLabelsDescription,
269
+ inputSchema: addLabelsInputSchema,
270
+ execute: withToken(addLabelsCore, ctx)
271
+ },
272
+ {
273
+ name: "removeLabel",
274
+ writeTool: "removeLabel",
275
+ description: removeLabelDescription,
276
+ inputSchema: removeLabelInputSchema,
277
+ execute: withToken(removeLabelCore, ctx)
278
+ },
279
+ {
280
+ name: "createLabel",
281
+ writeTool: "createLabel",
282
+ description: createLabelDescription,
283
+ inputSchema: createLabelInputSchema,
284
+ execute: withToken(createLabelCore, ctx)
285
+ },
286
+ {
287
+ name: "updateLabel",
288
+ writeTool: "updateLabel",
289
+ description: updateLabelDescription,
290
+ inputSchema: updateLabelInputSchema,
291
+ execute: withToken(updateLabelCore, ctx)
292
+ },
293
+ {
294
+ name: "deleteLabel",
295
+ writeTool: "deleteLabel",
296
+ description: deleteLabelDescription,
297
+ inputSchema: deleteLabelInputSchema,
298
+ execute: withToken(deleteLabelCore, ctx)
299
+ },
300
+ {
301
+ name: "addAssignees",
302
+ writeTool: "addAssignees",
303
+ description: addAssigneesDescription,
304
+ inputSchema: addAssigneesInputSchema,
305
+ execute: withToken(addAssigneesCore, ctx)
306
+ },
307
+ {
308
+ name: "removeAssignees",
309
+ writeTool: "removeAssignees",
310
+ description: removeAssigneesDescription,
311
+ inputSchema: removeAssigneesInputSchema,
312
+ execute: withToken(removeAssigneesCore, ctx)
313
+ },
314
+ {
315
+ name: "listIssueReactions",
316
+ description: listIssueReactionsDescription,
317
+ inputSchema: listIssueReactionsInputSchema,
318
+ execute: withToken(listIssueReactionsCore, ctx)
319
+ },
320
+ {
321
+ name: "addIssueReaction",
322
+ writeTool: "addIssueReaction",
323
+ description: addIssueReactionDescription,
324
+ inputSchema: addIssueReactionInputSchema,
325
+ execute: withToken(addIssueReactionCore, ctx)
326
+ },
327
+ {
328
+ name: "listCommentReactions",
329
+ description: listCommentReactionsDescription,
330
+ inputSchema: listCommentReactionsInputSchema,
331
+ execute: withToken(listCommentReactionsCore, ctx)
332
+ },
333
+ {
334
+ name: "addCommentReaction",
335
+ writeTool: "addCommentReaction",
336
+ description: addCommentReactionDescription,
337
+ inputSchema: addCommentReactionInputSchema,
338
+ execute: withToken(addCommentReactionCore, ctx)
339
+ },
340
+ {
341
+ name: "listDiscussions",
342
+ description: listDiscussionsDescription,
343
+ inputSchema: listDiscussionsInputSchema,
344
+ execute: withToken(listDiscussionsCore, ctx)
345
+ },
346
+ {
347
+ name: "getDiscussion",
348
+ description: getDiscussionDescription,
349
+ inputSchema: getDiscussionInputSchema,
350
+ execute: withToken(getDiscussionCore, ctx)
351
+ },
352
+ {
353
+ name: "addDiscussionComment",
354
+ writeTool: "addDiscussionComment",
355
+ description: addDiscussionCommentDescription,
356
+ inputSchema: addDiscussionCommentInputSchema,
357
+ execute: withToken(addDiscussionCommentCore, ctx)
358
+ },
359
+ {
360
+ name: "listNotifications",
361
+ description: listNotificationsDescription,
362
+ inputSchema: listNotificationsInputSchema,
363
+ execute: withToken(listNotificationsCore, ctx)
364
+ },
365
+ {
366
+ name: "markNotificationRead",
367
+ writeTool: "markNotificationRead",
368
+ description: markNotificationReadDescription,
369
+ inputSchema: markNotificationReadInputSchema,
370
+ execute: withToken(markNotificationReadCore, ctx)
371
+ },
372
+ {
373
+ name: "searchCode",
374
+ description: searchCodeDescription,
375
+ inputSchema: searchCodeInputSchema,
376
+ execute: withToken(searchCodeCore, ctx)
377
+ },
378
+ {
379
+ name: "searchRepositories",
380
+ description: searchRepositoriesDescription,
381
+ inputSchema: searchRepositoriesInputSchema,
382
+ execute: withToken(searchRepositoriesCore, ctx)
383
+ },
384
+ {
385
+ name: "searchIssues",
386
+ description: searchIssuesDescription,
387
+ inputSchema: searchIssuesInputSchema,
388
+ execute: withToken(searchIssuesCore, ctx)
389
+ },
390
+ {
391
+ name: "listCommits",
392
+ description: listCommitsDescription,
393
+ inputSchema: listCommitsInputSchema,
394
+ execute: withToken(listCommitsCore, ctx)
395
+ },
396
+ {
397
+ name: "getCommit",
398
+ description: getCommitDescription,
399
+ inputSchema: getCommitInputSchema,
400
+ execute: withToken(getCommitCore, ctx),
401
+ toModelOutput: modelOutputAdapter(getCommitToModelOutput)
402
+ },
403
+ {
404
+ name: "getBlame",
405
+ description: getBlameDescription,
406
+ inputSchema: getBlameInputSchema,
407
+ execute: withToken(getBlameCore, ctx)
408
+ },
409
+ {
410
+ name: "compareCommits",
411
+ description: compareCommitsDescription,
412
+ inputSchema: compareCommitsInputSchema,
413
+ execute: withToken(compareCommitsCore, ctx),
414
+ toModelOutput: modelOutputAdapter(compareCommitsToModelOutput)
415
+ },
416
+ {
417
+ name: "listGists",
418
+ description: listGistsDescription,
419
+ inputSchema: listGistsInputSchema,
420
+ execute: withToken(listGistsCore, ctx)
421
+ },
422
+ {
423
+ name: "getGist",
424
+ description: getGistDescription,
425
+ inputSchema: getGistInputSchema,
426
+ execute: withToken(getGistCore, ctx)
427
+ },
428
+ {
429
+ name: "listGistComments",
430
+ description: listGistCommentsDescription,
431
+ inputSchema: listGistCommentsInputSchema,
432
+ execute: withToken(listGistCommentsCore, ctx)
433
+ },
434
+ {
435
+ name: "createGist",
436
+ writeTool: "createGist",
437
+ description: createGistDescription,
438
+ inputSchema: createGistInputSchema,
439
+ execute: withToken(createGistCore, ctx)
440
+ },
441
+ {
442
+ name: "updateGist",
443
+ writeTool: "updateGist",
444
+ description: updateGistDescription,
445
+ inputSchema: updateGistInputSchema,
446
+ execute: withToken(updateGistCore, ctx)
447
+ },
448
+ {
449
+ name: "deleteGist",
450
+ writeTool: "deleteGist",
451
+ description: deleteGistDescription,
452
+ inputSchema: deleteGistInputSchema,
453
+ execute: withToken(deleteGistCore, ctx)
454
+ },
455
+ {
456
+ name: "createGistComment",
457
+ writeTool: "createGistComment",
458
+ description: createGistCommentDescription,
459
+ inputSchema: createGistCommentInputSchema,
460
+ execute: withToken(createGistCommentCore, ctx)
461
+ },
462
+ {
463
+ name: "listWorkflows",
464
+ description: listWorkflowsDescription,
465
+ inputSchema: listWorkflowsInputSchema,
466
+ execute: withToken(listWorkflowsCore, ctx)
467
+ },
468
+ {
469
+ name: "listWorkflowRuns",
470
+ description: listWorkflowRunsDescription,
471
+ inputSchema: listWorkflowRunsInputSchema,
472
+ execute: withToken(listWorkflowRunsCore, ctx)
473
+ },
474
+ {
475
+ name: "getWorkflowRun",
476
+ description: getWorkflowRunDescription,
477
+ inputSchema: getWorkflowRunInputSchema,
478
+ execute: withToken(getWorkflowRunCore, ctx)
479
+ },
480
+ {
481
+ name: "listWorkflowJobs",
482
+ description: listWorkflowJobsDescription,
483
+ inputSchema: listWorkflowJobsInputSchema,
484
+ execute: withToken(listWorkflowJobsCore, ctx)
485
+ },
486
+ {
487
+ name: "triggerWorkflow",
488
+ writeTool: "triggerWorkflow",
489
+ description: triggerWorkflowDescription,
490
+ inputSchema: triggerWorkflowInputSchema,
491
+ execute: withToken(triggerWorkflowCore, ctx)
492
+ },
493
+ {
494
+ name: "cancelWorkflowRun",
495
+ writeTool: "cancelWorkflowRun",
496
+ description: cancelWorkflowRunDescription,
497
+ inputSchema: cancelWorkflowRunInputSchema,
498
+ execute: withToken(cancelWorkflowRunCore, ctx)
499
+ },
500
+ {
501
+ name: "rerunWorkflowRun",
502
+ writeTool: "rerunWorkflowRun",
503
+ description: rerunWorkflowRunDescription,
504
+ inputSchema: rerunWorkflowRunInputSchema,
505
+ execute: withToken(rerunWorkflowRunCore, ctx)
506
+ },
507
+ {
508
+ name: "listCheckRuns",
509
+ description: listCheckRunsDescription,
510
+ inputSchema: listCheckRunsInputSchema,
511
+ execute: withToken(listCheckRunsCore, ctx)
512
+ },
513
+ {
514
+ name: "getCombinedStatus",
515
+ description: getCombinedStatusDescription,
516
+ inputSchema: getCombinedStatusInputSchema,
517
+ execute: withToken(getCombinedStatusCore, ctx)
518
+ },
519
+ {
520
+ name: "getCiFailureContext",
521
+ description: getCiFailureContextDescription,
522
+ inputSchema: getCiFailureContextInputSchema,
523
+ execute: withToken(getCiFailureContextCore, ctx)
524
+ },
525
+ {
526
+ name: "listReleases",
527
+ description: listReleasesDescription,
528
+ inputSchema: listReleasesInputSchema,
529
+ execute: withToken(listReleasesCore, ctx)
530
+ },
531
+ {
532
+ name: "getLatestRelease",
533
+ description: getLatestReleaseDescription,
534
+ inputSchema: getLatestReleaseInputSchema,
535
+ execute: withToken(getLatestReleaseCore, ctx)
536
+ },
537
+ {
538
+ name: "getRelease",
539
+ description: getReleaseDescription,
540
+ inputSchema: getReleaseInputSchema,
541
+ execute: withToken(getReleaseCore, ctx)
542
+ },
543
+ {
544
+ name: "getReleaseContext",
545
+ description: getReleaseContextDescription,
546
+ inputSchema: getReleaseContextInputSchema,
547
+ execute: withToken(getReleaseContextCore, ctx)
548
+ },
549
+ {
550
+ name: "createRelease",
551
+ writeTool: "createRelease",
552
+ description: createReleaseDescription,
553
+ inputSchema: createReleaseInputSchema,
554
+ execute: withToken(createReleaseCore, ctx)
555
+ },
556
+ {
557
+ name: "updateRelease",
558
+ writeTool: "updateRelease",
559
+ description: updateReleaseDescription,
560
+ inputSchema: updateReleaseInputSchema,
561
+ execute: withToken(updateReleaseCore, ctx)
562
+ },
563
+ {
564
+ name: "deleteRelease",
565
+ writeTool: "deleteRelease",
566
+ description: deleteReleaseDescription,
567
+ inputSchema: deleteReleaseInputSchema,
568
+ execute: withToken(deleteReleaseCore, ctx)
569
+ }
570
+ ];
571
+ if (!ctx.context) return entries;
572
+ return entries.map((entry) => ({
573
+ ...entry,
574
+ inputSchema: softenContextSchema(entry.inputSchema, ctx.context)
575
+ }));
576
+ }
577
+ //#endregion
578
+ //#region src/eve/steps.ts
579
+ async function executeGithubToolStep(name, input, ctx) {
580
+ "use step";
581
+ const entry = createToolRegistry(ctx).find((tool) => tool.name === name);
582
+ if (!entry) throw new Error(`Unknown GitHub tool: ${name}`);
583
+ return entry.execute(input);
584
+ }
585
+ async function runGithubToolStep(name, input, ctx) {
586
+ const token = await resolveGithubToken(ctx.token);
587
+ return executeGithubToolStep(name, input, {
588
+ ...ctx,
589
+ token
590
+ });
591
+ }
592
+ //#endregion
593
+ //#region src/eve/build.ts
594
+ function resolveAllowedToolNames(options) {
595
+ const presetAllowed = options.preset ? resolvePresetTools(options.preset) : null;
596
+ const includeAllowed = options.include ? new Set(options.include) : null;
597
+ const excluded = options.exclude ? new Set(options.exclude) : null;
598
+ const allowed = presetAllowed && includeAllowed ? /* @__PURE__ */ new Set([...presetAllowed, ...includeAllowed]) : presetAllowed ?? includeAllowed;
599
+ return (name) => (!allowed || allowed.has(name)) && !excluded?.has(name);
600
+ }
601
+ function applyOverrides(tool, name, overrides) {
602
+ const override = overrides?.[name];
603
+ if (!override) return tool;
604
+ return {
605
+ ...tool,
606
+ ...override.description !== void 0 && { description: override.description },
607
+ ...override.approval !== void 0 && { approval: mapEveApprovalValue(override.approval) },
608
+ ...override.toModelOutput !== void 0 && { toModelOutput: override.toModelOutput },
609
+ ...override.outputSchema !== void 0 && { outputSchema: override.outputSchema }
610
+ };
611
+ }
612
+ function buildEveToolDefinition(name, options = {}) {
613
+ const { defineTool } = getEveTools();
614
+ const ctx = {
615
+ token: createGithubTokenResolver(options.token),
616
+ context: options.context,
617
+ author: options.author,
618
+ committer: options.committer,
619
+ coAuthors: options.coAuthors
620
+ };
621
+ const entry = createToolRegistry(ctx).find((tool) => tool.name === name);
622
+ if (!entry) throw new Error(`Unknown GitHub tool: ${name}`);
623
+ return applyOverrides(defineTool({
624
+ description: entry.description,
625
+ inputSchema: entry.inputSchema,
626
+ ...entry.writeTool && { approval: resolveEveApproval(entry.writeTool, options.requireApproval) },
627
+ ...entry.toModelOutput && { toModelOutput: entry.toModelOutput },
628
+ execute: async (input) => runGithubToolStep(name, input, ctx)
629
+ }), name, options.overrides);
630
+ }
631
+ function buildEveToolMap(options = {}) {
632
+ const { defineTool } = getEveTools();
633
+ const ctx = {
634
+ token: createGithubTokenResolver(options.token),
635
+ context: options.context,
636
+ author: options.author,
637
+ committer: options.committer,
638
+ coAuthors: options.coAuthors
639
+ };
640
+ const isAllowed = resolveAllowedToolNames(options);
641
+ const registry = createToolRegistry(ctx);
642
+ const tools = {};
643
+ for (const entry of registry) {
644
+ if (!isAllowed(entry.name)) continue;
645
+ const tool = defineTool({
646
+ description: entry.description,
647
+ inputSchema: entry.inputSchema,
648
+ ...entry.writeTool && { approval: resolveEveApproval(entry.writeTool, options.requireApproval) },
649
+ ...entry.toModelOutput && { toModelOutput: entry.toModelOutput },
650
+ execute: async (input) => runGithubToolStep(entry.name, input, ctx)
651
+ });
652
+ tools[entry.name] = applyOverrides(tool, entry.name, options.overrides);
653
+ }
654
+ return tools;
655
+ }
656
+ function createEveGithubToolsDynamic(options = {}) {
657
+ const { defineDynamic } = getEveTools();
658
+ return defineDynamic({ events: { "session.started": async () => buildEveToolMap(options) } });
659
+ }
660
+ function listResolvedEveToolNames(options = {}) {
661
+ const isAllowed = resolveAllowedToolNames(options);
662
+ return ALL_GITHUB_TOOL_NAMES.filter(isAllowed);
663
+ }
664
+ /**
665
+ * Tool descriptors (no `execute`) for authored eve `defineTool` loops.
666
+ * Prefer this when registering tools outside the SDK package so durable transforms can hoist inline execute.
667
+ */
668
+ function listEveToolDescriptors(options = {}) {
669
+ const ctx = {
670
+ token: createGithubTokenResolver(options.token),
671
+ context: options.context,
672
+ author: options.author,
673
+ committer: options.committer,
674
+ coAuthors: options.coAuthors
675
+ };
676
+ const isAllowed = resolveAllowedToolNames(options);
677
+ return createToolRegistry(ctx).filter((entry) => isAllowed(entry.name)).map((entry) => ({
678
+ name: entry.name,
679
+ description: entry.description,
680
+ inputSchema: entry.inputSchema,
681
+ writeTool: entry.writeTool,
682
+ toModelOutput: entry.toModelOutput
683
+ }));
684
+ }
685
+ /**
686
+ * Execute a GitHub tool by name with the given eve options (token/context/attribution).
687
+ * Used by `@github-tools/eve-extension` so `execute` only closes over a serializable tool name.
688
+ */
689
+ async function executeGithubEveTool(name, input, options = {}) {
690
+ return runGithubToolStep(name, input, {
691
+ token: createGithubTokenResolver(options.token),
692
+ context: options.context,
693
+ author: options.author,
694
+ committer: options.committer,
695
+ coAuthors: options.coAuthors
696
+ });
697
+ }
698
+ //#endregion
699
+ export { listEveToolDescriptors as a, resolveEveApproval as c, executeGithubEveTool as i, MISSING_EVE_MESSAGE as l, buildEveToolMap as n, listResolvedEveToolNames as o, createEveGithubToolsDynamic as r, mapEveApprovalValue as s, buildEveToolDefinition as t };
700
+
701
+ //# sourceMappingURL=eve-runtime-DXZgfCMb.mjs.map