Commit Graph

14 Commits

Author SHA1 Message Date
Sarah Fortune
8c565b5a7c
Run the cline extension as a standalone process outside of vscode. (#3535)
* Add standalone cline server.

Add directory standalone/ with the scripts to generate
a cline instance that runs a gRPC service for the proto bus.

* Rm unused dependencies

* Build standalone extension

Build stubs for the whole vscode SDK.

Import extension.js instead of putting everything in one file.

Move all the files the extension needs at runtime in files/
  Use local packages for vscode and stub-utils instead of module alias.
  Move vscode-impls into the vscode module.
  Create separate package.json for the standalone extension in files/.

* Handlers for gRPC requests

Add code to the bottom of extension.js to export the gRPC handlers.
Add a wrapper to the handlers to catch and log extensions, otherwise the whole server process fails.
Fix use of open module.

* Standalone gRPC server

Export handers from the extension.
Add reflection and healthcheck to the server.
Add vscode launch file for standalone server.

* Fix formatting

* Better error handling in the server template.

Exit if the server could not bind to the port.
Use internal error code if exception is thrown.

* Formatting

* Stop using google-protobuf npm module to generate JS for protos

The code generated by google-protobuf cannot serialize protos from plain objects. It needs the protos to be class instances created with ProtoExample.create().
But, the protos created in the extension are just POJOs.
Use protoLoader instead which is fine with plain objects.
Protoloader is also the method used in the grpc JS documentation: https://grpc.io/docs/languages/node/basics/#loading-service-descriptors-from-proto-files

* Rm proto that was removed in cline/cline

* Rm old protos when building standalone extension.

* Log gRPC requests

* feat(standalone): implement TypeScript gRPC-based standalone extension

The major improvement is that the gRPC implementation is now written in TypeScript instead of JavaScript, and the standalone extension is compiled together with the original extension rather than using the compiled JS output. This provides full type safety throughout the codebase and prevents issues with the TypeScript compiler renaming handlers during compilation, making the system more robust and maintainable.

- Add new standalone implementation files in src/standalone/ directory using TypeScript
- Implement gRPC server setup in extension-standalone.ts with full type safety
- Generate server setup code with service registrations
- Update build script to support the new standalone architecture
- Reorganize runtime files from standalone/files/ to standalone/runtime-files/
- Replace template-based server generation with gRPC service registration

* Fix issues when doing clean build

Use correct build dir in esbuild.js
Remove undefined type.

* Add handler for gRPC methods with streaming response.

Add a handler-wrapper for rpc's with streaming responses.

Fix issue where grpc-js won't deserialize protos in camelcase. It is the default
for generated code for protos to use camelcase (keepCase: false), but I cannot find
where is being set for the proto serializations to keep the case. For now, just convert the
properties of the proto messages to snake case. This is not a good
solution, but trying to fix this is time sink.

* Formatting

* Add streaming response support to the script that generates setup-server.ts

Add types for the handlers.

* Formatting

* Fix case conversion for gRPC requset protos as well.

Convert snake case to camelcase for incoming request protos.

* formatting

* Improve build process / building for standalone extension

Add separate configs for the extension and the standalone in the esbuild config.
Modules that use __dirname to load files at runtime are marked as external in the build config.
Rename vscode-impls to vscode-context.
Remove unecessary files from the standalone runtime.

* Rename extension-standalone.js to standalone.js

* Move generate-server-setup script to protos dir.

Add the script the npm target `protos`, so it is run when the protos are regenerated.

* formatting

* Add a post build step for the npm run target `protos` to format the generated files.

* Move generate-server-setup to scripts directory

* Add a JS script to package the standalone build, replacing the shell script.

Add a post build step for the standalone target that:
    * copies the vscode module files into the output directory.
    * checks that native modules are not included in the output
    * creates a zip of the build.

* Rm files that were included from merge by mistake

* Move scripts from standalone in scripts directory

Remove unused package.json files from standalone/

* Update scripts and launch.json to use correct paths

* During build install external modules in the dist directory.

Add package.json for the distribution.
Set the node path for the vscode launch config.
Make the prettier silent during `npm run protos`

* Fix ellipsis suggestions
2025-05-15 12:04:46 -07:00
Trevor Hudson
e504b9d414
Trevhud/telem defaults (#3449)
* fresh install mode

* add nocapture

* add ui host

* changeset
2025-05-12 13:58:25 -07:00
Evan
df7f9fcba4
It depends... (#3126)
* add protos to more dependsOn, also make it so that the scripts are always displayed and the window does not automatically close

* changeset

* add back build script
2025-04-27 21:47:49 -07:00
Evan
0836e4d45a
add npm protos to tests.json for dev build (#3107) 2025-04-24 17:07:31 -07:00
pashpashpash
2c0afbc3be
added IS_TEST build flag (#2770)
* added IS_TEST build flag

* removed cross-env
2025-04-09 15:32:08 -07:00
Frostbourne
916660a390 [ENG-126] Migrate to Vite (#1876)
* Initial webview vite migration

* Make vite work

* Fix test running

* Enable HMR, disable vite chunking

* Silence type checking errors

* Vite doesn't use browserslist

* get rid of breaking css flag

* add doc to getHMRHtmlContent

* Make it work

* Changeset

* Add IS_DEV to env definitions

* Update tasks to include HMR

* Update CSP image rules

* prettier

* reintroduce IS_DEV in env

* add new deps to pkg lock

---------

Co-authored-by: Dennis Bartlett <bartlett.dc.1@gmail.com>
2025-02-27 14:45:46 -08:00
Dennis Bartlett
b4e67afcba
Reapply "Add IS_DEV and Hot Reloading to debug. (#1895)" (#1917) (#1942)
* Reapply "Add IS_DEV and Hot Reloading to debug. (#1895)" (#1917)

This reverts commit 25ea46aa8d.

* Update TODO to be more explicit. Update logic for checking IS_DEV

* Update TODO with even more explanation.  (Now with 2x more explanation per explanation
2025-02-24 18:16:15 -08:00
Saoud Rizwan
25ea46aa8d
Revert "Add IS_DEV and Hot Reloading to debug. (#1895)" (#1917)
This reverts commit b0446f7bac.
2025-02-23 16:10:37 -08:00
Dennis Bartlett
b0446f7bac
Add IS_DEV and Hot Reloading to debug. (#1895)
* Add IS_DEV and Hot Reloading to debug.

* Changeset Added

* Clean logs
2025-02-21 00:21:00 -08:00
Saoud Rizwan
25cd7cc8e2 chore: Prettier fix formatting 2025-01-06 12:41:33 -08:00
Saoud Rizwan
9de7253998 refactor: code cleanup, formatting updates, improved workspace handling, checkpoints feature
Add instructions

Fix completion

Refactor

Rename reset to restore

add haschanges flag

Remove log

Better error handling

Better error handling

Fix wording

Fix

Fix

Fix

Comment

Add hash for only latest tool

Prepare for release

Fix

Fix delete

Format fix
2025-01-06 12:40:30 -08:00
Mark Percival
93e70c62f1
Chore: Prettier for consistant formatting (#794)
* Chore: Pretier for consistant formatting

- TODO: This PR needs to be updated by Saoud after he runs `npm install` & `npm format:fix` and commits the results of the prettier changes.

* Revert prettier config

* Run npm install

* Fix prettier config and ignore package lock

* Run format

---------

Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
2024-11-21 13:13:54 -08:00
Saoud Rizwan
08effc4799 Make react build task; add react-textarea-autosize; add settings button; add settings page; get basic chat interface working 2024-07-07 05:05:28 -04:00
Saoud Rizwan
9f169b7e4b Initial commit 2024-07-05 20:51:41 -04:00