@sourcegraph/cody-web 0.30.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent.worker-DFfKh9n_.mjs → agent.worker-DT8FShIL.mjs} +57 -153
- package/dist/agent.worker.js +2 -2
- package/dist/{git-log-mAummXPq.mjs → git-log-CZLl35Ua.mjs} +1 -1
- package/dist/{index-ByWBq8cv.mjs → index-CFWvzD4D.mjs} +2 -2
- package/dist/index.js +76 -216
- package/dist/style.css +77 -68
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{util-DYm6oJqS.mjs → util-Bt98Paeh.mjs} +1 -1
- package/dist/{vscode-shim-D5fSC1mv.mjs → vscode-shim-DuhCkl0x.mjs} +305 -362
- package/package.json +3 -3
|
@@ -18,8 +18,8 @@ var __privateWrapper = (obj, member, setter2, getter) => ({
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
var _a2, _b, _constructing, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn, _c, _d, _e, _f, _g, _h, _constructing2, _i, _j, _max2, _maxSize2, _dispose2, _disposeAfter2, _fetchMethod2, _size2, _calculatedSize2, _keyMap2, _keyList2, _valList2, _next2, _prev2, _head2, _tail2, _free2, _disposed2, _sizes2, _starts2, _ttls2, _hasDispose2, _hasFetchMethod2, _hasDisposeAfter2, _LRUCache_instances2, initializeTTLTracking_fn2, _updateItemAge2, _statusTTL2, _setItemTTL2, _isStale2, initializeSizeTracking_fn2, _removeItemSize2, _addItemSize2, _requireSize2, indexes_fn2, rindexes_fn2, isValidIndex_fn2, evict_fn2, backgroundFetch_fn2, isBackgroundFetch_fn2, connect_fn2, moveToTail_fn2, _k, _l, _m, _n, _o;
|
|
21
|
-
import { b8 as Observable,
|
|
22
|
-
import { r as requireUtil, i as inherits_browserExports, a as utilExports } from "./util-
|
|
21
|
+
import { b8 as Observable, ch as unsubscribe, ci as AsyncSerialScheduler, cj as authStatus, ck as debounceTime, cl as switchMapReplayOperation, cm as interval, cn as map$1, co as filter$2, cp as startWith$1, cq as switchMap$1, cr as promiseFactoryToObservable, cs as retry$1, bE as isError$3, ct as distinctUntilChanged$1, c2 as firstValueFrom$1, c3 as skipPendingOperation, cu as logDebug$1, cv as graphqlClient, cw as isAbortError, cx as logError$2, cy as semver, cz as pendingOperation, cA as pick, bN as ModelTag, cB as getModelInfo, cC as CHAT_INPUT_TOKEN_BUDGET, cD as CHAT_OUTPUT_TOKEN_BUDGET, cE as EXTENDED_CHAT_INPUT_TOKEN_BUDGET, cF as EXTENDED_USER_CONTEXT_TOKEN_BUDGET, cG as createSubscriber, cH as fromVSCodeEvent, bf as isEqual, cI as cenv, bn as isDotCom, cJ as currentAuthStatus, cK as isFileURI, w as wrapInActiveSpan, cL as INCLUDE_EVERYTHING_CONTEXT_FILTERS, cM as EXCLUDE_EVERYTHING_CONTEXT_FILTERS, cN as onAbort, cO as addCodyClientIdentificationHeaders, cP as addTraceparent, cQ as addAuthHeaders, cR as fetch$3, cS as verifyResponseCode, cT as combineLatest$1, cU as take$2, cV as clientCapabilities, cW as shareReplay$1, cX as tap$2, cY as featureFlagProvider, bs as FeatureFlag, cZ as getExperimentalClientModelByFeatureFlag, bV as ToolCodyModelName, c_ as TOOL_CODY_MODEL, c$ as getEnterpriseContextWindow, d0 as ANSWER_TOKENS, d1 as storeLastValue, d2 as resolvedConfig, d3 as userProductSubscription, bY as firstResultFromOperation, d4 as isEnterpriseUser, bA as isCodyProUser, d as ps, d5 as currentResolvedConfig, cd as PromptString, bB as CodyIDE, d6 as CORPUS_CONTEXT_ALLOCATION, d7 as isCustomModel, d8 as recordErrorToSpan, d9 as addClientInfoParams, da as dependentAbortController, az as FILE_CONTEXT_MENTION_PROVIDER, aA as SYMBOL_CONTEXT_MENTION_PROVIDER, aB as REMOTE_REPOSITORY_PROVIDER_URI, aC as REMOTE_FILE_PROVIDER_URI, aD as REMOTE_DIRECTORY_PROVIDER_URI, aE as WEB_PROVIDER_URI, t as telemetryRecorder, C as ContextItemSource, bH as lodashExports, db as isS2, dc as GIT_OPENCTX_PROVIDER_URI, dd as CODE_SEARCH_PROVIDER_URI, bD as cryptoJsExports, de as currentOpenCtxController, aW as URI, df as MulticastSubject, dg as AsyncSerialScheduler_1, i as getDefaultExportFromCjs, b as workspace, p as path, dh as vscode, R as Range, c as commands$1, a as window$1, di as Selection, U as Uri, dj as AgentEventEmitter, dk as MarkdownString, g as Disposable, dl as TextEditorRevealType, dm as ThemeIcon, dn as StatusBarAlignment, dp as readFile, dq as env, dr as UIKind, l as languages$1, h as commonjsGlobal, ds as _baseAssignValue, dt as eq_1, du as isArrayLike_1, dv as isObjectLike_1, dw as _copyObject, dx as keysIn_1, dy as _cloneBufferExports, dz as _cloneTypedArray, dA as _copyArray, dB as _initCloneObject, dC as isArguments_1, dD as isArray_1, dE as isBufferExports, dF as isFunction_1, dG as isObject_1, dH as isPlainObject_1, dI as isTypedArray_1, dJ as _Stack, dK as identity_1, dL as _overRest, dM as _setToString, dN as _isIndex, bo as isSourcegraphToken, dO as v4, dP as CONFIG_KEY, cb as CodyAutoSuggestionMode, dQ as ConfigurationTarget, dR as pathBrowserify, dS as stat, dT as extensions, dU as version$2, dV as setExtensionVersion, dW as withLatestFrom, dX as NEVER, dY as abortableOperation, dZ as disposableSubscription, d_ as setAuthStatusObservable, d$ as DOTCOM_URL, e0 as normalizeServerEndpointURL, e1 as ProgressLocation, e2 as SourcegraphGraphQLAPIClient, e3 as isExternalProviderAuthError, e4 as isNetworkLikeError, e5 as resolveAuth, e6 as QuickPickItemKind, e7 as getAuthErrorMessage, e8 as isWorkspaceInstance, e9 as SUPPORTED_URI_SCHEMAS, ea as _baseIsEqual, eb as keys_1, ec as _baseGet, ed as _castPath, ee as isLength_1, ef as _toKey, eg as _isKey, eh as toNumber_1, ei as _baseFindIndex, ej as require$$0$2, ek as NetworkError, el as isRateLimitError, em as isAuthError, en as FileType, e as dedent$1, eo as FoldingRange, ep as CancellationTokenSource, eq as SymbolKind, bJ as isDefined, er as convertGitCloneURLToCodebaseName, es as pluck, et as toRangeData, P as Position, eu as DefaultChatCommands, ev as pathFunctionsForURI, ew as uriParseNameAndExtension, ex as uriDirname, ey as Utils$1, ez as uriExtname, eA as uriBasename, eB as DefaultEditCommands, eC as subscriptionDisposable, eD as NoOpTelemetryRecorderProvider, eE as TimestampTelemetryProcessor_1, eF as updateGlobalTelemetryInstances, eG as TelemetryRecorderProvider, eH as telemetryRecorderProvider, eI as createGitDiff, eJ as catchError$1, eK as AgentWorkspaceEdit, eL as TextDocumentChangeReason, eM as omit$1, eN as displayPathWithoutWorkspaceFolderPrefix, eO as getEditorInsertSpaces, eP as escapeRegExp$1, eQ as isNetworkError, bU as isCodyProModel, eR as http, eS as open, bC as CodyTaskState, f as CodeLens, eT as defaultWebviewPanel, b9 as createExtensionAPI, ba as createMessageAPIForWebview, eU as EndOfLine, eV as ViewColumn, eW as Location, eX as onDidChangeActiveTextEditor, eY as tabGroups, eZ as workspaceTextDocuments, e_ as visibleTextEditors, e$ as onDidChangeVisibleTextEditors, f0 as fs, f1 as onDidCloseTextDocument, f2 as setCreateWebviewPanel, f3 as getAugmentedNamespace, f4 as extensionConfiguration, f5 as main$1, f6 as setAgent, f7 as setWorkspaceDocuments, f8 as onDidRegisterNewCodeActionProvider, f9 as onDidUnregisterNewCodeActionProvider, fa as onDidRegisterNewCodeLensProvider, fb as onDidUnregisterNewCodeLensProvider, fc as setClientInfo, fd as AgentWorkspaceConfiguration, fe as firstNonPendingAuthStatus, ff as setWorkspaceFolders, fg as onDidChangeWorkspaceFolders, fh as onDidChangeWindowState, fi as onDidOpenTextDocument, fj as onDidSaveTextDocument, fk as packageJson, fl as progressBars, fm as CodeActionTriggerKind, fn as CodeAction, fo as UriString, D as DiagnosticSeverity, fp as diagnostics, fq as isIntegrationTesting, fr as TESTING_TELEMETRY_EXPORTER, fs as dist, ft as completionProvider, fu as InlineCompletionTriggerKind, fv as checkIfEnterpriseUser, fw as currentAuthStatusAuthed, fx as waitUntilComplete, fy as setExtensionConfiguration, fz as onDidChangeConfiguration, fA as onDidChangeTextDocument, fB as onDidChangeTextEditorSelection, fC as workspaceFolders$1, fD as isTokenOrEndpointChange, bX as isMacOS, fE as QuickInputButtons, bS as CustomCommandType, fF as RelativePattern, ce as setDisplayPathEnvInfo, fG as isWindows, fH as currentAuthStatusOrNotReadyYet, fI as currentUserProductSubscription, b$ as ACCOUNT_USAGE_URL, bb as debounce$1, aG as displayPath, fJ as structuredPatch, fK as isDotComAuthed, fL as dedupeWith$1, fM as AbortError, fN as TimeoutError, fO as createDisposables, fP as getClientInfoQueryParams, fQ as tracer, fR as getClientIdentificationHeaders, fS as logResponseHeadersToSpan, fT as getActiveTraceAndSpanId, fU as TracedError, fV as isNodeResponse, br as SpanStatusCode, bF as RateLimitError$2, fW as capitalize, fX as createTwoFilesPatch, T as ThemeColor, fY as getEditorTabSize$1, bv as whitespace, bt as svg, bw as find$1, bx as stringify$1, by as stringify$2, bz as ccount, bu as html$4, fZ as InlineCompletionItem, f_ as isFreeUser, f$ as exec, g0 as _baseGetTag, g1 as MAX_BYTES_PER_FILE, g2 as debounce_1, cc as isErrorLike, g3 as mentionProvidersMetadata, g4 as expandToLineRange, aJ as displayPathBasename, aH as displayLineRange, g5 as openctxController, bO as DeepCodyAgentID, b5 as parseMentionQuery, g6 as openCtxProviderMetadata, g7 as editorStateFromPromptString, g8 as inputTextWithoutContextChipsFromPromptEditorState, bM as isAbortErrorOrSocketHangUp, s as spawn, g9 as ToolCodyModelRef, ga as PromptMode, gb as skip$1, bq as context, gc as extractContextFromTraceparent, gd as isContextWindowLimitError, bl as forceHydration, bL as reformatBotMessageForChat, bm as hydrateAfterPostMessage, ge as addMessageListenersForExtensionAPI, gf as createMessageAPIForExtension, bT as View, gg as CODY_PASSTHROUGH_VSCODE_OPEN_COMMAND_ID, gh as CodeActionKind, c6 as pluralize, gi as assertFileURI, gj as defer$2, gk as merge$2, gl as ruleSearchPaths, gm as isRuleFilename, gn as parseRuleFile, go as languageFromFilename, aF as RULES_PROVIDER_URI, gp as ruleTitle, gq as createCodeSearchProvider, gr as psDedent, gs as DecorationRangeBehavior, gt as ProgrammingLanguage, gu as MAX_CURRENT_FILE_TOKENS, gv as formatRuleForPrompt, gw as posixFilePaths, gx as SURROUNDING_LINES, gy as ACCOUNT_UPGRADE_URL, bg as scanForMentionTriggerInUserTextInput, aL as LARGE_FILE_WARNING_LABEL, gz as GENERAL_HELP_LABEL, gA as diffLines, gB as CODY_SUPPORT_URL, gC as CODY_DOC_URL, gD as CODY_FEEDBACK_URL, gE as DISCORD_URL, bW as getRelativeChatPeriod, gF as globalAgentRef, gG as VSCODE_CHANGELOG_URL, gH as SG_CHANGELOG_URL, gI as ACCOUNT_LIMITS_INFO_URL, gJ as assertUnreachable, gK as promise, gL as ExtensionMode, gM as setLogger, gN as setClientCapabilities, gO as setResolvedConfigurationObservable, gP as _, gQ as setClientNameVersion, gR as setOpenCtxControllerObservable, gS as CODY_OLLAMA_DOCS_URL, ca as browser$2 } from "./vscode-shim-DuhCkl0x.mjs";
|
|
22
|
+
import { r as requireUtil, i as inherits_browserExports, a as utilExports } from "./util-Bt98Paeh.mjs";
|
|
23
23
|
var NOTHING = Symbol.for("immer-nothing");
|
|
24
24
|
var DRAFTABLE = Symbol.for("immer-draftable");
|
|
25
25
|
var DRAFT_STATE = Symbol.for("immer-state");
|
|
@@ -811,15 +811,11 @@ const _ClientConfigSingleton = class _ClientConfigSingleton {
|
|
|
811
811
|
]).then(([viewerSettings, codeSearchEnabled]) => {
|
|
812
812
|
const config = {
|
|
813
813
|
...clientConfig,
|
|
814
|
-
intentDetection: "enabled",
|
|
815
814
|
notices: [],
|
|
816
815
|
omniBoxEnabled,
|
|
817
816
|
codeSearchEnabled: isError$3(codeSearchEnabled) ? true : codeSearchEnabled
|
|
818
817
|
};
|
|
819
818
|
if (!isError$3(viewerSettings)) {
|
|
820
|
-
config.intentDetection = ["disabled", "enabled"].includes(
|
|
821
|
-
viewerSettings["omnibox.intentDetection"]
|
|
822
|
-
) ? viewerSettings["omnibox.intentDetection"] : "enabled";
|
|
823
819
|
config.notices = Array.from(
|
|
824
820
|
viewerSettings["cody.notices"] ?? [],
|
|
825
821
|
(notice, index2) => ({
|
|
@@ -829,9 +825,6 @@ const _ClientConfigSingleton = class _ClientConfigSingleton {
|
|
|
829
825
|
})
|
|
830
826
|
);
|
|
831
827
|
}
|
|
832
|
-
if (codeSearchEnabled === false) {
|
|
833
|
-
config.intentDetection = "disabled";
|
|
834
|
-
}
|
|
835
828
|
return config;
|
|
836
829
|
});
|
|
837
830
|
}).catch((e) => {
|
|
@@ -853,7 +846,6 @@ const _ClientConfigSingleton = class _ClientConfigSingleton {
|
|
|
853
846
|
attributionEnabled: features2.attribution,
|
|
854
847
|
smartContextWindowEnabled: smartContextWindow,
|
|
855
848
|
// Things that did not exist before logically default to disabled.
|
|
856
|
-
intentDetection: "disabled",
|
|
857
849
|
modelsAPIEnabled: false,
|
|
858
850
|
userShouldUseEnterprise: false,
|
|
859
851
|
notices: [],
|
|
@@ -12199,7 +12191,6 @@ const events$2 = [
|
|
|
12199
12191
|
event(
|
|
12200
12192
|
"cody.chat-question/executed",
|
|
12201
12193
|
({ feature: feature2, action, map: map2 }) => (params, spans, tokenCounterUtils) => {
|
|
12202
|
-
var _a3;
|
|
12203
12194
|
const recordTranscript = params.authStatus.endpoint && (isDotCom(params.authStatus) || isS2(params.authStatus));
|
|
12204
12195
|
const gitMetadata = recordTranscript && params.repoIsPublic && lodashExports.isArray(params.repoMetadata) ? params.repoMetadata : void 0;
|
|
12205
12196
|
const metadata2 = lodashExports.isArray(params.context) ? publicContextSummary("context", params.context) : {
|
|
@@ -12212,22 +12203,12 @@ const events$2 = [
|
|
|
12212
12203
|
const telemetryData = {
|
|
12213
12204
|
metadata: pickDefined({
|
|
12214
12205
|
userSpecifiedIntent: params.userSpecifiedIntent ? map2.intent(params.userSpecifiedIntent) : void 0,
|
|
12215
|
-
detectedIntent: params.detectedIntent ? map2.intent(params.detectedIntent) : void 0,
|
|
12216
|
-
// Each intent is mapped to a `detectedIntentScores.{intent}` field inside the metadata
|
|
12217
|
-
...(_a3 = params.detectedIntentScores) == null ? void 0 : _a3.reduce(
|
|
12218
|
-
(scores, intentScore) => {
|
|
12219
|
-
scores["detectedIntentScores." + intentScore.intent] = intentScore.score;
|
|
12220
|
-
return scores;
|
|
12221
|
-
},
|
|
12222
|
-
{}
|
|
12223
|
-
),
|
|
12224
12206
|
// TODO: Remove this field when the transition from commands to prompts is complete
|
|
12225
12207
|
isCommand: params.command ? 1 : 0,
|
|
12226
12208
|
...metadata2,
|
|
12227
12209
|
recordsPrivateMetadataTranscript: recordTranscript ? 1 : 0
|
|
12228
12210
|
}),
|
|
12229
12211
|
privateMetadata: {
|
|
12230
|
-
detectedIntent: params.detectedIntent,
|
|
12231
12212
|
// TODO: Remove this field when the transition from commands to prompts is complete
|
|
12232
12213
|
command: params.command,
|
|
12233
12214
|
userSpecifiedIntent: params.userSpecifiedIntent,
|
|
@@ -12875,30 +12856,32 @@ The Markdown body is an LLM prompt that is included in AI code chat and editing
|
|
|
12875
12856
|
};
|
|
12876
12857
|
function ruleAppliesToFile(rule, file) {
|
|
12877
12858
|
if (rule.repo_filters) {
|
|
12878
|
-
if (!
|
|
12859
|
+
if (!regExpMatch(rule.repo_filters, file.repo)) {
|
|
12879
12860
|
return false;
|
|
12880
12861
|
}
|
|
12881
12862
|
}
|
|
12882
12863
|
if (rule.path_filters) {
|
|
12883
|
-
if (!
|
|
12864
|
+
if (!regExpMatch(rule.path_filters, file.path)) {
|
|
12884
12865
|
return false;
|
|
12885
12866
|
}
|
|
12886
12867
|
}
|
|
12887
12868
|
const language_filters = rule.language_filters;
|
|
12888
12869
|
if (language_filters) {
|
|
12889
|
-
const anyMatch = file.languages.some(
|
|
12870
|
+
const anyMatch = file.languages.some(
|
|
12871
|
+
(language) => stringMatch(language_filters, language, { caseInsensitive: true })
|
|
12872
|
+
);
|
|
12890
12873
|
if (!anyMatch) {
|
|
12891
12874
|
return false;
|
|
12892
12875
|
}
|
|
12893
12876
|
}
|
|
12894
12877
|
if (rule.text_content_filters) {
|
|
12895
|
-
if (!
|
|
12878
|
+
if (!regExpMatch(rule.text_content_filters, file.textContent)) {
|
|
12896
12879
|
return false;
|
|
12897
12880
|
}
|
|
12898
12881
|
}
|
|
12899
12882
|
return true;
|
|
12900
12883
|
}
|
|
12901
|
-
function
|
|
12884
|
+
function regExpMatch(filters, value) {
|
|
12902
12885
|
var _a3;
|
|
12903
12886
|
if (filters.include && !filters.include.some((pattern) => new RegExp(pattern).test(value))) {
|
|
12904
12887
|
return false;
|
|
@@ -12908,6 +12891,17 @@ function match$1(filters, value) {
|
|
|
12908
12891
|
}
|
|
12909
12892
|
return true;
|
|
12910
12893
|
}
|
|
12894
|
+
function stringMatch(filters, value, options = {}) {
|
|
12895
|
+
var _a3;
|
|
12896
|
+
const compare = (a, b) => options.caseInsensitive ? a.toLowerCase() === b.toLowerCase() : a === b;
|
|
12897
|
+
if (filters.include && !filters.include.some((pattern) => compare(pattern, value))) {
|
|
12898
|
+
return false;
|
|
12899
|
+
}
|
|
12900
|
+
if ((_a3 = filters.exclude) == null ? void 0 : _a3.some((pattern) => compare(pattern, value))) {
|
|
12901
|
+
return false;
|
|
12902
|
+
}
|
|
12903
|
+
return true;
|
|
12904
|
+
}
|
|
12911
12905
|
function isRulesEnabled(configuration) {
|
|
12912
12906
|
return configuration.rulesEnabled || configuration.internalUnstable;
|
|
12913
12907
|
}
|
|
@@ -32334,12 +32328,27 @@ class RepoNameResolver {
|
|
|
32334
32328
|
if (remoteUrls.length === 0) {
|
|
32335
32329
|
return Observable.of([]);
|
|
32336
32330
|
}
|
|
32337
|
-
|
|
32338
|
-
|
|
32339
|
-
)
|
|
32340
|
-
|
|
32341
|
-
|
|
32342
|
-
|
|
32331
|
+
const remoteUrlsAndRepoNames = remoteUrls.map(
|
|
32332
|
+
(url) => this.getRepoNameCached(url).map((repoName) => [url, repoName])
|
|
32333
|
+
);
|
|
32334
|
+
return combineLatest$1(...remoteUrlsAndRepoNames).pipe(
|
|
32335
|
+
map$1((remoteUrlsAndRepoNames2) => {
|
|
32336
|
+
const repoNames = [];
|
|
32337
|
+
for (const [url, repoName] of remoteUrlsAndRepoNames2) {
|
|
32338
|
+
if (repoName === pendingOperation) {
|
|
32339
|
+
return pendingOperation;
|
|
32340
|
+
}
|
|
32341
|
+
if (!repoName) {
|
|
32342
|
+
const convertedName = convertGitCloneURLToCodebaseName(url);
|
|
32343
|
+
if (convertedName) {
|
|
32344
|
+
repoNames.push(convertedName);
|
|
32345
|
+
}
|
|
32346
|
+
} else {
|
|
32347
|
+
repoNames.push(repoName);
|
|
32348
|
+
}
|
|
32349
|
+
}
|
|
32350
|
+
return repoNames;
|
|
32351
|
+
})
|
|
32343
32352
|
);
|
|
32344
32353
|
}),
|
|
32345
32354
|
map$1((value) => {
|
|
@@ -43920,7 +43929,7 @@ class CommandsProvider {
|
|
|
43920
43929
|
if (!isFileURI(uri)) {
|
|
43921
43930
|
throw new Error("history only supported on local file paths");
|
|
43922
43931
|
}
|
|
43923
|
-
const { getContextFileFromGitLog } = await import("./git-log-
|
|
43932
|
+
const { getContextFileFromGitLog } = await import("./git-log-CZLl35Ua.mjs");
|
|
43924
43933
|
return getContextFileFromGitLog(uri, options);
|
|
43925
43934
|
}
|
|
43926
43935
|
dispose() {
|
|
@@ -162687,7 +162696,10 @@ class DefaultDecorator {
|
|
|
162687
162696
|
// Scale to decoration to the correct size (upscaled to boost resolution)
|
|
162688
162697
|
scale: "0.5",
|
|
162689
162698
|
"transform-origin": "0px 0px",
|
|
162690
|
-
height: "auto"
|
|
162699
|
+
height: "auto",
|
|
162700
|
+
// The decoration will be entirely taken up by the image.
|
|
162701
|
+
// Setting the line-height to 0 ensures that there is no additional padding added by the decoration area.
|
|
162702
|
+
"line-height": "0"
|
|
162691
162703
|
});
|
|
162692
162704
|
this.editor.setDecorations(this.addedLinesDecorationType, [
|
|
162693
162705
|
{
|
|
@@ -165897,8 +165909,8 @@ async function getOpenTabsContextFile() {
|
|
|
165897
165909
|
}
|
|
165898
165910
|
async function createContextFileFromUri(uri, source, type, selectionRange, kind2, symbolName) {
|
|
165899
165911
|
const range = toRangeData(selectionRange);
|
|
165900
|
-
const repoNames = await
|
|
165901
|
-
const repoName =
|
|
165912
|
+
const repoNames = await firstResultFromOperation(repoNameResolver.getRepoNamesContainingUri(uri));
|
|
165913
|
+
const repoName = repoNames[0];
|
|
165902
165914
|
return [
|
|
165903
165915
|
type === "file" ? {
|
|
165904
165916
|
type,
|
|
@@ -170932,7 +170944,6 @@ class ChatController {
|
|
|
170932
170944
|
editor,
|
|
170933
170945
|
guardrails,
|
|
170934
170946
|
startTokenReceiver,
|
|
170935
|
-
chatIntentAPIClient,
|
|
170936
170947
|
contextRetriever,
|
|
170937
170948
|
extensionClient
|
|
170938
170949
|
}) {
|
|
@@ -170943,7 +170954,6 @@ class ChatController {
|
|
|
170943
170954
|
__publicField2(this, "extensionClient");
|
|
170944
170955
|
__publicField2(this, "guardrails");
|
|
170945
170956
|
__publicField2(this, "startTokenReceiver");
|
|
170946
|
-
__publicField2(this, "chatIntentAPIClient");
|
|
170947
170957
|
__publicField2(this, "disposables", []);
|
|
170948
170958
|
__publicField2(this, "clientBroadcast", new MulticastSubject());
|
|
170949
170959
|
__publicField2(this, "initDoer", new InitDoer());
|
|
@@ -170962,7 +170972,6 @@ class ChatController {
|
|
|
170962
170972
|
this.chatBuilder = new ChatBuilder(void 0);
|
|
170963
170973
|
this.guardrails = guardrails;
|
|
170964
170974
|
this.startTokenReceiver = startTokenReceiver;
|
|
170965
|
-
this.chatIntentAPIClient = chatIntentAPIClient;
|
|
170966
170975
|
if (TestSupport.instance) {
|
|
170967
170976
|
TestSupport.instance.chatPanelProvider.set(this);
|
|
170968
170977
|
}
|
|
@@ -171020,8 +171029,6 @@ class ChatController {
|
|
|
171020
171029
|
editorState: message.editorState,
|
|
171021
171030
|
signal: await this.startNewSubmitOrEditOperation(),
|
|
171022
171031
|
source: "chat",
|
|
171023
|
-
preDetectedIntent: message.preDetectedIntent,
|
|
171024
|
-
preDetectedIntentScores: message.preDetectedIntentScores,
|
|
171025
171032
|
manuallySelectedIntent: message.manuallySelectedIntent,
|
|
171026
171033
|
traceparent: message.traceparent
|
|
171027
171034
|
});
|
|
@@ -171035,8 +171042,6 @@ class ChatController {
|
|
|
171035
171042
|
index: message.index ?? void 0,
|
|
171036
171043
|
contextFiles: message.contextItems ?? [],
|
|
171037
171044
|
editorState: message.editorState,
|
|
171038
|
-
preDetectedIntent: message.preDetectedIntent,
|
|
171039
|
-
preDetectedIntentScores: message.preDetectedIntentScores,
|
|
171040
171045
|
manuallySelectedIntent: message.manuallySelectedIntent
|
|
171041
171046
|
});
|
|
171042
171047
|
break;
|
|
@@ -171332,8 +171337,6 @@ class ChatController {
|
|
|
171332
171337
|
signal: signal2,
|
|
171333
171338
|
source,
|
|
171334
171339
|
command,
|
|
171335
|
-
preDetectedIntent,
|
|
171336
|
-
preDetectedIntentScores,
|
|
171337
171340
|
manuallySelectedIntent,
|
|
171338
171341
|
traceparent
|
|
171339
171342
|
}) {
|
|
@@ -171363,8 +171366,7 @@ class ChatController {
|
|
|
171363
171366
|
this.chatBuilder.addHumanMessage({
|
|
171364
171367
|
text: inputText,
|
|
171365
171368
|
editorState,
|
|
171366
|
-
intent: manuallySelectedIntent
|
|
171367
|
-
manuallySelectedIntent,
|
|
171369
|
+
intent: manuallySelectedIntent,
|
|
171368
171370
|
agent: selectedAgent
|
|
171369
171371
|
});
|
|
171370
171372
|
this.postViewTranscript({ speaker: "assistant" });
|
|
@@ -171379,8 +171381,6 @@ class ChatController {
|
|
|
171379
171381
|
signal: signal2,
|
|
171380
171382
|
source,
|
|
171381
171383
|
command,
|
|
171382
|
-
preDetectedIntent,
|
|
171383
|
-
preDetectedIntentScores,
|
|
171384
171384
|
manuallySelectedIntent
|
|
171385
171385
|
},
|
|
171386
171386
|
span2
|
|
@@ -171388,45 +171388,6 @@ class ChatController {
|
|
|
171388
171388
|
});
|
|
171389
171389
|
});
|
|
171390
171390
|
}
|
|
171391
|
-
async isOmniBoxEnabled() {
|
|
171392
|
-
const config = await ClientConfigSingleton.getInstance().getConfig();
|
|
171393
|
-
return !!(config == null ? void 0 : config.omniBoxEnabled);
|
|
171394
|
-
}
|
|
171395
|
-
async getIntentAndScores({
|
|
171396
|
-
requestID,
|
|
171397
|
-
input,
|
|
171398
|
-
signal: signal2,
|
|
171399
|
-
preDetectedIntent,
|
|
171400
|
-
preDetectedIntentScores,
|
|
171401
|
-
manuallySelectedIntent
|
|
171402
|
-
}) {
|
|
171403
|
-
if (!await this.isOmniBoxEnabled()) {
|
|
171404
|
-
return { intent: "chat", detectedIntent: null, detectedIntentScores: [] };
|
|
171405
|
-
}
|
|
171406
|
-
const intent = manuallySelectedIntent ?? preDetectedIntent;
|
|
171407
|
-
if (intent) {
|
|
171408
|
-
return {
|
|
171409
|
-
intent,
|
|
171410
|
-
detectedIntent: preDetectedIntent,
|
|
171411
|
-
detectedIntentScores: preDetectedIntentScores || []
|
|
171412
|
-
};
|
|
171413
|
-
}
|
|
171414
|
-
const response = await this.detectChatIntent({
|
|
171415
|
-
requestID,
|
|
171416
|
-
text: input
|
|
171417
|
-
}).then(async (response2) => {
|
|
171418
|
-
signal2.throwIfAborted();
|
|
171419
|
-
return response2;
|
|
171420
|
-
}).catch(() => void 0);
|
|
171421
|
-
if (response) {
|
|
171422
|
-
return {
|
|
171423
|
-
intent: response.intent,
|
|
171424
|
-
detectedIntent: response.intent,
|
|
171425
|
-
detectedIntentScores: response.allScores
|
|
171426
|
-
};
|
|
171427
|
-
}
|
|
171428
|
-
return { intent: "chat", detectedIntent: null, detectedIntentScores: [] };
|
|
171429
|
-
}
|
|
171430
171391
|
async sendChat({
|
|
171431
171392
|
requestID,
|
|
171432
171393
|
inputText,
|
|
@@ -171435,8 +171396,6 @@ class ChatController {
|
|
|
171435
171396
|
signal: signal2,
|
|
171436
171397
|
source,
|
|
171437
171398
|
command,
|
|
171438
|
-
preDetectedIntent,
|
|
171439
|
-
preDetectedIntentScores,
|
|
171440
171399
|
manuallySelectedIntent
|
|
171441
171400
|
}, span2) {
|
|
171442
171401
|
span2.addEvent("ChatController.sendChat");
|
|
@@ -171463,28 +171422,17 @@ class ChatController {
|
|
|
171463
171422
|
chatAgent
|
|
171464
171423
|
});
|
|
171465
171424
|
recorder2.recordChatQuestionSubmitted(mentions);
|
|
171466
|
-
const { intent, detectedIntent, detectedIntentScores } = await this.getIntentAndScores({
|
|
171467
|
-
requestID,
|
|
171468
|
-
input: editorState ? inputTextWithMappedContextChipsFromPromptEditorState(editorState) : inputText.toString(),
|
|
171469
|
-
preDetectedIntent,
|
|
171470
|
-
preDetectedIntentScores,
|
|
171471
|
-
manuallySelectedIntent,
|
|
171472
|
-
signal: signal2
|
|
171473
|
-
});
|
|
171474
171425
|
signal2.throwIfAborted();
|
|
171475
|
-
this.chatBuilder.setLastMessageIntent(
|
|
171426
|
+
this.chatBuilder.setLastMessageIntent(manuallySelectedIntent);
|
|
171476
171427
|
this.postEmptyMessageInProgress(model2);
|
|
171477
|
-
const agentName = ["search", "edit", "insert"].includes(
|
|
171428
|
+
const agentName = ["search", "edit", "insert"].includes(manuallySelectedIntent ?? "") ? manuallySelectedIntent : chatAgent ?? "chat";
|
|
171478
171429
|
const agent2 = getAgent(agentName, model2, {
|
|
171479
171430
|
contextRetriever: this.contextRetriever,
|
|
171480
171431
|
editor: this.editor,
|
|
171481
171432
|
chatClient: this.chatClient
|
|
171482
171433
|
});
|
|
171483
|
-
const omniBoxEnabled = await this.isOmniBoxEnabled();
|
|
171484
171434
|
recorder2.setIntentInfo({
|
|
171485
|
-
userSpecifiedIntent: manuallySelectedIntent ??
|
|
171486
|
-
detectedIntent,
|
|
171487
|
-
detectedIntentScores
|
|
171435
|
+
userSpecifiedIntent: manuallySelectedIntent ?? "chat"
|
|
171488
171436
|
});
|
|
171489
171437
|
this.postEmptyMessageInProgress(model2);
|
|
171490
171438
|
let messageInProgress = { speaker: "assistant", model: model2 };
|
|
@@ -171579,22 +171527,6 @@ class ChatController {
|
|
|
171579
171527
|
recordErrorToSpan(span2, error);
|
|
171580
171528
|
}
|
|
171581
171529
|
}
|
|
171582
|
-
async detectChatIntent({
|
|
171583
|
-
requestID,
|
|
171584
|
-
text: text2
|
|
171585
|
-
}) {
|
|
171586
|
-
const response = await wrapInActiveSpan("chat.detectChatIntent", () => {
|
|
171587
|
-
var _a3;
|
|
171588
|
-
return (_a3 = this.chatIntentAPIClient) == null ? void 0 : _a3.detectChatIntent(requestID || "", text2).catch(() => null);
|
|
171589
|
-
});
|
|
171590
|
-
if (response && !isError$3(response)) {
|
|
171591
|
-
return {
|
|
171592
|
-
intent: response.intent === "search" ? "search" : "chat",
|
|
171593
|
-
allScores: response.allScores || []
|
|
171594
|
-
};
|
|
171595
|
-
}
|
|
171596
|
-
return;
|
|
171597
|
-
}
|
|
171598
171530
|
async openRemoteFile(uri, tryLocal) {
|
|
171599
171531
|
if (tryLocal) {
|
|
171600
171532
|
try {
|
|
@@ -171744,8 +171676,6 @@ class ChatController {
|
|
|
171744
171676
|
index: index2,
|
|
171745
171677
|
contextFiles,
|
|
171746
171678
|
editorState,
|
|
171747
|
-
preDetectedIntent,
|
|
171748
|
-
preDetectedIntentScores,
|
|
171749
171679
|
manuallySelectedIntent
|
|
171750
171680
|
}) {
|
|
171751
171681
|
const abortSignal = this.startNewSubmitOrEditOperation();
|
|
@@ -171768,8 +171698,6 @@ class ChatController {
|
|
|
171768
171698
|
editorState,
|
|
171769
171699
|
signal: abortSignal,
|
|
171770
171700
|
source: "chat",
|
|
171771
|
-
preDetectedIntent,
|
|
171772
|
-
preDetectedIntentScores,
|
|
171773
171701
|
manuallySelectedIntent
|
|
171774
171702
|
});
|
|
171775
171703
|
} catch (error) {
|
|
@@ -172154,7 +172082,6 @@ class ChatController {
|
|
|
172154
172082
|
});
|
|
172155
172083
|
},
|
|
172156
172084
|
defaultContext: () => defaultContext.pipe(skipPendingOperation()),
|
|
172157
|
-
detectIntent: (text2) => promiseFactoryToObservable(() => this.detectChatIntent({ text: text2 })),
|
|
172158
172085
|
resolvedConfig: () => resolvedConfig,
|
|
172159
172086
|
authStatus: () => authStatus,
|
|
172160
172087
|
transcript: () => this.chatBuilder.changes.pipe(map$1((chat2) => chat2.getDehydratedMessages())),
|
|
@@ -172262,7 +172189,7 @@ function manipulateWebviewHTML(html2, options) {
|
|
|
172262
172189
|
}
|
|
172263
172190
|
const CodyChatEditorViewType = "cody.editorPanel";
|
|
172264
172191
|
class ChatsController {
|
|
172265
|
-
constructor(options, chatClient, contextRetriever, guardrails,
|
|
172192
|
+
constructor(options, chatClient, contextRetriever, guardrails, extensionClient) {
|
|
172266
172193
|
// Chat view in the panel (typically in the sidebar)
|
|
172267
172194
|
__publicField2(this, "panel");
|
|
172268
172195
|
// Chat views in editor panels
|
|
@@ -172275,7 +172202,6 @@ class ChatsController {
|
|
|
172275
172202
|
this.chatClient = chatClient;
|
|
172276
172203
|
this.contextRetriever = contextRetriever;
|
|
172277
172204
|
this.guardrails = guardrails;
|
|
172278
|
-
this.chatIntentAPIClient = chatIntentAPIClient;
|
|
172279
172205
|
this.extensionClient = extensionClient;
|
|
172280
172206
|
logDebug("ChatsController:constructor", "init");
|
|
172281
172207
|
this.panel = this.createChatController();
|
|
@@ -172670,7 +172596,6 @@ class ChatsController {
|
|
|
172670
172596
|
chatClient: this.chatClient,
|
|
172671
172597
|
guardrails: this.guardrails,
|
|
172672
172598
|
startTokenReceiver: this.options.startTokenReceiver,
|
|
172673
|
-
chatIntentAPIClient: this.chatIntentAPIClient,
|
|
172674
172599
|
contextRetriever: this.contextRetriever,
|
|
172675
172600
|
extensionClient: this.extensionClient
|
|
172676
172601
|
});
|
|
@@ -173693,8 +173618,8 @@ function parseMentionURI(uri) {
|
|
|
173693
173618
|
}
|
|
173694
173619
|
}
|
|
173695
173620
|
async function execFileAsync(program2, args2, { cwd }) {
|
|
173696
|
-
const { promisify } = await import("./util-
|
|
173697
|
-
const { execFile } = await import("./vscode-shim-
|
|
173621
|
+
const { promisify } = await import("./util-Bt98Paeh.mjs").then((n) => n.u);
|
|
173622
|
+
const { execFile } = await import("./vscode-shim-DuhCkl0x.mjs").then((n) => n.gT);
|
|
173698
173623
|
return promisify(execFile)(program2, args2, { cwd });
|
|
173699
173624
|
}
|
|
173700
173625
|
var __create = Object.create;
|
|
@@ -178428,14 +178353,6 @@ class VSCodeEditor {
|
|
|
178428
178353
|
await window$1.showWarningMessage(message);
|
|
178429
178354
|
}
|
|
178430
178355
|
}
|
|
178431
|
-
class ChatIntentAPIClient {
|
|
178432
|
-
constructor(apiClient) {
|
|
178433
|
-
this.apiClient = apiClient;
|
|
178434
|
-
}
|
|
178435
|
-
async detectChatIntent(interactionID, query2) {
|
|
178436
|
-
return this.apiClient.chatIntent(interactionID, query2);
|
|
178437
|
-
}
|
|
178438
|
-
}
|
|
178439
178356
|
async function configureExternalServices(context2, platform2) {
|
|
178440
178357
|
var _a3, _b2, _c2;
|
|
178441
178358
|
const disposables = [];
|
|
@@ -178448,13 +178365,11 @@ async function configureExternalServices(context2, platform2) {
|
|
|
178448
178365
|
if (symfRunner) disposables.push(symfRunner);
|
|
178449
178366
|
const chatClient = new ChatClient(completionsClient);
|
|
178450
178367
|
const guardrails = new SourcegraphGuardrailsClient();
|
|
178451
|
-
const chatIntentAPIClient = new ChatIntentAPIClient(graphqlClient);
|
|
178452
178368
|
return {
|
|
178453
178369
|
chatClient,
|
|
178454
178370
|
completionsClient,
|
|
178455
178371
|
guardrails,
|
|
178456
178372
|
symfRunner,
|
|
178457
|
-
chatIntentAPIClient,
|
|
178458
178373
|
dispose() {
|
|
178459
178374
|
for (const d2 of disposables) {
|
|
178460
178375
|
d2 == null ? void 0 : d2.dispose();
|
|
@@ -183577,7 +183492,6 @@ const register = async (context2, platform2, isExtensionModeDevOrTest) => {
|
|
|
183577
183492
|
completionsClient,
|
|
183578
183493
|
guardrails,
|
|
183579
183494
|
symfRunner,
|
|
183580
|
-
chatIntentAPIClient,
|
|
183581
183495
|
dispose: disposeExternalServices
|
|
183582
183496
|
} = await configureExternalServices(context2, platform2);
|
|
183583
183497
|
disposables.push({ dispose: disposeExternalServices });
|
|
@@ -183590,7 +183504,6 @@ const register = async (context2, platform2, isExtensionModeDevOrTest) => {
|
|
|
183590
183504
|
chatClient,
|
|
183591
183505
|
guardrails,
|
|
183592
183506
|
editor,
|
|
183593
|
-
chatIntentAPIClient,
|
|
183594
183507
|
contextRetriever
|
|
183595
183508
|
},
|
|
183596
183509
|
disposables
|
|
@@ -183941,7 +183854,7 @@ async function registerDebugCommands(context2, disposables) {
|
|
|
183941
183854
|
}
|
|
183942
183855
|
async function tryRegisterTutorial(context2, disposables) {
|
|
183943
183856
|
if (!isRunningInsideAgent()) {
|
|
183944
|
-
const { registerInteractiveTutorial } = await import("./index-
|
|
183857
|
+
const { registerInteractiveTutorial } = await import("./index-CFWvzD4D.mjs");
|
|
183945
183858
|
registerInteractiveTutorial(context2).then((disposable) => disposables.push(...disposable));
|
|
183946
183859
|
}
|
|
183947
183860
|
}
|
|
@@ -184025,15 +183938,7 @@ function registerAutocomplete(platform2, statusBar, disposables) {
|
|
|
184025
183938
|
)
|
|
184026
183939
|
);
|
|
184027
183940
|
}
|
|
184028
|
-
function registerChat({
|
|
184029
|
-
context: context2,
|
|
184030
|
-
platform: platform2,
|
|
184031
|
-
chatClient,
|
|
184032
|
-
guardrails,
|
|
184033
|
-
editor,
|
|
184034
|
-
chatIntentAPIClient,
|
|
184035
|
-
contextRetriever
|
|
184036
|
-
}, disposables) {
|
|
183941
|
+
function registerChat({ context: context2, platform: platform2, chatClient, guardrails, editor, contextRetriever }, disposables) {
|
|
184037
183942
|
const messageProviderOptions = {
|
|
184038
183943
|
chat: chatClient,
|
|
184039
183944
|
guardrails,
|
|
@@ -184048,7 +183953,6 @@ function registerChat({
|
|
|
184048
183953
|
chatClient,
|
|
184049
183954
|
contextRetriever,
|
|
184050
183955
|
guardrails,
|
|
184051
|
-
chatIntentAPIClient || null,
|
|
184052
183956
|
platform2.extensionClient
|
|
184053
183957
|
);
|
|
184054
183958
|
chatsController.registerViewsAndCommands();
|
package/dist/agent.worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./agent.worker-
|
|
2
|
-
import "./vscode-shim-
|
|
1
|
+
import "./agent.worker-DT8FShIL.mjs";
|
|
2
|
+
import "./vscode-shim-DuhCkl0x.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { w as wrapInActiveSpan, p as path, U as Uri, C as ContextItemSource, s as spawn } from "./vscode-shim-
|
|
1
|
+
import { w as wrapInActiveSpan, p as path, U as Uri, C as ContextItemSource, s as spawn } from "./vscode-shim-DuhCkl0x.mjs";
|
|
2
2
|
async function getContextFileFromGitLog(file, options) {
|
|
3
3
|
return wrapInActiveSpan("commands.context.git-log", async (span) => {
|
|
4
4
|
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, a as window, D as DiagnosticSeverity, b as workspace, c as commands, t as telemetryRecorder, d as ps, e as dedent, T as ThemeColor, l as languages, f as CodeLens, g as Disposable } from "./vscode-shim-
|
|
5
|
-
import { u as updateRangeMultipleChanges, e as executeEdit, T as TERMINAL_EDIT_STATES, s as setTutorialUri, l as logSidebarClick } from "./agent.worker-
|
|
4
|
+
import { U as Uri, P as Position, R as Range, a as window, D as DiagnosticSeverity, b as workspace, c as commands, t as telemetryRecorder, d as ps, e as dedent, T as ThemeColor, l as languages, f as CodeLens, g as Disposable } from "./vscode-shim-DuhCkl0x.mjs";
|
|
5
|
+
import { u as updateRangeMultipleChanges, e as executeEdit, T as TERMINAL_EDIT_STATES, s as setTutorialUri, l as logSidebarClick } from "./agent.worker-DT8FShIL.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>`;
|