When the context items provided by user overflow the context length and are truncated, it is very confusing for the user. This is a first step that catches an common case at the least confusing time - when the user is selecting a file. A more general check that warns whenever the most recent message is truncated is something that can be added later. Granite-Code/granite-code#22
81 lines
2.3 KiB
TypeScript
81 lines
2.3 KiB
TypeScript
import {
|
|
ToCoreFromWebviewProtocol,
|
|
ToWebviewFromCoreProtocol,
|
|
} from "./coreWebview.js";
|
|
|
|
// Message types to pass through from webview to core
|
|
// Note: If updating these values, make a corresponding update in
|
|
// extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt
|
|
export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] =
|
|
[
|
|
"ping",
|
|
"abort",
|
|
"history/list",
|
|
"history/delete",
|
|
"history/load",
|
|
"history/save",
|
|
"devdata/log",
|
|
"config/addModel",
|
|
"config/newPromptFile",
|
|
"config/ideSettingsUpdate",
|
|
"config/getSerializedProfileInfo",
|
|
"config/deleteModel",
|
|
"config/refreshProfiles",
|
|
"config/openProfile",
|
|
"config/updateSharedConfig",
|
|
"config/updateSelectedModel",
|
|
"mcp/reloadServer",
|
|
"context/getContextItems",
|
|
"context/getSymbolsForFiles",
|
|
"context/loadSubmenuItems",
|
|
"context/addDocs",
|
|
"context/removeDocs",
|
|
"context/indexDocs",
|
|
"autocomplete/complete",
|
|
"autocomplete/cancel",
|
|
"autocomplete/accept",
|
|
"tts/kill",
|
|
"llm/complete",
|
|
"llm/streamChat",
|
|
"llm/listModels",
|
|
"streamDiffLines",
|
|
"chatDescriber/describe",
|
|
"stats/getTokensPerDay",
|
|
"stats/getTokensPerModel",
|
|
// Codebase
|
|
"index/setPaused",
|
|
"index/forceReIndex",
|
|
"index/indexingProgressBarInitialized",
|
|
// Docs, etc.
|
|
"indexing/reindex",
|
|
"indexing/abort",
|
|
"indexing/setPaused",
|
|
"docs/initStatuses",
|
|
"docs/getDetails",
|
|
//
|
|
"completeOnboarding",
|
|
"addAutocompleteModel",
|
|
"didChangeSelectedProfile",
|
|
"didChangeSelectedOrg",
|
|
"tools/call",
|
|
"controlPlane/openUrl",
|
|
"isItemTooBig",
|
|
];
|
|
|
|
// Message types to pass through from core to webview
|
|
// Note: If updating these values, make a corresponding update in
|
|
// extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt
|
|
export const CORE_TO_WEBVIEW_PASS_THROUGH: (keyof ToWebviewFromCoreProtocol)[] =
|
|
[
|
|
"configUpdate",
|
|
"getDefaultModelTitle",
|
|
"indexProgress", // Codebase
|
|
"indexing/statusUpdate", // Docs, etc.
|
|
"addContextItem",
|
|
"refreshSubmenuItems",
|
|
"isContinueInputFocused",
|
|
"setTTSActive",
|
|
"getWebviewHistoryLength",
|
|
"getCurrentSessionId",
|
|
"didCloseFiles",
|
|
];
|