@github-tools/sdk 1.9.0 → 1.10.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 (42) hide show
  1. package/README.md +82 -27
  2. package/dist/connect/eve.d.mts +14 -9
  3. package/dist/connect/eve.d.mts.map +1 -1
  4. package/dist/connect/eve.mjs +14 -9
  5. package/dist/connect/eve.mjs.map +1 -1
  6. package/dist/connect.d.mts +16 -8
  7. package/dist/connect.d.mts.map +1 -1
  8. package/dist/connect.mjs +2 -2
  9. package/dist/eve-runtime-CI4dR_hI.d.mts +54 -0
  10. package/dist/eve-runtime-CI4dR_hI.d.mts.map +1 -0
  11. package/dist/eve-runtime-CIcrt7MD.mjs +674 -0
  12. package/dist/eve-runtime-CIcrt7MD.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 +5 -34
  16. package/dist/eve.d.mts.map +1 -1
  17. package/dist/eve.mjs +356 -3
  18. package/dist/eve.mjs.map +1 -0
  19. package/dist/{index-CtID5dUi.d.mts → index-B0nL0C00.d.mts} +159 -19
  20. package/dist/index-B0nL0C00.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-v-LjzPpR.mjs} +354 -68
  24. package/dist/src-v-LjzPpR.mjs.map +1 -0
  25. package/dist/{token-sbepWIkd.mjs → token-DDMlEkK-.mjs} +34 -5
  26. package/dist/token-DDMlEkK-.mjs.map +1 -0
  27. package/dist/{types-BVLof-5R.d.mts → types-VW0m0Uxl.d.mts} +3 -3
  28. package/dist/{types-BVLof-5R.d.mts.map → types-VW0m0Uxl.d.mts.map} +1 -1
  29. package/dist/{types-BOnJ0Rou.d.mts → types-Ygt1pw1N.d.mts} +4 -3
  30. package/dist/types-Ygt1pw1N.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-uIVfURVp.mjs} +792 -25
  34. package/dist/write-tools-uIVfURVp.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.map +0 -1
  41. package/dist/types-BOnJ0Rou.d.mts.map +0 -1
  42. package/dist/write-tools-cg_ialNd.mjs.map +0 -1
@@ -0,0 +1,674 @@
1
+ import { $ as listWorkflowJobsDescription, $n as listLabelsDescription, $r as getFileContentToModelOutput, $t as searchRepositoriesDescription, A as getLatestReleaseInputSchema, An as addAssigneesInputSchema, Ar as listPullRequestFilesInputSchema, At as listGistsInputSchema, B as getCombinedStatusCore, Bn as createIssueCore, Br as requestReviewersCore, Bt as getCommitCore, C as createReleaseDescription, Ci as listBranchesCore, Cn as listCommentReactionsDescription, Cr as deletePullRequestCommentDescription, Ct as getGistDescription, D as deleteReleaseInputSchema, Dn as listIssueReactionsInputSchema, Dr as getPullRequestInputSchema, Dt as listGistCommentsInputSchema, E as deleteReleaseDescription, En as listIssueReactionsDescription, Er as getPullRequestDescription, Et as listGistCommentsDescription, F as listReleasesDescription, Fn as addLabelsDescription, Fr as listPullRequestsDescription, Ft as compareCommitsDescription, G as listCheckRunsInputSchema, Gn as deleteIssueCommentInputSchema, Gr as updatePullRequestCommentInputSchema, Gt as listCommitsInputSchema, H as getCombinedStatusInputSchema, Hn as createIssueInputSchema, Hr as requestReviewersInputSchema, Ht as getCommitInputSchema, I as listReleasesInputSchema, In as addLabelsInputSchema, Ir as listPullRequestsInputSchema, It as compareCommitsInputSchema, J as cancelWorkflowRunInputSchema, Jn as getIssueInputSchema, Jr as updatePullRequestInputSchema, Jt as searchCodeInputSchema, K as cancelWorkflowRunCore, Kn as getIssueCore, Kr as updatePullRequestCore, Kt as searchCodeCore, L as updateReleaseCore, Ln as closeIssueCore, Lr as mergePullRequestCore, Lt as getBlameCore, M as getReleaseDescription, Mn as addIssueCommentDescription, Mr as listPullRequestReviewsDescription, Mt as updateGistDescription, N as getReleaseInputSchema, Nn as addIssueCommentInputSchema, Nr as listPullRequestReviewsInputSchema, Nt as updateGistInputSchema, O as getLatestReleaseCore, On as addAssigneesCore, Or as listPullRequestFilesCore, Ot as listGistsCore, P as listReleasesCore, Pn as addLabelsCore, Pr as listPullRequestsCore, Pt as compareCommitsCore, Q as listWorkflowJobsCore, Qn as listLabelsCore, Qr as getCommitToModelOutput, Qt as searchRepositoriesCore, R as updateReleaseDescription, Rn as closeIssueDescription, Rr as mergePullRequestDescription, Rt as getBlameDescription, S as createReleaseCore, Si as getRepositoryTreeInputSchema, Sn as listCommentReactionsCore, Sr as deletePullRequestCommentCore, St as getGistCore, T as deleteReleaseCore, Ti as listBranchesInputSchema, Tn as listIssueReactionsCore, Tr as getPullRequestCore, Tt as listGistCommentsCore, U as listCheckRunsCore, Un as deleteIssueCommentCore, Ur as updatePullRequestCommentCore, Ut as listCommitsCore, V as getCombinedStatusDescription, Vn as createIssueDescription, Vr as requestReviewersDescription, Vt as getCommitDescription, W as listCheckRunsDescription, Wn as deleteIssueCommentDescription, Wr as updatePullRequestCommentDescription, Wt as listCommitsDescription, X as getWorkflowRunDescription, Xn as listIssuesDescription, Xr as resolveGithubToken, Xt as searchIssuesDescription, Y as getWorkflowRunCore, Yn as listIssuesCore, Yr as createGithubTokenResolver, Yt as searchIssuesCore, Z as getWorkflowRunInputSchema, Zn as listIssuesInputSchema, Zr as compareCommitsToModelOutput, Zt as searchIssuesInputSchema, _ as getPullRequestContextDescription, _i as getRepositoryCore, _n as addCommentReactionDescription, _r as createPullRequestDescription, _t as createGistDescription, a as resolvePresetTools, ai as createOrUpdateFileCore, an as markNotificationReadDescription, ar as removeLabelDescription, at as listWorkflowsDescription, b as getReleaseContextDescription, bi as getRepositoryTreeCore, bn as addIssueReactionDescription, br as createPullRequestReviewDescription, bt as deleteGistDescription, c as mergeContextArgs, ci as createRepositoryCore, cn as addDiscussionCommentDescription, cr as updateIssueCommentDescription, ct as rerunWorkflowRunDescription, d as getCiFailureContextDescription, di as forkRepositoryCore, dn as getDiscussionDescription, dr as updateIssueDescription, dt as triggerWorkflowDescription, ei as getPullRequestContextToModelOutput, en as searchRepositoriesInputSchema, er as listLabelsInputSchema, et as listWorkflowJobsInputSchema, f as getCiFailureContextInputSchema, fi as forkRepositoryDescription, fn as getDiscussionInputSchema, fr as updateIssueInputSchema, ft as triggerWorkflowInputSchema, g as getPullRequestContextCore, gi as getFileContentInputSchema, gn as addCommentReactionCore, gr as createPullRequestCore, gt as createGistCore, h as getIssueContextInputSchema, hi as getFileContentDescription, hn as listDiscussionsInputSchema, hr as addPullRequestCommentInputSchema, ht as createGistCommentInputSchema, ii as createBranchInputSchema, in as markNotificationReadCore, ir as removeLabelCore, it as listWorkflowsCore, j as getReleaseCore, jn as addIssueCommentCore, jr as listPullRequestReviewsCore, jt as updateGistCore, k as getLatestReleaseDescription, kn as addAssigneesDescription, kr as listPullRequestFilesDescription, kt as listGistsDescription, l as softenContextSchema, li as createRepositoryDescription, ln as addDiscussionCommentInputSchema, lr as updateIssueCommentInputSchema, lt as rerunWorkflowRunInputSchema, m as getIssueContextDescription, mi as getFileContentCore, mn as listDiscussionsDescription, mr as addPullRequestCommentDescription, mt as createGistCommentDescription, n as ALL_GITHUB_TOOL_NAMES, ni as createBranchCore, nn as listNotificationsDescription, nr as removeAssigneesDescription, nt as listWorkflowRunsDescription, oi as createOrUpdateFileDescription, on as markNotificationReadInputSchema, or as removeLabelInputSchema, ot as listWorkflowsInputSchema, p as getIssueContextCore, pi as forkRepositoryInputSchema, pn as listDiscussionsCore, pr as addPullRequestCommentCore, pt as createGistCommentCore, q as cancelWorkflowRunDescription, qn as getIssueDescription, qr as updatePullRequestDescription, qt as searchCodeDescription, ri as createBranchDescription, rn as listNotificationsInputSchema, rr as removeAssigneesInputSchema, rt as listWorkflowRunsInputSchema, si as createOrUpdateFileInputSchema, sn as addDiscussionCommentCore, sr as updateIssueCommentCore, st as rerunWorkflowRunCore, ti as listPullRequestFilesToModelOutput, tn as listNotificationsCore, tr as removeAssigneesCore, tt as listWorkflowRunsCore, u as getCiFailureContextCore, ui as createRepositoryInputSchema, un as getDiscussionCore, ur as updateIssueCore, ut as triggerWorkflowCore, v as getPullRequestContextInputSchema, vi as getRepositoryDescription, vn as addCommentReactionInputSchema, vr as createPullRequestInputSchema, vt as createGistInputSchema, w as createReleaseInputSchema, wi as listBranchesDescription, wn as listCommentReactionsInputSchema, wr as deletePullRequestCommentInputSchema, wt as getGistInputSchema, x as getReleaseContextInputSchema, xi as getRepositoryTreeDescription, xn as addIssueReactionInputSchema, xr as createPullRequestReviewInputSchema, xt as deleteGistInputSchema, y as getReleaseContextCore, yi as getRepositoryInputSchema, yn as addIssueReactionCore, yr as createPullRequestReviewCore, yt as deleteGistCore, z as updateReleaseInputSchema, zn as closeIssueInputSchema, zr as mergePullRequestInputSchema, zt as getBlameInputSchema } from "./write-tools-uIVfURVp.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: "createIssue",
213
+ writeTool: "createIssue",
214
+ description: createIssueDescription,
215
+ inputSchema: createIssueInputSchema,
216
+ execute: withToken(createIssueCore, ctx)
217
+ },
218
+ {
219
+ name: "addIssueComment",
220
+ writeTool: "addIssueComment",
221
+ description: addIssueCommentDescription,
222
+ inputSchema: addIssueCommentInputSchema,
223
+ execute: withToken(addIssueCommentCore, ctx)
224
+ },
225
+ {
226
+ name: "updateIssueComment",
227
+ writeTool: "updateIssueComment",
228
+ description: updateIssueCommentDescription,
229
+ inputSchema: updateIssueCommentInputSchema,
230
+ execute: withToken(updateIssueCommentCore, ctx)
231
+ },
232
+ {
233
+ name: "deleteIssueComment",
234
+ writeTool: "deleteIssueComment",
235
+ description: deleteIssueCommentDescription,
236
+ inputSchema: deleteIssueCommentInputSchema,
237
+ execute: withToken(deleteIssueCommentCore, ctx)
238
+ },
239
+ {
240
+ name: "closeIssue",
241
+ writeTool: "closeIssue",
242
+ description: closeIssueDescription,
243
+ inputSchema: closeIssueInputSchema,
244
+ execute: withToken(closeIssueCore, ctx)
245
+ },
246
+ {
247
+ name: "updateIssue",
248
+ writeTool: "updateIssue",
249
+ description: updateIssueDescription,
250
+ inputSchema: updateIssueInputSchema,
251
+ execute: withToken(updateIssueCore, ctx)
252
+ },
253
+ {
254
+ name: "listLabels",
255
+ description: listLabelsDescription,
256
+ inputSchema: listLabelsInputSchema,
257
+ execute: withToken(listLabelsCore, ctx)
258
+ },
259
+ {
260
+ name: "addLabels",
261
+ writeTool: "addLabels",
262
+ description: addLabelsDescription,
263
+ inputSchema: addLabelsInputSchema,
264
+ execute: withToken(addLabelsCore, ctx)
265
+ },
266
+ {
267
+ name: "removeLabel",
268
+ writeTool: "removeLabel",
269
+ description: removeLabelDescription,
270
+ inputSchema: removeLabelInputSchema,
271
+ execute: withToken(removeLabelCore, ctx)
272
+ },
273
+ {
274
+ name: "addAssignees",
275
+ writeTool: "addAssignees",
276
+ description: addAssigneesDescription,
277
+ inputSchema: addAssigneesInputSchema,
278
+ execute: withToken(addAssigneesCore, ctx)
279
+ },
280
+ {
281
+ name: "removeAssignees",
282
+ writeTool: "removeAssignees",
283
+ description: removeAssigneesDescription,
284
+ inputSchema: removeAssigneesInputSchema,
285
+ execute: withToken(removeAssigneesCore, ctx)
286
+ },
287
+ {
288
+ name: "listIssueReactions",
289
+ description: listIssueReactionsDescription,
290
+ inputSchema: listIssueReactionsInputSchema,
291
+ execute: withToken(listIssueReactionsCore, ctx)
292
+ },
293
+ {
294
+ name: "addIssueReaction",
295
+ writeTool: "addIssueReaction",
296
+ description: addIssueReactionDescription,
297
+ inputSchema: addIssueReactionInputSchema,
298
+ execute: withToken(addIssueReactionCore, ctx)
299
+ },
300
+ {
301
+ name: "listCommentReactions",
302
+ description: listCommentReactionsDescription,
303
+ inputSchema: listCommentReactionsInputSchema,
304
+ execute: withToken(listCommentReactionsCore, ctx)
305
+ },
306
+ {
307
+ name: "addCommentReaction",
308
+ writeTool: "addCommentReaction",
309
+ description: addCommentReactionDescription,
310
+ inputSchema: addCommentReactionInputSchema,
311
+ execute: withToken(addCommentReactionCore, ctx)
312
+ },
313
+ {
314
+ name: "listDiscussions",
315
+ description: listDiscussionsDescription,
316
+ inputSchema: listDiscussionsInputSchema,
317
+ execute: withToken(listDiscussionsCore, ctx)
318
+ },
319
+ {
320
+ name: "getDiscussion",
321
+ description: getDiscussionDescription,
322
+ inputSchema: getDiscussionInputSchema,
323
+ execute: withToken(getDiscussionCore, ctx)
324
+ },
325
+ {
326
+ name: "addDiscussionComment",
327
+ writeTool: "addDiscussionComment",
328
+ description: addDiscussionCommentDescription,
329
+ inputSchema: addDiscussionCommentInputSchema,
330
+ execute: withToken(addDiscussionCommentCore, ctx)
331
+ },
332
+ {
333
+ name: "listNotifications",
334
+ description: listNotificationsDescription,
335
+ inputSchema: listNotificationsInputSchema,
336
+ execute: withToken(listNotificationsCore, ctx)
337
+ },
338
+ {
339
+ name: "markNotificationRead",
340
+ writeTool: "markNotificationRead",
341
+ description: markNotificationReadDescription,
342
+ inputSchema: markNotificationReadInputSchema,
343
+ execute: withToken(markNotificationReadCore, ctx)
344
+ },
345
+ {
346
+ name: "searchCode",
347
+ description: searchCodeDescription,
348
+ inputSchema: searchCodeInputSchema,
349
+ execute: withToken(searchCodeCore, ctx)
350
+ },
351
+ {
352
+ name: "searchRepositories",
353
+ description: searchRepositoriesDescription,
354
+ inputSchema: searchRepositoriesInputSchema,
355
+ execute: withToken(searchRepositoriesCore, ctx)
356
+ },
357
+ {
358
+ name: "searchIssues",
359
+ description: searchIssuesDescription,
360
+ inputSchema: searchIssuesInputSchema,
361
+ execute: withToken(searchIssuesCore, ctx)
362
+ },
363
+ {
364
+ name: "listCommits",
365
+ description: listCommitsDescription,
366
+ inputSchema: listCommitsInputSchema,
367
+ execute: withToken(listCommitsCore, ctx)
368
+ },
369
+ {
370
+ name: "getCommit",
371
+ description: getCommitDescription,
372
+ inputSchema: getCommitInputSchema,
373
+ execute: withToken(getCommitCore, ctx),
374
+ toModelOutput: modelOutputAdapter(getCommitToModelOutput)
375
+ },
376
+ {
377
+ name: "getBlame",
378
+ description: getBlameDescription,
379
+ inputSchema: getBlameInputSchema,
380
+ execute: withToken(getBlameCore, ctx)
381
+ },
382
+ {
383
+ name: "compareCommits",
384
+ description: compareCommitsDescription,
385
+ inputSchema: compareCommitsInputSchema,
386
+ execute: withToken(compareCommitsCore, ctx),
387
+ toModelOutput: modelOutputAdapter(compareCommitsToModelOutput)
388
+ },
389
+ {
390
+ name: "listGists",
391
+ description: listGistsDescription,
392
+ inputSchema: listGistsInputSchema,
393
+ execute: withToken(listGistsCore, ctx)
394
+ },
395
+ {
396
+ name: "getGist",
397
+ description: getGistDescription,
398
+ inputSchema: getGistInputSchema,
399
+ execute: withToken(getGistCore, ctx)
400
+ },
401
+ {
402
+ name: "listGistComments",
403
+ description: listGistCommentsDescription,
404
+ inputSchema: listGistCommentsInputSchema,
405
+ execute: withToken(listGistCommentsCore, ctx)
406
+ },
407
+ {
408
+ name: "createGist",
409
+ writeTool: "createGist",
410
+ description: createGistDescription,
411
+ inputSchema: createGistInputSchema,
412
+ execute: withToken(createGistCore, ctx)
413
+ },
414
+ {
415
+ name: "updateGist",
416
+ writeTool: "updateGist",
417
+ description: updateGistDescription,
418
+ inputSchema: updateGistInputSchema,
419
+ execute: withToken(updateGistCore, ctx)
420
+ },
421
+ {
422
+ name: "deleteGist",
423
+ writeTool: "deleteGist",
424
+ description: deleteGistDescription,
425
+ inputSchema: deleteGistInputSchema,
426
+ execute: withToken(deleteGistCore, ctx)
427
+ },
428
+ {
429
+ name: "createGistComment",
430
+ writeTool: "createGistComment",
431
+ description: createGistCommentDescription,
432
+ inputSchema: createGistCommentInputSchema,
433
+ execute: withToken(createGistCommentCore, ctx)
434
+ },
435
+ {
436
+ name: "listWorkflows",
437
+ description: listWorkflowsDescription,
438
+ inputSchema: listWorkflowsInputSchema,
439
+ execute: withToken(listWorkflowsCore, ctx)
440
+ },
441
+ {
442
+ name: "listWorkflowRuns",
443
+ description: listWorkflowRunsDescription,
444
+ inputSchema: listWorkflowRunsInputSchema,
445
+ execute: withToken(listWorkflowRunsCore, ctx)
446
+ },
447
+ {
448
+ name: "getWorkflowRun",
449
+ description: getWorkflowRunDescription,
450
+ inputSchema: getWorkflowRunInputSchema,
451
+ execute: withToken(getWorkflowRunCore, ctx)
452
+ },
453
+ {
454
+ name: "listWorkflowJobs",
455
+ description: listWorkflowJobsDescription,
456
+ inputSchema: listWorkflowJobsInputSchema,
457
+ execute: withToken(listWorkflowJobsCore, ctx)
458
+ },
459
+ {
460
+ name: "triggerWorkflow",
461
+ writeTool: "triggerWorkflow",
462
+ description: triggerWorkflowDescription,
463
+ inputSchema: triggerWorkflowInputSchema,
464
+ execute: withToken(triggerWorkflowCore, ctx)
465
+ },
466
+ {
467
+ name: "cancelWorkflowRun",
468
+ writeTool: "cancelWorkflowRun",
469
+ description: cancelWorkflowRunDescription,
470
+ inputSchema: cancelWorkflowRunInputSchema,
471
+ execute: withToken(cancelWorkflowRunCore, ctx)
472
+ },
473
+ {
474
+ name: "rerunWorkflowRun",
475
+ writeTool: "rerunWorkflowRun",
476
+ description: rerunWorkflowRunDescription,
477
+ inputSchema: rerunWorkflowRunInputSchema,
478
+ execute: withToken(rerunWorkflowRunCore, ctx)
479
+ },
480
+ {
481
+ name: "listCheckRuns",
482
+ description: listCheckRunsDescription,
483
+ inputSchema: listCheckRunsInputSchema,
484
+ execute: withToken(listCheckRunsCore, ctx)
485
+ },
486
+ {
487
+ name: "getCombinedStatus",
488
+ description: getCombinedStatusDescription,
489
+ inputSchema: getCombinedStatusInputSchema,
490
+ execute: withToken(getCombinedStatusCore, ctx)
491
+ },
492
+ {
493
+ name: "getCiFailureContext",
494
+ description: getCiFailureContextDescription,
495
+ inputSchema: getCiFailureContextInputSchema,
496
+ execute: withToken(getCiFailureContextCore, ctx)
497
+ },
498
+ {
499
+ name: "listReleases",
500
+ description: listReleasesDescription,
501
+ inputSchema: listReleasesInputSchema,
502
+ execute: withToken(listReleasesCore, ctx)
503
+ },
504
+ {
505
+ name: "getLatestRelease",
506
+ description: getLatestReleaseDescription,
507
+ inputSchema: getLatestReleaseInputSchema,
508
+ execute: withToken(getLatestReleaseCore, ctx)
509
+ },
510
+ {
511
+ name: "getRelease",
512
+ description: getReleaseDescription,
513
+ inputSchema: getReleaseInputSchema,
514
+ execute: withToken(getReleaseCore, ctx)
515
+ },
516
+ {
517
+ name: "getReleaseContext",
518
+ description: getReleaseContextDescription,
519
+ inputSchema: getReleaseContextInputSchema,
520
+ execute: withToken(getReleaseContextCore, ctx)
521
+ },
522
+ {
523
+ name: "createRelease",
524
+ writeTool: "createRelease",
525
+ description: createReleaseDescription,
526
+ inputSchema: createReleaseInputSchema,
527
+ execute: withToken(createReleaseCore, ctx)
528
+ },
529
+ {
530
+ name: "updateRelease",
531
+ writeTool: "updateRelease",
532
+ description: updateReleaseDescription,
533
+ inputSchema: updateReleaseInputSchema,
534
+ execute: withToken(updateReleaseCore, ctx)
535
+ },
536
+ {
537
+ name: "deleteRelease",
538
+ writeTool: "deleteRelease",
539
+ description: deleteReleaseDescription,
540
+ inputSchema: deleteReleaseInputSchema,
541
+ execute: withToken(deleteReleaseCore, ctx)
542
+ }
543
+ ];
544
+ if (!ctx.context) return entries;
545
+ return entries.map((entry) => ({
546
+ ...entry,
547
+ inputSchema: softenContextSchema(entry.inputSchema, ctx.context)
548
+ }));
549
+ }
550
+ //#endregion
551
+ //#region src/eve/steps.ts
552
+ async function executeGithubToolStep(name, input, ctx) {
553
+ "use step";
554
+ const entry = createToolRegistry(ctx).find((tool) => tool.name === name);
555
+ if (!entry) throw new Error(`Unknown GitHub tool: ${name}`);
556
+ return entry.execute(input);
557
+ }
558
+ async function runGithubToolStep(name, input, ctx) {
559
+ const token = await resolveGithubToken(ctx.token);
560
+ return executeGithubToolStep(name, input, {
561
+ ...ctx,
562
+ token
563
+ });
564
+ }
565
+ //#endregion
566
+ //#region src/eve/build.ts
567
+ function resolveAllowedToolNames(options) {
568
+ const presetAllowed = options.preset ? resolvePresetTools(options.preset) : null;
569
+ const includeAllowed = options.include ? new Set(options.include) : null;
570
+ const excluded = options.exclude ? new Set(options.exclude) : null;
571
+ const allowed = presetAllowed && includeAllowed ? /* @__PURE__ */ new Set([...presetAllowed, ...includeAllowed]) : presetAllowed ?? includeAllowed;
572
+ return (name) => (!allowed || allowed.has(name)) && !excluded?.has(name);
573
+ }
574
+ function applyOverrides(tool, name, overrides) {
575
+ const override = overrides?.[name];
576
+ if (!override) return tool;
577
+ return {
578
+ ...tool,
579
+ ...override.description !== void 0 && { description: override.description },
580
+ ...override.approval !== void 0 && { approval: mapEveApprovalValue(override.approval) },
581
+ ...override.toModelOutput !== void 0 && { toModelOutput: override.toModelOutput },
582
+ ...override.outputSchema !== void 0 && { outputSchema: override.outputSchema }
583
+ };
584
+ }
585
+ function buildEveToolDefinition(name, options = {}) {
586
+ const { defineTool } = getEveTools();
587
+ const ctx = {
588
+ token: createGithubTokenResolver(options.token),
589
+ context: options.context,
590
+ author: options.author,
591
+ committer: options.committer,
592
+ coAuthors: options.coAuthors
593
+ };
594
+ const entry = createToolRegistry(ctx).find((tool) => tool.name === name);
595
+ if (!entry) throw new Error(`Unknown GitHub tool: ${name}`);
596
+ return applyOverrides(defineTool({
597
+ description: entry.description,
598
+ inputSchema: entry.inputSchema,
599
+ ...entry.writeTool && { approval: resolveEveApproval(entry.writeTool, options.requireApproval) },
600
+ ...entry.toModelOutput && { toModelOutput: entry.toModelOutput },
601
+ execute: async (input) => runGithubToolStep(name, input, ctx)
602
+ }), name, options.overrides);
603
+ }
604
+ function buildEveToolMap(options = {}) {
605
+ const { defineTool } = getEveTools();
606
+ const ctx = {
607
+ token: createGithubTokenResolver(options.token),
608
+ context: options.context,
609
+ author: options.author,
610
+ committer: options.committer,
611
+ coAuthors: options.coAuthors
612
+ };
613
+ const isAllowed = resolveAllowedToolNames(options);
614
+ const registry = createToolRegistry(ctx);
615
+ const tools = {};
616
+ for (const entry of registry) {
617
+ if (!isAllowed(entry.name)) continue;
618
+ const tool = defineTool({
619
+ description: entry.description,
620
+ inputSchema: entry.inputSchema,
621
+ ...entry.writeTool && { approval: resolveEveApproval(entry.writeTool, options.requireApproval) },
622
+ ...entry.toModelOutput && { toModelOutput: entry.toModelOutput },
623
+ execute: async (input) => runGithubToolStep(entry.name, input, ctx)
624
+ });
625
+ tools[entry.name] = applyOverrides(tool, entry.name, options.overrides);
626
+ }
627
+ return tools;
628
+ }
629
+ function createEveGithubToolsDynamic(options = {}) {
630
+ const { defineDynamic } = getEveTools();
631
+ return defineDynamic({ events: { "session.started": async () => buildEveToolMap(options) } });
632
+ }
633
+ function listResolvedEveToolNames(options = {}) {
634
+ const isAllowed = resolveAllowedToolNames(options);
635
+ return ALL_GITHUB_TOOL_NAMES.filter(isAllowed);
636
+ }
637
+ /**
638
+ * Tool descriptors (no `execute`) for authored eve `defineTool` loops.
639
+ * Prefer this when registering tools outside the SDK package so durable transforms can hoist inline execute.
640
+ */
641
+ function listEveToolDescriptors(options = {}) {
642
+ const ctx = {
643
+ token: createGithubTokenResolver(options.token),
644
+ context: options.context,
645
+ author: options.author,
646
+ committer: options.committer,
647
+ coAuthors: options.coAuthors
648
+ };
649
+ const isAllowed = resolveAllowedToolNames(options);
650
+ return createToolRegistry(ctx).filter((entry) => isAllowed(entry.name)).map((entry) => ({
651
+ name: entry.name,
652
+ description: entry.description,
653
+ inputSchema: entry.inputSchema,
654
+ writeTool: entry.writeTool,
655
+ toModelOutput: entry.toModelOutput
656
+ }));
657
+ }
658
+ /**
659
+ * Execute a GitHub tool by name with the given eve options (token/context/attribution).
660
+ * Used by `@github-tools/eve-extension` so `execute` only closes over a serializable tool name.
661
+ */
662
+ async function executeGithubEveTool(name, input, options = {}) {
663
+ return runGithubToolStep(name, input, {
664
+ token: createGithubTokenResolver(options.token),
665
+ context: options.context,
666
+ author: options.author,
667
+ committer: options.committer,
668
+ coAuthors: options.coAuthors
669
+ });
670
+ }
671
+ //#endregion
672
+ 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 };
673
+
674
+ //# sourceMappingURL=eve-runtime-CIcrt7MD.mjs.map