@cleocode/caamp 2026.4.0 → 2026.4.4
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/{chunk-3WKBFXLE.js → chunk-6NBM4CAF.js} +796 -1611
- package/dist/chunk-6NBM4CAF.js.map +1 -0
- package/dist/{chunk-5UUABVWS.js → chunk-CRU25LRL.js} +2 -2
- package/dist/{chunk-OH6Z2N3G.js → chunk-FLBRAXDW.js} +2 -2
- package/dist/{chunk-3IEKCREL.js → chunk-XWQ5WPHC.js} +1 -8
- package/dist/{chunk-3IEKCREL.js.map → chunk-XWQ5WPHC.js.map} +1 -1
- package/dist/cli.js +364 -1906
- package/dist/cli.js.map +1 -1
- package/dist/{hooks-Q7KO2SGK.js → hooks-VLIP52LY.js} +3 -3
- package/dist/index.d.ts +6 -1043
- package/dist/index.js +5 -60
- package/dist/index.js.map +1 -1
- package/dist/{injector-XCWEBXWK.js → injector-ALLOKC54.js} +3 -3
- package/package.json +2 -2
- package/dist/chunk-3WKBFXLE.js.map +0 -1
- /package/dist/{chunk-5UUABVWS.js.map → chunk-CRU25LRL.js.map} +0 -0
- /package/dist/{chunk-OH6Z2N3G.js.map → chunk-FLBRAXDW.js.map} +0 -0
- /package/dist/{hooks-Q7KO2SGK.js.map → hooks-VLIP52LY.js.map} +0 -0
- /package/dist/{injector-XCWEBXWK.js.map → injector-ALLOKC54.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1196,146 +1196,11 @@ interface GlobalOptions {
|
|
|
1196
1196
|
quiet?: boolean;
|
|
1197
1197
|
}
|
|
1198
1198
|
|
|
1199
|
-
/**
|
|
1200
|
-
* MCP config installer
|
|
1201
|
-
*
|
|
1202
|
-
* Writes MCP server configurations to agent config files,
|
|
1203
|
-
* handling per-agent formats, keys, and transformations.
|
|
1204
|
-
*/
|
|
1205
|
-
|
|
1206
|
-
/**
|
|
1207
|
-
* Result of installing an MCP server configuration to a single provider.
|
|
1208
|
-
*
|
|
1209
|
-
* @example
|
|
1210
|
-
* ```typescript
|
|
1211
|
-
* const provider = getProvider("claude-code")!;
|
|
1212
|
-
* const result = await installMcpServer(provider, "my-server", {
|
|
1213
|
-
* command: "npx",
|
|
1214
|
-
* args: ["-y", "@modelcontextprotocol/server-filesystem"],
|
|
1215
|
-
* });
|
|
1216
|
-
* if (result.success) {
|
|
1217
|
-
* console.log(`Written to ${result.configPath}`);
|
|
1218
|
-
* }
|
|
1219
|
-
* ```
|
|
1220
|
-
*
|
|
1221
|
-
* @public
|
|
1222
|
-
*/
|
|
1223
|
-
interface InstallResult {
|
|
1224
|
-
/** The provider the config was written to. */
|
|
1225
|
-
provider: Provider;
|
|
1226
|
-
/** Whether project or global scope was used. */
|
|
1227
|
-
scope: 'project' | 'global';
|
|
1228
|
-
/** Absolute path to the config file that was written. */
|
|
1229
|
-
configPath: string;
|
|
1230
|
-
/** Whether the write succeeded. */
|
|
1231
|
-
success: boolean;
|
|
1232
|
-
/** Error message if the write failed. @defaultValue undefined */
|
|
1233
|
-
error?: string;
|
|
1234
|
-
}
|
|
1235
|
-
/**
|
|
1236
|
-
* Install an MCP server configuration for a single provider.
|
|
1237
|
-
*
|
|
1238
|
-
* Applies provider-specific transforms (e.g. Goose, Zed, Codex) and writes
|
|
1239
|
-
* the config to the provider's config file in the specified scope.
|
|
1240
|
-
*
|
|
1241
|
-
* @remarks
|
|
1242
|
-
* The installation flow is: resolve config path, apply any provider-specific
|
|
1243
|
-
* transform via {@link getTransform}, then write the result using the
|
|
1244
|
-
* provider's config format (JSON, YAML, or TOML). If the provider does not
|
|
1245
|
-
* support the requested scope, a failed result is returned without throwing.
|
|
1246
|
-
*
|
|
1247
|
-
* @param provider - Target provider to write config for
|
|
1248
|
-
* @param serverName - Name/key for the MCP server entry
|
|
1249
|
-
* @param config - Canonical MCP server configuration
|
|
1250
|
-
* @param scope - Whether to write to project or global config (default: `"project"`)
|
|
1251
|
-
* @param projectDir - Project directory path (defaults to `process.cwd()`)
|
|
1252
|
-
* @returns Install result with success status and config path
|
|
1253
|
-
*
|
|
1254
|
-
* @example
|
|
1255
|
-
* ```typescript
|
|
1256
|
-
* const provider = getProvider("claude-code")!;
|
|
1257
|
-
* const result = await installMcpServer(provider, "filesystem", {
|
|
1258
|
-
* command: "npx",
|
|
1259
|
-
* args: ["-y", "@modelcontextprotocol/server-filesystem"],
|
|
1260
|
-
* }, "project", "/home/user/my-project");
|
|
1261
|
-
* ```
|
|
1262
|
-
*
|
|
1263
|
-
* @public
|
|
1264
|
-
*/
|
|
1265
|
-
declare function installMcpServer(provider: Provider, serverName: string, config: McpServerConfig, scope?: 'project' | 'global', projectDir?: string): Promise<InstallResult>;
|
|
1266
|
-
/**
|
|
1267
|
-
* Install an MCP server configuration to multiple providers.
|
|
1268
|
-
*
|
|
1269
|
-
* Calls {@link installMcpServer} for each provider sequentially and collects results.
|
|
1270
|
-
*
|
|
1271
|
-
* @remarks
|
|
1272
|
-
* Providers are processed sequentially (not in parallel) to avoid concurrent
|
|
1273
|
-
* writes to shared config files. Each provider's result is independent --
|
|
1274
|
-
* a failure for one provider does not prevent installation to others.
|
|
1275
|
-
*
|
|
1276
|
-
* @param providers - Array of target providers
|
|
1277
|
-
* @param serverName - Name/key for the MCP server entry
|
|
1278
|
-
* @param config - Canonical MCP server configuration
|
|
1279
|
-
* @param scope - Whether to write to project or global config (default: `"project"`)
|
|
1280
|
-
* @param projectDir - Project directory path (defaults to `process.cwd()`)
|
|
1281
|
-
* @returns Array of install results, one per provider
|
|
1282
|
-
*
|
|
1283
|
-
* @example
|
|
1284
|
-
* ```typescript
|
|
1285
|
-
* const providers = getInstalledProviders();
|
|
1286
|
-
* const config = { command: "npx", args: ["-y", "@mcp/server"] };
|
|
1287
|
-
* const results = await installMcpServerToAll(providers, "my-server", config, "project", "/home/user/project");
|
|
1288
|
-
* const successes = results.filter(r => r.success);
|
|
1289
|
-
* ```
|
|
1290
|
-
*
|
|
1291
|
-
* @see {@link installMcpServer}
|
|
1292
|
-
*
|
|
1293
|
-
* @public
|
|
1294
|
-
*/
|
|
1295
|
-
declare function installMcpServerToAll(providers: Provider[], serverName: string, config: McpServerConfig, scope?: 'project' | 'global', projectDir?: string): Promise<InstallResult[]>;
|
|
1296
|
-
/**
|
|
1297
|
-
* Build a canonical {@link McpServerConfig} from a parsed source.
|
|
1298
|
-
*
|
|
1299
|
-
* Maps source types to appropriate transport configurations:
|
|
1300
|
-
* - `"remote"` sources become HTTP/SSE configs with a `url`
|
|
1301
|
-
* - `"package"` sources become `npx -y <package>` stdio configs
|
|
1302
|
-
* - All others are treated as shell commands split into `command` + `args`
|
|
1303
|
-
*
|
|
1304
|
-
* @remarks
|
|
1305
|
-
* This function normalizes diverse source inputs into the canonical config
|
|
1306
|
-
* format that CAAMP uses internally. Provider-specific transforms are applied
|
|
1307
|
-
* later during installation via {@link getTransform}. Command-type sources
|
|
1308
|
-
* are split on whitespace, with the first token becoming `command` and the
|
|
1309
|
-
* remainder becoming `args`.
|
|
1310
|
-
*
|
|
1311
|
-
* @param source - Parsed source with `type` and `value`
|
|
1312
|
-
* @param transport - Override transport type for remote sources (default: `"http"`)
|
|
1313
|
-
* @param headers - Optional HTTP headers for remote servers
|
|
1314
|
-
* @returns Canonical MCP server configuration
|
|
1315
|
-
*
|
|
1316
|
-
* @example
|
|
1317
|
-
* ```typescript
|
|
1318
|
-
* buildServerConfig({ type: "package", value: "@mcp/server-fs" }, undefined, undefined);
|
|
1319
|
-
* // { command: "npx", args: ["-y", "@mcp/server-fs"] }
|
|
1320
|
-
*
|
|
1321
|
-
* buildServerConfig({ type: "remote", value: "https://mcp.example.com" }, "http", { "Authorization": "Bearer token" });
|
|
1322
|
-
* // { type: "http", url: "https://mcp.example.com", headers: { "Authorization": "Bearer token" } }
|
|
1323
|
-
* ```
|
|
1324
|
-
*
|
|
1325
|
-
* @see {@link installMcpServer}
|
|
1326
|
-
*
|
|
1327
|
-
* @public
|
|
1328
|
-
*/
|
|
1329
|
-
declare function buildServerConfig(source: {
|
|
1330
|
-
type: string;
|
|
1331
|
-
value: string;
|
|
1332
|
-
}, transport?: string, headers?: Record<string, string>): McpServerConfig;
|
|
1333
|
-
|
|
1334
1199
|
/**
|
|
1335
1200
|
* Advanced orchestration helpers for multi-provider operations.
|
|
1336
1201
|
*
|
|
1337
1202
|
* These helpers compose CAAMP's lower-level APIs into production patterns:
|
|
1338
|
-
* tier-based targeting,
|
|
1203
|
+
* tier-based targeting, rollback-capable skill batches, and instruction updates.
|
|
1339
1204
|
*/
|
|
1340
1205
|
|
|
1341
1206
|
type Scope = 'project' | 'global';
|
|
@@ -1360,23 +1225,6 @@ type Scope = 'project' | 'global';
|
|
|
1360
1225
|
* @public
|
|
1361
1226
|
*/
|
|
1362
1227
|
declare function selectProvidersByMinimumPriority(providers: Provider[], minimumPriority?: ProviderPriority): Provider[];
|
|
1363
|
-
/**
|
|
1364
|
-
* Single MCP operation entry used by batch orchestration.
|
|
1365
|
-
*
|
|
1366
|
-
* @remarks
|
|
1367
|
-
* Represents one MCP server installation that will be applied across
|
|
1368
|
-
* all targeted providers during a batch operation.
|
|
1369
|
-
*
|
|
1370
|
-
* @public
|
|
1371
|
-
*/
|
|
1372
|
-
interface McpBatchOperation {
|
|
1373
|
-
/** The name of the MCP server to install. */
|
|
1374
|
-
serverName: string;
|
|
1375
|
-
/** The MCP server configuration to write. */
|
|
1376
|
-
config: McpServerConfig;
|
|
1377
|
-
/** The scope for installation, defaults to `"project"`. */
|
|
1378
|
-
scope?: Scope;
|
|
1379
|
-
}
|
|
1380
1228
|
/**
|
|
1381
1229
|
* Single skill operation entry used by batch orchestration.
|
|
1382
1230
|
*
|
|
@@ -1409,8 +1257,6 @@ interface BatchInstallOptions {
|
|
|
1409
1257
|
providers?: Provider[];
|
|
1410
1258
|
/** Minimum provider priority threshold for filtering. */
|
|
1411
1259
|
minimumPriority?: ProviderPriority;
|
|
1412
|
-
/** MCP server operations to apply in the batch. */
|
|
1413
|
-
mcp?: McpBatchOperation[];
|
|
1414
1260
|
/** Skill operations to apply in the batch. */
|
|
1415
1261
|
skills?: SkillBatchOperation[];
|
|
1416
1262
|
/** Project root directory, defaults to `process.cwd()`. */
|
|
@@ -1430,8 +1276,6 @@ interface BatchInstallResult {
|
|
|
1430
1276
|
success: boolean;
|
|
1431
1277
|
/** IDs of providers that were targeted. */
|
|
1432
1278
|
providerIds: string[];
|
|
1433
|
-
/** Number of MCP server installations that were applied. */
|
|
1434
|
-
mcpApplied: number;
|
|
1435
1279
|
/** Number of skill installations that were applied. */
|
|
1436
1280
|
skillsApplied: number;
|
|
1437
1281
|
/** Whether rollback was performed due to a failure. */
|
|
@@ -1442,13 +1286,12 @@ interface BatchInstallResult {
|
|
|
1442
1286
|
error?: string;
|
|
1443
1287
|
}
|
|
1444
1288
|
/**
|
|
1445
|
-
* Installs multiple
|
|
1289
|
+
* Installs multiple skills across filtered providers with rollback.
|
|
1446
1290
|
*
|
|
1447
1291
|
* @remarks
|
|
1448
|
-
* Snapshots all affected
|
|
1449
|
-
*
|
|
1450
|
-
*
|
|
1451
|
-
* to their pre-operation state.
|
|
1292
|
+
* Snapshots all affected skill directories before applying operations.
|
|
1293
|
+
* If any operation fails, all changes are rolled back by reverting
|
|
1294
|
+
* skill symlinks and canonical directories to their pre-operation state.
|
|
1452
1295
|
*
|
|
1453
1296
|
* @param options - The batch installation options including providers, operations, and scope
|
|
1454
1297
|
* @returns A result object indicating success, applied counts, and any rollback information
|
|
@@ -1457,7 +1300,6 @@ interface BatchInstallResult {
|
|
|
1457
1300
|
* ```typescript
|
|
1458
1301
|
* const result = await installBatchWithRollback({
|
|
1459
1302
|
* minimumPriority: "high",
|
|
1460
|
-
* mcp: [{ serverName: "my-server", config: { command: "npx", args: ["my-server"] } }],
|
|
1461
1303
|
* skills: [{ sourcePath: "/path/to/skill", skillName: "my-skill" }],
|
|
1462
1304
|
* });
|
|
1463
1305
|
* if (!result.success) {
|
|
@@ -1468,119 +1310,6 @@ interface BatchInstallResult {
|
|
|
1468
1310
|
* @public
|
|
1469
1311
|
*/
|
|
1470
1312
|
declare function installBatchWithRollback(options: BatchInstallOptions): Promise<BatchInstallResult>;
|
|
1471
|
-
/**
|
|
1472
|
-
* Conflict policy when applying MCP install plans.
|
|
1473
|
-
*
|
|
1474
|
-
* @remarks
|
|
1475
|
-
* Controls behavior when an existing MCP server configuration conflicts
|
|
1476
|
-
* with the desired configuration: `"fail"` aborts the entire operation,
|
|
1477
|
-
* `"skip"` leaves conflicting entries unchanged, and `"overwrite"` replaces them.
|
|
1478
|
-
*
|
|
1479
|
-
* @public
|
|
1480
|
-
*/
|
|
1481
|
-
type ConflictPolicy = 'fail' | 'skip' | 'overwrite';
|
|
1482
|
-
/**
|
|
1483
|
-
* Conflict code identifying the type of MCP configuration conflict.
|
|
1484
|
-
*
|
|
1485
|
-
* @remarks
|
|
1486
|
-
* Used in {@link McpConflict} to categorize detected conflicts during
|
|
1487
|
-
* preflight checks before applying MCP installations.
|
|
1488
|
-
*
|
|
1489
|
-
* @public
|
|
1490
|
-
*/
|
|
1491
|
-
type McpConflictCode = 'unsupported-transport' | 'unsupported-headers' | 'existing-mismatch';
|
|
1492
|
-
/**
|
|
1493
|
-
* Describes a conflict detected during MCP installation preflight.
|
|
1494
|
-
*
|
|
1495
|
-
* @remarks
|
|
1496
|
-
* Contains the provider, server, scope, and nature of the conflict
|
|
1497
|
-
* so that callers can decide how to proceed based on their conflict policy.
|
|
1498
|
-
*
|
|
1499
|
-
* @public
|
|
1500
|
-
*/
|
|
1501
|
-
interface McpConflict {
|
|
1502
|
-
/** The provider where the conflict was detected. */
|
|
1503
|
-
providerId: string;
|
|
1504
|
-
/** The MCP server name involved in the conflict. */
|
|
1505
|
-
serverName: string;
|
|
1506
|
-
/** The scope (global or project) of the conflicting config. */
|
|
1507
|
-
scope: Scope;
|
|
1508
|
-
/** The type of conflict detected. */
|
|
1509
|
-
code: McpConflictCode;
|
|
1510
|
-
/** Human-readable description of the conflict. */
|
|
1511
|
-
message: string;
|
|
1512
|
-
}
|
|
1513
|
-
/**
|
|
1514
|
-
* Result from applying an MCP install plan with a conflict policy.
|
|
1515
|
-
*
|
|
1516
|
-
* @remarks
|
|
1517
|
-
* Contains all detected conflicts, successfully applied installations,
|
|
1518
|
-
* and any operations that were skipped due to the conflict policy.
|
|
1519
|
-
*
|
|
1520
|
-
* @public
|
|
1521
|
-
*/
|
|
1522
|
-
interface McpPlanApplyResult {
|
|
1523
|
-
/** All conflicts detected during preflight, regardless of policy. */
|
|
1524
|
-
conflicts: McpConflict[];
|
|
1525
|
-
/** Successfully applied MCP server installations. */
|
|
1526
|
-
applied: InstallResult[];
|
|
1527
|
-
/** Operations skipped due to the conflict policy. */
|
|
1528
|
-
skipped: Array<{
|
|
1529
|
-
providerId: string;
|
|
1530
|
-
serverName: string;
|
|
1531
|
-
scope: Scope;
|
|
1532
|
-
reason: McpConflictCode;
|
|
1533
|
-
}>;
|
|
1534
|
-
}
|
|
1535
|
-
/**
|
|
1536
|
-
* Performs preflight conflict detection for MCP install plans across providers.
|
|
1537
|
-
*
|
|
1538
|
-
* @remarks
|
|
1539
|
-
* Checks each provider-operation pair for transport support, header support,
|
|
1540
|
-
* and existing configuration mismatches. Returns all detected conflicts without
|
|
1541
|
-
* modifying any files. Callers can then decide whether to proceed based on
|
|
1542
|
-
* their conflict policy.
|
|
1543
|
-
*
|
|
1544
|
-
* @param providers - The providers to check for conflicts
|
|
1545
|
-
* @param operations - The MCP operations to validate against existing configs
|
|
1546
|
-
* @param projectDir - The project root directory, defaults to `process.cwd()`
|
|
1547
|
-
* @returns An array of detected conflicts, empty if no conflicts found
|
|
1548
|
-
*
|
|
1549
|
-
* @example
|
|
1550
|
-
* ```typescript
|
|
1551
|
-
* const conflicts = await detectMcpConfigConflicts(providers, operations);
|
|
1552
|
-
* if (conflicts.length > 0) {
|
|
1553
|
-
* console.warn("Conflicts detected:", conflicts);
|
|
1554
|
-
* }
|
|
1555
|
-
* ```
|
|
1556
|
-
*
|
|
1557
|
-
* @public
|
|
1558
|
-
*/
|
|
1559
|
-
declare function detectMcpConfigConflicts(providers: Provider[], operations: McpBatchOperation[], projectDir?: string): Promise<McpConflict[]>;
|
|
1560
|
-
/**
|
|
1561
|
-
* Applies an MCP install plan with a conflict policy controlling behavior on conflicts.
|
|
1562
|
-
*
|
|
1563
|
-
* @remarks
|
|
1564
|
-
* First runs {@link detectMcpConfigConflicts} to find all conflicts, then applies
|
|
1565
|
-
* the specified policy: `"fail"` returns immediately with no changes, `"skip"`
|
|
1566
|
-
* leaves conflicting entries unchanged and applies the rest, and `"overwrite"`
|
|
1567
|
-
* applies all operations regardless of conflicts.
|
|
1568
|
-
*
|
|
1569
|
-
* @param providers - The providers to install MCP servers for
|
|
1570
|
-
* @param operations - The MCP server operations to apply
|
|
1571
|
-
* @param policy - The conflict resolution policy, defaults to `"fail"`
|
|
1572
|
-
* @param projectDir - The project root directory, defaults to `process.cwd()`
|
|
1573
|
-
* @returns A result containing conflicts, applied installations, and skipped operations
|
|
1574
|
-
*
|
|
1575
|
-
* @example
|
|
1576
|
-
* ```typescript
|
|
1577
|
-
* const result = await applyMcpInstallWithPolicy(providers, operations, "skip");
|
|
1578
|
-
* console.log(`Applied: ${result.applied.length}, Skipped: ${result.skipped.length}`);
|
|
1579
|
-
* ```
|
|
1580
|
-
*
|
|
1581
|
-
* @public
|
|
1582
|
-
*/
|
|
1583
|
-
declare function applyMcpInstallWithPolicy(providers: Provider[], operations: McpBatchOperation[], policy?: ConflictPolicy, projectDir?: string): Promise<McpPlanApplyResult>;
|
|
1584
1313
|
/**
|
|
1585
1314
|
* Result of a single-operation instruction update across providers.
|
|
1586
1315
|
*
|
|
@@ -1631,87 +1360,6 @@ interface InstructionUpdateSummary {
|
|
|
1631
1360
|
* @public
|
|
1632
1361
|
*/
|
|
1633
1362
|
declare function updateInstructionsSingleOperation(providers: Provider[], content: string, scope?: Scope, projectDir?: string): Promise<InstructionUpdateSummary>;
|
|
1634
|
-
/**
|
|
1635
|
-
* Request payload for dual-scope provider configuration.
|
|
1636
|
-
*
|
|
1637
|
-
* @remarks
|
|
1638
|
-
* Allows configuring both global and project-level MCP servers and
|
|
1639
|
-
* instructions in a single call. Instruction content can be a single
|
|
1640
|
-
* string applied to both scopes or scope-specific strings.
|
|
1641
|
-
*
|
|
1642
|
-
* @public
|
|
1643
|
-
*/
|
|
1644
|
-
interface DualScopeConfigureOptions {
|
|
1645
|
-
/** MCP servers to install at global scope. */
|
|
1646
|
-
globalMcp?: Array<{
|
|
1647
|
-
serverName: string;
|
|
1648
|
-
config: McpServerConfig;
|
|
1649
|
-
}>;
|
|
1650
|
-
/** MCP servers to install at project scope. */
|
|
1651
|
-
projectMcp?: Array<{
|
|
1652
|
-
serverName: string;
|
|
1653
|
-
config: McpServerConfig;
|
|
1654
|
-
}>;
|
|
1655
|
-
/** Instruction content for injection, either shared or per-scope. */
|
|
1656
|
-
instructionContent?: string | {
|
|
1657
|
-
global?: string;
|
|
1658
|
-
project?: string;
|
|
1659
|
-
};
|
|
1660
|
-
/** Project root directory, defaults to `process.cwd()`. */
|
|
1661
|
-
projectDir?: string;
|
|
1662
|
-
}
|
|
1663
|
-
/**
|
|
1664
|
-
* Result of dual-scope provider configuration.
|
|
1665
|
-
*
|
|
1666
|
-
* @remarks
|
|
1667
|
-
* Contains the resolved config paths, MCP installation results for both
|
|
1668
|
-
* scopes, and instruction injection results for each scope that was configured.
|
|
1669
|
-
*
|
|
1670
|
-
* @public
|
|
1671
|
-
*/
|
|
1672
|
-
interface DualScopeConfigureResult {
|
|
1673
|
-
/** The ID of the configured provider. */
|
|
1674
|
-
providerId: string;
|
|
1675
|
-
/** Resolved configuration file paths for both scopes. */
|
|
1676
|
-
configPaths: {
|
|
1677
|
-
global: string | null;
|
|
1678
|
-
project: string | null;
|
|
1679
|
-
};
|
|
1680
|
-
/** MCP installation results for each scope. */
|
|
1681
|
-
mcp: {
|
|
1682
|
-
global: InstallResult[];
|
|
1683
|
-
project: InstallResult[];
|
|
1684
|
-
};
|
|
1685
|
-
/** Instruction injection results for each scope, if applicable. */
|
|
1686
|
-
instructions: {
|
|
1687
|
-
global?: Map<string, 'created' | 'added' | 'consolidated' | 'updated' | 'intact'>;
|
|
1688
|
-
project?: Map<string, 'created' | 'added' | 'consolidated' | 'updated' | 'intact'>;
|
|
1689
|
-
};
|
|
1690
|
-
}
|
|
1691
|
-
/**
|
|
1692
|
-
* Configures both global and project-level settings for one provider in one call.
|
|
1693
|
-
*
|
|
1694
|
-
* @remarks
|
|
1695
|
-
* Applies MCP server installations and instruction injections at both global
|
|
1696
|
-
* and project scope in a single coordinated operation. This avoids the need
|
|
1697
|
-
* to make separate calls for each scope.
|
|
1698
|
-
*
|
|
1699
|
-
* @param provider - The provider to configure
|
|
1700
|
-
* @param options - The dual-scope configuration options
|
|
1701
|
-
* @returns A result containing config paths, MCP results, and instruction results for both scopes
|
|
1702
|
-
*
|
|
1703
|
-
* @example
|
|
1704
|
-
* ```typescript
|
|
1705
|
-
* const result = await configureProviderGlobalAndProject(provider, {
|
|
1706
|
-
* globalMcp: [{ serverName: "my-server", config: { command: "npx", args: ["my-server"] } }],
|
|
1707
|
-
* instructionContent: "## Agent Setup\nUse these tools...",
|
|
1708
|
-
* });
|
|
1709
|
-
* console.log(result.configPaths);
|
|
1710
|
-
* ```
|
|
1711
|
-
*
|
|
1712
|
-
* @public
|
|
1713
|
-
*/
|
|
1714
|
-
declare function configureProviderGlobalAndProject(provider: Provider, options: DualScopeConfigureOptions): Promise<DualScopeConfigureResult>;
|
|
1715
1363
|
|
|
1716
1364
|
/**
|
|
1717
1365
|
* Format utility functions
|
|
@@ -3166,691 +2814,6 @@ declare class MarketplaceClient {
|
|
|
3166
2814
|
getSkill(scopedName: string): Promise<MarketplaceResult | null>;
|
|
3167
2815
|
}
|
|
3168
2816
|
|
|
3169
|
-
/**
|
|
3170
|
-
* CLEO MCP channel profile helpers.
|
|
3171
|
-
*/
|
|
3172
|
-
|
|
3173
|
-
/**
|
|
3174
|
-
* CLEO release channel identifier.
|
|
3175
|
-
*
|
|
3176
|
-
* @remarks
|
|
3177
|
-
* Determines which version stream is used: `"stable"` for production releases,
|
|
3178
|
-
* `"beta"` for pre-release versions, and `"dev"` for local development builds.
|
|
3179
|
-
*
|
|
3180
|
-
* @public
|
|
3181
|
-
*/
|
|
3182
|
-
type CleoChannel = 'stable' | 'beta' | 'dev';
|
|
3183
|
-
/**
|
|
3184
|
-
* Options for building a CLEO MCP server profile configuration.
|
|
3185
|
-
*
|
|
3186
|
-
* @remarks
|
|
3187
|
-
* For stable and beta channels, the `version` field controls the npm package
|
|
3188
|
-
* version. For the dev channel, `command` is required to specify the local
|
|
3189
|
-
* binary path or command.
|
|
3190
|
-
*
|
|
3191
|
-
* @public
|
|
3192
|
-
*/
|
|
3193
|
-
interface CleoProfileBuildOptions {
|
|
3194
|
-
/** The CLEO release channel to target. */
|
|
3195
|
-
channel: CleoChannel;
|
|
3196
|
-
/** Optional npm version tag or semver range for stable/beta channels. */
|
|
3197
|
-
version?: string;
|
|
3198
|
-
/** Custom command binary for dev channel, required when channel is `"dev"`. */
|
|
3199
|
-
command?: string;
|
|
3200
|
-
/** Additional arguments to pass to the command. */
|
|
3201
|
-
args?: string[];
|
|
3202
|
-
/** Environment variables to set in the MCP server config. */
|
|
3203
|
-
env?: Record<string, string>;
|
|
3204
|
-
/** Custom CLEO directory path for dev channel, overrides default. */
|
|
3205
|
-
cleoDir?: string;
|
|
3206
|
-
}
|
|
3207
|
-
/**
|
|
3208
|
-
* Result of building a CLEO MCP server profile configuration.
|
|
3209
|
-
*
|
|
3210
|
-
* @remarks
|
|
3211
|
-
* Contains the resolved channel, server name, and MCP configuration.
|
|
3212
|
-
* For stable/beta channels, `packageSpec` contains the npm package
|
|
3213
|
-
* specifier used in the npx command.
|
|
3214
|
-
*
|
|
3215
|
-
* @public
|
|
3216
|
-
*/
|
|
3217
|
-
interface CleoProfileBuildResult {
|
|
3218
|
-
/** The resolved CLEO release channel. */
|
|
3219
|
-
channel: CleoChannel;
|
|
3220
|
-
/** The MCP server name for this channel. */
|
|
3221
|
-
serverName: string;
|
|
3222
|
-
/** The MCP server configuration ready for installation. */
|
|
3223
|
-
config: McpServerConfig;
|
|
3224
|
-
/** The npm package specifier, present for stable/beta channels. */
|
|
3225
|
-
packageSpec?: string;
|
|
3226
|
-
}
|
|
3227
|
-
/**
|
|
3228
|
-
* Result of checking whether a command is reachable on the system.
|
|
3229
|
-
*
|
|
3230
|
-
* @remarks
|
|
3231
|
-
* The `method` field indicates whether the command was checked as a filesystem
|
|
3232
|
-
* path or via system PATH lookup (using `which`/`where`).
|
|
3233
|
-
*
|
|
3234
|
-
* @public
|
|
3235
|
-
*/
|
|
3236
|
-
interface CommandReachability {
|
|
3237
|
-
/** Whether the command was found and is reachable. */
|
|
3238
|
-
reachable: boolean;
|
|
3239
|
-
/** The method used to check reachability. */
|
|
3240
|
-
method: 'path' | 'lookup';
|
|
3241
|
-
/** The resolved path or command name that was checked. */
|
|
3242
|
-
detail: string;
|
|
3243
|
-
}
|
|
3244
|
-
/**
|
|
3245
|
-
* Normalizes a string value to a valid CLEO channel identifier.
|
|
3246
|
-
*
|
|
3247
|
-
* @remarks
|
|
3248
|
-
* Trims and lowercases the input, then validates it against the known
|
|
3249
|
-
* channel names. Returns `"stable"` for empty or undefined input.
|
|
3250
|
-
* Throws if the value is not a recognized channel.
|
|
3251
|
-
*
|
|
3252
|
-
* @param value - The raw channel string to normalize
|
|
3253
|
-
* @returns The normalized CLEO channel
|
|
3254
|
-
* @throws Error if the value is not `"stable"`, `"beta"`, or `"dev"`
|
|
3255
|
-
*
|
|
3256
|
-
* @example
|
|
3257
|
-
* ```typescript
|
|
3258
|
-
* const channel = normalizeCleoChannel("Beta");
|
|
3259
|
-
* // returns "beta"
|
|
3260
|
-
* ```
|
|
3261
|
-
*
|
|
3262
|
-
* @public
|
|
3263
|
-
*/
|
|
3264
|
-
declare function normalizeCleoChannel(value?: string): CleoChannel;
|
|
3265
|
-
/**
|
|
3266
|
-
* Resolves the MCP server name for a given CLEO channel.
|
|
3267
|
-
*
|
|
3268
|
-
* @remarks
|
|
3269
|
-
* Maps channel identifiers to their corresponding server names
|
|
3270
|
-
* using the {@link CLEO_SERVER_NAMES} registry.
|
|
3271
|
-
*
|
|
3272
|
-
* @param channel - The CLEO channel to resolve
|
|
3273
|
-
* @returns The MCP server name for the channel
|
|
3274
|
-
*
|
|
3275
|
-
* @example
|
|
3276
|
-
* ```typescript
|
|
3277
|
-
* const name = resolveCleoServerName("stable");
|
|
3278
|
-
* // returns "cleo"
|
|
3279
|
-
* ```
|
|
3280
|
-
*
|
|
3281
|
-
* @public
|
|
3282
|
-
*/
|
|
3283
|
-
declare function resolveCleoServerName(channel: CleoChannel): string;
|
|
3284
|
-
/**
|
|
3285
|
-
* Resolves a CLEO channel from an MCP server name.
|
|
3286
|
-
*
|
|
3287
|
-
* @remarks
|
|
3288
|
-
* Performs a reverse lookup from server name to channel. Returns null
|
|
3289
|
-
* if the server name does not match any known CLEO channel.
|
|
3290
|
-
*
|
|
3291
|
-
* @param serverName - The MCP server name to look up
|
|
3292
|
-
* @returns The matching CLEO channel, or null if not a CLEO server
|
|
3293
|
-
*
|
|
3294
|
-
* @example
|
|
3295
|
-
* ```typescript
|
|
3296
|
-
* const channel = resolveChannelFromServerName("cleo-beta");
|
|
3297
|
-
* // returns "beta"
|
|
3298
|
-
* ```
|
|
3299
|
-
*
|
|
3300
|
-
* @public
|
|
3301
|
-
*/
|
|
3302
|
-
declare function resolveChannelFromServerName(serverName: string): CleoChannel | null;
|
|
3303
|
-
/**
|
|
3304
|
-
* Builds a CLEO MCP server profile configuration from options.
|
|
3305
|
-
*
|
|
3306
|
-
* @remarks
|
|
3307
|
-
* For the dev channel, constructs a config using the provided command and args.
|
|
3308
|
-
* For stable/beta channels, constructs an npx-based config with the appropriate
|
|
3309
|
-
* package specifier. Dev channel requires a command; stable/beta use npx with
|
|
3310
|
-
* the `@cleocode/cleo` package.
|
|
3311
|
-
*
|
|
3312
|
-
* @param options - The profile build options specifying channel, command, version, etc.
|
|
3313
|
-
* @returns The built profile with server name, config, and optional package spec
|
|
3314
|
-
* @throws Error if dev channel is selected without a command
|
|
3315
|
-
*
|
|
3316
|
-
* @example
|
|
3317
|
-
* ```typescript
|
|
3318
|
-
* const profile = buildCleoProfile({ channel: "stable" });
|
|
3319
|
-
* // profile.config.command === "npx"
|
|
3320
|
-
* // profile.config.args === ["-y", "@cleocode/cleo@latest", "mcp"]
|
|
3321
|
-
* ```
|
|
3322
|
-
*
|
|
3323
|
-
* @public
|
|
3324
|
-
*/
|
|
3325
|
-
declare function buildCleoProfile(options: CleoProfileBuildOptions): CleoProfileBuildResult;
|
|
3326
|
-
/**
|
|
3327
|
-
* Checks whether a command binary is reachable on the current system.
|
|
3328
|
-
*
|
|
3329
|
-
* @remarks
|
|
3330
|
-
* If the command contains path separators or starts with `~`, it is treated
|
|
3331
|
-
* as a filesystem path and checked with `existsSync`. Otherwise, a system
|
|
3332
|
-
* PATH lookup is performed using `which` (Unix) or `where` (Windows).
|
|
3333
|
-
*
|
|
3334
|
-
* @param command - The command or path to check for reachability
|
|
3335
|
-
* @returns A reachability result indicating whether the command was found
|
|
3336
|
-
*
|
|
3337
|
-
* @example
|
|
3338
|
-
* ```typescript
|
|
3339
|
-
* const result = checkCommandReachability("node");
|
|
3340
|
-
* if (result.reachable) {
|
|
3341
|
-
* console.log("Found via", result.method);
|
|
3342
|
-
* }
|
|
3343
|
-
* ```
|
|
3344
|
-
*
|
|
3345
|
-
* @public
|
|
3346
|
-
*/
|
|
3347
|
-
declare function checkCommandReachability(command: string): CommandReachability;
|
|
3348
|
-
/**
|
|
3349
|
-
* Parses an array of `KEY=value` strings into an environment variable record.
|
|
3350
|
-
*
|
|
3351
|
-
* @remarks
|
|
3352
|
-
* Each string must contain an `=` separator with a non-empty key.
|
|
3353
|
-
* Throws on malformed entries. Whitespace around keys and values is trimmed.
|
|
3354
|
-
*
|
|
3355
|
-
* @param values - Array of `KEY=value` assignment strings
|
|
3356
|
-
* @returns A record mapping environment variable names to their values
|
|
3357
|
-
* @throws Error if any assignment is malformed (missing `=` or empty key)
|
|
3358
|
-
*
|
|
3359
|
-
* @example
|
|
3360
|
-
* ```typescript
|
|
3361
|
-
* const env = parseEnvAssignments(["NODE_ENV=production", "PORT=3000"]);
|
|
3362
|
-
* // returns { NODE_ENV: "production", PORT: "3000" }
|
|
3363
|
-
* ```
|
|
3364
|
-
*
|
|
3365
|
-
* @public
|
|
3366
|
-
*/
|
|
3367
|
-
declare function parseEnvAssignments(values: string[]): Record<string, string>;
|
|
3368
|
-
/**
|
|
3369
|
-
* Extracts the version tag from an npm package specifier string.
|
|
3370
|
-
*
|
|
3371
|
-
* @remarks
|
|
3372
|
-
* Splits on the last `@` character to separate the package name from
|
|
3373
|
-
* the version tag. Returns undefined if no version tag is present or
|
|
3374
|
-
* the input is falsy.
|
|
3375
|
-
*
|
|
3376
|
-
* @param packageSpec - The npm package specifier, e.g., `"@cleocode/cleo@1.2.0"`
|
|
3377
|
-
* @returns The extracted version tag, or undefined if not present
|
|
3378
|
-
*
|
|
3379
|
-
* @example
|
|
3380
|
-
* ```typescript
|
|
3381
|
-
* const tag = extractVersionTag("@cleocode/cleo@1.2.0");
|
|
3382
|
-
* // returns "1.2.0"
|
|
3383
|
-
* ```
|
|
3384
|
-
*
|
|
3385
|
-
* @public
|
|
3386
|
-
*/
|
|
3387
|
-
declare function extractVersionTag(packageSpec?: string): string | undefined;
|
|
3388
|
-
/**
|
|
3389
|
-
* Checks whether a source string identifies a CLEO MCP installation.
|
|
3390
|
-
*
|
|
3391
|
-
* @remarks
|
|
3392
|
-
* Performs a case-insensitive comparison after trimming whitespace.
|
|
3393
|
-
* Returns true only when the source is exactly `"cleo"`.
|
|
3394
|
-
*
|
|
3395
|
-
* @param source - The source identifier string to check
|
|
3396
|
-
* @returns True if the source represents a CLEO installation
|
|
3397
|
-
*
|
|
3398
|
-
* @example
|
|
3399
|
-
* ```typescript
|
|
3400
|
-
* isCleoSource("cleo"); // true
|
|
3401
|
-
* isCleoSource("Cleo"); // true
|
|
3402
|
-
* isCleoSource("other"); // false
|
|
3403
|
-
* ```
|
|
3404
|
-
*
|
|
3405
|
-
* @public
|
|
3406
|
-
*/
|
|
3407
|
-
declare function isCleoSource(source: string): boolean;
|
|
3408
|
-
|
|
3409
|
-
/**
|
|
3410
|
-
* Shared lock file utilities
|
|
3411
|
-
*
|
|
3412
|
-
* Single source of truth for reading/writing the canonical CAAMP lock file path.
|
|
3413
|
-
* Both MCP and skills lock modules import from here.
|
|
3414
|
-
*/
|
|
3415
|
-
|
|
3416
|
-
/**
|
|
3417
|
-
* Read and parse the CAAMP lock file from disk.
|
|
3418
|
-
*
|
|
3419
|
-
* @remarks
|
|
3420
|
-
* Returns a default empty lock structure when the file does not exist or
|
|
3421
|
-
* cannot be parsed, ensuring callers always receive a valid object.
|
|
3422
|
-
*
|
|
3423
|
-
* @returns Parsed lock file contents
|
|
3424
|
-
*
|
|
3425
|
-
* @example
|
|
3426
|
-
* ```typescript
|
|
3427
|
-
* const lock = await readLockFile();
|
|
3428
|
-
* console.log(Object.keys(lock.mcpServers));
|
|
3429
|
-
* ```
|
|
3430
|
-
*
|
|
3431
|
-
* @public
|
|
3432
|
-
*/
|
|
3433
|
-
declare function readLockFile(): Promise<CaampLockFile>;
|
|
3434
|
-
|
|
3435
|
-
/**
|
|
3436
|
-
* MCP lock file management
|
|
3437
|
-
*
|
|
3438
|
-
* Tracks installed MCP servers with source and agent metadata.
|
|
3439
|
-
* Stored in the canonical CAAMP lock file (shared with skills lock).
|
|
3440
|
-
*/
|
|
3441
|
-
|
|
3442
|
-
/**
|
|
3443
|
-
* Record an MCP server installation in the lock file.
|
|
3444
|
-
*
|
|
3445
|
-
* Creates or updates an entry in `lock.mcpServers`. If the server already exists,
|
|
3446
|
-
* the agent list is merged and `updatedAt` is refreshed while `installedAt` is preserved.
|
|
3447
|
-
*
|
|
3448
|
-
* @remarks
|
|
3449
|
-
* Uses an atomic read-modify-write pattern via `updateLockFile`. When updating
|
|
3450
|
-
* an existing entry, the agent list is deduplicated using a `Set` to prevent
|
|
3451
|
-
* duplicate provider IDs. The `installedAt` timestamp is preserved from the
|
|
3452
|
-
* original entry while `updatedAt` is always refreshed.
|
|
3453
|
-
*
|
|
3454
|
-
* @param serverName - Name/key of the MCP server
|
|
3455
|
-
* @param source - Original source string
|
|
3456
|
-
* @param sourceType - Classified source type
|
|
3457
|
-
* @param agents - Provider IDs the server was installed to
|
|
3458
|
-
* @param isGlobal - Whether this is a global installation
|
|
3459
|
-
* @param version - Optional version string for the installed package
|
|
3460
|
-
*
|
|
3461
|
-
* @example
|
|
3462
|
-
* ```typescript
|
|
3463
|
-
* await recordMcpInstall("filesystem", "@mcp/server-fs", "package", ["claude-code"], true, "1.0.0");
|
|
3464
|
-
* ```
|
|
3465
|
-
*
|
|
3466
|
-
* @public
|
|
3467
|
-
*/
|
|
3468
|
-
declare function recordMcpInstall(serverName: string, source: string, sourceType: SourceType, agents: string[], isGlobal: boolean, version?: string): Promise<void>;
|
|
3469
|
-
/**
|
|
3470
|
-
* Remove an MCP server entry from the lock file.
|
|
3471
|
-
*
|
|
3472
|
-
* @remarks
|
|
3473
|
-
* Uses an atomic read-modify-write pattern. If the server name is not present
|
|
3474
|
-
* in the lock file, the file is not modified and `false` is returned.
|
|
3475
|
-
*
|
|
3476
|
-
* @param serverName - Name/key of the MCP server to remove
|
|
3477
|
-
* @returns `true` if the entry was found and removed, `false` if not found
|
|
3478
|
-
*
|
|
3479
|
-
* @example
|
|
3480
|
-
* ```typescript
|
|
3481
|
-
* const removed = await removeMcpFromLock("filesystem");
|
|
3482
|
-
* if (removed) {
|
|
3483
|
-
* console.log("Server removed from lock file");
|
|
3484
|
-
* }
|
|
3485
|
-
* ```
|
|
3486
|
-
*
|
|
3487
|
-
* @public
|
|
3488
|
-
*/
|
|
3489
|
-
declare function removeMcpFromLock(serverName: string): Promise<boolean>;
|
|
3490
|
-
/**
|
|
3491
|
-
* Get all MCP servers tracked in the lock file.
|
|
3492
|
-
*
|
|
3493
|
-
* @remarks
|
|
3494
|
-
* Returns the `mcpServers` section of the lock file as a record. Each key
|
|
3495
|
-
* is a server name and each value contains installation metadata including
|
|
3496
|
-
* source, agents, timestamps, and scope.
|
|
3497
|
-
*
|
|
3498
|
-
* @returns Record of server name to lock entry
|
|
3499
|
-
*
|
|
3500
|
-
* @example
|
|
3501
|
-
* ```typescript
|
|
3502
|
-
* const servers = await getTrackedMcpServers();
|
|
3503
|
-
* for (const [name, entry] of Object.entries(servers)) {
|
|
3504
|
-
* console.log(`${name}: installed ${entry.installedAt}`);
|
|
3505
|
-
* }
|
|
3506
|
-
* ```
|
|
3507
|
-
*
|
|
3508
|
-
* @public
|
|
3509
|
-
*/
|
|
3510
|
-
declare function getTrackedMcpServers(): Promise<Record<string, LockEntry>>;
|
|
3511
|
-
/**
|
|
3512
|
-
* Save the last selected agent IDs to the lock file for UX persistence.
|
|
3513
|
-
*
|
|
3514
|
-
* Used to remember the user's agent selection between CLI invocations.
|
|
3515
|
-
*
|
|
3516
|
-
* @remarks
|
|
3517
|
-
* Persists the `lastSelectedAgents` field in the lock file so subsequent
|
|
3518
|
-
* CLI invocations can default to the same agent selection. This avoids
|
|
3519
|
-
* requiring the user to re-select agents each time.
|
|
3520
|
-
*
|
|
3521
|
-
* @param agents - Array of provider IDs to remember
|
|
3522
|
-
*
|
|
3523
|
-
* @example
|
|
3524
|
-
* ```typescript
|
|
3525
|
-
* await saveLastSelectedAgents(["claude-code", "cursor"]);
|
|
3526
|
-
* ```
|
|
3527
|
-
*
|
|
3528
|
-
* @public
|
|
3529
|
-
*/
|
|
3530
|
-
declare function saveLastSelectedAgents(agents: string[]): Promise<void>;
|
|
3531
|
-
/**
|
|
3532
|
-
* Retrieve the last selected agent IDs from the lock file.
|
|
3533
|
-
*
|
|
3534
|
-
* @remarks
|
|
3535
|
-
* Returns the `lastSelectedAgents` field from the lock file, which is
|
|
3536
|
-
* set by {@link saveLastSelectedAgents}. Returns `undefined` if no
|
|
3537
|
-
* selection has been persisted yet.
|
|
3538
|
-
*
|
|
3539
|
-
* @returns Array of provider IDs, or `undefined` if none were saved
|
|
3540
|
-
*
|
|
3541
|
-
* @example
|
|
3542
|
-
* ```typescript
|
|
3543
|
-
* const agents = await getLastSelectedAgents();
|
|
3544
|
-
* // ["claude-code", "cursor"] or undefined
|
|
3545
|
-
* ```
|
|
3546
|
-
*
|
|
3547
|
-
* @public
|
|
3548
|
-
*/
|
|
3549
|
-
declare function getLastSelectedAgents(): Promise<string[] | undefined>;
|
|
3550
|
-
|
|
3551
|
-
/**
|
|
3552
|
-
* MCP config reader
|
|
3553
|
-
*
|
|
3554
|
-
* Reads, lists, and removes MCP server entries from agent config files.
|
|
3555
|
-
* Provides the programmatic API that CLI commands delegate to.
|
|
3556
|
-
*/
|
|
3557
|
-
|
|
3558
|
-
/**
|
|
3559
|
-
* Resolve the absolute config file path for a provider and scope.
|
|
3560
|
-
*
|
|
3561
|
-
* For project scope, joins the project directory with the provider's relative
|
|
3562
|
-
* config path. For global scope, returns the provider's global config path.
|
|
3563
|
-
*
|
|
3564
|
-
* @remarks
|
|
3565
|
-
* Delegates to {@link resolveProviderConfigPath} from the paths module.
|
|
3566
|
-
* Returns `null` when the provider has no config path defined for the
|
|
3567
|
-
* requested scope (e.g. some providers only support global config).
|
|
3568
|
-
*
|
|
3569
|
-
* @param provider - Provider to resolve config path for
|
|
3570
|
-
* @param scope - Whether to resolve project or global config path
|
|
3571
|
-
* @param projectDir - Project directory (defaults to `process.cwd()`)
|
|
3572
|
-
* @returns Absolute config file path, or `null` if the provider does not support the given scope
|
|
3573
|
-
*
|
|
3574
|
-
* @example
|
|
3575
|
-
* ```typescript
|
|
3576
|
-
* const provider = getProvider("claude-code")!;
|
|
3577
|
-
* const path = resolveConfigPath(provider, "project", "/home/user/my-project");
|
|
3578
|
-
* // Returns provider-specific project config path
|
|
3579
|
-
* ```
|
|
3580
|
-
*
|
|
3581
|
-
* @public
|
|
3582
|
-
*/
|
|
3583
|
-
declare function resolveConfigPath(provider: Provider, scope: 'project' | 'global', projectDir?: string): string | null;
|
|
3584
|
-
/**
|
|
3585
|
-
* List MCP servers configured for a single provider.
|
|
3586
|
-
*
|
|
3587
|
-
* Reads the provider's config file, extracts the MCP servers section using the
|
|
3588
|
-
* provider's `configKey`, and returns each server entry with metadata.
|
|
3589
|
-
*
|
|
3590
|
-
* @remarks
|
|
3591
|
-
* The config file is read using the format handler matching the provider's
|
|
3592
|
-
* `configFormat` (JSON, YAML, or TOML). The `configKey` is used to extract
|
|
3593
|
-
* the MCP servers section (e.g. `"mcpServers"`, `"mcp_servers"`, `"extensions"`).
|
|
3594
|
-
* Returns an empty array if the file does not exist or cannot be parsed.
|
|
3595
|
-
*
|
|
3596
|
-
* @param provider - Provider whose config file to read
|
|
3597
|
-
* @param scope - Whether to read project or global config
|
|
3598
|
-
* @param projectDir - Project directory (defaults to `process.cwd()`)
|
|
3599
|
-
* @returns Array of MCP server entries found in the config file
|
|
3600
|
-
*
|
|
3601
|
-
* @example
|
|
3602
|
-
* ```typescript
|
|
3603
|
-
* const provider = getProvider("claude-code")!;
|
|
3604
|
-
* const servers = await listMcpServers(provider, "project", "/home/user/my-project");
|
|
3605
|
-
* for (const s of servers) {
|
|
3606
|
-
* console.log(`${s.name} (${s.scope})`);
|
|
3607
|
-
* }
|
|
3608
|
-
* ```
|
|
3609
|
-
*
|
|
3610
|
-
* @public
|
|
3611
|
-
*/
|
|
3612
|
-
declare function listMcpServers(provider: Provider, scope: 'project' | 'global', projectDir?: string): Promise<McpServerEntry[]>;
|
|
3613
|
-
/**
|
|
3614
|
-
* List MCP servers from the `.agents/mcp/servers.json` standard location.
|
|
3615
|
-
*
|
|
3616
|
-
* Per the `.agents/` standard (Section 9), this file is the canonical
|
|
3617
|
-
* provider-agnostic MCP server registry. It should be checked before
|
|
3618
|
-
* per-provider legacy config files.
|
|
3619
|
-
*
|
|
3620
|
-
* @remarks
|
|
3621
|
-
* The `.agents/mcp/servers.json` file uses a `{ "servers": { ... } }` structure
|
|
3622
|
-
* where each key is a server name. Entries returned from this function use
|
|
3623
|
-
* `providerId: ".agents"` and `providerName: ".agents/ standard"` to distinguish
|
|
3624
|
-
* them from per-provider legacy entries.
|
|
3625
|
-
*
|
|
3626
|
-
* @param scope - `"global"` for `~/.agents/mcp/servers.json`, `"project"` for project-level
|
|
3627
|
-
* @param projectDir - Project directory (defaults to `process.cwd()`)
|
|
3628
|
-
* @returns Array of MCP server entries found in the `.agents/` servers.json
|
|
3629
|
-
*
|
|
3630
|
-
* @example
|
|
3631
|
-
* ```typescript
|
|
3632
|
-
* const globalServers = await listAgentsMcpServers("global");
|
|
3633
|
-
* const projectServers = await listAgentsMcpServers("project", "/home/user/my-project");
|
|
3634
|
-
* console.log(`Found ${globalServers.length} global, ${projectServers.length} project servers`);
|
|
3635
|
-
* ```
|
|
3636
|
-
*
|
|
3637
|
-
* @public
|
|
3638
|
-
*/
|
|
3639
|
-
declare function listAgentsMcpServers(scope: 'project' | 'global', projectDir?: string): Promise<McpServerEntry[]>;
|
|
3640
|
-
/**
|
|
3641
|
-
* List MCP servers across all given providers, deduplicating by config path.
|
|
3642
|
-
*
|
|
3643
|
-
* Per the `.agents/` standard (Section 9.4), checks `.agents/mcp/servers.json`
|
|
3644
|
-
* first, then falls back to per-provider legacy config files. Multiple providers
|
|
3645
|
-
* may share the same config file; this function ensures each config file is read
|
|
3646
|
-
* only once to avoid duplicate entries.
|
|
3647
|
-
*
|
|
3648
|
-
* @remarks
|
|
3649
|
-
* The deduplication is path-based: if two providers share the same config file
|
|
3650
|
-
* (resolved to the same absolute path), it is read only once. The `.agents/`
|
|
3651
|
-
* standard location is always checked first and takes precedence.
|
|
3652
|
-
*
|
|
3653
|
-
* @param providers - Array of providers to query
|
|
3654
|
-
* @param scope - Whether to read project or global config
|
|
3655
|
-
* @param projectDir - Project directory (defaults to `process.cwd()`)
|
|
3656
|
-
* @returns Combined array of MCP server entries from all providers
|
|
3657
|
-
*
|
|
3658
|
-
* @example
|
|
3659
|
-
* ```typescript
|
|
3660
|
-
* const installed = getInstalledProviders();
|
|
3661
|
-
* const allServers = await listAllMcpServers(installed, "global", "/home/user/my-project");
|
|
3662
|
-
* console.log(`Found ${allServers.length} servers across all providers`);
|
|
3663
|
-
* ```
|
|
3664
|
-
*
|
|
3665
|
-
* @public
|
|
3666
|
-
*/
|
|
3667
|
-
declare function listAllMcpServers(providers: Provider[], scope: 'project' | 'global', projectDir?: string): Promise<McpServerEntry[]>;
|
|
3668
|
-
/**
|
|
3669
|
-
* Remove an MCP server entry from a provider's config file.
|
|
3670
|
-
*
|
|
3671
|
-
* @remarks
|
|
3672
|
-
* Delegates to the format-specific `removeConfig` handler. If the provider
|
|
3673
|
-
* does not have a config path for the requested scope, returns `false`
|
|
3674
|
-
* without modifying any files.
|
|
3675
|
-
*
|
|
3676
|
-
* @param provider - Provider whose config file to modify
|
|
3677
|
-
* @param serverName - Name/key of the MCP server to remove
|
|
3678
|
-
* @param scope - Whether to modify project or global config
|
|
3679
|
-
* @param projectDir - Project directory (defaults to `process.cwd()`)
|
|
3680
|
-
* @returns `true` if the entry was removed, `false` if no config path exists
|
|
3681
|
-
*
|
|
3682
|
-
* @example
|
|
3683
|
-
* ```typescript
|
|
3684
|
-
* const provider = getProvider("claude-code")!;
|
|
3685
|
-
* const removed = await removeMcpServer(provider, "my-server", "project", "/home/user/my-project");
|
|
3686
|
-
* ```
|
|
3687
|
-
*
|
|
3688
|
-
* @public
|
|
3689
|
-
*/
|
|
3690
|
-
declare function removeMcpServer(provider: Provider, serverName: string, scope: 'project' | 'global', projectDir?: string): Promise<boolean>;
|
|
3691
|
-
|
|
3692
|
-
/**
|
|
3693
|
-
* CLEO MCP lock reconciliation
|
|
3694
|
-
*
|
|
3695
|
-
* Infers lock metadata from live config entries and backfills
|
|
3696
|
-
* missing lock entries for CLEO servers installed before lock tracking.
|
|
3697
|
-
*/
|
|
3698
|
-
|
|
3699
|
-
/**
|
|
3700
|
-
* Lock metadata inferred from a live MCP config entry.
|
|
3701
|
-
*
|
|
3702
|
-
* @public
|
|
3703
|
-
*/
|
|
3704
|
-
interface InferredLockData {
|
|
3705
|
-
/** The source string (package name, command, or path). */
|
|
3706
|
-
source: string;
|
|
3707
|
-
/** Classified source type. */
|
|
3708
|
-
sourceType: SourceType;
|
|
3709
|
-
/** Inferred version string, if extractable from the config. @defaultValue undefined */
|
|
3710
|
-
version: string | undefined;
|
|
3711
|
-
}
|
|
3712
|
-
/**
|
|
3713
|
-
* Infer lock metadata from a live MCP config entry.
|
|
3714
|
-
*
|
|
3715
|
-
* Determines source, sourceType, and version by inspecting the command and args
|
|
3716
|
-
* of an existing CLEO MCP server config entry.
|
|
3717
|
-
*
|
|
3718
|
-
* @remarks
|
|
3719
|
-
* The inference logic checks three patterns in order: (1) if any argument
|
|
3720
|
-
* contains the CLEO npm package name, it is classified as a `"package"` source
|
|
3721
|
-
* with the version extracted from the package specifier; (2) if the channel is
|
|
3722
|
-
* `"dev"` or the command contains path separators, it is classified as a
|
|
3723
|
-
* `"command"` source; (3) otherwise, the full command + args string is used as
|
|
3724
|
-
* a `"command"` source.
|
|
3725
|
-
*
|
|
3726
|
-
* @param config - The raw config object from the provider's config file
|
|
3727
|
-
* @param channel - The resolved CLEO channel (`"stable"`, `"next"`, or `"dev"`)
|
|
3728
|
-
* @returns Inferred lock metadata with source, sourceType, and optional version
|
|
3729
|
-
*
|
|
3730
|
-
* @example
|
|
3731
|
-
* ```typescript
|
|
3732
|
-
* const data = inferCleoLockData(
|
|
3733
|
-
* { command: "npx", args: ["-y", "@cleocode/cleo-mcp@1.2.0"] },
|
|
3734
|
-
* "stable",
|
|
3735
|
-
* );
|
|
3736
|
-
* // { source: "@cleocode/cleo-mcp@1.2.0", sourceType: "package", version: "1.2.0" }
|
|
3737
|
-
* ```
|
|
3738
|
-
*
|
|
3739
|
-
* @public
|
|
3740
|
-
*/
|
|
3741
|
-
declare function inferCleoLockData(config: Record<string, unknown>, channel: CleoChannel): InferredLockData;
|
|
3742
|
-
/**
|
|
3743
|
-
* Options for the CLEO lock reconciliation process.
|
|
3744
|
-
*
|
|
3745
|
-
* @public
|
|
3746
|
-
*/
|
|
3747
|
-
interface ReconcileOptions {
|
|
3748
|
-
/** Specific provider IDs to scan (if omitted, scans all installed). @defaultValue undefined */
|
|
3749
|
-
providerIds?: string[];
|
|
3750
|
-
/** Whether to scan all providers. @defaultValue undefined */
|
|
3751
|
-
all?: boolean;
|
|
3752
|
-
/** Whether to scan global-scope configs. @defaultValue undefined */
|
|
3753
|
-
global?: boolean;
|
|
3754
|
-
/** Whether to scan project-scope configs. @defaultValue undefined */
|
|
3755
|
-
project?: boolean;
|
|
3756
|
-
/** Whether to remove orphaned lock entries not found in any live config. @defaultValue undefined */
|
|
3757
|
-
prune?: boolean;
|
|
3758
|
-
/** If true, report changes without writing to the lock file. @defaultValue undefined */
|
|
3759
|
-
dryRun?: boolean;
|
|
3760
|
-
}
|
|
3761
|
-
/**
|
|
3762
|
-
* Result of a CLEO lock reconciliation operation.
|
|
3763
|
-
*
|
|
3764
|
-
* @public
|
|
3765
|
-
*/
|
|
3766
|
-
interface ReconcileResult {
|
|
3767
|
-
/** Entries that were backfilled into the lock file. @defaultValue [] */
|
|
3768
|
-
backfilled: Array<{
|
|
3769
|
-
serverName: string;
|
|
3770
|
-
channel: CleoChannel;
|
|
3771
|
-
scope: 'project' | 'global';
|
|
3772
|
-
agents: string[];
|
|
3773
|
-
source: string;
|
|
3774
|
-
sourceType: SourceType;
|
|
3775
|
-
version: string | undefined;
|
|
3776
|
-
}>;
|
|
3777
|
-
/** Server names that were pruned from the lock file. */
|
|
3778
|
-
pruned: string[];
|
|
3779
|
-
/** Count of entries that were already tracked in the lock file. */
|
|
3780
|
-
alreadyTracked: number;
|
|
3781
|
-
/** Errors encountered during reconciliation. */
|
|
3782
|
-
errors: Array<{
|
|
3783
|
-
message: string;
|
|
3784
|
-
}>;
|
|
3785
|
-
}
|
|
3786
|
-
/**
|
|
3787
|
-
* Reconcile CLEO lock entries against live config.
|
|
3788
|
-
*
|
|
3789
|
-
* 1. Scans all providers x scopes for CLEO server entries
|
|
3790
|
-
* 2. Identifies entries not tracked in the lock file
|
|
3791
|
-
* 3. Backfills missing entries via recordMcpInstall
|
|
3792
|
-
* 4. Optionally prunes orphaned lock entries (in lock but not in any config)
|
|
3793
|
-
*
|
|
3794
|
-
* @remarks
|
|
3795
|
-
* This function bridges the gap between CLEO servers installed before lock
|
|
3796
|
-
* tracking was introduced and the current lock file state. It scans live
|
|
3797
|
-
* config files across all installed providers and requested scopes, infers
|
|
3798
|
-
* lock metadata from the config entries, and writes missing entries to the
|
|
3799
|
-
* lock file. When `prune` is enabled, it also removes lock entries for
|
|
3800
|
-
* CLEO servers that no longer appear in any live config.
|
|
3801
|
-
*
|
|
3802
|
-
* @param options - Reconciliation options controlling scope, providers, and behavior
|
|
3803
|
-
* @returns Reconciliation result with backfilled entries, pruned entries, and errors
|
|
3804
|
-
*
|
|
3805
|
-
* @example
|
|
3806
|
-
* ```typescript
|
|
3807
|
-
* const result = await reconcileCleoLock({ global: true, prune: true });
|
|
3808
|
-
* console.log(`Backfilled: ${result.backfilled.length}, Pruned: ${result.pruned.length}`);
|
|
3809
|
-
* ```
|
|
3810
|
-
*
|
|
3811
|
-
* @public
|
|
3812
|
-
*/
|
|
3813
|
-
declare function reconcileCleoLock(options?: ReconcileOptions): Promise<ReconcileResult>;
|
|
3814
|
-
|
|
3815
|
-
/**
|
|
3816
|
-
* Per-agent MCP config transformations
|
|
3817
|
-
*
|
|
3818
|
-
* Most agents use the canonical McpServerConfig directly.
|
|
3819
|
-
* These transforms handle agents with non-standard schemas.
|
|
3820
|
-
*/
|
|
3821
|
-
|
|
3822
|
-
/**
|
|
3823
|
-
* Get the config transform function for a provider, or `undefined` for passthrough.
|
|
3824
|
-
*
|
|
3825
|
-
* Providers with non-standard MCP config schemas (Goose, Zed, OpenCode, Codex, Cursor)
|
|
3826
|
-
* require transforms to convert the canonical {@link McpServerConfig} into their
|
|
3827
|
-
* provider-specific format.
|
|
3828
|
-
*
|
|
3829
|
-
* @remarks
|
|
3830
|
-
* Five of the 28+ supported providers use non-standard MCP config schemas.
|
|
3831
|
-
* This function acts as a registry of transform functions, returning `undefined`
|
|
3832
|
-
* for providers that accept the canonical format directly (the majority).
|
|
3833
|
-
* The returned function takes a server name and canonical config and produces
|
|
3834
|
-
* the provider-specific shape.
|
|
3835
|
-
*
|
|
3836
|
-
* @param providerId - Provider ID to look up (e.g. `"goose"`, `"zed"`)
|
|
3837
|
-
* @returns Transform function, or `undefined` if the provider uses the canonical format
|
|
3838
|
-
*
|
|
3839
|
-
* @example
|
|
3840
|
-
* ```typescript
|
|
3841
|
-
* const transform = getTransform("goose");
|
|
3842
|
-
* if (transform) {
|
|
3843
|
-
* const gooseConfig = transform("my-server", { command: "npx", args: ["-y", "@mcp/server"] });
|
|
3844
|
-
* }
|
|
3845
|
-
* ```
|
|
3846
|
-
*
|
|
3847
|
-
* @see {@link transformGoose}
|
|
3848
|
-
* @see {@link transformZed}
|
|
3849
|
-
*
|
|
3850
|
-
* @public
|
|
3851
|
-
*/
|
|
3852
|
-
declare function getTransform(providerId: string): ((name: string, config: McpServerConfig) => unknown) | undefined;
|
|
3853
|
-
|
|
3854
2817
|
/**
|
|
3855
2818
|
* Scope for path resolution, either global (user home) or project-local.
|
|
3856
2819
|
*
|
|
@@ -6700,4 +5663,4 @@ declare function parseSource(input: string): ParsedSource;
|
|
|
6700
5663
|
*/
|
|
6701
5664
|
declare function isMarketplaceScoped(input: string): boolean;
|
|
6702
5665
|
|
|
6703
|
-
export { type AuditFinding, type AuditResult, type AuditRule, type AuditSeverity, type BatchInstallOptions, type BatchInstallResult, CANONICAL_HOOK_EVENTS, type CaampLockFile, type CanonicalEventDefinition, type CanonicalHookEvent, type
|
|
5666
|
+
export { type AuditFinding, type AuditResult, type AuditRule, type AuditSeverity, type BatchInstallOptions, type BatchInstallResult, CANONICAL_HOOK_EVENTS, type CaampLockFile, type CanonicalEventDefinition, type CanonicalHookEvent, type ConfigFormat, type CrossProviderMatrix, type CtDispatchMatrix, type CtManifest, type CtManifestSkill, type CtProfileDefinition, type CtSkillEntry, type CtValidationIssue, type CtValidationResult, type DetectionCacheOptions, type DetectionResult, type EnsureProviderInstructionFileOptions, type EnsureProviderInstructionFileResult, type GlobalOptions, HOOK_CATEGORIES, type HookCategory, type HookEvent, type HookHandlerType, type HookMapping, type HookSupportResult, type HookSystemType, type InjectionCheckResult, type InjectionStatus, type InjectionTemplate, type InstructionUpdateSummary, type LockEntry, MarketplaceClient, type MarketplaceResult, type MarketplaceSearchResult, type MarketplaceSkill, type McpServerConfig, type McpServerEntry, type NormalizedHookEvent, type NormalizedRecommendationCriteria, type ParsedSource, type PlatformPaths, type Provider, type ProviderCapabilities, type ProviderHookProfile, type ProviderHookSummary, type ProviderHooksCapability, type ProviderPriority, type ProviderSkillsCapability, type ProviderSpawnCapability, type ProviderStatus, RECOMMENDATION_ERROR_CODES, type RankedSkillRecommendation, type RecommendSkillsResult, type RecommendationCriteriaInput, type RecommendationErrorCode, type RecommendationOptions, type RecommendationReason, type RecommendationReasonCode, type RecommendationScoreBreakdown, type RecommendationValidationIssue, type RecommendationValidationResult, type RecommendationWeights, type SkillBatchOperation, type SkillEntry, type SkillInstallResult, type SkillIntegrityResult, type SkillIntegrityStatus, type SkillLibrary, type SkillLibraryDispatchMatrix, type SkillLibraryEntry, type SkillLibraryManifest, type SkillLibraryManifestSkill, type SkillLibraryProfile, type SkillLibraryValidationIssue, type SkillLibraryValidationResult, type SkillMetadata, type SkillsPrecedence, type SourceType, type SpawnAdapter, type SpawnMechanism, type SpawnOptions, type SpawnResult, type SystemInfo, type TransportType, type ValidationIssue, type ValidationResult, _resetPlatformPathsCache, buildHookMatrix, buildInjectionContent, buildLibraryFromFiles, buildSkillsMap, catalog, checkAllInjections, checkAllSkillIntegrity, checkAllSkillUpdates, checkInjection, checkSkillIntegrity, checkSkillUpdate, clearRegisteredLibrary, deepMerge, detectAllProviders, detectProjectProviders, detectProvider, discoverSkill, discoverSkills, ensureAllProviderInstructionFiles, ensureDir, ensureProviderInstructionFile, formatSkillRecommendations, generateInjectionContent, generateSkillsSection, getAgentsConfigPath, getAgentsHome, getAgentsInstructFile, getAgentsLinksDir, getAgentsMcpDir, getAgentsMcpServersPath, getAgentsSpecDir, getAgentsWikiDir, getAllCanonicalEvents, getAllProviders, getCanonicalEvent, getCanonicalEventsByCategory, getCanonicalSkillsDir, getCommonEvents, getCommonHookEvents, getEffectiveSkillsPaths, getHookConfigPath, getHookMappingsVersion, getHookSupport, getHookSystemType, getInstalledProviders, getInstructionFiles, getLockFilePath, getMappedProviderIds, getNestedValue, getPlatformLocations, getPlatformPaths, getProjectAgentsDir, getProvider, getProviderCapabilities, getProviderCount, getProviderHookProfile, getProviderOnlyEvents, getProviderSummary, getProvidersByHookEvent, getProvidersByInstructFile, getProvidersByPriority, getProvidersBySkillsPrecedence, getProvidersBySpawnCapability, getProvidersByStatus, getProvidersForEvent, getRegistryVersion, getSpawnCapableProviders, getSupportedEvents, getSystemInfo, getTrackedSkills, getUnsupportedEvents, groupByInstructFile, inject, injectAll, installBatchWithRollback, installSkill, isCaampOwnedSkill, isMarketplaceScoped, isQuiet, isVerbose, listCanonicalSkills, loadLibraryFromModule, normalizeRecommendationCriteria, parseInjectionContent, parseSkillFile, parseSource, providerSupports, providerSupportsById, rankSkills, readConfig, recommendSkills, recordSkillInstall, registerSkillLibrary, registerSkillLibraryFromPath, removeConfig, removeInjection, removeSkill, removeSkillFromLock, resetDetectionCache, resolveAlias, resolveNativeEvent, resolveProviderSkillsDirs, resolveRegistryTemplatePath, scanDirectory, scanFile, scoreSkillRecommendation, searchSkills, selectProvidersByMinimumPriority, setQuiet, setVerbose, shouldOverrideSkill, supportsHook, toCanonical, toNative, toNativeBatch, toSarif, tokenizeCriteriaValue, translateToAll, updateInstructionsSingleOperation, validateInstructionIntegrity, validateRecommendationCriteria, validateSkill, writeConfig };
|