@github-tools/sdk 1.11.1 → 1.13.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 (46) hide show
  1. package/README.md +31 -14
  2. package/dist/connect/eve.d.mts +2 -3
  3. package/dist/connect/eve.d.mts.map +1 -1
  4. package/dist/connect/eve.mjs +1 -1
  5. package/dist/connect.d.mts +8 -86
  6. package/dist/connect.d.mts.map +1 -1
  7. package/dist/connect.mjs +2 -2
  8. package/dist/eve-runtime-BkzmgsI2.mjs +274 -0
  9. package/dist/eve-runtime-BkzmgsI2.mjs.map +1 -0
  10. package/dist/eve-runtime-C5HaKmOP.d.mts +85 -0
  11. package/dist/eve-runtime-C5HaKmOP.d.mts.map +1 -0
  12. package/dist/eve-runtime.d.mts +5 -4
  13. package/dist/eve-runtime.mjs +3 -3
  14. package/dist/eve.d.mts +4 -4
  15. package/dist/eve.d.mts.map +1 -1
  16. package/dist/eve.mjs +2 -2
  17. package/dist/index-BjRUOM2Z.d.mts +287 -0
  18. package/dist/index-BjRUOM2Z.d.mts.map +1 -0
  19. package/dist/index.d.mts +3 -2
  20. package/dist/index.mjs +3 -3
  21. package/dist/{src-jQWS2Txw.mjs → src-DPcwVTf-.mjs} +98 -4
  22. package/dist/src-DPcwVTf-.mjs.map +1 -0
  23. package/dist/{token-1uPUq_g-.mjs → token-qesvchbI.mjs} +23 -169
  24. package/dist/token-qesvchbI.mjs.map +1 -0
  25. package/dist/tool-types-K8i--5D9.d.mts +3255 -0
  26. package/dist/tool-types-K8i--5D9.d.mts.map +1 -0
  27. package/dist/{types-BD5YvGxm.d.mts → types-6aWpzNzg.d.mts} +3 -3
  28. package/dist/{types-BD5YvGxm.d.mts.map → types-6aWpzNzg.d.mts.map} +1 -1
  29. package/dist/{types-BDO-Mmn6.d.mts → types-BVSe0Zey.d.mts} +4 -3
  30. package/dist/types-BVSe0Zey.d.mts.map +1 -0
  31. package/dist/workflow.d.mts +2 -1
  32. package/dist/workflow.d.mts.map +1 -1
  33. package/dist/workflow.mjs +2 -2
  34. package/dist/{write-tools-Dk32V9Hl.mjs → write-tools-BEcL5Fv6.mjs} +2626 -1513
  35. package/dist/write-tools-BEcL5Fv6.mjs.map +1 -0
  36. package/package.json +5 -5
  37. package/dist/eve-runtime-Cb0LVEvS.d.mts +0 -66
  38. package/dist/eve-runtime-Cb0LVEvS.d.mts.map +0 -1
  39. package/dist/eve-runtime-DInXr4h5.mjs +0 -734
  40. package/dist/eve-runtime-DInXr4h5.mjs.map +0 -1
  41. package/dist/index-BNeMjmgp.d.mts +0 -770
  42. package/dist/index-BNeMjmgp.d.mts.map +0 -1
  43. package/dist/src-jQWS2Txw.mjs.map +0 -1
  44. package/dist/token-1uPUq_g-.mjs.map +0 -1
  45. package/dist/types-BDO-Mmn6.d.mts.map +0 -1
  46. package/dist/write-tools-Dk32V9Hl.mjs.map +0 -1
@@ -1,734 +0,0 @@
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
- /**
15
- * `false` / `'never'` should omit the tool `approval` field entirely.
16
- * eve treats a missing `approval` like `never()`; attaching `never()` is
17
- * redundant and has caused approval UI noise on some channels.
18
- */
19
- function isEveApprovalDisabled(value) {
20
- return value === false || value === "never";
21
- }
22
- function mapEveApprovalValue(value) {
23
- if (typeof value === "function") return value;
24
- const { always, never, once } = getEveApprovalHelpers();
25
- if (value === true || value === "always") return always();
26
- if (value === false || value === "never") return never();
27
- if (value === "once") return once();
28
- return always();
29
- }
30
- function resolveEveApproval(toolName, config) {
31
- if (config === void 0) return getEveApprovalHelpers().always();
32
- if (config === true) return getEveApprovalHelpers().always();
33
- if (config === false) return getEveApprovalHelpers().never();
34
- const value = config[toolName];
35
- if (value === void 0) return getEveApprovalHelpers().always();
36
- return mapEveApprovalValue(value);
37
- }
38
- /**
39
- * Approval to attach on a write tool, or `undefined` to omit the field.
40
- * Prefer this when building `defineTool` values so `false` / `'never'` do not
41
- * attach a redundant `never()` handler.
42
- */
43
- function resolveEveToolApproval(toolName, config, override) {
44
- if (override !== void 0) {
45
- if (isEveApprovalDisabled(override)) return void 0;
46
- return mapEveApprovalValue(override);
47
- }
48
- if (config === false) return void 0;
49
- if (typeof config === "object" && config !== null && isEveApprovalDisabled(config[toolName])) return;
50
- return resolveEveApproval(toolName, config);
51
- }
52
- //#endregion
53
- //#region src/eve/registry.ts
54
- function withToken(core, ctx, extra) {
55
- return async (input) => core({
56
- token: await resolveGithubToken(ctx.token),
57
- ...extra,
58
- ...mergeContextArgs(input, ctx.context ?? {})
59
- });
60
- }
61
- function modelOutputAdapter(fn) {
62
- return (output) => fn({
63
- toolCallId: "",
64
- input: {},
65
- output
66
- });
67
- }
68
- function createToolRegistry(ctx) {
69
- const entries = [
70
- {
71
- name: "getRepository",
72
- description: getRepositoryDescription,
73
- inputSchema: getRepositoryInputSchema,
74
- execute: withToken(getRepositoryCore, ctx)
75
- },
76
- {
77
- name: "listBranches",
78
- description: listBranchesDescription,
79
- inputSchema: listBranchesInputSchema,
80
- execute: withToken(listBranchesCore, ctx)
81
- },
82
- {
83
- name: "getFileContent",
84
- description: getFileContentDescription,
85
- inputSchema: getFileContentInputSchema,
86
- execute: withToken(getFileContentCore, ctx),
87
- toModelOutput: modelOutputAdapter(getFileContentToModelOutput)
88
- },
89
- {
90
- name: "getRepositoryTree",
91
- description: getRepositoryTreeDescription,
92
- inputSchema: getRepositoryTreeInputSchema,
93
- execute: withToken(getRepositoryTreeCore, ctx)
94
- },
95
- {
96
- name: "createBranch",
97
- writeTool: "createBranch",
98
- description: createBranchDescription,
99
- inputSchema: createBranchInputSchema,
100
- execute: withToken(createBranchCore, ctx)
101
- },
102
- {
103
- name: "forkRepository",
104
- writeTool: "forkRepository",
105
- description: forkRepositoryDescription,
106
- inputSchema: forkRepositoryInputSchema,
107
- execute: withToken(forkRepositoryCore, ctx)
108
- },
109
- {
110
- name: "createRepository",
111
- writeTool: "createRepository",
112
- description: createRepositoryDescription,
113
- inputSchema: createRepositoryInputSchema,
114
- execute: withToken(createRepositoryCore, ctx)
115
- },
116
- {
117
- name: "createOrUpdateFile",
118
- writeTool: "createOrUpdateFile",
119
- description: createOrUpdateFileDescription,
120
- inputSchema: createOrUpdateFileInputSchema,
121
- execute: withToken(createOrUpdateFileCore, ctx, {
122
- author: ctx.author,
123
- committer: ctx.committer,
124
- coAuthors: ctx.coAuthors
125
- })
126
- },
127
- {
128
- name: "listPullRequests",
129
- description: listPullRequestsDescription,
130
- inputSchema: listPullRequestsInputSchema,
131
- execute: withToken(listPullRequestsCore, ctx)
132
- },
133
- {
134
- name: "getPullRequest",
135
- description: getPullRequestDescription,
136
- inputSchema: getPullRequestInputSchema,
137
- execute: withToken(getPullRequestCore, ctx)
138
- },
139
- {
140
- name: "createPullRequest",
141
- writeTool: "createPullRequest",
142
- description: createPullRequestDescription,
143
- inputSchema: createPullRequestInputSchema,
144
- execute: withToken(createPullRequestCore, ctx)
145
- },
146
- {
147
- name: "mergePullRequest",
148
- writeTool: "mergePullRequest",
149
- description: mergePullRequestDescription,
150
- inputSchema: mergePullRequestInputSchema,
151
- execute: withToken(mergePullRequestCore, ctx, { coAuthors: ctx.coAuthors })
152
- },
153
- {
154
- name: "updatePullRequest",
155
- writeTool: "updatePullRequest",
156
- description: updatePullRequestDescription,
157
- inputSchema: updatePullRequestInputSchema,
158
- execute: withToken(updatePullRequestCore, ctx)
159
- },
160
- {
161
- name: "addPullRequestComment",
162
- writeTool: "addPullRequestComment",
163
- description: addPullRequestCommentDescription,
164
- inputSchema: addPullRequestCommentInputSchema,
165
- execute: withToken(addPullRequestCommentCore, ctx)
166
- },
167
- {
168
- name: "updatePullRequestComment",
169
- writeTool: "updatePullRequestComment",
170
- description: updatePullRequestCommentDescription,
171
- inputSchema: updatePullRequestCommentInputSchema,
172
- execute: withToken(updatePullRequestCommentCore, ctx)
173
- },
174
- {
175
- name: "deletePullRequestComment",
176
- writeTool: "deletePullRequestComment",
177
- description: deletePullRequestCommentDescription,
178
- inputSchema: deletePullRequestCommentInputSchema,
179
- execute: withToken(deletePullRequestCommentCore, ctx)
180
- },
181
- {
182
- name: "listPullRequestFiles",
183
- description: listPullRequestFilesDescription,
184
- inputSchema: listPullRequestFilesInputSchema,
185
- execute: withToken(listPullRequestFilesCore, ctx),
186
- toModelOutput: modelOutputAdapter(listPullRequestFilesToModelOutput)
187
- },
188
- {
189
- name: "listPullRequestReviews",
190
- description: listPullRequestReviewsDescription,
191
- inputSchema: listPullRequestReviewsInputSchema,
192
- execute: withToken(listPullRequestReviewsCore, ctx)
193
- },
194
- {
195
- name: "createPullRequestReview",
196
- writeTool: "createPullRequestReview",
197
- description: createPullRequestReviewDescription,
198
- inputSchema: createPullRequestReviewInputSchema,
199
- execute: withToken(createPullRequestReviewCore, ctx)
200
- },
201
- {
202
- name: "requestReviewers",
203
- writeTool: "requestReviewers",
204
- description: requestReviewersDescription,
205
- inputSchema: requestReviewersInputSchema,
206
- execute: withToken(requestReviewersCore, ctx)
207
- },
208
- {
209
- name: "getPullRequestContext",
210
- description: getPullRequestContextDescription,
211
- inputSchema: getPullRequestContextInputSchema,
212
- execute: withToken(getPullRequestContextCore, ctx),
213
- toModelOutput: modelOutputAdapter(getPullRequestContextToModelOutput)
214
- },
215
- {
216
- name: "getIssueContext",
217
- description: getIssueContextDescription,
218
- inputSchema: getIssueContextInputSchema,
219
- execute: withToken(getIssueContextCore, ctx)
220
- },
221
- {
222
- name: "listIssues",
223
- description: listIssuesDescription,
224
- inputSchema: listIssuesInputSchema,
225
- execute: withToken(listIssuesCore, ctx)
226
- },
227
- {
228
- name: "getIssue",
229
- description: getIssueDescription,
230
- inputSchema: getIssueInputSchema,
231
- execute: withToken(getIssueCore, ctx)
232
- },
233
- {
234
- name: "listIssueComments",
235
- description: listIssueCommentsDescription,
236
- inputSchema: listIssueCommentsInputSchema,
237
- execute: withToken(listIssueCommentsCore, ctx)
238
- },
239
- {
240
- name: "createIssue",
241
- writeTool: "createIssue",
242
- description: createIssueDescription,
243
- inputSchema: createIssueInputSchema,
244
- execute: withToken(createIssueCore, ctx)
245
- },
246
- {
247
- name: "addIssueComment",
248
- writeTool: "addIssueComment",
249
- description: addIssueCommentDescription,
250
- inputSchema: addIssueCommentInputSchema,
251
- execute: withToken(addIssueCommentCore, ctx)
252
- },
253
- {
254
- name: "updateIssueComment",
255
- writeTool: "updateIssueComment",
256
- description: updateIssueCommentDescription,
257
- inputSchema: updateIssueCommentInputSchema,
258
- execute: withToken(updateIssueCommentCore, ctx)
259
- },
260
- {
261
- name: "deleteIssueComment",
262
- writeTool: "deleteIssueComment",
263
- description: deleteIssueCommentDescription,
264
- inputSchema: deleteIssueCommentInputSchema,
265
- execute: withToken(deleteIssueCommentCore, ctx)
266
- },
267
- {
268
- name: "closeIssue",
269
- writeTool: "closeIssue",
270
- description: closeIssueDescription,
271
- inputSchema: closeIssueInputSchema,
272
- execute: withToken(closeIssueCore, ctx)
273
- },
274
- {
275
- name: "updateIssue",
276
- writeTool: "updateIssue",
277
- description: updateIssueDescription,
278
- inputSchema: updateIssueInputSchema,
279
- execute: withToken(updateIssueCore, ctx)
280
- },
281
- {
282
- name: "listLabels",
283
- description: listLabelsDescription,
284
- inputSchema: listLabelsInputSchema,
285
- execute: withToken(listLabelsCore, ctx)
286
- },
287
- {
288
- name: "addLabels",
289
- writeTool: "addLabels",
290
- description: addLabelsDescription,
291
- inputSchema: addLabelsInputSchema,
292
- execute: withToken(addLabelsCore, ctx)
293
- },
294
- {
295
- name: "removeLabel",
296
- writeTool: "removeLabel",
297
- description: removeLabelDescription,
298
- inputSchema: removeLabelInputSchema,
299
- execute: withToken(removeLabelCore, ctx)
300
- },
301
- {
302
- name: "createLabel",
303
- writeTool: "createLabel",
304
- description: createLabelDescription,
305
- inputSchema: createLabelInputSchema,
306
- execute: withToken(createLabelCore, ctx)
307
- },
308
- {
309
- name: "updateLabel",
310
- writeTool: "updateLabel",
311
- description: updateLabelDescription,
312
- inputSchema: updateLabelInputSchema,
313
- execute: withToken(updateLabelCore, ctx)
314
- },
315
- {
316
- name: "deleteLabel",
317
- writeTool: "deleteLabel",
318
- description: deleteLabelDescription,
319
- inputSchema: deleteLabelInputSchema,
320
- execute: withToken(deleteLabelCore, ctx)
321
- },
322
- {
323
- name: "addAssignees",
324
- writeTool: "addAssignees",
325
- description: addAssigneesDescription,
326
- inputSchema: addAssigneesInputSchema,
327
- execute: withToken(addAssigneesCore, ctx)
328
- },
329
- {
330
- name: "removeAssignees",
331
- writeTool: "removeAssignees",
332
- description: removeAssigneesDescription,
333
- inputSchema: removeAssigneesInputSchema,
334
- execute: withToken(removeAssigneesCore, ctx)
335
- },
336
- {
337
- name: "listIssueReactions",
338
- description: listIssueReactionsDescription,
339
- inputSchema: listIssueReactionsInputSchema,
340
- execute: withToken(listIssueReactionsCore, ctx)
341
- },
342
- {
343
- name: "addIssueReaction",
344
- writeTool: "addIssueReaction",
345
- description: addIssueReactionDescription,
346
- inputSchema: addIssueReactionInputSchema,
347
- execute: withToken(addIssueReactionCore, ctx)
348
- },
349
- {
350
- name: "listCommentReactions",
351
- description: listCommentReactionsDescription,
352
- inputSchema: listCommentReactionsInputSchema,
353
- execute: withToken(listCommentReactionsCore, ctx)
354
- },
355
- {
356
- name: "addCommentReaction",
357
- writeTool: "addCommentReaction",
358
- description: addCommentReactionDescription,
359
- inputSchema: addCommentReactionInputSchema,
360
- execute: withToken(addCommentReactionCore, ctx)
361
- },
362
- {
363
- name: "listDiscussions",
364
- description: listDiscussionsDescription,
365
- inputSchema: listDiscussionsInputSchema,
366
- execute: withToken(listDiscussionsCore, ctx)
367
- },
368
- {
369
- name: "getDiscussion",
370
- description: getDiscussionDescription,
371
- inputSchema: getDiscussionInputSchema,
372
- execute: withToken(getDiscussionCore, ctx)
373
- },
374
- {
375
- name: "addDiscussionComment",
376
- writeTool: "addDiscussionComment",
377
- description: addDiscussionCommentDescription,
378
- inputSchema: addDiscussionCommentInputSchema,
379
- execute: withToken(addDiscussionCommentCore, ctx)
380
- },
381
- {
382
- name: "listNotifications",
383
- description: listNotificationsDescription,
384
- inputSchema: listNotificationsInputSchema,
385
- execute: withToken(listNotificationsCore, ctx)
386
- },
387
- {
388
- name: "markNotificationRead",
389
- writeTool: "markNotificationRead",
390
- description: markNotificationReadDescription,
391
- inputSchema: markNotificationReadInputSchema,
392
- execute: withToken(markNotificationReadCore, ctx)
393
- },
394
- {
395
- name: "searchCode",
396
- description: searchCodeDescription,
397
- inputSchema: searchCodeInputSchema,
398
- execute: withToken(searchCodeCore, ctx)
399
- },
400
- {
401
- name: "searchRepositories",
402
- description: searchRepositoriesDescription,
403
- inputSchema: searchRepositoriesInputSchema,
404
- execute: withToken(searchRepositoriesCore, ctx)
405
- },
406
- {
407
- name: "searchIssues",
408
- description: searchIssuesDescription,
409
- inputSchema: searchIssuesInputSchema,
410
- execute: withToken(searchIssuesCore, ctx)
411
- },
412
- {
413
- name: "listCommits",
414
- description: listCommitsDescription,
415
- inputSchema: listCommitsInputSchema,
416
- execute: withToken(listCommitsCore, ctx)
417
- },
418
- {
419
- name: "getCommit",
420
- description: getCommitDescription,
421
- inputSchema: getCommitInputSchema,
422
- execute: withToken(getCommitCore, ctx),
423
- toModelOutput: modelOutputAdapter(getCommitToModelOutput)
424
- },
425
- {
426
- name: "getBlame",
427
- description: getBlameDescription,
428
- inputSchema: getBlameInputSchema,
429
- execute: withToken(getBlameCore, ctx)
430
- },
431
- {
432
- name: "compareCommits",
433
- description: compareCommitsDescription,
434
- inputSchema: compareCommitsInputSchema,
435
- execute: withToken(compareCommitsCore, ctx),
436
- toModelOutput: modelOutputAdapter(compareCommitsToModelOutput)
437
- },
438
- {
439
- name: "listGists",
440
- description: listGistsDescription,
441
- inputSchema: listGistsInputSchema,
442
- execute: withToken(listGistsCore, ctx)
443
- },
444
- {
445
- name: "getGist",
446
- description: getGistDescription,
447
- inputSchema: getGistInputSchema,
448
- execute: withToken(getGistCore, ctx)
449
- },
450
- {
451
- name: "listGistComments",
452
- description: listGistCommentsDescription,
453
- inputSchema: listGistCommentsInputSchema,
454
- execute: withToken(listGistCommentsCore, ctx)
455
- },
456
- {
457
- name: "createGist",
458
- writeTool: "createGist",
459
- description: createGistDescription,
460
- inputSchema: createGistInputSchema,
461
- execute: withToken(createGistCore, ctx)
462
- },
463
- {
464
- name: "updateGist",
465
- writeTool: "updateGist",
466
- description: updateGistDescription,
467
- inputSchema: updateGistInputSchema,
468
- execute: withToken(updateGistCore, ctx)
469
- },
470
- {
471
- name: "deleteGist",
472
- writeTool: "deleteGist",
473
- description: deleteGistDescription,
474
- inputSchema: deleteGistInputSchema,
475
- execute: withToken(deleteGistCore, ctx)
476
- },
477
- {
478
- name: "createGistComment",
479
- writeTool: "createGistComment",
480
- description: createGistCommentDescription,
481
- inputSchema: createGistCommentInputSchema,
482
- execute: withToken(createGistCommentCore, ctx)
483
- },
484
- {
485
- name: "listWorkflows",
486
- description: listWorkflowsDescription,
487
- inputSchema: listWorkflowsInputSchema,
488
- execute: withToken(listWorkflowsCore, ctx)
489
- },
490
- {
491
- name: "listWorkflowRuns",
492
- description: listWorkflowRunsDescription,
493
- inputSchema: listWorkflowRunsInputSchema,
494
- execute: withToken(listWorkflowRunsCore, ctx)
495
- },
496
- {
497
- name: "getWorkflowRun",
498
- description: getWorkflowRunDescription,
499
- inputSchema: getWorkflowRunInputSchema,
500
- execute: withToken(getWorkflowRunCore, ctx)
501
- },
502
- {
503
- name: "listWorkflowJobs",
504
- description: listWorkflowJobsDescription,
505
- inputSchema: listWorkflowJobsInputSchema,
506
- execute: withToken(listWorkflowJobsCore, ctx)
507
- },
508
- {
509
- name: "triggerWorkflow",
510
- writeTool: "triggerWorkflow",
511
- description: triggerWorkflowDescription,
512
- inputSchema: triggerWorkflowInputSchema,
513
- execute: withToken(triggerWorkflowCore, ctx)
514
- },
515
- {
516
- name: "cancelWorkflowRun",
517
- writeTool: "cancelWorkflowRun",
518
- description: cancelWorkflowRunDescription,
519
- inputSchema: cancelWorkflowRunInputSchema,
520
- execute: withToken(cancelWorkflowRunCore, ctx)
521
- },
522
- {
523
- name: "rerunWorkflowRun",
524
- writeTool: "rerunWorkflowRun",
525
- description: rerunWorkflowRunDescription,
526
- inputSchema: rerunWorkflowRunInputSchema,
527
- execute: withToken(rerunWorkflowRunCore, ctx)
528
- },
529
- {
530
- name: "listCheckRuns",
531
- description: listCheckRunsDescription,
532
- inputSchema: listCheckRunsInputSchema,
533
- execute: withToken(listCheckRunsCore, ctx)
534
- },
535
- {
536
- name: "getCombinedStatus",
537
- description: getCombinedStatusDescription,
538
- inputSchema: getCombinedStatusInputSchema,
539
- execute: withToken(getCombinedStatusCore, ctx)
540
- },
541
- {
542
- name: "getCiFailureContext",
543
- description: getCiFailureContextDescription,
544
- inputSchema: getCiFailureContextInputSchema,
545
- execute: withToken(getCiFailureContextCore, ctx)
546
- },
547
- {
548
- name: "listReleases",
549
- description: listReleasesDescription,
550
- inputSchema: listReleasesInputSchema,
551
- execute: withToken(listReleasesCore, ctx)
552
- },
553
- {
554
- name: "getLatestRelease",
555
- description: getLatestReleaseDescription,
556
- inputSchema: getLatestReleaseInputSchema,
557
- execute: withToken(getLatestReleaseCore, ctx)
558
- },
559
- {
560
- name: "getRelease",
561
- description: getReleaseDescription,
562
- inputSchema: getReleaseInputSchema,
563
- execute: withToken(getReleaseCore, ctx)
564
- },
565
- {
566
- name: "getReleaseContext",
567
- description: getReleaseContextDescription,
568
- inputSchema: getReleaseContextInputSchema,
569
- execute: withToken(getReleaseContextCore, ctx)
570
- },
571
- {
572
- name: "createRelease",
573
- writeTool: "createRelease",
574
- description: createReleaseDescription,
575
- inputSchema: createReleaseInputSchema,
576
- execute: withToken(createReleaseCore, ctx)
577
- },
578
- {
579
- name: "updateRelease",
580
- writeTool: "updateRelease",
581
- description: updateReleaseDescription,
582
- inputSchema: updateReleaseInputSchema,
583
- execute: withToken(updateReleaseCore, ctx)
584
- },
585
- {
586
- name: "deleteRelease",
587
- writeTool: "deleteRelease",
588
- description: deleteReleaseDescription,
589
- inputSchema: deleteReleaseInputSchema,
590
- execute: withToken(deleteReleaseCore, ctx)
591
- }
592
- ];
593
- if (!ctx.context) return entries;
594
- return entries.map((entry) => ({
595
- ...entry,
596
- inputSchema: softenContextSchema(entry.inputSchema, ctx.context)
597
- }));
598
- }
599
- //#endregion
600
- //#region src/eve/steps.ts
601
- async function executeGithubToolStep(name, input, ctx) {
602
- "use step";
603
- const entry = createToolRegistry(ctx).find((tool) => tool.name === name);
604
- if (!entry) throw new Error(`Unknown GitHub tool: ${name}`);
605
- return entry.execute(input);
606
- }
607
- async function runGithubToolStep(name, input, ctx) {
608
- const token = await resolveGithubToken(ctx.token);
609
- return executeGithubToolStep(name, input, {
610
- ...ctx,
611
- token
612
- });
613
- }
614
- //#endregion
615
- //#region src/eve/build.ts
616
- function resolveAllowedToolNames(options) {
617
- const presetAllowed = options.preset ? resolvePresetTools(options.preset) : null;
618
- const includeAllowed = options.include ? new Set(options.include) : null;
619
- const excluded = options.exclude ? new Set(options.exclude) : null;
620
- const allowed = presetAllowed && includeAllowed ? /* @__PURE__ */ new Set([...presetAllowed, ...includeAllowed]) : presetAllowed ?? includeAllowed;
621
- return (name) => (!allowed || allowed.has(name)) && !excluded?.has(name);
622
- }
623
- function applyOverrides(tool, name, overrides) {
624
- const override = overrides?.[name];
625
- if (!override) return tool;
626
- const next = {
627
- ...tool,
628
- ...override.description !== void 0 && { description: override.description },
629
- ...override.toModelOutput !== void 0 && { toModelOutput: override.toModelOutput },
630
- ...override.outputSchema !== void 0 && { outputSchema: override.outputSchema }
631
- };
632
- if (override.approval === void 0) return next;
633
- if (isEveApprovalDisabled(override.approval)) {
634
- const rest = { ...next };
635
- delete rest.approval;
636
- return rest;
637
- }
638
- return {
639
- ...next,
640
- approval: mapEveApprovalValue(override.approval)
641
- };
642
- }
643
- function buildEveToolDefinition(name, options = {}) {
644
- const { defineTool } = getEveTools();
645
- const ctx = {
646
- token: createGithubTokenResolver(options.token),
647
- context: options.context,
648
- author: options.author,
649
- committer: options.committer,
650
- coAuthors: options.coAuthors
651
- };
652
- const entry = createToolRegistry(ctx).find((tool) => tool.name === name);
653
- if (!entry) throw new Error(`Unknown GitHub tool: ${name}`);
654
- const approval = entry.writeTool ? resolveEveToolApproval(entry.writeTool, options.requireApproval) : void 0;
655
- return applyOverrides(defineTool({
656
- description: entry.description,
657
- inputSchema: entry.inputSchema,
658
- ...approval && { approval },
659
- ...entry.toModelOutput && { toModelOutput: entry.toModelOutput },
660
- execute: async (input) => runGithubToolStep(name, input, ctx)
661
- }), name, options.overrides);
662
- }
663
- function buildEveToolMap(options = {}) {
664
- const { defineTool } = getEveTools();
665
- const ctx = {
666
- token: createGithubTokenResolver(options.token),
667
- context: options.context,
668
- author: options.author,
669
- committer: options.committer,
670
- coAuthors: options.coAuthors
671
- };
672
- const isAllowed = resolveAllowedToolNames(options);
673
- const registry = createToolRegistry(ctx);
674
- const tools = {};
675
- for (const entry of registry) {
676
- if (!isAllowed(entry.name)) continue;
677
- const approval = entry.writeTool ? resolveEveToolApproval(entry.writeTool, options.requireApproval) : void 0;
678
- const tool = defineTool({
679
- description: entry.description,
680
- inputSchema: entry.inputSchema,
681
- ...approval && { approval },
682
- ...entry.toModelOutput && { toModelOutput: entry.toModelOutput },
683
- execute: async (input) => runGithubToolStep(entry.name, input, ctx)
684
- });
685
- tools[entry.name] = applyOverrides(tool, entry.name, options.overrides);
686
- }
687
- return tools;
688
- }
689
- function createEveGithubToolsDynamic(options = {}) {
690
- const { defineDynamic } = getEveTools();
691
- return defineDynamic({ events: { "step.started": async () => buildEveToolMap(options) } });
692
- }
693
- function listResolvedEveToolNames(options = {}) {
694
- const isAllowed = resolveAllowedToolNames(options);
695
- return ALL_GITHUB_TOOL_NAMES.filter(isAllowed);
696
- }
697
- /**
698
- * Tool descriptors (no `execute`) for authored eve `defineTool` loops.
699
- * Prefer this when registering tools outside the SDK package so durable transforms can hoist inline execute.
700
- */
701
- function listEveToolDescriptors(options = {}) {
702
- const ctx = {
703
- token: createGithubTokenResolver(options.token),
704
- context: options.context,
705
- author: options.author,
706
- committer: options.committer,
707
- coAuthors: options.coAuthors
708
- };
709
- const isAllowed = resolveAllowedToolNames(options);
710
- return createToolRegistry(ctx).filter((entry) => isAllowed(entry.name)).map((entry) => ({
711
- name: entry.name,
712
- description: entry.description,
713
- inputSchema: entry.inputSchema,
714
- writeTool: entry.writeTool,
715
- toModelOutput: entry.toModelOutput
716
- }));
717
- }
718
- /**
719
- * Execute a GitHub tool by name with the given eve options (token/context/attribution).
720
- * Used by `@github-tools/eve-extension` so `execute` only closes over a serializable tool name.
721
- */
722
- async function executeGithubEveTool(name, input, options = {}) {
723
- return runGithubToolStep(name, input, {
724
- token: createGithubTokenResolver(options.token),
725
- context: options.context,
726
- author: options.author,
727
- committer: options.committer,
728
- coAuthors: options.coAuthors
729
- });
730
- }
731
- //#endregion
732
- export { listEveToolDescriptors as a, mapEveApprovalValue as c, MISSING_EVE_MESSAGE as d, executeGithubEveTool as i, resolveEveApproval as l, buildEveToolMap as n, listResolvedEveToolNames as o, createEveGithubToolsDynamic as r, isEveApprovalDisabled as s, buildEveToolDefinition as t, resolveEveToolApproval as u };
733
-
734
- //# sourceMappingURL=eve-runtime-DInXr4h5.mjs.map