@tankpkg/mcp-server 0.14.4 → 0.15.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/dist/index.js CHANGED
@@ -279,6 +279,32 @@ z.object({
279
279
  visibility: z.enum(["public", "private"]).optional(),
280
280
  audit: z.object({ min_score: z.number().min(0).max(10) }).strict().optional()
281
281
  }).strict();
282
+ const commandSchema$1 = z.string().min(1, "command must not be empty");
283
+ const argSchema$1 = z.array(z.string()).default([]);
284
+ const envSchema$1 = z.record(z.string(), z.string()).optional();
285
+ const remoteUrlSchema$1 = z.string().url("remote must be a valid URL");
286
+ const localMcpServerSchema = z.object({
287
+ command: commandSchema$1,
288
+ args: argSchema$1,
289
+ env: envSchema$1,
290
+ requires_auth: z.literal(false).optional()
291
+ }).strict();
292
+ const remoteMcpServerSchema = z.object({
293
+ remote: remoteUrlSchema$1,
294
+ requires_auth: z.boolean().default(false),
295
+ env: envSchema$1
296
+ }).strict();
297
+ const mcpServerSchema$1 = z.union([localMcpServerSchema, remoteMcpServerSchema]);
298
+ const perToolOverrideSchema$1 = z.object({
299
+ scan: z.boolean().optional(),
300
+ blockOnMatch: z.boolean().optional()
301
+ }).strict();
302
+ z.object({
303
+ perfBudgetMs: z.number().positive().optional(),
304
+ blockOnMatch: z.boolean().optional(),
305
+ resetPinsOnMismatch: z.boolean().optional(),
306
+ perTool: z.record(z.string(), perToolOverrideSchema$1).optional()
307
+ }).strict();
282
308
  const baseManifestFields$1 = {
283
309
  name: z.string().min(1, "Name must not be empty").max(214, `Name must be 214 characters or fewer`).regex(/^@[a-z0-9-]+\/[a-z0-9][a-z0-9-]*$/, "Name must be scoped (@org/name), lowercase alphanumeric and hyphens"),
284
310
  version: z.string().regex(/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/, "Version must be valid semver"),
@@ -287,7 +313,8 @@ const baseManifestFields$1 = {
287
313
  permissions: permissionsSchema$1.optional(),
288
314
  repository: z.string().url("Repository must be a valid URL").optional(),
289
315
  visibility: z.enum(["public", "private"]).optional(),
290
- audit: z.object({ min_score: z.number().min(0).max(10) }).strict().optional()
316
+ audit: z.object({ min_score: z.number().min(0).max(10) }).strict().optional(),
317
+ mcp_server: mcpServerSchema$1.optional()
291
318
  };
292
319
  /** Legacy skills.json schema — strict, no atoms. Used for backward-compatible consumers. */
293
320
  const skillsJsonSchema = z.object(baseManifestFields$1).strict();
@@ -4510,6 +4537,30 @@ object({
4510
4537
  visibility: _enum(["public", "private"]).optional(),
4511
4538
  audit: object({ min_score: number().min(0).max(10) }).strict().optional()
4512
4539
  }).strict();
4540
+ const commandSchema = string().min(1, "command must not be empty");
4541
+ const argSchema = array(string()).default([]);
4542
+ const envSchema = record(string(), string()).optional();
4543
+ const remoteUrlSchema = string().url("remote must be a valid URL");
4544
+ const mcpServerSchema = union([object({
4545
+ command: commandSchema,
4546
+ args: argSchema,
4547
+ env: envSchema,
4548
+ requires_auth: literal(false).optional()
4549
+ }).strict(), object({
4550
+ remote: remoteUrlSchema,
4551
+ requires_auth: boolean().default(false),
4552
+ env: envSchema
4553
+ }).strict()]);
4554
+ const perToolOverrideSchema = object({
4555
+ scan: boolean().optional(),
4556
+ blockOnMatch: boolean().optional()
4557
+ }).strict();
4558
+ object({
4559
+ perfBudgetMs: number().positive().optional(),
4560
+ blockOnMatch: boolean().optional(),
4561
+ resetPinsOnMismatch: boolean().optional(),
4562
+ perTool: record(string(), perToolOverrideSchema).optional()
4563
+ }).strict();
4513
4564
  const baseManifestFields = {
4514
4565
  name: string().min(1, "Name must not be empty").max(214, `Name must be 214 characters or fewer`).regex(/^@[a-z0-9-]+\/[a-z0-9][a-z0-9-]*$/, "Name must be scoped (@org/name), lowercase alphanumeric and hyphens"),
4515
4566
  version: string().regex(/^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/, "Version must be valid semver"),
@@ -4518,7 +4569,8 @@ const baseManifestFields = {
4518
4569
  permissions: permissionsSchema.optional(),
4519
4570
  repository: string().url("Repository must be a valid URL").optional(),
4520
4571
  visibility: _enum(["public", "private"]).optional(),
4521
- audit: object({ min_score: number().min(0).max(10) }).strict().optional()
4572
+ audit: object({ min_score: number().min(0).max(10) }).strict().optional(),
4573
+ mcp_server: mcpServerSchema.optional()
4522
4574
  };
4523
4575
  object(baseManifestFields).strict();
4524
4576
  object({
@@ -6123,6 +6175,8 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6123
6175
  rcompareIdentifiers: identifiers.rcompareIdentifiers
6124
6176
  };
6125
6177
  })))();
6178
+ const ALPHANUMERIC$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
6179
+ `${ALPHANUMERIC$1}`, `${ALPHANUMERIC$1}`, `${ALPHANUMERIC$1}`, `${ALPHANUMERIC$1}`;
6126
6180
  //#endregion
6127
6181
  //#region src/lib/config.ts
6128
6182
  const DEFAULT_CONFIG = { registry: "https://www.tankpkg.dev" };
@@ -6624,6 +6678,8 @@ function registerInitSkillTool(server) {
6624
6678
  }
6625
6679
  //#endregion
6626
6680
  //#region ../internals-helpers/dist/index.js
6681
+ const ALPHANUMERIC = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
6682
+ `${ALPHANUMERIC}`, `${ALPHANUMERIC}`, `${ALPHANUMERIC}`, `${ALPHANUMERIC}`;
6627
6683
  function resolve(range, versions) {
6628
6684
  try {
6629
6685
  if (!range || !semver.validRange(range)) return null;
@@ -7490,7 +7546,7 @@ function registerSearchSkillsTool(server) {
7490
7546
  }] };
7491
7547
  const header = "| Skill | Score | Downloads | Description |\n|-------|-------|-----------|-------------|";
7492
7548
  const rows = results.map((skill) => {
7493
- const score = skill.auditScore !== null ? skill.auditScore.toFixed(1) : "-";
7549
+ const score = typeof skill.auditScore === "number" && Number.isFinite(skill.auditScore) ? skill.auditScore.toFixed(1) : "-";
7494
7550
  const downloads = skill.downloads > 1e3 ? `${(skill.downloads / 1e3).toFixed(1)}k` : skill.downloads.toString();
7495
7551
  const desc = skill.description?.slice(0, 50) ?? "No description";
7496
7552
  return `| ${skill.name} | ${score} | ${downloads} | ${desc} |`;