@sourcegraph/cody-web 0.8.1 → 0.8.2
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/dist/{agent.worker-BGToM1eX.mjs → agent.worker-DwbwPMEN.mjs} +2030 -2065
- package/dist/agent.worker.js +2 -2
- package/dist/{browser-D1wtYpbR.mjs → browser-BOPUs1B6.mjs} +164 -154
- package/dist/{git-log-DzEEgPFA.mjs → git-log-I_XFP7Ys.mjs} +2 -2
- package/dist/{index-BC137051.mjs → index-Cn5rZvtV.mjs} +2 -2
- package/dist/index.js +97 -35
- package/dist/{shell-C59BlM8E.mjs → shell-BJpPLvT9.mjs} +3 -4
- package/dist/style.css +3 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/util-xV842Ayw.mjs +0 -28
package/dist/agent.worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./agent.worker-
|
|
2
|
-
import "./browser-
|
|
1
|
+
import "./agent.worker-DwbwPMEN.mjs";
|
|
2
|
+
import "./browser-BOPUs1B6.mjs";
|
|
@@ -14893,6 +14893,9 @@ var ModelTag = /* @__PURE__ */ ((ModelTag2) => {
|
|
|
14893
14893
|
ModelTag2["Recommended"] = "recommended";
|
|
14894
14894
|
ModelTag2["Deprecated"] = "deprecated";
|
|
14895
14895
|
ModelTag2["Experimental"] = "experimental";
|
|
14896
|
+
ModelTag2["Waitlist"] = "waitlist";
|
|
14897
|
+
ModelTag2["OnWaitlist"] = "on-waitlist";
|
|
14898
|
+
ModelTag2["EarlyAccess"] = "early-access";
|
|
14896
14899
|
ModelTag2["Pro"] = "pro";
|
|
14897
14900
|
ModelTag2["Free"] = "free";
|
|
14898
14901
|
ModelTag2["Enterprise"] = "enterprise";
|
|
@@ -14901,6 +14904,7 @@ var ModelTag = /* @__PURE__ */ ((ModelTag2) => {
|
|
|
14901
14904
|
ModelTag2["Local"] = "local";
|
|
14902
14905
|
ModelTag2["Ollama"] = "ollama";
|
|
14903
14906
|
ModelTag2["Dev"] = "dev";
|
|
14907
|
+
ModelTag2["StreamDisabled"] = "stream-disabled";
|
|
14904
14908
|
return ModelTag2;
|
|
14905
14909
|
})(ModelTag || {});
|
|
14906
14910
|
const CHAT_INPUT_TOKEN_BUDGET = 7e3;
|
|
@@ -14933,6 +14937,9 @@ function getModelInfo(modelID) {
|
|
|
14933
14937
|
function isCodyProModel(model) {
|
|
14934
14938
|
return modelHasTag(model, ModelTag.Pro);
|
|
14935
14939
|
}
|
|
14940
|
+
function isWaitlistModel(model) {
|
|
14941
|
+
return modelHasTag(model, ModelTag.Waitlist) || modelHasTag(model, ModelTag.OnWaitlist);
|
|
14942
|
+
}
|
|
14936
14943
|
function isCustomModel(model) {
|
|
14937
14944
|
return modelHasTag(model, ModelTag.Local) || modelHasTag(model, ModelTag.Dev) || modelHasTag(model, ModelTag.BYOK);
|
|
14938
14945
|
}
|
|
@@ -27709,6 +27716,7 @@ const ACCOUNT_USAGE_URL = new URL("https://sourcegraph.com/cody/manage");
|
|
|
27709
27716
|
const ACCOUNT_LIMITS_INFO_URL = new URL(
|
|
27710
27717
|
"https://sourcegraph.com/docs/cody/troubleshooting#autocomplete-rate-limits"
|
|
27711
27718
|
);
|
|
27719
|
+
const CODY_BLOG_URL_o1_WAITLIST = new URL("https://sourcegraph.com/blog/openai-o1-for-cody");
|
|
27712
27720
|
const sourcegraphTokenRegex = /(sgp_(?:[a-fA-F0-9]{16}|local)|sgp_)?[a-fA-F0-9]{40}|(sgd|slk|sgs)_[a-fA-F0-9]{64}/;
|
|
27713
27721
|
function isSourcegraphToken(text) {
|
|
27714
27722
|
return sourcegraphTokenRegex.test(text);
|
|
@@ -31686,7 +31694,7 @@ export {
|
|
|
31686
31694
|
Ei as ay,
|
|
31687
31695
|
xe as az,
|
|
31688
31696
|
ds as b,
|
|
31689
|
-
|
|
31697
|
+
ClientConfigSingleton as b$,
|
|
31690
31698
|
hydrateAfterPostMessage as b0,
|
|
31691
31699
|
isCodyProUser as b1,
|
|
31692
31700
|
CodyIDE as b2,
|
|
@@ -31697,164 +31705,166 @@ export {
|
|
|
31697
31705
|
isError as b7,
|
|
31698
31706
|
RateLimitError as b8,
|
|
31699
31707
|
CODY_FEEDBACK_URL as b9,
|
|
31700
|
-
|
|
31701
|
-
|
|
31702
|
-
|
|
31703
|
-
|
|
31704
|
-
|
|
31705
|
-
|
|
31706
|
-
|
|
31707
|
-
|
|
31708
|
-
|
|
31709
|
-
|
|
31710
|
-
|
|
31711
|
-
|
|
31712
|
-
|
|
31713
|
-
|
|
31714
|
-
|
|
31715
|
-
|
|
31716
|
-
|
|
31717
|
-
|
|
31718
|
-
|
|
31719
|
-
|
|
31720
|
-
|
|
31721
|
-
|
|
31722
|
-
|
|
31723
|
-
|
|
31724
|
-
|
|
31725
|
-
|
|
31726
|
-
|
|
31708
|
+
PromptString as bA,
|
|
31709
|
+
Observable as bB,
|
|
31710
|
+
unsubscribe as bC,
|
|
31711
|
+
AsyncSerialScheduler$1 as bD,
|
|
31712
|
+
fromLateSetSource as bE,
|
|
31713
|
+
shareReplay as bF,
|
|
31714
|
+
map as bG,
|
|
31715
|
+
firstValueFrom as bH,
|
|
31716
|
+
distinctUntilChanged as bI,
|
|
31717
|
+
DOTCOM_URL as bJ,
|
|
31718
|
+
logError as bK,
|
|
31719
|
+
createSubscriber as bL,
|
|
31720
|
+
isDotCom as bM,
|
|
31721
|
+
graphqlClient as bN,
|
|
31722
|
+
fromVSCodeEvent as bO,
|
|
31723
|
+
logDebug as bP,
|
|
31724
|
+
isFileURI as bQ,
|
|
31725
|
+
INCLUDE_EVERYTHING_CONTEXT_FILTERS as bR,
|
|
31726
|
+
EXCLUDE_EVERYTHING_CONTEXT_FILTERS as bS,
|
|
31727
|
+
isAbortError as bT,
|
|
31728
|
+
onAbort as bU,
|
|
31729
|
+
CHAT_OUTPUT_TOKEN_BUDGET as bV,
|
|
31730
|
+
getModelInfo as bW,
|
|
31731
|
+
MulticastSubject as bX,
|
|
31732
|
+
isEnterpriseUser as bY,
|
|
31733
|
+
EXTENDED_CHAT_INPUT_TOKEN_BUDGET as bZ,
|
|
31734
|
+
EXTENDED_USER_CONTEXT_TOKEN_BUDGET as b_,
|
|
31727
31735
|
isDefined as ba,
|
|
31728
31736
|
reformatBotMessageForChat as bb,
|
|
31729
31737
|
isAbortErrorOrSocketHangUp as bc,
|
|
31730
|
-
|
|
31731
|
-
|
|
31732
|
-
|
|
31733
|
-
|
|
31734
|
-
|
|
31735
|
-
|
|
31736
|
-
|
|
31737
|
-
|
|
31738
|
-
|
|
31739
|
-
|
|
31740
|
-
|
|
31741
|
-
|
|
31742
|
-
|
|
31743
|
-
|
|
31744
|
-
|
|
31745
|
-
|
|
31746
|
-
|
|
31747
|
-
|
|
31748
|
-
|
|
31749
|
-
|
|
31750
|
-
|
|
31751
|
-
|
|
31752
|
-
|
|
31738
|
+
ModelTag as bd,
|
|
31739
|
+
isEqual$1 as be,
|
|
31740
|
+
serializedPromptEditorStateFromChatMessage as bf,
|
|
31741
|
+
contextItemsFromPromptEditorValue as bg,
|
|
31742
|
+
filterContextItemsFromPromptEditorValue as bh,
|
|
31743
|
+
pluralize as bi,
|
|
31744
|
+
isCodyProModel as bj,
|
|
31745
|
+
isWaitlistModel as bk,
|
|
31746
|
+
CustomCommandType as bl,
|
|
31747
|
+
isMacOS as bm,
|
|
31748
|
+
textContentFromSerializedLexicalNode as bn,
|
|
31749
|
+
FAST_CHAT_INPUT_TOKEN_BUDGET as bo,
|
|
31750
|
+
inputTextWithoutContextChipsFromPromptEditorState as bp,
|
|
31751
|
+
deserializeContextItem as bq,
|
|
31752
|
+
View as br,
|
|
31753
|
+
truncateTextStart as bs,
|
|
31754
|
+
CHAT_INPUT_TOKEN_BUDGET as bt,
|
|
31755
|
+
ACCOUNT_USAGE_URL as bu,
|
|
31756
|
+
ACCOUNT_UPGRADE_URL as bv,
|
|
31757
|
+
getRelativeChatPeriod as bw,
|
|
31758
|
+
browser as bx,
|
|
31759
|
+
isErrorLike as by,
|
|
31760
|
+
setDisplayPathEnvInfo as bz,
|
|
31753
31761
|
bs as c,
|
|
31754
|
-
|
|
31755
|
-
|
|
31756
|
-
|
|
31757
|
-
|
|
31758
|
-
|
|
31759
|
-
|
|
31760
|
-
|
|
31761
|
-
|
|
31762
|
-
|
|
31763
|
-
|
|
31764
|
-
|
|
31765
|
-
|
|
31766
|
-
|
|
31767
|
-
|
|
31768
|
-
|
|
31769
|
-
|
|
31770
|
-
|
|
31771
|
-
|
|
31772
|
-
|
|
31773
|
-
|
|
31774
|
-
|
|
31775
|
-
|
|
31776
|
-
|
|
31777
|
-
|
|
31778
|
-
|
|
31779
|
-
|
|
31780
|
-
|
|
31781
|
-
|
|
31782
|
-
|
|
31783
|
-
|
|
31784
|
-
|
|
31785
|
-
|
|
31786
|
-
|
|
31787
|
-
|
|
31788
|
-
|
|
31789
|
-
|
|
31790
|
-
|
|
31791
|
-
|
|
31792
|
-
|
|
31793
|
-
|
|
31794
|
-
|
|
31795
|
-
|
|
31796
|
-
|
|
31797
|
-
|
|
31798
|
-
|
|
31799
|
-
|
|
31800
|
-
|
|
31801
|
-
|
|
31802
|
-
|
|
31803
|
-
|
|
31804
|
-
|
|
31805
|
-
|
|
31806
|
-
|
|
31807
|
-
|
|
31808
|
-
|
|
31809
|
-
|
|
31810
|
-
|
|
31811
|
-
|
|
31812
|
-
|
|
31813
|
-
|
|
31814
|
-
|
|
31815
|
-
|
|
31816
|
-
|
|
31817
|
-
|
|
31762
|
+
promiseFactoryToObservable as c$,
|
|
31763
|
+
isCustomModel as c0,
|
|
31764
|
+
recordErrorToSpan as c1,
|
|
31765
|
+
dependentAbortController as c2,
|
|
31766
|
+
addCustomUserAgent as c3,
|
|
31767
|
+
addTraceparent as c4,
|
|
31768
|
+
fetch as c5,
|
|
31769
|
+
verifyResponseCode as c6,
|
|
31770
|
+
openCtx as c7,
|
|
31771
|
+
AsyncSerialScheduler_1 as c8,
|
|
31772
|
+
Utils as c9,
|
|
31773
|
+
SUPPORTED_URI_SCHEMAS as cA,
|
|
31774
|
+
require$$1 as cB,
|
|
31775
|
+
dedupeWith as cC,
|
|
31776
|
+
getEditorInsertSpaces as cD,
|
|
31777
|
+
TimeoutError as cE,
|
|
31778
|
+
isDotComAuthed as cF,
|
|
31779
|
+
getActiveTraceAndSpanId as cG,
|
|
31780
|
+
isNetworkError as cH,
|
|
31781
|
+
currentAuthStatusAuthed as cI,
|
|
31782
|
+
trace as cJ,
|
|
31783
|
+
http as cK,
|
|
31784
|
+
getAugmentedNamespace as cL,
|
|
31785
|
+
main as cM,
|
|
31786
|
+
setUserAgent as cN,
|
|
31787
|
+
TESTING_TELEMETRY_EXPORTER as cO,
|
|
31788
|
+
dist as cP,
|
|
31789
|
+
waitUntilComplete as cQ,
|
|
31790
|
+
isWindows as cR,
|
|
31791
|
+
_root as cS,
|
|
31792
|
+
_baseGetTag as cT,
|
|
31793
|
+
isObjectLike_1 as cU,
|
|
31794
|
+
isObject_1 as cV,
|
|
31795
|
+
DefaultChatCommands as cW,
|
|
31796
|
+
pathFunctionsForURI as cX,
|
|
31797
|
+
uriParseNameAndExtension as cY,
|
|
31798
|
+
uriDirname as cZ,
|
|
31799
|
+
DefaultEditCommands as c_,
|
|
31800
|
+
extensionForLanguage as ca,
|
|
31801
|
+
startWith as cb,
|
|
31802
|
+
isSourcegraphToken as cc,
|
|
31803
|
+
_$1 as cd,
|
|
31804
|
+
toRangeData as ce,
|
|
31805
|
+
requireBase64Js as cf,
|
|
31806
|
+
NetworkError as cg,
|
|
31807
|
+
isRateLimitError as ch,
|
|
31808
|
+
isAuthError as ci,
|
|
31809
|
+
NoOpTelemetryRecorderProvider as cj,
|
|
31810
|
+
TimestampTelemetryProcessor_1 as ck,
|
|
31811
|
+
updateGlobalTelemetryInstances as cl,
|
|
31812
|
+
TelemetryRecorderProvider as cm,
|
|
31813
|
+
telemetryRecorderProvider as cn,
|
|
31814
|
+
createGitDiff as co,
|
|
31815
|
+
currentAuthStatus as cp,
|
|
31816
|
+
semver$1 as cq,
|
|
31817
|
+
setAuthStatusObservable as cr,
|
|
31818
|
+
SourcegraphGraphQLAPIClient as cs,
|
|
31819
|
+
isNetworkLikeError as ct,
|
|
31820
|
+
authStatus as cu,
|
|
31821
|
+
convertGitCloneURLToCodebaseName as cv,
|
|
31822
|
+
subscriptionDisposable as cw,
|
|
31823
|
+
combineLatest as cx,
|
|
31824
|
+
uriExtname as cy,
|
|
31825
|
+
uriBasename as cz,
|
|
31818
31826
|
dedent as d,
|
|
31819
|
-
|
|
31820
|
-
|
|
31821
|
-
|
|
31822
|
-
|
|
31823
|
-
|
|
31824
|
-
|
|
31825
|
-
|
|
31826
|
-
|
|
31827
|
-
|
|
31828
|
-
|
|
31829
|
-
|
|
31830
|
-
|
|
31831
|
-
|
|
31832
|
-
|
|
31833
|
-
|
|
31834
|
-
|
|
31835
|
-
|
|
31836
|
-
|
|
31837
|
-
|
|
31838
|
-
|
|
31839
|
-
|
|
31840
|
-
|
|
31841
|
-
|
|
31842
|
-
|
|
31843
|
-
|
|
31844
|
-
|
|
31845
|
-
|
|
31846
|
-
|
|
31847
|
-
|
|
31848
|
-
|
|
31849
|
-
|
|
31850
|
-
|
|
31851
|
-
|
|
31852
|
-
|
|
31853
|
-
|
|
31854
|
-
|
|
31855
|
-
|
|
31856
|
-
|
|
31857
|
-
|
|
31827
|
+
mentionProvidersMetadata as d0,
|
|
31828
|
+
expandToLineRange as d1,
|
|
31829
|
+
truncateTextNearestLine as d2,
|
|
31830
|
+
TokenCounter as d3,
|
|
31831
|
+
createDisposables as d4,
|
|
31832
|
+
tracer as d5,
|
|
31833
|
+
isContextWindowLimitError as d6,
|
|
31834
|
+
truncatePromptString as d7,
|
|
31835
|
+
addMessageListenersForExtensionAPI as d8,
|
|
31836
|
+
createMessageAPIForExtension as d9,
|
|
31837
|
+
CODY_SUPPORT_URL as dA,
|
|
31838
|
+
SG_CHANGELOG_URL as dB,
|
|
31839
|
+
ACCOUNT_LIMITS_INFO_URL as dC,
|
|
31840
|
+
setLogger as dD,
|
|
31841
|
+
CODY_OLLAMA_DOCS_URL as dE,
|
|
31842
|
+
currentAuthStatusOrNotReadyYet as dF,
|
|
31843
|
+
CODY_BLOG_URL_o1_WAITLIST as da,
|
|
31844
|
+
promiseToObservable as db,
|
|
31845
|
+
CODY_PASSTHROUGH_VSCODE_OPEN_COMMAND_ID as dc,
|
|
31846
|
+
editorStateFromPromptString as dd,
|
|
31847
|
+
getEditorTabSize as de,
|
|
31848
|
+
mergeMap as df,
|
|
31849
|
+
AbortError as dg,
|
|
31850
|
+
psDedent as dh,
|
|
31851
|
+
getEditorIndentString as di,
|
|
31852
|
+
logResponseHeadersToSpan as dj,
|
|
31853
|
+
TracedError as dk,
|
|
31854
|
+
isNodeResponse as dl,
|
|
31855
|
+
SpanStatusCode as dm,
|
|
31856
|
+
assertFileURI as dn,
|
|
31857
|
+
setOpenCtx as dp,
|
|
31858
|
+
pluck as dq,
|
|
31859
|
+
GIT_OPENCTX_PROVIDER_URI as dr,
|
|
31860
|
+
GENERAL_HELP_LABEL as ds,
|
|
31861
|
+
diffLines as dt,
|
|
31862
|
+
languageFromFilename as du,
|
|
31863
|
+
ProgrammingLanguage as dv,
|
|
31864
|
+
truncatePromptStringStart as dw,
|
|
31865
|
+
posixFilePaths as dx,
|
|
31866
|
+
CODY_DOC_URL as dy,
|
|
31867
|
+
DISCORD_URL as dz,
|
|
31858
31868
|
ws as e,
|
|
31859
31869
|
g as f,
|
|
31860
31870
|
getDefaultExportFromCjs as g,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as path, U as Uri, s as spawn } from "./agent.worker-
|
|
2
|
-
import { w as wrapInActiveSpan, C as ContextItemSource } from "./browser-
|
|
1
|
+
import { p as path, U as Uri, s as spawn } from "./agent.worker-DwbwPMEN.mjs";
|
|
2
|
+
import { w as wrapInActiveSpan, C as ContextItemSource } from "./browser-BOPUs1B6.mjs";
|
|
3
3
|
async function getContextFileFromGitLog(file, options) {
|
|
4
4
|
return wrapInActiveSpan("commands.context.git-log", async (span) => {
|
|
5
5
|
const cwd = path.dirname(file.fsPath);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { U as Uri, P as Position, R as Range, w as window, D as DiagnosticSeverity, b as workspace,
|
|
5
|
-
import { t as telemetryRecorder, p as ps, d as dedent } from "./browser-
|
|
4
|
+
import { U as Uri, P as Position, R as Range, w as window, D as DiagnosticSeverity, b as workspace, c as updateRangeMultipleChanges, d as commands, f as executeEdit, T as TERMINAL_EDIT_STATES, g as ThemeColor, h as languages, C as CodeLens, i as setTutorialUri, j as logSidebarClick, k as Disposable } from "./agent.worker-DwbwPMEN.mjs";
|
|
5
|
+
import { t as telemetryRecorder, p as ps, d as dedent } from "./browser-BOPUs1B6.mjs";
|
|
6
6
|
const EMOJI_SVG_TEMPLATE = `<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
|
|
7
7
|
<text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="24px">{emoji}</text>
|
|
8
8
|
</svg>`;
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
|
-
import { g as getDefaultExportFromCjs, L as Ls, k as ke$1, a as ks, F as Fi$1, _ as _s, b as ds, c as bs, i as ii$1, q as qe$1, y as ys, x as xi$1, K as K$2, J as J$2, R as R$3, e as ws, B as B$2, f as g$5, h as h$4, j as _i, S as Ss, l as Br, m as ln, n as bi$1, v as vn, o as xn, N as Nn, r as mn, s as li$1, u as n$1, z as ns, M as M$4, D as Ds, A as le$2, E as c$4, G as oe$1, H as z$1, I as yi$1, W as W$2, U as Ue$1, O as I$2, P as Se$2, Q as O$2, V as F$1, X as Ni$1, Y as ee$1, Z as we$2, $ as b$2, a0 as T$3, a1 as s$2, a2 as o$4, a3 as w$3, a4 as i$1, a5 as k$3, a6 as D$5, a7 as p$8, a8 as m$7, a9 as S$4, aa as v$4, ab as P$2, ac as E$6, ad as Wi$1, ae as L$3, af as d$2, ag as a$3, ah as l$2, ai as f$2, aj as u$6, ak as r$6, al as t$2, am as FILE_CONTEXT_MENTION_PROVIDER, an as SYMBOL_CONTEXT_MENTION_PROVIDER, ao as REMOTE_REPOSITORY_PROVIDER_URI, ap as REMOTE_FILE_PROVIDER_URI, aq as REMOTE_DIRECTORY_PROVIDER_URI, ar as WEB_PROVIDER_URI, as as displayPath, at as displayLineRange, au as displayPathDirname, av as displayPathBasename, aw as IGNORED_FILE_WARNING_LABEL, ax as LARGE_FILE_WARNING_LABEL, ay as Ei$1, az as xe$2, aA as V$2, aB as Es, aC as U$2, aD as e, aE as Ns, aF as an, aG as gs, aH as serializeContextItem, aI as CONTEXT_ITEM_MENTION_NODE_TYPE, aJ as contextItemMentionNodeDisplayText, C as ContextItemSource, aK as URI, aL as qr, aM as _$2, aN as TEMPLATE_INPUT_NODE_TYPE, aO as N$2, aP as parseMentionQuery, aQ as NO_SYMBOL_MATCHES_HELP_LABEL, aR as FILE_RANGE_TOOLTIP_LABEL, aS as createExtensionAPI, aT as createMessageAPIForWebview, aU as lodashExports, aV as memoizeLastValue, aW as toSerializedPromptEditorValue, aX as ri$1, aY as scanForMentionTriggerInUserTextInput, aZ as fs, a_ as Ts, a$ as ps, b0 as hydrateAfterPostMessage, b1 as isCodyProUser, b2 as CodyIDE, b3 as webviewOpenURIForContextItem, b4 as commonjsGlobal, b5 as CodyTaskState, b6 as cryptoJsExports, b7 as isError, b8 as RateLimitError, b9 as CODY_FEEDBACK_URL, ba as isDefined, bb as reformatBotMessageForChat, p as ps$1, bc as isAbortErrorOrSocketHangUp, bd as
|
|
5
|
+
import { g as getDefaultExportFromCjs, L as Ls, k as ke$1, a as ks, F as Fi$1, _ as _s, b as ds, c as bs, i as ii$1, q as qe$1, y as ys, x as xi$1, K as K$2, J as J$2, R as R$3, e as ws, B as B$2, f as g$5, h as h$4, j as _i, S as Ss, l as Br, m as ln, n as bi$1, v as vn, o as xn, N as Nn, r as mn, s as li$1, u as n$1, z as ns, M as M$4, D as Ds, A as le$2, E as c$4, G as oe$1, H as z$1, I as yi$1, W as W$2, U as Ue$1, O as I$2, P as Se$2, Q as O$2, V as F$1, X as Ni$1, Y as ee$1, Z as we$2, $ as b$2, a0 as T$3, a1 as s$2, a2 as o$4, a3 as w$3, a4 as i$1, a5 as k$3, a6 as D$5, a7 as p$8, a8 as m$7, a9 as S$4, aa as v$4, ab as P$2, ac as E$6, ad as Wi$1, ae as L$3, af as d$2, ag as a$3, ah as l$2, ai as f$2, aj as u$6, ak as r$6, al as t$2, am as FILE_CONTEXT_MENTION_PROVIDER, an as SYMBOL_CONTEXT_MENTION_PROVIDER, ao as REMOTE_REPOSITORY_PROVIDER_URI, ap as REMOTE_FILE_PROVIDER_URI, aq as REMOTE_DIRECTORY_PROVIDER_URI, ar as WEB_PROVIDER_URI, as as displayPath, at as displayLineRange, au as displayPathDirname, av as displayPathBasename, aw as IGNORED_FILE_WARNING_LABEL, ax as LARGE_FILE_WARNING_LABEL, ay as Ei$1, az as xe$2, aA as V$2, aB as Es, aC as U$2, aD as e, aE as Ns, aF as an, aG as gs, aH as serializeContextItem, aI as CONTEXT_ITEM_MENTION_NODE_TYPE, aJ as contextItemMentionNodeDisplayText, C as ContextItemSource, aK as URI, aL as qr, aM as _$2, aN as TEMPLATE_INPUT_NODE_TYPE, aO as N$2, aP as parseMentionQuery, aQ as NO_SYMBOL_MATCHES_HELP_LABEL, aR as FILE_RANGE_TOOLTIP_LABEL, aS as createExtensionAPI, aT as createMessageAPIForWebview, aU as lodashExports, aV as memoizeLastValue, aW as toSerializedPromptEditorValue, aX as ri$1, aY as scanForMentionTriggerInUserTextInput, aZ as fs, a_ as Ts, a$ as ps, b0 as hydrateAfterPostMessage, b1 as isCodyProUser, b2 as CodyIDE, b3 as webviewOpenURIForContextItem, b4 as commonjsGlobal, b5 as CodyTaskState, b6 as cryptoJsExports, b7 as isError, b8 as RateLimitError, b9 as CODY_FEEDBACK_URL, ba as isDefined, bb as reformatBotMessageForChat, p as ps$1, bc as isAbortErrorOrSocketHangUp, bd as ModelTag, be as isEqual, bf as serializedPromptEditorStateFromChatMessage, bg as contextItemsFromPromptEditorValue, bh as filterContextItemsFromPromptEditorValue, bi as pluralize$1, bj as isCodyProModel, bk as isWaitlistModel, bl as CustomCommandType, bm as isMacOS, bn as textContentFromSerializedLexicalNode, bo as FAST_CHAT_INPUT_TOKEN_BUDGET, bp as inputTextWithoutContextChipsFromPromptEditorState, bq as deserializeContextItem, br as View, bs as truncateTextStart, bt as CHAT_INPUT_TOKEN_BUDGET, bu as ACCOUNT_USAGE_URL, bv as ACCOUNT_UPGRADE_URL, bw as getRelativeChatPeriod, bx as browser, by as isErrorLike, bz as setDisplayPathEnvInfo, bA as PromptString } from "./browser-BOPUs1B6.mjs";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import React__default, { createContext, useContext, useMemo, useLayoutEffect, useEffect, forwardRef, useState, useCallback, useRef, Suspense, createElement, memo, useImperativeHandle, Children, isValidElement, cloneElement, Fragment as Fragment$1, useReducer } from "react";
|
|
8
8
|
var classnames = { exports: {} };
|
|
@@ -32530,19 +32530,20 @@ const CodyLogoBW = ({ size: size2, ...props }) => /* @__PURE__ */ jsxs(
|
|
|
32530
32530
|
}
|
|
32531
32531
|
);
|
|
32532
32532
|
function chatModelIconComponent(model) {
|
|
32533
|
-
|
|
32533
|
+
model = model.toLowerCase();
|
|
32534
|
+
if (model.startsWith("openai") || model.includes("gpt")) {
|
|
32534
32535
|
return OpenAILogo;
|
|
32535
32536
|
}
|
|
32536
|
-
if (model.
|
|
32537
|
+
if (model.includes("anthropic")) {
|
|
32537
32538
|
return AnthropicLogo;
|
|
32538
32539
|
}
|
|
32539
|
-
if (model.startsWith("google")) {
|
|
32540
|
+
if (model.startsWith("google") || model.includes("gemini")) {
|
|
32540
32541
|
return GeminiLogo;
|
|
32541
32542
|
}
|
|
32542
|
-
if (model.
|
|
32543
|
+
if (model.includes("ollama")) {
|
|
32543
32544
|
return OllamaLogo;
|
|
32544
32545
|
}
|
|
32545
|
-
if (model.
|
|
32546
|
+
if (model.includes("mistral") || model.includes("mixtral")) {
|
|
32546
32547
|
return MistralLogo;
|
|
32547
32548
|
}
|
|
32548
32549
|
return CodyLogoBW;
|
|
@@ -73439,7 +73440,7 @@ const BaseMessageCell = ({ speakerIcon, speakerTitle, cellAction, content: conte
|
|
|
73439
73440
|
}
|
|
73440
73441
|
);
|
|
73441
73442
|
const MESSAGE_CELL_AVATAR_SIZE = 20;
|
|
73442
|
-
const ContextFocusActions = ({ humanMessage, className }) => {
|
|
73443
|
+
const ContextFocusActions = ({ humanMessage, longResponseTime, className }) => {
|
|
73443
73444
|
const telemetryRecorder = useTelemetryRecorder();
|
|
73444
73445
|
const initialContextEventMetadata = {
|
|
73445
73446
|
hasInitialContextRepositories: humanMessage.hasInitialContext.repositories ? 1 : 0,
|
|
@@ -73487,7 +73488,16 @@ const ContextFocusActions = ({ humanMessage, className }) => {
|
|
|
73487
73488
|
humanMessage.rerunWithDifferentContext(options);
|
|
73488
73489
|
}
|
|
73489
73490
|
} : null,
|
|
73490
|
-
{
|
|
73491
|
+
longResponseTime ? {
|
|
73492
|
+
label: "Try again with a different model",
|
|
73493
|
+
tooltip: "A new window will open with a copy of the current conversation where you can resubmit your request with a different model",
|
|
73494
|
+
onClick: () => {
|
|
73495
|
+
getVSCodeAPI().postMessage({
|
|
73496
|
+
command: "chatSession",
|
|
73497
|
+
action: "duplicate"
|
|
73498
|
+
});
|
|
73499
|
+
}
|
|
73500
|
+
} : {
|
|
73491
73501
|
label: "Add context...",
|
|
73492
73502
|
tooltip: "Add relevant content to improve the response",
|
|
73493
73503
|
onClick: () => {
|
|
@@ -73502,7 +73512,13 @@ const ContextFocusActions = ({ humanMessage, className }) => {
|
|
|
73502
73512
|
}
|
|
73503
73513
|
}
|
|
73504
73514
|
].flat().filter(isDefined),
|
|
73505
|
-
[
|
|
73515
|
+
[
|
|
73516
|
+
humanMessage,
|
|
73517
|
+
telemetryRecorder,
|
|
73518
|
+
logRerunWithDifferentContext,
|
|
73519
|
+
initialContextEventMetadata,
|
|
73520
|
+
longResponseTime
|
|
73521
|
+
]
|
|
73506
73522
|
);
|
|
73507
73523
|
return actions2.length > 0 ? /* @__PURE__ */ jsx(
|
|
73508
73524
|
"menu",
|
|
@@ -73511,7 +73527,7 @@ const ContextFocusActions = ({ humanMessage, className }) => {
|
|
|
73511
73527
|
role: "group",
|
|
73512
73528
|
"aria-label": "Try again with different context",
|
|
73513
73529
|
children: /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-flex-wrap tw-items-center tw-gap-x-4 tw-gap-y-2", children: [
|
|
73514
|
-
/* @__PURE__ */ jsx("h3", { className: "tw-flex tw-items-center tw-gap-3", children: "Try again with different context" }),
|
|
73530
|
+
!longResponseTime && /* @__PURE__ */ jsx("h3", { className: "tw-flex tw-items-center tw-gap-3", children: "Try again with different context" }),
|
|
73515
73531
|
/* @__PURE__ */ jsx("ul", { className: "tw-whitespace-nowrap tw-flex tw-gap-2 tw-flex-wrap", children: actions2.map(({ label, tooltip, onClick }) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
73516
73532
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
73517
73533
|
Button3,
|
|
@@ -73546,6 +73562,7 @@ const AssistantMessageCell = memo(
|
|
|
73546
73562
|
smartApply,
|
|
73547
73563
|
smartApplyEnabled
|
|
73548
73564
|
}) => {
|
|
73565
|
+
var _a;
|
|
73549
73566
|
const displayMarkdown = useMemo(
|
|
73550
73567
|
() => reformatBotMessageForChat(message2.text ?? ps$1``).toString(),
|
|
73551
73568
|
[message2]
|
|
@@ -73553,6 +73570,7 @@ const AssistantMessageCell = memo(
|
|
|
73553
73570
|
const chatModel = useChatModelByID(message2.model);
|
|
73554
73571
|
const ModelIcon = chatModel ? chatModelIconComponent(chatModel.id) : null;
|
|
73555
73572
|
const isAborted = isAbortErrorOrSocketHangUp(message2.error);
|
|
73573
|
+
const hasLongerResponseTime = (_a = chatModel == null ? void 0 : chatModel.tags) == null ? void 0 : _a.includes(ModelTag.StreamDisabled);
|
|
73556
73574
|
return /* @__PURE__ */ jsx(
|
|
73557
73575
|
BaseMessageCell,
|
|
73558
73576
|
{
|
|
@@ -73580,7 +73598,10 @@ const AssistantMessageCell = memo(
|
|
|
73580
73598
|
smartApply,
|
|
73581
73599
|
userInfo
|
|
73582
73600
|
}
|
|
73583
|
-
) : isLoading && /* @__PURE__ */
|
|
73601
|
+
) : isLoading && /* @__PURE__ */ jsxs("div", { children: [
|
|
73602
|
+
hasLongerResponseTime && /* @__PURE__ */ jsx("p", { className: "tw-m-4 tw-mt-0 tw-text-muted-foreground", children: "This model may take longer to response." }),
|
|
73603
|
+
/* @__PURE__ */ jsx(LoadingDots, {})
|
|
73604
|
+
] })
|
|
73584
73605
|
] }),
|
|
73585
73606
|
footer: chatEnabled && humanMessage && /* @__PURE__ */ jsxs("div", { className: "tw-py-3 tw-flex tw-flex-col tw-gap-2", children: [
|
|
73586
73607
|
isAborted && /* @__PURE__ */ jsx("div", { className: "tw-text-sm tw-text-muted-foreground tw-mt-4", children: "Output stream stopped" }),
|
|
@@ -73596,6 +73617,7 @@ const AssistantMessageCell = memo(
|
|
|
73596
73617
|
ContextFocusActions,
|
|
73597
73618
|
{
|
|
73598
73619
|
humanMessage,
|
|
73620
|
+
longResponseTime: hasLongerResponseTime,
|
|
73599
73621
|
className: showFeedbackButtons && feedbackButtonsOnSubmit ? "tw-pl-5" : void 0
|
|
73600
73622
|
}
|
|
73601
73623
|
)
|
|
@@ -73653,7 +73675,8 @@ function useChatModelByID(model) {
|
|
|
73653
73675
|
return (chatModels == null ? void 0 : chatModels.find((m2) => m2.id === model)) ?? (model ? {
|
|
73654
73676
|
id: model,
|
|
73655
73677
|
title: model,
|
|
73656
|
-
provider: "unknown"
|
|
73678
|
+
provider: "unknown",
|
|
73679
|
+
tags: []
|
|
73657
73680
|
} : void 0);
|
|
73658
73681
|
}
|
|
73659
73682
|
const contextItem = "_context-item_911i8_1";
|
|
@@ -74355,11 +74378,12 @@ const ModelSelectField = ({
|
|
|
74355
74378
|
});
|
|
74356
74379
|
return;
|
|
74357
74380
|
}
|
|
74358
|
-
|
|
74359
|
-
|
|
74360
|
-
|
|
74361
|
-
|
|
74362
|
-
|
|
74381
|
+
if (isWaitlistModel(model)) {
|
|
74382
|
+
getVSCodeAPI().postMessage({
|
|
74383
|
+
command: "links",
|
|
74384
|
+
value: "waitlist"
|
|
74385
|
+
});
|
|
74386
|
+
}
|
|
74363
74387
|
parentOnModelSelect(model);
|
|
74364
74388
|
},
|
|
74365
74389
|
[telemetryRecorder.recordEvent, showCodyProBadge, parentOnModelSelect, isCodyProUser2]
|
|
@@ -74405,7 +74429,7 @@ const ModelSelectField = ({
|
|
|
74405
74429
|
// be taken to the upgrade page.
|
|
74406
74430
|
disabled: !["available", "needs-cody-pro"].includes(availability),
|
|
74407
74431
|
group: getModelDropDownUIGroup(m2),
|
|
74408
|
-
tooltip:
|
|
74432
|
+
tooltip: getTooltip(m2, availability)
|
|
74409
74433
|
};
|
|
74410
74434
|
}),
|
|
74411
74435
|
[models, userInfo, serverSentModelsEnabled]
|
|
@@ -74540,21 +74564,55 @@ function modelAvailability(userInfo, serverSentModelsEnabled, model) {
|
|
|
74540
74564
|
}
|
|
74541
74565
|
return "available";
|
|
74542
74566
|
}
|
|
74543
|
-
|
|
74544
|
-
|
|
74545
|
-
|
|
74546
|
-
className: clsx$1(styles$5.modelTitleWithIcon, {
|
|
74547
|
-
[styles$5.disabled]: modelAvailability2 !== "available"
|
|
74548
|
-
}),
|
|
74549
|
-
children: [
|
|
74550
|
-
showIcon && /* @__PURE__ */ jsx(ChatModelIcon, { model: model.provider, className: styles$5.modelIcon }),
|
|
74551
|
-
/* @__PURE__ */ jsx("span", { className: clsx$1("tw-flex-grow", styles$5.modelName), children: model.title }),
|
|
74552
|
-
modelAvailability2 === "needs-cody-pro" && /* @__PURE__ */ jsx(Badge3, { variant: "secondary", className: clsx$1(styles$5.badge, "tw-opacity-75"), children: "Cody Pro" }),
|
|
74553
|
-
model.tags.includes(ModelTag.Experimental) && /* @__PURE__ */ jsx(Badge3, { variant: "secondary", className: styles$5.badge, children: "Experimental" }),
|
|
74554
|
-
model.tags.includes(ModelTag.Recommended) && modelAvailability2 !== "needs-cody-pro" ? /* @__PURE__ */ jsx(Badge3, { variant: "secondary", className: styles$5.badge, children: "Recommended" }) : null
|
|
74555
|
-
]
|
|
74567
|
+
function getTooltip(model, availability) {
|
|
74568
|
+
if (model.tags.includes(ModelTag.Waitlist)) {
|
|
74569
|
+
return "Request access to this new model";
|
|
74556
74570
|
}
|
|
74557
|
-
)
|
|
74571
|
+
if (model.tags.includes(ModelTag.OnWaitlist)) {
|
|
74572
|
+
return "Request received, we will reach out with next steps";
|
|
74573
|
+
}
|
|
74574
|
+
switch (availability) {
|
|
74575
|
+
case "not-selectable-on-enterprise":
|
|
74576
|
+
return "Chat model set by your Sourcegraph Enterprise admin";
|
|
74577
|
+
case "needs-cody-pro":
|
|
74578
|
+
return `Upgrade to Cody Pro to use ${model.title} by ${model.provider}`;
|
|
74579
|
+
default:
|
|
74580
|
+
return `${model.title} by ${model.provider}`;
|
|
74581
|
+
}
|
|
74582
|
+
}
|
|
74583
|
+
const ModelTitleWithIcon = ({ model, showIcon, modelAvailability: modelAvailability2 }) => {
|
|
74584
|
+
const getBadgeText = (model2, modelAvailability3) => {
|
|
74585
|
+
if (modelAvailability3 === "needs-cody-pro") return "Cody Pro";
|
|
74586
|
+
if (model2.tags.includes(ModelTag.Experimental)) return "Experimental";
|
|
74587
|
+
if (model2.tags.includes(ModelTag.Waitlist)) return "Join Waitlist";
|
|
74588
|
+
if (model2.tags.includes(ModelTag.OnWaitlist)) return "On Waitlist";
|
|
74589
|
+
if (model2.tags.includes(ModelTag.EarlyAccess)) return "Early Access";
|
|
74590
|
+
if (model2.tags.includes(ModelTag.Recommended)) return "Recommended";
|
|
74591
|
+
return null;
|
|
74592
|
+
};
|
|
74593
|
+
return /* @__PURE__ */ jsxs(
|
|
74594
|
+
"span",
|
|
74595
|
+
{
|
|
74596
|
+
className: clsx$1(styles$5.modelTitleWithIcon, {
|
|
74597
|
+
[styles$5.disabled]: modelAvailability2 !== "available"
|
|
74598
|
+
}),
|
|
74599
|
+
children: [
|
|
74600
|
+
showIcon && /* @__PURE__ */ jsx(ChatModelIcon, { model: model.provider, className: styles$5.modelIcon }),
|
|
74601
|
+
/* @__PURE__ */ jsx("span", { className: clsx$1("tw-flex-grow", styles$5.modelName), children: model.title }),
|
|
74602
|
+
getBadgeText(model, modelAvailability2) && /* @__PURE__ */ jsx(
|
|
74603
|
+
Badge3,
|
|
74604
|
+
{
|
|
74605
|
+
variant: "secondary",
|
|
74606
|
+
className: clsx$1(styles$5.badge, {
|
|
74607
|
+
"tw-opacity-75": modelAvailability2 === "needs-cody-pro"
|
|
74608
|
+
}),
|
|
74609
|
+
children: getBadgeText(model, modelAvailability2)
|
|
74610
|
+
}
|
|
74611
|
+
)
|
|
74612
|
+
]
|
|
74613
|
+
}
|
|
74614
|
+
);
|
|
74615
|
+
};
|
|
74558
74616
|
const ChatModelIcon = ({
|
|
74559
74617
|
model,
|
|
74560
74618
|
className
|
|
@@ -75527,15 +75585,20 @@ const HumanMessageEditor = ({
|
|
|
75527
75585
|
[isSent]
|
|
75528
75586
|
)
|
|
75529
75587
|
);
|
|
75530
|
-
const
|
|
75588
|
+
const model = useCurrentChatModel();
|
|
75589
|
+
let initialContext = useClientState().initialContext;
|
|
75531
75590
|
useEffect(() => {
|
|
75591
|
+
var _a2;
|
|
75532
75592
|
if (initialContext && !isSent && isFirstMessage) {
|
|
75533
75593
|
const editor2 = editorRef.current;
|
|
75534
75594
|
if (editor2) {
|
|
75595
|
+
if ((_a2 = model == null ? void 0 : model.tags) == null ? void 0 : _a2.includes(ModelTag.StreamDisabled)) {
|
|
75596
|
+
initialContext = initialContext.filter((item2) => item2.type !== "tree");
|
|
75597
|
+
}
|
|
75535
75598
|
editor2.setInitialContextMentions(initialContext);
|
|
75536
75599
|
}
|
|
75537
75600
|
}
|
|
75538
|
-
}, [initialContext, isSent, isFirstMessage]);
|
|
75601
|
+
}, [initialContext, isSent, isFirstMessage, model]);
|
|
75539
75602
|
const focusEditor = useCallback(() => {
|
|
75540
75603
|
var _a2;
|
|
75541
75604
|
return (_a2 = editorRef.current) == null ? void 0 : _a2.setFocus(true);
|
|
@@ -75546,7 +75609,6 @@ const HumanMessageEditor = ({
|
|
|
75546
75609
|
}
|
|
75547
75610
|
}, [__storybook__focus, focusEditor]);
|
|
75548
75611
|
const focused2 = Boolean(isEditorFocused || isFocusWithin || __storybook__focus);
|
|
75549
|
-
const model = useCurrentChatModel();
|
|
75550
75612
|
const contextWindowSizeInTokens = ((_b = (_a = model == null ? void 0 : model.contextWindow) == null ? void 0 : _a.context) == null ? void 0 : _b.user) || ((_c = model == null ? void 0 : model.contextWindow) == null ? void 0 : _c.input) || FAST_CHAT_INPUT_TOKEN_BUDGET;
|
|
75551
75613
|
return (
|
|
75552
75614
|
// biome-ignore lint/a11y/useKeyWithClickEvents: only relevant to click areas
|