@mtaap/mcp 0.2.13 → 0.4.1
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/README.md +1 -1
- package/dist/cli.js +469 -260
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +19 -4
- package/dist/index.js +467 -258
- package/dist/index.js.map +1 -1
- package/dist/server.js +597 -269
- package/dist/server.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
|
44
44
|
// package.json
|
|
45
45
|
var package_default = {
|
|
46
46
|
name: "@mtaap/mcp",
|
|
47
|
-
version: "0.
|
|
47
|
+
version: "0.4.1",
|
|
48
48
|
description: "Model Context Protocol (MCP) server for AI agents to interact with Collab - the multi-tenant collaborative agent development platform",
|
|
49
49
|
mcpName: "collab",
|
|
50
50
|
scripts: {
|
|
@@ -53,6 +53,7 @@ var package_default = {
|
|
|
53
53
|
main: "./dist/index.js",
|
|
54
54
|
types: "./dist/index.d.ts",
|
|
55
55
|
bin: {
|
|
56
|
+
mcp: "./dist/cli.js",
|
|
56
57
|
"collab-mcp": "./dist/cli.js",
|
|
57
58
|
"collab-mcp-server": "./dist/server.js"
|
|
58
59
|
},
|
|
@@ -102,7 +103,7 @@ var package_default = {
|
|
|
102
103
|
var VERSION = package_default.version;
|
|
103
104
|
|
|
104
105
|
// src/index.ts
|
|
105
|
-
var
|
|
106
|
+
var import_zod4 = require("zod");
|
|
106
107
|
|
|
107
108
|
// ../../packages/core/dist/constants/enums.js
|
|
108
109
|
var TaskState;
|
|
@@ -189,12 +190,6 @@ var WebSocketEventType;
|
|
|
189
190
|
WebSocketEventType2["TASK_DELETED"] = "task.deleted";
|
|
190
191
|
WebSocketEventType2["MEMBER_JOINED"] = "member.joined";
|
|
191
192
|
})(WebSocketEventType || (WebSocketEventType = {}));
|
|
192
|
-
var AuthProvider;
|
|
193
|
-
(function(AuthProvider2) {
|
|
194
|
-
AuthProvider2["CREDENTIALS"] = "credentials";
|
|
195
|
-
AuthProvider2["LDAP"] = "ldap";
|
|
196
|
-
AuthProvider2["SSO"] = "sso";
|
|
197
|
-
})(AuthProvider || (AuthProvider = {}));
|
|
198
193
|
var SubscriptionStatus;
|
|
199
194
|
(function(SubscriptionStatus2) {
|
|
200
195
|
SubscriptionStatus2["ACTIVE"] = "ACTIVE";
|
|
@@ -210,6 +205,12 @@ var EventType;
|
|
|
210
205
|
EventType2["ACCESS"] = "ACCESS";
|
|
211
206
|
EventType2["MODIFICATION"] = "MODIFICATION";
|
|
212
207
|
})(EventType || (EventType = {}));
|
|
208
|
+
var CreatedVia;
|
|
209
|
+
(function(CreatedVia2) {
|
|
210
|
+
CreatedVia2["UI"] = "UI";
|
|
211
|
+
CreatedVia2["API_KEY"] = "API_KEY";
|
|
212
|
+
CreatedVia2["OAUTH"] = "OAUTH";
|
|
213
|
+
})(CreatedVia || (CreatedVia = {}));
|
|
213
214
|
|
|
214
215
|
// ../../packages/core/dist/constants/state-machine.js
|
|
215
216
|
var VALID_TRANSITIONS = {
|
|
@@ -233,6 +234,62 @@ var VALID_TRANSITIONS = {
|
|
|
233
234
|
[TaskState.DONE]: []
|
|
234
235
|
};
|
|
235
236
|
|
|
237
|
+
// ../../packages/core/dist/constants/oauth.js
|
|
238
|
+
var OAuthScopes = {
|
|
239
|
+
/** Read-only access to MCP resources */
|
|
240
|
+
READ: "mcp:read",
|
|
241
|
+
/** Read and write access to MCP resources */
|
|
242
|
+
WRITE: "mcp:write",
|
|
243
|
+
/** Full administrative access */
|
|
244
|
+
ADMIN: "mcp:admin"
|
|
245
|
+
};
|
|
246
|
+
var VALID_OAUTH_SCOPES = [
|
|
247
|
+
OAuthScopes.READ,
|
|
248
|
+
OAuthScopes.WRITE,
|
|
249
|
+
OAuthScopes.ADMIN
|
|
250
|
+
];
|
|
251
|
+
var DEFAULT_OAUTH_SCOPES = `${OAuthScopes.READ} ${OAuthScopes.WRITE}`;
|
|
252
|
+
var OAUTH_SCOPE_TO_PERMISSION = {
|
|
253
|
+
[OAuthScopes.READ]: ApiKeyPermission.READ,
|
|
254
|
+
[OAuthScopes.WRITE]: ApiKeyPermission.WRITE,
|
|
255
|
+
[OAuthScopes.ADMIN]: ApiKeyPermission.ADMIN
|
|
256
|
+
};
|
|
257
|
+
var PERMISSION_TO_OAUTH_SCOPE = {
|
|
258
|
+
[ApiKeyPermission.READ]: OAuthScopes.READ,
|
|
259
|
+
[ApiKeyPermission.WRITE]: OAuthScopes.WRITE,
|
|
260
|
+
[ApiKeyPermission.ADMIN]: OAuthScopes.ADMIN
|
|
261
|
+
};
|
|
262
|
+
var OAuthTokenLifetimes = {
|
|
263
|
+
/** Access token lifetime: 1 hour */
|
|
264
|
+
ACCESS_TOKEN_MS: 60 * 60 * 1e3,
|
|
265
|
+
/** Refresh token lifetime: 30 days */
|
|
266
|
+
REFRESH_TOKEN_MS: 30 * 24 * 60 * 60 * 1e3,
|
|
267
|
+
/** Authorization code lifetime: 10 minutes */
|
|
268
|
+
AUTHORIZATION_CODE_MS: 10 * 60 * 1e3
|
|
269
|
+
};
|
|
270
|
+
var OAuthGrantTypes = {
|
|
271
|
+
AUTHORIZATION_CODE: "authorization_code",
|
|
272
|
+
REFRESH_TOKEN: "refresh_token"
|
|
273
|
+
};
|
|
274
|
+
var SUPPORTED_GRANT_TYPES = [
|
|
275
|
+
OAuthGrantTypes.AUTHORIZATION_CODE,
|
|
276
|
+
OAuthGrantTypes.REFRESH_TOKEN
|
|
277
|
+
];
|
|
278
|
+
var OAuthResponseTypes = {
|
|
279
|
+
CODE: "code"
|
|
280
|
+
};
|
|
281
|
+
var OAuthCodeChallengeMethods = {
|
|
282
|
+
S256: "S256"
|
|
283
|
+
};
|
|
284
|
+
var OAuthRateLimits = {
|
|
285
|
+
/** /oauth/token: 30 requests per minute per client */
|
|
286
|
+
TOKEN_ENDPOINT: { limit: 30, windowMs: 60 * 1e3 },
|
|
287
|
+
/** /oauth/authorize: 10 requests per minute per user */
|
|
288
|
+
AUTHORIZE_ENDPOINT: { limit: 10, windowMs: 60 * 1e3 },
|
|
289
|
+
/** /oauth/register: 5 requests per minute per IP */
|
|
290
|
+
REGISTER_ENDPOINT: { limit: 5, windowMs: 60 * 1e3 }
|
|
291
|
+
};
|
|
292
|
+
|
|
236
293
|
// ../../packages/core/dist/config/deployment.js
|
|
237
294
|
var config = {
|
|
238
295
|
deploymentMode: process.env.DEPLOYMENT_MODE || "saas"
|
|
@@ -240,20 +297,24 @@ var config = {
|
|
|
240
297
|
var isSaas = config.deploymentMode === "saas";
|
|
241
298
|
var isOnPrem = config.deploymentMode === "onprem";
|
|
242
299
|
|
|
243
|
-
// ../../packages/core/dist/
|
|
244
|
-
var
|
|
300
|
+
// ../../packages/core/dist/versions.js
|
|
301
|
+
var VERSIONS = {
|
|
302
|
+
core: "0.3.0",
|
|
303
|
+
web: "0.3.0",
|
|
304
|
+
mcp: "0.4.1"
|
|
305
|
+
};
|
|
306
|
+
var VERSION2 = VERSIONS.core;
|
|
245
307
|
|
|
246
308
|
// ../../packages/core/dist/config/index.js
|
|
247
309
|
var DEPLOYMENT_MODE = process.env.DEPLOYMENT_MODE || "saas";
|
|
248
310
|
var config2 = {
|
|
249
311
|
version: VERSION2,
|
|
312
|
+
packages: VERSIONS,
|
|
250
313
|
deploymentMode: DEPLOYMENT_MODE,
|
|
251
314
|
billing: {
|
|
252
315
|
enabled: DEPLOYMENT_MODE === "saas",
|
|
253
316
|
revenuecat: {
|
|
254
|
-
publicKey: process.env.
|
|
255
|
-
stripeKey: process.env.STRIPE_SECRET_KEY
|
|
256
|
-
// Required by RevenueCat Web Billing
|
|
317
|
+
publicKey: process.env.NEXT_PUBLIC_REVENUECAT_PUBLIC_KEY
|
|
257
318
|
}
|
|
258
319
|
},
|
|
259
320
|
licensing: {
|
|
@@ -359,7 +420,6 @@ var OrganizationIdSchema = import_zod.z.string().regex(/^org_[a-zA-Z0-9]+$/);
|
|
|
359
420
|
var OrganizationSchema = import_zod.z.object({
|
|
360
421
|
id: OrganizationIdSchema,
|
|
361
422
|
name: import_zod.z.string().min(1).max(255),
|
|
362
|
-
slug: import_zod.z.string().min(1).max(100).regex(/^[a-z0-9-]+$/),
|
|
363
423
|
logoUrl: import_zod.z.string().url().nullable(),
|
|
364
424
|
accentColor: import_zod.z.string().regex(/^#[0-9A-Fa-f]{6}$/).nullable(),
|
|
365
425
|
tenantName: import_zod.z.string().nullable(),
|
|
@@ -487,239 +547,375 @@ var ProjectCollaboratorSchema = import_zod.z.object({
|
|
|
487
547
|
});
|
|
488
548
|
|
|
489
549
|
// ../../packages/core/dist/validation/index.js
|
|
550
|
+
var import_zod3 = require("zod");
|
|
551
|
+
|
|
552
|
+
// ../../packages/core/dist/validation/oauth.js
|
|
490
553
|
var import_zod2 = require("zod");
|
|
491
|
-
var
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
var
|
|
554
|
+
var scopeString = import_zod2.z.string().optional().transform((val) => {
|
|
555
|
+
if (!val)
|
|
556
|
+
return void 0;
|
|
557
|
+
const scopes = val.split(" ").filter(Boolean);
|
|
558
|
+
const validScopes = scopes.filter((s) => VALID_OAUTH_SCOPES.includes(s));
|
|
559
|
+
return validScopes.length > 0 ? validScopes.join(" ") : void 0;
|
|
560
|
+
});
|
|
561
|
+
var redirectUri = import_zod2.z.string().url().refine((uri) => {
|
|
562
|
+
const url = new URL(uri);
|
|
563
|
+
return url.protocol === "https:" || url.hostname === "localhost" || url.hostname === "127.0.0.1";
|
|
564
|
+
}, { message: "redirect_uri must use HTTPS or be localhost" });
|
|
565
|
+
var codeVerifier = import_zod2.z.string().min(43).max(128).regex(/^[A-Za-z0-9._~-]+$/, "code_verifier must only contain unreserved characters");
|
|
566
|
+
var codeChallenge = import_zod2.z.string().min(43).max(128).regex(/^[A-Za-z0-9_-]+$/, "code_challenge must be base64url encoded (no padding)");
|
|
567
|
+
var DynamicClientRegistrationSchema = import_zod2.z.object({
|
|
568
|
+
redirect_uris: import_zod2.z.array(redirectUri).min(1),
|
|
569
|
+
client_name: import_zod2.z.string().min(1).max(255),
|
|
570
|
+
client_uri: import_zod2.z.string().url().optional(),
|
|
571
|
+
logo_uri: import_zod2.z.string().url().optional(),
|
|
572
|
+
// Accept lowercase OAuth spec values
|
|
573
|
+
grant_types: import_zod2.z.array(import_zod2.z.enum(["authorization_code", "refresh_token"])).default(["authorization_code", "refresh_token"]),
|
|
574
|
+
response_types: import_zod2.z.array(import_zod2.z.enum([OAuthResponseTypes.CODE])).default([OAuthResponseTypes.CODE]),
|
|
575
|
+
scope: scopeString,
|
|
576
|
+
// Accept lowercase OAuth spec values
|
|
577
|
+
token_endpoint_auth_method: import_zod2.z.enum(["none", "client_secret_post", "client_secret_basic"]).default("none")
|
|
578
|
+
});
|
|
579
|
+
var DynamicClientRegistrationResponseSchema = import_zod2.z.object({
|
|
580
|
+
client_id: import_zod2.z.string(),
|
|
581
|
+
client_secret: import_zod2.z.string().optional(),
|
|
582
|
+
client_id_issued_at: import_zod2.z.number(),
|
|
583
|
+
client_secret_expires_at: import_zod2.z.number().optional(),
|
|
584
|
+
redirect_uris: import_zod2.z.array(import_zod2.z.string()),
|
|
585
|
+
client_name: import_zod2.z.string(),
|
|
586
|
+
client_uri: import_zod2.z.string().optional(),
|
|
587
|
+
logo_uri: import_zod2.z.string().optional(),
|
|
588
|
+
grant_types: import_zod2.z.array(import_zod2.z.string()),
|
|
589
|
+
response_types: import_zod2.z.array(import_zod2.z.string()),
|
|
590
|
+
scope: import_zod2.z.string(),
|
|
591
|
+
token_endpoint_auth_method: import_zod2.z.string(),
|
|
592
|
+
registration_access_token: import_zod2.z.string().optional(),
|
|
593
|
+
registration_client_uri: import_zod2.z.string().optional()
|
|
594
|
+
});
|
|
595
|
+
var AuthorizationRequestSchema = import_zod2.z.object({
|
|
596
|
+
response_type: import_zod2.z.literal(OAuthResponseTypes.CODE),
|
|
597
|
+
client_id: import_zod2.z.string().min(1),
|
|
598
|
+
redirect_uri: redirectUri,
|
|
599
|
+
scope: scopeString,
|
|
600
|
+
state: import_zod2.z.string().max(255).optional(),
|
|
601
|
+
// PKCE is mandatory in OAuth 2.1
|
|
602
|
+
code_challenge: codeChallenge,
|
|
603
|
+
code_challenge_method: import_zod2.z.literal(OAuthCodeChallengeMethods.S256)
|
|
604
|
+
});
|
|
605
|
+
var TokenRequestAuthorizationCodeSchema = import_zod2.z.object({
|
|
606
|
+
grant_type: import_zod2.z.literal(OAuthGrantTypes.AUTHORIZATION_CODE),
|
|
607
|
+
code: import_zod2.z.string().min(1),
|
|
608
|
+
redirect_uri: redirectUri,
|
|
609
|
+
client_id: import_zod2.z.string().min(1),
|
|
610
|
+
// PKCE code verifier is mandatory
|
|
611
|
+
code_verifier: codeVerifier,
|
|
612
|
+
// Client secret is optional (for confidential clients)
|
|
613
|
+
client_secret: import_zod2.z.string().optional()
|
|
614
|
+
});
|
|
615
|
+
var TokenRequestRefreshTokenSchema = import_zod2.z.object({
|
|
616
|
+
grant_type: import_zod2.z.literal(OAuthGrantTypes.REFRESH_TOKEN),
|
|
617
|
+
refresh_token: import_zod2.z.string().min(1),
|
|
618
|
+
client_id: import_zod2.z.string().min(1),
|
|
619
|
+
// Optional: request reduced scope
|
|
620
|
+
scope: scopeString,
|
|
621
|
+
// Client secret is optional (for confidential clients)
|
|
622
|
+
client_secret: import_zod2.z.string().optional()
|
|
623
|
+
});
|
|
624
|
+
var TokenRequestSchema = import_zod2.z.discriminatedUnion("grant_type", [
|
|
625
|
+
TokenRequestAuthorizationCodeSchema,
|
|
626
|
+
TokenRequestRefreshTokenSchema
|
|
627
|
+
]);
|
|
628
|
+
var TokenResponseSchema = import_zod2.z.object({
|
|
629
|
+
access_token: import_zod2.z.string(),
|
|
630
|
+
token_type: import_zod2.z.literal("Bearer"),
|
|
631
|
+
expires_in: import_zod2.z.number(),
|
|
632
|
+
refresh_token: import_zod2.z.string().optional(),
|
|
633
|
+
scope: import_zod2.z.string()
|
|
634
|
+
});
|
|
635
|
+
var TokenRevocationRequestSchema = import_zod2.z.object({
|
|
636
|
+
token: import_zod2.z.string().min(1),
|
|
637
|
+
token_type_hint: import_zod2.z.enum(["access_token", "refresh_token"]).optional(),
|
|
638
|
+
client_id: import_zod2.z.string().min(1),
|
|
639
|
+
client_secret: import_zod2.z.string().optional()
|
|
640
|
+
});
|
|
641
|
+
var OAuthErrorResponseSchema = import_zod2.z.object({
|
|
642
|
+
error: import_zod2.z.string(),
|
|
643
|
+
error_description: import_zod2.z.string().optional(),
|
|
644
|
+
error_uri: import_zod2.z.string().url().optional(),
|
|
645
|
+
state: import_zod2.z.string().optional()
|
|
646
|
+
});
|
|
647
|
+
var AuthorizationServerMetadataSchema = import_zod2.z.object({
|
|
648
|
+
issuer: import_zod2.z.string().url(),
|
|
649
|
+
authorization_endpoint: import_zod2.z.string().url(),
|
|
650
|
+
token_endpoint: import_zod2.z.string().url(),
|
|
651
|
+
registration_endpoint: import_zod2.z.string().url().optional(),
|
|
652
|
+
revocation_endpoint: import_zod2.z.string().url().optional(),
|
|
653
|
+
scopes_supported: import_zod2.z.array(import_zod2.z.string()),
|
|
654
|
+
response_types_supported: import_zod2.z.array(import_zod2.z.string()),
|
|
655
|
+
grant_types_supported: import_zod2.z.array(import_zod2.z.string()),
|
|
656
|
+
token_endpoint_auth_methods_supported: import_zod2.z.array(import_zod2.z.string()),
|
|
657
|
+
code_challenge_methods_supported: import_zod2.z.array(import_zod2.z.string()),
|
|
658
|
+
service_documentation: import_zod2.z.string().url().optional()
|
|
659
|
+
});
|
|
660
|
+
var ProtectedResourceMetadataSchema = import_zod2.z.object({
|
|
661
|
+
resource: import_zod2.z.string().url(),
|
|
662
|
+
authorization_servers: import_zod2.z.array(import_zod2.z.string().url()),
|
|
663
|
+
scopes_supported: import_zod2.z.array(import_zod2.z.string()).optional(),
|
|
664
|
+
bearer_methods_supported: import_zod2.z.array(import_zod2.z.string()).optional(),
|
|
665
|
+
resource_signing_alg_values_supported: import_zod2.z.array(import_zod2.z.string()).optional(),
|
|
666
|
+
resource_documentation: import_zod2.z.string().url().optional()
|
|
667
|
+
});
|
|
668
|
+
var InternalTokenValidationRequestSchema = import_zod2.z.object({
|
|
669
|
+
access_token: import_zod2.z.string().min(1)
|
|
670
|
+
});
|
|
671
|
+
var InternalTokenValidationResponseSchema = import_zod2.z.object({
|
|
672
|
+
valid: import_zod2.z.boolean(),
|
|
673
|
+
userId: import_zod2.z.string().optional(),
|
|
674
|
+
userEmail: import_zod2.z.string().optional(),
|
|
675
|
+
userName: import_zod2.z.string().optional(),
|
|
676
|
+
scope: import_zod2.z.string().optional(),
|
|
677
|
+
permissions: import_zod2.z.string().optional(),
|
|
678
|
+
clientId: import_zod2.z.string().optional(),
|
|
679
|
+
expiresAt: import_zod2.z.string().optional()
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
// ../../packages/core/dist/validation/index.js
|
|
683
|
+
var ListProjectsInputSchema = import_zod3.z.object({
|
|
684
|
+
workspaceType: import_zod3.z.preprocess((val) => typeof val === "string" ? val.toUpperCase() : val, import_zod3.z.enum(["TEAM", "PERSONAL", "ALL"]).optional())
|
|
685
|
+
});
|
|
686
|
+
var ListTasksInputSchema = import_zod3.z.object({
|
|
687
|
+
projectId: import_zod3.z.string().optional(),
|
|
688
|
+
state: import_zod3.z.nativeEnum(TaskState).optional(),
|
|
689
|
+
assigneeId: import_zod3.z.string().optional(),
|
|
690
|
+
includeArchived: import_zod3.z.boolean().optional()
|
|
691
|
+
});
|
|
692
|
+
var cuidOrPrefixedId = import_zod3.z.string().regex(/^([a-z0-9]+|[a-z]+_[a-zA-Z0-9]+)$/);
|
|
693
|
+
var gitBranchName = import_zod3.z.string().min(1).max(100).regex(/^[a-zA-Z0-9][-a-zA-Z0-9._/]*[a-zA-Z0-9]$|^[a-zA-Z0-9]$/, "Branch name must start and end with alphanumeric character").refine((val) => !val.includes("..") && !val.includes("@{") && !val.includes("//") && !val.endsWith(".lock") && !val.includes("~") && !val.includes("^") && !val.includes(":") && !val.includes("?") && !val.includes("*") && !val.includes("[") && !val.includes("\\") && !val.includes(" ") && !val.includes(";") && !val.includes("&") && !val.includes("|") && !val.includes("$") && !val.includes("`") && !val.includes("'") && !val.includes('"') && !val.includes("<") && !val.includes(">") && !val.includes("(") && !val.includes(")"), "Invalid branch name: contains forbidden characters or sequences");
|
|
694
|
+
var GetTaskInputSchema = import_zod3.z.object({
|
|
503
695
|
taskId: cuidOrPrefixedId
|
|
504
696
|
});
|
|
505
|
-
var AssignTaskInputSchema =
|
|
697
|
+
var AssignTaskInputSchema = import_zod3.z.object({
|
|
506
698
|
projectId: cuidOrPrefixedId,
|
|
507
699
|
taskId: cuidOrPrefixedId,
|
|
508
|
-
expectedState:
|
|
700
|
+
expectedState: import_zod3.z.nativeEnum(TaskState).default(TaskState.TODO)
|
|
509
701
|
});
|
|
510
|
-
var UpdateProgressInputSchema =
|
|
702
|
+
var UpdateProgressInputSchema = import_zod3.z.object({
|
|
511
703
|
taskId: cuidOrPrefixedId,
|
|
512
|
-
statusMessage:
|
|
513
|
-
completedCheckpointIds:
|
|
514
|
-
currentCheckpointIndex:
|
|
704
|
+
statusMessage: import_zod3.z.string().max(1e3).optional(),
|
|
705
|
+
completedCheckpointIds: import_zod3.z.array(import_zod3.z.string()).optional(),
|
|
706
|
+
currentCheckpointIndex: import_zod3.z.number().int().optional()
|
|
515
707
|
});
|
|
516
|
-
var CompleteTaskInputSchema =
|
|
708
|
+
var CompleteTaskInputSchema = import_zod3.z.object({
|
|
517
709
|
projectId: cuidOrPrefixedId,
|
|
518
710
|
taskId: cuidOrPrefixedId,
|
|
519
|
-
pullRequestTitle:
|
|
520
|
-
pullRequestBody:
|
|
711
|
+
pullRequestTitle: import_zod3.z.string().min(1).max(300).optional(),
|
|
712
|
+
pullRequestBody: import_zod3.z.string().max(1e4).optional()
|
|
521
713
|
});
|
|
522
|
-
var ReportErrorInputSchema =
|
|
714
|
+
var ReportErrorInputSchema = import_zod3.z.object({
|
|
523
715
|
taskId: cuidOrPrefixedId,
|
|
524
|
-
errorType:
|
|
525
|
-
errorMessage:
|
|
526
|
-
context:
|
|
716
|
+
errorType: import_zod3.z.nativeEnum(ErrorType),
|
|
717
|
+
errorMessage: import_zod3.z.string().min(1).max(1e3),
|
|
718
|
+
context: import_zod3.z.string().max(2e3).optional()
|
|
527
719
|
});
|
|
528
|
-
var GetProjectContextInputSchema =
|
|
720
|
+
var GetProjectContextInputSchema = import_zod3.z.object({
|
|
529
721
|
projectId: cuidOrPrefixedId
|
|
530
722
|
});
|
|
531
|
-
var AddNoteInputSchema =
|
|
723
|
+
var AddNoteInputSchema = import_zod3.z.object({
|
|
532
724
|
taskId: cuidOrPrefixedId,
|
|
533
|
-
content:
|
|
725
|
+
content: import_zod3.z.string().min(1).max(500)
|
|
534
726
|
});
|
|
535
|
-
var AbandonTaskInputSchema =
|
|
727
|
+
var AbandonTaskInputSchema = import_zod3.z.object({
|
|
536
728
|
projectId: cuidOrPrefixedId,
|
|
537
729
|
taskId: cuidOrPrefixedId,
|
|
538
|
-
deleteBranch:
|
|
730
|
+
deleteBranch: import_zod3.z.boolean().optional()
|
|
539
731
|
});
|
|
540
|
-
var RequestChangesInputSchema =
|
|
732
|
+
var RequestChangesInputSchema = import_zod3.z.object({
|
|
541
733
|
projectId: cuidOrPrefixedId,
|
|
542
734
|
taskId: cuidOrPrefixedId,
|
|
543
|
-
reviewComments:
|
|
544
|
-
requestedChanges:
|
|
735
|
+
reviewComments: import_zod3.z.string().min(1).max(5e3),
|
|
736
|
+
requestedChanges: import_zod3.z.array(import_zod3.z.string().min(1).max(500)).optional()
|
|
545
737
|
});
|
|
546
|
-
var ApproveTaskInputSchema =
|
|
738
|
+
var ApproveTaskInputSchema = import_zod3.z.object({
|
|
547
739
|
projectId: cuidOrPrefixedId,
|
|
548
740
|
taskId: cuidOrPrefixedId,
|
|
549
|
-
reviewComments:
|
|
741
|
+
reviewComments: import_zod3.z.string().max(2e3).optional()
|
|
550
742
|
});
|
|
551
|
-
var ArchiveTaskInputSchema =
|
|
743
|
+
var ArchiveTaskInputSchema = import_zod3.z.object({
|
|
552
744
|
projectId: cuidOrPrefixedId,
|
|
553
745
|
taskId: cuidOrPrefixedId
|
|
554
746
|
});
|
|
555
|
-
var UnarchiveTaskInputSchema =
|
|
747
|
+
var UnarchiveTaskInputSchema = import_zod3.z.object({
|
|
556
748
|
projectId: cuidOrPrefixedId,
|
|
557
749
|
taskId: cuidOrPrefixedId
|
|
558
750
|
});
|
|
559
|
-
var CreatePersonalProjectInputSchema =
|
|
560
|
-
name:
|
|
561
|
-
description:
|
|
562
|
-
repositoryUrl:
|
|
751
|
+
var CreatePersonalProjectInputSchema = import_zod3.z.object({
|
|
752
|
+
name: import_zod3.z.string().min(1).max(100),
|
|
753
|
+
description: import_zod3.z.string().max(500).optional(),
|
|
754
|
+
repositoryUrl: import_zod3.z.string().url()
|
|
563
755
|
});
|
|
564
|
-
var CheckActiveTaskInputSchema =
|
|
565
|
-
var CreateTaskMCPInputSchema =
|
|
756
|
+
var CheckActiveTaskInputSchema = import_zod3.z.object({});
|
|
757
|
+
var CreateTaskMCPInputSchema = import_zod3.z.object({
|
|
566
758
|
projectId: cuidOrPrefixedId,
|
|
567
759
|
epicId: cuidOrPrefixedId.nullable().optional(),
|
|
568
|
-
title:
|
|
569
|
-
description:
|
|
570
|
-
priority:
|
|
571
|
-
acceptanceCriteria:
|
|
572
|
-
description:
|
|
760
|
+
title: import_zod3.z.string().min(1).max(200),
|
|
761
|
+
description: import_zod3.z.string().max(5e3),
|
|
762
|
+
priority: import_zod3.z.nativeEnum(TaskPriority).default(TaskPriority.MEDIUM),
|
|
763
|
+
acceptanceCriteria: import_zod3.z.array(import_zod3.z.object({
|
|
764
|
+
description: import_zod3.z.string().min(1).max(500)
|
|
573
765
|
})).min(1)
|
|
574
766
|
});
|
|
575
|
-
var CreateOrganizationInputSchema =
|
|
576
|
-
name:
|
|
577
|
-
slug: import_zod2.z.string().min(1).max(100).regex(/^[a-z0-9-]+$/).optional()
|
|
767
|
+
var CreateOrganizationInputSchema = import_zod3.z.object({
|
|
768
|
+
name: import_zod3.z.string().min(1).max(255)
|
|
578
769
|
});
|
|
579
|
-
var UpdateOrganizationInputSchema =
|
|
770
|
+
var UpdateOrganizationInputSchema = import_zod3.z.object({
|
|
580
771
|
organizationId: cuidOrPrefixedId,
|
|
581
|
-
name:
|
|
582
|
-
logoUrl:
|
|
583
|
-
accentColor:
|
|
584
|
-
tenantName:
|
|
585
|
-
});
|
|
586
|
-
var CreateProjectInputSchema =
|
|
587
|
-
name:
|
|
588
|
-
description:
|
|
589
|
-
type:
|
|
590
|
-
repositoryUrl:
|
|
591
|
-
baseBranch:
|
|
592
|
-
tags:
|
|
593
|
-
});
|
|
594
|
-
var UpdateProjectInputSchema =
|
|
595
|
-
projectId:
|
|
596
|
-
name:
|
|
597
|
-
description:
|
|
598
|
-
repositoryUrl:
|
|
599
|
-
baseBranch:
|
|
600
|
-
tags:
|
|
601
|
-
allowMemberArchive:
|
|
602
|
-
});
|
|
603
|
-
var CreateEpicInputSchema =
|
|
772
|
+
name: import_zod3.z.string().min(1).max(255).optional(),
|
|
773
|
+
logoUrl: import_zod3.z.string().url().nullable().optional(),
|
|
774
|
+
accentColor: import_zod3.z.string().regex(/^#[0-9A-Fa-f]{6}$/, "Invalid hex color format. Expected #RRGGBB").nullable().optional(),
|
|
775
|
+
tenantName: import_zod3.z.string().max(255).nullable().optional()
|
|
776
|
+
});
|
|
777
|
+
var CreateProjectInputSchema = import_zod3.z.object({
|
|
778
|
+
name: import_zod3.z.string().min(1).max(100),
|
|
779
|
+
description: import_zod3.z.string().max(500).optional(),
|
|
780
|
+
type: import_zod3.z.nativeEnum(ProjectType),
|
|
781
|
+
repositoryUrl: import_zod3.z.string().url(),
|
|
782
|
+
baseBranch: import_zod3.z.string().default("develop").optional(),
|
|
783
|
+
tags: import_zod3.z.array(import_zod3.z.string()).default([])
|
|
784
|
+
});
|
|
785
|
+
var UpdateProjectInputSchema = import_zod3.z.object({
|
|
786
|
+
projectId: import_zod3.z.string().min(1).optional(),
|
|
787
|
+
name: import_zod3.z.string().min(1).max(100).optional(),
|
|
788
|
+
description: import_zod3.z.string().max(500).optional(),
|
|
789
|
+
repositoryUrl: import_zod3.z.string().url().optional(),
|
|
790
|
+
baseBranch: import_zod3.z.string().optional(),
|
|
791
|
+
tags: import_zod3.z.array(import_zod3.z.string()).optional(),
|
|
792
|
+
allowMemberArchive: import_zod3.z.boolean().optional()
|
|
793
|
+
});
|
|
794
|
+
var CreateEpicInputSchema = import_zod3.z.object({
|
|
604
795
|
projectId: cuidOrPrefixedId,
|
|
605
|
-
name:
|
|
606
|
-
description:
|
|
607
|
-
});
|
|
608
|
-
var CreateTaskInputSchema =
|
|
609
|
-
projectId:
|
|
610
|
-
epicId:
|
|
611
|
-
title:
|
|
612
|
-
description:
|
|
613
|
-
priority:
|
|
614
|
-
acceptanceCriteria:
|
|
615
|
-
description:
|
|
796
|
+
name: import_zod3.z.string().min(1).max(200),
|
|
797
|
+
description: import_zod3.z.string().max(2e3).optional()
|
|
798
|
+
});
|
|
799
|
+
var CreateTaskInputSchema = import_zod3.z.object({
|
|
800
|
+
projectId: import_zod3.z.string().min(1),
|
|
801
|
+
epicId: import_zod3.z.string().min(1).nullable().optional(),
|
|
802
|
+
title: import_zod3.z.string().min(1).max(200),
|
|
803
|
+
description: import_zod3.z.string().max(5e3),
|
|
804
|
+
priority: import_zod3.z.nativeEnum(TaskPriority).default(TaskPriority.MEDIUM),
|
|
805
|
+
acceptanceCriteria: import_zod3.z.array(import_zod3.z.object({
|
|
806
|
+
description: import_zod3.z.string().min(1).max(500)
|
|
616
807
|
})).min(1)
|
|
617
808
|
});
|
|
618
|
-
var UpdateTaskInputSchema =
|
|
619
|
-
taskId:
|
|
620
|
-
title:
|
|
621
|
-
description:
|
|
622
|
-
priority:
|
|
623
|
-
state:
|
|
624
|
-
assigneeId:
|
|
625
|
-
acceptanceCriteria:
|
|
626
|
-
id:
|
|
627
|
-
description:
|
|
628
|
-
completed:
|
|
809
|
+
var UpdateTaskInputSchema = import_zod3.z.object({
|
|
810
|
+
taskId: import_zod3.z.string().min(1),
|
|
811
|
+
title: import_zod3.z.string().min(1).max(200).optional(),
|
|
812
|
+
description: import_zod3.z.string().max(5e3).optional(),
|
|
813
|
+
priority: import_zod3.z.nativeEnum(TaskPriority).optional(),
|
|
814
|
+
state: import_zod3.z.nativeEnum(TaskState).optional(),
|
|
815
|
+
assigneeId: import_zod3.z.string().nullable().optional(),
|
|
816
|
+
acceptanceCriteria: import_zod3.z.array(import_zod3.z.object({
|
|
817
|
+
id: import_zod3.z.string().optional(),
|
|
818
|
+
description: import_zod3.z.string().min(1).max(500),
|
|
819
|
+
completed: import_zod3.z.boolean().optional()
|
|
629
820
|
})).optional()
|
|
630
821
|
});
|
|
631
|
-
var AssignTaskWebappInputSchema =
|
|
632
|
-
taskId:
|
|
633
|
-
userId:
|
|
822
|
+
var AssignTaskWebappInputSchema = import_zod3.z.object({
|
|
823
|
+
taskId: import_zod3.z.string().min(1),
|
|
824
|
+
userId: import_zod3.z.string().min(1)
|
|
634
825
|
});
|
|
635
|
-
var CreateTagInputSchema =
|
|
826
|
+
var CreateTagInputSchema = import_zod3.z.object({
|
|
636
827
|
organizationId: cuidOrPrefixedId,
|
|
637
|
-
name:
|
|
828
|
+
name: import_zod3.z.string().min(1).max(50).regex(/^[a-zA-Z0-9\s-]+$/)
|
|
638
829
|
});
|
|
639
|
-
var UpdateTagInputSchema =
|
|
640
|
-
name:
|
|
830
|
+
var UpdateTagInputSchema = import_zod3.z.object({
|
|
831
|
+
name: import_zod3.z.string().min(1).max(50).regex(/^[a-zA-Z0-9\s-]+$/)
|
|
641
832
|
});
|
|
642
|
-
var UpdateOrganizationSettingsInputSchema =
|
|
833
|
+
var UpdateOrganizationSettingsInputSchema = import_zod3.z.object({
|
|
643
834
|
organizationId: cuidOrPrefixedId,
|
|
644
|
-
ldapEnabled:
|
|
645
|
-
ldapUrl:
|
|
646
|
-
ldapBindDN:
|
|
647
|
-
ldapSearchBase:
|
|
648
|
-
deleteMergedBranches:
|
|
649
|
-
enforceConventionalCommits:
|
|
650
|
-
maxPersonalProjectsPerUser:
|
|
651
|
-
logoUrl:
|
|
652
|
-
accentColor:
|
|
653
|
-
tenantName:
|
|
654
|
-
});
|
|
655
|
-
var InviteUserInputSchema =
|
|
835
|
+
ldapEnabled: import_zod3.z.boolean().optional(),
|
|
836
|
+
ldapUrl: import_zod3.z.string().url().nullable().optional(),
|
|
837
|
+
ldapBindDN: import_zod3.z.string().nullable().optional(),
|
|
838
|
+
ldapSearchBase: import_zod3.z.string().nullable().optional(),
|
|
839
|
+
deleteMergedBranches: import_zod3.z.boolean().optional(),
|
|
840
|
+
enforceConventionalCommits: import_zod3.z.boolean().optional(),
|
|
841
|
+
maxPersonalProjectsPerUser: import_zod3.z.number().int().min(0).optional(),
|
|
842
|
+
logoUrl: import_zod3.z.string().url().nullable().optional(),
|
|
843
|
+
accentColor: import_zod3.z.string().regex(/^#[0-9A-Fa-f]{6}$/, "Invalid hex color format. Expected #RRGGBB").nullable().optional(),
|
|
844
|
+
tenantName: import_zod3.z.string().max(255).nullable().optional()
|
|
845
|
+
});
|
|
846
|
+
var InviteUserInputSchema = import_zod3.z.object({
|
|
656
847
|
organizationId: cuidOrPrefixedId,
|
|
657
|
-
email:
|
|
658
|
-
role:
|
|
659
|
-
tags:
|
|
848
|
+
email: import_zod3.z.string().email(),
|
|
849
|
+
role: import_zod3.z.nativeEnum(UserRole).default(UserRole.MEMBER),
|
|
850
|
+
tags: import_zod3.z.array(import_zod3.z.string()).default([])
|
|
660
851
|
});
|
|
661
|
-
var AssignUserTagsInputSchema =
|
|
852
|
+
var AssignUserTagsInputSchema = import_zod3.z.object({
|
|
662
853
|
userId: cuidOrPrefixedId,
|
|
663
|
-
tags:
|
|
854
|
+
tags: import_zod3.z.array(import_zod3.z.string()).min(0)
|
|
664
855
|
});
|
|
665
|
-
var InviteCollaboratorInputSchema =
|
|
856
|
+
var InviteCollaboratorInputSchema = import_zod3.z.object({
|
|
666
857
|
projectId: cuidOrPrefixedId,
|
|
667
|
-
email:
|
|
858
|
+
email: import_zod3.z.string().email()
|
|
668
859
|
});
|
|
669
|
-
var PublishProjectInputSchema =
|
|
860
|
+
var PublishProjectInputSchema = import_zod3.z.object({
|
|
670
861
|
projectId: cuidOrPrefixedId,
|
|
671
|
-
transferOwnership:
|
|
672
|
-
tags:
|
|
862
|
+
transferOwnership: import_zod3.z.boolean().default(false),
|
|
863
|
+
tags: import_zod3.z.array(import_zod3.z.string()).min(1)
|
|
673
864
|
});
|
|
674
|
-
var GenerateApiKeyInputSchema =
|
|
675
|
-
name:
|
|
676
|
-
|
|
677
|
-
|
|
865
|
+
var GenerateApiKeyInputSchema = import_zod3.z.object({
|
|
866
|
+
name: import_zod3.z.string().min(1).max(100),
|
|
867
|
+
publicNickname: import_zod3.z.string().max(50).optional(),
|
|
868
|
+
expiresInDays: import_zod3.z.number().int().min(1).max(365).default(90),
|
|
869
|
+
permissions: import_zod3.z.nativeEnum(ApiKeyPermission).default(ApiKeyPermission.WRITE)
|
|
678
870
|
});
|
|
679
|
-
var
|
|
871
|
+
var UpdateApiKeyInputSchema = import_zod3.z.object({
|
|
872
|
+
publicNickname: import_zod3.z.string().max(50).nullable().optional(),
|
|
873
|
+
scopedOrganizationId: import_zod3.z.string().optional().nullable(),
|
|
874
|
+
scopedProjectIds: import_zod3.z.array(import_zod3.z.string()).optional()
|
|
875
|
+
});
|
|
876
|
+
var RevokeApiKeyInputSchema = import_zod3.z.object({
|
|
680
877
|
keyId: cuidOrPrefixedId
|
|
681
878
|
});
|
|
682
|
-
var LoginInputSchema =
|
|
683
|
-
email:
|
|
684
|
-
password:
|
|
879
|
+
var LoginInputSchema = import_zod3.z.object({
|
|
880
|
+
email: import_zod3.z.string().email(),
|
|
881
|
+
password: import_zod3.z.string().min(8).max(255)
|
|
685
882
|
});
|
|
686
|
-
var RegisterInputSchema =
|
|
687
|
-
email:
|
|
688
|
-
password:
|
|
689
|
-
name:
|
|
690
|
-
organizationSlug: import_zod2.z.string().min(1).max(100).regex(/^[a-z0-9-]+$/).optional()
|
|
883
|
+
var RegisterInputSchema = import_zod3.z.object({
|
|
884
|
+
email: import_zod3.z.string().email(),
|
|
885
|
+
password: import_zod3.z.string().min(8).max(255),
|
|
886
|
+
name: import_zod3.z.string().min(1).max(255)
|
|
691
887
|
});
|
|
692
|
-
var VerifyTaskInputSchema =
|
|
888
|
+
var VerifyTaskInputSchema = import_zod3.z.object({
|
|
693
889
|
projectId: cuidOrPrefixedId,
|
|
694
890
|
taskId: cuidOrPrefixedId,
|
|
695
|
-
approved:
|
|
696
|
-
feedback:
|
|
891
|
+
approved: import_zod3.z.boolean(),
|
|
892
|
+
feedback: import_zod3.z.string().max(5e3).optional()
|
|
697
893
|
});
|
|
698
|
-
var GetTaskPromptInputSchema =
|
|
894
|
+
var GetTaskPromptInputSchema = import_zod3.z.object({
|
|
699
895
|
projectId: cuidOrPrefixedId,
|
|
700
896
|
taskId: cuidOrPrefixedId
|
|
701
897
|
});
|
|
702
|
-
var UpdateTaskMCPInputSchema =
|
|
898
|
+
var UpdateTaskMCPInputSchema = import_zod3.z.object({
|
|
703
899
|
projectId: cuidOrPrefixedId,
|
|
704
900
|
taskId: cuidOrPrefixedId,
|
|
705
|
-
title:
|
|
706
|
-
description:
|
|
707
|
-
priority:
|
|
708
|
-
acceptanceCriteria:
|
|
709
|
-
id:
|
|
710
|
-
description:
|
|
901
|
+
title: import_zod3.z.string().min(1).max(200).optional(),
|
|
902
|
+
description: import_zod3.z.string().max(5e3).optional(),
|
|
903
|
+
priority: import_zod3.z.nativeEnum(TaskPriority).optional(),
|
|
904
|
+
acceptanceCriteria: import_zod3.z.array(import_zod3.z.object({
|
|
905
|
+
id: import_zod3.z.string().optional(),
|
|
906
|
+
description: import_zod3.z.string().min(1).max(500)
|
|
711
907
|
})).optional()
|
|
712
908
|
});
|
|
713
|
-
var ReportBranchInputSchema =
|
|
909
|
+
var ReportBranchInputSchema = import_zod3.z.object({
|
|
714
910
|
projectId: cuidOrPrefixedId,
|
|
715
911
|
taskId: cuidOrPrefixedId,
|
|
716
912
|
branchName: gitBranchName
|
|
717
913
|
});
|
|
718
|
-
var ReportPRInputSchema =
|
|
914
|
+
var ReportPRInputSchema = import_zod3.z.object({
|
|
719
915
|
projectId: cuidOrPrefixedId,
|
|
720
916
|
taskId: cuidOrPrefixedId,
|
|
721
|
-
pullRequestUrl:
|
|
722
|
-
pullRequestNumber:
|
|
917
|
+
pullRequestUrl: import_zod3.z.string().url(),
|
|
918
|
+
pullRequestNumber: import_zod3.z.number().int().positive()
|
|
723
919
|
});
|
|
724
920
|
|
|
725
921
|
// ../../packages/core/dist/logging/metrics.js
|
|
@@ -800,23 +996,16 @@ function createHistogram(name, help, buckets = [5e-3, 0.01, 0.025, 0.05, 0.1, 0.
|
|
|
800
996
|
var httpRequestsTotal = createCounter("mtaap_http_requests_total", "Total number of HTTP requests");
|
|
801
997
|
var httpRequestDuration = createHistogram("mtaap_http_request_duration_seconds", "HTTP request duration in seconds");
|
|
802
998
|
var activeUsers = createGauge("mtaap_active_users", "Number of active users");
|
|
803
|
-
var tasksTotal = createCounter("mtaap_tasks_total", "Total number of tasks by state");
|
|
804
|
-
var taskStateChanges = createCounter("mtaap_task_state_changes_total", "Total number of task state changes");
|
|
805
999
|
var httpErrorsTotal = createCounter("mtaap_http_errors_total", "Total number of HTTP errors");
|
|
806
1000
|
var httpActiveConnections = createGauge("mtaap_http_active_connections", "Number of active HTTP connections");
|
|
807
1001
|
var newSignupsTotal = createCounter("mtaap_new_signups_total", "Total number of new user signups");
|
|
808
1002
|
var loginSuccessTotal = createCounter("mtaap_login_success_total", "Total number of successful logins");
|
|
809
1003
|
var loginFailureTotal = createCounter("mtaap_login_failure_total", "Total number of failed logins");
|
|
810
|
-
var dbConnectionPoolActive = createGauge("mtaap_db_connection_pool_active", "Number of active database connections");
|
|
811
|
-
var dbConnectionPoolIdle = createGauge("mtaap_db_connection_pool_idle", "Number of idle database connections");
|
|
812
|
-
var dbConnectionPoolMax = createGauge("mtaap_db_connection_pool_max", "Maximum number of database connections");
|
|
813
1004
|
var dbQueryDuration = createHistogram("mtaap_db_query_duration_seconds", "Database query duration in seconds");
|
|
814
1005
|
var dbSlowQueriesTotal = createCounter("mtaap_db_slow_queries_total", "Total number of slow database queries (>1s)");
|
|
815
|
-
var dbErrorsTotal = createCounter("mtaap_db_errors_total", "Total number of database errors");
|
|
816
1006
|
var tasksCreatedTotal = createCounter("mtaap_tasks_created_total", "Total number of tasks created");
|
|
817
1007
|
var tasksAssignedTotal = createCounter("mtaap_tasks_assigned_total", "Total number of tasks assigned");
|
|
818
1008
|
var tasksCompletedTotal = createCounter("mtaap_tasks_completed_total", "Total number of tasks completed");
|
|
819
|
-
var tasksByState = createGauge("mtaap_tasks_by_state", "Number of tasks by state");
|
|
820
1009
|
|
|
821
1010
|
// ../../packages/core/dist/logging/performance-monitor.js
|
|
822
1011
|
var MAX_SAMPLES = 1e3;
|
|
@@ -1038,12 +1227,17 @@ var ApiError = class extends Error {
|
|
|
1038
1227
|
var MCPApiClient = class {
|
|
1039
1228
|
baseUrl;
|
|
1040
1229
|
apiKey;
|
|
1230
|
+
oauthToken;
|
|
1041
1231
|
timeout;
|
|
1042
1232
|
debug;
|
|
1043
1233
|
authContext = null;
|
|
1044
1234
|
constructor(config3) {
|
|
1235
|
+
if (!config3.apiKey && !config3.oauthToken) {
|
|
1236
|
+
throw new Error("Either apiKey or oauthToken must be provided");
|
|
1237
|
+
}
|
|
1045
1238
|
this.baseUrl = config3.baseUrl.replace(/\/$/, "");
|
|
1046
1239
|
this.apiKey = config3.apiKey;
|
|
1240
|
+
this.oauthToken = config3.oauthToken;
|
|
1047
1241
|
this.timeout = config3.timeout ?? DEFAULT_TIMEOUT;
|
|
1048
1242
|
this.debug = config3.debug ?? false;
|
|
1049
1243
|
}
|
|
@@ -1058,18 +1252,33 @@ var MCPApiClient = class {
|
|
|
1058
1252
|
console.error(`[mcp-api] ${method} ${sanitizeForLogging(path)}`);
|
|
1059
1253
|
}
|
|
1060
1254
|
try {
|
|
1255
|
+
const headers = {
|
|
1256
|
+
"Content-Type": "application/json"
|
|
1257
|
+
};
|
|
1258
|
+
if (this.oauthToken) {
|
|
1259
|
+
headers["Authorization"] = `Bearer ${this.oauthToken}`;
|
|
1260
|
+
} else if (this.apiKey) {
|
|
1261
|
+
headers["X-API-Key"] = this.apiKey;
|
|
1262
|
+
}
|
|
1061
1263
|
const response = await fetch(url, {
|
|
1062
1264
|
method,
|
|
1063
|
-
headers
|
|
1064
|
-
"Content-Type": "application/json",
|
|
1065
|
-
"X-API-Key": this.apiKey
|
|
1066
|
-
},
|
|
1265
|
+
headers,
|
|
1067
1266
|
body: body ? JSON.stringify(body) : void 0,
|
|
1068
1267
|
signal: controller.signal
|
|
1069
1268
|
});
|
|
1070
1269
|
clearTimeout(timeoutId);
|
|
1071
1270
|
const data = await response.json();
|
|
1072
1271
|
if (!response.ok) {
|
|
1272
|
+
if (response.status === 403 && data.code === "EMAIL_NOT_VERIFIED" && data.verificationUrl) {
|
|
1273
|
+
throw new ApiError(
|
|
1274
|
+
`${data.error}
|
|
1275
|
+
|
|
1276
|
+
To verify your email, visit: ${data.verificationUrl}
|
|
1277
|
+
${data.hint ? `Hint: ${data.hint}` : ""}`,
|
|
1278
|
+
"EMAIL_NOT_VERIFIED",
|
|
1279
|
+
403
|
|
1280
|
+
);
|
|
1281
|
+
}
|
|
1073
1282
|
throw new ApiError(
|
|
1074
1283
|
data.error || "API request failed",
|
|
1075
1284
|
data.code || "UNKNOWN_ERROR",
|
|
@@ -1332,7 +1541,7 @@ var PERMISSION_RANK = {
|
|
|
1332
1541
|
ADMIN: 3
|
|
1333
1542
|
};
|
|
1334
1543
|
function assertApiKeyPermission(apiKey, required, toolName) {
|
|
1335
|
-
const actualRank = PERMISSION_RANK[apiKey.permissions] ?? 0;
|
|
1544
|
+
const actualRank = apiKey.permissions ? PERMISSION_RANK[apiKey.permissions] ?? 0 : 0;
|
|
1336
1545
|
const requiredRank = PERMISSION_RANK[required] ?? 0;
|
|
1337
1546
|
if (actualRank >= requiredRank) {
|
|
1338
1547
|
return;
|
|
@@ -1453,7 +1662,7 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1453
1662
|
{
|
|
1454
1663
|
description: "Discover all accessible projects. Use first to find project IDs. Filter by TEAM, PERSONAL, or ALL workspaces.",
|
|
1455
1664
|
inputSchema: {
|
|
1456
|
-
workspaceType:
|
|
1665
|
+
workspaceType: import_zod4.z.enum(["TEAM", "PERSONAL", "ALL"]).optional().describe("Filter by workspace type")
|
|
1457
1666
|
}
|
|
1458
1667
|
},
|
|
1459
1668
|
async (args) => {
|
|
@@ -1483,10 +1692,10 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1483
1692
|
{
|
|
1484
1693
|
description: "Query tasks with filters. Use state=TODO for assignable tasks, state=REVIEW for pending reviews.",
|
|
1485
1694
|
inputSchema: {
|
|
1486
|
-
projectId:
|
|
1487
|
-
state:
|
|
1488
|
-
assigneeId:
|
|
1489
|
-
includeArchived:
|
|
1695
|
+
projectId: import_zod4.z.string().optional().describe("Filter by project ID"),
|
|
1696
|
+
state: import_zod4.z.nativeEnum(TaskState).optional().describe("Filter by task state"),
|
|
1697
|
+
assigneeId: import_zod4.z.string().optional().describe("Filter by assignee ID"),
|
|
1698
|
+
includeArchived: import_zod4.z.boolean().optional().describe("Include archived tasks (default: false)")
|
|
1490
1699
|
}
|
|
1491
1700
|
},
|
|
1492
1701
|
async (args) => {
|
|
@@ -1517,7 +1726,7 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1517
1726
|
{
|
|
1518
1727
|
description: "Get complete task details with acceptance criteria and notes. Call before assign_task to understand requirements.",
|
|
1519
1728
|
inputSchema: {
|
|
1520
|
-
taskId:
|
|
1729
|
+
taskId: import_zod4.z.string().describe("The task ID to retrieve")
|
|
1521
1730
|
}
|
|
1522
1731
|
},
|
|
1523
1732
|
async (args) => {
|
|
@@ -1543,9 +1752,9 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1543
1752
|
{
|
|
1544
1753
|
description: "Atomically claim a task. Race-safe - fails if already assigned. Task must be TODO. Returns suggested branch name and worktree path for isolated parallel development.",
|
|
1545
1754
|
inputSchema: {
|
|
1546
|
-
projectId:
|
|
1547
|
-
taskId:
|
|
1548
|
-
expectedState:
|
|
1755
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
1756
|
+
taskId: import_zod4.z.string().describe("The task ID to assign"),
|
|
1757
|
+
expectedState: import_zod4.z.nativeEnum(TaskState).optional().describe("Expected task state (default: TODO)")
|
|
1549
1758
|
}
|
|
1550
1759
|
},
|
|
1551
1760
|
async (args) => {
|
|
@@ -1579,10 +1788,10 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1579
1788
|
{
|
|
1580
1789
|
description: "Report progress and checkpoint work. Call frequently during execution. Marks acceptance criteria complete.",
|
|
1581
1790
|
inputSchema: {
|
|
1582
|
-
taskId:
|
|
1583
|
-
statusMessage:
|
|
1584
|
-
completedCheckpointIds:
|
|
1585
|
-
currentCheckpointIndex:
|
|
1791
|
+
taskId: import_zod4.z.string().describe("The task ID to update"),
|
|
1792
|
+
statusMessage: import_zod4.z.string().optional().describe("Status message (max 1000 chars)"),
|
|
1793
|
+
completedCheckpointIds: import_zod4.z.array(import_zod4.z.string()).optional().describe("Array of completed checkpoint IDs"),
|
|
1794
|
+
currentCheckpointIndex: import_zod4.z.number().optional().describe("Current checkpoint index")
|
|
1586
1795
|
}
|
|
1587
1796
|
},
|
|
1588
1797
|
async (args) => {
|
|
@@ -1616,10 +1825,10 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1616
1825
|
{
|
|
1617
1826
|
description: "Prepare task for PR creation. Returns PR suggestions. After creating PR locally, call report_pr to transition to REVIEW. Requires IN_PROGRESS state.",
|
|
1618
1827
|
inputSchema: {
|
|
1619
|
-
projectId:
|
|
1620
|
-
taskId:
|
|
1621
|
-
pullRequestTitle:
|
|
1622
|
-
pullRequestBody:
|
|
1828
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
1829
|
+
taskId: import_zod4.z.string().describe("The task ID to complete"),
|
|
1830
|
+
pullRequestTitle: import_zod4.z.string().optional().describe("PR title (max 300 chars)"),
|
|
1831
|
+
pullRequestBody: import_zod4.z.string().optional().describe("PR body/description (max 10000 chars)")
|
|
1623
1832
|
}
|
|
1624
1833
|
},
|
|
1625
1834
|
async (args) => {
|
|
@@ -1676,10 +1885,10 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1676
1885
|
{
|
|
1677
1886
|
description: "Report unrecoverable errors (BUILD_FAILURE, TEST_FAILURE, CONFLICT, AUTH_ERROR). Consider abandon_task after.",
|
|
1678
1887
|
inputSchema: {
|
|
1679
|
-
taskId:
|
|
1680
|
-
errorType:
|
|
1681
|
-
errorMessage:
|
|
1682
|
-
context:
|
|
1888
|
+
taskId: import_zod4.z.string().describe("The task ID"),
|
|
1889
|
+
errorType: import_zod4.z.nativeEnum(ErrorType).describe("Error type: BUILD_FAILURE, TEST_FAILURE, CONFLICT, AUTH_ERROR, OTHER"),
|
|
1890
|
+
errorMessage: import_zod4.z.string().describe("Error message (max 1000 chars)"),
|
|
1891
|
+
context: import_zod4.z.string().optional().describe("Additional context (max 2000 chars)")
|
|
1683
1892
|
}
|
|
1684
1893
|
},
|
|
1685
1894
|
async (args) => {
|
|
@@ -1714,7 +1923,7 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1714
1923
|
{
|
|
1715
1924
|
description: "Load project README, tech stack, and coding conventions. Call after selecting project.",
|
|
1716
1925
|
inputSchema: {
|
|
1717
|
-
projectId:
|
|
1926
|
+
projectId: import_zod4.z.string().describe("The project ID")
|
|
1718
1927
|
}
|
|
1719
1928
|
},
|
|
1720
1929
|
async (args) => {
|
|
@@ -1744,8 +1953,8 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1744
1953
|
{
|
|
1745
1954
|
description: "Document implementation decisions. Notes persist for future reference and handoff.",
|
|
1746
1955
|
inputSchema: {
|
|
1747
|
-
taskId:
|
|
1748
|
-
content:
|
|
1956
|
+
taskId: import_zod4.z.string().describe("The task ID"),
|
|
1957
|
+
content: import_zod4.z.string().describe("Note content (max 500 chars)")
|
|
1749
1958
|
}
|
|
1750
1959
|
},
|
|
1751
1960
|
async (args) => {
|
|
@@ -1774,9 +1983,9 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1774
1983
|
{
|
|
1775
1984
|
description: "Release task assignment and optionally clean up branch. Task returns to TODO. Use after errors.",
|
|
1776
1985
|
inputSchema: {
|
|
1777
|
-
projectId:
|
|
1778
|
-
taskId:
|
|
1779
|
-
deleteBranch:
|
|
1986
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
1987
|
+
taskId: import_zod4.z.string().describe("The task ID to abandon"),
|
|
1988
|
+
deleteBranch: import_zod4.z.boolean().optional().describe("Whether to delete the associated branch")
|
|
1780
1989
|
}
|
|
1781
1990
|
},
|
|
1782
1991
|
async (args) => {
|
|
@@ -1810,9 +2019,9 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1810
2019
|
{
|
|
1811
2020
|
description: "Report a branch created by the agent. Call after using git to create and push a branch. Task must be IN_PROGRESS.",
|
|
1812
2021
|
inputSchema: {
|
|
1813
|
-
projectId:
|
|
1814
|
-
taskId:
|
|
1815
|
-
branchName:
|
|
2022
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
2023
|
+
taskId: import_zod4.z.string().describe("The task ID"),
|
|
2024
|
+
branchName: import_zod4.z.string().describe("Name of the branch created (e.g., feature/TASK-123-fix-login)")
|
|
1816
2025
|
}
|
|
1817
2026
|
},
|
|
1818
2027
|
async (args) => {
|
|
@@ -1846,10 +2055,10 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1846
2055
|
{
|
|
1847
2056
|
description: "Report a PR created by the agent. Call after using gh pr create. Transitions task to REVIEW state.",
|
|
1848
2057
|
inputSchema: {
|
|
1849
|
-
projectId:
|
|
1850
|
-
taskId:
|
|
1851
|
-
pullRequestUrl:
|
|
1852
|
-
pullRequestNumber:
|
|
2058
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
2059
|
+
taskId: import_zod4.z.string().describe("The task ID"),
|
|
2060
|
+
pullRequestUrl: import_zod4.z.string().describe("Full URL of the created PR (e.g., https://github.com/owner/repo/pull/123)"),
|
|
2061
|
+
pullRequestNumber: import_zod4.z.number().describe("PR number (e.g., 123)")
|
|
1853
2062
|
}
|
|
1854
2063
|
},
|
|
1855
2064
|
async (args) => {
|
|
@@ -1884,8 +2093,8 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1884
2093
|
{
|
|
1885
2094
|
description: "Soft-delete a task. Hidden but restorable via unarchive_task.",
|
|
1886
2095
|
inputSchema: {
|
|
1887
|
-
projectId:
|
|
1888
|
-
taskId:
|
|
2096
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
2097
|
+
taskId: import_zod4.z.string().describe("The task ID to archive")
|
|
1889
2098
|
}
|
|
1890
2099
|
},
|
|
1891
2100
|
async (args) => {
|
|
@@ -1918,8 +2127,8 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1918
2127
|
{
|
|
1919
2128
|
description: "Restore previously archived task to original state.",
|
|
1920
2129
|
inputSchema: {
|
|
1921
|
-
projectId:
|
|
1922
|
-
taskId:
|
|
2130
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
2131
|
+
taskId: import_zod4.z.string().describe("The task ID to restore")
|
|
1923
2132
|
}
|
|
1924
2133
|
},
|
|
1925
2134
|
async (args) => {
|
|
@@ -1952,9 +2161,9 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1952
2161
|
{
|
|
1953
2162
|
description: "Create new project in personal workspace linked to GitHub repository.",
|
|
1954
2163
|
inputSchema: {
|
|
1955
|
-
name:
|
|
1956
|
-
description:
|
|
1957
|
-
repositoryUrl:
|
|
2164
|
+
name: import_zod4.z.string().describe("Project name (max 100 chars)"),
|
|
2165
|
+
description: import_zod4.z.string().optional().describe("Project description (max 500 chars)"),
|
|
2166
|
+
repositoryUrl: import_zod4.z.string().describe("GitHub repository URL")
|
|
1958
2167
|
}
|
|
1959
2168
|
},
|
|
1960
2169
|
async (args) => {
|
|
@@ -1988,14 +2197,14 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
1988
2197
|
{
|
|
1989
2198
|
description: "Create task with title, description, acceptance criteria. Starts in DRAFT. Priority: LOW/MEDIUM/HIGH/CRITICAL.",
|
|
1990
2199
|
inputSchema: {
|
|
1991
|
-
projectId:
|
|
1992
|
-
epicId:
|
|
1993
|
-
title:
|
|
1994
|
-
description:
|
|
1995
|
-
priority:
|
|
1996
|
-
acceptanceCriteria:
|
|
1997
|
-
|
|
1998
|
-
description:
|
|
2200
|
+
projectId: import_zod4.z.string().describe("The project ID to create the task in"),
|
|
2201
|
+
epicId: import_zod4.z.string().nullable().optional().describe("Optional epic ID to associate the task with"),
|
|
2202
|
+
title: import_zod4.z.string().describe("Task title (max 200 chars)"),
|
|
2203
|
+
description: import_zod4.z.string().describe("Task description (max 5000 chars)"),
|
|
2204
|
+
priority: import_zod4.z.nativeEnum(TaskPriority).optional().describe("Task priority: LOW, MEDIUM, HIGH, CRITICAL (default: MEDIUM)"),
|
|
2205
|
+
acceptanceCriteria: import_zod4.z.array(
|
|
2206
|
+
import_zod4.z.object({
|
|
2207
|
+
description: import_zod4.z.string().describe("Acceptance criterion description (max 500 chars)")
|
|
1999
2208
|
})
|
|
2000
2209
|
).describe("Array of acceptance criteria (at least 1 required)")
|
|
2001
2210
|
}
|
|
@@ -2034,10 +2243,10 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
2034
2243
|
{
|
|
2035
2244
|
description: "Return task from REVIEW to IN_PROGRESS with feedback. Original assignee addresses changes.",
|
|
2036
2245
|
inputSchema: {
|
|
2037
|
-
projectId:
|
|
2038
|
-
taskId:
|
|
2039
|
-
reviewComments:
|
|
2040
|
-
requestedChanges:
|
|
2246
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
2247
|
+
taskId: import_zod4.z.string().describe("The task ID to review"),
|
|
2248
|
+
reviewComments: import_zod4.z.string().describe("Review comments explaining requested changes (max 5000 chars)"),
|
|
2249
|
+
requestedChanges: import_zod4.z.array(import_zod4.z.string()).optional().describe("List of specific changes requested")
|
|
2041
2250
|
}
|
|
2042
2251
|
},
|
|
2043
2252
|
async (args) => {
|
|
@@ -2072,9 +2281,9 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
2072
2281
|
{
|
|
2073
2282
|
description: "Approve completed work and mark DONE. Only for REVIEW state tasks.",
|
|
2074
2283
|
inputSchema: {
|
|
2075
|
-
projectId:
|
|
2076
|
-
taskId:
|
|
2077
|
-
reviewComments:
|
|
2284
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
2285
|
+
taskId: import_zod4.z.string().describe("The task ID to approve"),
|
|
2286
|
+
reviewComments: import_zod4.z.string().optional().describe("Optional approval comments (max 2000 chars)")
|
|
2078
2287
|
}
|
|
2079
2288
|
},
|
|
2080
2289
|
async (args) => {
|
|
@@ -2108,10 +2317,10 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
2108
2317
|
{
|
|
2109
2318
|
description: "Verify a DRAFT task and move it to TODO state. Requires task to pass programmatic validation (title 10+ chars, description 50+ chars, each criterion 20+ chars). If approved=false, stores feedback with NEEDS_REVISION status.",
|
|
2110
2319
|
inputSchema: {
|
|
2111
|
-
projectId:
|
|
2112
|
-
taskId:
|
|
2113
|
-
approved:
|
|
2114
|
-
feedback:
|
|
2320
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
2321
|
+
taskId: import_zod4.z.string().describe("The task ID to verify"),
|
|
2322
|
+
approved: import_zod4.z.boolean().describe("Whether to approve the task"),
|
|
2323
|
+
feedback: import_zod4.z.string().optional().describe("Feedback for the task (required if not approved)")
|
|
2115
2324
|
}
|
|
2116
2325
|
},
|
|
2117
2326
|
async (args) => {
|
|
@@ -2142,8 +2351,8 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
2142
2351
|
{
|
|
2143
2352
|
description: "Get state-appropriate prompt for a task. Returns verify prompt for DRAFT, assignment prompt for TODO, or continue prompt for IN_PROGRESS tasks.",
|
|
2144
2353
|
inputSchema: {
|
|
2145
|
-
projectId:
|
|
2146
|
-
taskId:
|
|
2354
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
2355
|
+
taskId: import_zod4.z.string().describe("The task ID")
|
|
2147
2356
|
}
|
|
2148
2357
|
},
|
|
2149
2358
|
async (args) => {
|
|
@@ -2176,15 +2385,15 @@ function initializeMCPServer(apiClient, authContext) {
|
|
|
2176
2385
|
{
|
|
2177
2386
|
description: "Update task details (title, description, priority, acceptanceCriteria). Only works for DRAFT and TODO states. If task is in TODO state, it reverts to DRAFT and requires re-verification.",
|
|
2178
2387
|
inputSchema: {
|
|
2179
|
-
projectId:
|
|
2180
|
-
taskId:
|
|
2181
|
-
title:
|
|
2182
|
-
description:
|
|
2183
|
-
priority:
|
|
2184
|
-
acceptanceCriteria:
|
|
2185
|
-
|
|
2186
|
-
id:
|
|
2187
|
-
description:
|
|
2388
|
+
projectId: import_zod4.z.string().describe("The project ID"),
|
|
2389
|
+
taskId: import_zod4.z.string().describe("The task ID to update"),
|
|
2390
|
+
title: import_zod4.z.string().optional().describe("New task title"),
|
|
2391
|
+
description: import_zod4.z.string().optional().describe("New task description"),
|
|
2392
|
+
priority: import_zod4.z.nativeEnum(TaskPriority).optional().describe("New task priority"),
|
|
2393
|
+
acceptanceCriteria: import_zod4.z.array(
|
|
2394
|
+
import_zod4.z.object({
|
|
2395
|
+
id: import_zod4.z.string().optional().describe("Existing criterion ID (for updates)"),
|
|
2396
|
+
description: import_zod4.z.string().describe("Criterion description")
|
|
2188
2397
|
})
|
|
2189
2398
|
).optional().describe("New acceptance criteria (replaces existing)")
|
|
2190
2399
|
}
|
|
@@ -2292,12 +2501,12 @@ function handleApiError(error) {
|
|
|
2292
2501
|
isError: true
|
|
2293
2502
|
};
|
|
2294
2503
|
}
|
|
2295
|
-
var ActiveTaskSchema =
|
|
2296
|
-
taskId:
|
|
2297
|
-
projectId:
|
|
2298
|
-
branchName:
|
|
2299
|
-
worktreePath:
|
|
2300
|
-
startedAt:
|
|
2504
|
+
var ActiveTaskSchema = import_zod4.z.object({
|
|
2505
|
+
taskId: import_zod4.z.string().min(1),
|
|
2506
|
+
projectId: import_zod4.z.string().min(1),
|
|
2507
|
+
branchName: import_zod4.z.string().optional(),
|
|
2508
|
+
worktreePath: import_zod4.z.string().optional(),
|
|
2509
|
+
startedAt: import_zod4.z.string().optional()
|
|
2301
2510
|
});
|
|
2302
2511
|
async function checkActiveTask() {
|
|
2303
2512
|
const fs = await import("fs");
|