mcp-perforce-server 1.0.0

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.
@@ -0,0 +1,303 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.P4Runner = void 0;
37
+ const child_process_1 = require("child_process");
38
+ const os = __importStar(require("os"));
39
+ class P4Runner {
40
+ constructor() {
41
+ // Support P4_PATH environment variable override
42
+ this.p4Path = process.env.P4_PATH || (os.platform() === 'win32' ? 'p4.exe' : 'p4');
43
+ }
44
+ async run(command, args = [], cwd = process.cwd(), options = {}) {
45
+ const { timeout = P4Runner.DEFAULT_TIMEOUT, env = {}, parseOutput = true, useZtag = false, useMarshalled = false, } = options;
46
+ // Build full command args
47
+ const fullArgs = [];
48
+ // Add global flags for non-interactive operation
49
+ fullArgs.push('-s'); // Script mode - suppress info messages
50
+ if (useMarshalled && this.supportsMarshalled()) {
51
+ fullArgs.push('-G'); // Marshaled output
52
+ }
53
+ else if (useZtag) {
54
+ fullArgs.push('-ztag'); // Tagged output
55
+ }
56
+ // Add the command
57
+ fullArgs.push(command);
58
+ // Add command-specific args
59
+ fullArgs.push(...args);
60
+ // Set up environment
61
+ const processEnv = {
62
+ ...process.env,
63
+ ...env,
64
+ // Ensure P4CONFIG is set for .p4config detection
65
+ P4CONFIG: env.P4CONFIG || process.env.P4CONFIG || '.p4config',
66
+ };
67
+ const result = {
68
+ ok: false,
69
+ command: this.p4Path,
70
+ args: fullArgs,
71
+ cwd,
72
+ configUsed: this.extractConfigFromEnv(processEnv),
73
+ };
74
+ try {
75
+ const { stdout, stderr, exitCode } = await this.spawnP4Process(fullArgs, {
76
+ cwd,
77
+ env: processEnv,
78
+ timeout,
79
+ });
80
+ if (exitCode === 0) {
81
+ result.ok = true;
82
+ if (parseOutput && stdout.trim()) {
83
+ result.result = this.parseOutput(stdout, useZtag, useMarshalled);
84
+ }
85
+ else {
86
+ result.result = stdout.trim() || null;
87
+ }
88
+ // Check for warnings in stderr
89
+ if (stderr.trim()) {
90
+ result.warnings = stderr.split('\n').filter(line => line.trim());
91
+ }
92
+ }
93
+ else {
94
+ result.error = this.mapError(exitCode, stderr, stdout);
95
+ }
96
+ }
97
+ catch (error) {
98
+ result.error = this.mapError(-1, String(error), '');
99
+ }
100
+ return result;
101
+ }
102
+ async spawnP4Process(args, options) {
103
+ return new Promise((resolve, reject) => {
104
+ const spawnOptions = {
105
+ cwd: options.cwd,
106
+ env: options.env,
107
+ shell: false, // Critical: avoid shell on Windows
108
+ windowsHide: true,
109
+ stdio: ['ignore', 'pipe', 'pipe'], // Hide stdin, capture stdout/stderr
110
+ detached: false, // Keep attached to parent process
111
+ };
112
+ const child = (0, child_process_1.spawn)(this.p4Path, args, spawnOptions);
113
+ let stdout = '';
114
+ let stderr = '';
115
+ let timeoutHandle = null;
116
+ // Set up timeout
117
+ if (options.timeout > 0) {
118
+ timeoutHandle = setTimeout(() => {
119
+ child.kill('SIGTERM');
120
+ reject(new Error(`Command timeout after ${options.timeout}ms`));
121
+ }, options.timeout);
122
+ }
123
+ // Collect output
124
+ child.stdout?.on('data', (data) => {
125
+ stdout += data.toString();
126
+ });
127
+ child.stderr?.on('data', (data) => {
128
+ stderr += data.toString();
129
+ });
130
+ child.on('close', (code) => {
131
+ if (timeoutHandle) {
132
+ clearTimeout(timeoutHandle);
133
+ }
134
+ resolve({
135
+ stdout,
136
+ stderr,
137
+ exitCode: code ?? -1,
138
+ });
139
+ });
140
+ child.on('error', (error) => {
141
+ if (timeoutHandle) {
142
+ clearTimeout(timeoutHandle);
143
+ }
144
+ reject(error);
145
+ });
146
+ });
147
+ }
148
+ parseOutput(output, useZtag, useMarshalled) {
149
+ if (!output.trim()) {
150
+ return null;
151
+ }
152
+ try {
153
+ if (useMarshalled) {
154
+ // Parse marshaled output (binary format) - simplified parsing
155
+ // In practice, you'd use a proper marshaling library
156
+ return this.parseMarshaled(output);
157
+ }
158
+ else if (useZtag) {
159
+ return this.parseZtagOutput(output);
160
+ }
161
+ else {
162
+ // Try to parse as structured text
163
+ return this.parseTextOutput(output);
164
+ }
165
+ }
166
+ catch (error) {
167
+ // If parsing fails, return raw output
168
+ return output;
169
+ }
170
+ }
171
+ parseZtagOutput(output) {
172
+ const results = [];
173
+ const lines = output.split('\n');
174
+ let currentRecord = {};
175
+ for (const line of lines) {
176
+ const trimmedLine = line.trim();
177
+ if (!trimmedLine) {
178
+ if (Object.keys(currentRecord).length > 0) {
179
+ results.push(currentRecord);
180
+ currentRecord = {};
181
+ }
182
+ continue;
183
+ }
184
+ const match = trimmedLine.match(/^\.\.\. (\w+)\s+(.*)$/);
185
+ if (match) {
186
+ const [, key, value] = match;
187
+ currentRecord[key] = value;
188
+ }
189
+ }
190
+ if (Object.keys(currentRecord).length > 0) {
191
+ results.push(currentRecord);
192
+ }
193
+ return results.length === 1 ? results[0] : results;
194
+ }
195
+ parseMarshaled(output) {
196
+ // Simplified marshaled parsing - in production, use proper library
197
+ // This is a placeholder implementation
198
+ return { raw: output, note: 'Marshaled parsing not fully implemented' };
199
+ }
200
+ parseTextOutput(output) {
201
+ const lines = output.split('\n').filter(line => line.trim());
202
+ // Try to detect structured output patterns
203
+ if (lines.some(line => line.includes(': '))) {
204
+ const result = {};
205
+ for (const line of lines) {
206
+ const colonIndex = line.indexOf(': ');
207
+ if (colonIndex > 0) {
208
+ const key = line.substring(0, colonIndex).trim();
209
+ const value = line.substring(colonIndex + 2).trim();
210
+ result[key] = value;
211
+ }
212
+ }
213
+ return Object.keys(result).length > 0 ? result : lines;
214
+ }
215
+ return lines;
216
+ }
217
+ supportsMarshalled() {
218
+ // Check if marshaled output is supported for this command
219
+ // Most p4 commands support -G but some don't
220
+ return true; // Simplified - in practice, maintain a whitelist
221
+ }
222
+ extractConfigFromEnv(env) {
223
+ const configKeys = ['P4PORT', 'P4USER', 'P4CLIENT', 'P4CHARSET', 'P4PASSWD'];
224
+ const config = {};
225
+ for (const key of configKeys) {
226
+ if (env[key]) {
227
+ // Mask password in logs
228
+ config[key] = key === 'P4PASSWD' ? '***masked***' : env[key];
229
+ }
230
+ }
231
+ return config;
232
+ }
233
+ mapError(exitCode, stderr, stdout) {
234
+ const errorMessage = stderr || stdout || 'Unknown error';
235
+ // Map common Perforce error patterns to stable error codes
236
+ if (errorMessage.includes('Perforce client error') || exitCode === 127 || exitCode === -1) {
237
+ return {
238
+ code: 'P4_NOT_FOUND',
239
+ message: 'Perforce executable not found or not accessible',
240
+ details: { stderr: errorMessage, exitCode },
241
+ stderr,
242
+ exitCode,
243
+ };
244
+ }
245
+ if (errorMessage.includes('Perforce password') || errorMessage.includes('Access denied')) {
246
+ return {
247
+ code: 'P4_AUTH_FAILED',
248
+ message: 'Perforce authentication failed',
249
+ details: { stderr: errorMessage, exitCode },
250
+ stderr,
251
+ exitCode,
252
+ };
253
+ }
254
+ if (errorMessage.includes("Client '") && errorMessage.includes("' unknown")) {
255
+ return {
256
+ code: 'P4_CLIENT_UNKNOWN',
257
+ message: 'Perforce client/workspace unknown',
258
+ details: { stderr: errorMessage, exitCode },
259
+ stderr,
260
+ exitCode,
261
+ };
262
+ }
263
+ if (errorMessage.includes('Connect to server failed') || errorMessage.includes('TCP connect')) {
264
+ return {
265
+ code: 'P4_CONNECTION_FAILED',
266
+ message: 'Failed to connect to Perforce server',
267
+ details: { stderr: errorMessage, exitCode },
268
+ stderr,
269
+ exitCode,
270
+ };
271
+ }
272
+ if (errorMessage.includes('timeout') || errorMessage.includes('Command timeout')) {
273
+ return {
274
+ code: 'P4_TIMEOUT',
275
+ message: 'Perforce command timed out',
276
+ details: { stderr: errorMessage, exitCode },
277
+ stderr,
278
+ exitCode,
279
+ };
280
+ }
281
+ if (errorMessage.includes('not under client')) {
282
+ return {
283
+ code: 'P4_NOT_UNDER_CLIENT',
284
+ message: 'File(s) not under client root',
285
+ details: { stderr: errorMessage, exitCode },
286
+ stderr,
287
+ exitCode,
288
+ };
289
+ }
290
+ // Note: P4_READONLY_MODE and P4_DELETE_DISABLED are handled at the tool level
291
+ // and should not appear here as they're not p4 command errors
292
+ return {
293
+ code: 'P4_COMMAND_FAILED',
294
+ message: errorMessage || `Command failed with exit code ${exitCode}`,
295
+ details: { stderr: errorMessage, exitCode },
296
+ stderr,
297
+ exitCode,
298
+ };
299
+ }
300
+ }
301
+ exports.P4Runner = P4Runner;
302
+ P4Runner.DEFAULT_TIMEOUT = 60000; // 60 seconds
303
+ //# sourceMappingURL=runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/p4/runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YAC9F,OAAO;gBACL,IAAI,EAAE,sBAAsB;gBAC5B,OAAO,EAAE,sCAAsC;gBAC/C,OAAO,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE;gBAC3C,MAAM;gBACN,QAAQ;aACT,CAAC;QACJ,CAAC;QAED,IAAI,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACjF,OAAO;gBACL,IAAI,EAAE,YAAY;gBAClB,OAAO,EAAE,4BAA4B;gBACrC,OAAO,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE;gBAC3C,MAAM;gBACN,QAAQ;aACT,CAAC;QACJ,CAAC;QAED,IAAI,YAAY,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAC9C,OAAO;gBACL,IAAI,EAAE,qBAAqB;gBAC3B,OAAO,EAAE,+BAA+B;gBACxC,OAAO,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE;gBAC3C,MAAM;gBACN,QAAQ;aACT,CAAC;QACJ,CAAC;QAED,8EAA8E;QAC9E,8DAA8D;QAE9D,OAAO;YACL,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,YAAY,IAAI,iCAAiC,QAAQ,EAAE;YACpE,OAAO,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE;YAC3C,MAAM;YACN,QAAQ;SACT,CAAC;IACJ,CAAC;;AA3TH,4BA4TC;AA3TyB,wBAAe,GAAG,KAAK,CAAC,CAAC,aAAa"}
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ declare class MCPPerforceServer {
3
+ private server;
4
+ private context;
5
+ constructor();
6
+ private setupErrorHandling;
7
+ private setupToolHandlers;
8
+ run(): Promise<void>;
9
+ }
10
+ export { MCPPerforceServer };
11
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAmCA,cAAM,iBAAiB;IACrB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAc;;IAyB7B,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,iBAAiB;IA0anB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAM3B;AA8CD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}