@vsc-neuropilot/api-types 1.0.0-pre.2 → 1.0.0-pre.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/index.d.mts +87 -36
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +53 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,28 @@ For prereleases:
|
|
|
19
19
|
- Pre-release versions (x.x.x-pre.x) are unstable releases for the designated API version. These contain work-in-progress types and annotations. Pre-release versions are not meant to be used except for trying out new API interfaces and giving feedback, and may change without prior programmatic notice. Pre-release versions are meant to be used with new builds from the `dev` branch of the base extension repo.
|
|
20
20
|
- Release candidates (x.x.x-rc.x) are stable previews for the designated API version. These contain types that are more or less finalized for the designated release. Breaking changes should not be expected, both in type signature and functionality, but will always be highlighted in the changelog if necessary. This is also meant for feedback, but only for more subtle feedback before releasing that version such that it simply just contains bug fixes and very minor changes.
|
|
21
21
|
|
|
22
|
+
## 1.0.0-pre.4
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- `RCEAction.contextSetupHook` is now pluralized to `contextSetupHooks`, matching that it's an array.
|
|
27
|
+
- `RCEAction.storage` can no longer be set to undefined.
|
|
28
|
+
|
|
29
|
+
## 1.0.0-pre.3
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- An enum containing strings to certain settings, provided for backwards compatibility reasons.
|
|
34
|
+
- Note that setting names themselves are not under API SemVer compliance.
|
|
35
|
+
- For this reason, it is recommended to use the new enum when needing to access NeuroPilot's settings.
|
|
36
|
+
- Example:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import * as vscode from 'vscode';
|
|
40
|
+
import { NeuroPilotSetting } from '@vsc-neuropilot/api-types'
|
|
41
|
+
|
|
42
|
+
vscode.workspace.getConfiguration(`neuropilot.${NeuroPilotSetting.GameName}`)
|
|
43
|
+
|
|
22
44
|
## 1.0.0-pre.2
|
|
23
45
|
|
|
24
46
|
### Added
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Action, ActionData, ActionForcePriorityEnum, ActionForcePriorityEnum as ActionForcePriorityEnum$1 } from "neuro-game-sdk";
|
|
2
2
|
import { JSONSchema7Object } from "json-schema";
|
|
3
|
-
import * as vscode
|
|
4
|
-
import { Disposable, Event, Position, Progress, Range, TextEditorDecorationType } from "vscode";
|
|
3
|
+
import * as vscode from "vscode";
|
|
4
|
+
import { Disposable, Event, Position, Progress, Range, TextEditorDecorationType, Uri } from "vscode";
|
|
5
5
|
|
|
6
6
|
//#region src/actions/enums.d.ts
|
|
7
7
|
/** Permission level enums */
|
|
@@ -116,7 +116,7 @@ declare class RCEContext<T extends JSONSchema7Object | undefined = any, K = any>
|
|
|
116
116
|
* each stage.
|
|
117
117
|
* This data does not persist across different executions.
|
|
118
118
|
*/
|
|
119
|
-
storage
|
|
119
|
+
storage: RCEStorage;
|
|
120
120
|
/**
|
|
121
121
|
* Updates the status of the action on the action execution history panel
|
|
122
122
|
* @param status The new status to update to
|
|
@@ -311,7 +311,7 @@ interface RCEAction<T extends JSONSchema7Object | undefined = any, E = any> exte
|
|
|
311
311
|
*
|
|
312
312
|
* These functions will be parallelised, so the same key should not be accessed from multiple functions.
|
|
313
313
|
*/
|
|
314
|
-
|
|
314
|
+
contextSetupHooks?: ((context: RCEContext<T, E>) => Thenable<void>)[];
|
|
315
315
|
}
|
|
316
316
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
317
317
|
type PromptGenerator<T extends JSONSchema7Object | undefined, E = any> = string | ((context: RCEContext<T, E>) => string);
|
|
@@ -472,34 +472,8 @@ declare class CompanionAPI extends Disposable {
|
|
|
472
472
|
* These are separated due to them returning Disposables that need to be handled better.
|
|
473
473
|
*/
|
|
474
474
|
actionUtils: {
|
|
475
|
-
files:
|
|
476
|
-
|
|
477
|
-
* Mark certain files with a preview effect.
|
|
478
|
-
* @param uris An array of files to mark. Direct inputs here are automatically assumed to be Neuro-safe, you must perform your own Neuro-safe checks at call time.
|
|
479
|
-
* @param promptString A string that describes what Neuro is about to do. Should match the scheme "Neuro wants to (do something)"
|
|
480
|
-
* @param absolutelyAllFiles For folders, bypass checking children for Neuro-safe path validation and highlights them anyways. Has no effect on files.
|
|
481
|
-
* @param noChildren For folders, does not mark its children in the preview effect. Has no effect on files.
|
|
482
|
-
* @returns A Disposable that, when its dispose method is called, unmarks the marked files.
|
|
483
|
-
*/
|
|
484
|
-
markPreviewFiles(uris: vscode.Uri[], promptString: string, absolutelyAllFiles = false, noChildren = false): Disposable;
|
|
485
|
-
};
|
|
486
|
-
edits: {
|
|
487
|
-
/**
|
|
488
|
-
* Set a preview cursor that matches the normal colour scheme for NeuroPilot's preview cursor.
|
|
489
|
-
* @param location A {@link Position} object where the cursor will be placed.
|
|
490
|
-
* @param prompt The prompt suffix that displays when hovering over the cursor. Must match the scheme "Neuro wants to (x)"
|
|
491
|
-
* @returns The {@link TextEditorDecorationType} that was used to create the highlight.
|
|
492
|
-
*/
|
|
493
|
-
setPreviewCursor(location: Position, prompt: string): TextEditorDecorationType;
|
|
494
|
-
/**
|
|
495
|
-
* Set a preview highlight that matches the normal colour scheme for NeuroPilot's preview highlights.
|
|
496
|
-
* @param startPosition A {@link Position} object that marks the start of the highlight.
|
|
497
|
-
* @param endPosition A {@link Position} object that marks the end of the highlight.
|
|
498
|
-
* @param prompt The prompt suffix that displays when hovering over the cursor. Must match the scheme "Neuro wants to (x)"
|
|
499
|
-
* @returns The {@link TextEditorDecorationType} that was used to create the highlight.
|
|
500
|
-
*/
|
|
501
|
-
setPreviewHighlight(startPosition: Position, endPosition: Position, prompt: string): TextEditorDecorationType;
|
|
502
|
-
};
|
|
475
|
+
files: FileActionUtils;
|
|
476
|
+
edits: EditActionUtils;
|
|
503
477
|
/**
|
|
504
478
|
* Creates a new cancel event for RCE.
|
|
505
479
|
* Make sure to properly dispose of them when you no longer need the cancel events.
|
|
@@ -639,6 +613,34 @@ interface CompanionMeta {
|
|
|
639
613
|
*/
|
|
640
614
|
contributes: Contributions[];
|
|
641
615
|
}
|
|
616
|
+
interface FileActionUtils {
|
|
617
|
+
/**
|
|
618
|
+
* Mark certain files with a preview effect.
|
|
619
|
+
* @param uris An array of files to mark. Direct inputs here are automatically assumed to be Neuro-safe, you must perform your own Neuro-safe checks at call time.
|
|
620
|
+
* @param promptString A string that describes what Neuro is about to do. Should match the scheme "Neuro wants to (do something)"
|
|
621
|
+
* @param absolutelyAllFiles For folders, bypass checking children for Neuro-safe path validation and highlights them anyways. Has no effect on files.
|
|
622
|
+
* @param noChildren For folders, does not mark its children in the preview effect. Has no effect on files.
|
|
623
|
+
* @returns A Disposable that, when its dispose method is called, unmarks the marked files.
|
|
624
|
+
*/
|
|
625
|
+
markPreviewFiles(uris: Uri[], promptString: string, absolutelyAllFiles?: boolean, noChildren?: boolean): Disposable;
|
|
626
|
+
}
|
|
627
|
+
interface EditActionUtils {
|
|
628
|
+
/**
|
|
629
|
+
* Set a preview cursor that matches the normal colour scheme for NeuroPilot's preview cursor.
|
|
630
|
+
* @param location A {@link Position} object where the cursor will be placed.
|
|
631
|
+
* @param prompt The prompt suffix that displays when hovering over the cursor. Must match the scheme "Neuro wants to (x)"
|
|
632
|
+
* @returns The {@link TextEditorDecorationType} that was used to create the highlight.
|
|
633
|
+
*/
|
|
634
|
+
setPreviewCursor(location: Position, prompt: string): TextEditorDecorationType;
|
|
635
|
+
/**
|
|
636
|
+
* Set a preview highlight that matches the normal colour scheme for NeuroPilot's preview highlights.
|
|
637
|
+
* @param startPosition A {@link Position} object that marks the start of the highlight.
|
|
638
|
+
* @param endPosition A {@link Position} object that marks the end of the highlight.
|
|
639
|
+
* @param prompt The prompt suffix that displays when hovering over the cursor. Must match the scheme "Neuro wants to (x)"
|
|
640
|
+
* @returns The {@link TextEditorDecorationType} that was used to create the highlight.
|
|
641
|
+
*/
|
|
642
|
+
setPreviewHighlight(startPosition: Position, endPosition: Position, prompt: string): TextEditorDecorationType;
|
|
643
|
+
}
|
|
642
644
|
//#endregion
|
|
643
645
|
//#region src/companions/errors.d.ts
|
|
644
646
|
/**
|
|
@@ -778,7 +780,7 @@ interface DiffUtils {
|
|
|
778
780
|
* - Word diff: `/\w+|\r?\n|\s+|./g`
|
|
779
781
|
* - Character diff: `/.|\r?\n/g`
|
|
780
782
|
*/
|
|
781
|
-
calculateDiffRanges(startPosition: vscode
|
|
783
|
+
calculateDiffRanges(startPosition: vscode.Position, oldText: string, newText: string, tokenRegExp?: RegExp): DiffRange[];
|
|
782
784
|
/**
|
|
783
785
|
* Apply diff highlighting to a text editor based on the provided diff ranges.
|
|
784
786
|
* If you use {@link DiffUtils.calculateDiffRanges calculateDiffRanges} to calculate the
|
|
@@ -788,7 +790,7 @@ interface DiffUtils {
|
|
|
788
790
|
* If you use {@link DiffUtils.calculateDiffRanges calculateDiffRanges} to calculate these,
|
|
789
791
|
* the current text in the editor should be provided as the `newText` parameter.
|
|
790
792
|
*/
|
|
791
|
-
applyDiffHighlighting(editor: vscode
|
|
793
|
+
applyDiffHighlighting(editor: vscode.TextEditor, diffRanges: DiffRange[]): void;
|
|
792
794
|
}
|
|
793
795
|
interface FilePathUtils {
|
|
794
796
|
/**
|
|
@@ -814,7 +816,7 @@ interface WorkspaceUtils {
|
|
|
814
816
|
* Gets the full workspace uri that is normally targeted for operations.
|
|
815
817
|
* In multi-root workspaces this is the first open workspace.
|
|
816
818
|
*/
|
|
817
|
-
getWorkspaceUri(): vscode
|
|
819
|
+
getWorkspaceUri(): vscode.Uri | undefined;
|
|
818
820
|
/**
|
|
819
821
|
* Gets the full workspace path that is normally targeted for operations.
|
|
820
822
|
* (Same as calling {@link WorkspaceUtils.getWorkspaceUri getWorkspaceUri}.fsPath)
|
|
@@ -858,7 +860,56 @@ interface NeuroPilotAPI {
|
|
|
858
860
|
*/
|
|
859
861
|
utils: Utils;
|
|
860
862
|
}
|
|
863
|
+
/**
|
|
864
|
+
* The setting IDs of NeuroPilot's settings.
|
|
865
|
+
*
|
|
866
|
+
* @example
|
|
867
|
+
* ```ts
|
|
868
|
+
* const nameOfAPI = vscode.workspace.getConfiguration('neuropilot').get<string>(NeuroPilotSetting.NameOfAPI);
|
|
869
|
+
* ```
|
|
870
|
+
*/
|
|
871
|
+
declare const enum NeuroPilotSetting {
|
|
872
|
+
/** The number of lines before the cursor position to include as context when editing a file or sending a completion request. */
|
|
873
|
+
BeforeContext = "beforeContext",
|
|
874
|
+
/** The number of lines after the cursor position to include as context when editing a file or sending a completion request. */
|
|
875
|
+
AfterContext = "afterContext",
|
|
876
|
+
/** Whether the real cursor follows Neuro's cursor. */
|
|
877
|
+
CursorFollowsNeuro = "cursorFollowsNeuro",
|
|
878
|
+
/**
|
|
879
|
+
* Whether to send contents of a file to Neuro when the user switches to it.
|
|
880
|
+
* If false, Neuro will still know what file was switched to, but won't get the contents.
|
|
881
|
+
* Neuro will never get the contents or the name of files that aren't Neuro-safe.
|
|
882
|
+
*/
|
|
883
|
+
SendContentsOnFileChange = "sendContentsOnFileChange",
|
|
884
|
+
/**
|
|
885
|
+
* The style to use for specifying the cursor position in context messages.
|
|
886
|
+
* Possible values are:
|
|
887
|
+
* - `"off"`: Cursor position should not be mentioned to Neuro.
|
|
888
|
+
* - `"inline"`: Cursor position should be denoted by `<<<|>>>`
|
|
889
|
+
* - `"lineAndColumn"`: Cursor position should be reported in <line>:<column> format (one-based).
|
|
890
|
+
* - `"both"`: Combination of `"inline"` and `"lineAndColumn"`.
|
|
891
|
+
*/
|
|
892
|
+
CursorPositionContextStyle = "cursorPositionContextStyle",
|
|
893
|
+
/**
|
|
894
|
+
* The format to use for line numbers in context messages.
|
|
895
|
+
* This format should be prepended to every line.
|
|
896
|
+
* `{n}` is used for the line number. Examples:
|
|
897
|
+
* - `""`
|
|
898
|
+
* - `"{n} "`
|
|
899
|
+
* - `"{n}|"`
|
|
900
|
+
* - `"{n}: "`
|
|
901
|
+
*/
|
|
902
|
+
LineNumberContextFormat = "lineNumberContextFormat",
|
|
903
|
+
/** The URL to connect to the Neuro API. */
|
|
904
|
+
WebsocketUrl = "connection.websocketUrl",
|
|
905
|
+
/** The game name NeuroPilot reports to the API. */
|
|
906
|
+
GameName = "connection.gameName",
|
|
907
|
+
/** The name to indicate who is controlling this VS Code instance alongside the API server. This replaces the default name `Vedal`. */
|
|
908
|
+
UserName = "connection.userName",
|
|
909
|
+
/** The name of the entity currently acting as the API server. You can add custom characters using `settings.json` if you ignore the lint error from VS Code. */
|
|
910
|
+
NameOfAPI = "connection.nameOfAPI"
|
|
911
|
+
}
|
|
861
912
|
type ItselfOrArray<T> = T | T[];
|
|
862
913
|
//#endregion
|
|
863
|
-
export { ActionForceParams, ActionForcePriorityEnum, ActionHandlerResult, ActionStatus, ActionValidationResult, ActionsEventData, BaseCompanionError, CompanionAPI, CompanionMeta, CompanionRegistryError, Contributions, Diff, DiffLine, DiffPlus, DiffPlusLine, DiffRange, DiffRangeType, InjectionBaseData, NeuroPilotAPI, PermissionError, PermissionLevel, PromptGenerator, RCEAction, RCECancelEvent, RCECancelEventInitializer, RCEContext, RCEHandlerReturns, RCELifecycleMetadata, RCERequestState, RCEStorage, ReasonGenerator, SimplifiedStatusUpdateHandler };
|
|
914
|
+
export { ActionForceParams, ActionForcePriorityEnum, ActionHandlerResult, ActionStatus, ActionValidationResult, ActionsEventData, BaseCompanionError, CompanionAPI, CompanionMeta, CompanionRegistryError, Contributions, Diff, DiffLine, DiffPlus, DiffPlusLine, DiffRange, DiffRangeType, InjectionBaseData, NeuroPilotAPI, NeuroPilotSetting, PermissionError, PermissionLevel, PromptGenerator, RCEAction, RCECancelEvent, RCECancelEventInitializer, RCEContext, RCEHandlerReturns, RCELifecycleMetadata, RCERequestState, RCEStorage, ReasonGenerator, SimplifiedStatusUpdateHandler };
|
|
864
915
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":["JSONSchema7Object","Disposable","Progress","Event","ActionValidationResult","RCEAction","ActionData","RCEStorage","Record","ActionStatus","RCELifecycleMetadata","events","preview","dispose","validatorResults","sync","async","setupHooks","SimplifiedStatusUpdateHandler","status","message","RCERequestState","Promise","NodeJS","Timeout","prompt","notificationVisible","attachNotification","increment","progress","resolve","resolved","interval","timeout","RCEContext","T","K","name","createdAt","data","action","forced","lifecycle","request","storage","updateStatus","done","success","clearPreHandlerResources","ReasonGenerator","context","RCECancelEventInitializer","reason","logReason","RCECancelEvent","event","disposable","fire","constructor","init","JSONSchema7Object","ActionForcePriorityEnum","Action","NeuroClient","Range","PermissionLevel","DiffRangeType","RCECancelEvent","RCEContext","ActionStatus","CompanionAPI","ActionForceParams","COPILOT","AUTOPILOT","Record","state","query","ephemeral_context","actionNames","priority","overridePermissions","RCEAction","T","E","ActionValidationResult","Promise","RCEHandler","PromptGenerator","Thenable","displayName","validators","sync","context","async","cancelEvents","preview","dispose","handler","promptGenerator","defaultPermission","category","autoRegister","hidden","registerCondition","contextSetupHook","RCEHandlerReturns","ActionHandlerResult","success","message","retry","historyNote","ActionHandlerSuccess","InjectionBaseData","Omit","ActionsEventData","action","status","executionId","DiffLine","text","oldIndex","newIndex","DiffPlusLine","moved","Diff","lines","lineCountDeleted","lineCountInserted","DiffPlus","lineCountMoved","DiffRange","range","type","removedText","Disposable","Event","Position","ExtensionContext","Extension","Uri","TextEditorDecorationType","ActionForceParams","ActionsEventData","InjectionBaseData","RCEAction","Contributions","RCECancelEvent","CompanionAPI","CompanionMeta","vscode","Partial","constructor","data","actionUtils","files","markPreviewFiles","uris","promptString","absolutelyAllFiles","noChildren","edits","setPreviewCursor","location","prompt","setPreviewHighlight","startPosition","endPosition","CancelEvent","addActions","actions","register","removeActions","registerAction","action","unregisterAction","reregisterAllActions","conservative","tryForceActions","params","strict","injectIntoAction","name","injection","force","onActionStatusChanged","sendContext","message","silent","addChangelog","version","changelog","getCursor","setCursor","onDidMoveCursor","extensionId","author","docs","contributes"],"sources":["../src/actions/enums.ts","../src/actions/classes.d.ts","../src/actions/types.d.ts","../src/companions/enum.ts","../src/companions/register.d.ts","../src/companions/errors.ts","../src/index.ts"],"mappings":";;;;;;;mBACkB,eAAA;EACd,GAAA;EACA,OAAA;EACA,SAAA;AAAA;AAHJ;AAAA,mBAOkB,aAAA;EACd,KAAA;EACA,QAAA;EACA,OAAA;AAAA;;;;KCHQO,UAAAA,GAAaC,MAAAA;AAAAA,KAEbC,YAAAA;AAAAA,UAEKC,oBAAAA;EACbC,MAAAA,GAASV,UAAAA;EACTW,OAAAA;IAAYC,OAAAA;EAAAA;EACZC,gBAAAA;IACIC,IAAAA,GAAOX,sBAAAA;IACPY,KAAAA,GAAQZ,sBAAAA;EAAAA;EAEZa,UAAAA;AAAAA;AAAAA,KAGQC,6BAAAA,IAAiCC,MAAAA,EAAQV,YAAAA,EAAcW,OAAAA;AAAAA,UAElDC,eAAAA;;;AAhBjB;EAoBII,MAAAA;;;;EAIAC,mBAAAA;EAtBoB;;;;AAExB;;EA2BIC,kBAAAA,GAAqBE,QAAAA,EAAU3B,QAAAA;IAAWkB,OAAAA;IAAkBQ,SAAAA;EAAAA,OAA0BN,OAAAA;EA1B7ErB;;;;EA+BT6B,OAAAA;EA/BAnB;;;EAmCAoB,QAAAA;EAjCAjB;;;EAqCAkB,QAAAA,GAAWT,MAAAA,CAAOC,OAAAA;EAnCNpB;;;EAuCZ6B,OAAAA,GAAUV,MAAAA,CAAOC,OAAAA;AAAAA;;;;;;;;AAhCrB;;;cA6CaU,UAAAA,WAAqBlC,iBAAAA,qCAAsDC,UAAAA;EA9BEqB;EAgCtFe,IAAAA;EAfUd;EAiBVe,SAAAA;EA7CAb;;;;EAmDAc,IAAAA,EAAMjC,UAAAA,CAAW6B,CAAAA;EAxC2CP;;;;EA6C5DY,MAAAA,EAAQnC,SAAAA,CAAU8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;AAO5B;;;EKWI,eAAA,IAAmB,QAAA,CAAO,GAAA;;;;;EAK1B,gBAAA;AAAA;AAAA,UAGM,KAAA;ELjBV;;;EKqBI,gBAAA,EAAkB,qBAAA;;;;EAIlB,aAAA,EAAe,kBAAA;;;;EAIf,cAAA,EAAgB,mBAAA;ELvBmC;;;EK2BnD,KAAA,EAAO,SAAA;;;;EAIP,SAAA,EAAW,aAAA;;;;EAIX,SAAA,EAAW,cAAA;AAAA;AAAA,UAGE,aAAA;;;ALnCjB;;EKwCI,SAAA,SAAkB,YAAA;;;;EAIlB,KAAA,EAAO,KAAA;AAAA;AAAA,KAGN,aAAA,MAAmB,CAAA,GAAI,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":["JSONSchema7Object","Disposable","Progress","Event","ActionValidationResult","RCEAction","ActionData","RCEStorage","Record","ActionStatus","RCELifecycleMetadata","events","preview","dispose","validatorResults","sync","async","setupHooks","SimplifiedStatusUpdateHandler","status","message","RCERequestState","Promise","NodeJS","Timeout","prompt","notificationVisible","attachNotification","increment","progress","resolve","resolved","interval","timeout","RCEContext","T","K","name","createdAt","data","action","forced","lifecycle","request","storage","updateStatus","done","success","clearPreHandlerResources","ReasonGenerator","context","RCECancelEventInitializer","reason","logReason","RCECancelEvent","event","disposable","fire","constructor","init","JSONSchema7Object","ActionForcePriorityEnum","Action","NeuroClient","Range","PermissionLevel","DiffRangeType","RCECancelEvent","RCEContext","ActionStatus","CompanionAPI","ActionForceParams","COPILOT","AUTOPILOT","Record","state","query","ephemeral_context","actionNames","priority","overridePermissions","RCEAction","T","E","ActionValidationResult","Promise","RCEHandler","PromptGenerator","Thenable","displayName","validators","sync","context","async","cancelEvents","preview","dispose","handler","promptGenerator","defaultPermission","category","autoRegister","hidden","registerCondition","contextSetupHooks","RCEHandlerReturns","ActionHandlerResult","success","message","retry","historyNote","ActionHandlerSuccess","InjectionBaseData","Omit","ActionsEventData","action","status","executionId","DiffLine","text","oldIndex","newIndex","DiffPlusLine","moved","Diff","lines","lineCountDeleted","lineCountInserted","DiffPlus","lineCountMoved","DiffRange","range","type","removedText","Disposable","Event","Position","ExtensionContext","Extension","Uri","TextEditorDecorationType","ActionForceParams","ActionsEventData","InjectionBaseData","RCEAction","Contributions","RCECancelEvent","CompanionAPI","CompanionMeta","FileActionUtils","EditActionUtils","Partial","constructor","data","actionUtils","files","edits","CancelEvent","addActions","actions","register","removeActions","registerAction","action","unregisterAction","reregisterAllActions","conservative","tryForceActions","params","strict","injectIntoAction","name","injection","force","onActionStatusChanged","sendContext","message","silent","addChangelog","version","changelog","getCursor","setCursor","location","onDidMoveCursor","extensionId","author","docs","contributes","markPreviewFiles","uris","promptString","absolutelyAllFiles","noChildren","setPreviewCursor","prompt","setPreviewHighlight","startPosition","endPosition"],"sources":["../src/actions/enums.ts","../src/actions/classes.d.ts","../src/actions/types.d.ts","../src/companions/enum.ts","../src/companions/register.d.ts","../src/companions/errors.ts","../src/index.ts"],"mappings":";;;;;;;mBACkB,eAAA;EACd,GAAA;EACA,OAAA;EACA,SAAA;AAAA;AAHJ;AAAA,mBAOkB,aAAA;EACd,KAAA;EACA,QAAA;EACA,OAAA;AAAA;;;;KCHQO,UAAAA,GAAaC,MAAAA;AAAAA,KAEbC,YAAAA;AAAAA,UAEKC,oBAAAA;EACbC,MAAAA,GAASV,UAAAA;EACTW,OAAAA;IAAYC,OAAAA;EAAAA;EACZC,gBAAAA;IACIC,IAAAA,GAAOX,sBAAAA;IACPY,KAAAA,GAAQZ,sBAAAA;EAAAA;EAEZa,UAAAA;AAAAA;AAAAA,KAGQC,6BAAAA,IAAiCC,MAAAA,EAAQV,YAAAA,EAAcW,OAAAA;AAAAA,UAElDC,eAAAA;;;AAhBjB;EAoBII,MAAAA;;;;EAIAC,mBAAAA;EAtBoB;;;;AAExB;;EA2BIC,kBAAAA,GAAqBE,QAAAA,EAAU3B,QAAAA;IAAWkB,OAAAA;IAAkBQ,SAAAA;EAAAA,OAA0BN,OAAAA;EA1B7ErB;;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AA;;;;;;;;;;;;;EAavD,iBAAA,CAAkB,QAAA,YAAoB,QAAA,aAAqB,QAAA;;;;ALxB/D;;;;;;;;;;EKsCI,mBAAA,CAAoB,aAAA,EAAe,MAAA,CAAO,QAAA,EAAU,OAAA,UAAiB,OAAA,UAAiB,WAAA,GAAc,MAAA,GAAS,SAAA;;;;;;;;;;EAU7G,qBAAA,CAAsB,MAAA,EAAQ,MAAA,CAAO,UAAA,EAAY,UAAA,EAAY,SAAA;AAAA;AAAA,UAGvD,aAAA;;;;;EAKN,cAAA,CAAe,QAAA;;;;;EAKf,aAAA,CAAc,IAAA;;;;;;;EAOd,eAAA,CAAgB,IAAA;AAAA;AAAA,UAGV,cAAA;ELbkB;AAO5B;;;EKWI,eAAA,IAAmB,MAAA,CAAO,GAAA;;;;;EAK1B,gBAAA;AAAA;AAAA,UAGM,KAAA;ELjBV;;;EKqBI,gBAAA,EAAkB,qBAAA;;;;EAIlB,aAAA,EAAe,kBAAA;;;;EAIf,cAAA,EAAgB,mBAAA;ELvBmC;;;EK2BnD,KAAA,EAAO,SAAA;;;;EAIP,SAAA,EAAW,aAAA;;;;EAIX,SAAA,EAAW,cAAA;AAAA;AAAA,UAGE,aAAA;;;ALnCjB;;EKwCI,SAAA,SAAkB,YAAA;;;;EAIlB,KAAA,EAAO,KAAA;AAAA;;;;;;;;;mBAWO,iBAAA;;EAEd,aAAA;;EAEA,YAAA;;EAEA,kBAAA;;;;;;EAMA,wBAAA;;;;;;;;;EASA,0BAAA;;AJ/MJ;;;;;;;;EIyNI,uBAAA;;EAEA,YAAA;;EAEA,QAAA;;EAEA,QAAA;;EAEA,SAAA;AAAA;AAAA,KA2CC,aAAA,MAAmB,CAAA,GAAI,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -115,6 +115,58 @@ let Contributions = /* @__PURE__ */ function(Contributions) {
|
|
|
115
115
|
return Contributions;
|
|
116
116
|
}({});
|
|
117
117
|
//#endregion
|
|
118
|
-
|
|
118
|
+
//#region src/index.ts
|
|
119
|
+
/**
|
|
120
|
+
* The setting IDs of NeuroPilot's settings.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* const nameOfAPI = vscode.workspace.getConfiguration('neuropilot').get<string>(NeuroPilotSetting.NameOfAPI);
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
let NeuroPilotSetting = /* @__PURE__ */ function(NeuroPilotSetting) {
|
|
128
|
+
/** The number of lines before the cursor position to include as context when editing a file or sending a completion request. */
|
|
129
|
+
NeuroPilotSetting["BeforeContext"] = "beforeContext";
|
|
130
|
+
/** The number of lines after the cursor position to include as context when editing a file or sending a completion request. */
|
|
131
|
+
NeuroPilotSetting["AfterContext"] = "afterContext";
|
|
132
|
+
/** Whether the real cursor follows Neuro's cursor. */
|
|
133
|
+
NeuroPilotSetting["CursorFollowsNeuro"] = "cursorFollowsNeuro";
|
|
134
|
+
/**
|
|
135
|
+
* Whether to send contents of a file to Neuro when the user switches to it.
|
|
136
|
+
* If false, Neuro will still know what file was switched to, but won't get the contents.
|
|
137
|
+
* Neuro will never get the contents or the name of files that aren't Neuro-safe.
|
|
138
|
+
*/
|
|
139
|
+
NeuroPilotSetting["SendContentsOnFileChange"] = "sendContentsOnFileChange";
|
|
140
|
+
/**
|
|
141
|
+
* The style to use for specifying the cursor position in context messages.
|
|
142
|
+
* Possible values are:
|
|
143
|
+
* - `"off"`: Cursor position should not be mentioned to Neuro.
|
|
144
|
+
* - `"inline"`: Cursor position should be denoted by `<<<|>>>`
|
|
145
|
+
* - `"lineAndColumn"`: Cursor position should be reported in <line>:<column> format (one-based).
|
|
146
|
+
* - `"both"`: Combination of `"inline"` and `"lineAndColumn"`.
|
|
147
|
+
*/
|
|
148
|
+
NeuroPilotSetting["CursorPositionContextStyle"] = "cursorPositionContextStyle";
|
|
149
|
+
/**
|
|
150
|
+
* The format to use for line numbers in context messages.
|
|
151
|
+
* This format should be prepended to every line.
|
|
152
|
+
* `{n}` is used for the line number. Examples:
|
|
153
|
+
* - `""`
|
|
154
|
+
* - `"{n} "`
|
|
155
|
+
* - `"{n}|"`
|
|
156
|
+
* - `"{n}: "`
|
|
157
|
+
*/
|
|
158
|
+
NeuroPilotSetting["LineNumberContextFormat"] = "lineNumberContextFormat";
|
|
159
|
+
/** The URL to connect to the Neuro API. */
|
|
160
|
+
NeuroPilotSetting["WebsocketUrl"] = "connection.websocketUrl";
|
|
161
|
+
/** The game name NeuroPilot reports to the API. */
|
|
162
|
+
NeuroPilotSetting["GameName"] = "connection.gameName";
|
|
163
|
+
/** The name to indicate who is controlling this VS Code instance alongside the API server. This replaces the default name `Vedal`. */
|
|
164
|
+
NeuroPilotSetting["UserName"] = "connection.userName";
|
|
165
|
+
/** The name of the entity currently acting as the API server. You can add custom characters using `settings.json` if you ignore the lint error from VS Code. */
|
|
166
|
+
NeuroPilotSetting["NameOfAPI"] = "connection.nameOfAPI";
|
|
167
|
+
return NeuroPilotSetting;
|
|
168
|
+
}({});
|
|
169
|
+
//#endregion
|
|
170
|
+
export { ActionForcePriorityEnum, BaseCompanionError, CompanionRegistryError, Contributions, DiffRangeType, NeuroPilotSetting, PermissionError, PermissionLevel };
|
|
119
171
|
|
|
120
172
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/actions/enums.ts","../src/companions/errors.ts","../src/companions/enum.ts"],"sourcesContent":["/** Permission level enums */\nexport const enum PermissionLevel {\n OFF = 0,\n COPILOT = 1,\n AUTOPILOT = 2,\n}\n\n/** Type of diff range */\nexport const enum DiffRangeType {\n Added,\n Modified,\n Removed,\n}\n","import { Contributions } from './enum';\n\n/**\n * The base class for all errors caused by companions.\n * Usually this class is extended by other classes that are thrown by NeuroPilot,\n * but there may also be cases where this class is used directly.\n * \n * If you're wanting to ensure that errors are coming from NeuroPilot, simply check if the error is an instance of this class.\n */\nexport class BaseCompanionError extends Error {\n /**\n * An explanation of the cause that led to the error.\n */\n readonly causedBy: string;\n /**\n * The companion that caused the error.\n */\n readonly companion?: string;\n /**\n * The feature that caused the error.\n */\n readonly feature: string;\n constructor(feature: string, error?: string, cause = 'Unknown cause.', companion?: string) {\n super(error);\n this.feature = feature;\n this.causedBy = cause;\n this.companion = companion;\n };\n};\n\n/**\n * This class being thrown means that there was an error with the companion registry.\n */\nexport class CompanionRegistryError extends BaseCompanionError {\n constructor(error?: string, cause = 'Unknown cause.') {\n super('Companion registry', error, cause);\n };\n}\n\nexport class PermissionError extends BaseCompanionError {\n /**\n * The list of contribution points that allow performing this action.\n */\n readonly contributions: string[];\n constructor(feature: string, contributions: Contributions[], error?: string) {\n super(feature, error, `${feature} without declaring any of these contributions: \"${contributions.join('\", \"')}\"`);\n this.contributions = contributions;\n }\n}\n","/**\n * Const enum for companion contributions \n */\nexport const enum Contributions {\n /**\n * Allows you to add and remove your own actions from the actions registry.\n * Also allows you to register and unregister them on-demand.\n */\n ACTIONS_MANAGE = 'actions:manage',\n /**\n * Allows you to register and unregister other companions' actions.\n * Does NOT allow you to add or remove them from the registry.\n */\n ACTIONS_MANAGE_OTHERS = 'actions:manage_others',\n /**\n * Allows injecting into other companions' actions.\n * This allows you to change all properties on that action (except for `name` and `source`).\n */\n ACTIONS_INJECT = 'actions:inject',\n /**\n * Allows subscribing to when an action status is changed.\n */\n ACTIONS_PROCESS = 'actions:process',\n /**\n * Allows forcing actions from Neuro.\n * You do not need either {@link Contributions.ACTIONS_MANAGE actions:manage} or {@link Contributions.ACTIONS_MANAGE_OTHERS actions:manage_others} to force actions.\n */\n ACTIONS_FORCE = 'actions:force',\n /**\n * Allows adding changelogs to the `read_changelog` command, so Neuro can query it on-demand.\n */\n CHANGELOG = 'changelog',\n /**\n * Allows sending context to Neuro at any time.\n */\n CONTEXT = 'context',\n /**\n * Allows you to get the virtual cursor position & subscribe to when it gets changed.\n */\n CURSOR_GET = 'cursor:get',\n /**\n * Allows you to set the position of the virtual cursor.\n * This does NOT implicitly grant {@link Contributions.CURSOR_GET cursor:get} and will not let you view the cursor position.\n */\n CURSOR_SET = 'cursor:set',\n /**\n * Currently unused.\n */\n IMAGES = 'images',\n};\n"],"mappings":";;;AACA,IAAkB,kBAAX,yBAAA,iBAAA;AACH,iBAAA,gBAAA,SAAA,KAAA;AACA,iBAAA,gBAAA,aAAA,KAAA;AACA,iBAAA,gBAAA,eAAA,KAAA;;KACH;;AAGD,IAAkB,gBAAX,yBAAA,eAAA;AACH,eAAA,cAAA,WAAA,KAAA;AACA,eAAA,cAAA,cAAA,KAAA;AACA,eAAA,cAAA,aAAA,KAAA;;KACH;;;;;;;;;;ACHD,IAAa,qBAAb,cAAwC,MAAM;;;;CAI1C;;;;CAIA;;;;CAIA;CACA,YAAY,SAAiB,OAAgB,QAAQ,kBAAkB,WAAoB;AACvF,QAAM,MAAM;AACZ,OAAK,UAAU;AACf,OAAK,WAAW;AAChB,OAAK,YAAY;;;;;;AAOzB,IAAa,yBAAb,cAA4C,mBAAmB;CAC3D,YAAY,OAAgB,QAAQ,kBAAkB;AAClD,QAAM,sBAAsB,OAAO,MAAM;;;AAIjD,IAAa,kBAAb,cAAqC,mBAAmB;;;;CAIpD;CACA,YAAY,SAAiB,eAAgC,OAAgB;AACzE,QAAM,SAAS,OAAO,GAAG,QAAQ,kDAAkD,cAAc,KAAK,SAAO,CAAC,GAAG;AACjH,OAAK,gBAAgB;;;;;;;;AC3C7B,IAAkB,gBAAX,yBAAA,eAAA;;;;;AAKH,eAAA,oBAAA;;;;;AAKA,eAAA,2BAAA;;;;;AAKA,eAAA,oBAAA;;;;AAIA,eAAA,qBAAA;;;;;AAKA,eAAA,mBAAA;;;;AAIA,eAAA,eAAA;;;;AAIA,eAAA,aAAA;;;;AAIA,eAAA,gBAAA;;;;;AAKA,eAAA,gBAAA;;;;AAIA,eAAA,YAAA;;KACH"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/actions/enums.ts","../src/companions/errors.ts","../src/companions/enum.ts","../src/index.ts"],"sourcesContent":["/** Permission level enums */\nexport const enum PermissionLevel {\n OFF = 0,\n COPILOT = 1,\n AUTOPILOT = 2,\n}\n\n/** Type of diff range */\nexport const enum DiffRangeType {\n Added,\n Modified,\n Removed,\n}\n","import { Contributions } from './enum';\n\n/**\n * The base class for all errors caused by companions.\n * Usually this class is extended by other classes that are thrown by NeuroPilot,\n * but there may also be cases where this class is used directly.\n * \n * If you're wanting to ensure that errors are coming from NeuroPilot, simply check if the error is an instance of this class.\n */\nexport class BaseCompanionError extends Error {\n /**\n * An explanation of the cause that led to the error.\n */\n readonly causedBy: string;\n /**\n * The companion that caused the error.\n */\n readonly companion?: string;\n /**\n * The feature that caused the error.\n */\n readonly feature: string;\n constructor(feature: string, error?: string, cause = 'Unknown cause.', companion?: string) {\n super(error);\n this.feature = feature;\n this.causedBy = cause;\n this.companion = companion;\n };\n};\n\n/**\n * This class being thrown means that there was an error with the companion registry.\n */\nexport class CompanionRegistryError extends BaseCompanionError {\n constructor(error?: string, cause = 'Unknown cause.') {\n super('Companion registry', error, cause);\n };\n}\n\nexport class PermissionError extends BaseCompanionError {\n /**\n * The list of contribution points that allow performing this action.\n */\n readonly contributions: string[];\n constructor(feature: string, contributions: Contributions[], error?: string) {\n super(feature, error, `${feature} without declaring any of these contributions: \"${contributions.join('\", \"')}\"`);\n this.contributions = contributions;\n }\n}\n","/**\n * Const enum for companion contributions \n */\nexport const enum Contributions {\n /**\n * Allows you to add and remove your own actions from the actions registry.\n * Also allows you to register and unregister them on-demand.\n */\n ACTIONS_MANAGE = 'actions:manage',\n /**\n * Allows you to register and unregister other companions' actions.\n * Does NOT allow you to add or remove them from the registry.\n */\n ACTIONS_MANAGE_OTHERS = 'actions:manage_others',\n /**\n * Allows injecting into other companions' actions.\n * This allows you to change all properties on that action (except for `name` and `source`).\n */\n ACTIONS_INJECT = 'actions:inject',\n /**\n * Allows subscribing to when an action status is changed.\n */\n ACTIONS_PROCESS = 'actions:process',\n /**\n * Allows forcing actions from Neuro.\n * You do not need either {@link Contributions.ACTIONS_MANAGE actions:manage} or {@link Contributions.ACTIONS_MANAGE_OTHERS actions:manage_others} to force actions.\n */\n ACTIONS_FORCE = 'actions:force',\n /**\n * Allows adding changelogs to the `read_changelog` command, so Neuro can query it on-demand.\n */\n CHANGELOG = 'changelog',\n /**\n * Allows sending context to Neuro at any time.\n */\n CONTEXT = 'context',\n /**\n * Allows you to get the virtual cursor position & subscribe to when it gets changed.\n */\n CURSOR_GET = 'cursor:get',\n /**\n * Allows you to set the position of the virtual cursor.\n * This does NOT implicitly grant {@link Contributions.CURSOR_GET cursor:get} and will not let you view the cursor position.\n */\n CURSOR_SET = 'cursor:set',\n /**\n * Currently unused.\n */\n IMAGES = 'images',\n};\n","import type { ActionHandlerResult, ActionValidationResult, Diff, DiffPlus, DiffRange, RCEAction, DiffPlusLine } from './actions/types';\nimport type { CompanionAPI } from './companions/register';\nimport type * as vscode from 'vscode';\n\ninterface ActionValidationUtils {\n /**\n * Function to return an object that indicates handler success.\n * @param message The message that will be sent to Neuro\n * @param historyNote If supplied, an action status update with its status set to success will be fired with the note. Otherwise, assumes that you've already done that yourself.\n * @returns {ActionHandlerResult} An object with a successful validation result\n */\n success(message?: string, historyNote?: string): ActionValidationResult;\n /**\n * Function to return an object that indicates handler failure.\n * @param message The message that will be sent to Neuro\n * @param historyNote If supplied, an action status update with its status set to success will be fired with the note. Otherwise, assumes that you've already done that yourself.\n * @returns {ActionHandlerResult} An object with a failed validation result\n */\n failure(message: string, historyNote?: string): ActionValidationResult;\n /**\n * Function to return an object that indicates handler failure.\n * @param message The message that will be sent to Neuro\n * @param historyNote If supplied, an action status update with its status set to success will be fired with the note. Otherwise, assumes that you've already done that yourself.\n * @returns {ActionHandlerResult} An object with a failed validation result\n */\n retry(message: string, historyNote?: string): ActionValidationResult;\n}\n\ninterface ActionHandlerUtils {\n /**\n * Create a successful action result.\n * This should be used if all parameters have been parsed correctly.\n * @param message An optional message to send to Neuro.\n * @param historyNote A note for the history panel.\n * @returns A successful action result.\n */\n success(message?: string, historyNote?: string): ActionHandlerResult;\n /**\n * Create an action result with the specified message.\n * This should be used if the action failed, but should not be retried, e.g.\n * if the source of the error is out of Neuro's control or to prevent a retry\n * loop in case the action is not applicable in the current state.\n * @param message The message to send to Neuro. This should explain, if possible, why the action failed. If omitted, will just send \"Action failed.\".\n * @param historyNote A note for the history panel.\n * @returns A successful action result with the specified message.\n */\n failure(message: string, historyNote?: string): ActionHandlerResult;\n /**\n * Create an action result that tells Neuro to retry the forced action.\n * @param message The message to send to Neuro. This should contain the information required to fix the mistake.\n * @param historyNote A note for the history panel.\n * @returns A failed action result with the specified message.\n */\n retry(message: string, historyNote?: string): ActionHandlerResult;\n}\n\ninterface ActionsListingUtils {\n /**\n * Get an action or an array of actions.\n * @todo split into overloads for sanity\n * @param action A string or array of strings of action names.\n * @returns An action (if a string was provided), undefined (if a string was provided and nothing was found), or an array of actions (if nothing or an array was provided)\n */\n getActions(action?: string | string[]): ItselfOrArray<RCEAction & {\n source?: string;\n }> | undefined;\n}\n\ninterface DiffUtils {\n /**\n * Calculate the diff between two sets of lines using the Patience diff algorithm.\n *\n * The algorithm is not limited to line-based diffs, you can also use it to calculate word- or\n * character-based diffs by splitting your text into arrays of words or characters instead of lines (at\n * the cost of performance).\n * However, documentation and property names still refer to everything as lines.\n * @param oldLines The lines before the change.\n * @param newLines The lines after the change.\n * @see {@link https://github.com/jonTrent/PatienceDiff}\n */\n calculateDiff(oldLines: string[], newLines: string[]): Diff;\n /**\n * Calculate the diff between two sets of lines, taking moved lines into account.\n *\n * Note that moved lines are duplicated in the resulting diff:\n * A line will appear once with `oldIndex` set to the position it was moved from and `newIndex` set to the\n * position it was moved to, and a counterpart of that line will also appear with the same text and\n * `newIndex` set to -1. This is part of the original implementation of the algorithm, which we did not modify.\n * See also: {@link DiffPlusLine.newIndex}\n * @param oldLines The lines before the change.\n * @param newLines The lines after the change.\n * @see {@link DiffUtils.calculateDiff calculateDiff}\n */\n calculateDiffPlus(oldLines: string[], newLines: string[]): DiffPlus;\n /**\n * Calculates the difference between the original and modified text. The ranges are based on the new text.\n * @param startPosition The position to offset the resulting ranges by.\n * @param oldText The text before the change.\n * @param newText The text after the change.\n * @param tokenRegExp The regular expression used for tokenization. The global flag must be set, and every\n * character in the text must be matched.\n * Defaults to `/\\w+|\\r?\\n|\\s+|./g` (word diff).\n * Examples:\n * - Line diff: `/.*(?:\\r?\\n|$)/g`\n * - Word diff: `/\\w+|\\r?\\n|\\s+|./g`\n * - Character diff: `/.|\\r?\\n/g`\n */\n calculateDiffRanges(startPosition: vscode.Position, oldText: string, newText: string, tokenRegExp?: RegExp): DiffRange[];\n /**\n * Apply diff highlighting to a text editor based on the provided diff ranges.\n * If you use {@link DiffUtils.calculateDiffRanges calculateDiffRanges} to calculate the\n * diff ranges, the current text in the editor should be provided as the `newText` parameter.\n * @param editor The text editor to highlight.\n * @param diffRanges The diff ranges to highlight.\n * If you use {@link DiffUtils.calculateDiffRanges calculateDiffRanges} to calculate these,\n * the current text in the editor should be provided as the `newText` parameter.\n */\n applyDiffHighlighting(editor: vscode.TextEditor, diffRanges: DiffRange[]): void;\n}\n\ninterface FilePathUtils {\n /**\n * Simplifies the file path\n * @param fileName The path of the file\n */\n simpleFileName(fileName: string): string;\n /**\n * Normalizes the path so it looks consistent when sending to Neuro.\n * @param path The path to be normalized\n */\n normalizePath(path: string): string;\n /**\n * Checks if a file is Neuro-safe, according to the rules the user has set in NeuroPilot's settings.\n *\n * It is recommended that you use this to check file paths if your actions are accessing a file for any reason.\n * @param path The path to the file. This utility expects an *absolute* path.\n */\n isPathNeuroSafe(path: string): boolean;\n}\n\ninterface WorkspaceUtils {\n /**\n * Gets the full workspace uri that is normally targeted for operations.\n * In multi-root workspaces this is the first open workspace.\n */\n getWorkspaceUri(): vscode.Uri | undefined;\n /**\n * Gets the full workspace path that is normally targeted for operations.\n * (Same as calling {@link WorkspaceUtils.getWorkspaceUri getWorkspaceUri}.fsPath)\n */\n getWorkspacePath(): string | undefined;\n}\n\ninterface Utils {\n /**\n * Utilities for generating action validation messages\n */\n actionValidation: ActionValidationUtils;\n /**\n * Utililties for generating action handler messages\n */\n actionHandler: ActionHandlerUtils;\n /**\n * Utilities for the action listing\n */\n actionsListing: ActionsListingUtils;\n /**\n * Utilities for generating and applying diffs\n */\n diffs: DiffUtils;\n /**\n * Utilities for working with file paths\n */\n filePaths: FilePathUtils;\n /**\n * Utilities for getting the current workspace\n */\n workspace: WorkspaceUtils;\n}\n\nexport interface NeuroPilotAPI {\n /**\n * Register your companion extension by creating a new object from this class.\n * See {@link CompanionAPI} for the API surface it exposes.\n */\n Companion: typeof CompanionAPI;\n /**\n * Public, useful utilities you might want to use in your extension.\n */\n utils: Utils;\n}\n\n/**\n * The setting IDs of NeuroPilot's settings.\n * \n * @example\n * ```ts\n * const nameOfAPI = vscode.workspace.getConfiguration('neuropilot').get<string>(NeuroPilotSetting.NameOfAPI);\n * ```\n */\nexport const enum NeuroPilotSetting {\n /** The number of lines before the cursor position to include as context when editing a file or sending a completion request. */\n BeforeContext = 'beforeContext',\n /** The number of lines after the cursor position to include as context when editing a file or sending a completion request. */\n AfterContext = 'afterContext',\n /** Whether the real cursor follows Neuro's cursor. */\n CursorFollowsNeuro = 'cursorFollowsNeuro',\n /**\n * Whether to send contents of a file to Neuro when the user switches to it.\n * If false, Neuro will still know what file was switched to, but won't get the contents.\n * Neuro will never get the contents or the name of files that aren't Neuro-safe.\n */\n SendContentsOnFileChange = 'sendContentsOnFileChange',\n /**\n * The style to use for specifying the cursor position in context messages.\n * Possible values are:\n * - `\"off\"`: Cursor position should not be mentioned to Neuro.\n * - `\"inline\"`: Cursor position should be denoted by `<<<|>>>`\n * - `\"lineAndColumn\"`: Cursor position should be reported in <line>:<column> format (one-based).\n * - `\"both\"`: Combination of `\"inline\"` and `\"lineAndColumn\"`.\n */\n CursorPositionContextStyle = 'cursorPositionContextStyle',\n /**\n * The format to use for line numbers in context messages.\n * This format should be prepended to every line.\n * `{n}` is used for the line number. Examples:\n * - `\"\"`\n * - `\"{n} \"`\n * - `\"{n}|\"`\n * - `\"{n}: \"`\n */\n LineNumberContextFormat = 'lineNumberContextFormat',\n /** The URL to connect to the Neuro API. */\n WebsocketUrl = 'connection.websocketUrl',\n /** The game name NeuroPilot reports to the API. */\n GameName = 'connection.gameName',\n /** The name to indicate who is controlling this VS Code instance alongside the API server. This replaces the default name `Vedal`. */\n UserName = 'connection.userName',\n /** The name of the entity currently acting as the API server. You can add custom characters using `settings.json` if you ignore the lint error from VS Code. */\n NameOfAPI = 'connection.nameOfAPI',\n\n // Commented access.* out for now because companions should use isPathNeuroSafe instead.\n // If we find a use case that is not covered by isPathNeuroSafe then we can add them back.\n\n // /** Whether to allow Neuro to access files and folders beginning with a dot. */\n // DotFiles = 'access.dotFiles',\n // /** Whether to allow Neuro to access files and folders outside the current workspace. */\n // ExternalFiles = 'access.externalFiles',\n // /**\n // * Whether to allow Neuro to use environment variables in paths.\n // * Resolving environent variables isn't implemented in NeuroPilot, so you won't have to implement it in your companion either.\n // * However, you should still check for it.\n // */\n // EnvironmentVariables = 'access.environmentVariables',\n // /**\n // * A case-sensitive list of glob patterns for files Neuro is allowed to open, i.e. she should be unable to open files that don't match this pattern.\n // * Should be applied before {@link ExcludePattern}.\n // * \n // * Patterns without a slash should match any file or folder with that name.\n // */\n // IncludePattern = 'access.includePattern',\n // /**\n // * A case-sensitive glob pattern for files Neuro is not allowed to open.\n // * Should be applied after {@link IncludePattern}.\n // * \n // * Patterns without a slash should match any file or folder with that name.\n // */\n // ExcludePattern = 'access.excludePattern',\n // /** Allow NeuroPilot to read ignore patterns from an ignore file (e.g. .gitignore). */\n // InheritFromIgnoreFiles = 'access.inheritFromIgnoreFiles',\n // /**\n // * A list of ignore-style files to inherit Neuro-safe glob paths from.\n // * Should support the full range of git's ignore pattern globs and ignore comments (lines starting with #).\n // * The further down a file is on the list, the more priority it should get.\n // * \n // * This setting should not override any of the other access settings.\n // * \n // * Example: `[ \".gitignore\", \".npmignore\", \".prettierignore\" ]`\n // */\n // IgnoreFiles = 'access.ignoreFiles',\n}\n\ntype ItselfOrArray<T> = T | T[];\n\nexport * from './actions';\nexport * from './companions';\nexport { ActionForcePriorityEnum } from 'neuro-game-sdk';\n"],"mappings":";;;AACA,IAAkB,kBAAX,yBAAA,iBAAA;AACH,iBAAA,gBAAA,SAAA,KAAA;AACA,iBAAA,gBAAA,aAAA,KAAA;AACA,iBAAA,gBAAA,eAAA,KAAA;;KACH;;AAGD,IAAkB,gBAAX,yBAAA,eAAA;AACH,eAAA,cAAA,WAAA,KAAA;AACA,eAAA,cAAA,cAAA,KAAA;AACA,eAAA,cAAA,aAAA,KAAA;;KACH;;;;;;;;;;ACHD,IAAa,qBAAb,cAAwC,MAAM;;;;CAI1C;;;;CAIA;;;;CAIA;CACA,YAAY,SAAiB,OAAgB,QAAQ,kBAAkB,WAAoB;AACvF,QAAM,MAAM;AACZ,OAAK,UAAU;AACf,OAAK,WAAW;AAChB,OAAK,YAAY;;;;;;AAOzB,IAAa,yBAAb,cAA4C,mBAAmB;CAC3D,YAAY,OAAgB,QAAQ,kBAAkB;AAClD,QAAM,sBAAsB,OAAO,MAAM;;;AAIjD,IAAa,kBAAb,cAAqC,mBAAmB;;;;CAIpD;CACA,YAAY,SAAiB,eAAgC,OAAgB;AACzE,QAAM,SAAS,OAAO,GAAG,QAAQ,kDAAkD,cAAc,KAAK,SAAO,CAAC,GAAG;AACjH,OAAK,gBAAgB;;;;;;;;AC3C7B,IAAkB,gBAAX,yBAAA,eAAA;;;;;AAKH,eAAA,oBAAA;;;;;AAKA,eAAA,2BAAA;;;;;AAKA,eAAA,oBAAA;;;;AAIA,eAAA,qBAAA;;;;;AAKA,eAAA,mBAAA;;;;AAIA,eAAA,eAAA;;;;AAIA,eAAA,aAAA;;;;AAIA,eAAA,gBAAA;;;;;AAKA,eAAA,gBAAA;;;;AAIA,eAAA,YAAA;;KAC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