Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension API for VS Code v1 #1144

Closed

Conversation

FunkMonkey
Copy link

Description

This is a PR for #1041. It is as simple as possible, basically exporting the VsCodeExtension instance to be usable by other extensions.

This could for example be used to directly communicate with the models (e.g. via model.streamChat etc.) or to communicate with the chat webview, for example:

continueInstance.webviewProtocol.request("userInput", {
  input: "Please do X for me!",
});

I believe it is currently ok to export the VsCodeExtension instance, despite giving full access to internals of continue, in order to figure out what features are actually useful for other extension authors. Later on, the instance property should be deprecated in favor of a better designed external API.

Maybe the author of #803 could make use of this simple API, too, instead of adding the proposed functionality to continue itself.

For a better Typescript experience, the types of the API should also be exposed as an npm package.

Checklist

  • The base branch of this PR is preview, rather than main

…ly exposing the `VsCodeExtension` instance)
@sestinj sestinj force-pushed the preview branch 4 times, most recently from c102261 to bdd6449 Compare June 23, 2024 22:00
@sestinj
Copy link
Contributor

sestinj commented Jun 28, 2024

@FunkMonkey I'm going through all of the many PRs that have ended up on the back burner, and I realize now that I completely missed this. The principle I think we're coming to is that it's not best to accept "input" from other extensions. What I mean by this is that you could do something like registering a custom "slash command" or "context provider" (like here), but we don't want to allow arbitrary usage of Continue resources without the user triggering them. Especially when something like OAuth is in place to allow users to access resources from an account, this could pose a potential security risk.

I'm going to close this PR because of this, but I would be curious to hear in the GH issue whether you think that there might be another way of accomplishing what you're looking to do. Hope to hear from you, and hopefully we can make something work!

@sestinj sestinj closed this Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants