@gitkraken/core-gitlens 0.36.0 → 0.37.1
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/CHANGELOG.md +25 -1
- package/dist/git/utils/branch.utils.d.ts +14 -0
- package/dist/git/utils/branch.utils.js +37 -1
- package/dist/git/utils/branch.utils.js.map +1 -1
- package/dist/git/utils/branchLanded.utils.d.ts +43 -0
- package/dist/git/utils/branchLanded.utils.js +56 -0
- package/dist/git/utils/branchLanded.utils.js.map +1 -0
- package/dist/plus/ai/models/model.js +58 -4
- package/dist/plus/ai/models/model.js.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.js +58 -223
- package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
- package/dist/plus/ai/providers/deepSeekProvider.js +32 -18
- package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.js +25 -189
- package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.js +31 -73
- package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.js +9 -11
- package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +18 -3
- package/dist/plus/git-github/api/github.js +58 -15
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +2 -0
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +24 -5
- package/dist/plus/integrations/models/issuesIntegration.d.ts +2 -1
- package/dist/plus/integrations/models/issuesIntegration.js +6 -3
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +21 -6
- package/dist/plus/integrations/providers/azureDevOps.js +24 -12
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +49 -3
- package/dist/plus/integrations/providers/azureDevOpsServer.js +151 -23
- package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
- package/dist/plus/integrations/providers/issueSorts.d.ts +0 -1
- package/dist/plus/integrations/providers/linear.d.ts +3 -2
- package/dist/plus/integrations/providers/linear.js +7 -5
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/reads/drains.d.ts +0 -1
- package/dist/plus/integrations/reads/searchPullRequests.d.ts +2 -0
- package/dist/plus/integrations/reads/searchPullRequests.js +18 -9
- package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
- package/docs/integrations.md +27 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,28 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.37.1] - 2026-11-10
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Fixes GitHub/GHE pull request text searches for exactly open and merged matches filling their ten-result limit with open pull requests before considering merged ones. This combination now selects and combines matches newest-created first, overriding unquoted `sort:` qualifiers in the search text. Other state combinations and the filtered, paged search keep their existing behavior ([#5980](https://github.com/gitkraken/vscode-gitlens/issues/5980)) (plus/git-github)
|
|
14
|
+
|
|
15
|
+
## [0.37.0] - 2026-11-10
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Adds `getBranchReflogWork` to `utils/branch.utils.js`: from a local branch's reflog (newest first, as `refs.getReflogEntries` reads it), whether the branch has work authored on it (`'work'`), was created here and never had any (`'none'`), or can't be told (`'unknown'`: an empty or expired reflog, or a branch created from the same-named remote branch). Every entry counts as work except a move that adds none: the branch's creation, a reset or rename, a fast-forward merge or pull, a fetch, a clone, or a rebase that replayed nothing. It tells a branch whose work was fast-forward merged apart from a new one, which `getBranchMergedStatus` reports alike, as merged (git)
|
|
20
|
+
- Adds `getBranchLandedState` to `utils/branchLanded.utils.js`, with the `BranchLandedPullRequestCandidate` and `BranchLandedState` types: from a branch's tip sha and its pull requests, whether its work landed through a merged pull request. The head sha decides, never recency: an open pull request at the tip means the branch is live (`live`), a merged one at the tip means it landed, and otherwise the merged pull request with the fewest new commits decides between landed (none) and a successor (some). A pull request without a head sha never decides (git)
|
|
21
|
+
- Adds `cancellation` to `IntegrationManager.searchPullRequestsPage`: aborting it cancels the request in flight, a retry waiting to be sent and any page a page-number walk still has to read, and the read rejects with a `CancellationError` rather than resolving as a failed or empty page (plus/integrations)
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **Breaking (plus/git-github, plus/integrations)** — On GitHub/GHE the filtered pull request search (`searchPullRequestsPage`) holds at most 20 pull requests a page across all of its relationship × state facets in the full shape, and 100 in the `summary` shape, split evenly across the active facets (at least one each), and `itemsPerPage` can only lower a facet's share. The full-shape default was 30 per facet with an explicit maximum of 100, so a single-facet page now holds up to 20 rather than 30 (or 100), a 3-relationship search 6 per facet rather than 30, and an explicit `summary` size of 100 over two states 50 per facet. GitHub gives up on a page it can't build in about 11 seconds, answering 502/504 with an HTML gateway page, and the time grows with the pull requests the page selects: measured on `org:microsoft is:pr is:open`, 20 full rows took 5 to 7 seconds while 30 failed in some runs and 100 in every run. A page with more to read always carries a `cursor`; a smaller page is not the last one and carries no warning, and `page.itemsPerPage` reports what came back. Size a list from `hasMore`/`cursor` and `page.itemsPerPage`, never from the size you asked for ([#5978](https://github.com/gitkraken/vscode-gitlens/issues/5978))
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Fixes the filtered pull request search on GitHub/GHE failing after about 35 seconds whenever GitHub's gateway timed out building a page, by sending the same expensive request three times. A page whose request gets a 502/504 is now asked for once more at half its size (unchanged once it is one row per facet), and a second gateway failure fails the read (warning + `fetchFailed`, as before) instead of a third identical request. A page that recovers is smaller but no facet skips or repeats a row, since every facet resumes from the last row it served, and the rest of the walk keeps the halved size so its later pages don't time out first; the reduced size travels in the cursor. Other transient failures (503, a network failure) retry unchanged as before ([#5978](https://github.com/gitkraken/vscode-gitlens/issues/5978)) (plus/git-github)
|
|
30
|
+
|
|
9
31
|
## [0.36.0] - 2026-11-09
|
|
10
32
|
|
|
11
33
|
### Added
|
|
@@ -1204,7 +1226,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
1204
1226
|
|
|
1205
1227
|
- Initial release. Bundles `@gitlens/utils`, `@gitlens/git`, `@gitlens/git-cli`, `@gitlens/ai`, and `@gitlens/git-github` into a single core npm package with subpath exports.
|
|
1206
1228
|
|
|
1207
|
-
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.
|
|
1229
|
+
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.37.1...HEAD
|
|
1230
|
+
[0.37.1]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.37.0...gitkraken:releases/core/v0.37.1
|
|
1231
|
+
[0.37.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.36.0...gitkraken:releases/core/v0.37.0
|
|
1208
1232
|
[0.36.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.35.0...gitkraken:releases/core/v0.36.0
|
|
1209
1233
|
[0.35.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.34.0...gitkraken:releases/core/v0.35.0
|
|
1210
1234
|
[0.34.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.33.0...gitkraken:releases/core/v0.34.0
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PageableResult } from "../../utils/paging.js";
|
|
2
2
|
import { GitBranchReference, GitReference } from "../models/reference.js";
|
|
3
3
|
import { BranchMetadata, BranchMetadataGkConfigKey, GitBranch, GitTrackingUpstream } from "../models/branch.js";
|
|
4
|
+
import { GitReflogEntry } from "../models/reflog.js";
|
|
4
5
|
//#region ../git/src/utils/branch.utils.d.ts
|
|
5
6
|
export declare function formatDetachedHeadName(sha: string): string;
|
|
6
7
|
export declare function getBranchNameAndRemote(ref: GitBranchReference): [name: string, remote: string | undefined];
|
|
@@ -41,5 +42,18 @@ export declare function parseBranchMetadataGkConfigKey(key: string): {
|
|
|
41
42
|
} | undefined;
|
|
42
43
|
/** Sets the field `key` is read into to `value`, or removes it for `undefined`, exactly as a fresh read of the key would */
|
|
43
44
|
export declare function setBranchMetadataValue(metadata: BranchMetadata, key: BranchMetadataGkConfigKey, value: string | undefined): void;
|
|
45
|
+
/**
|
|
46
|
+
* Classifies whether a local branch's own reflog shows work authored on it. A branch that is 0 commits ahead
|
|
47
|
+
* of its merge target is either brand new (nothing merged) or had its work fast-forward merged, and only the
|
|
48
|
+
* reflog tells them apart. Exclusion-based: any entry other than a known no-work move (creation, reset, rename,
|
|
49
|
+
* fast-forward, fetch, clone, or a rebase that replayed nothing) counts as work.
|
|
50
|
+
*
|
|
51
|
+
* - `work`: the branch has its own work, so it was genuinely merged
|
|
52
|
+
* - `none`: the branch was created here and never had work, so it's just fresh
|
|
53
|
+
* - `unknown`: can't tell (empty or expired reflog, or created from the same-named remote branch)
|
|
54
|
+
*
|
|
55
|
+
* @param entries the branch's reflog, newest first
|
|
56
|
+
*/
|
|
57
|
+
export declare function getBranchReflogWork(entries: readonly GitReflogEntry[], branchName: string): 'work' | 'none' | 'unknown';
|
|
44
58
|
//#endregion
|
|
45
59
|
//# sourceMappingURL=branch.utils.d.ts.map
|
|
@@ -174,7 +174,43 @@ function setBranchMetadataValue(metadata, key, value) {
|
|
|
174
174
|
else delete metadata.disposition;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
+
const mergeFastForwardRegex = /^merge .+: Fast-forward$/;
|
|
178
|
+
const pullFastForwardRegex = /^pull\b.*: Fast-forward$/;
|
|
179
|
+
const rebaseFinishRegex = /^(?:rebase|pull)\b.* \(finish\): .* onto ([0-9a-f]+)$/;
|
|
180
|
+
const branchCreatedRegex = /^branch: Created from (.+)$/;
|
|
181
|
+
/**
|
|
182
|
+
* Classifies whether a local branch's own reflog shows work authored on it. A branch that is 0 commits ahead
|
|
183
|
+
* of its merge target is either brand new (nothing merged) or had its work fast-forward merged, and only the
|
|
184
|
+
* reflog tells them apart. Exclusion-based: any entry other than a known no-work move (creation, reset, rename,
|
|
185
|
+
* fast-forward, fetch, clone, or a rebase that replayed nothing) counts as work.
|
|
186
|
+
*
|
|
187
|
+
* - `work`: the branch has its own work, so it was genuinely merged
|
|
188
|
+
* - `none`: the branch was created here and never had work, so it's just fresh
|
|
189
|
+
* - `unknown`: can't tell (empty or expired reflog, or created from the same-named remote branch)
|
|
190
|
+
*
|
|
191
|
+
* @param entries the branch's reflog, newest first
|
|
192
|
+
*/
|
|
193
|
+
function getBranchReflogWork(entries, branchName) {
|
|
194
|
+
let createdFrom;
|
|
195
|
+
for (const entry of entries) {
|
|
196
|
+
const { message } = entry;
|
|
197
|
+
const created = branchCreatedRegex.exec(message);
|
|
198
|
+
if (created != null) {
|
|
199
|
+
createdFrom = created[1];
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
if (message.startsWith("branch: Reset to ") || message.startsWith("Branch: renamed ") || message.startsWith("reset: moving to ") || mergeFastForwardRegex.test(message) || pullFastForwardRegex.test(message) || message.startsWith("fetch") || message.startsWith("clone: ")) continue;
|
|
203
|
+
const finished = rebaseFinishRegex.exec(message);
|
|
204
|
+
if (finished != null && finished[1] === entry.sha) continue;
|
|
205
|
+
return "work";
|
|
206
|
+
}
|
|
207
|
+
if (createdFrom == null) return "unknown";
|
|
208
|
+
const source = createdFrom.startsWith("refs/remotes/") ? createdFrom.substring(13) : createdFrom;
|
|
209
|
+
const slash = source.indexOf("/");
|
|
210
|
+
if (slash > 0 && source.substring(slash + 1) === branchName) return "unknown";
|
|
211
|
+
return "none";
|
|
212
|
+
}
|
|
177
213
|
//#endregion
|
|
178
|
-
export { formatDetachedHeadName, getBranchNameAndRemote, getBranchTrackingWithoutRemote, getLocalBranchByUpstream, getLocalBranchUpstreamNames, isDetachedHead, isOfBranchRefType, isRemoteBranch, isRemoteHEAD, parseBranchMetadataGkConfigKey, parseRefName, parseUpstream, setBranchMetadataValue, splitRemoteBranchName };
|
|
214
|
+
export { formatDetachedHeadName, getBranchNameAndRemote, getBranchReflogWork, getBranchTrackingWithoutRemote, getLocalBranchByUpstream, getLocalBranchUpstreamNames, isDetachedHead, isOfBranchRefType, isRemoteBranch, isRemoteHEAD, parseBranchMetadataGkConfigKey, parseRefName, parseUpstream, setBranchMetadataValue, splitRemoteBranchName };
|
|
179
215
|
|
|
180
216
|
//# sourceMappingURL=branch.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branch.utils.js","names":[],"sources":["../../../../git/src/utils/branch.utils.ts"],"sourcesContent":["import { getRemoteNameSlashIndex } from '@gitlens/utils/gitRefs.js';\nimport type { PageableResult } from '@gitlens/utils/paging.js';\nimport type { BranchMetadata, BranchMetadataGkConfigKey, GitBranch, GitTrackingUpstream } from '../models/branch.js';\nimport type { GitBranchReference, GitReference } from '../models/reference.js';\nimport { shortenRevision } from './revision.utils.js';\n\n/**\n * The names git uses where a branch name would go when HEAD isn't on a branch — `(HEAD detached\n * at|from <rev>)`, `(no branch)`, `(no branch, rebasing <name>)`, `(no branch, bisect started on\n * <name>)`, and `git status --porcelain=v2`'s `branch.head` token `(detached)` — plus bare `HEAD`\n * and our own {@link formatDetachedHeadName} output (`(<rev>...)`).\n *\n * Deliberately NOT \"anything parenthesized\": parentheses are legal in ref names, so `(release)`,\n * `v1.0(rc)` and `feat/(wip)` are all real branches a user can be on. Matching those made\n * `GitBranch` rewrite a genuine branch's `name` to the synthesized `(sha…)` label and re-key its\n * `id` by SHA, which corrupts its identity for every downstream consumer.\n */\nconst detachedHEADRegex = /^(?:HEAD|\\(detached\\)|\\(HEAD detached (?:at|from) .+\\)|\\(no branch.*\\)|\\(.+\\.\\.\\.\\))$/;\n\nexport function formatDetachedHeadName(sha: string): string {\n\treturn `(${shortenRevision(sha)}...)`;\n}\n\nexport function getBranchNameAndRemote(ref: GitBranchReference): [name: string, remote: string | undefined] {\n\tif (ref.remote) {\n\t\tconst index = getRemoteNameSlashIndex(ref.name);\n\t\tif (index === -1) return [ref.name, undefined];\n\n\t\treturn [ref.name.substring(index + 1), ref.name.substring(0, index)];\n\t}\n\n\tif (ref.upstream?.local) return [ref.name, undefined];\n\tif (ref.upstream?.remote) return [ref.name, ref.upstream.remote];\n\n\tif (ref.upstream?.name != null) {\n\t\tconst index = getRemoteNameSlashIndex(ref.upstream.name);\n\t\tif (index === -1) return [ref.name, undefined];\n\n\t\treturn [ref.name, ref.upstream.name.substring(0, index)];\n\t}\n\n\treturn [ref.name, undefined];\n}\n\n/**\n * The upstream's branch name on its remote. The name git reports (`branch.<name>.merge`) wins over stripping the local\n * remote-tracking name, which a custom fetch refspec makes differ (`origin` fetching into `refs/remotes/mirror/*`).\n *\n * A remote-tracking branch tracks nothing. The Graph's remote refs carry the remote's own name in `upstream`, which\n * read as a tracking name would fetch a branch named after the remote (`git fetch upstream upstream`)\n */\nexport function getBranchTrackingWithoutRemote(ref: GitBranchReference): string | undefined {\n\tif (ref.remote || ref.upstream == null) return undefined;\n\n\tconst { name, remote, remoteBranch, local } = ref.upstream;\n\tif (local) return name;\n\tif (remoteBranch) return remoteBranch;\n\tif (remote && name.startsWith(`${remote}/`)) return name.substring(remote.length + 1);\n\n\treturn name.substring(getRemoteNameSlashIndex(name) + 1);\n}\n\n/**\n * Splits `name` at the longest of `remoteNames` that prefixes it, so a remote whose own name contains a `/` resolves\n * whole. A leading `remotes/` is stripped only when no remote matches the name as given\n */\nexport function splitRemoteBranchName(\n\tname: string,\n\tremoteNames: Iterable<string>,\n): [remote: string, branch: string] | undefined {\n\tconst names = Array.isArray(remoteNames) ? remoteNames : [...remoteNames];\n\n\tconst split = splitAtLongestRemote(name, names);\n\tif (split != null || !name.startsWith('remotes/')) return split;\n\n\treturn splitAtLongestRemote(name.substring(8), names);\n}\n\nfunction splitAtLongestRemote(\n\tname: string,\n\tremoteNames: Iterable<string>,\n): [remote: string, branch: string] | undefined {\n\tlet match: string | undefined;\n\tfor (const remote of remoteNames) {\n\t\tif (\n\t\t\tname.length > remote.length + 1 &&\n\t\t\tname.charCodeAt(remote.length) === 47 /* '/' */ &&\n\t\t\tname.startsWith(remote) &&\n\t\t\t(match == null || remote.length > match.length)\n\t\t) {\n\t\t\tmatch = remote;\n\t\t}\n\t}\n\n\treturn match != null ? [match, name.substring(match.length + 1)] : undefined;\n}\n\nexport function isDetachedHead(name: string): boolean {\n\t// If there is whitespace in the name assume this is not a valid branch name\n\t// Deals with detached HEAD states\n\tname = name.trim();\n\treturn name.length ? detachedHEADRegex.test(name) : true;\n}\n\nexport function isOfBranchRefType(branch: GitReference | undefined): branch is GitBranchReference {\n\treturn branch?.refType === 'branch';\n}\n\nconst localBranchesPrefixRegex = /^(refs\\/)?heads\\//i;\nconst remoteBranchesPrefixRegex = /^(refs\\/)?remotes\\//i;\nconst remoteHEADRegex = /^(refs\\/)?remotes\\/(.*\\/)HEAD$/i;\n\nexport function isRemoteBranch(refName: string): boolean {\n\treturn remoteBranchesPrefixRegex.test(refName);\n}\n\nexport function isRemoteHEAD(refName: string): boolean {\n\treturn remoteHEADRegex.test(refName);\n}\n\nexport function parseRefName(refName: string): { name: string; remote: boolean } {\n\tconst remote = isRemoteBranch(refName);\n\n\tlet name;\n\tif (remote) {\n\t\t// Strip off refs/remotes/\n\t\tname = refName.replace(remoteBranchesPrefixRegex, '');\n\t} else {\n\t\t// Strip off refs/heads/\n\t\tname = refName.replace(localBranchesPrefixRegex, '');\n\t}\n\n\treturn { name: name, remote: remote };\n}\n\nexport async function getLocalBranchByUpstream(\n\tremoteBranchName: string,\n\tbranches: PageableResult<GitBranch> | ReadonlyMap<unknown, GitBranch>,\n): Promise<GitBranch | undefined> {\n\tlet qualifiedRemoteBranchName;\n\tif (remoteBranchName.startsWith('remotes/')) {\n\t\tqualifiedRemoteBranchName = remoteBranchName;\n\t\tremoteBranchName = remoteBranchName.substring(8);\n\t} else {\n\t\tqualifiedRemoteBranchName = `remotes/${remoteBranchName}`;\n\t}\n\n\tfunction matches(branch: GitBranch): boolean {\n\t\treturn (\n\t\t\t!branch.remote &&\n\t\t\tbranch.upstream?.name != null &&\n\t\t\t(branch.upstream.name === remoteBranchName || branch.upstream.name === qualifiedRemoteBranchName!)\n\t\t);\n\t}\n\n\tconst values = branches.values();\n\tif (Symbol.asyncIterator in values) {\n\t\tfor await (const branch of values) {\n\t\t\tif (matches(branch)) return branch;\n\t\t}\n\t} else {\n\t\tfor (const branch of values) {\n\t\t\tif (matches(branch)) return branch;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport async function getLocalBranchUpstreamNames(branches: PageableResult<GitBranch>): Promise<Set<string>> {\n\tconst remoteBranches = new Set<string>();\n\n\tfor await (const branch of branches.values()) {\n\t\tif (!branch.remote && branch.upstream?.name != null) {\n\t\t\tremoteBranches.add(branch.upstream.name);\n\t\t}\n\t}\n\n\treturn remoteBranches;\n}\n\nconst trackingStateRegex = /(?:\\[(?:ahead ([0-9]+))?[,\\s]*(?:behind ([0-9]+))?]|\\[(gone)])/;\n\n/**\n * @param remote - `%(upstream:remotename)`; `.` is a local upstream, and empty means git reported none. A reported\n * remote always wins, even when a custom fetch refspec puts its branches under `refs/heads/`; only when none was\n * reported (git < 2.23) is an upstream under `refs/heads/` taken as local\n * @param remoteRef - `%(upstream:remoteref)`; the upstream's ref on `remote`, read as its branch name\n */\nexport function parseUpstream(\n\tupstream: string,\n\ttracking: string,\n\tremote?: string,\n\tremoteRef?: string,\n): GitTrackingUpstream | undefined {\n\tif (!upstream) return undefined;\n\n\tconst { name } = parseRefName(upstream);\n\tconst local = remote ? remote === '.' : upstream.startsWith('refs/heads/');\n\tconst localProp = local ? { local: true } : undefined;\n\tconst remoteProp =\n\t\tremote && remote !== '.'\n\t\t\t? { remote: remote, ...(remoteRef ? { remoteBranch: remoteRef.replace(/^refs\\/heads\\//, '') } : undefined) }\n\t\t\t: undefined;\n\n\tconst match = trackingStateRegex.exec(tracking);\n\tif (match == null) {\n\t\treturn { name: name, missing: false, state: { ahead: 0, behind: 0 }, ...remoteProp, ...localProp };\n\t}\n\n\tconst ahead = match[1] == null ? 0 : Number(match[1]);\n\tconst behind = match[2] == null ? 0 : Number(match[2]);\n\n\treturn {\n\t\tname: name,\n\t\tmissing: match[3] != null,\n\t\tstate: { ahead: isNaN(ahead) ? 0 : ahead, behind: isNaN(behind) ? 0 : behind },\n\t\t...remoteProp,\n\t\t...localProp,\n\t};\n}\n\nconst branchMetadataGkConfigKeyRegex =\n\t/^branch\\.(.+)\\.(gk-(?:last-accessed|last-modified|agent-last-activity|disposition))$/;\n\n/** Splits a `branch.<name>.<key>` gk config key that a branch's {@link BranchMetadata} is read from, or `undefined` for any other key */\nexport function parseBranchMetadataGkConfigKey(\n\tkey: string,\n): { branch: string; key: BranchMetadataGkConfigKey } | undefined {\n\tconst match = branchMetadataGkConfigKeyRegex.exec(key);\n\tif (match == null) return undefined;\n\n\treturn { branch: match[1], key: match[2] as BranchMetadataGkConfigKey };\n}\n\n/** Sets the field `key` is read into to `value`, or removes it for `undefined`, exactly as a fresh read of the key would */\nexport function setBranchMetadataValue(\n\tmetadata: BranchMetadata,\n\tkey: BranchMetadataGkConfigKey,\n\tvalue: string | undefined,\n): void {\n\tswitch (key) {\n\t\tcase 'gk-last-accessed':\n\t\t\tif (value != null) {\n\t\t\t\tmetadata.lastAccessedAt = value;\n\t\t\t} else {\n\t\t\t\tdelete metadata.lastAccessedAt;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'gk-last-modified':\n\t\t\tif (value != null) {\n\t\t\t\tmetadata.lastModifiedAt = value;\n\t\t\t} else {\n\t\t\t\tdelete metadata.lastModifiedAt;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'gk-agent-last-activity':\n\t\t\tif (value != null) {\n\t\t\t\tmetadata.agentLastActivityAt = value;\n\t\t\t} else {\n\t\t\t\tdelete metadata.agentLastActivityAt;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'gk-disposition':\n\t\t\tif (value === 'starred' || value === 'archived') {\n\t\t\t\tmetadata.disposition = value;\n\t\t\t} else {\n\t\t\t\tdelete metadata.disposition;\n\t\t\t}\n\t\t\tbreak;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAM,oBAAoB;AAE1B,SAAgB,uBAAuB,KAAqB;CAC3D,OAAO,IAAI,gBAAgB,GAAG,EAAE;AACjC;AAEA,SAAgB,uBAAuB,KAAqE;CAC3G,IAAI,IAAI,QAAQ;EACf,MAAM,QAAQ,wBAAwB,IAAI,IAAI;EAC9C,IAAI,UAAU,IAAI,OAAO,CAAC,IAAI,MAAM,KAAA,CAAS;EAE7C,OAAO,CAAC,IAAI,KAAK,UAAU,QAAQ,CAAC,GAAG,IAAI,KAAK,UAAU,GAAG,KAAK,CAAC;CACpE;CAEA,IAAI,IAAI,UAAU,OAAO,OAAO,CAAC,IAAI,MAAM,KAAA,CAAS;CACpD,IAAI,IAAI,UAAU,QAAQ,OAAO,CAAC,IAAI,MAAM,IAAI,SAAS,MAAM;CAE/D,IAAI,IAAI,UAAU,QAAQ,MAAM;EAC/B,MAAM,QAAQ,wBAAwB,IAAI,SAAS,IAAI;EACvD,IAAI,UAAU,IAAI,OAAO,CAAC,IAAI,MAAM,KAAA,CAAS;EAE7C,OAAO,CAAC,IAAI,MAAM,IAAI,SAAS,KAAK,UAAU,GAAG,KAAK,CAAC;CACxD;CAEA,OAAO,CAAC,IAAI,MAAM,KAAA,CAAS;AAC5B;;;;;;;;AASA,SAAgB,+BAA+B,KAA6C;CAC3F,IAAI,IAAI,UAAU,IAAI,YAAY,MAAM,OAAO,KAAA;CAE/C,MAAM,EAAE,MAAM,QAAQ,cAAc,UAAU,IAAI;CAClD,IAAI,OAAO,OAAO;CAClB,IAAI,cAAc,OAAO;CACzB,IAAI,UAAU,KAAK,WAAW,GA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G;EAAY,GAAG;CAAU;CAGlG,MAAM,QAAQ,MAAM,MAAM,OAAO,IAAI,OAAO,MAAM,EAAE;CACpD,MAAM,SAAS,MAAM,MAAM,OAAO,IAAI,OAAO,MAAM,EAAE;CAErD,OAAO;EACA;EACN,SAAS,MAAM,MAAM;EACrB,OAAO;GAAE,OAAO,MAAM,KAAK,IAAI,IAAI;GAAO,QAAQ,MAAM,MAAM,IAAI,IAAI;EAAO;EAC7E,GAAG;EACH,GAAG;CACJ;AACD;AAEA,MAAM,iCACL;;AAGD,SAAgB,+BACf,KACiE;CACjE,MAAM,QAAQ,+BAA+B,KAAK,GAAG;CACrD,IAAI,SAAS,MAAM,OAAO,KAAA;CAE1B,OAAO;EAAE,QAAQ,MAAM;EAAI,KAAK,MAAM;CAAgC;AACvE;;AAGA,SAAgB,uBACf,UACA,KACA,OACO;CACP,QAAQ,KAAR;EACC,KAAK;GACJ,IAAI,SAAS,MACZ,SAAS,iBAAiB;QAE1B,OAAO,SAAS;GAEjB;EACD,KAAK;GACJ,IAAI,SAAS,MACZ,SAAS,iBAAiB;QAE1B,OAAO,SAAS;GAEjB;EACD,KAAK;GACJ,IAAI,SAAS,MACZ,SAAS,sBAAsB;QAE/B,OAAO,SAAS;GAEjB;EACD,KAAK,kBACJ,IAAI,UAAU,aAAa,UAAU,YACpC,SAAS,cAAc;OAEvB,OAAO,SAAS;CAGnB;AACD"}
|
|
1
|
+
{"version":3,"file":"branch.utils.js","names":[],"sources":["../../../../git/src/utils/branch.utils.ts"],"sourcesContent":["import { getRemoteNameSlashIndex } from '@gitlens/utils/gitRefs.js';\nimport type { PageableResult } from '@gitlens/utils/paging.js';\nimport type { BranchMetadata, BranchMetadataGkConfigKey, GitBranch, GitTrackingUpstream } from '../models/branch.js';\nimport type { GitBranchReference, GitReference } from '../models/reference.js';\nimport type { GitReflogEntry } from '../models/reflog.js';\nimport { shortenRevision } from './revision.utils.js';\n\n/**\n * The names git uses where a branch name would go when HEAD isn't on a branch — `(HEAD detached\n * at|from <rev>)`, `(no branch)`, `(no branch, rebasing <name>)`, `(no branch, bisect started on\n * <name>)`, and `git status --porcelain=v2`'s `branch.head` token `(detached)` — plus bare `HEAD`\n * and our own {@link formatDetachedHeadName} output (`(<rev>...)`).\n *\n * Deliberately NOT \"anything parenthesized\": parentheses are legal in ref names, so `(release)`,\n * `v1.0(rc)` and `feat/(wip)` are all real branches a user can be on. Matching those made\n * `GitBranch` rewrite a genuine branch's `name` to the synthesized `(sha…)` label and re-key its\n * `id` by SHA, which corrupts its identity for every downstream consumer.\n */\nconst detachedHEADRegex = /^(?:HEAD|\\(detached\\)|\\(HEAD detached (?:at|from) .+\\)|\\(no branch.*\\)|\\(.+\\.\\.\\.\\))$/;\n\nexport function formatDetachedHeadName(sha: string): string {\n\treturn `(${shortenRevision(sha)}...)`;\n}\n\nexport function getBranchNameAndRemote(ref: GitBranchReference): [name: string, remote: string | undefined] {\n\tif (ref.remote) {\n\t\tconst index = getRemoteNameSlashIndex(ref.name);\n\t\tif (index === -1) return [ref.name, undefined];\n\n\t\treturn [ref.name.substring(index + 1), ref.name.substring(0, index)];\n\t}\n\n\tif (ref.upstream?.local) return [ref.name, undefined];\n\tif (ref.upstream?.remote) return [ref.name, ref.upstream.remote];\n\n\tif (ref.upstream?.name != null) {\n\t\tconst index = getRemoteNameSlashIndex(ref.upstream.name);\n\t\tif (index === -1) return [ref.name, undefined];\n\n\t\treturn [ref.name, ref.upstream.name.substring(0, index)];\n\t}\n\n\treturn [ref.name, undefined];\n}\n\n/**\n * The upstream's branch name on its remote. The name git reports (`branch.<name>.merge`) wins over stripping the local\n * remote-tracking name, which a custom fetch refspec makes differ (`origin` fetching into `refs/remotes/mirror/*`).\n *\n * A remote-tracking branch tracks nothing. The Graph's remote refs carry the remote's own name in `upstream`, which\n * read as a tracking name would fetch a branch named after the remote (`git fetch upstream upstream`)\n */\nexport function getBranchTrackingWithoutRemote(ref: GitBranchReference): string | undefined {\n\tif (ref.remote || ref.upstream == null) return undefined;\n\n\tconst { name, remote, remoteBranch, local } = ref.upstream;\n\tif (local) return name;\n\tif (remoteBranch) return remoteBranch;\n\tif (remote && name.startsWith(`${remote}/`)) return name.substring(remote.length + 1);\n\n\treturn name.substring(getRemoteNameSlashIndex(name) + 1);\n}\n\n/**\n * Splits `name` at the longest of `remoteNames` that prefixes it, so a remote whose own name contains a `/` resolves\n * whole. A leading `remotes/` is stripped only when no remote matches the name as given\n */\nexport function splitRemoteBranchName(\n\tname: string,\n\tremoteNames: Iterable<string>,\n): [remote: string, branch: string] | undefined {\n\tconst names = Array.isArray(remoteNames) ? remoteNames : [...remoteNames];\n\n\tconst split = splitAtLongestRemote(name, names);\n\tif (split != null || !name.startsWith('remotes/')) return split;\n\n\treturn splitAtLongestRemote(name.substring(8), names);\n}\n\nfunction splitAtLongestRemote(\n\tname: string,\n\tremoteNames: Iterable<string>,\n): [remote: string, branch: string] | undefined {\n\tlet match: string | undefined;\n\tfor (const remote of remoteNames) {\n\t\tif (\n\t\t\tname.length > remote.length + 1 &&\n\t\t\tname.charCodeAt(remote.length) === 47 /* '/' */ &&\n\t\t\tname.startsWith(remote) &&\n\t\t\t(match == null || remote.length > match.length)\n\t\t) {\n\t\t\tmatch = remote;\n\t\t}\n\t}\n\n\treturn match != null ? [match, name.substring(match.length + 1)] : undefined;\n}\n\nexport function isDetachedHead(name: string): boolean {\n\t// If there is whitespace in the name assume this is not a valid branch name\n\t// Deals with detached HEAD states\n\tname = name.trim();\n\treturn name.length ? detachedHEADRegex.test(name) : true;\n}\n\nexport function isOfBranchRefType(branch: GitReference | undefined): branch is GitBranchReference {\n\treturn branch?.refType === 'branch';\n}\n\nconst localBranchesPrefixRegex = /^(refs\\/)?heads\\//i;\nconst remoteBranchesPrefixRegex = /^(refs\\/)?remotes\\//i;\nconst remoteHEADRegex = /^(refs\\/)?remotes\\/(.*\\/)HEAD$/i;\n\nexport function isRemoteBranch(refName: string): boolean {\n\treturn remoteBranchesPrefixRegex.test(refName);\n}\n\nexport function isRemoteHEAD(refName: string): boolean {\n\treturn remoteHEADRegex.test(refName);\n}\n\nexport function parseRefName(refName: string): { name: string; remote: boolean } {\n\tconst remote = isRemoteBranch(refName);\n\n\tlet name;\n\tif (remote) {\n\t\t// Strip off refs/remotes/\n\t\tname = refName.replace(remoteBranchesPrefixRegex, '');\n\t} else {\n\t\t// Strip off refs/heads/\n\t\tname = refName.replace(localBranchesPrefixRegex, '');\n\t}\n\n\treturn { name: name, remote: remote };\n}\n\nexport async function getLocalBranchByUpstream(\n\tremoteBranchName: string,\n\tbranches: PageableResult<GitBranch> | ReadonlyMap<unknown, GitBranch>,\n): Promise<GitBranch | undefined> {\n\tlet qualifiedRemoteBranchName;\n\tif (remoteBranchName.startsWith('remotes/')) {\n\t\tqualifiedRemoteBranchName = remoteBranchName;\n\t\tremoteBranchName = remoteBranchName.substring(8);\n\t} else {\n\t\tqualifiedRemoteBranchName = `remotes/${remoteBranchName}`;\n\t}\n\n\tfunction matches(branch: GitBranch): boolean {\n\t\treturn (\n\t\t\t!branch.remote &&\n\t\t\tbranch.upstream?.name != null &&\n\t\t\t(branch.upstream.name === remoteBranchName || branch.upstream.name === qualifiedRemoteBranchName!)\n\t\t);\n\t}\n\n\tconst values = branches.values();\n\tif (Symbol.asyncIterator in values) {\n\t\tfor await (const branch of values) {\n\t\t\tif (matches(branch)) return branch;\n\t\t}\n\t} else {\n\t\tfor (const branch of values) {\n\t\t\tif (matches(branch)) return branch;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\nexport async function getLocalBranchUpstreamNames(branches: PageableResult<GitBranch>): Promise<Set<string>> {\n\tconst remoteBranches = new Set<string>();\n\n\tfor await (const branch of branches.values()) {\n\t\tif (!branch.remote && branch.upstream?.name != null) {\n\t\t\tremoteBranches.add(branch.upstream.name);\n\t\t}\n\t}\n\n\treturn remoteBranches;\n}\n\nconst trackingStateRegex = /(?:\\[(?:ahead ([0-9]+))?[,\\s]*(?:behind ([0-9]+))?]|\\[(gone)])/;\n\n/**\n * @param remote - `%(upstream:remotename)`; `.` is a local upstream, and empty means git reported none. A reported\n * remote always wins, even when a custom fetch refspec puts its branches under `refs/heads/`; only when none was\n * reported (git < 2.23) is an upstream under `refs/heads/` taken as local\n * @param remoteRef - `%(upstream:remoteref)`; the upstream's ref on `remote`, read as its branch name\n */\nexport function parseUpstream(\n\tupstream: string,\n\ttracking: string,\n\tremote?: string,\n\tremoteRef?: string,\n): GitTrackingUpstream | undefined {\n\tif (!upstream) return undefined;\n\n\tconst { name } = parseRefName(upstream);\n\tconst local = remote ? remote === '.' : upstream.startsWith('refs/heads/');\n\tconst localProp = local ? { local: true } : undefined;\n\tconst remoteProp =\n\t\tremote && remote !== '.'\n\t\t\t? { remote: remote, ...(remoteRef ? { remoteBranch: remoteRef.replace(/^refs\\/heads\\//, '') } : undefined) }\n\t\t\t: undefined;\n\n\tconst match = trackingStateRegex.exec(tracking);\n\tif (match == null) {\n\t\treturn { name: name, missing: false, state: { ahead: 0, behind: 0 }, ...remoteProp, ...localProp };\n\t}\n\n\tconst ahead = match[1] == null ? 0 : Number(match[1]);\n\tconst behind = match[2] == null ? 0 : Number(match[2]);\n\n\treturn {\n\t\tname: name,\n\t\tmissing: match[3] != null,\n\t\tstate: { ahead: isNaN(ahead) ? 0 : ahead, behind: isNaN(behind) ? 0 : behind },\n\t\t...remoteProp,\n\t\t...localProp,\n\t};\n}\n\nconst branchMetadataGkConfigKeyRegex =\n\t/^branch\\.(.+)\\.(gk-(?:last-accessed|last-modified|agent-last-activity|disposition))$/;\n\n/** Splits a `branch.<name>.<key>` gk config key that a branch's {@link BranchMetadata} is read from, or `undefined` for any other key */\nexport function parseBranchMetadataGkConfigKey(\n\tkey: string,\n): { branch: string; key: BranchMetadataGkConfigKey } | undefined {\n\tconst match = branchMetadataGkConfigKeyRegex.exec(key);\n\tif (match == null) return undefined;\n\n\treturn { branch: match[1], key: match[2] as BranchMetadataGkConfigKey };\n}\n\n/** Sets the field `key` is read into to `value`, or removes it for `undefined`, exactly as a fresh read of the key would */\nexport function setBranchMetadataValue(\n\tmetadata: BranchMetadata,\n\tkey: BranchMetadataGkConfigKey,\n\tvalue: string | undefined,\n): void {\n\tswitch (key) {\n\t\tcase 'gk-last-accessed':\n\t\t\tif (value != null) {\n\t\t\t\tmetadata.lastAccessedAt = value;\n\t\t\t} else {\n\t\t\t\tdelete metadata.lastAccessedAt;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'gk-last-modified':\n\t\t\tif (value != null) {\n\t\t\t\tmetadata.lastModifiedAt = value;\n\t\t\t} else {\n\t\t\t\tdelete metadata.lastModifiedAt;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'gk-agent-last-activity':\n\t\t\tif (value != null) {\n\t\t\t\tmetadata.agentLastActivityAt = value;\n\t\t\t} else {\n\t\t\t\tdelete metadata.agentLastActivityAt;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'gk-disposition':\n\t\t\tif (value === 'starred' || value === 'archived') {\n\t\t\t\tmetadata.disposition = value;\n\t\t\t} else {\n\t\t\t\tdelete metadata.disposition;\n\t\t\t}\n\t\t\tbreak;\n\t}\n}\n\nconst mergeFastForwardRegex = /^merge .+: Fast-forward$/;\nconst pullFastForwardRegex = /^pull\\b.*: Fast-forward$/;\nconst rebaseFinishRegex = /^(?:rebase|pull)\\b.* \\(finish\\): .* onto ([0-9a-f]+)$/;\nconst branchCreatedRegex = /^branch: Created from (.+)$/;\n\n/**\n * Classifies whether a local branch's own reflog shows work authored on it. A branch that is 0 commits ahead\n * of its merge target is either brand new (nothing merged) or had its work fast-forward merged, and only the\n * reflog tells them apart. Exclusion-based: any entry other than a known no-work move (creation, reset, rename,\n * fast-forward, fetch, clone, or a rebase that replayed nothing) counts as work.\n *\n * - `work`: the branch has its own work, so it was genuinely merged\n * - `none`: the branch was created here and never had work, so it's just fresh\n * - `unknown`: can't tell (empty or expired reflog, or created from the same-named remote branch)\n *\n * @param entries the branch's reflog, newest first\n */\nexport function getBranchReflogWork(\n\tentries: readonly GitReflogEntry[],\n\tbranchName: string,\n): 'work' | 'none' | 'unknown' {\n\tlet createdFrom: string | undefined;\n\n\tfor (const entry of entries) {\n\t\tconst { message } = entry;\n\n\t\tconst created = branchCreatedRegex.exec(message);\n\t\tif (created != null) {\n\t\t\tcreatedFrom = created[1];\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (\n\t\t\tmessage.startsWith('branch: Reset to ') ||\n\t\t\tmessage.startsWith('Branch: renamed ') ||\n\t\t\tmessage.startsWith('reset: moving to ') ||\n\t\t\tmergeFastForwardRegex.test(message) ||\n\t\t\tpullFastForwardRegex.test(message) ||\n\t\t\tmessage.startsWith('fetch') ||\n\t\t\tmessage.startsWith('clone: ')\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// A rebase that finishes onto the entry's own sha replayed nothing\n\t\tconst finished = rebaseFinishRegex.exec(message);\n\t\tif (finished != null && finished[1] === entry.sha) continue;\n\n\t\treturn 'work';\n\t}\n\n\tif (createdFrom == null) return 'unknown';\n\n\t// Strip an optional `refs/remotes/`, then see if what's left is `<remote>/<branchName>` (remote has no `/`)\n\tconst source = createdFrom.startsWith('refs/remotes/')\n\t\t? createdFrom.substring('refs/remotes/'.length)\n\t\t: createdFrom;\n\tconst slash = source.indexOf('/');\n\tif (slash > 0 && source.substring(slash + 1) === branchName) return 'unknown';\n\n\treturn 'none';\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAM,oBAAoB;AAE1B,SAAgB,uBAAuB,KAAqB;CAC3D,OAAO,IAAI,gBAAgB,GAAG,EAAE;AACjC;AAEA,SAAgB,uBAAuB,KAAqE;CAC3G,IAAI,IAAI,QAAQ;EACf,MAAM,QAAQ,wBAAwB,IAAI,IAAI;EAC9C,IAAI,UAAU,IAAI,OAAO,CAAC,IAAI,MAAM,KAAA,CAAS;EAE7C,OAAO,CAAC,IAAI,KAAK,UAAU,QAAQ,CAAC,GAAG,IAAI,KAAK,UAAU,GAAG,KAAK,CAAC;CACp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andedPullRequestCandidate {
|
|
4
|
+
readonly pullRequest: Pick<PullRequestShape, 'id' | 'url' | 'title' | 'state' | 'refs'>;
|
|
5
|
+
/**
|
|
6
|
+
* Commits on the branch that are in neither this pull request's head nor the merge target, when known. Only read
|
|
7
|
+
* for a merged pull request whose head isn't the tip; leaving it `undefined` leaves that pull request undecided.
|
|
8
|
+
*/
|
|
9
|
+
readonly newCommits?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface BranchLandedState {
|
|
12
|
+
/** An open pull request's head is the tip, so the branch is live and nothing landed, whatever git evidence says */
|
|
13
|
+
live?: true;
|
|
14
|
+
landed?: {
|
|
15
|
+
via: 'pr';
|
|
16
|
+
confidence: 'highest';
|
|
17
|
+
/** `id` is the pull request's display number where its url names one */
|
|
18
|
+
pullRequest: {
|
|
19
|
+
id: string;
|
|
20
|
+
url: string;
|
|
21
|
+
title?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/** The pull request merged, but the branch has commits it didn't carry — so the branch itself hasn't landed */
|
|
25
|
+
successor?: {
|
|
26
|
+
pullRequest: {
|
|
27
|
+
id: string;
|
|
28
|
+
url: string;
|
|
29
|
+
};
|
|
30
|
+
newCommits: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* What a branch's pull requests say about whether its work landed. The head sha decides, never recency:
|
|
35
|
+
* - an open pull request whose head is the tip is live (`live`), so nothing landed
|
|
36
|
+
* - a merged pull request whose head is the tip landed
|
|
37
|
+
* - else the merged pull request with the fewest new commits (the first on a tie): none → landed, some → successor
|
|
38
|
+
*
|
|
39
|
+
* A pull request without a head sha (some non-GitHub hosts) never decides, so git evidence can.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getBranchLandedState(tipSha: string | undefined, candidates: readonly BranchLandedPullRequestCandidate[]): BranchLandedState;
|
|
42
|
+
//#endregion
|
|
43
|
+
//# sourceMappingURL=branchLanded.utils.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { getPullRequestNumberFromUrl } from "./pullRequest.utils.js";
|
|
2
|
+
//#region ../git/src/utils/branchLanded.utils.ts
|
|
3
|
+
/**
|
|
4
|
+
* What a branch's pull requests say about whether its work landed. The head sha decides, never recency:
|
|
5
|
+
* - an open pull request whose head is the tip is live (`live`), so nothing landed
|
|
6
|
+
* - a merged pull request whose head is the tip landed
|
|
7
|
+
* - else the merged pull request with the fewest new commits (the first on a tie): none → landed, some → successor
|
|
8
|
+
*
|
|
9
|
+
* A pull request without a head sha (some non-GitHub hosts) never decides, so git evidence can.
|
|
10
|
+
*/
|
|
11
|
+
function getBranchLandedState(tipSha, candidates) {
|
|
12
|
+
if (!tipSha) return {};
|
|
13
|
+
let atTip;
|
|
14
|
+
let best;
|
|
15
|
+
for (const candidate of candidates) {
|
|
16
|
+
const { state, refs } = candidate.pullRequest;
|
|
17
|
+
const headSha = refs?.head?.sha;
|
|
18
|
+
if (!headSha) continue;
|
|
19
|
+
if (headSha === tipSha) {
|
|
20
|
+
if (state === "opened") return { live: true };
|
|
21
|
+
if (state === "merged") atTip ??= candidate;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (state !== "merged" || candidate.newCommits == null) continue;
|
|
25
|
+
if (best?.newCommits == null || candidate.newCommits < best.newCommits) best = candidate;
|
|
26
|
+
}
|
|
27
|
+
if (atTip != null) return { landed: toLanded(atTip.pullRequest) };
|
|
28
|
+
if (best?.newCommits == null) return {};
|
|
29
|
+
if (best.newCommits === 0) return { landed: toLanded(best.pullRequest) };
|
|
30
|
+
const { id, url } = toLandedPullRequest(best.pullRequest);
|
|
31
|
+
return { successor: {
|
|
32
|
+
pullRequest: {
|
|
33
|
+
id,
|
|
34
|
+
url
|
|
35
|
+
},
|
|
36
|
+
newCommits: best.newCommits
|
|
37
|
+
} };
|
|
38
|
+
}
|
|
39
|
+
function toLanded(pr) {
|
|
40
|
+
return {
|
|
41
|
+
via: "pr",
|
|
42
|
+
confidence: "highest",
|
|
43
|
+
pullRequest: toLandedPullRequest(pr)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function toLandedPullRequest(pr) {
|
|
47
|
+
return {
|
|
48
|
+
id: getPullRequestNumberFromUrl(pr.url) ?? pr.id,
|
|
49
|
+
url: pr.url,
|
|
50
|
+
title: pr.title
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { getBranchLandedState };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=branchLanded.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branchLanded.utils.js","names":[],"sources":["../../../../git/src/utils/branchLanded.utils.ts"],"sourcesContent":["import type { PullRequestShape } from '../models/pullRequest.js';\nimport { getPullRequestNumberFromUrl } from './pullRequest.utils.js';\n\nexport interface BranchLandedPullRequestCandidate {\n\treadonly pullRequest: Pick<PullRequestShape, 'id' | 'url' | 'title' | 'state' | 'refs'>;\n\t/**\n\t * Commits on the branch that are in neither this pull request's head nor the merge target, when known. Only read\n\t * for a merged pull request whose head isn't the tip; leaving it `undefined` leaves that pull request undecided.\n\t */\n\treadonly newCommits?: number;\n}\n\nexport interface BranchLandedState {\n\t/** An open pull request's head is the tip, so the branch is live and nothing landed, whatever git evidence says */\n\tlive?: true;\n\tlanded?: {\n\t\tvia: 'pr';\n\t\tconfidence: 'highest';\n\t\t/** `id` is the pull request's display number where its url names one */\n\t\tpullRequest: { id: string; url: string; title?: string };\n\t};\n\t/** The pull request merged, but the branch has commits it didn't carry — so the branch itself hasn't landed */\n\tsuccessor?: { pullRequest: { id: string; url: string }; newCommits: number };\n}\n\n/**\n * What a branch's pull requests say about whether its work landed. The head sha decides, never recency:\n * - an open pull request whose head is the tip is live (`live`), so nothing landed\n * - a merged pull request whose head is the tip landed\n * - else the merged pull request with the fewest new commits (the first on a tie): none → landed, some → successor\n *\n * A pull request without a head sha (some non-GitHub hosts) never decides, so git evidence can.\n */\nexport function getBranchLandedState(\n\ttipSha: string | undefined,\n\tcandidates: readonly BranchLandedPullRequestCandidate[],\n): BranchLandedState {\n\tif (!tipSha) return {};\n\n\tlet atTip: BranchLandedPullRequestCandidate | undefined;\n\tlet best: BranchLandedPullRequestCandidate | undefined;\n\tfor (const candidate of candidates) {\n\t\tconst { state, refs } = candidate.pullRequest;\n\t\tconst headSha = refs?.head?.sha;\n\t\tif (!headSha) continue;\n\n\t\tif (headSha === tipSha) {\n\t\t\tif (state === 'opened') return { live: true };\n\n\t\t\tif (state === 'merged') {\n\t\t\t\tatTip ??= candidate;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (state !== 'merged' || candidate.newCommits == null) continue;\n\n\t\tif (best?.newCommits == null || candidate.newCommits < best.newCommits) {\n\t\t\tbest = candidate;\n\t\t}\n\t}\n\n\tif (atTip != null) return { landed: toLanded(atTip.pullRequest) };\n\tif (best?.newCommits == null) return {};\n\tif (best.newCommits === 0) return { landed: toLanded(best.pullRequest) };\n\n\tconst { id, url } = toLandedPullRequest(best.pullRequest);\n\treturn {\n\t\tsuccessor: {\n\t\t\tpullRequest: { id: id, url: url },\n\t\t\tnewCommits: best.newCommits,\n\t\t},\n\t};\n}\n\nfunction toLanded(pr: BranchLandedPullRequestCandidate['pullRequest']): NonNullable<BranchLandedState['landed']> {\n\treturn {\n\t\tvia: 'pr',\n\t\tconfidence: 'highest',\n\t\tpullRequest: toLandedPullRequest(pr),\n\t};\n}\n\nfunction toLandedPullRequest(pr: BranchLandedPullRequestCandidate['pullRequest']): {\n\tid: string;\n\turl: string;\n\ttitle?: string;\n} {\n\treturn {\n\t\tid: getPullRequestNumberFromUrl(pr.url) ?? pr.id,\n\t\turl: pr.url,\n\t\ttitle: pr.title,\n\t};\n}\n"],"mappings":";;;;;;;;;;AAiCA,SAAgB,qBACf,QACA,YACoB;CACpB,IAAI,CAAC,QAAQ,OAAO,CAAC;CAErB,IAAI;CACJ,IAAI;CACJ,KAAK,MAAM,aAAa,YAAY;EACnC,MAAM,EAAE,OAAO,SAAS,UAAU;EAClC,MAAM,UAAU,MAAM,MAAM;EAC5B,IAAI,CAAC,SAAS;EAEd,IAAI,YAAY,QAAQ;GACvB,IAAI,UAAU,UAAU,OAAO,EAAE,MAAM,KAAK;GAE5C,IAAI,UAAU,UACb,UAAU;GAEX;EACD;EAEA,IAAI,UAAU,YAAY,UAAU,cAAc,MAAM;EAExD,IAAI,MAAM,cAAc,QAAQ,UAAU,aAAa,KAAK,YAC3D,OAAO;CAET;CAEA,IAAI,SAAS,MAAM,OAAO,EAAE,QAAQ,SAAS,MAAM,WAAW,EAAE;CAChE,IAAI,MAAM,cAAc,MAAM,OAAO,CAAC;CACtC,IAAI,KAAK,eAAe,GAAG,OAAO,EAAE,QAAQ,SAAS,KAAK,WAAW,EAAE;CAEvE,MAAM,EAAE,IAAI,QAAQ,oBAAoB,KAAK,WAAW;CACxD,OAAO,EACN,WAAW;EACV,aAAa;GAAM;GAAS;EAAI;EAChC,YAAY,KAAK;CAClB,EACD;AACD;AAEA,SAAS,SAAS,IAA+F;CAChH,OAAO;EACN,KAAK;EACL,YAAY;EACZ,aAAa,oBAAoB,EAAE;CACpC;AACD;AAEA,SAAS,oBAAoB,IAI3B;CACD,OAAO;EACN,IAAI,4BAA4B,GAAG,GAAG,KAAK,GAAG;EAC9C,KAAK,GAAG;EACR,OAAO,GAAG;CACX;AACD"}
|
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
//#region ../plus/ai/src/models/model.ts
|
|
2
2
|
const openAIModels = (provider) => [
|
|
3
|
+
{
|
|
4
|
+
id: "gpt-6.1-sol",
|
|
5
|
+
name: "GPT-6.1 Sol",
|
|
6
|
+
maxTokens: {
|
|
7
|
+
input: 922e3,
|
|
8
|
+
output: 128e3
|
|
9
|
+
},
|
|
10
|
+
provider,
|
|
11
|
+
temperature: null
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: "gpt-6.1-terra",
|
|
15
|
+
name: "GPT-6.1 Terra",
|
|
16
|
+
maxTokens: {
|
|
17
|
+
input: 922e3,
|
|
18
|
+
output: 128e3
|
|
19
|
+
},
|
|
20
|
+
provider,
|
|
21
|
+
temperature: null
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "gpt-6-astra",
|
|
25
|
+
name: "GPT-6 Astra",
|
|
26
|
+
maxTokens: {
|
|
27
|
+
input: 922e3,
|
|
28
|
+
output: 128e3
|
|
29
|
+
},
|
|
30
|
+
provider,
|
|
31
|
+
temperature: null
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "gpt-6-sol",
|
|
35
|
+
name: "GPT-6 Sol",
|
|
36
|
+
maxTokens: {
|
|
37
|
+
input: 922e3,
|
|
38
|
+
output: 128e3
|
|
39
|
+
},
|
|
40
|
+
provider,
|
|
41
|
+
temperature: null
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "gpt-6-luna",
|
|
45
|
+
name: "GPT-6 Luna",
|
|
46
|
+
maxTokens: {
|
|
47
|
+
input: 922e3,
|
|
48
|
+
output: 128e3
|
|
49
|
+
},
|
|
50
|
+
provider,
|
|
51
|
+
temperature: null
|
|
52
|
+
},
|
|
3
53
|
{
|
|
4
54
|
id: "gpt-5.6",
|
|
5
55
|
name: "GPT-5.6 Sol",
|
|
@@ -45,7 +95,8 @@ const openAIModels = (provider) => [
|
|
|
45
95
|
input: 922e3,
|
|
46
96
|
output: 128e3
|
|
47
97
|
},
|
|
48
|
-
provider
|
|
98
|
+
provider,
|
|
99
|
+
hidden: true
|
|
49
100
|
},
|
|
50
101
|
{
|
|
51
102
|
id: "gpt-5.5-pro",
|
|
@@ -64,7 +115,8 @@ const openAIModels = (provider) => [
|
|
|
64
115
|
input: 922e3,
|
|
65
116
|
output: 128e3
|
|
66
117
|
},
|
|
67
|
-
provider
|
|
118
|
+
provider,
|
|
119
|
+
hidden: true
|
|
68
120
|
},
|
|
69
121
|
{
|
|
70
122
|
id: "gpt-5.4-mini",
|
|
@@ -73,7 +125,8 @@ const openAIModels = (provider) => [
|
|
|
73
125
|
input: 272e3,
|
|
74
126
|
output: 128e3
|
|
75
127
|
},
|
|
76
|
-
provider
|
|
128
|
+
provider,
|
|
129
|
+
hidden: true
|
|
77
130
|
},
|
|
78
131
|
{
|
|
79
132
|
id: "gpt-5.4-nano",
|
|
@@ -82,7 +135,8 @@ const openAIModels = (provider) => [
|
|
|
82
135
|
input: 272e3,
|
|
83
136
|
output: 128e3
|
|
84
137
|
},
|
|
85
|
-
provider
|
|
138
|
+
provider,
|
|
139
|
+
hidden: true
|
|
86
140
|
},
|
|
87
141
|
{
|
|
88
142
|
id: "gpt-5.3-codex",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","names":[],"sources":["../../../../../plus/ai/src/models/model.ts"],"sourcesContent":["import type { AIPrimaryProviders, AIProviders, OpenAIProviders } from '../constants.js';\n\nexport interface AIModel<Provider extends AIProviders = AIProviders, Model extends string = string> {\n\treadonly id: Model;\n\treadonly name: string;\n\treadonly maxTokens: { readonly input: number; readonly output: number | undefined };\n\treadonly provider: {\n\t\treadonly id: Provider;\n\t\treadonly name: string;\n\t};\n\n\treadonly default?: boolean;\n\treadonly hidden?: boolean;\n\n\treadonly temperature?: number | null;\n\n\treadonly consumptionRateLabel?: string;\n\n\t/** Whether the model supports native structured output (JSON schema); absent means capable\n\t * (new models default on). Populated by dynamic catalogs (GitKraken, OpenRouter) and set to\n\t * false on legacy static-registry entries; provider-wide gaps override the provider hook */\n\treadonly supportsStructuredOutputs?: boolean;\n}\n\nexport interface AIModelDescriptor<Provider extends AIProviders = AIProviders, Model extends string = string> {\n\treadonly provider: Provider;\n\treadonly model: Model;\n}\n\nexport type AIActionType =\n\t| 'explain-changes'\n\t| 'review-changes'\n\t| 'review-orient'\n\t| 'generate-commitMessage'\n\t| 'generate-stashMessage'\n\t| 'generate-changelog'\n\t| `generate-create-${'cloudPatch' | 'pullRequest'}`\n\t| 'generate-commits'\n\t| 'conflict-resolution'\n\t| 'generate-searchQuery';\n\nexport interface AIProviderDescriptor<T extends AIProviders = AIProviders> {\n\treadonly id: T;\n\treadonly name: string;\n\treadonly primary: T extends AIPrimaryProviders ? true : false;\n\treadonly requiresAccount: boolean;\n\treadonly requiresUserKey: boolean;\n\n\treadonly type?: never;\n}\n\nexport interface AIProviderDescriptorWithConfiguration<\n\tT extends AIProviders = AIProviders,\n> extends AIProviderDescriptor<T> {\n\treadonly configured: boolean;\n}\n\nexport const openAIModels = <T extends OpenAIProviders>(provider: AIProviderDescriptor<T>): AIModel<T>[] => [\n\t{\n\t\tid: 'gpt-5.6',\n\t\tname: 'GPT-5.6 Sol',\n\t\tmaxTokens: { input: 922000, output: 128000 }, // 1.05M context, but OpenAI caps input at 922k\n\t\tprovider: provider,\n\t},\n\t{\n\t\tid: 'gpt-5.6-sol',\n\t\tname: 'GPT-5.6 Sol',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.6-terra',\n\t\tname: 'GPT-5.6 Terra',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t},\n\t{\n\t\tid: 'gpt-5.6-luna',\n\t\tname: 'GPT-5.6 Luna',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\tdefault: true,\n\t},\n\t{\n\t\tid: 'gpt-5.5',\n\t\tname: 'GPT-5.5',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t},\n\t{\n\t\tid: 'gpt-5.5-pro',\n\t\tname: 'GPT-5.5 Pro',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.4',\n\t\tname: 'GPT-5.4',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t},\n\t{\n\t\tid: 'gpt-5.4-mini',\n\t\tname: 'GPT-5.4 mini',\n\t\tmaxTokens: { input: 272000, output: 128000 },\n\t\tprovider: provider,\n\t},\n\t{\n\t\tid: 'gpt-5.4-nano',\n\t\tname: 'GPT-5.4 nano',\n\t\tmaxTokens: { input: 272000, output: 128000 },\n\t\tprovider: provider,\n\t},\n\t{\n\t\tid: 'gpt-5.3-codex',\n\t\tname: 'GPT-5.3 Codex',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.2',\n\t\tname: 'GPT-5.2',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.2-2025-12-11',\n\t\tname: 'GPT-5.2 (2025-12-11)',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.1',\n\t\tname: 'GPT-5.1',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.1-2025-11-13',\n\t\tname: 'GPT-5.1 (2025-11-13)',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5',\n\t\tname: 'GPT-5',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-2025-08-07',\n\t\tname: 'GPT-5 (2025-08-07)',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-mini',\n\t\tname: 'GPT-5 mini',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-mini-2025-08-07',\n\t\tname: 'GPT-5 mini (2025-08-07)',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-nano',\n\t\tname: 'GPT-5 nano',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-nano-2025-08-07',\n\t\tname: 'GPT-5 nano (2025-08-07)',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-pro',\n\t\tname: 'GPT-5 Pro',\n\t\tmaxTokens: { input: 400000, output: 272000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-pro-2025-10-06',\n\t\tname: 'GPT-5 Pro (2025-10-06)',\n\t\tmaxTokens: { input: 400000, output: 272000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1',\n\t\tname: 'GPT-4.1',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1-2025-04-14',\n\t\tname: 'GPT-4.1 (2025-04-14)',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1-mini',\n\t\tname: 'GPT-4.1 mini',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1-mini-2025-04-14',\n\t\tname: 'GPT-4.1 mini (2025-04-14)',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1-nano',\n\t\tname: 'GPT-4.1 nano',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1-nano-2025-04-14',\n\t\tname: 'GPT-4.1 nano (2025-04-14)',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o4-mini',\n\t\tname: 'o4 mini',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o4-mini-2025-04-16',\n\t\tname: 'o4 mini (2025-04-16)',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-deep-research',\n\t\tname: 'o3 Deep Research',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-deep-research-2025-06-26',\n\t\tname: 'o3 Deep Research (2025-06-26)',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3',\n\t\tname: 'o3',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-2025-04-16',\n\t\tname: 'o3 (2025-04-16)',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-pro',\n\t\tname: 'o3 Pro',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-mini',\n\t\tname: 'o3 mini',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-mini-2025-01-31',\n\t\tname: 'o3 mini (2025-01-31)',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o1',\n\t\tname: 'o1',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o1-2024-12-17',\n\t\tname: 'o1 (2024-12-17)',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o1-preview',\n\t\tname: 'o1 preview',\n\t\tmaxTokens: { input: 128000, output: 32768 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'o1-preview-2024-09-12',\n\t\tname: 'o1 preview (2024-09-12)',\n\t\tmaxTokens: { input: 128000, output: 32768 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'o1-mini',\n\t\tname: 'o1 mini',\n\t\tmaxTokens: { input: 128000, output: 65536 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'o1-mini-2024-09-12',\n\t\tname: 'o1 mini (2024-09-12)',\n\t\tmaxTokens: { input: 128000, output: 65536 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4o',\n\t\tname: 'GPT-4o',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4o-2024-11-20',\n\t\tname: 'GPT-4o (2024-11-20)',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4o-2024-08-06',\n\t\tname: 'GPT-4o (2024-08-06)',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4o-2024-05-13',\n\t\tname: 'GPT-4o (2024-05-13)',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\t// json_schema needs gpt-4o-2024-08-06+ (or o1+); the flagged legacy ids reject it with a 400\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'chatgpt-4o-latest',\n\t\tname: 'GPT-4o',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4o-mini',\n\t\tname: 'GPT-4o mini',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4o-mini-2024-07-18',\n\t\tname: 'GPT-4o mini (2024-07-18)',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4-turbo',\n\t\tname: 'GPT-4 Turbo',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-turbo-2024-04-09',\n\t\tname: 'GPT-4 Turbo preview (2024-04-09)',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-turbo-preview',\n\t\tname: 'GPT-4 Turbo preview',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-0125-preview',\n\t\tname: 'GPT-4 0125 preview',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-1106-preview',\n\t\tname: 'GPT-4 1106 preview',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4',\n\t\tname: 'GPT-4',\n\t\tmaxTokens: { input: 8192, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-0613',\n\t\tname: 'GPT-4 0613',\n\t\tmaxTokens: { input: 8192, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-32k',\n\t\tname: 'GPT-4 32k',\n\t\tmaxTokens: { input: 32768, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-32k-0613',\n\t\tname: 'GPT-4 32k 0613',\n\t\tmaxTokens: { input: 32768, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-3.5-turbo',\n\t\tname: 'GPT-3.5 Turbo',\n\t\tmaxTokens: { input: 16385, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-3.5-turbo-0125',\n\t\tname: 'GPT-3.5 Turbo 0125',\n\t\tmaxTokens: { input: 16385, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-3.5-turbo-1106',\n\t\tname: 'GPT-3.5 Turbo 1106',\n\t\tmaxTokens: { input: 16385, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-3.5-turbo-16k',\n\t\tname: 'GPT-3.5 Turbo 16k',\n\t\tmaxTokens: { input: 16385, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n];\n"],"mappings":";AAyDA,MAAa,gBAA2C,aAAoD;CAC3G;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAQ,QAAQ;EAAO;EACjC;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAQ,QAAQ;EAAO;EACjC;EACV,QAAQ;CACT;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAQ,QAAQ;EAAO;EACjC;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAQ,QAAQ;EAAO;EACjC;EACV,SAAS;CACV;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAQ,QAAQ;EAAO;EACjC;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAQ,QAAQ;EAAO;EACjC;EACV,QAAQ;CACT;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAQ,QAAQ;EAAO;EACjC;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAQ,QAAQ;EAAO;EACjC;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAQ,QAAQ;EAAO;EACjC;CACX;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAQ,QAAQ;EAAO;EACjC;EACV,QAAQ;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;GAAE,OAAO;GAAO,QAAQ;EAAK;EAC9B;EACV,QAAQ;EACR,2BAA2B;CAC5B;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAO,QAAQ;EAAK;EAC9B;EACV,QAAQ;EACR,2BAA2B;CAC5B;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAO,QAAQ;EAAK;EAC9B;EACV,QAAQ;EACR,2BAA2B;CAC5B;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAO,QAAQ;EAAK;EAC9B;EACV,QAAQ;EACR,2BAA2B;CAC5B;CACA;EACC,IAAI;EACJ,MAAM;EACN,WAAW;GAAE,OAAO;GAAO,QAAQ;EAAK;EAC9B;EACV,QAAQ;EACR,2BAA2B;CAC5B;AACD"}
|
|
1
|
+
{"version":3,"file":"model.js","names":[],"sources":["../../../../../plus/ai/src/models/model.ts"],"sourcesContent":["import type { AIPrimaryProviders, AIProviders, OpenAIProviders } from '../constants.js';\n\nexport interface AIModel<Provider extends AIProviders = AIProviders, Model extends string = string> {\n\treadonly id: Model;\n\treadonly name: string;\n\treadonly maxTokens: { readonly input: number; readonly output: number | undefined };\n\treadonly provider: {\n\t\treadonly id: Provider;\n\t\treadonly name: string;\n\t};\n\n\treadonly default?: boolean;\n\treadonly hidden?: boolean;\n\n\treadonly temperature?: number | null;\n\n\treadonly consumptionRateLabel?: string;\n\n\t/** Whether the model supports native structured output (JSON schema); absent means capable\n\t * (new models default on). Populated by dynamic catalogs (GitKraken, OpenRouter) and set to\n\t * false on legacy static-registry entries; provider-wide gaps override the provider hook */\n\treadonly supportsStructuredOutputs?: boolean;\n}\n\nexport interface AIModelDescriptor<Provider extends AIProviders = AIProviders, Model extends string = string> {\n\treadonly provider: Provider;\n\treadonly model: Model;\n}\n\nexport type AIActionType =\n\t| 'explain-changes'\n\t| 'review-changes'\n\t| 'review-orient'\n\t| 'generate-commitMessage'\n\t| 'generate-stashMessage'\n\t| 'generate-changelog'\n\t| `generate-create-${'cloudPatch' | 'pullRequest'}`\n\t| 'generate-commits'\n\t| 'conflict-resolution'\n\t| 'generate-searchQuery';\n\nexport interface AIProviderDescriptor<T extends AIProviders = AIProviders> {\n\treadonly id: T;\n\treadonly name: string;\n\treadonly primary: T extends AIPrimaryProviders ? true : false;\n\treadonly requiresAccount: boolean;\n\treadonly requiresUserKey: boolean;\n\n\treadonly type?: never;\n}\n\nexport interface AIProviderDescriptorWithConfiguration<\n\tT extends AIProviders = AIProviders,\n> extends AIProviderDescriptor<T> {\n\treadonly configured: boolean;\n}\n\nexport const openAIModels = <T extends OpenAIProviders>(provider: AIProviderDescriptor<T>): AIModel<T>[] => [\n\t{\n\t\tid: 'gpt-6.1-sol',\n\t\tname: 'GPT-6.1 Sol',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\ttemperature: null, // Sends no temperature, like GPT-5 — `getValidatedTemperature`'s `gpt-5` id check doesn't match GPT-6\n\t},\n\t{\n\t\tid: 'gpt-6.1-terra',\n\t\tname: 'GPT-6.1 Terra',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t},\n\t{\n\t\tid: 'gpt-6-astra',\n\t\tname: 'GPT-6 Astra',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t},\n\t{\n\t\tid: 'gpt-6-sol',\n\t\tname: 'GPT-6 Sol',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t},\n\t{\n\t\tid: 'gpt-6-luna',\n\t\tname: 'GPT-6 Luna',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t},\n\t{\n\t\tid: 'gpt-5.6',\n\t\tname: 'GPT-5.6 Sol',\n\t\tmaxTokens: { input: 922000, output: 128000 }, // 1.05M context, but OpenAI caps input at 922k\n\t\tprovider: provider,\n\t},\n\t{\n\t\tid: 'gpt-5.6-sol',\n\t\tname: 'GPT-5.6 Sol',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.6-terra',\n\t\tname: 'GPT-5.6 Terra',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t},\n\t{\n\t\tid: 'gpt-5.6-luna',\n\t\tname: 'GPT-5.6 Luna',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\tdefault: true,\n\t},\n\t{\n\t\tid: 'gpt-5.5',\n\t\tname: 'GPT-5.5',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.5-pro',\n\t\tname: 'GPT-5.5 Pro',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.4',\n\t\tname: 'GPT-5.4',\n\t\tmaxTokens: { input: 922000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.4-mini',\n\t\tname: 'GPT-5.4 mini',\n\t\tmaxTokens: { input: 272000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.4-nano',\n\t\tname: 'GPT-5.4 nano',\n\t\tmaxTokens: { input: 272000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.3-codex',\n\t\tname: 'GPT-5.3 Codex',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.2',\n\t\tname: 'GPT-5.2',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.2-2025-12-11',\n\t\tname: 'GPT-5.2 (2025-12-11)',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.1',\n\t\tname: 'GPT-5.1',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5.1-2025-11-13',\n\t\tname: 'GPT-5.1 (2025-11-13)',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5',\n\t\tname: 'GPT-5',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-2025-08-07',\n\t\tname: 'GPT-5 (2025-08-07)',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-mini',\n\t\tname: 'GPT-5 mini',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-mini-2025-08-07',\n\t\tname: 'GPT-5 mini (2025-08-07)',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-nano',\n\t\tname: 'GPT-5 nano',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-nano-2025-08-07',\n\t\tname: 'GPT-5 nano (2025-08-07)',\n\t\tmaxTokens: { input: 400000, output: 128000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-pro',\n\t\tname: 'GPT-5 Pro',\n\t\tmaxTokens: { input: 400000, output: 272000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-5-pro-2025-10-06',\n\t\tname: 'GPT-5 Pro (2025-10-06)',\n\t\tmaxTokens: { input: 400000, output: 272000 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1',\n\t\tname: 'GPT-4.1',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1-2025-04-14',\n\t\tname: 'GPT-4.1 (2025-04-14)',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1-mini',\n\t\tname: 'GPT-4.1 mini',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1-mini-2025-04-14',\n\t\tname: 'GPT-4.1 mini (2025-04-14)',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1-nano',\n\t\tname: 'GPT-4.1 nano',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4.1-nano-2025-04-14',\n\t\tname: 'GPT-4.1 nano (2025-04-14)',\n\t\tmaxTokens: { input: 1047576, output: 32768 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o4-mini',\n\t\tname: 'o4 mini',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o4-mini-2025-04-16',\n\t\tname: 'o4 mini (2025-04-16)',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-deep-research',\n\t\tname: 'o3 Deep Research',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-deep-research-2025-06-26',\n\t\tname: 'o3 Deep Research (2025-06-26)',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3',\n\t\tname: 'o3',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-2025-04-16',\n\t\tname: 'o3 (2025-04-16)',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-pro',\n\t\tname: 'o3 Pro',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-mini',\n\t\tname: 'o3 mini',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o3-mini-2025-01-31',\n\t\tname: 'o3 mini (2025-01-31)',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o1',\n\t\tname: 'o1',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o1-2024-12-17',\n\t\tname: 'o1 (2024-12-17)',\n\t\tmaxTokens: { input: 200000, output: 100000 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'o1-preview',\n\t\tname: 'o1 preview',\n\t\tmaxTokens: { input: 128000, output: 32768 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'o1-preview-2024-09-12',\n\t\tname: 'o1 preview (2024-09-12)',\n\t\tmaxTokens: { input: 128000, output: 32768 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'o1-mini',\n\t\tname: 'o1 mini',\n\t\tmaxTokens: { input: 128000, output: 65536 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'o1-mini-2024-09-12',\n\t\tname: 'o1 mini (2024-09-12)',\n\t\tmaxTokens: { input: 128000, output: 65536 },\n\t\tprovider: provider,\n\t\ttemperature: null,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4o',\n\t\tname: 'GPT-4o',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4o-2024-11-20',\n\t\tname: 'GPT-4o (2024-11-20)',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4o-2024-08-06',\n\t\tname: 'GPT-4o (2024-08-06)',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4o-2024-05-13',\n\t\tname: 'GPT-4o (2024-05-13)',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\t// json_schema needs gpt-4o-2024-08-06+ (or o1+); the flagged legacy ids reject it with a 400\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'chatgpt-4o-latest',\n\t\tname: 'GPT-4o',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4o-mini',\n\t\tname: 'GPT-4o mini',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4o-mini-2024-07-18',\n\t\tname: 'GPT-4o mini (2024-07-18)',\n\t\tmaxTokens: { input: 128000, output: 16384 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t},\n\t{\n\t\tid: 'gpt-4-turbo',\n\t\tname: 'GPT-4 Turbo',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-turbo-2024-04-09',\n\t\tname: 'GPT-4 Turbo preview (2024-04-09)',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-turbo-preview',\n\t\tname: 'GPT-4 Turbo preview',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-0125-preview',\n\t\tname: 'GPT-4 0125 preview',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-1106-preview',\n\t\tname: 'GPT-4 1106 preview',\n\t\tmaxTokens: { input: 128000, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4',\n\t\tname: 'GPT-4',\n\t\tmaxTokens: { input: 8192, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-0613',\n\t\tname: 'GPT-4 0613',\n\t\tmaxTokens: { input: 8192, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-32k',\n\t\tname: 'GPT-4 32k',\n\t\tmaxTokens: { input: 32768, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-4-32k-0613',\n\t\tname: 'GPT-4 32k 0613',\n\t\tmaxTokens: { input: 32768, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-3.5-turbo',\n\t\tname: 'GPT-3.5 Turbo',\n\t\tmaxTokens: { input: 16385, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-3.5-turbo-0125',\n\t\tname: 'GPT-3.5 Turbo 0125',\n\t\tmaxTokens: { input: 16385, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-3.5-turbo-1106',\n\t\tname: 'GPT-3.5 Turbo 1106',\n\t\tmaxTokens: { input: 16385, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n\t{\n\t\tid: 'gpt-3.5-turbo-16k',\n\t\tname: 'GPT-3.5 Turbo 16k',\n\t\tmaxTokens: { input: 16385, output: 4096 },\n\t\tprovider: provider,\n\t\thidden: true,\n\t\tsupportsStructuredOutputs: false,\n\t},\n];\n"],"mappings":";AAyDA,MAAa,gBAA2C,aAAoD;CAC3G;EACC,IAAI;EACJ,MAAM;EACN,W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