update build
This commit is contained in:
parent
9183486255
commit
fe560fe12a
3 changed files with 39 additions and 14 deletions
|
|
@ -120,19 +120,19 @@ async function installNodeModuleInTempDirAndCopyToCurrent(packageName, toCopy) {
|
|||
(async () => {
|
||||
// Informs of where to look for node_sqlite3.node https://www.npmjs.com/package/bindings#:~:text=The%20searching%20for,file%20is%20found
|
||||
// This is only needed for our `pkg` command
|
||||
fs.writeFileSync(
|
||||
"out/package.json",
|
||||
JSON.stringify(
|
||||
{
|
||||
name: "binary",
|
||||
version: "1.0.0",
|
||||
author: "Continue Dev, Inc",
|
||||
license: "Apache-2.0",
|
||||
},
|
||||
undefined,
|
||||
2,
|
||||
),
|
||||
);
|
||||
// fs.writeFileSync(
|
||||
// "out/package.json",
|
||||
// JSON.stringify(
|
||||
// {
|
||||
// name: "binary",
|
||||
// version: "1.0.0",
|
||||
// author: "Continue Dev, Inc",
|
||||
// license: "Apache-2.0",
|
||||
// },
|
||||
// undefined,
|
||||
// 2,
|
||||
// ),
|
||||
// );
|
||||
|
||||
console.log("[info] Downloading prebuilt lancedb...");
|
||||
for (const target of targets) {
|
||||
|
|
|
|||
2
binary/package-lock.json
generated
2
binary/package-lock.json
generated
|
|
@ -48,7 +48,7 @@
|
|||
"@aws-sdk/client-sagemaker-runtime": "^3.621.0",
|
||||
"@aws-sdk/credential-providers": "^3.620.1",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "^1.0.10",
|
||||
"@continuedev/config-yaml": "^1.0.11",
|
||||
"@continuedev/fetch": "^1.0.4",
|
||||
"@continuedev/llm-info": "^1.0.2",
|
||||
"@continuedev/openai-adapters": "^1.0.10",
|
||||
|
|
|
|||
|
|
@ -28,12 +28,16 @@ class ContinueBrowser(val project: Project, url: String) {
|
|||
}
|
||||
|
||||
val browser: JBCefBrowser
|
||||
private var browserInitialized = false
|
||||
|
||||
|
||||
init {
|
||||
val isOSREnabled = ServiceManager.getService(ContinueExtensionSettings::class.java).continueState.enableOSR
|
||||
|
||||
this.browser = JBCefBrowser.createBuilder().setOffScreenRendering(isOSREnabled).build()
|
||||
|
||||
|
||||
|
||||
registerAppSchemeHandler()
|
||||
browser.loadURL(url);
|
||||
Disposer.register(ContinuePluginDisposable.getInstance(project), browser)
|
||||
|
|
@ -41,6 +45,21 @@ class ContinueBrowser(val project: Project, url: String) {
|
|||
// Listen for events sent from browser
|
||||
val myJSQueryOpenInBrowser = JBCefJSQuery.create((browser as JBCefBrowserBase?)!!)
|
||||
|
||||
browser.jbCefClient.addLoadHandler(object : CefLoadHandlerAdapter() {
|
||||
override fun onLoadingStateChange(
|
||||
browser: CefBrowser?,
|
||||
isLoading: Boolean,
|
||||
canGoBack: Boolean,
|
||||
canGoForward: Boolean
|
||||
) {
|
||||
if (!isLoading) {
|
||||
// The page has finished loading
|
||||
executeJavaScript(browser, myJSQueryOpenInBrowser)
|
||||
browserInitialized = true
|
||||
}
|
||||
}
|
||||
}, browser.cefBrowser)
|
||||
|
||||
myJSQueryOpenInBrowser.addHandler { msg: String? ->
|
||||
val parser = JsonParser()
|
||||
val json: JsonObject = parser.parse(msg).asJsonObject
|
||||
|
|
@ -114,6 +133,12 @@ class ContinueBrowser(val project: Project, url: String) {
|
|||
data: Any?,
|
||||
messageId: String = uuid()
|
||||
) {
|
||||
if (!browserInitialized) {
|
||||
println("Browser not yet initialized, cannot send message to webview")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
val jsonData = Gson().toJson(
|
||||
mapOf(
|
||||
"messageId" to messageId,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue