@cleocode/caamp 0.3.0 → 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 +18 -2
- package/dist/{chunk-PCWTRJV2.js → chunk-6HQDRJLS.js} +1135 -172
- package/dist/chunk-6HQDRJLS.js.map +1 -0
- package/dist/cli.js +966 -50
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +330 -40
- package/dist/index.js +45 -1
- package/package.json +7 -3
- package/dist/chunk-PCWTRJV2.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ type TransportType = "stdio" | "sse" | "http";
|
|
|
34
34
|
*
|
|
35
35
|
* - `"binary"` - Check if a CLI binary exists on PATH
|
|
36
36
|
* - `"directory"` - Check if known config/data directories exist
|
|
37
|
-
* - `"appBundle"` - Check for macOS .app bundle in
|
|
37
|
+
* - `"appBundle"` - Check for macOS .app bundle in standard app directories
|
|
38
38
|
* - `"flatpak"` - Check for Flatpak installation on Linux
|
|
39
39
|
*/
|
|
40
40
|
type DetectionMethod = "binary" | "directory" | "appBundle" | "flatpak";
|
|
@@ -245,10 +245,13 @@ interface SkillMetadata {
|
|
|
245
245
|
*
|
|
246
246
|
* @example
|
|
247
247
|
* ```typescript
|
|
248
|
+
* import { getCanonicalSkillsDir } from "./core/paths/standard.js";
|
|
249
|
+
* import { join } from "node:path";
|
|
250
|
+
*
|
|
248
251
|
* const entry: SkillEntry = {
|
|
249
252
|
* name: "my-skill",
|
|
250
253
|
* scopedName: "my-skill",
|
|
251
|
-
* path: "
|
|
254
|
+
* path: join(getCanonicalSkillsDir(), "my-skill"),
|
|
252
255
|
* metadata: { name: "my-skill", description: "A skill" },
|
|
253
256
|
* };
|
|
254
257
|
* ```
|
|
@@ -270,6 +273,9 @@ interface SkillEntry {
|
|
|
270
273
|
*
|
|
271
274
|
* @example
|
|
272
275
|
* ```typescript
|
|
276
|
+
* import { getCanonicalSkillsDir } from "./core/paths/standard.js";
|
|
277
|
+
* import { join } from "node:path";
|
|
278
|
+
*
|
|
273
279
|
* const entry: LockEntry = {
|
|
274
280
|
* name: "my-skill",
|
|
275
281
|
* scopedName: "my-skill",
|
|
@@ -277,7 +283,7 @@ interface SkillEntry {
|
|
|
277
283
|
* sourceType: "github",
|
|
278
284
|
* installedAt: "2025-01-15T10:30:00.000Z",
|
|
279
285
|
* agents: ["claude-code", "cursor"],
|
|
280
|
-
* canonicalPath: "
|
|
286
|
+
* canonicalPath: join(getCanonicalSkillsDir(), "my-skill"),
|
|
281
287
|
* isGlobal: true,
|
|
282
288
|
* };
|
|
283
289
|
* ```
|
|
@@ -307,7 +313,7 @@ interface LockEntry {
|
|
|
307
313
|
projectDir?: string;
|
|
308
314
|
}
|
|
309
315
|
/**
|
|
310
|
-
* The CAAMP lock file structure, stored at
|
|
316
|
+
* The CAAMP lock file structure, stored at the resolved canonical lock path.
|
|
311
317
|
*
|
|
312
318
|
* Tracks all installed skills and MCP servers along with their sources,
|
|
313
319
|
* versions, and linked agents.
|
|
@@ -532,7 +538,7 @@ interface InjectionCheckResult {
|
|
|
532
538
|
* providerId: "claude-code",
|
|
533
539
|
* providerName: "Claude Code",
|
|
534
540
|
* scope: "project",
|
|
535
|
-
* configPath: "/project
|
|
541
|
+
* configPath: "/project/<provider-project-config>",
|
|
536
542
|
* config: { command: "npx", args: ["-y", "@mcp/server-filesystem"] },
|
|
537
543
|
* };
|
|
538
544
|
* ```
|
|
@@ -610,6 +616,10 @@ interface DetectionResult {
|
|
|
610
616
|
/** Whether the provider has project-level config in the current directory. */
|
|
611
617
|
projectDetected: boolean;
|
|
612
618
|
}
|
|
619
|
+
interface DetectionCacheOptions {
|
|
620
|
+
forceRefresh?: boolean;
|
|
621
|
+
ttlMs?: number;
|
|
622
|
+
}
|
|
613
623
|
/**
|
|
614
624
|
* Detect if a single provider is installed on the system.
|
|
615
625
|
*
|
|
@@ -643,7 +653,7 @@ declare function detectProvider(provider: Provider): DetectionResult;
|
|
|
643
653
|
* console.log(`${installed.length} agents detected`);
|
|
644
654
|
* ```
|
|
645
655
|
*/
|
|
646
|
-
declare function detectAllProviders(): DetectionResult[];
|
|
656
|
+
declare function detectAllProviders(options?: DetectionCacheOptions): DetectionResult[];
|
|
647
657
|
/**
|
|
648
658
|
* Get only providers that are currently installed on the system.
|
|
649
659
|
*
|
|
@@ -658,7 +668,7 @@ declare function detectAllProviders(): DetectionResult[];
|
|
|
658
668
|
* console.log(installed.map(p => p.toolName).join(", "));
|
|
659
669
|
* ```
|
|
660
670
|
*/
|
|
661
|
-
declare function getInstalledProviders(): Provider[];
|
|
671
|
+
declare function getInstalledProviders(options?: DetectionCacheOptions): Provider[];
|
|
662
672
|
/**
|
|
663
673
|
* Detect all providers and enrich results with project-level presence.
|
|
664
674
|
*
|
|
@@ -678,7 +688,8 @@ declare function getInstalledProviders(): Provider[];
|
|
|
678
688
|
* }
|
|
679
689
|
* ```
|
|
680
690
|
*/
|
|
681
|
-
declare function detectProjectProviders(projectDir: string): DetectionResult[];
|
|
691
|
+
declare function detectProjectProviders(projectDir: string, options?: DetectionCacheOptions): DetectionResult[];
|
|
692
|
+
declare function resetDetectionCache(): void;
|
|
682
693
|
|
|
683
694
|
/**
|
|
684
695
|
* MCP config installer
|
|
@@ -814,7 +825,7 @@ interface SkillInstallResult {
|
|
|
814
825
|
/**
|
|
815
826
|
* Install a skill from a local path to the canonical location and link to agents.
|
|
816
827
|
*
|
|
817
|
-
* Copies the skill directory to
|
|
828
|
+
* Copies the skill directory to the canonical skills directory and creates symlinks
|
|
818
829
|
* (or copies on Windows) from each provider's skills directory to the canonical path.
|
|
819
830
|
*
|
|
820
831
|
* @param sourcePath - Local path to the skill directory to install
|
|
@@ -834,7 +845,7 @@ declare function installSkill(sourcePath: string, skillName: string, providers:
|
|
|
834
845
|
* Remove a skill from the canonical location and all agent symlinks.
|
|
835
846
|
*
|
|
836
847
|
* Removes symlinks from each provider's skills directory and then removes the
|
|
837
|
-
* canonical copy from
|
|
848
|
+
* canonical copy from the centralized canonical skills directory.
|
|
838
849
|
*
|
|
839
850
|
* @param skillName - Name of the skill to remove
|
|
840
851
|
* @param providers - Providers to unlink the skill from
|
|
@@ -852,7 +863,7 @@ declare function removeSkill(skillName: string, providers: Provider[], isGlobal:
|
|
|
852
863
|
errors: string[];
|
|
853
864
|
}>;
|
|
854
865
|
/**
|
|
855
|
-
* List all skills installed in the canonical directory
|
|
866
|
+
* List all skills installed in the canonical skills directory.
|
|
856
867
|
*
|
|
857
868
|
* Returns the directory names of all skills, which correspond to skill names.
|
|
858
869
|
*
|
|
@@ -930,6 +941,267 @@ interface ValidationResult {
|
|
|
930
941
|
*/
|
|
931
942
|
declare function validateSkill(filePath: string): Promise<ValidationResult>;
|
|
932
943
|
|
|
944
|
+
/**
|
|
945
|
+
* Marketplace types shared between adapters
|
|
946
|
+
*/
|
|
947
|
+
interface MarketplaceAdapter {
|
|
948
|
+
name: string;
|
|
949
|
+
search(query: string, limit?: number): Promise<MarketplaceResult[]>;
|
|
950
|
+
getSkill(scopedName: string): Promise<MarketplaceResult | null>;
|
|
951
|
+
}
|
|
952
|
+
interface MarketplaceResult {
|
|
953
|
+
name: string;
|
|
954
|
+
scopedName: string;
|
|
955
|
+
description: string;
|
|
956
|
+
author: string;
|
|
957
|
+
stars: number;
|
|
958
|
+
githubUrl: string;
|
|
959
|
+
repoFullName: string;
|
|
960
|
+
path: string;
|
|
961
|
+
source: string;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
declare const RECOMMENDATION_ERROR_CODES: {
|
|
965
|
+
readonly QUERY_INVALID: "E_SKILLS_QUERY_INVALID";
|
|
966
|
+
readonly NO_MATCHES: "E_SKILLS_NO_MATCHES";
|
|
967
|
+
readonly SOURCE_UNAVAILABLE: "E_SKILLS_SOURCE_UNAVAILABLE";
|
|
968
|
+
readonly CRITERIA_CONFLICT: "E_SKILLS_CRITERIA_CONFLICT";
|
|
969
|
+
};
|
|
970
|
+
type RecommendationErrorCode = (typeof RECOMMENDATION_ERROR_CODES)[keyof typeof RECOMMENDATION_ERROR_CODES];
|
|
971
|
+
interface RecommendationValidationIssue {
|
|
972
|
+
code: RecommendationErrorCode;
|
|
973
|
+
field: "query" | "mustHave" | "prefer" | "exclude";
|
|
974
|
+
message: string;
|
|
975
|
+
}
|
|
976
|
+
interface RecommendationValidationResult {
|
|
977
|
+
valid: boolean;
|
|
978
|
+
issues: RecommendationValidationIssue[];
|
|
979
|
+
}
|
|
980
|
+
interface RecommendationCriteriaInput {
|
|
981
|
+
query?: string;
|
|
982
|
+
mustHave?: string | string[];
|
|
983
|
+
prefer?: string | string[];
|
|
984
|
+
exclude?: string | string[];
|
|
985
|
+
}
|
|
986
|
+
interface NormalizedRecommendationCriteria {
|
|
987
|
+
query: string;
|
|
988
|
+
queryTokens: string[];
|
|
989
|
+
mustHave: string[];
|
|
990
|
+
prefer: string[];
|
|
991
|
+
exclude: string[];
|
|
992
|
+
}
|
|
993
|
+
type RecommendationReasonCode = "MATCH_TOPIC_GITBOOK" | "HAS_GIT_SYNC" | "HAS_API_WORKFLOW" | "PENALTY_LEGACY_CLI" | "MUST_HAVE_MATCH" | "MISSING_MUST_HAVE" | "PREFER_MATCH" | "QUERY_MATCH" | "STAR_SIGNAL" | "METADATA_SIGNAL" | "MODERN_MARKER" | "LEGACY_MARKER" | "EXCLUDE_MATCH";
|
|
994
|
+
interface RecommendationReason {
|
|
995
|
+
code: RecommendationReasonCode;
|
|
996
|
+
detail?: string;
|
|
997
|
+
}
|
|
998
|
+
interface RecommendationScoreBreakdown {
|
|
999
|
+
mustHave: number;
|
|
1000
|
+
prefer: number;
|
|
1001
|
+
query: number;
|
|
1002
|
+
stars: number;
|
|
1003
|
+
metadata: number;
|
|
1004
|
+
modernity: number;
|
|
1005
|
+
exclusionPenalty: number;
|
|
1006
|
+
total: number;
|
|
1007
|
+
}
|
|
1008
|
+
interface RankedSkillRecommendation {
|
|
1009
|
+
skill: MarketplaceResult;
|
|
1010
|
+
score: number;
|
|
1011
|
+
reasons: RecommendationReason[];
|
|
1012
|
+
tradeoffs: string[];
|
|
1013
|
+
excluded: boolean;
|
|
1014
|
+
breakdown?: RecommendationScoreBreakdown;
|
|
1015
|
+
}
|
|
1016
|
+
interface RecommendationOptions {
|
|
1017
|
+
top?: number;
|
|
1018
|
+
includeDetails?: boolean;
|
|
1019
|
+
weights?: Partial<RecommendationWeights>;
|
|
1020
|
+
modernMarkers?: string[];
|
|
1021
|
+
legacyMarkers?: string[];
|
|
1022
|
+
}
|
|
1023
|
+
interface RecommendationWeights {
|
|
1024
|
+
mustHaveMatch: number;
|
|
1025
|
+
preferMatch: number;
|
|
1026
|
+
queryTokenMatch: number;
|
|
1027
|
+
starsFactor: number;
|
|
1028
|
+
metadataBoost: number;
|
|
1029
|
+
modernMarkerBoost: number;
|
|
1030
|
+
legacyMarkerPenalty: number;
|
|
1031
|
+
excludePenalty: number;
|
|
1032
|
+
missingMustHavePenalty: number;
|
|
1033
|
+
}
|
|
1034
|
+
interface RecommendSkillsResult {
|
|
1035
|
+
criteria: NormalizedRecommendationCriteria;
|
|
1036
|
+
ranking: RankedSkillRecommendation[];
|
|
1037
|
+
}
|
|
1038
|
+
declare function tokenizeCriteriaValue(value: string): string[];
|
|
1039
|
+
declare function validateRecommendationCriteria(input: RecommendationCriteriaInput): RecommendationValidationResult;
|
|
1040
|
+
declare function normalizeRecommendationCriteria(input: RecommendationCriteriaInput): NormalizedRecommendationCriteria;
|
|
1041
|
+
declare function scoreSkillRecommendation(skill: MarketplaceResult, criteria: NormalizedRecommendationCriteria, options?: RecommendationOptions): RankedSkillRecommendation;
|
|
1042
|
+
declare function recommendSkills$1(skills: MarketplaceResult[], criteriaInput: RecommendationCriteriaInput, options?: RecommendationOptions): RecommendSkillsResult;
|
|
1043
|
+
declare const rankSkills: typeof recommendSkills$1;
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* Advanced orchestration helpers for multi-provider operations.
|
|
1047
|
+
*
|
|
1048
|
+
* These helpers compose CAAMP's lower-level APIs into production patterns:
|
|
1049
|
+
* tier-based targeting, conflict-aware installs, and rollback-capable batches.
|
|
1050
|
+
*/
|
|
1051
|
+
|
|
1052
|
+
type Scope = "project" | "global";
|
|
1053
|
+
/**
|
|
1054
|
+
* Filter providers by minimum priority and return them in deterministic tier order.
|
|
1055
|
+
*
|
|
1056
|
+
* `minimumPriority = "medium"` returns `high` + `medium`.
|
|
1057
|
+
*/
|
|
1058
|
+
declare function selectProvidersByMinimumPriority(providers: Provider[], minimumPriority?: ProviderPriority): Provider[];
|
|
1059
|
+
/**
|
|
1060
|
+
* Single MCP operation entry used by batch orchestration.
|
|
1061
|
+
*/
|
|
1062
|
+
interface McpBatchOperation {
|
|
1063
|
+
serverName: string;
|
|
1064
|
+
config: McpServerConfig;
|
|
1065
|
+
scope?: Scope;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Single skill operation entry used by batch orchestration.
|
|
1069
|
+
*/
|
|
1070
|
+
interface SkillBatchOperation {
|
|
1071
|
+
sourcePath: string;
|
|
1072
|
+
skillName: string;
|
|
1073
|
+
isGlobal?: boolean;
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Options for rollback-capable batch installation.
|
|
1077
|
+
*/
|
|
1078
|
+
interface BatchInstallOptions {
|
|
1079
|
+
providers?: Provider[];
|
|
1080
|
+
minimumPriority?: ProviderPriority;
|
|
1081
|
+
mcp?: McpBatchOperation[];
|
|
1082
|
+
skills?: SkillBatchOperation[];
|
|
1083
|
+
projectDir?: string;
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Result of rollback-capable batch installation.
|
|
1087
|
+
*/
|
|
1088
|
+
interface BatchInstallResult {
|
|
1089
|
+
success: boolean;
|
|
1090
|
+
providerIds: string[];
|
|
1091
|
+
mcpApplied: number;
|
|
1092
|
+
skillsApplied: number;
|
|
1093
|
+
rollbackPerformed: boolean;
|
|
1094
|
+
rollbackErrors: string[];
|
|
1095
|
+
error?: string;
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Install multiple MCP servers and skills across filtered providers with rollback.
|
|
1099
|
+
*
|
|
1100
|
+
* Rollback behavior:
|
|
1101
|
+
* - MCP config files are restored exactly from snapshots.
|
|
1102
|
+
* - Skill state is restored for canonical skill dirs and targeted provider link paths.
|
|
1103
|
+
*/
|
|
1104
|
+
declare function installBatchWithRollback(options: BatchInstallOptions): Promise<BatchInstallResult>;
|
|
1105
|
+
/**
|
|
1106
|
+
* Conflict policy when applying MCP install plans.
|
|
1107
|
+
*/
|
|
1108
|
+
type ConflictPolicy = "fail" | "skip" | "overwrite";
|
|
1109
|
+
/**
|
|
1110
|
+
* MCP conflict code.
|
|
1111
|
+
*/
|
|
1112
|
+
type McpConflictCode = "unsupported-transport" | "unsupported-headers" | "existing-mismatch";
|
|
1113
|
+
/**
|
|
1114
|
+
* Conflict detected during preflight.
|
|
1115
|
+
*/
|
|
1116
|
+
interface McpConflict {
|
|
1117
|
+
providerId: string;
|
|
1118
|
+
serverName: string;
|
|
1119
|
+
scope: Scope;
|
|
1120
|
+
code: McpConflictCode;
|
|
1121
|
+
message: string;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Result from applying install plan with conflict policy.
|
|
1125
|
+
*/
|
|
1126
|
+
interface McpPlanApplyResult {
|
|
1127
|
+
conflicts: McpConflict[];
|
|
1128
|
+
applied: InstallResult[];
|
|
1129
|
+
skipped: Array<{
|
|
1130
|
+
providerId: string;
|
|
1131
|
+
serverName: string;
|
|
1132
|
+
scope: Scope;
|
|
1133
|
+
reason: McpConflictCode;
|
|
1134
|
+
}>;
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Preflight conflict detection for MCP install plans across providers.
|
|
1138
|
+
*/
|
|
1139
|
+
declare function detectMcpConfigConflicts(providers: Provider[], operations: McpBatchOperation[], projectDir?: string): Promise<McpConflict[]>;
|
|
1140
|
+
/**
|
|
1141
|
+
* Apply MCP install plan with a conflict policy.
|
|
1142
|
+
*/
|
|
1143
|
+
declare function applyMcpInstallWithPolicy(providers: Provider[], operations: McpBatchOperation[], policy?: ConflictPolicy, projectDir?: string): Promise<McpPlanApplyResult>;
|
|
1144
|
+
/**
|
|
1145
|
+
* Result of a single-operation instruction update across providers.
|
|
1146
|
+
*/
|
|
1147
|
+
interface InstructionUpdateSummary {
|
|
1148
|
+
scope: Scope;
|
|
1149
|
+
updatedFiles: number;
|
|
1150
|
+
actions: Array<{
|
|
1151
|
+
file: string;
|
|
1152
|
+
action: "created" | "added" | "updated";
|
|
1153
|
+
providers: string[];
|
|
1154
|
+
configFormats: ConfigFormat[];
|
|
1155
|
+
}>;
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* Update instruction files across providers as a single operation.
|
|
1159
|
+
*
|
|
1160
|
+
* Works the same regardless of provider config format (JSON/YAML/TOML/JSONC)
|
|
1161
|
+
* because instruction files are handled through CAAMP markers.
|
|
1162
|
+
*/
|
|
1163
|
+
declare function updateInstructionsSingleOperation(providers: Provider[], content: string, scope?: Scope, projectDir?: string): Promise<InstructionUpdateSummary>;
|
|
1164
|
+
/**
|
|
1165
|
+
* Request payload for dual-scope provider configuration.
|
|
1166
|
+
*/
|
|
1167
|
+
interface DualScopeConfigureOptions {
|
|
1168
|
+
globalMcp?: Array<{
|
|
1169
|
+
serverName: string;
|
|
1170
|
+
config: McpServerConfig;
|
|
1171
|
+
}>;
|
|
1172
|
+
projectMcp?: Array<{
|
|
1173
|
+
serverName: string;
|
|
1174
|
+
config: McpServerConfig;
|
|
1175
|
+
}>;
|
|
1176
|
+
instructionContent?: string | {
|
|
1177
|
+
global?: string;
|
|
1178
|
+
project?: string;
|
|
1179
|
+
};
|
|
1180
|
+
projectDir?: string;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* Result of dual-scope provider configuration.
|
|
1184
|
+
*/
|
|
1185
|
+
interface DualScopeConfigureResult {
|
|
1186
|
+
providerId: string;
|
|
1187
|
+
configPaths: {
|
|
1188
|
+
global: string | null;
|
|
1189
|
+
project: string | null;
|
|
1190
|
+
};
|
|
1191
|
+
mcp: {
|
|
1192
|
+
global: InstallResult[];
|
|
1193
|
+
project: InstallResult[];
|
|
1194
|
+
};
|
|
1195
|
+
instructions: {
|
|
1196
|
+
global?: Map<string, "created" | "added" | "updated">;
|
|
1197
|
+
project?: Map<string, "created" | "added" | "updated">;
|
|
1198
|
+
};
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Configure both global and project-level settings for one provider in one call.
|
|
1202
|
+
*/
|
|
1203
|
+
declare function configureProviderGlobalAndProject(provider: Provider, options: DualScopeConfigureOptions): Promise<DualScopeConfigureResult>;
|
|
1204
|
+
|
|
933
1205
|
/**
|
|
934
1206
|
* Provider registry loader
|
|
935
1207
|
*
|
|
@@ -1054,6 +1326,21 @@ declare function getProviderCount(): number;
|
|
|
1054
1326
|
*/
|
|
1055
1327
|
declare function getRegistryVersion(): string;
|
|
1056
1328
|
|
|
1329
|
+
interface PlatformLocations {
|
|
1330
|
+
home: string;
|
|
1331
|
+
config: string;
|
|
1332
|
+
vscodeConfig: string;
|
|
1333
|
+
zedConfig: string;
|
|
1334
|
+
claudeDesktopConfig: string;
|
|
1335
|
+
applications: string[];
|
|
1336
|
+
}
|
|
1337
|
+
declare function getPlatformLocations(): PlatformLocations;
|
|
1338
|
+
declare function getAgentsHome(): string;
|
|
1339
|
+
declare function getProjectAgentsDir(projectRoot?: string): string;
|
|
1340
|
+
declare function getCanonicalSkillsDir(): string;
|
|
1341
|
+
declare function getLockFilePath(): string;
|
|
1342
|
+
declare function resolveRegistryTemplatePath(template: string): string;
|
|
1343
|
+
|
|
1057
1344
|
/**
|
|
1058
1345
|
* Source URL/path classifier
|
|
1059
1346
|
*
|
|
@@ -1134,7 +1421,10 @@ declare function parseSkillFile(filePath: string): Promise<SkillMetadata | null>
|
|
|
1134
1421
|
*
|
|
1135
1422
|
* @example
|
|
1136
1423
|
* ```typescript
|
|
1137
|
-
*
|
|
1424
|
+
* import { getCanonicalSkillsDir } from "../paths/standard.js";
|
|
1425
|
+
* import { join } from "node:path";
|
|
1426
|
+
*
|
|
1427
|
+
* const skill = await discoverSkill(join(getCanonicalSkillsDir(), "my-skill"));
|
|
1138
1428
|
* if (skill) {
|
|
1139
1429
|
* console.log(`Found: ${skill.name}`);
|
|
1140
1430
|
* }
|
|
@@ -1152,12 +1442,27 @@ declare function discoverSkill(skillDir: string): Promise<SkillEntry | null>;
|
|
|
1152
1442
|
*
|
|
1153
1443
|
* @example
|
|
1154
1444
|
* ```typescript
|
|
1155
|
-
*
|
|
1445
|
+
* import { getCanonicalSkillsDir } from "../paths/standard.js";
|
|
1446
|
+
*
|
|
1447
|
+
* const skills = await discoverSkills(getCanonicalSkillsDir());
|
|
1156
1448
|
* console.log(`Found ${skills.length} skills`);
|
|
1157
1449
|
* ```
|
|
1158
1450
|
*/
|
|
1159
1451
|
declare function discoverSkills(rootDir: string): Promise<SkillEntry[]>;
|
|
1160
1452
|
|
|
1453
|
+
interface SearchSkillsOptions {
|
|
1454
|
+
limit?: number;
|
|
1455
|
+
}
|
|
1456
|
+
interface RecommendSkillsQueryOptions extends RecommendationOptions {
|
|
1457
|
+
limit?: number;
|
|
1458
|
+
}
|
|
1459
|
+
declare function formatSkillRecommendations(result: RecommendSkillsResult, opts: {
|
|
1460
|
+
mode: "human" | "json";
|
|
1461
|
+
details?: boolean;
|
|
1462
|
+
}): string | Record<string, unknown>;
|
|
1463
|
+
declare function searchSkills(query: string, options?: SearchSkillsOptions): Promise<MarketplaceResult[]>;
|
|
1464
|
+
declare function recommendSkills(query: string, criteria: Omit<RecommendationCriteriaInput, "query">, options?: RecommendSkillsQueryOptions): Promise<RecommendSkillsResult>;
|
|
1465
|
+
|
|
1161
1466
|
/**
|
|
1162
1467
|
* Security scanning engine for SKILL.md files
|
|
1163
1468
|
*
|
|
@@ -1193,7 +1498,9 @@ declare function scanFile(filePath: string, rules?: AuditRule[]): Promise<AuditR
|
|
|
1193
1498
|
*
|
|
1194
1499
|
* @example
|
|
1195
1500
|
* ```typescript
|
|
1196
|
-
*
|
|
1501
|
+
* import { getCanonicalSkillsDir } from "../../paths/standard.js";
|
|
1502
|
+
*
|
|
1503
|
+
* const results = await scanDirectory(getCanonicalSkillsDir());
|
|
1197
1504
|
* const failing = results.filter(r => !r.passed);
|
|
1198
1505
|
* ```
|
|
1199
1506
|
*/
|
|
@@ -1264,7 +1571,7 @@ declare function getTransform(providerId: string): ((name: string, config: McpSe
|
|
|
1264
1571
|
* @example
|
|
1265
1572
|
* ```typescript
|
|
1266
1573
|
* const path = resolveConfigPath(provider, "project", "/home/user/my-project");
|
|
1267
|
-
* //
|
|
1574
|
+
* // Returns provider-specific project config path
|
|
1268
1575
|
* ```
|
|
1269
1576
|
*/
|
|
1270
1577
|
declare function resolveConfigPath(provider: Provider, scope: "project" | "global", projectDir?: string): string | null;
|
|
@@ -1324,7 +1631,7 @@ declare function removeMcpServer(provider: Provider, serverName: string, scope:
|
|
|
1324
1631
|
/**
|
|
1325
1632
|
* Shared lock file utilities
|
|
1326
1633
|
*
|
|
1327
|
-
* Single source of truth for reading/writing
|
|
1634
|
+
* Single source of truth for reading/writing the canonical CAAMP lock file path.
|
|
1328
1635
|
* Both MCP and skills lock modules import from here.
|
|
1329
1636
|
*/
|
|
1330
1637
|
|
|
@@ -1335,7 +1642,7 @@ declare function readLockFile(): Promise<CaampLockFile>;
|
|
|
1335
1642
|
* MCP lock file management
|
|
1336
1643
|
*
|
|
1337
1644
|
* Tracks installed MCP servers with source and agent metadata.
|
|
1338
|
-
* Stored
|
|
1645
|
+
* Stored in the canonical CAAMP lock file (shared with skills lock).
|
|
1339
1646
|
*/
|
|
1340
1647
|
|
|
1341
1648
|
/**
|
|
@@ -1411,7 +1718,7 @@ declare function getLastSelectedAgents(): Promise<string[] | undefined>;
|
|
|
1411
1718
|
/**
|
|
1412
1719
|
* Skills lock file management
|
|
1413
1720
|
*
|
|
1414
|
-
* Shares the same lock file as MCP
|
|
1721
|
+
* Shares the same canonical lock file as MCP.
|
|
1415
1722
|
*/
|
|
1416
1723
|
|
|
1417
1724
|
/**
|
|
@@ -1432,9 +1739,12 @@ declare function getLastSelectedAgents(): Promise<string[] | undefined>;
|
|
|
1432
1739
|
*
|
|
1433
1740
|
* @example
|
|
1434
1741
|
* ```typescript
|
|
1742
|
+
* import { getCanonicalSkillsDir } from "../paths/standard.js";
|
|
1743
|
+
* import { join } from "node:path";
|
|
1744
|
+
*
|
|
1435
1745
|
* await recordSkillInstall(
|
|
1436
1746
|
* "my-skill", "my-skill", "owner/repo", "github",
|
|
1437
|
-
* ["claude-code"], "
|
|
1747
|
+
* ["claude-code"], join(getCanonicalSkillsDir(), "my-skill"), true,
|
|
1438
1748
|
* );
|
|
1439
1749
|
* ```
|
|
1440
1750
|
*/
|
|
@@ -1490,26 +1800,6 @@ declare function checkSkillUpdate(skillName: string): Promise<{
|
|
|
1490
1800
|
status: "up-to-date" | "update-available" | "unknown";
|
|
1491
1801
|
}>;
|
|
1492
1802
|
|
|
1493
|
-
/**
|
|
1494
|
-
* Marketplace types shared between adapters
|
|
1495
|
-
*/
|
|
1496
|
-
interface MarketplaceAdapter {
|
|
1497
|
-
name: string;
|
|
1498
|
-
search(query: string, limit?: number): Promise<MarketplaceResult[]>;
|
|
1499
|
-
getSkill(scopedName: string): Promise<MarketplaceResult | null>;
|
|
1500
|
-
}
|
|
1501
|
-
interface MarketplaceResult {
|
|
1502
|
-
name: string;
|
|
1503
|
-
scopedName: string;
|
|
1504
|
-
description: string;
|
|
1505
|
-
author: string;
|
|
1506
|
-
stars: number;
|
|
1507
|
-
githubUrl: string;
|
|
1508
|
-
repoFullName: string;
|
|
1509
|
-
path: string;
|
|
1510
|
-
source: string;
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
1803
|
/**
|
|
1514
1804
|
* Unified marketplace client
|
|
1515
1805
|
*
|
|
@@ -1893,4 +2183,4 @@ declare function isVerbose(): boolean;
|
|
|
1893
2183
|
*/
|
|
1894
2184
|
declare function isQuiet(): boolean;
|
|
1895
2185
|
|
|
1896
|
-
export { type AuditFinding, type AuditResult, type AuditRule, type AuditSeverity, type CaampLockFile, type ConfigFormat, type DetectionResult, type GlobalOptions, type InjectionCheckResult, type InjectionStatus, type InstallResult, type LockEntry, MarketplaceClient, type MarketplaceResult, type MarketplaceSearchResult, type MarketplaceSkill, type McpServerConfig, type McpServerEntry, type ParsedSource, type Provider, type ProviderPriority, type ProviderStatus, type SkillEntry, type SkillInstallResult, type SkillMetadata, type SourceType, type TransportType, type ValidationIssue, type ValidationResult, buildServerConfig, checkAllInjections, checkInjection, checkSkillUpdate, deepMerge, detectAllProviders, detectProjectProviders, detectProvider, discoverSkill, discoverSkills, ensureDir, generateInjectionContent, getAllProviders, getInstalledProviders, getInstructionFiles, getLastSelectedAgents, getNestedValue, getProvider, getProviderCount, getProvidersByInstructFile, getProvidersByPriority, getProvidersByStatus, getRegistryVersion, getTrackedMcpServers, getTrackedSkills, getTransform, groupByInstructFile, inject, injectAll, installMcpServer, installMcpServerToAll, installSkill, isMarketplaceScoped, isQuiet, isVerbose, listAllMcpServers, listCanonicalSkills, listMcpServers, parseSkillFile, parseSource, readConfig, readLockFile, recordMcpInstall, recordSkillInstall, removeConfig, removeInjection, removeMcpFromLock, removeMcpServer, removeSkill, removeSkillFromLock, resolveAlias, resolveConfigPath, saveLastSelectedAgents, scanDirectory, scanFile, setQuiet, setVerbose, toSarif, validateSkill, writeConfig };
|
|
2186
|
+
export { type AuditFinding, type AuditResult, type AuditRule, type AuditSeverity, type BatchInstallOptions, type BatchInstallResult, type CaampLockFile, type ConfigFormat, type ConflictPolicy, type DetectionCacheOptions, type DetectionResult, type DualScopeConfigureOptions, type DualScopeConfigureResult, type GlobalOptions, type InjectionCheckResult, type InjectionStatus, type InstallResult, type InstructionUpdateSummary, type LockEntry, MarketplaceClient, type MarketplaceResult, type MarketplaceSearchResult, type MarketplaceSkill, type McpBatchOperation, type McpConflict, type McpConflictCode, type McpPlanApplyResult, type McpServerConfig, type McpServerEntry, type NormalizedRecommendationCriteria, type ParsedSource, type Provider, type ProviderPriority, 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 SkillMetadata, type SourceType, type TransportType, type ValidationIssue, type ValidationResult, applyMcpInstallWithPolicy, buildServerConfig, checkAllInjections, checkInjection, checkSkillUpdate, configureProviderGlobalAndProject, deepMerge, detectAllProviders, detectMcpConfigConflicts, detectProjectProviders, detectProvider, discoverSkill, discoverSkills, ensureDir, formatSkillRecommendations, generateInjectionContent, getAgentsHome, getAllProviders, getCanonicalSkillsDir, getInstalledProviders, getInstructionFiles, getLastSelectedAgents, getLockFilePath, getNestedValue, getPlatformLocations, getProjectAgentsDir, getProvider, getProviderCount, getProvidersByInstructFile, getProvidersByPriority, getProvidersByStatus, getRegistryVersion, getTrackedMcpServers, getTrackedSkills, getTransform, groupByInstructFile, inject, injectAll, installBatchWithRollback, installMcpServer, installMcpServerToAll, installSkill, isMarketplaceScoped, isQuiet, isVerbose, listAllMcpServers, listCanonicalSkills, listMcpServers, normalizeRecommendationCriteria, parseSkillFile, parseSource, rankSkills, readConfig, readLockFile, recommendSkills, recordMcpInstall, recordSkillInstall, removeConfig, removeInjection, removeMcpFromLock, removeMcpServer, removeSkill, removeSkillFromLock, resetDetectionCache, resolveAlias, resolveConfigPath, resolveRegistryTemplatePath, saveLastSelectedAgents, scanDirectory, scanFile, scoreSkillRecommendation, searchSkills, selectProvidersByMinimumPriority, setQuiet, setVerbose, toSarif, tokenizeCriteriaValue, updateInstructionsSingleOperation, validateRecommendationCriteria, validateSkill, writeConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MarketplaceClient,
|
|
3
|
+
RECOMMENDATION_ERROR_CODES,
|
|
4
|
+
applyMcpInstallWithPolicy,
|
|
3
5
|
buildServerConfig,
|
|
4
6
|
checkAllInjections,
|
|
5
7
|
checkInjection,
|
|
6
8
|
checkSkillUpdate,
|
|
9
|
+
configureProviderGlobalAndProject,
|
|
7
10
|
deepMerge,
|
|
8
11
|
detectAllProviders,
|
|
12
|
+
detectMcpConfigConflicts,
|
|
9
13
|
detectProjectProviders,
|
|
10
14
|
detectProvider,
|
|
11
15
|
discoverSkill,
|
|
12
16
|
discoverSkills,
|
|
13
17
|
ensureDir,
|
|
18
|
+
formatSkillRecommendations,
|
|
14
19
|
generateInjectionContent,
|
|
20
|
+
getAgentsHome,
|
|
15
21
|
getAllProviders,
|
|
22
|
+
getCanonicalSkillsDir,
|
|
16
23
|
getInstalledProviders,
|
|
17
24
|
getInstructionFiles,
|
|
18
25
|
getLastSelectedAgents,
|
|
26
|
+
getLockFilePath,
|
|
19
27
|
getNestedValue,
|
|
28
|
+
getPlatformLocations,
|
|
29
|
+
getProjectAgentsDir,
|
|
20
30
|
getProvider,
|
|
21
31
|
getProviderCount,
|
|
22
32
|
getProvidersByInstructFile,
|
|
@@ -29,6 +39,7 @@ import {
|
|
|
29
39
|
groupByInstructFile,
|
|
30
40
|
inject,
|
|
31
41
|
injectAll,
|
|
42
|
+
installBatchWithRollback,
|
|
32
43
|
installMcpServer,
|
|
33
44
|
installMcpServerToAll,
|
|
34
45
|
installSkill,
|
|
@@ -38,10 +49,13 @@ import {
|
|
|
38
49
|
listAllMcpServers,
|
|
39
50
|
listCanonicalSkills,
|
|
40
51
|
listMcpServers,
|
|
52
|
+
normalizeRecommendationCriteria,
|
|
41
53
|
parseSkillFile,
|
|
42
54
|
parseSource,
|
|
55
|
+
rankSkills,
|
|
43
56
|
readConfig,
|
|
44
57
|
readLockFile,
|
|
58
|
+
recommendSkills,
|
|
45
59
|
recordMcpInstall,
|
|
46
60
|
recordSkillInstall,
|
|
47
61
|
removeConfig,
|
|
@@ -50,36 +64,54 @@ import {
|
|
|
50
64
|
removeMcpServer,
|
|
51
65
|
removeSkill,
|
|
52
66
|
removeSkillFromLock,
|
|
67
|
+
resetDetectionCache,
|
|
53
68
|
resolveAlias,
|
|
54
69
|
resolveConfigPath,
|
|
70
|
+
resolveRegistryTemplatePath,
|
|
55
71
|
saveLastSelectedAgents,
|
|
56
72
|
scanDirectory,
|
|
57
73
|
scanFile,
|
|
74
|
+
scoreSkillRecommendation,
|
|
75
|
+
searchSkills,
|
|
76
|
+
selectProvidersByMinimumPriority,
|
|
58
77
|
setQuiet,
|
|
59
78
|
setVerbose,
|
|
60
79
|
toSarif,
|
|
80
|
+
tokenizeCriteriaValue,
|
|
81
|
+
updateInstructionsSingleOperation,
|
|
82
|
+
validateRecommendationCriteria,
|
|
61
83
|
validateSkill,
|
|
62
84
|
writeConfig
|
|
63
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-6HQDRJLS.js";
|
|
64
86
|
export {
|
|
65
87
|
MarketplaceClient,
|
|
88
|
+
RECOMMENDATION_ERROR_CODES,
|
|
89
|
+
applyMcpInstallWithPolicy,
|
|
66
90
|
buildServerConfig,
|
|
67
91
|
checkAllInjections,
|
|
68
92
|
checkInjection,
|
|
69
93
|
checkSkillUpdate,
|
|
94
|
+
configureProviderGlobalAndProject,
|
|
70
95
|
deepMerge,
|
|
71
96
|
detectAllProviders,
|
|
97
|
+
detectMcpConfigConflicts,
|
|
72
98
|
detectProjectProviders,
|
|
73
99
|
detectProvider,
|
|
74
100
|
discoverSkill,
|
|
75
101
|
discoverSkills,
|
|
76
102
|
ensureDir,
|
|
103
|
+
formatSkillRecommendations,
|
|
77
104
|
generateInjectionContent,
|
|
105
|
+
getAgentsHome,
|
|
78
106
|
getAllProviders,
|
|
107
|
+
getCanonicalSkillsDir,
|
|
79
108
|
getInstalledProviders,
|
|
80
109
|
getInstructionFiles,
|
|
81
110
|
getLastSelectedAgents,
|
|
111
|
+
getLockFilePath,
|
|
82
112
|
getNestedValue,
|
|
113
|
+
getPlatformLocations,
|
|
114
|
+
getProjectAgentsDir,
|
|
83
115
|
getProvider,
|
|
84
116
|
getProviderCount,
|
|
85
117
|
getProvidersByInstructFile,
|
|
@@ -92,6 +124,7 @@ export {
|
|
|
92
124
|
groupByInstructFile,
|
|
93
125
|
inject,
|
|
94
126
|
injectAll,
|
|
127
|
+
installBatchWithRollback,
|
|
95
128
|
installMcpServer,
|
|
96
129
|
installMcpServerToAll,
|
|
97
130
|
installSkill,
|
|
@@ -101,10 +134,13 @@ export {
|
|
|
101
134
|
listAllMcpServers,
|
|
102
135
|
listCanonicalSkills,
|
|
103
136
|
listMcpServers,
|
|
137
|
+
normalizeRecommendationCriteria,
|
|
104
138
|
parseSkillFile,
|
|
105
139
|
parseSource,
|
|
140
|
+
rankSkills,
|
|
106
141
|
readConfig,
|
|
107
142
|
readLockFile,
|
|
143
|
+
recommendSkills,
|
|
108
144
|
recordMcpInstall,
|
|
109
145
|
recordSkillInstall,
|
|
110
146
|
removeConfig,
|
|
@@ -113,14 +149,22 @@ export {
|
|
|
113
149
|
removeMcpServer,
|
|
114
150
|
removeSkill,
|
|
115
151
|
removeSkillFromLock,
|
|
152
|
+
resetDetectionCache,
|
|
116
153
|
resolveAlias,
|
|
117
154
|
resolveConfigPath,
|
|
155
|
+
resolveRegistryTemplatePath,
|
|
118
156
|
saveLastSelectedAgents,
|
|
119
157
|
scanDirectory,
|
|
120
158
|
scanFile,
|
|
159
|
+
scoreSkillRecommendation,
|
|
160
|
+
searchSkills,
|
|
161
|
+
selectProvidersByMinimumPriority,
|
|
121
162
|
setQuiet,
|
|
122
163
|
setVerbose,
|
|
123
164
|
toSarif,
|
|
165
|
+
tokenizeCriteriaValue,
|
|
166
|
+
updateInstructionsSingleOperation,
|
|
167
|
+
validateRecommendationCriteria,
|
|
124
168
|
validateSkill,
|
|
125
169
|
writeConfig
|
|
126
170
|
};
|