This feature include the following changes:
- Implemented llm/compileChat that gives the webview the ability to precompile the chat messages
before sending them to llm/streamChat where the webview can gather the pruning information and
provide users better guides.
- Added a optional parameter to llm/streamChat that can be used to indicate whether the chat
messages being passed is procompiled or not, so we don't compile the chat messages twice.
Because it's an optional parameter, we don't affect the behavior of llm/stream when it's
called at other places.
- Added a warning message box for the last ContinueInputBox which will display the warning
messages and also provide some useful guides.
https://github.com/Granite-Code/granite-code/issues/22
91 lines
2.6 KiB
TypeScript
91 lines
2.6 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",
|
|
"history/clear",
|
|
"devdata/log",
|
|
"config/addModel",
|
|
"config/newPromptFile",
|
|
"config/ideSettingsUpdate",
|
|
"config/addLocalWorkspaceBlock",
|
|
"config/getSerializedProfileInfo",
|
|
"config/deleteModel",
|
|
"config/refreshProfiles",
|
|
"config/openProfile",
|
|
"config/updateSharedConfig",
|
|
"config/updateSelectedModel",
|
|
"mcp/reloadServer",
|
|
"mcp/getPrompt",
|
|
"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",
|
|
"llm/compileChat",
|
|
"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",
|
|
//
|
|
"onboarding/complete",
|
|
"addAutocompleteModel",
|
|
"didChangeSelectedProfile",
|
|
"didChangeSelectedOrg",
|
|
"tools/call",
|
|
"controlPlane/openUrl",
|
|
"controlPlane/getModelsAddOnUpgradeUrl",
|
|
"isItemTooBig",
|
|
"process/markAsBackgrounded",
|
|
"process/isBackgrounded",
|
|
"controlPlane/getFreeTrialStatus",
|
|
];
|
|
|
|
// 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",
|
|
"indexProgress", // Codebase
|
|
"indexing/statusUpdate", // Docs, etc.
|
|
"addContextItem",
|
|
"refreshSubmenuItems",
|
|
"isContinueInputFocused",
|
|
"setTTSActive",
|
|
"getWebviewHistoryLength",
|
|
"getCurrentSessionId",
|
|
"sessionUpdate",
|
|
"didCloseFiles",
|
|
"toolCallPartialOutput",
|
|
"freeTrialExceeded",
|
|
];
|