@kaitranntt/ccs 7.43.0-dev.1 → 7.43.0-dev.3
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/dist/ccs.js +7 -0
- package/dist/ccs.js.map +1 -1
- package/dist/commands/cursor-command.d.ts +12 -0
- package/dist/commands/cursor-command.d.ts.map +1 -0
- package/dist/commands/cursor-command.js +225 -0
- package/dist/commands/cursor-command.js.map +1 -0
- package/dist/cursor/cursor-daemon.d.ts +47 -0
- package/dist/cursor/cursor-daemon.d.ts.map +1 -0
- package/dist/cursor/cursor-daemon.js +332 -0
- package/dist/cursor/cursor-daemon.js.map +1 -0
- package/dist/cursor/cursor-executor.d.ts +74 -0
- package/dist/cursor/cursor-executor.d.ts.map +1 -0
- package/dist/cursor/cursor-executor.js +621 -0
- package/dist/cursor/cursor-executor.js.map +1 -0
- package/dist/cursor/cursor-models.d.ts +43 -0
- package/dist/cursor/cursor-models.d.ts.map +1 -0
- package/dist/cursor/cursor-models.js +205 -0
- package/dist/cursor/cursor-models.js.map +1 -0
- package/dist/cursor/cursor-protobuf-decoder.d.ts +52 -0
- package/dist/cursor/cursor-protobuf-decoder.d.ts.map +1 -0
- package/dist/cursor/cursor-protobuf-decoder.js +311 -0
- package/dist/cursor/cursor-protobuf-decoder.js.map +1 -0
- package/dist/cursor/cursor-protobuf-encoder.d.ts +54 -0
- package/dist/cursor/cursor-protobuf-encoder.d.ts.map +1 -0
- package/dist/cursor/cursor-protobuf-encoder.js +173 -0
- package/dist/cursor/cursor-protobuf-encoder.js.map +1 -0
- package/dist/cursor/cursor-protobuf-schema.d.ts +168 -0
- package/dist/cursor/cursor-protobuf-schema.d.ts.map +1 -0
- package/dist/cursor/cursor-protobuf-schema.js +130 -0
- package/dist/cursor/cursor-protobuf-schema.js.map +1 -0
- package/dist/cursor/cursor-protobuf.d.ts +21 -0
- package/dist/cursor/cursor-protobuf.d.ts.map +1 -0
- package/dist/cursor/cursor-protobuf.js +116 -0
- package/dist/cursor/cursor-protobuf.js.map +1 -0
- package/dist/cursor/cursor-translator.d.ts +39 -0
- package/dist/cursor/cursor-translator.d.ts.map +1 -0
- package/dist/cursor/cursor-translator.js +118 -0
- package/dist/cursor/cursor-translator.js.map +1 -0
- package/dist/cursor/index.d.ts +11 -0
- package/dist/cursor/index.d.ts.map +1 -0
- package/dist/cursor/index.js +53 -0
- package/dist/cursor/index.js.map +1 -0
- package/dist/cursor/types.d.ts +33 -1
- package/dist/cursor/types.d.ts.map +1 -1
- package/dist/cursor/types.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor Model Catalog
|
|
3
|
+
*
|
|
4
|
+
* Manages available models from Cursor IDE.
|
|
5
|
+
* Based on Cursor's supported models catalog.
|
|
6
|
+
*/
|
|
7
|
+
import type { CursorModel } from './types';
|
|
8
|
+
/** Default daemon port */
|
|
9
|
+
export declare const DEFAULT_CURSOR_PORT = 4242;
|
|
10
|
+
/** Default model ID */
|
|
11
|
+
export declare const DEFAULT_CURSOR_MODEL = "gpt-4.1";
|
|
12
|
+
/**
|
|
13
|
+
* Default models available through Cursor IDE.
|
|
14
|
+
* Used as fallback when daemon is not reachable.
|
|
15
|
+
* Source: Cursor IDE supported models (Feb 2025)
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_CURSOR_MODELS: CursorModel[];
|
|
18
|
+
/**
|
|
19
|
+
* Fetch available models from running cursor daemon.
|
|
20
|
+
*
|
|
21
|
+
* @param port The port cursor daemon is running on
|
|
22
|
+
* @returns List of available models
|
|
23
|
+
*/
|
|
24
|
+
export declare function fetchModelsFromDaemon(port: number): Promise<CursorModel[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Get available models (from daemon or defaults).
|
|
27
|
+
* Checks daemon health first to avoid 5s timeout when daemon is not running.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getAvailableModels(port: number): Promise<CursorModel[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Get the default model.
|
|
32
|
+
* Uses gpt-4.1 as it's commonly available.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getDefaultModel(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Detect provider from model ID.
|
|
37
|
+
*/
|
|
38
|
+
export declare function detectProvider(modelId: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Format model ID to human-readable name.
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatModelName(modelId: string): string;
|
|
43
|
+
//# sourceMappingURL=cursor-models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor-models.d.ts","sourceRoot":"","sources":["../../src/cursor/cursor-models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG3C,0BAA0B;AAC1B,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,uBAAuB;AACvB,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,EAiD9C,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CA8DhF;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAK7E;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMtD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAYvD"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cursor Model Catalog
|
|
4
|
+
*
|
|
5
|
+
* Manages available models from Cursor IDE.
|
|
6
|
+
* Based on Cursor's supported models catalog.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.formatModelName = exports.detectProvider = exports.getDefaultModel = exports.getAvailableModels = exports.fetchModelsFromDaemon = exports.DEFAULT_CURSOR_MODELS = exports.DEFAULT_CURSOR_MODEL = exports.DEFAULT_CURSOR_PORT = void 0;
|
|
33
|
+
const http = __importStar(require("http"));
|
|
34
|
+
const cursor_daemon_1 = require("./cursor-daemon");
|
|
35
|
+
/** Default daemon port */
|
|
36
|
+
exports.DEFAULT_CURSOR_PORT = 4242;
|
|
37
|
+
/** Default model ID */
|
|
38
|
+
exports.DEFAULT_CURSOR_MODEL = 'gpt-4.1';
|
|
39
|
+
/**
|
|
40
|
+
* Default models available through Cursor IDE.
|
|
41
|
+
* Used as fallback when daemon is not reachable.
|
|
42
|
+
* Source: Cursor IDE supported models (Feb 2025)
|
|
43
|
+
*/
|
|
44
|
+
exports.DEFAULT_CURSOR_MODELS = [
|
|
45
|
+
// Anthropic Models
|
|
46
|
+
{
|
|
47
|
+
id: 'claude-sonnet-4',
|
|
48
|
+
name: 'Claude Sonnet 4',
|
|
49
|
+
provider: 'anthropic',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 'claude-sonnet-4.5',
|
|
53
|
+
name: 'Claude Sonnet 4.5',
|
|
54
|
+
provider: 'anthropic',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'claude-opus-4',
|
|
58
|
+
name: 'Claude Opus 4',
|
|
59
|
+
provider: 'anthropic',
|
|
60
|
+
},
|
|
61
|
+
// OpenAI Models
|
|
62
|
+
{
|
|
63
|
+
id: 'gpt-4.1',
|
|
64
|
+
name: 'GPT-4.1',
|
|
65
|
+
provider: 'openai',
|
|
66
|
+
isDefault: true,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 'gpt-5-mini',
|
|
70
|
+
name: 'GPT-5 Mini',
|
|
71
|
+
provider: 'openai',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'o3-mini',
|
|
75
|
+
name: 'O3 Mini',
|
|
76
|
+
provider: 'openai',
|
|
77
|
+
},
|
|
78
|
+
// Google Models
|
|
79
|
+
{
|
|
80
|
+
id: 'gemini-2.5-pro',
|
|
81
|
+
name: 'Gemini 2.5 Pro',
|
|
82
|
+
provider: 'google',
|
|
83
|
+
},
|
|
84
|
+
// Cursor Custom Models
|
|
85
|
+
{
|
|
86
|
+
id: 'cursor-small',
|
|
87
|
+
name: 'Cursor Small',
|
|
88
|
+
provider: 'cursor',
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
/**
|
|
92
|
+
* Fetch available models from running cursor daemon.
|
|
93
|
+
*
|
|
94
|
+
* @param port The port cursor daemon is running on
|
|
95
|
+
* @returns List of available models
|
|
96
|
+
*/
|
|
97
|
+
async function fetchModelsFromDaemon(port) {
|
|
98
|
+
return new Promise((resolve) => {
|
|
99
|
+
let resolved = false;
|
|
100
|
+
const safeResolve = (models) => {
|
|
101
|
+
if (resolved)
|
|
102
|
+
return;
|
|
103
|
+
resolved = true;
|
|
104
|
+
resolve(models);
|
|
105
|
+
};
|
|
106
|
+
const req = http.request({
|
|
107
|
+
// Use 127.0.0.1 instead of localhost for more reliable local connections
|
|
108
|
+
hostname: '127.0.0.1',
|
|
109
|
+
port,
|
|
110
|
+
path: '/v1/models',
|
|
111
|
+
method: 'GET',
|
|
112
|
+
timeout: 5000,
|
|
113
|
+
}, (res) => {
|
|
114
|
+
const MAX_BODY_SIZE = 1024 * 1024; // 1MB limit
|
|
115
|
+
let data = '';
|
|
116
|
+
res.on('data', (chunk) => {
|
|
117
|
+
data += chunk;
|
|
118
|
+
if (data.length > MAX_BODY_SIZE) {
|
|
119
|
+
req.destroy();
|
|
120
|
+
safeResolve(exports.DEFAULT_CURSOR_MODELS);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
res.on('end', () => {
|
|
124
|
+
try {
|
|
125
|
+
const response = JSON.parse(data);
|
|
126
|
+
if (response.data && Array.isArray(response.data)) {
|
|
127
|
+
const models = response.data.map((m) => ({
|
|
128
|
+
id: m.id,
|
|
129
|
+
name: formatModelName(m.id),
|
|
130
|
+
provider: detectProvider(m.id),
|
|
131
|
+
isDefault: m.id === exports.DEFAULT_CURSOR_MODEL,
|
|
132
|
+
}));
|
|
133
|
+
safeResolve(models.length > 0 ? models : exports.DEFAULT_CURSOR_MODELS);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
safeResolve(exports.DEFAULT_CURSOR_MODELS);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
safeResolve(exports.DEFAULT_CURSOR_MODELS);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
req.on('error', () => {
|
|
145
|
+
safeResolve(exports.DEFAULT_CURSOR_MODELS);
|
|
146
|
+
});
|
|
147
|
+
req.on('timeout', () => {
|
|
148
|
+
req.destroy();
|
|
149
|
+
safeResolve(exports.DEFAULT_CURSOR_MODELS);
|
|
150
|
+
});
|
|
151
|
+
req.end();
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
exports.fetchModelsFromDaemon = fetchModelsFromDaemon;
|
|
155
|
+
/**
|
|
156
|
+
* Get available models (from daemon or defaults).
|
|
157
|
+
* Checks daemon health first to avoid 5s timeout when daemon is not running.
|
|
158
|
+
*/
|
|
159
|
+
async function getAvailableModels(port) {
|
|
160
|
+
if (!(await (0, cursor_daemon_1.isDaemonRunning)(port))) {
|
|
161
|
+
return exports.DEFAULT_CURSOR_MODELS;
|
|
162
|
+
}
|
|
163
|
+
return fetchModelsFromDaemon(port);
|
|
164
|
+
}
|
|
165
|
+
exports.getAvailableModels = getAvailableModels;
|
|
166
|
+
/**
|
|
167
|
+
* Get the default model.
|
|
168
|
+
* Uses gpt-4.1 as it's commonly available.
|
|
169
|
+
*/
|
|
170
|
+
function getDefaultModel() {
|
|
171
|
+
return exports.DEFAULT_CURSOR_MODEL;
|
|
172
|
+
}
|
|
173
|
+
exports.getDefaultModel = getDefaultModel;
|
|
174
|
+
/**
|
|
175
|
+
* Detect provider from model ID.
|
|
176
|
+
*/
|
|
177
|
+
function detectProvider(modelId) {
|
|
178
|
+
if (modelId.includes('claude'))
|
|
179
|
+
return 'anthropic';
|
|
180
|
+
if (modelId.includes('gpt') || /^o[1-9]\d*(-|$)/.test(modelId))
|
|
181
|
+
return 'openai';
|
|
182
|
+
if (modelId.includes('gemini'))
|
|
183
|
+
return 'google';
|
|
184
|
+
if (modelId.includes('cursor'))
|
|
185
|
+
return 'cursor';
|
|
186
|
+
return 'unknown';
|
|
187
|
+
}
|
|
188
|
+
exports.detectProvider = detectProvider;
|
|
189
|
+
/**
|
|
190
|
+
* Format model ID to human-readable name.
|
|
191
|
+
*/
|
|
192
|
+
function formatModelName(modelId) {
|
|
193
|
+
// Find model in catalog for metadata
|
|
194
|
+
const model = exports.DEFAULT_CURSOR_MODELS.find((m) => m.id === modelId);
|
|
195
|
+
if (model) {
|
|
196
|
+
return model.name;
|
|
197
|
+
}
|
|
198
|
+
// Fallback: convert kebab-case to title case
|
|
199
|
+
return modelId
|
|
200
|
+
.split('-')
|
|
201
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
202
|
+
.join(' ');
|
|
203
|
+
}
|
|
204
|
+
exports.formatModelName = formatModelName;
|
|
205
|
+
//# sourceMappingURL=cursor-models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor-models.js","sourceRoot":"","sources":["../../src/cursor/cursor-models.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAE7B,mDAAkD;AAElD,0BAA0B;AACb,QAAA,mBAAmB,GAAG,IAAI,CAAC;AAExC,uBAAuB;AACV,QAAA,oBAAoB,GAAG,SAAS,CAAC;AAE9C;;;;GAIG;AACU,QAAA,qBAAqB,GAAkB;IAClD,mBAAmB;IACnB;QACE,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,WAAW;KACtB;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,WAAW;KACtB;IACD;QACE,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,WAAW;KACtB;IAED,gBAAgB;IAChB;QACE,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,QAAQ;QAClB,SAAS,EAAE,IAAI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,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAZD,0CAYC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor Protobuf Decoder
|
|
3
|
+
* Implements ConnectRPC protobuf wire format decoding
|
|
4
|
+
*/
|
|
5
|
+
/// <reference types="node" />
|
|
6
|
+
/// <reference types="node" />
|
|
7
|
+
import { type WireType } from './cursor-protobuf-schema.js';
|
|
8
|
+
/**
|
|
9
|
+
* Decode a varint from buffer
|
|
10
|
+
* Returns [value, newOffset]
|
|
11
|
+
*/
|
|
12
|
+
export declare function decodeVarint(buffer: Uint8Array, offset: number): [number, number];
|
|
13
|
+
/**
|
|
14
|
+
* Decode a single protobuf field
|
|
15
|
+
* Returns [fieldNum, wireType, value, newOffset]
|
|
16
|
+
*/
|
|
17
|
+
export declare function decodeField(buffer: Uint8Array, offset: number): [number | null, WireType | null, Uint8Array | number | null, number];
|
|
18
|
+
/**
|
|
19
|
+
* Decode a protobuf message into a map of fields
|
|
20
|
+
*/
|
|
21
|
+
export declare function decodeMessage(data: Uint8Array): Map<number, Array<{
|
|
22
|
+
wireType: WireType;
|
|
23
|
+
value: Uint8Array | number;
|
|
24
|
+
}>>;
|
|
25
|
+
/**
|
|
26
|
+
* Parse ConnectRPC frame from buffer
|
|
27
|
+
* Returns frame data or null if incomplete
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseConnectRPCFrame(buffer: Buffer): {
|
|
30
|
+
flags: number;
|
|
31
|
+
length: number;
|
|
32
|
+
payload: Uint8Array;
|
|
33
|
+
consumed: number;
|
|
34
|
+
} | null;
|
|
35
|
+
/**
|
|
36
|
+
* Extract text and tool calls from response payload
|
|
37
|
+
*/
|
|
38
|
+
export declare function extractTextFromResponse(payload: Uint8Array): {
|
|
39
|
+
text: string | null;
|
|
40
|
+
error: string | null;
|
|
41
|
+
toolCall: {
|
|
42
|
+
id: string;
|
|
43
|
+
type: string;
|
|
44
|
+
function: {
|
|
45
|
+
name: string;
|
|
46
|
+
arguments: string;
|
|
47
|
+
};
|
|
48
|
+
isLast: boolean;
|
|
49
|
+
} | null;
|
|
50
|
+
thinking: string | null;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=cursor-protobuf-decoder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor-protobuf-decoder.d.ts","sourceRoot":"","sources":["../../src/cursor/cursor-protobuf-decoder.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;AAGH,OAAO,EAAmC,KAAK,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAE7F;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAejF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,MAAM,GACb,CAAC,MAAM,GAAG,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,CAsCtE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,UAAU,GACf,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAA;CAAE,CAAC,CAAC,CAoBxE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,UAAU,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAgCP;AAgJD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,UAAU,GAAG;IAC5D,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC;QAC9C,MAAM,EAAE,OAAO,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAkCA"}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cursor Protobuf Decoder
|
|
4
|
+
* Implements ConnectRPC protobuf wire format decoding
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.extractTextFromResponse = exports.parseConnectRPCFrame = exports.decodeMessage = exports.decodeField = exports.decodeVarint = void 0;
|
|
31
|
+
const zlib = __importStar(require("zlib"));
|
|
32
|
+
const cursor_protobuf_schema_js_1 = require("./cursor-protobuf-schema.js");
|
|
33
|
+
/**
|
|
34
|
+
* Decode a varint from buffer
|
|
35
|
+
* Returns [value, newOffset]
|
|
36
|
+
*/
|
|
37
|
+
function decodeVarint(buffer, offset) {
|
|
38
|
+
let result = 0;
|
|
39
|
+
let shift = 0;
|
|
40
|
+
let pos = offset;
|
|
41
|
+
const maxBytes = 5;
|
|
42
|
+
while (pos < buffer.length && pos - offset < maxBytes) {
|
|
43
|
+
const b = buffer[pos];
|
|
44
|
+
result |= (b & 0x7f) << shift;
|
|
45
|
+
pos++;
|
|
46
|
+
if (!(b & 0x80))
|
|
47
|
+
break;
|
|
48
|
+
shift += 7;
|
|
49
|
+
}
|
|
50
|
+
return [result >>> 0, pos]; // Ensure unsigned
|
|
51
|
+
}
|
|
52
|
+
exports.decodeVarint = decodeVarint;
|
|
53
|
+
/**
|
|
54
|
+
* Decode a single protobuf field
|
|
55
|
+
* Returns [fieldNum, wireType, value, newOffset]
|
|
56
|
+
*/
|
|
57
|
+
function decodeField(buffer, offset) {
|
|
58
|
+
if (offset >= buffer.length) {
|
|
59
|
+
return [null, null, null, offset];
|
|
60
|
+
}
|
|
61
|
+
const [tag, pos1] = decodeVarint(buffer, offset);
|
|
62
|
+
const fieldNum = tag >> 3;
|
|
63
|
+
const wireType = (tag & 0x07);
|
|
64
|
+
let value;
|
|
65
|
+
let pos = pos1;
|
|
66
|
+
if (wireType === cursor_protobuf_schema_js_1.WIRE_TYPE.VARINT) {
|
|
67
|
+
[value, pos] = decodeVarint(buffer, pos);
|
|
68
|
+
}
|
|
69
|
+
else if (wireType === cursor_protobuf_schema_js_1.WIRE_TYPE.LEN) {
|
|
70
|
+
const [length, pos2] = decodeVarint(buffer, pos);
|
|
71
|
+
if (pos2 + length > buffer.length) {
|
|
72
|
+
return [null, null, null, buffer.length];
|
|
73
|
+
}
|
|
74
|
+
value = buffer.slice(pos2, pos2 + length);
|
|
75
|
+
pos = pos2 + length;
|
|
76
|
+
}
|
|
77
|
+
else if (wireType === cursor_protobuf_schema_js_1.WIRE_TYPE.FIXED64) {
|
|
78
|
+
if (pos + 8 > buffer.length) {
|
|
79
|
+
return [null, null, null, buffer.length];
|
|
80
|
+
}
|
|
81
|
+
value = buffer.slice(pos, pos + 8);
|
|
82
|
+
pos += 8;
|
|
83
|
+
}
|
|
84
|
+
else if (wireType === cursor_protobuf_schema_js_1.WIRE_TYPE.FIXED32) {
|
|
85
|
+
if (pos + 4 > buffer.length) {
|
|
86
|
+
return [null, null, null, buffer.length];
|
|
87
|
+
}
|
|
88
|
+
value = buffer.slice(pos, pos + 4);
|
|
89
|
+
pos += 4;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
value = null;
|
|
93
|
+
}
|
|
94
|
+
return [fieldNum, wireType, value, pos];
|
|
95
|
+
}
|
|
96
|
+
exports.decodeField = decodeField;
|
|
97
|
+
/**
|
|
98
|
+
* Decode a protobuf message into a map of fields
|
|
99
|
+
*/
|
|
100
|
+
function decodeMessage(data) {
|
|
101
|
+
const fields = new Map();
|
|
102
|
+
let pos = 0;
|
|
103
|
+
// NOTE: If two fields share the same field number but different wire types, later values overwrite earlier ones.
|
|
104
|
+
while (pos < data.length) {
|
|
105
|
+
const [fieldNum, wireType, value, newPos] = decodeField(data, pos);
|
|
106
|
+
if (fieldNum === null || wireType === null || value === null)
|
|
107
|
+
break;
|
|
108
|
+
if (!fields.has(fieldNum)) {
|
|
109
|
+
fields.set(fieldNum, []);
|
|
110
|
+
}
|
|
111
|
+
const fieldArray = fields.get(fieldNum);
|
|
112
|
+
if (fieldArray) {
|
|
113
|
+
fieldArray.push({ wireType, value: value });
|
|
114
|
+
}
|
|
115
|
+
pos = newPos;
|
|
116
|
+
}
|
|
117
|
+
return fields;
|
|
118
|
+
}
|
|
119
|
+
exports.decodeMessage = decodeMessage;
|
|
120
|
+
/**
|
|
121
|
+
* Parse ConnectRPC frame from buffer
|
|
122
|
+
* Returns frame data or null if incomplete
|
|
123
|
+
*/
|
|
124
|
+
function parseConnectRPCFrame(buffer) {
|
|
125
|
+
if (buffer.length < 5)
|
|
126
|
+
return null;
|
|
127
|
+
const flags = buffer[0];
|
|
128
|
+
const length = (buffer[1] << 24) | (buffer[2] << 16) | (buffer[3] << 8) | buffer[4];
|
|
129
|
+
if (buffer.length < 5 + length)
|
|
130
|
+
return null;
|
|
131
|
+
let payload = buffer.slice(5, 5 + length);
|
|
132
|
+
// Decompress if gzip
|
|
133
|
+
if (flags === cursor_protobuf_schema_js_1.COMPRESS_FLAG.GZIP ||
|
|
134
|
+
flags === cursor_protobuf_schema_js_1.COMPRESS_FLAG.GZIP_ALT ||
|
|
135
|
+
flags === cursor_protobuf_schema_js_1.COMPRESS_FLAG.GZIP_BOTH) {
|
|
136
|
+
try {
|
|
137
|
+
payload = Buffer.from(zlib.gunzipSync(payload));
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
if (process.env.CCS_DEBUG) {
|
|
141
|
+
console.error('[cursor] parseConnectRPCFrame decompression failed:', err);
|
|
142
|
+
}
|
|
143
|
+
// Decompression failed, use raw payload
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
flags,
|
|
148
|
+
length,
|
|
149
|
+
payload: new Uint8Array(payload),
|
|
150
|
+
consumed: 5 + length,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
exports.parseConnectRPCFrame = parseConnectRPCFrame;
|
|
154
|
+
/**
|
|
155
|
+
* Extract tool call from protobuf data
|
|
156
|
+
*/
|
|
157
|
+
function extractToolCall(toolCallData) {
|
|
158
|
+
const toolCall = decodeMessage(toolCallData);
|
|
159
|
+
let toolCallId = '';
|
|
160
|
+
let toolName = '';
|
|
161
|
+
let rawArgs = '';
|
|
162
|
+
let isLast = false;
|
|
163
|
+
// Extract tool call ID
|
|
164
|
+
if (toolCall.has(cursor_protobuf_schema_js_1.FIELD.TOOL_ID)) {
|
|
165
|
+
const idField = toolCall.get(cursor_protobuf_schema_js_1.FIELD.TOOL_ID);
|
|
166
|
+
if (idField && idField[0]) {
|
|
167
|
+
const fullId = new TextDecoder().decode(idField[0].value);
|
|
168
|
+
toolCallId = fullId.split('\n')[0]; // Take first line
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Extract tool name
|
|
172
|
+
if (toolCall.has(cursor_protobuf_schema_js_1.FIELD.TOOL_NAME)) {
|
|
173
|
+
const nameField = toolCall.get(cursor_protobuf_schema_js_1.FIELD.TOOL_NAME);
|
|
174
|
+
if (nameField && nameField[0]) {
|
|
175
|
+
toolName = new TextDecoder().decode(nameField[0].value);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// Extract is_last flag
|
|
179
|
+
if (toolCall.has(cursor_protobuf_schema_js_1.FIELD.TOOL_IS_LAST)) {
|
|
180
|
+
const lastField = toolCall.get(cursor_protobuf_schema_js_1.FIELD.TOOL_IS_LAST);
|
|
181
|
+
if (lastField && lastField[0]) {
|
|
182
|
+
isLast = lastField[0].value !== 0;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// Extract MCP params - nested real tool info
|
|
186
|
+
if (toolCall.has(cursor_protobuf_schema_js_1.FIELD.TOOL_MCP_PARAMS)) {
|
|
187
|
+
try {
|
|
188
|
+
const mcpField = toolCall.get(cursor_protobuf_schema_js_1.FIELD.TOOL_MCP_PARAMS);
|
|
189
|
+
if (!mcpField || !mcpField[0])
|
|
190
|
+
return null;
|
|
191
|
+
const mcpParams = decodeMessage(mcpField[0].value);
|
|
192
|
+
if (mcpParams.has(cursor_protobuf_schema_js_1.FIELD.MCP_TOOLS_LIST)) {
|
|
193
|
+
const toolsList = mcpParams.get(cursor_protobuf_schema_js_1.FIELD.MCP_TOOLS_LIST);
|
|
194
|
+
if (!toolsList || !toolsList[0])
|
|
195
|
+
return null;
|
|
196
|
+
const tool = decodeMessage(toolsList[0].value);
|
|
197
|
+
if (tool.has(cursor_protobuf_schema_js_1.FIELD.MCP_NESTED_NAME)) {
|
|
198
|
+
const nestedName = tool.get(cursor_protobuf_schema_js_1.FIELD.MCP_NESTED_NAME);
|
|
199
|
+
if (nestedName && nestedName[0]) {
|
|
200
|
+
toolName = new TextDecoder().decode(nestedName[0].value);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (tool.has(cursor_protobuf_schema_js_1.FIELD.MCP_NESTED_PARAMS)) {
|
|
204
|
+
const nestedParams = tool.get(cursor_protobuf_schema_js_1.FIELD.MCP_NESTED_PARAMS);
|
|
205
|
+
if (nestedParams && nestedParams[0]) {
|
|
206
|
+
rawArgs = new TextDecoder().decode(nestedParams[0].value);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
catch (err) {
|
|
212
|
+
if (process.env.CCS_DEBUG) {
|
|
213
|
+
console.error('[cursor] extractToolCall MCP parsing failed:', err);
|
|
214
|
+
}
|
|
215
|
+
// MCP parse error, continue
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// Fallback to raw_args
|
|
219
|
+
if (!rawArgs && toolCall.has(cursor_protobuf_schema_js_1.FIELD.TOOL_RAW_ARGS)) {
|
|
220
|
+
const rawArgsField = toolCall.get(cursor_protobuf_schema_js_1.FIELD.TOOL_RAW_ARGS);
|
|
221
|
+
if (rawArgsField && rawArgsField[0]) {
|
|
222
|
+
rawArgs = new TextDecoder().decode(rawArgsField[0].value);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (toolCallId && toolName) {
|
|
226
|
+
return {
|
|
227
|
+
id: toolCallId,
|
|
228
|
+
type: 'function',
|
|
229
|
+
function: {
|
|
230
|
+
name: toolName,
|
|
231
|
+
arguments: rawArgs || '{}',
|
|
232
|
+
},
|
|
233
|
+
isLast,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Extract text and thinking from response data
|
|
240
|
+
*/
|
|
241
|
+
function extractTextAndThinking(responseData) {
|
|
242
|
+
const nested = decodeMessage(responseData);
|
|
243
|
+
let text = null;
|
|
244
|
+
let thinking = null;
|
|
245
|
+
// Extract text
|
|
246
|
+
if (nested.has(cursor_protobuf_schema_js_1.FIELD.RESPONSE_TEXT)) {
|
|
247
|
+
const textField = nested.get(cursor_protobuf_schema_js_1.FIELD.RESPONSE_TEXT);
|
|
248
|
+
if (textField && textField[0]) {
|
|
249
|
+
text = new TextDecoder().decode(textField[0].value);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
// Extract thinking
|
|
253
|
+
if (nested.has(cursor_protobuf_schema_js_1.FIELD.THINKING)) {
|
|
254
|
+
try {
|
|
255
|
+
const thinkingField = nested.get(cursor_protobuf_schema_js_1.FIELD.THINKING);
|
|
256
|
+
if (thinkingField && thinkingField[0]) {
|
|
257
|
+
const thinkingMsg = decodeMessage(thinkingField[0].value);
|
|
258
|
+
if (thinkingMsg.has(cursor_protobuf_schema_js_1.FIELD.THINKING_TEXT)) {
|
|
259
|
+
const thinkingTextField = thinkingMsg.get(cursor_protobuf_schema_js_1.FIELD.THINKING_TEXT);
|
|
260
|
+
if (thinkingTextField && thinkingTextField[0]) {
|
|
261
|
+
thinking = new TextDecoder().decode(thinkingTextField[0].value);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
catch (err) {
|
|
267
|
+
if (process.env.CCS_DEBUG) {
|
|
268
|
+
console.error('[cursor] extractTextAndThinking parsing failed:', err);
|
|
269
|
+
}
|
|
270
|
+
// Thinking parse error, continue
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return { text, thinking };
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Extract text and tool calls from response payload
|
|
277
|
+
*/
|
|
278
|
+
function extractTextFromResponse(payload) {
|
|
279
|
+
try {
|
|
280
|
+
const fields = decodeMessage(payload);
|
|
281
|
+
// Field 1: ClientSideToolV2Call
|
|
282
|
+
if (fields.has(cursor_protobuf_schema_js_1.FIELD.TOOL_CALL)) {
|
|
283
|
+
const toolCallField = fields.get(cursor_protobuf_schema_js_1.FIELD.TOOL_CALL);
|
|
284
|
+
if (toolCallField && toolCallField[0]) {
|
|
285
|
+
const toolCall = extractToolCall(toolCallField[0].value);
|
|
286
|
+
if (toolCall) {
|
|
287
|
+
return { text: null, error: null, toolCall, thinking: null };
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
// Field 2: StreamUnifiedChatResponse
|
|
292
|
+
if (fields.has(cursor_protobuf_schema_js_1.FIELD.RESPONSE)) {
|
|
293
|
+
const responseField = fields.get(cursor_protobuf_schema_js_1.FIELD.RESPONSE);
|
|
294
|
+
if (responseField && responseField[0]) {
|
|
295
|
+
const { text, thinking } = extractTextAndThinking(responseField[0].value);
|
|
296
|
+
if (text || thinking) {
|
|
297
|
+
return { text, error: null, toolCall: null, thinking };
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return { text: null, error: null, toolCall: null, thinking: null };
|
|
302
|
+
}
|
|
303
|
+
catch (err) {
|
|
304
|
+
if (process.env.CCS_DEBUG) {
|
|
305
|
+
console.error('[cursor] extractTextFromResponse parsing failed:', err);
|
|
306
|
+
}
|
|
307
|
+
return { text: null, error: null, toolCall: null, thinking: null };
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
exports.extractTextFromResponse = extractTextFromResponse;
|
|
311
|
+
//# sourceMappingURL=cursor-protobuf-decoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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