@github-tools/sdk 1.16.1 → 1.17.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.
- package/README.md +18 -9
- package/dist/connect/eve.d.mts +2 -2
- package/dist/connect/eve.d.mts.map +1 -1
- package/dist/connect/eve.mjs +1 -1
- package/dist/connect.d.mts +12 -4
- package/dist/connect.d.mts.map +1 -1
- package/dist/connect.mjs +2 -2
- package/dist/{eve-runtime-BnWUzXdV.d.mts → eve-runtime-DwPFaBlj.d.mts} +5 -5
- package/dist/{eve-runtime-BnWUzXdV.d.mts.map → eve-runtime-DwPFaBlj.d.mts.map} +1 -1
- package/dist/{eve-runtime-Cfyy1tzp.mjs → eve-runtime-NBFRz1SB.mjs} +11 -10
- package/dist/eve-runtime-NBFRz1SB.mjs.map +1 -0
- package/dist/eve-runtime.d.mts +5 -5
- package/dist/eve-runtime.mjs +3 -3
- package/dist/eve.d.mts +4 -4
- package/dist/eve.d.mts.map +1 -1
- package/dist/eve.mjs +2 -2
- package/dist/{index-JH3DVh1R.d.mts → index-DglfkoWk.d.mts} +35 -10
- package/dist/{index-JH3DVh1R.d.mts.map → index-DglfkoWk.d.mts.map} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/{src-C54blWpT.mjs → src-SH7fl4eI.mjs} +135 -99
- package/dist/src-SH7fl4eI.mjs.map +1 -0
- package/dist/{token-Iop2lapd.mjs → token-C4lAap1Y.mjs} +65 -10
- package/dist/token-C4lAap1Y.mjs.map +1 -0
- package/dist/{tool-types-BsfalcyC.d.mts → tool-types-DcfQIOAY.d.mts} +110 -12
- package/dist/tool-types-DcfQIOAY.d.mts.map +1 -0
- package/dist/{types-ve9shBaf.d.mts → types-6nsCJ0Pu.d.mts} +19 -8
- package/dist/types-6nsCJ0Pu.d.mts.map +1 -0
- package/dist/{types-BKXTeCqT.d.mts → types-vuvgvlL-.d.mts} +2 -2
- package/dist/{types-BKXTeCqT.d.mts.map → types-vuvgvlL-.d.mts.map} +1 -1
- package/dist/workflow.d.mts +7 -5
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +2 -2
- package/dist/workflow.mjs.map +1 -1
- package/dist/{write-tools-BvuWAzwo.mjs → write-tools-BidBkLtv.mjs} +2388 -2216
- package/dist/write-tools-BidBkLtv.mjs.map +1 -0
- package/package.json +5 -5
- package/dist/eve-runtime-Cfyy1tzp.mjs.map +0 -1
- package/dist/src-C54blWpT.mjs.map +0 -1
- package/dist/token-Iop2lapd.mjs.map +0 -1
- package/dist/tool-types-BsfalcyC.d.mts.map +0 -1
- package/dist/types-ve9shBaf.d.mts.map +0 -1
- package/dist/write-tools-BvuWAzwo.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tool } from "ai";
|
|
1
|
+
import { Experimental_EvaluationModel, ModelMessage, Tool } from "ai";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { Octokit as Octokit$1 } from "octokit";
|
|
4
4
|
//#endregion
|
|
@@ -1225,7 +1225,7 @@ declare function markNotificationReadCore({ token, threadId }: {
|
|
|
1225
1225
|
//#region src/types.d.ts
|
|
1226
1226
|
type GithubTool = Tool<any, any>;
|
|
1227
1227
|
type ToolOptions = {
|
|
1228
|
-
needsApproval?:
|
|
1228
|
+
needsApproval?: GithubTool['needsApproval'];
|
|
1229
1229
|
};
|
|
1230
1230
|
/**
|
|
1231
1231
|
* Identity for a commit author or committer on GitHub.
|
|
@@ -4075,6 +4075,30 @@ type PresetToolName<P extends GithubToolPreset> = Extract<(typeof PRESET_TOOLS)[
|
|
|
4075
4075
|
/** Tool names included when combining multiple presets. */
|
|
4076
4076
|
type CombinedPresetToolNames<P extends readonly GithubToolPreset[]> = PresetToolName<P[number]>;
|
|
4077
4077
|
//#endregion
|
|
4078
|
+
//#region src/core/token.d.ts
|
|
4079
|
+
/**
|
|
4080
|
+
* The tool call a token is requested for. Passed to token providers so they
|
|
4081
|
+
* can mint a token for the call's target — e.g. the GitHub App installation
|
|
4082
|
+
* that owns `owner/repo`.
|
|
4083
|
+
*/
|
|
4084
|
+
type GithubTokenCall = {
|
|
4085
|
+
toolName: GithubToolName;
|
|
4086
|
+
/** Tool input after context defaults are applied. */
|
|
4087
|
+
input: unknown;
|
|
4088
|
+
/** Target repository owner. Undefined for tools without a repository target (search, gists, notifications). */
|
|
4089
|
+
owner?: string;
|
|
4090
|
+
/** Target repository name. Undefined for tools without a repository target. */
|
|
4091
|
+
repo?: string;
|
|
4092
|
+
};
|
|
4093
|
+
/**
|
|
4094
|
+
* A token string, or an async provider. Providers receive the tool call the
|
|
4095
|
+
* token is requested for; `call` is undefined when the token is resolved
|
|
4096
|
+
* outside a tool call.
|
|
4097
|
+
*/
|
|
4098
|
+
type GithubTokenInput = string | ((call?: GithubTokenCall) => Promise<string>);
|
|
4099
|
+
/** Resolves a {@link GithubTokenInput} to a token string for an optional tool call. */
|
|
4100
|
+
declare function resolveGithubToken(token?: GithubTokenInput, call?: GithubTokenCall): Promise<string>;
|
|
4101
|
+
//#endregion
|
|
4078
4102
|
//#region src/core/write-tools.d.ts
|
|
4079
4103
|
/**
|
|
4080
4104
|
* GitHub tools that perform write operations and require approval by default.
|
|
@@ -4082,19 +4106,94 @@ type CombinedPresetToolNames<P extends readonly GithubToolPreset[]> = PresetTool
|
|
|
4082
4106
|
*/
|
|
4083
4107
|
declare const GITHUB_WRITE_TOOLS: { [K in GithubWriteToolName]: K; };
|
|
4084
4108
|
//#endregion
|
|
4109
|
+
//#region src/core/evaluation.d.ts
|
|
4110
|
+
/** Evaluation model used by `'auto'` approval and `preset: 'auto'` unless `evaluation.model` is set. */
|
|
4111
|
+
declare const DEFAULT_EVALUATION_MODEL = "typesafe-ai/jev";
|
|
4112
|
+
/**
|
|
4113
|
+
* Write tools `requireApproval: 'auto'` evaluates: labels, assignees, reactions, comments,
|
|
4114
|
+
* review-thread replies, reviewer requests, notification reads, and workflow re-runs.
|
|
4115
|
+
* Every other write tool keeps requiring approval.
|
|
4116
|
+
*/
|
|
4117
|
+
declare const AUTO_APPROVAL_TOOLS: readonly ["addLabels", "removeLabel", "addAssignees", "removeAssignees", "addIssueReaction", "addCommentReaction", "addIssueComment", "addPullRequestComment", "addDiscussionComment", "createGistComment", "replyToReviewComment", "resolveReviewThread", "requestReviewers", "markNotificationRead", "rerunWorkflowRun"];
|
|
4118
|
+
/**
|
|
4119
|
+
* Tuning for `requireApproval: 'auto'` and `preset: 'auto'`. Every field is optional.
|
|
4120
|
+
*/
|
|
4121
|
+
type GithubEvaluationOptions = {
|
|
4122
|
+
/**
|
|
4123
|
+
* Evaluation model for AI SDK `experimental_evaluate`: an AI Gateway ID or a model instance.
|
|
4124
|
+
* @default 'typesafe-ai/jev'
|
|
4125
|
+
*/
|
|
4126
|
+
model?: Experimental_EvaluationModel;
|
|
4127
|
+
/**
|
|
4128
|
+
* Highest risk an `'auto'` tool call can have and still run without approval, on a 0–2 scale
|
|
4129
|
+
* (0 negligible, 1 visible but reversible, 2 hard to undo).
|
|
4130
|
+
* @default 1
|
|
4131
|
+
*/
|
|
4132
|
+
maxRisk?: number;
|
|
4133
|
+
/**
|
|
4134
|
+
* Lowest probability that the latest user message asked for the call, for it to run without approval.
|
|
4135
|
+
* @default 0.6
|
|
4136
|
+
*/
|
|
4137
|
+
minIntent?: number;
|
|
4138
|
+
/**
|
|
4139
|
+
* Lowest probability for `preset: 'auto'` to select a preset. When no preset reaches it,
|
|
4140
|
+
* the single most likely preset is used.
|
|
4141
|
+
* @default 0.7
|
|
4142
|
+
*/
|
|
4143
|
+
minPresetProbability?: number;
|
|
4144
|
+
/**
|
|
4145
|
+
* Most presets `preset: 'auto'` combines in one call, keeping the most likely ones.
|
|
4146
|
+
* @default 2
|
|
4147
|
+
*/
|
|
4148
|
+
maxPresets?: number;
|
|
4149
|
+
};
|
|
4150
|
+
/**
|
|
4151
|
+
* Whether an `'auto'` write tool call needs human approval: `false` only when the model
|
|
4152
|
+
* rates it low-risk and asked for by the latest user message. When the evaluation call
|
|
4153
|
+
* fails, logs `EVALUATION_FAILED` and asks for approval.
|
|
4154
|
+
*/
|
|
4155
|
+
declare function needsAutoApproval(toolName: GithubWriteToolName, input: unknown, messages: readonly ModelMessage[], { model, maxRisk, minIntent }?: GithubEvaluationOptions): Promise<boolean>;
|
|
4156
|
+
type RoutablePreset = Exclude<GithubToolPreset, 'maintainer'>;
|
|
4157
|
+
/**
|
|
4158
|
+
* Presets the latest user message needs, from one evaluation call with an independent
|
|
4159
|
+
* yes/no question per preset. Returns up to `maxPresets` presets at or above
|
|
4160
|
+
* `minPresetProbability`, most likely first; when none qualifies, the single most likely preset.
|
|
4161
|
+
* `repo-explorer` is only returned when no other preset qualifies.
|
|
4162
|
+
* When the evaluation call fails, logs `EVALUATION_FAILED` and returns read-only `repo-explorer`.
|
|
4163
|
+
* Never returns `maintainer`, so the full catalog is never exposed.
|
|
4164
|
+
*/
|
|
4165
|
+
declare function selectPresets(messages: readonly ModelMessage[], { model, minPresetProbability, maxPresets }?: GithubEvaluationOptions): Promise<RoutablePreset[]>;
|
|
4166
|
+
declare function latestUserText(messages: readonly ModelMessage[]): string;
|
|
4167
|
+
//#endregion
|
|
4085
4168
|
//#region src/core/approval.d.ts
|
|
4169
|
+
/**
|
|
4170
|
+
* Approval for a single write tool.
|
|
4171
|
+
*
|
|
4172
|
+
* - `true` — always ask the user
|
|
4173
|
+
* - `false` — never ask
|
|
4174
|
+
* - `'auto'` — ask only when an evaluation model (Jev by default) rates the call risky
|
|
4175
|
+
* or not asked for by the latest user message. Needs `ai` 7.0.105 or later.
|
|
4176
|
+
*/
|
|
4177
|
+
type ToolApprovalMode = boolean | 'auto';
|
|
4086
4178
|
/**
|
|
4087
4179
|
* Whether write operations require user approval.
|
|
4088
4180
|
*
|
|
4089
4181
|
* - `true` — all write tools need approval (default)
|
|
4090
4182
|
* - `false` — no approval needed for any write tool
|
|
4091
|
-
* -
|
|
4183
|
+
* - `'auto'` — low-risk write tools ({@link AUTO_APPROVAL_TOOLS}) are evaluated per call;
|
|
4184
|
+
* every other write tool needs approval
|
|
4185
|
+
* - object — per-tool {@link ToolApprovalMode} via {@link GithubWriteToolName}; unspecified write tools default to `true`
|
|
4092
4186
|
*
|
|
4093
4187
|
* @example Global disable
|
|
4094
4188
|
* ```ts
|
|
4095
4189
|
* createGithubTools({ token, requireApproval: false })
|
|
4096
4190
|
* ```
|
|
4097
4191
|
*
|
|
4192
|
+
* @example Auto approval for low-risk writes
|
|
4193
|
+
* ```ts
|
|
4194
|
+
* createGithubTools({ token, requireApproval: 'auto' })
|
|
4195
|
+
* ```
|
|
4196
|
+
*
|
|
4098
4197
|
* @example Granular per write tool
|
|
4099
4198
|
* ```ts
|
|
4100
4199
|
* createGithubTools({
|
|
@@ -4102,12 +4201,14 @@ declare const GITHUB_WRITE_TOOLS: { [K in GithubWriteToolName]: K; };
|
|
|
4102
4201
|
* requireApproval: {
|
|
4103
4202
|
* mergePullRequest: true,
|
|
4104
4203
|
* createOrUpdateFile: true,
|
|
4105
|
-
* addPullRequestComment:
|
|
4204
|
+
* addPullRequestComment: 'auto',
|
|
4106
4205
|
* },
|
|
4107
4206
|
* })
|
|
4108
4207
|
* ```
|
|
4109
4208
|
*/
|
|
4110
|
-
type ApprovalConfig =
|
|
4209
|
+
type ApprovalConfig = ToolApprovalMode | Partial<Record<GithubWriteToolName, ToolApprovalMode>>;
|
|
4210
|
+
/** {@link ApprovalConfig} without `'auto'`, for runtimes that cannot run the evaluation model. */
|
|
4211
|
+
type StaticApprovalConfig = boolean | Partial<Record<GithubWriteToolName, boolean>>;
|
|
4111
4212
|
//#endregion
|
|
4112
4213
|
//#region src/core/context.d.ts
|
|
4113
4214
|
/**
|
|
@@ -4125,11 +4226,6 @@ type GithubToolsContext = {
|
|
|
4125
4226
|
ref?: string;
|
|
4126
4227
|
};
|
|
4127
4228
|
//#endregion
|
|
4128
|
-
//#region src/core/token.d.ts
|
|
4129
|
-
type GithubTokenInput = string | (() => Promise<string>);
|
|
4130
|
-
/** Resolves a {@link GithubTokenInput} to a token string. */
|
|
4131
|
-
declare function resolveGithubToken(token?: GithubTokenInput): Promise<string>;
|
|
4132
|
-
//#endregion
|
|
4133
4229
|
//#region src/core/tool-types.d.ts
|
|
4134
4230
|
/** Full tool set returned when no `preset` is specified. */
|
|
4135
4231
|
type AllGithubTools = Record<GithubToolName, GithubTool>;
|
|
@@ -4139,6 +4235,8 @@ type GithubToolsBaseOptions = {
|
|
|
4139
4235
|
token?: GithubTokenInput;
|
|
4140
4236
|
/** Control whether write operations require user approval. @see {@link ApprovalConfig} */
|
|
4141
4237
|
requireApproval?: ApprovalConfig;
|
|
4238
|
+
/** Tuning for `requireApproval: 'auto'` (model, thresholds). Jev with sensible thresholds by default. */
|
|
4239
|
+
evaluation?: GithubEvaluationOptions;
|
|
4142
4240
|
/**
|
|
4143
4241
|
* Default owner / repo / PR / issue / ref values.
|
|
4144
4242
|
* Softens matching tool input fields and fills them when the model omits them.
|
|
@@ -4159,5 +4257,5 @@ type GithubToolsForPreset<P extends GithubToolPreset | readonly GithubToolPreset
|
|
|
4159
4257
|
/** Pick a subset of GitHub tools by tool name. */
|
|
4160
4258
|
type PickGithubTools<T extends GithubToolName> = Pick<AllGithubTools, T>;
|
|
4161
4259
|
//#endregion
|
|
4162
|
-
export {
|
|
4163
|
-
//# sourceMappingURL=tool-types-
|
|
4260
|
+
export { ToolOptions as A, GITHUB_TOOL_NAMES as C, CommitToolOptions as D, CommitIdentity as E, GithubTool as O, PresetToolName as S, GithubWriteToolName as T, GithubTokenInput as _, GithubToolsContext as a, GithubToolPreset as b, ToolApprovalMode as c, GithubEvaluationOptions as d, latestUserText as f, GithubTokenCall as g, GITHUB_WRITE_TOOLS as h, PickGithubTools as i, ToolOverrides as j, Octokit$1 as k, AUTO_APPROVAL_TOOLS as l, selectPresets as m, GithubToolsBaseOptions as n, ApprovalConfig as o, needsAutoApproval as p, GithubToolsForPreset as r, StaticApprovalConfig as s, AllGithubTools as t, DEFAULT_EVALUATION_MODEL as u, resolveGithubToken as v, GithubToolName as w, PRESET_TOOLS as x, CombinedPresetToolNames as y };
|
|
4261
|
+
//# sourceMappingURL=tool-types-DcfQIOAY.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-types-DcfQIOAY.d.mts","names":[],"sources":["../src/core/detail.ts","../src/core/bundles.ts","../src/core/checks.ts","../src/core/pagination.ts","../src/core/commits.ts","../src/core/discussions.ts","../src/core/gists.ts","../src/core/issues.ts","../src/core/notifications.ts","../src/types.ts","../src/core/pull-requests.ts","../src/core/reactions.ts","../src/core/releases.ts","../src/core/repository.ts","../src/core/search.ts","../src/core/workflows.ts","../src/core/catalog.ts","../src/core/tool-names.ts","../src/core/presets.ts","../src/core/token.ts","../src/core/write-tools.ts","../src/core/evaluation.ts","../src/core/approval.ts","../src/core/context.ts","../src/core/tool-types.ts"],"mappings":";;;;;KAeY;;;;cCGC,kCAAgC,EAAA;;;;;;;;;;;;;GAU3C,EAAA,KAAA;cAEW;iBAES,4BACpB,OACA,OACA,MACA,YACA,cACA,gBACA,eACA,cACA,cACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;IACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCY,4BAA0B,EAAA;;;;;;;;;;;GAarC,EAAA,KAAA;cAEW;iBAES,sBACpB,OACA,OACA,MACA,aACA,eACA,iBACA,aACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;IACV;;;;;;;;;;;;;;;;;;;;;;;;;;cA2BY,8BAA4B,EAAA;;;;;;;;;;GAOvC,EAAA,KAAA;cAEW;iBAES,wBACpB,OACA,OACA,MACA,WACA,iBACA,gBACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;IACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AEV,QAAQ;;EAER,kBAAkB;;EAElB,aAAa;;;;;;EAMb,UAAU;;EAEV,YAAY,QAAQ,OAAO,gBAAgB;;EAE3C,SAAS;;EAET,YAAY;;EAEZ,YAAY;;;KAIF,qBAAqB,UAAU,4BAA4B,kCACrE,UAAU,mBACN,KAAK,gBAAgB,eAAe,KAAK,kBACzC,mBAAmB,qBACjB,KAAK,gBAAgB,wBAAwB,KAAK,kBAClD;;KAGI,gBAAgB,UAAU,kBAAkB,KAAK,gBAAgB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as EveGithubToolsOptions } from "./types-
|
|
1
|
+
import { b as GithubToolPreset, g as GithubTokenCall, n as GithubToolsBaseOptions, w as GithubToolName } from "./tool-types-DcfQIOAY.mjs";
|
|
2
|
+
import { r as EveGithubToolsOptions } from "./types-vuvgvlL-.mjs";
|
|
3
3
|
import { ConnectOptions, ConnectTokenParams } from "@vercel/connect";
|
|
4
4
|
//#region src/connect/connector.d.ts
|
|
5
5
|
/**
|
|
@@ -17,7 +17,9 @@ declare function resolveGithubConnector(connector: GithubConnectorInput): Promis
|
|
|
17
17
|
/**
|
|
18
18
|
* Token parameters for Vercel Connect GitHub connectors.
|
|
19
19
|
* `subject` defaults to `{ type: 'app' }` — the project's GitHub App
|
|
20
|
-
* installation, same as `connectGitHubAdapter`.
|
|
20
|
+
* installation, same as `connectGitHubAdapter`. App-subject tokens target
|
|
21
|
+
* the installation that owns the tool call's repository unless
|
|
22
|
+
* `installationId`, `authorizationDetails` or `repositories` pins one.
|
|
21
23
|
*/
|
|
22
24
|
type GithubConnectParams = Omit<ConnectTokenParams, 'subject'> & {
|
|
23
25
|
/**
|
|
@@ -31,12 +33,21 @@ type GithubConnectParams = Omit<ConnectTokenParams, 'subject'> & {
|
|
|
31
33
|
/** Restrict the token to specific repositories via GitHub authorization details. */
|
|
32
34
|
repositories?: string[];
|
|
33
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* Resolves Connect token params for each tool call, e.g. to pick an
|
|
38
|
+
* `installationId` per tenant. `call` is undefined when the token is resolved
|
|
39
|
+
* outside a tool call. Unless the returned params set `scopes`, scopes are
|
|
40
|
+
* still derived from `preset` / `include` / `exclude`.
|
|
41
|
+
*/
|
|
42
|
+
type GithubConnectParamsResolver = (call?: GithubTokenCall) => GithubConnectParams | Promise<GithubConnectParams>;
|
|
43
|
+
/** Static Connect token params, or a per-call {@link GithubConnectParamsResolver}. */
|
|
44
|
+
type GithubConnectParamsInput = GithubConnectParams | GithubConnectParamsResolver;
|
|
34
45
|
type ConnectGithubToolsOptions = GithubToolsBaseOptions & {
|
|
35
46
|
preset?: GithubToolPreset | GithubToolPreset[];
|
|
36
|
-
connect?:
|
|
47
|
+
connect?: GithubConnectParamsInput;
|
|
37
48
|
};
|
|
38
49
|
type ConnectGithubEveToolsOptions = Omit<EveGithubToolsOptions, 'token'> & {
|
|
39
|
-
connect?:
|
|
50
|
+
connect?: GithubConnectParamsInput;
|
|
40
51
|
};
|
|
41
52
|
type ConnectGithubTokenOptions = {
|
|
42
53
|
preset?: GithubToolPreset | GithubToolPreset[];
|
|
@@ -44,9 +55,9 @@ type ConnectGithubTokenOptions = {
|
|
|
44
55
|
include?: readonly GithubToolName[];
|
|
45
56
|
/** Same deny-list semantics as eve `exclude` — scopes derive from the resolved tools when set. */
|
|
46
57
|
exclude?: readonly GithubToolName[];
|
|
47
|
-
params?:
|
|
58
|
+
params?: GithubConnectParamsInput;
|
|
48
59
|
connectOptions?: ConnectOptions;
|
|
49
60
|
};
|
|
50
61
|
//#endregion
|
|
51
|
-
export {
|
|
52
|
-
//# sourceMappingURL=types-
|
|
62
|
+
export { GithubConnectParamsInput as a, resolveGithubConnector as c, GithubConnectParams as i, ConnectGithubTokenOptions as n, GithubConnectParamsResolver as o, ConnectGithubToolsOptions as r, GithubConnectorInput as s, ConnectGithubEveToolsOptions as t };
|
|
63
|
+
//# sourceMappingURL=types-6nsCJ0Pu.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-6nsCJ0Pu.d.mts","names":[],"sources":["../src/connect/connector.ts","../src/connect/types.ts"],"mappings":";;;;;;;;;;;KAOY,gDAAgD;;iBAGtC,uBAAuB,WAAW,uBAAuB;;;;;;;;;;KCInE,sBAAsB,KAAK;;;;;;;;EAQrC,UAAU;;EAEV;;;;;;;;KASU,+BACV,OAAO,oBACJ,sBAAsB,QAAQ;;KAGvB,2BAA2B,sBAAsB;KAEjD,4BAA4B;EACtC,SAAS,mBAAmB;EAC5B,UAAU;;KAGA,+BAA+B,KAAK;EAC9C,UAAU;;KAGA;EACV,SAAS,mBAAmB;;EAE5B,mBAAmB;;EAEnB,mBAAmB;EACnB,SAAS;EACT,iBAAiB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as CommitIdentity, T as GithubWriteToolName, _ as GithubTokenInput, a as GithubToolsContext, b as GithubToolPreset, w as GithubToolName } from "./tool-types-DcfQIOAY.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { ToolModelOutput } from "eve/tools";
|
|
4
4
|
import { Approval } from "eve/tools/approval";
|
|
@@ -68,4 +68,4 @@ type EveGithubToolsOptions = {
|
|
|
68
68
|
type EveToolFactoryOptions = Omit<EveGithubToolsOptions, 'preset' | 'include' | 'exclude'>;
|
|
69
69
|
//#endregion
|
|
70
70
|
export { EveToolOverrides as a, EveToolFactoryOptions as i, EveApprovalValue as n, EveGithubToolsOptions as r, EveApprovalConfig as t };
|
|
71
|
-
//# sourceMappingURL=types-
|
|
71
|
+
//# sourceMappingURL=types-vuvgvlL-.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-vuvgvlL-.d.mts","names":[],"sources":["../src/eve/types.ts"],"mappings":";;;;;;;;;;;;;KAkBY,2DAKR;KAEQ,8BAER,QAAQ,OAAO,qBAAqB;KAE5B,mBAAmB,QAAQ,OAAO;EAC5C;EACA,WAAW;EACX,iBAAiB,oBAAoB,kBAAkB,QAAQ;;EAE/D,eAAe,EAAE;;KAGP;;EAEV,QAAQ;;;;;;EAMR,SAAS,mBAAmB;;;;;;EAM5B,UAAU;;;;;;EAMV,UAAU;;;;;;EAMV,kBAAkB;;;;;;EAMlB,YAAY;;EAEZ,SAAS;;EAET,YAAY;;EAEZ,YAAY;;;;;EAKZ,UAAU;;KAGA,wBAAwB,KAAK"}
|
package/dist/workflow.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as createGithubAgent, i as CreateGithubAgentOptions, n as GithubToolsOptions, r as createGithubTools, t as GithubTools } from "./index-
|
|
1
|
+
import { C as GITHUB_TOOL_NAMES, D as CommitToolOptions, E as CommitIdentity, S as PresetToolName, T as GithubWriteToolName, _ as GithubTokenInput, a as GithubToolsContext, b as GithubToolPreset, h as GITHUB_WRITE_TOOLS, i as PickGithubTools, j as ToolOverrides, o as ApprovalConfig, r as GithubToolsForPreset, s as StaticApprovalConfig, t as AllGithubTools, v as resolveGithubToken, w as GithubToolName, x as PRESET_TOOLS, y as CombinedPresetToolNames } from "./tool-types-DcfQIOAY.mjs";
|
|
2
|
+
import { a as createGithubAgent, i as CreateGithubAgentOptions, n as GithubToolsOptions, r as createGithubTools, t as GithubTools } from "./index-DglfkoWk.mjs";
|
|
3
3
|
import { FinishReason, LanguageModel, LanguageModelResponseMetadata, LanguageModelUsage, ModelMessage, StepResult, StopCondition, ToolSet } from "ai";
|
|
4
4
|
import { WorkflowAgentOptions, WorkflowAgentStreamOptions, WorkflowAgentStreamResult } from "@ai-sdk/workflow";
|
|
5
5
|
import { Context } from "@ai-sdk/provider-utils";
|
|
@@ -77,9 +77,11 @@ export type CreateDurableGithubAgentOptions = Omit<WorkflowAgentOptions, 'model'
|
|
|
77
77
|
/**
|
|
78
78
|
* Control whether write operations require user approval before execution.
|
|
79
79
|
*
|
|
80
|
-
*
|
|
80
|
+
* `'auto'` is not supported: the evaluation call cannot run inside a workflow function.
|
|
81
|
+
*
|
|
82
|
+
* @see {@link StaticApprovalConfig} for global and per-tool options.
|
|
81
83
|
*/
|
|
82
|
-
requireApproval?:
|
|
84
|
+
requireApproval?: StaticApprovalConfig;
|
|
83
85
|
/**
|
|
84
86
|
* Fully replace the default system prompt.
|
|
85
87
|
* When set, `preset` system prompts and `additionalInstructions` are ignored.
|
|
@@ -131,7 +133,7 @@ export type CreateDurableGithubAgentOptions = Omit<WorkflowAgentOptions, 'model'
|
|
|
131
133
|
* async function chatWorkflow(messages: ModelMessage[], token: string) {
|
|
132
134
|
* "use workflow"
|
|
133
135
|
* const agent = createDurableGithubAgent({
|
|
134
|
-
* model: 'anthropic/claude-
|
|
136
|
+
* model: 'anthropic/claude-opus-5.5',
|
|
135
137
|
* token,
|
|
136
138
|
* preset: 'code-review',
|
|
137
139
|
* })
|
package/dist/workflow.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.mts","names":[],"sources":["../src/workflow.ts"],"mappings":";;;;;;;;;iBA+BiB,iCAAiC,eAAe,UAAU;EACzE;EACA,cAAc;EACd,OAAO;EACP,OAAO,WAAW;EAClB,UAAU;IAAkC,UAAU;;;;;;;;;;;;;qBAa3C,mBAAmB,eAAe,UAAU;UAC/C;UACA;UACA;UACA;UACA;EAEI,YAAA,SAAS,qBAAqB;;MAStC,SAAS;;;;;EAQb,OAAO,qBAAqB,SAAS,QAAQ,gBAAgB,wBAC3D,SAAS,2BAA2B,cAAc,SAAS,QAAQ,kBAClE,QAAQ,0BAA0B,cAAc;;;;;;;;EAW7C,WAAW,QAAQ;IAAc;IAAgB,WAAW,cAAc,UAAU,MAAM,cAAc;MAAa,QAAQ,iCAAiC;;;;;;;;YA8B1J,kCACV,KAAK;EACH,gBAAgB;;;;;EAKhB,QAAQ;;;;;;;;;EASR,SAAS,mBAAmB
|
|
1
|
+
{"version":3,"file":"workflow.d.mts","names":[],"sources":["../src/workflow.ts"],"mappings":";;;;;;;;;iBA+BiB,iCAAiC,eAAe,UAAU;EACzE;EACA,cAAc;EACd,OAAO;EACP,OAAO,WAAW;EAClB,UAAU;IAAkC,UAAU;;;;;;;;;;;;;qBAa3C,mBAAmB,eAAe,UAAU;UAC/C;UACA;UACA;UACA;UACA;EAEI,YAAA,SAAS,qBAAqB;;MAStC,SAAS;;;;;EAQb,OAAO,qBAAqB,SAAS,QAAQ,gBAAgB,wBAC3D,SAAS,2BAA2B,cAAc,SAAS,QAAQ,kBAClE,QAAQ,0BAA0B,cAAc;;;;;;;;EAW7C,WAAW,QAAQ;IAAc;IAAgB,WAAW,cAAc,UAAU,MAAM,cAAc;MAAa,QAAQ,iCAAiC;;;;;;;;YA8B1J,kCACV,KAAK;EACH,gBAAgB;;;;;EAKhB,QAAQ;;;;;;;;;EASR,SAAS,mBAAmB;;;;;;;;EAQ5B,kBAAkB;;;;;EAKlB;;;;;EAKA;;;;EAIA,UAAU;;;;;EAKV,SAAS;;;;;EAKT,YAAY;;;;;EAKZ,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiCA,yBACd,SAAS;EAAoC;IAC5C,mBAAmB;wBACN,yBAAyB,UAAU,kBACjD,SAAS;EAAoC,QAAQ;IACpD,mBAAmB,KAAK,gBAAgB,eAAe;wBAC1C,yBAAyB,mBAAmB,oBAC1D,SAAS;EAAoC,QAAQ;IACpD,mBAAmB,KAAK,gBAAgB,wBAAwB"}
|
package/dist/workflow.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as createGithubAgent, r as resolveInstructions, t as createGithubTools } from "./src-
|
|
1
|
+
import { f as PRESET_TOOLS, g as resolveGithubToken, n as GITHUB_TOOL_NAMES, t as GITHUB_WRITE_TOOLS } from "./write-tools-BidBkLtv.mjs";
|
|
2
|
+
import { n as createGithubAgent, r as resolveInstructions, t as createGithubTools } from "./src-SH7fl4eI.mjs";
|
|
3
3
|
import { WorkflowAgent } from "@ai-sdk/workflow";
|
|
4
4
|
//#region src/workflow.ts
|
|
5
5
|
/**
|
package/dist/workflow.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.mjs","names":[],"sources":["../src/workflow.ts"],"sourcesContent":["import { WorkflowAgent } from '@ai-sdk/workflow'\nimport type {\n WorkflowAgentOptions,\n WorkflowAgentStreamOptions,\n WorkflowAgentStreamResult,\n TelemetryOptions,\n} from '@ai-sdk/workflow'\nimport type {\n LanguageModel,\n ToolSet,\n StepResult,\n FinishReason,\n LanguageModelUsage,\n LanguageModelResponseMetadata,\n ModelMessage,\n StopCondition,\n} from 'ai'\nimport { createGithubTools } from './index'\nimport { resolveInstructions } from './agents'\nimport type { AllGithubTools } from './core/tool-types'\nimport type { CombinedPresetToolNames, GithubToolPreset, PresetToolName } from './core/presets'\nimport type { GithubToolName } from './core/tool-names'\nimport type { ApprovalConfig } from './index'\nimport type { CommitIdentity } from './types'\nimport type { GithubTokenInput } from './core/token'\nimport type { GithubToolsContext } from './core/context'\nimport type { Context } from '@ai-sdk/provider-utils'\n\n/**\n * Result of {@link DurableGithubAgent.generate}.\n */\nexport interface DurableGithubAgentGenerateResult<TTools extends ToolSet = ToolSet> {\n text: string\n finishReason: FinishReason\n usage: LanguageModelUsage\n steps: StepResult<TTools>[]\n response: LanguageModelResponseMetadata & { messages: ModelMessage[] }\n}\n\n/**\n * A wrapper around {@link WorkflowAgent} that adds a non-streaming\n * `.generate()` method alongside the existing `.stream()`.\n *\n * - `.stream()` — delegates to `WorkflowAgent.stream()`. Each tool call is\n * an individually retriable workflow step. Supports `needsApproval` on tools.\n * - `.generate()` — uses `generateText` from the AI SDK for non-streaming\n * execution. Must be called from within a `\"use step\"` function in\n * workflow context (the Workflow runtime blocks raw I/O in workflow scope).\n */\nexport class DurableGithubAgent<TTools extends ToolSet = ToolSet> {\n private agent: WorkflowAgent<TTools>\n private _model: LanguageModel\n private _instructions?: string\n private _telemetry?: TelemetryOptions\n private _tools: TTools\n\n constructor(options: WorkflowAgentOptions<TTools>) {\n this.agent = new WorkflowAgent(options)\n this._model = options.model\n this._instructions = typeof options.instructions === 'string' ? options.instructions : undefined\n this._telemetry = options.telemetry\n this._tools = options.tools ?? {} as TTools\n }\n\n /** The tool set configured for this agent. */\n get tools(): TTools {\n return this.agent.tools\n }\n\n /**\n * Stream the agent's response. Delegates directly to `WorkflowAgent.stream()`.\n * Works in workflow context — each tool call is a durable step.\n */\n stream<TStreamTools extends TTools = TTools, OUTPUT = never, PARTIAL_OUTPUT = never>(\n options: WorkflowAgentStreamOptions<TStreamTools, Context, OUTPUT, PARTIAL_OUTPUT>,\n ): Promise<WorkflowAgentStreamResult<TStreamTools, OUTPUT>> {\n return this.agent.stream(options)\n }\n\n /**\n * Generate a non-streaming response using `generateText` from the AI SDK.\n *\n * In workflow context this **must** be called from within a `\"use step\"`\n * function, because the Workflow runtime blocks direct I/O (HTTP calls)\n * at the workflow scope level.\n */\n async generate({ prompt, stopWhen }: { prompt: string, stopWhen?: StopCondition<TTools> | Array<StopCondition<TTools>> }): Promise<DurableGithubAgentGenerateResult<TTools>> {\n const { generateText } = await import('ai')\n\n const system = this._instructions\n\n const result = await generateText({\n model: this._model,\n tools: this._tools,\n system,\n prompt,\n stopWhen,\n experimental_telemetry: this._telemetry as Parameters<typeof generateText>[0]['experimental_telemetry'],\n })\n\n return {\n text: result.text,\n finishReason: result.finishReason,\n usage: result.usage,\n steps: result.steps as StepResult<TTools>[],\n response: result.response,\n }\n }\n}\n\n/**\n * Options for creating a durable GitHub agent via {@link createDurableGithubAgent}.\n *\n * Extends all `WorkflowAgentOptions` (temperature, telemetry, callbacks, etc.)\n * and adds GitHub-specific fields (token, preset, approval config).\n */\nexport type CreateDurableGithubAgentOptions =\n Omit<WorkflowAgentOptions, 'model' | 'tools' | 'instructions'> & {\n model: string | LanguageModel\n /**\n * GitHub personal access token or async token provider.\n * Falls back to `process.env.GITHUB_TOKEN` when omitted.\n */\n token?: GithubTokenInput\n /**\n * Restrict tools and system prompt to a predefined preset.\n *\n * Selects a subset of tools and, when a single preset is passed,\n * sets a matching system prompt. Combine presets with an array to merge tool sets.\n *\n * @see {@link GithubToolPreset} for available presets and included tools.\n */\n preset?: GithubToolPreset | GithubToolPreset[]\n /**\n * Control whether write operations require user approval before execution.\n *\n * @see {@link ApprovalConfig} for global and per-tool options.\n */\n requireApproval?: ApprovalConfig\n /**\n * Fully replace the default system prompt.\n * When set, `preset` system prompts and `additionalInstructions` are ignored.\n */\n instructions?: string\n /**\n * Append text to the preset-specific (or default) system prompt.\n * Ignored when `instructions` is set.\n */\n additionalInstructions?: string\n /**\n * Default owner / repo / PR / issue / ref values for tools and the system prompt.\n */\n context?: GithubToolsContext\n /**\n * Default author for commit-creating tools.\n * Falls back to the authenticated user when omitted.\n */\n author?: CommitIdentity\n /**\n * Default committer for commit-creating tools.\n * Falls back to the authenticated user when omitted.\n */\n committer?: CommitIdentity\n /**\n * Co-authors to attribute on all commits.\n * Added as \"Co-authored-by\" trailers to commit messages.\n */\n coAuthors?: CommitIdentity[]\n }\n\n/**\n * Create a pre-configured durable GitHub agent powered by `WorkflowAgent`\n * from `@ai-sdk/workflow`.\n *\n * Returns a {@link DurableGithubAgent} with two interaction modes:\n *\n * - `.stream()` — works directly in workflow scope; each tool call is a durable step.\n * Write tools honor `requireApproval` via `needsApproval` and pause the workflow\n * until the user approves or denies.\n * - `.generate()` — uses `generateText` from the AI SDK; must be called from\n * within a `\"use step\"` function when running inside a workflow.\n *\n * @example Streaming (chat UI — works in workflow scope)\n * ```ts\n * import { createDurableGithubAgent } from '@github-tools/sdk/workflow'\n * import { getWritable } from 'workflow'\n * import type { ModelMessage, ModelCallStreamPart } 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<ModelCallStreamPart>()\n * await agent.stream({ messages, writable })\n * }\n * ```\n */\nexport function createDurableGithubAgent(\n options: CreateDurableGithubAgentOptions & { preset?: undefined },\n): DurableGithubAgent<AllGithubTools>\nexport function createDurableGithubAgent<P extends GithubToolPreset>(\n options: CreateDurableGithubAgentOptions & { preset: P },\n): DurableGithubAgent<Pick<AllGithubTools, PresetToolName<P>>>\nexport function createDurableGithubAgent<P extends readonly GithubToolPreset[]>(\n options: CreateDurableGithubAgentOptions & { preset: P },\n): DurableGithubAgent<Pick<AllGithubTools, CombinedPresetToolNames<P>>>\nexport function createDurableGithubAgent({\n model,\n token,\n preset,\n requireApproval,\n context,\n instructions,\n additionalInstructions,\n author,\n committer,\n coAuthors,\n ...agentOptions\n}: CreateDurableGithubAgentOptions): DurableGithubAgent<AllGithubTools | Pick<AllGithubTools, GithubToolName>> {\n const tools = createGithubTools({ token, requireApproval, preset, context, author, committer, coAuthors })\n\n return new DurableGithubAgent({\n ...agentOptions,\n model,\n tools,\n instructions: resolveInstructions({ preset, instructions, additionalInstructions, context }),\n }) as DurableGithubAgent<typeof tools>\n}\n\nexport { createGithubTools, createGithubAgent } from './index'\nexport type { CommitIdentity, CommitToolOptions, GithubTools, GithubToolsOptions, GithubToolPreset, GithubToolName, GithubWriteToolName, ApprovalConfig, ToolOverrides, AllGithubTools, PresetToolName, CombinedPresetToolNames, GithubToolsForPreset, PickGithubTools, GithubTokenInput, GithubToolsContext } from './index'\nexport { PRESET_TOOLS, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, resolveGithubToken } from './index'\nexport type { CreateGithubAgentOptions } from './agents'\n"],"mappings":";;;;;;;;;;;;;;AAiDA,IAAa,qBAAb,MAAkE;CAChE;CACA;CACA;CACA;CACA;CAEA,YAAY,SAAuC;EACjD,KAAK,QAAQ,IAAI,cAAc,OAAO;EACtC,KAAK,SAAS,QAAQ;EACtB,KAAK,gBAAgB,OAAO,QAAQ,iBAAiB,WAAW,QAAQ,eAAe,KAAA;EACvF,KAAK,aAAa,QAAQ;EAC1B,KAAK,SAAS,QAAQ,SAAS,CAAC;CAClC;;CAGA,IAAI,QAAgB;EAClB,OAAO,KAAK,MAAM;CACpB;;;;;CAMA,OACE,SAC0D;EAC1D,OAAO,KAAK,MAAM,OAAO,OAAO;CAClC;;;;;;;;CASA,MAAM,SAAS,EAAE,QAAQ,YAAoJ;EAC3K,MAAM,EAAE,iBAAiB,MAAM,OAAO;EAEtC,MAAM,SAAS,KAAK;EAEpB,MAAM,SAAS,MAAM,aAAa;GAChC,OAAO,KAAK;GACZ,OAAO,KAAK;GACZ;GACA;GACA;GACA,wBAAwB,KAAK;EAC/B,CAAC;EAED,OAAO;GACL,MAAM,OAAO;GACb,cAAc,OAAO;GACrB,OAAO,OAAO;GACd,OAAO,OAAO;GACd,UAAU,OAAO;EACnB;CACF;AACF;AAqGA,SAAgB,yBAAyB,EACvC,OACA,OACA,QACA,iBACA,SACA,cACA,wBACA,QACA,WACA,WACA,GAAG,gBAC0G;CAC7G,MAAM,QAAQ,kBAAkB;EAAE;EAAO;EAAiB;EAAQ;EAAS;EAAQ;EAAW;CAAU,CAAC;CAEzG,OAAO,IAAI,mBAAmB;EAC5B,GAAG;EACH;EACA;EACA,cAAc,oBAAoB;GAAE;GAAQ;GAAc;GAAwB;EAAQ,CAAC;CAC7F,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"workflow.mjs","names":[],"sources":["../src/workflow.ts"],"sourcesContent":["import { WorkflowAgent } from '@ai-sdk/workflow'\nimport type {\n WorkflowAgentOptions,\n WorkflowAgentStreamOptions,\n WorkflowAgentStreamResult,\n TelemetryOptions,\n} from '@ai-sdk/workflow'\nimport type {\n LanguageModel,\n ToolSet,\n StepResult,\n FinishReason,\n LanguageModelUsage,\n LanguageModelResponseMetadata,\n ModelMessage,\n StopCondition,\n} from 'ai'\nimport { createGithubTools } from './index'\nimport { resolveInstructions } from './agents'\nimport type { AllGithubTools } from './core/tool-types'\nimport type { CombinedPresetToolNames, GithubToolPreset, PresetToolName } from './core/presets'\nimport type { GithubToolName } from './core/tool-names'\nimport type { StaticApprovalConfig } from './index'\nimport type { CommitIdentity } from './types'\nimport type { GithubTokenInput } from './core/token'\nimport type { GithubToolsContext } from './core/context'\nimport type { Context } from '@ai-sdk/provider-utils'\n\n/**\n * Result of {@link DurableGithubAgent.generate}.\n */\nexport interface DurableGithubAgentGenerateResult<TTools extends ToolSet = ToolSet> {\n text: string\n finishReason: FinishReason\n usage: LanguageModelUsage\n steps: StepResult<TTools>[]\n response: LanguageModelResponseMetadata & { messages: ModelMessage[] }\n}\n\n/**\n * A wrapper around {@link WorkflowAgent} that adds a non-streaming\n * `.generate()` method alongside the existing `.stream()`.\n *\n * - `.stream()` — delegates to `WorkflowAgent.stream()`. Each tool call is\n * an individually retriable workflow step. Supports `needsApproval` on tools.\n * - `.generate()` — uses `generateText` from the AI SDK for non-streaming\n * execution. Must be called from within a `\"use step\"` function in\n * workflow context (the Workflow runtime blocks raw I/O in workflow scope).\n */\nexport class DurableGithubAgent<TTools extends ToolSet = ToolSet> {\n private agent: WorkflowAgent<TTools>\n private _model: LanguageModel\n private _instructions?: string\n private _telemetry?: TelemetryOptions\n private _tools: TTools\n\n constructor(options: WorkflowAgentOptions<TTools>) {\n this.agent = new WorkflowAgent(options)\n this._model = options.model\n this._instructions = typeof options.instructions === 'string' ? options.instructions : undefined\n this._telemetry = options.telemetry\n this._tools = options.tools ?? {} as TTools\n }\n\n /** The tool set configured for this agent. */\n get tools(): TTools {\n return this.agent.tools\n }\n\n /**\n * Stream the agent's response. Delegates directly to `WorkflowAgent.stream()`.\n * Works in workflow context — each tool call is a durable step.\n */\n stream<TStreamTools extends TTools = TTools, OUTPUT = never, PARTIAL_OUTPUT = never>(\n options: WorkflowAgentStreamOptions<TStreamTools, Context, OUTPUT, PARTIAL_OUTPUT>,\n ): Promise<WorkflowAgentStreamResult<TStreamTools, OUTPUT>> {\n return this.agent.stream(options)\n }\n\n /**\n * Generate a non-streaming response using `generateText` from the AI SDK.\n *\n * In workflow context this **must** be called from within a `\"use step\"`\n * function, because the Workflow runtime blocks direct I/O (HTTP calls)\n * at the workflow scope level.\n */\n async generate({ prompt, stopWhen }: { prompt: string, stopWhen?: StopCondition<TTools> | Array<StopCondition<TTools>> }): Promise<DurableGithubAgentGenerateResult<TTools>> {\n const { generateText } = await import('ai')\n\n const system = this._instructions\n\n const result = await generateText({\n model: this._model,\n tools: this._tools,\n system,\n prompt,\n stopWhen,\n experimental_telemetry: this._telemetry as Parameters<typeof generateText>[0]['experimental_telemetry'],\n })\n\n return {\n text: result.text,\n finishReason: result.finishReason,\n usage: result.usage,\n steps: result.steps as StepResult<TTools>[],\n response: result.response,\n }\n }\n}\n\n/**\n * Options for creating a durable GitHub agent via {@link createDurableGithubAgent}.\n *\n * Extends all `WorkflowAgentOptions` (temperature, telemetry, callbacks, etc.)\n * and adds GitHub-specific fields (token, preset, approval config).\n */\nexport type CreateDurableGithubAgentOptions =\n Omit<WorkflowAgentOptions, 'model' | 'tools' | 'instructions'> & {\n model: string | LanguageModel\n /**\n * GitHub personal access token or async token provider.\n * Falls back to `process.env.GITHUB_TOKEN` when omitted.\n */\n token?: GithubTokenInput\n /**\n * Restrict tools and system prompt to a predefined preset.\n *\n * Selects a subset of tools and, when a single preset is passed,\n * sets a matching system prompt. Combine presets with an array to merge tool sets.\n *\n * @see {@link GithubToolPreset} for available presets and included tools.\n */\n preset?: GithubToolPreset | GithubToolPreset[]\n /**\n * Control whether write operations require user approval before execution.\n *\n * `'auto'` is not supported: the evaluation call cannot run inside a workflow function.\n *\n * @see {@link StaticApprovalConfig} for global and per-tool options.\n */\n requireApproval?: StaticApprovalConfig\n /**\n * Fully replace the default system prompt.\n * When set, `preset` system prompts and `additionalInstructions` are ignored.\n */\n instructions?: string\n /**\n * Append text to the preset-specific (or default) system prompt.\n * Ignored when `instructions` is set.\n */\n additionalInstructions?: string\n /**\n * Default owner / repo / PR / issue / ref values for tools and the system prompt.\n */\n context?: GithubToolsContext\n /**\n * Default author for commit-creating tools.\n * Falls back to the authenticated user when omitted.\n */\n author?: CommitIdentity\n /**\n * Default committer for commit-creating tools.\n * Falls back to the authenticated user when omitted.\n */\n committer?: CommitIdentity\n /**\n * Co-authors to attribute on all commits.\n * Added as \"Co-authored-by\" trailers to commit messages.\n */\n coAuthors?: CommitIdentity[]\n }\n\n/**\n * Create a pre-configured durable GitHub agent powered by `WorkflowAgent`\n * from `@ai-sdk/workflow`.\n *\n * Returns a {@link DurableGithubAgent} with two interaction modes:\n *\n * - `.stream()` — works directly in workflow scope; each tool call is a durable step.\n * Write tools honor `requireApproval` via `needsApproval` and pause the workflow\n * until the user approves or denies.\n * - `.generate()` — uses `generateText` from the AI SDK; must be called from\n * within a `\"use step\"` function when running inside a workflow.\n *\n * @example Streaming (chat UI — works in workflow scope)\n * ```ts\n * import { createDurableGithubAgent } from '@github-tools/sdk/workflow'\n * import { getWritable } from 'workflow'\n * import type { ModelMessage, ModelCallStreamPart } from 'ai'\n *\n * async function chatWorkflow(messages: ModelMessage[], token: string) {\n * \"use workflow\"\n * const agent = createDurableGithubAgent({\n * model: 'anthropic/claude-opus-5.5',\n * token,\n * preset: 'code-review',\n * })\n * const writable = getWritable<ModelCallStreamPart>()\n * await agent.stream({ messages, writable })\n * }\n * ```\n */\nexport function createDurableGithubAgent(\n options: CreateDurableGithubAgentOptions & { preset?: undefined },\n): DurableGithubAgent<AllGithubTools>\nexport function createDurableGithubAgent<P extends GithubToolPreset>(\n options: CreateDurableGithubAgentOptions & { preset: P },\n): DurableGithubAgent<Pick<AllGithubTools, PresetToolName<P>>>\nexport function createDurableGithubAgent<P extends readonly GithubToolPreset[]>(\n options: CreateDurableGithubAgentOptions & { preset: P },\n): DurableGithubAgent<Pick<AllGithubTools, CombinedPresetToolNames<P>>>\nexport function createDurableGithubAgent({\n model,\n token,\n preset,\n requireApproval,\n context,\n instructions,\n additionalInstructions,\n author,\n committer,\n coAuthors,\n ...agentOptions\n}: CreateDurableGithubAgentOptions): DurableGithubAgent<AllGithubTools | Pick<AllGithubTools, GithubToolName>> {\n const tools = createGithubTools({ token, requireApproval, preset, context, author, committer, coAuthors })\n\n return new DurableGithubAgent({\n ...agentOptions,\n model,\n tools,\n instructions: resolveInstructions({ preset, instructions, additionalInstructions, context }),\n }) as DurableGithubAgent<typeof tools>\n}\n\nexport { createGithubTools, createGithubAgent } from './index'\nexport type { CommitIdentity, CommitToolOptions, GithubTools, GithubToolsOptions, GithubToolPreset, GithubToolName, GithubWriteToolName, ApprovalConfig, ToolOverrides, AllGithubTools, PresetToolName, CombinedPresetToolNames, GithubToolsForPreset, PickGithubTools, GithubTokenInput, GithubToolsContext } from './index'\nexport { PRESET_TOOLS, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, resolveGithubToken } from './index'\nexport type { CreateGithubAgentOptions } from './agents'\n"],"mappings":";;;;;;;;;;;;;;AAiDA,IAAa,qBAAb,MAAkE;CAChE;CACA;CACA;CACA;CACA;CAEA,YAAY,SAAuC;EACjD,KAAK,QAAQ,IAAI,cAAc,OAAO;EACtC,KAAK,SAAS,QAAQ;EACtB,KAAK,gBAAgB,OAAO,QAAQ,iBAAiB,WAAW,QAAQ,eAAe,KAAA;EACvF,KAAK,aAAa,QAAQ;EAC1B,KAAK,SAAS,QAAQ,SAAS,CAAC;CAClC;;CAGA,IAAI,QAAgB;EAClB,OAAO,KAAK,MAAM;CACpB;;;;;CAMA,OACE,SAC0D;EAC1D,OAAO,KAAK,MAAM,OAAO,OAAO;CAClC;;;;;;;;CASA,MAAM,SAAS,EAAE,QAAQ,YAAoJ;EAC3K,MAAM,EAAE,iBAAiB,MAAM,OAAO;EAEtC,MAAM,SAAS,KAAK;EAEpB,MAAM,SAAS,MAAM,aAAa;GAChC,OAAO,KAAK;GACZ,OAAO,KAAK;GACZ;GACA;GACA;GACA,wBAAwB,KAAK;EAC/B,CAAC;EAED,OAAO;GACL,MAAM,OAAO;GACb,cAAc,OAAO;GACrB,OAAO,OAAO;GACd,OAAO,OAAO;GACd,UAAU,OAAO;EACnB;CACF;AACF;AAuGA,SAAgB,yBAAyB,EACvC,OACA,OACA,QACA,iBACA,SACA,cACA,wBACA,QACA,WACA,WACA,GAAG,gBAC0G;CAC7G,MAAM,QAAQ,kBAAkB;EAAE;EAAO;EAAiB;EAAQ;EAAS;EAAQ;EAAW;CAAU,CAAC;CAEzG,OAAO,IAAI,mBAAmB;EAC5B,GAAG;EACH;EACA;EACA,cAAc,oBAAoB;GAAE;GAAQ;GAAc;GAAwB;EAAQ,CAAC;CAC7F,CAAC;AACH"}
|