@vybestack/llxprt-code-ide-integration 0.10.0-nightly.260613.1adad3b34

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.
Files changed (41) hide show
  1. package/dist/.last_build +0 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.js +7 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/src/ide/constants.d.ts +6 -0
  6. package/dist/src/ide/constants.js +7 -0
  7. package/dist/src/ide/constants.js.map +1 -0
  8. package/dist/src/ide/detect-ide.d.ts +64 -0
  9. package/dist/src/ide/detect-ide.js +78 -0
  10. package/dist/src/ide/detect-ide.js.map +1 -0
  11. package/dist/src/ide/ide-client.d.ts +77 -0
  12. package/dist/src/ide/ide-client.js +440 -0
  13. package/dist/src/ide/ide-client.js.map +1 -0
  14. package/dist/src/ide/ide-installer.d.ts +14 -0
  15. package/dist/src/ide/ide-installer.js +116 -0
  16. package/dist/src/ide/ide-installer.js.map +1 -0
  17. package/dist/src/ide/ideContext.d.ts +415 -0
  18. package/dist/src/ide/ideContext.js +162 -0
  19. package/dist/src/ide/ideContext.js.map +1 -0
  20. package/dist/src/ide/index.d.ts +11 -0
  21. package/dist/src/ide/index.js +12 -0
  22. package/dist/src/ide/index.js.map +1 -0
  23. package/dist/src/ide/process-utils.d.ts +21 -0
  24. package/dist/src/ide/process-utils.js +198 -0
  25. package/dist/src/ide/process-utils.js.map +1 -0
  26. package/dist/src/index.d.ts +8 -0
  27. package/dist/src/index.js +9 -0
  28. package/dist/src/index.js.map +1 -0
  29. package/dist/src/lsp/index.d.ts +7 -0
  30. package/dist/src/lsp/index.js +7 -0
  31. package/dist/src/lsp/index.js.map +1 -0
  32. package/dist/src/lsp/lsp-service-client.d.ts +37 -0
  33. package/dist/src/lsp/lsp-service-client.js +415 -0
  34. package/dist/src/lsp/lsp-service-client.js.map +1 -0
  35. package/dist/src/lsp/types.d.ts +45 -0
  36. package/dist/src/lsp/types.js +3 -0
  37. package/dist/src/lsp/types.js.map +1 -0
  38. package/dist/src/utils/paths.d.ts +13 -0
  39. package/dist/src/utils/paths.js +24 -0
  40. package/dist/src/utils/paths.js.map +1 -0
  41. package/package.json +46 -0
File without changes
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Vybestack LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export * from './src/index.js';
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Vybestack LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export * from './src/index.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export declare const LLXPRT_CODE_COMPANION_EXTENSION_NAME = "LLxprt Code Companion";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export const LLXPRT_CODE_COMPANION_EXTENSION_NAME = 'LLxprt Code Companion';
7
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/ide/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,oCAAoC,GAAG,uBAAuB,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export declare const IDE_DEFINITIONS: {
7
+ readonly devin: {
8
+ readonly name: "devin";
9
+ readonly displayName: "Devin";
10
+ };
11
+ readonly replit: {
12
+ readonly name: "replit";
13
+ readonly displayName: "Replit";
14
+ };
15
+ readonly cursor: {
16
+ readonly name: "cursor";
17
+ readonly displayName: "Cursor";
18
+ };
19
+ readonly cloudshell: {
20
+ readonly name: "cloudshell";
21
+ readonly displayName: "Cloud Shell";
22
+ };
23
+ readonly codespaces: {
24
+ readonly name: "codespaces";
25
+ readonly displayName: "GitHub Codespaces";
26
+ };
27
+ readonly firebasestudio: {
28
+ readonly name: "firebasestudio";
29
+ readonly displayName: "Firebase Studio";
30
+ };
31
+ readonly trae: {
32
+ readonly name: "trae";
33
+ readonly displayName: "Trae";
34
+ };
35
+ readonly vscode: {
36
+ readonly name: "vscode";
37
+ readonly displayName: "VS Code";
38
+ };
39
+ readonly antigravity: {
40
+ readonly name: "antigravity";
41
+ readonly displayName: "Antigravity";
42
+ };
43
+ readonly sublimetext: {
44
+ readonly name: "sublimetext";
45
+ readonly displayName: "Sublime Text";
46
+ };
47
+ readonly vscodefork: {
48
+ readonly name: "vscodefork";
49
+ readonly displayName: "IDE";
50
+ };
51
+ };
52
+ export interface IdeInfo {
53
+ name: string;
54
+ displayName: string;
55
+ }
56
+ export declare function isCloudShell(): boolean;
57
+ export declare function detectIdeFromEnv(): IdeInfo;
58
+ export declare function detectIde(ideProcessInfo: {
59
+ pid: number;
60
+ command: string;
61
+ }, ideInfoFromFile?: {
62
+ name?: string;
63
+ displayName?: string;
64
+ }): IdeInfo | undefined;
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export const IDE_DEFINITIONS = {
7
+ devin: { name: 'devin', displayName: 'Devin' },
8
+ replit: { name: 'replit', displayName: 'Replit' },
9
+ cursor: { name: 'cursor', displayName: 'Cursor' },
10
+ cloudshell: { name: 'cloudshell', displayName: 'Cloud Shell' },
11
+ codespaces: { name: 'codespaces', displayName: 'GitHub Codespaces' },
12
+ firebasestudio: { name: 'firebasestudio', displayName: 'Firebase Studio' },
13
+ trae: { name: 'trae', displayName: 'Trae' },
14
+ vscode: { name: 'vscode', displayName: 'VS Code' },
15
+ antigravity: { name: 'antigravity', displayName: 'Antigravity' },
16
+ sublimetext: { name: 'sublimetext', displayName: 'Sublime Text' },
17
+ vscodefork: { name: 'vscodefork', displayName: 'IDE' },
18
+ };
19
+ export function isCloudShell() {
20
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- intentional falsy coalescing: env vars may be empty string, both cases indicate not in cloud shell
21
+ return !!(process.env['EDITOR_IN_CLOUD_SHELL'] || process.env['CLOUD_SHELL']);
22
+ }
23
+ export function detectIdeFromEnv() {
24
+ if (process.env['__COG_BASHRC_SOURCED']) {
25
+ return IDE_DEFINITIONS.devin;
26
+ }
27
+ if (process.env['REPLIT_USER']) {
28
+ return IDE_DEFINITIONS.replit;
29
+ }
30
+ if (process.env['CURSOR_TRACE_ID']) {
31
+ return IDE_DEFINITIONS.cursor;
32
+ }
33
+ if (process.env['CODESPACES']) {
34
+ return IDE_DEFINITIONS.codespaces;
35
+ }
36
+ if (process.env['ANTIGRAVITY_CLI_ALIAS']) {
37
+ return IDE_DEFINITIONS.antigravity;
38
+ }
39
+ if (isCloudShell()) {
40
+ return IDE_DEFINITIONS.cloudshell;
41
+ }
42
+ if (process.env['TERM_PRODUCT'] === 'Trae') {
43
+ return IDE_DEFINITIONS.trae;
44
+ }
45
+ if (process.env['FIREBASE_DEPLOY_AGENT'] || process.env['MONOSPACE_ENV']) {
46
+ return IDE_DEFINITIONS.firebasestudio;
47
+ }
48
+ if (process.env['TERM_PROGRAM'] === 'sublime') {
49
+ return IDE_DEFINITIONS.sublimetext;
50
+ }
51
+ return IDE_DEFINITIONS.vscode;
52
+ }
53
+ function verifyVSCode(ide, ideProcessInfo) {
54
+ if (ide.name !== IDE_DEFINITIONS.vscode.name) {
55
+ return ide;
56
+ }
57
+ if (!ideProcessInfo.command ||
58
+ ideProcessInfo.command.toLowerCase().includes('code')) {
59
+ return IDE_DEFINITIONS.vscode;
60
+ }
61
+ return IDE_DEFINITIONS.vscodefork;
62
+ }
63
+ export function detectIde(ideProcessInfo, ideInfoFromFile) {
64
+ if (ideInfoFromFile?.name && ideInfoFromFile.displayName) {
65
+ return {
66
+ name: ideInfoFromFile.name,
67
+ displayName: ideInfoFromFile.displayName,
68
+ };
69
+ }
70
+ // Only VS Code and Sublime Text integrations are currently supported.
71
+ if (process.env['TERM_PROGRAM'] !== 'vscode' &&
72
+ process.env['TERM_PROGRAM'] !== 'sublime') {
73
+ return undefined;
74
+ }
75
+ const ide = detectIdeFromEnv();
76
+ return verifyVSCode(ide, ideProcessInfo);
77
+ }
78
+ //# sourceMappingURL=detect-ide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-ide.js","sourceRoot":"","sources":["../../../src/ide/detect-ide.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE;IAC9C,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE;IACjD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE;IACjD,UAAU,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE;IAC9D,UAAU,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE;IACpE,cAAc,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,EAAE;IAC1E,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE;IAC3C,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE;IAClD,WAAW,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,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 import { type DiffUpdateResult } from './ideContext.js';
8
+ export type IDEConnectionState = {
9
+ status: IDEConnectionStatus;
10
+ details?: string;
11
+ };
12
+ export declare enum IDEConnectionStatus {
13
+ Connected = "connected",
14
+ Disconnected = "disconnected",
15
+ Connecting = "connecting"
16
+ }
17
+ /**
18
+ * Manages the connection to and interaction with the IDE server.
19
+ */
20
+ export declare class IdeClient {
21
+ private static instance;
22
+ private client;
23
+ private state;
24
+ private currentIde;
25
+ private ideProcessInfo;
26
+ private connectionConfig;
27
+ private authToken;
28
+ private diffResponses;
29
+ private statusListeners;
30
+ private trustChangeListeners;
31
+ private constructor();
32
+ static getInstance(): Promise<IdeClient>;
33
+ static resetInstance(): void;
34
+ addStatusChangeListener(listener: (state: IDEConnectionState) => void): void;
35
+ removeStatusChangeListener(listener: (state: IDEConnectionState) => void): void;
36
+ addTrustChangeListener(listener: (isTrusted: boolean) => void): void;
37
+ removeTrustChangeListener(listener: (isTrusted: boolean) => void): void;
38
+ connect(): Promise<void>;
39
+ /**
40
+ * A diff is accepted with any modifications if the user performs one of the
41
+ * following actions:
42
+ * - Clicks the checkbox icon in the IDE to accept
43
+ * - Runs `command+shift+p` > "LLxprt Code: Accept Diff in IDE" to accept
44
+ * - Selects "accept" in the CLI UI
45
+ * - Saves the file via `ctrl/command+s`
46
+ *
47
+ * A diff is rejected if the user performs one of the following actions:
48
+ * - Clicks the "x" icon in the IDE
49
+ * - Runs "LLxprt Code: Close Diff in IDE"
50
+ * - Selects "no" in the CLI UI
51
+ * - Closes the file
52
+ */
53
+ openDiff(filePath: string, newContent?: string): Promise<DiffUpdateResult>;
54
+ closeDiff(filePath: string, options?: {
55
+ suppressNotification?: boolean;
56
+ }): Promise<string | undefined>;
57
+ resolveDiffFromCli(filePath: string, outcome: 'accepted' | 'rejected'): Promise<void>;
58
+ disconnect(): Promise<void>;
59
+ getCurrentIde(): IdeInfo | undefined;
60
+ getConnectionStatus(): IDEConnectionState;
61
+ getDetectedIdeDisplayName(): string | undefined;
62
+ /**
63
+ * Check if diffing functionality is enabled for this IDE client.
64
+ * Returns true when the client is connected and the IDE supports diff operations.
65
+ */
66
+ isDiffingEnabled(): boolean;
67
+ private setState;
68
+ static validateWorkspacePath(ideWorkspacePath: string | undefined, cwd: string): {
69
+ isValid: boolean;
70
+ error?: string;
71
+ };
72
+ private getPortFromEnv;
73
+ private getConnectionConfigFromFile;
74
+ private createProxyAwareFetch;
75
+ private registerClientHandlers;
76
+ private establishConnection;
77
+ }