Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
5f5001e
reroute to /docs for the first docs link in readme
KTrain5169 Aug 26, 2025
091efbd
Merge branch 'dev' into patch/dev-stream
KTrain5169 Aug 26, 2025
ea3938a
Add CNAME to default list of files Neuro cannot open
KTrain5169 Aug 26, 2025
b1168db
i forgot to not make it a function
KTrain5169 Aug 26, 2025
8354ef6
Disallow additionalProperties for every action schema
Pasu4 Aug 26, 2025
7844897
refactor to use @ for src because I got confused lol
KTrain5169 Aug 27, 2025
b942e11
add positional arguments to insert_text
KTrain5169 Aug 27, 2025
be1d8e2
change first part of context message when the current file is sent
KTrain5169 Aug 27, 2025
8bb2aee
enforce 1 as the minimum line & column for position parameters
KTrain5169 Aug 27, 2025
a046e0b
Merge branch 'patch/dev-stream' of https://github.com/VSC-NeuroPilot/…
KTrain5169 Aug 27, 2025
8fd3980
i'm a bit stupid
KTrain5169 Aug 27, 2025
8252f78
Fix gutter icon path
Pasu4 Aug 27, 2025
01dea51
Fix relative positions
Pasu4 Aug 27, 2025
973251d
Fix insert_text absolute position handling + Fix CRLF conversion offset
Pasu4 Aug 27, 2025
8151bb7
Specify what happens to the cursor in action descriptions
Pasu4 Aug 27, 2025
5a8cd5d
Specify appropriate usage of new lines and indentation
Pasu4 Aug 27, 2025
8f671a1
Mark the package as private just in case changesets attempts to publi…
KTrain5169 Aug 27, 2025
e1fd534
Undo one change of ~ to @ since it was part of the Neuro-safe path ch…
KTrain5169 Aug 27, 2025
ae7e7d2
Update changelog and enhance NeuroPilot features
KTrain5169 Aug 28, 2025
be7d1d8
forgot to change the subpages LMAO
KTrain5169 Aug 28, 2025
e8f3d35
Merge branch 'dev' into patch/dev-stream
KTrain5169 Aug 28, 2025
a2f4fcc
add get_content action
KTrain5169 Aug 28, 2025
3a678a6
move get_content to editing actions
KTrain5169 Aug 28, 2025
52a823a
Change permission required for get_content to editActiveDocument + ad…
Pasu4 Aug 28, 2025
f8324ce
I'm sorry Neuro, but I;m afraid I can't let you do that.
KTrain5169 Aug 28, 2025
c2644db
Implement disabling individual actions
Pasu4 Aug 28, 2025
336f9c1
feat: add rewrite_all action
frogneko Aug 28, 2025
acd68a5
remove unnecessary import, recommend actionValidationRetry over setti…
KTrain5169 Aug 29, 2025
33263b2
Merge branch 'patch/dev-stream' of https://github.com/VSC-NeuroPilot/…
KTrain5169 Aug 29, 2025
5e1dbc7
Include PatienceDiff and convert to TypeScript
Pasu4 Aug 29, 2025
c6038e1
Fix: Reset pnpm-lock.yaml and remove test documentation files
frogneko Aug 29, 2025
9edc7d0
Merge pull request #93 from frogneko/patch/devstream/action-rewrite-all
Pasu4 Aug 29, 2025
6fcecfe
feat: add rewrite_lines action and implement character limit validation
frogneko Aug 29, 2025
d84fddf
change how obtaining extension states work
KTrain5169 Aug 30, 2025
269136b
change how insert_lines works
KTrain5169 Aug 30, 2025
3f39401
Merge branch 'patch/dev-stream' into patch/devstream/action-rewrite-l…
frogneko Aug 30, 2025
4ea9904
Merge pull request #94 from frogneko/patch/devstream/action-rewrite-l…
KTrain5169 Aug 30, 2025
3776400
add @frogneko's changes to changeset
KTrain5169 Aug 30, 2025
8e812ad
use file-types library to validate binary files
KTrain5169 Aug 30, 2025
c09e001
add binary file warning to open_file action desc
KTrain5169 Aug 30, 2025
00d10b1
Add delete_lines action, update rewrite_lines action cursor behavior …
frogneko Aug 30, 2025
ecc1c45
remove unnecessary import
KTrain5169 Aug 31, 2025
e07adcb
strip the cancel request action or neuropilot-specific details when r…
KTrain5169 Aug 31, 2025
7093e08
eslint fix
KTrain5169 Aug 31, 2025
ee21b21
Merge branch 'patch/dev-stream' into patch/devstream/action-delete-lines
KTrain5169 Aug 31, 2025
7d6415b
Merge pull request #95 from frogneko/patch/devstream/action-delete-lines
KTrain5169 Aug 31, 2025
1f1057d
as seen on tv:tm:
KTrain5169 Aug 31, 2025
f74de19
add extra newline character
KTrain5169 Aug 31, 2025
41f8f67
Implement showing last edit + fix handleInsertLines
Pasu4 Aug 31, 2025
b350703
Add enum item labels to the live linting context setting to clarify a…
KTrain5169 Sep 1, 2025
e989c84
Merge branch 'patch/dev-stream' of https://github.com/VSC-NeuroPilot/…
KTrain5169 Sep 1, 2025
df8dbbb
Implement highlighting
Pasu4 Sep 1, 2025
9f188f1
Fix cursorFollowsNeuro setting not scrolling to cursor
Pasu4 Sep 1, 2025
d5d07ff
Add changelogs I forgor + make changelog more consistent
Pasu4 Sep 1, 2025
1b48194
Merge branch 'dev' into patch/dev-stream
KTrain5169 Sep 1, 2025
9229cb0
Implement read_file action + change how neuro safe validation works (…
KTrain5169 Sep 1, 2025
27fdb03
tfw you forget to add a changelog item
KTrain5169 Sep 1, 2025
fb4aa2c
Implement context on file change
Pasu4 Sep 1, 2025
dbe0f3d
Change default context size to 500
Pasu4 Sep 1, 2025
f027196
import cleanup + correct comment
KTrain5169 Sep 1, 2025
9034079
Make sending contents on file change configurable
Pasu4 Sep 1, 2025
9b7635e
I needed those imports after all
Pasu4 Sep 1, 2025
574ec22
Add sort enum script + sort enums + add tsconfig inside playground be…
KTrain5169 Sep 1, 2025
b0d0cb8
Implement line ranges for delete_text, replace_text and find_text
Pasu4 Sep 2, 2025
bd720c2
Forgot to document again
Pasu4 Sep 2, 2025
252f9d9
make getting git extension via obtainExtensionState only doable on de…
KTrain5169 Sep 3, 2025
b7d57c5
Add line numbers
Pasu4 Sep 3, 2025
ac92a04
Change highlight behaviour to not select with the real cursor
Pasu4 Sep 3, 2025
1a2ec9a
Clarify and correct cursor info in action descriptions
Pasu4 Sep 3, 2025
7f33ad6
Add erm.png for binary testing
Pasu4 Sep 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .changeset/clean-crews-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
"neuropilot": minor
---

This update was made in response to the Evil dev stream on 2025-08-28. [Here's the VoD, courtesy of Neuro Archiver](https://www.youtube.com/watch?v=AIYaBYVX95o).

- All actions with a schema now specify `additionalProperties: false`.
- While this is marked as "probably not supported" by the Neuro API spec, NeuroPilot checks the action against the schema via the `jsonschema` library, so enforcement will still happen, albeit on NeuroPilot's side instead of the Neuro API server.
- If you are testing with tools like Tony or Jippity, you can safely ignore the warning.
- The NeuroPilot v1 icon now shows in the gutter (the area to the left of the line count in a file). This already did show, even on stream, but after moving all assets into /assets/ we forgot to change it on dev branch.
- And yes, this was never pushed to production, so technically this isn't a noteworthy "change", but it's here now.
- `CNAME` (the file usually used to set a custom domain name) has now been added to the default list of Exclude Patterns that the connected Neuro twin cannot access.
- We now have a changelog! We are trialing the use of the [changesets](https://github.com/changesets) tools to generate changelogs automatically. These changelogs should appear inside VS Code.
- All editing actions that move the cursor now mention in their description that the cursor moves after usage.
- Certain actions have had usage instructions clarified in their description.
- Invalid cursor positions now fail at RCE validation time instead of execution time. This should improve the experience when using Copilot mode with editing actions.
- Actions `replace_text`, `delete_text` and `find_text` now allow specifying a line range to search in.
- The context message to send the current file to the connected Neuro twin is changed to indicate that Vedal used the command.
- CRLF conversion offset has been fixed when using `insert_text`.
- Docs are now hosted at [a different subpage](https://vsc-neuropilot.github.io/docs) than before. While this isn't part of the extension itself, the link on the README file broke as a result of this change. This has now been fixed.
- The way that the open docs commands work is slightly different, now having a dropdown to select instead of opening our own docs directly. This is in preparation for our public API for extending NeuroPilot.
- For now, you'll be selecting the `NeuroPilot` option most/all of the time.
- You can now optionally specify a format for line numbers in code context with the settings `lineNumberContextFormat`.
- The `find_text` action now also uses this format.
- You can now specify how Neuro will get the cursor position with the setting `cursorPositionContextStyle`.
- Code context now includes the total number of lines in the file.
- The setting `cursorFollowsNeuro` now actually scrolls to the cursor position.
- All actions can now be individually disabled using the new setting `disabledActions`.
- Neuro will now be notified when the editor changes (e.g. by opening a file or switching to another tab).
- By default, Neuro will get the contents of the file if it is Neuro-safe, this can be configured with the setting `sendContentsOnFileChange`.
- Changed the default context size around the cursor from 10 to 500.
- All editing actions now have a 100,000 character limit. If this is exceeded, the action will be rejected.
- Editing actions now highlight Neuro's latest edit.
- Deletions and modifications show the deleted or replaced text as a tooltip.
- The highlights will be cleared when the document is changed or edited.
- Added `get_content` action which sends the current file's contents. This works more or less the same as the Send Current File as Context command.
- Added `insert_lines` action which inserts text below a certain line. This also makes new lines if necessary.
- Added `rewrite_all` action which rewrites the entire file immediately.
- Added `rewrite_lines` action which rewrites text in between a specified line range and moves the cursor to the end of the last added line.
- Added `delete_lines` action which deletes text in between a specificed range and moves the cursor to the end of the line before the deleted lines.
- Added `highlight_lines` action which selects text in a specified range and moves moves the view there.
- Added `read_file` action which returns the entire contents of a file in the workspace without opening it.
15 changes: 1 addition & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,5 @@
"neuropilot",
"Pasu",
"sama"
],
"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": false,
"scminput": false,
"latex": false,
"properties": false,
"feature": false,
"ignore": false,
"jsonc": false,
"hjson": false,
"json": true
}
]
}
3 changes: 3 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ project-files/
esbuild.{m,c,}js
esbuild-configs/

# Other meta scripts
./sort-enums.ts

# Krita
*.kra
*.*~
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# <img src="assets/heart-xaendril.png" width="32" style="vertical-align:middle;horizontal-align:middle;"> NeuroPilot

As seen on TV (dev stream)!

**Disclaimer: For simplicity, all mentions of Neuro also apply to Evil unless otherwise stated.**

This extension enables Neuro-sama to write code in Visual Studio Code, either together with a programmer or on her own.
Expand Down Expand Up @@ -28,7 +30,7 @@ Capabilities of this extension include:
These can all be turned on or off using the extension's permission settings.
All permissions are set to "Off" by default, [except one](vscode://settings/neuropilot.permission.requestCookies).

For more detailed documentation, visit [the docs site](https://vsc-neuropilot.github.io/neuropilot).
For more detailed documentation, visit [the docs site](https://vsc-neuropilot.github.io/docs).
We've recently migrated a lot of information there, so you're more likely to find the information you're looking for there.

> [!WARNING]
Expand Down Expand Up @@ -99,7 +101,7 @@ The short answer is no, there isn't an intentional Remote Code Execution vulnera
## Debugging

- Clone the repository
- Run `npm install` in terminal to install dependencies
- Run `pnpm install` in terminal to install dependencies
- Run the `Run Extension` target in the Debug View. This will:
- Start a task `npm: watch` to compile the code
- Run the extension in a new VS Code window
Expand Down
2 changes: 1 addition & 1 deletion esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ switch (mode.toLowerCase()) {
outDir = './out';
}

const directoryPlural = outDir.length() === 1 || outDir.length() === -1 ? 'directory' : 'directories';
const directoryPlural = outDir.length === 1 || outDir.length === -1 ? 'directory' : 'directories';
if (fs.existsSync(outDir)) {
console.log(chalk.yellow(`🗑️ Output ${directoryPlural} ${outDir} already exists, removing dir...`));
fs.rmSync(outDir, {recursive: true});
Expand Down
6 changes: 4 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export default tseslint.config(
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
{
ignores: ['eslint.config.mjs'],
plugins: {
'@stylistic': stylistic,
'unicorn': eslintPluginUnicorn,
Expand All @@ -50,7 +49,10 @@ export default tseslint.config(
'curly': 'off',
'no-control-regex': 'off',
'@stylistic/semi': ['error', 'always'],
'@stylistic/indent': ['warn', 4],
'@stylistic/indent': ['warn', 4, {
'flatTernaryExpressions': true,
'SwitchCase': 1,
}],
'@stylistic/comma-dangle': ['warn', 'always-multiline'],
'@stylistic/eol-last': ['warn', 'always'],
'@stylistic/no-extra-parens': ['warn', 'all'],
Expand Down
120 changes: 115 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "neuropilot",
"displayName": "NeuroPilot",
"private": true,
"description": "Allows Neuro-sama to either act as a companion/copilot or control Visual Studio Code by herself.",
"icon": "assets/heart-xaendril.png",
"version": "2.0.3",
Expand Down Expand Up @@ -199,17 +200,17 @@
},
"neuropilot.docsURL": {
"type": "string",
"default": "https://vsc-neuropilot.github.io/neuropilot",
"default": "https://vsc-neuropilot.github.io/docs",
"markdownDescription": "If you're using a mirror of the docs site, put its URL here.\n\nYou will most likely not need to change this, unless you are modifying the docs themselves."
},
"neuropilot.beforeContext": {
"type": "integer",
"default": 10,
"default": 500,
"description": "The number of lines before the cursor position to include as context when editing a file or sending a completion request"
},
"neuropilot.afterContext": {
"type": "integer",
"default": 10,
"default": 500,
"description": "The number of lines after the cursor position to include as context when editing a file or sending a completion request"
},
"neuropilot.maxCompletions": {
Expand Down Expand Up @@ -245,7 +246,7 @@
},
"neuropilot.excludePattern": {
"type": "string",
"default": "**/node_modules/**\n**/venv/**",
"default": "**/node_modules/**\n**/venv/**\nCNAME",
"markdownDescription": "A glob pattern for files Neuro is not allowed to open. Applied after the include pattern. Files and folders beginning with a dot are always excluded, regardless of this setting. Separate multiple patterns with a newline.",
"editPresentation": "multilineText"
},
Expand Down Expand Up @@ -490,7 +491,7 @@
"Require approval before execution.",
"Execute without oversight."
],
"markdownDescription": "Allow Neuro __direct terminal access__. Be very careful with this.\nRequires [reloading permissions](command:neuropilot.reloadPermissions) if turned from \"on\" to off, and vice versa."
"markdownDescription": "Allow Neuro __direct terminal access__. Be very careful with this.\n\nRequires [reloading permissions](command:neuropilot.reloadPermissions) if turned from \"on\" to off, and vice versa."
},
"neuropilot.permission.accessLintingAnalysis": {
"type": "string",
Expand Down Expand Up @@ -536,6 +537,11 @@
"inCurrentFile",
"inWorkspace"
],
"enumItemLabels": [
"When manually checked",
"If it's in the current file",
"If it's any Neuro-safe file in the workspace"
],
"enumDescriptions": [
"Only when Neuro explicitly checks for it.",
"If a new problem appears in the file she is currently viewing.",
Expand Down Expand Up @@ -581,6 +587,109 @@
"Always open docs in a new WebView window"
],
"markdownDescription": "Choose where to open docs links.\n\nThis applies to both docs commands."
},
"neuropilot.disabledActions": {
"type": "array",
"default": [],
"items": {
"type": "string",
"enum": [
"abort_merge",
"add_file_to_git",
"add_git_remote",
"create_file",
"create_folder",
"delete_file_or_folder",
"delete_git_branch",
"delete_lines",
"delete_tag",
"delete_text",
"diff_files",
"execute_in_terminal",
"fetch_git_commits",
"find_text",
"get_content",
"get_currently_running_shells",
"get_cursor",
"get_file_lint_problems",
"get_files",
"get_folder_lint_problems",
"get_git_config",
"get_workspace_lint_problems",
"git_blame",
"git_log",
"git_status",
"highlight_lines",
"init_git_repo",
"insert_lines",
"insert_text",
"kill_terminal_process",
"make_git_commit",
"merge_to_current_branch",
"new_git_branch",
"open_file",
"place_cursor",
"pull_git_commits",
"push_git_commits",
"read_file",
"remove_file_from_git",
"remove_git_remote",
"rename_file_or_folder",
"rename_git_remote",
"replace_text",
"request_cookie",
"rewrite_all",
"rewrite_lines",
"save",
"set_git_config",
"switch_git_branch",
"tag_head",
"terminate_task",
"undo"
]
},
"markdownDescription": "List of action names that Neuro can't use, regardless of other permission settings.\n\nRequires [reloading permissions](command:neuropilot.reloadPermissions) if changed."
},
"neuropilot.sendContentsOnFileChange": {
"type": "boolean",
"default": true,
"markdownDescription": "Send contents of a file to Neuro when you switch to it? If false, Neuro will still know what file you switched to, but won't get the contents. Neuro will never get the contents or the name of files that aren't Neuro-safe."
},
"neuropilot.cursorPositionContextStyle": {
"type": "string",
"default": "inline",
"markdownDescription": "The style to use for specifying the cursor position in context messages.",
"enum": [
"off",
"inline",
"lineAndColumn",
"both"
],
"enumItemLabels": [
"Off",
"Inline",
"Line and column",
"Inline + Line and column"
],
"markdownEnumDescriptions": [
"Cursor position will not be mentioned to Neuro",
"\"Cursor position denoted by `<<<|>>>`\"",
"\"Cursor is at 198:4\"",
"\"Cursor is at 198:4, denoted by `<<<|>>>`\""
]
},
"neuropilot.lineNumberContextFormat": {
"type": "string",
"default": "",
"markdownDescription": "The format to use for line numbers in context messages. This format will be prepended to every line. Use `{n}` for the line number. Edit in settings.json for examples.",
"examples": [
"",
"{n} ",
"{n}|",
"{n}: ",
"/* {n} */ ",
"L. {n}: "
]
}
}
}
Expand Down Expand Up @@ -667,6 +776,7 @@
"typescript-eslint": "^8.26.0"
},
"dependencies": {
"file-type": "^21.0.0",
"glob-to-regexp": "^0.4.1",
"jsonschema": "^1.5.0",
"neuro-game-sdk": "^1.0.5"
Expand Down
Binary file added playground/erm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions playground/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ export default tseslint.config(
},
],
},
languageOptions: {
parserOptions: {
tsconfigRootDir: import.meta.dirname,
project: './tsconfig.json',
},
},
},
{
files: ['**/*.{js,mjs,cjs,ts}'],
Expand Down
44 changes: 44 additions & 0 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
// Visit https://aka.ms/tsconfig to read more about this file
"compilerOptions": {
// File Layout
// "rootDir": "./src",
// "outDir": "./dist",

// Environment Settings
// See also https://aka.ms/tsconfig/module
"module": "nodenext",
"target": "esnext",
"types": [],
// For nodejs:
// "lib": ["esnext"],
// "types": ["node"],
// and npm install -D @types/node

// Other Outputs
"sourceMap": true,
"declaration": true,
"declarationMap": true,

// Stricter Typechecking Options
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,

// Style Options
// "noImplicitReturns": true,
// "noImplicitOverride": true,
// "noUnusedLocals": true,
// "noUnusedParameters": true,
// "noFallthroughCasesInSwitch": true,
// "noPropertyAccessFromIndexSignature": true,

// Recommended Options
"strict": true,
"jsx": "react-jsx",
"verbatimModuleSyntax": true,
"isolatedModules": true,
"noUncheckedSideEffectImports": true,
"moduleDetection": "force",
"skipLibCheck": true,
}
}
Loading