@github-tools/sdk 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,649 @@
1
+ import { n as createGithubAgent, t as CreateGithubAgentOptions } from "./agents-CnwdZ0Wk.mjs";
2
+ import { ApprovalConfig, GithubToolPreset, GithubTools, GithubToolsOptions, GithubWriteToolName, createGithubTools } from "./index.mjs";
3
+ import * as ai from "ai";
4
+ import { CompatibleLanguageModel, DurableAgent } from "@workflow/ai/agent";
5
+
6
+ //#region src/workflow.d.ts
7
+ type CreateDurableGithubAgentOptions = {
8
+ model: string | CompatibleLanguageModel | (() => Promise<CompatibleLanguageModel>);
9
+ /**
10
+ * GitHub personal access token.
11
+ * Falls back to `process.env.GITHUB_TOKEN` when omitted.
12
+ */
13
+ token?: string;
14
+ preset?: GithubToolPreset | GithubToolPreset[];
15
+ requireApproval?: ApprovalConfig;
16
+ instructions?: string;
17
+ additionalInstructions?: string; /** Maximum number of LLM calls before stopping. Unlimited by default. */
18
+ maxSteps?: number;
19
+ temperature?: number;
20
+ };
21
+ /**
22
+ * Create a pre-configured durable GitHub agent powered by Vercel Workflow SDK's `DurableAgent`.
23
+ *
24
+ * Each tool call runs as a durable step with automatic retries and observability.
25
+ * Must be used inside a `"use workflow"` function.
26
+ *
27
+ * **Note:** `requireApproval` is accepted for forward-compatibility but is currently
28
+ * ignored by `DurableAgent` — the Workflow SDK does not yet support interactive tool
29
+ * approval. All tools execute immediately without user confirmation.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * import { createDurableGithubAgent } from '@github-tools/sdk/workflow'
34
+ * import { getWritable } from 'workflow'
35
+ * import type { ModelMessage, UIMessageChunk } from 'ai'
36
+ *
37
+ * async function chatWorkflow(messages: ModelMessage[], token: string) {
38
+ * "use workflow"
39
+ * const agent = createDurableGithubAgent({
40
+ * model: 'anthropic/claude-sonnet-4.6',
41
+ * token,
42
+ * preset: 'code-review',
43
+ * })
44
+ * const writable = getWritable<UIMessageChunk>()
45
+ * await agent.stream({ messages, writable })
46
+ * }
47
+ * ```
48
+ */
49
+ declare function createDurableGithubAgent({
50
+ model,
51
+ token,
52
+ preset,
53
+ requireApproval,
54
+ instructions,
55
+ additionalInstructions,
56
+ ...agentOptions
57
+ }: CreateDurableGithubAgentOptions): DurableAgent<Partial<{
58
+ getRepository: ai.Tool<{
59
+ owner: string;
60
+ repo: string;
61
+ }, {
62
+ name: string;
63
+ fullName: string;
64
+ description: string | null;
65
+ url: string;
66
+ defaultBranch: string;
67
+ stars: number;
68
+ forks: number;
69
+ openIssues: number;
70
+ language: string | null;
71
+ private: boolean;
72
+ createdAt: string;
73
+ updatedAt: string;
74
+ }>;
75
+ listBranches: ai.Tool<{
76
+ owner: string;
77
+ repo: string;
78
+ perPage: number;
79
+ }, {
80
+ name: string;
81
+ sha: string;
82
+ protected: boolean;
83
+ }[]>;
84
+ getFileContent: ai.Tool<{
85
+ owner: string;
86
+ repo: string;
87
+ path: string;
88
+ ref?: string | undefined;
89
+ }, {
90
+ type: string;
91
+ entries: {
92
+ name: string;
93
+ type: "file" | "dir" | "submodule" | "symlink";
94
+ path: string;
95
+ }[];
96
+ path?: undefined;
97
+ sha?: undefined;
98
+ size?: undefined;
99
+ content?: undefined;
100
+ } | {
101
+ type: "submodule" | "symlink";
102
+ path: string;
103
+ entries?: undefined;
104
+ sha?: undefined;
105
+ size?: undefined;
106
+ content?: undefined;
107
+ } | {
108
+ type: string;
109
+ path: string;
110
+ sha: string;
111
+ size: number;
112
+ content: string;
113
+ entries?: undefined;
114
+ }>;
115
+ listPullRequests: ai.Tool<{
116
+ owner: string;
117
+ repo: string;
118
+ state: "open" | "closed" | "all";
119
+ perPage: number;
120
+ }, {
121
+ number: number;
122
+ title: string;
123
+ state: string;
124
+ url: string;
125
+ author: string | undefined;
126
+ branch: string;
127
+ base: string;
128
+ draft: boolean | undefined;
129
+ createdAt: string;
130
+ updatedAt: string;
131
+ }[]>;
132
+ getPullRequest: ai.Tool<{
133
+ owner: string;
134
+ repo: string;
135
+ pullNumber: number;
136
+ }, {
137
+ number: number;
138
+ title: string;
139
+ body: string | null;
140
+ state: "open" | "closed";
141
+ url: string;
142
+ author: string;
143
+ branch: string;
144
+ base: string;
145
+ draft: boolean | undefined;
146
+ merged: boolean;
147
+ mergeable: boolean | null;
148
+ additions: number;
149
+ deletions: number;
150
+ changedFiles: number;
151
+ createdAt: string;
152
+ updatedAt: string;
153
+ mergedAt: string | null;
154
+ }>;
155
+ listIssues: ai.Tool<{
156
+ owner: string;
157
+ repo: string;
158
+ state: "open" | "closed" | "all";
159
+ perPage: number;
160
+ labels?: string | undefined;
161
+ }, {
162
+ number: number;
163
+ title: string;
164
+ state: string;
165
+ url: string;
166
+ author: string | undefined;
167
+ labels: (string | undefined)[];
168
+ createdAt: string;
169
+ updatedAt: string;
170
+ }[]>;
171
+ getIssue: ai.Tool<{
172
+ owner: string;
173
+ repo: string;
174
+ issueNumber: number;
175
+ }, {
176
+ number: number;
177
+ title: string;
178
+ body: string | null | undefined;
179
+ state: string;
180
+ url: string;
181
+ author: string | undefined;
182
+ assignees: string[] | undefined;
183
+ labels: (string | undefined)[];
184
+ comments: number;
185
+ createdAt: string;
186
+ updatedAt: string;
187
+ closedAt: string | null;
188
+ }>;
189
+ searchCode: ai.Tool<{
190
+ query: string;
191
+ perPage: number;
192
+ }, {
193
+ totalCount: number;
194
+ items: {
195
+ name: string;
196
+ path: string;
197
+ url: string;
198
+ repository: string;
199
+ sha: string;
200
+ }[];
201
+ }>;
202
+ searchRepositories: ai.Tool<{
203
+ query: string;
204
+ perPage: number;
205
+ order: "asc" | "desc";
206
+ sort?: "stars" | "forks" | "help-wanted-issues" | "updated" | undefined;
207
+ }, {
208
+ totalCount: number;
209
+ items: {
210
+ name: string;
211
+ fullName: string;
212
+ description: string | null;
213
+ url: string;
214
+ stars: number;
215
+ forks: number;
216
+ language: string | null;
217
+ topics: string[] | undefined;
218
+ }[];
219
+ }>;
220
+ listCommits: ai.Tool<{
221
+ owner: string;
222
+ repo: string;
223
+ perPage: number;
224
+ path?: string | undefined;
225
+ sha?: string | undefined;
226
+ author?: string | undefined;
227
+ since?: string | undefined;
228
+ until?: string | undefined;
229
+ }, {
230
+ sha: string;
231
+ message: string;
232
+ author: string | undefined;
233
+ authorLogin: string | undefined;
234
+ date: string | undefined;
235
+ url: string;
236
+ }[]>;
237
+ getCommit: ai.Tool<{
238
+ owner: string;
239
+ repo: string;
240
+ ref: string;
241
+ }, {
242
+ sha: string;
243
+ message: string;
244
+ author: string | undefined;
245
+ authorLogin: string | undefined;
246
+ date: string | undefined;
247
+ url: string;
248
+ stats: {
249
+ additions: number | undefined;
250
+ deletions: number | undefined;
251
+ total: number | undefined;
252
+ } | null;
253
+ files: {
254
+ filename: string;
255
+ status: "added" | "removed" | "modified" | "renamed" | "copied" | "changed" | "unchanged";
256
+ additions: number;
257
+ deletions: number;
258
+ patch: string | undefined;
259
+ }[] | undefined;
260
+ }>;
261
+ getBlame: ai.Tool<{
262
+ owner: string;
263
+ repo: string;
264
+ path: string;
265
+ ref?: string | undefined;
266
+ line?: number | undefined;
267
+ lineStart?: number | undefined;
268
+ lineEnd?: number | undefined;
269
+ }, {
270
+ error: string;
271
+ ref?: undefined;
272
+ tipSha?: undefined;
273
+ path?: undefined;
274
+ rangeCount?: undefined;
275
+ ranges?: undefined;
276
+ } | {
277
+ ref: string;
278
+ tipSha: string;
279
+ path: string;
280
+ rangeCount: number;
281
+ ranges: {
282
+ startingLine: number;
283
+ endingLine: number;
284
+ age: number;
285
+ commit: {
286
+ sha: string;
287
+ abbreviatedSha: string;
288
+ messageHeadline: string;
289
+ authoredDate: string;
290
+ url: string;
291
+ authorName: string | null;
292
+ authorEmail: string | null;
293
+ authorLogin: string | null;
294
+ };
295
+ }[];
296
+ error?: undefined;
297
+ }>;
298
+ createBranch: ai.Tool<{
299
+ owner: string;
300
+ repo: string;
301
+ branch: string;
302
+ from?: string | undefined;
303
+ }, {
304
+ ref: string;
305
+ sha: string;
306
+ url: string;
307
+ }>;
308
+ forkRepository: ai.Tool<{
309
+ owner: string;
310
+ repo: string;
311
+ organization?: string | undefined;
312
+ name?: string | undefined;
313
+ }, {
314
+ name: string;
315
+ fullName: string;
316
+ url: string;
317
+ cloneUrl: string;
318
+ sshUrl: string;
319
+ defaultBranch: string;
320
+ private: boolean;
321
+ parent: {
322
+ fullName: string;
323
+ url: string;
324
+ } | null;
325
+ }>;
326
+ createRepository: ai.Tool<{
327
+ name: string;
328
+ isPrivate: boolean;
329
+ autoInit: boolean;
330
+ description?: string | undefined;
331
+ gitignoreTemplate?: string | undefined;
332
+ licenseTemplate?: string | undefined;
333
+ org?: string | undefined;
334
+ }, {
335
+ name: string;
336
+ fullName: string;
337
+ description: string | null;
338
+ url: string;
339
+ cloneUrl: string;
340
+ sshUrl: string;
341
+ defaultBranch: string;
342
+ private: boolean;
343
+ createdAt: string;
344
+ }>;
345
+ createOrUpdateFile: ai.Tool<{
346
+ owner: string;
347
+ repo: string;
348
+ path: string;
349
+ message: string;
350
+ content: string;
351
+ branch?: string | undefined;
352
+ sha?: string | undefined;
353
+ }, {
354
+ path: string | undefined;
355
+ sha: string | undefined;
356
+ commitSha: string | undefined;
357
+ commitUrl: string | undefined;
358
+ }>;
359
+ createPullRequest: ai.Tool<{
360
+ owner: string;
361
+ repo: string;
362
+ title: string;
363
+ head: string;
364
+ base: string;
365
+ draft: boolean;
366
+ body?: string | undefined;
367
+ }, {
368
+ number: number;
369
+ title: string;
370
+ url: string;
371
+ state: "open" | "closed";
372
+ draft: boolean | undefined;
373
+ branch: string;
374
+ base: string;
375
+ }>;
376
+ mergePullRequest: ai.Tool<{
377
+ owner: string;
378
+ repo: string;
379
+ pullNumber: number;
380
+ mergeMethod: "merge" | "squash" | "rebase";
381
+ commitTitle?: string | undefined;
382
+ commitMessage?: string | undefined;
383
+ }, {
384
+ merged: boolean;
385
+ message: string;
386
+ sha: string;
387
+ }>;
388
+ addPullRequestComment: ai.Tool<{
389
+ owner: string;
390
+ repo: string;
391
+ pullNumber: number;
392
+ body: string;
393
+ }, {
394
+ id: number;
395
+ url: string;
396
+ body: string | undefined;
397
+ author: string | undefined;
398
+ createdAt: string;
399
+ }>;
400
+ createIssue: ai.Tool<{
401
+ owner: string;
402
+ repo: string;
403
+ title: string;
404
+ body?: string | undefined;
405
+ labels?: string[] | undefined;
406
+ assignees?: string[] | undefined;
407
+ }, {
408
+ number: number;
409
+ title: string;
410
+ url: string;
411
+ state: string;
412
+ labels: (string | undefined)[];
413
+ }>;
414
+ addIssueComment: ai.Tool<{
415
+ owner: string;
416
+ repo: string;
417
+ issueNumber: number;
418
+ body: string;
419
+ }, {
420
+ id: number;
421
+ url: string;
422
+ body: string | undefined;
423
+ author: string | undefined;
424
+ createdAt: string;
425
+ }>;
426
+ closeIssue: ai.Tool<{
427
+ owner: string;
428
+ repo: string;
429
+ issueNumber: number;
430
+ stateReason: "completed" | "not_planned";
431
+ }, {
432
+ number: number;
433
+ title: string;
434
+ state: string;
435
+ url: string;
436
+ closedAt: string | null;
437
+ }>;
438
+ listGists: ai.Tool<{
439
+ perPage: number;
440
+ page: number;
441
+ username?: string | undefined;
442
+ }, {
443
+ id: string;
444
+ description: string | null;
445
+ public: boolean;
446
+ url: string;
447
+ files: string[];
448
+ owner: string | undefined;
449
+ comments: number;
450
+ createdAt: string;
451
+ updatedAt: string;
452
+ }[]>;
453
+ getGist: ai.Tool<{
454
+ gistId: string;
455
+ }, {
456
+ id: string | undefined;
457
+ description: string | null | undefined;
458
+ public: boolean | undefined;
459
+ url: string | undefined;
460
+ owner: string | undefined;
461
+ files: {
462
+ filename: string | undefined;
463
+ language: string | undefined;
464
+ size: number | undefined;
465
+ content: string | undefined;
466
+ }[];
467
+ comments: number | undefined;
468
+ createdAt: string | undefined;
469
+ updatedAt: string | undefined;
470
+ }>;
471
+ listGistComments: ai.Tool<{
472
+ gistId: string;
473
+ perPage: number;
474
+ page: number;
475
+ }, {
476
+ id: number;
477
+ body: string;
478
+ author: string | undefined;
479
+ url: string;
480
+ createdAt: string;
481
+ updatedAt: string;
482
+ }[]>;
483
+ createGist: ai.Tool<{
484
+ files: Record<string, {
485
+ content: string;
486
+ }>;
487
+ isPublic: boolean;
488
+ description?: string | undefined;
489
+ }, {
490
+ id: string | undefined;
491
+ description: string | null | undefined;
492
+ public: boolean | undefined;
493
+ url: string | undefined;
494
+ files: string[];
495
+ owner: string | undefined;
496
+ }>;
497
+ updateGist: ai.Tool<{
498
+ gistId: string;
499
+ description?: string | undefined;
500
+ files?: Record<string, {
501
+ content: string;
502
+ }> | undefined;
503
+ filesToDelete?: string[] | undefined;
504
+ }, {
505
+ id: string | undefined;
506
+ description: string | null | undefined;
507
+ url: string | undefined;
508
+ files: string[];
509
+ }>;
510
+ deleteGist: ai.Tool<{
511
+ gistId: string;
512
+ }, {
513
+ deleted: boolean;
514
+ gistId: string;
515
+ }>;
516
+ createGistComment: ai.Tool<{
517
+ gistId: string;
518
+ body: string;
519
+ }, {
520
+ id: number;
521
+ url: string;
522
+ body: string;
523
+ author: string | undefined;
524
+ createdAt: string;
525
+ }>;
526
+ listWorkflows: ai.Tool<{
527
+ owner: string;
528
+ repo: string;
529
+ perPage: number;
530
+ page: number;
531
+ }, {
532
+ totalCount: number;
533
+ workflows: {
534
+ id: number;
535
+ name: string;
536
+ path: string;
537
+ state: "active" | "deleted" | "disabled_fork" | "disabled_inactivity" | "disabled_manually";
538
+ url: string;
539
+ createdAt: string;
540
+ updatedAt: string;
541
+ }[];
542
+ }>;
543
+ listWorkflowRuns: ai.Tool<{
544
+ owner: string;
545
+ repo: string;
546
+ perPage: number;
547
+ page: number;
548
+ workflowId?: string | number | undefined;
549
+ branch?: string | undefined;
550
+ event?: string | undefined;
551
+ status?: "success" | "completed" | "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "timed_out" | "in_progress" | "queued" | "requested" | "waiting" | "pending" | undefined;
552
+ }, {
553
+ totalCount: number;
554
+ runs: {
555
+ id: number;
556
+ name: string | null | undefined;
557
+ status: string | null;
558
+ conclusion: string | null;
559
+ branch: string | null;
560
+ event: string;
561
+ url: string;
562
+ actor: string | undefined;
563
+ createdAt: string;
564
+ updatedAt: string;
565
+ runNumber: number;
566
+ runAttempt: number | undefined;
567
+ }[];
568
+ }>;
569
+ getWorkflowRun: ai.Tool<{
570
+ owner: string;
571
+ repo: string;
572
+ runId: number;
573
+ }, {
574
+ id: number;
575
+ name: string | null | undefined;
576
+ status: string | null;
577
+ conclusion: string | null;
578
+ branch: string | null;
579
+ sha: string;
580
+ event: string;
581
+ url: string;
582
+ actor: string | undefined;
583
+ runNumber: number;
584
+ runAttempt: number | undefined;
585
+ createdAt: string;
586
+ updatedAt: string;
587
+ runStartedAt: string | undefined;
588
+ }>;
589
+ listWorkflowJobs: ai.Tool<{
590
+ owner: string;
591
+ repo: string;
592
+ runId: number;
593
+ filter: "all" | "latest";
594
+ perPage: number;
595
+ page: number;
596
+ }, {
597
+ totalCount: number;
598
+ jobs: {
599
+ id: number;
600
+ name: string;
601
+ status: "completed" | "in_progress" | "queued" | "requested" | "waiting" | "pending";
602
+ conclusion: "success" | "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "timed_out" | null;
603
+ url: string | null;
604
+ startedAt: string;
605
+ completedAt: string | null;
606
+ runnerName: string | null;
607
+ steps: {
608
+ name: string;
609
+ status: "completed" | "in_progress" | "queued";
610
+ conclusion: string | null;
611
+ number: number;
612
+ startedAt: string | null | undefined;
613
+ completedAt: string | null | undefined;
614
+ }[] | undefined;
615
+ }[];
616
+ }>;
617
+ triggerWorkflow: ai.Tool<{
618
+ owner: string;
619
+ repo: string;
620
+ workflowId: string | number;
621
+ ref: string;
622
+ inputs?: Record<string, string> | undefined;
623
+ }, {
624
+ triggered: boolean;
625
+ workflowId: string | number;
626
+ ref: string;
627
+ }>;
628
+ cancelWorkflowRun: ai.Tool<{
629
+ owner: string;
630
+ repo: string;
631
+ runId: number;
632
+ }, {
633
+ cancelled: boolean;
634
+ runId: number;
635
+ }>;
636
+ rerunWorkflowRun: ai.Tool<{
637
+ owner: string;
638
+ repo: string;
639
+ runId: number;
640
+ onlyFailedJobs: boolean;
641
+ }, {
642
+ rerun: boolean;
643
+ runId: number;
644
+ onlyFailedJobs: boolean;
645
+ }>;
646
+ }>>;
647
+ //#endregion
648
+ export { type ApprovalConfig, CreateDurableGithubAgentOptions, type CreateGithubAgentOptions, type GithubToolPreset, type GithubTools, type GithubToolsOptions, type GithubWriteToolName, createDurableGithubAgent, createGithubAgent, createGithubTools };
649
+ //# sourceMappingURL=workflow.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.d.mts","names":[],"sources":["../src/workflow.ts"],"mappings":";;;;;;KAMY,+BAAA;EACV,KAAA,WAAgB,uBAAA,UAAiC,OAAA,CAAQ,uBAAA;;AAD3D;;;EAME,KAAA;EACA,MAAA,GAAS,gBAAA,GAAmB,gBAAA;EAC5B,eAAA,GAAkB,cAAA;EAClB,YAAA;EACA,sBAAA,WAFkB;EAIlB,QAAA;EACA,WAAA;AAAA;;;;;;;;;;;;;;;;AA+BF;;;;;;;;;;;;;iBAAgB,wBAAA,CAAA;EACd,KAAA;EACA,KAAA;EACA,MAAA;EACA,eAAA;EACA,YAAA;EACA,sBAAA;EAAA,GACG;AAAA,GACF,+BAAA,GAA+B,YAAA,CAAA,OAAA;iBAAA,EAAA,CAAA,IAAA"}
@@ -0,0 +1,55 @@
1
+ import { n as resolveInstructions, t as createGithubAgent } from "./agents-Cdb0a8CP.mjs";
2
+ import { createGithubTools } from "./index.mjs";
3
+ import { DurableAgent } from "@workflow/ai/agent";
4
+
5
+ //#region src/workflow.ts
6
+ /**
7
+ * Create a pre-configured durable GitHub agent powered by Vercel Workflow SDK's `DurableAgent`.
8
+ *
9
+ * Each tool call runs as a durable step with automatic retries and observability.
10
+ * Must be used inside a `"use workflow"` function.
11
+ *
12
+ * **Note:** `requireApproval` is accepted for forward-compatibility but is currently
13
+ * ignored by `DurableAgent` — the Workflow SDK does not yet support interactive tool
14
+ * approval. All tools execute immediately without user confirmation.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * import { createDurableGithubAgent } from '@github-tools/sdk/workflow'
19
+ * import { getWritable } from 'workflow'
20
+ * import type { ModelMessage, UIMessageChunk } from 'ai'
21
+ *
22
+ * async function chatWorkflow(messages: ModelMessage[], token: string) {
23
+ * "use workflow"
24
+ * const agent = createDurableGithubAgent({
25
+ * model: 'anthropic/claude-sonnet-4.6',
26
+ * token,
27
+ * preset: 'code-review',
28
+ * })
29
+ * const writable = getWritable<UIMessageChunk>()
30
+ * await agent.stream({ messages, writable })
31
+ * }
32
+ * ```
33
+ */
34
+ function createDurableGithubAgent({ model, token, preset, requireApproval, instructions, additionalInstructions, ...agentOptions }) {
35
+ const tools = createGithubTools({
36
+ token,
37
+ requireApproval,
38
+ preset
39
+ });
40
+ const resolvedModel = typeof model === "string" || typeof model === "function" ? model : () => Promise.resolve(model);
41
+ return new DurableAgent({
42
+ ...agentOptions,
43
+ model: resolvedModel,
44
+ tools,
45
+ instructions: resolveInstructions({
46
+ preset,
47
+ instructions,
48
+ additionalInstructions
49
+ })
50
+ });
51
+ }
52
+
53
+ //#endregion
54
+ export { createDurableGithubAgent, createGithubAgent, createGithubTools };
55
+ //# sourceMappingURL=workflow.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.mjs","names":[],"sources":["../src/workflow.ts"],"sourcesContent":["import { DurableAgent } from '@workflow/ai/agent'\nimport type { CompatibleLanguageModel } from '@workflow/ai/agent'\nimport { createGithubTools } from './index'\nimport { resolveInstructions } from './agents'\nimport type { GithubToolPreset, ApprovalConfig } from './index'\n\nexport type CreateDurableGithubAgentOptions = {\n model: string | CompatibleLanguageModel | (() => Promise<CompatibleLanguageModel>)\n /**\n * GitHub personal access token.\n * Falls back to `process.env.GITHUB_TOKEN` when omitted.\n */\n token?: string\n preset?: GithubToolPreset | GithubToolPreset[]\n requireApproval?: ApprovalConfig\n instructions?: string\n additionalInstructions?: string\n /** Maximum number of LLM calls before stopping. Unlimited by default. */\n maxSteps?: number\n temperature?: number\n}\n\n/**\n * Create a pre-configured durable GitHub agent powered by Vercel Workflow SDK's `DurableAgent`.\n *\n * Each tool call runs as a durable step with automatic retries and observability.\n * Must be used inside a `\"use workflow\"` function.\n *\n * **Note:** `requireApproval` is accepted for forward-compatibility but is currently\n * ignored by `DurableAgent` — the Workflow SDK does not yet support interactive tool\n * approval. All tools execute immediately without user confirmation.\n *\n * @example\n * ```ts\n * import { createDurableGithubAgent } from '@github-tools/sdk/workflow'\n * import { getWritable } from 'workflow'\n * import type { ModelMessage, UIMessageChunk } from 'ai'\n *\n * async function chatWorkflow(messages: ModelMessage[], token: string) {\n * \"use workflow\"\n * const agent = createDurableGithubAgent({\n * model: 'anthropic/claude-sonnet-4.6',\n * token,\n * preset: 'code-review',\n * })\n * const writable = getWritable<UIMessageChunk>()\n * await agent.stream({ messages, writable })\n * }\n * ```\n */\nexport function createDurableGithubAgent({\n model,\n token,\n preset,\n requireApproval,\n instructions,\n additionalInstructions,\n ...agentOptions\n}: CreateDurableGithubAgentOptions) {\n const tools = createGithubTools({ token, requireApproval, preset })\n\n const resolvedModel = typeof model === 'string' || typeof model === 'function'\n ? model\n : () => Promise.resolve(model)\n\n return new DurableAgent({\n ...agentOptions,\n model: resolvedModel,\n tools,\n instructions: resolveInstructions({ preset, instructions, additionalInstructions }),\n })\n}\n\nexport { createGithubTools, createGithubAgent } from './index'\nexport type { GithubTools, GithubToolsOptions, GithubToolPreset, GithubWriteToolName, ApprovalConfig } from './index'\nexport type { CreateGithubAgentOptions } from './agents'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAgB,yBAAyB,EACvC,OACA,OACA,QACA,iBACA,cACA,wBACA,GAAG,gBAC+B;CAClC,MAAM,QAAQ,kBAAkB;EAAE;EAAO;EAAiB;EAAQ,CAAC;CAEnE,MAAM,gBAAgB,OAAO,UAAU,YAAY,OAAO,UAAU,aAChE,cACM,QAAQ,QAAQ,MAAM;AAEhC,QAAO,IAAI,aAAa;EACtB,GAAG;EACH,OAAO;EACP;EACA,cAAc,oBAAoB;GAAE;GAAQ;GAAc;GAAwB,CAAC;EACpF,CAAC"}