harnesstap 1.2.0 → 1.3.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 +28 -15
- package/dist/apply-2GRNKR5H.js +67 -0
- package/dist/apply-2GRNKR5H.js.map +1 -0
- package/dist/approve-KQNCNH2R.js +181 -0
- package/dist/approve-KQNCNH2R.js.map +1 -0
- package/dist/audit-SLYOZCMI.js +434 -0
- package/dist/audit-SLYOZCMI.js.map +1 -0
- package/dist/auth-3IEVICFT.js +220 -0
- package/dist/auth-3IEVICFT.js.map +1 -0
- package/dist/bin.js +166 -0
- package/dist/bin.js.map +1 -0
- package/dist/chunk-2EIJYDNI.js +10945 -0
- package/dist/chunk-2EIJYDNI.js.map +1 -0
- package/dist/chunk-2H7UOFLK.js +11 -0
- package/dist/chunk-2H7UOFLK.js.map +1 -0
- package/dist/chunk-37E5M4JX.js +34 -0
- package/dist/chunk-37E5M4JX.js.map +1 -0
- package/dist/chunk-3FIWOI3H.js +98 -0
- package/dist/chunk-3FIWOI3H.js.map +1 -0
- package/dist/chunk-3IWTJCPA.js +6448 -0
- package/dist/chunk-3IWTJCPA.js.map +1 -0
- package/dist/chunk-3IZ7SEGT.js +346 -0
- package/dist/chunk-3IZ7SEGT.js.map +1 -0
- package/dist/chunk-3RBYT7QN.js +540 -0
- package/dist/chunk-3RBYT7QN.js.map +1 -0
- package/dist/chunk-4KNQZDZC.js +115 -0
- package/dist/chunk-4KNQZDZC.js.map +1 -0
- package/dist/chunk-5F3LNDZG.js +9 -0
- package/dist/chunk-5F3LNDZG.js.map +1 -0
- package/dist/chunk-63U7QWNY.js +364 -0
- package/dist/chunk-63U7QWNY.js.map +1 -0
- package/dist/chunk-6BY4BV5G.js +998 -0
- package/dist/chunk-6BY4BV5G.js.map +1 -0
- package/dist/chunk-7L2K4N25.js +610 -0
- package/dist/chunk-7L2K4N25.js.map +1 -0
- package/dist/chunk-7LWH5SWH.js +18 -0
- package/dist/chunk-7LWH5SWH.js.map +1 -0
- package/dist/chunk-BIBUCC2E.js +696 -0
- package/dist/chunk-BIBUCC2E.js.map +1 -0
- package/dist/chunk-BSOBXLYI.js +172 -0
- package/dist/chunk-BSOBXLYI.js.map +1 -0
- package/dist/chunk-C4QBVVEH.js +32 -0
- package/dist/chunk-C4QBVVEH.js.map +1 -0
- package/dist/chunk-CHQGE2HF.js +283 -0
- package/dist/chunk-CHQGE2HF.js.map +1 -0
- package/dist/chunk-DV74UZJI.js +87 -0
- package/dist/chunk-DV74UZJI.js.map +1 -0
- package/dist/chunk-DWVAR4BP.js +656 -0
- package/dist/chunk-DWVAR4BP.js.map +1 -0
- package/dist/chunk-DXKAKKLP.js +302 -0
- package/dist/chunk-DXKAKKLP.js.map +1 -0
- package/dist/chunk-EIWXS4RM.js +235 -0
- package/dist/chunk-EIWXS4RM.js.map +1 -0
- package/dist/chunk-EWBCFAF3.js +681 -0
- package/dist/chunk-EWBCFAF3.js.map +1 -0
- package/dist/chunk-F2L4VNQK.js +1759 -0
- package/dist/chunk-F2L4VNQK.js.map +1 -0
- package/dist/chunk-G26HZZDJ.js +1359 -0
- package/dist/chunk-G26HZZDJ.js.map +1 -0
- package/dist/chunk-GQKKX7OE.js +818 -0
- package/dist/chunk-GQKKX7OE.js.map +1 -0
- package/dist/chunk-GRJY22U6.js +691 -0
- package/dist/chunk-GRJY22U6.js.map +1 -0
- package/dist/chunk-H6DVP2SI.js +682 -0
- package/dist/chunk-H6DVP2SI.js.map +1 -0
- package/dist/chunk-HVVPTCKR.js +1173 -0
- package/dist/chunk-HVVPTCKR.js.map +1 -0
- package/dist/chunk-I6XFZLTJ.js +9 -0
- package/dist/chunk-I6XFZLTJ.js.map +1 -0
- package/dist/chunk-IBOABSIA.js +17 -0
- package/dist/chunk-IBOABSIA.js.map +1 -0
- package/dist/chunk-IK524ZDW.js +691 -0
- package/dist/chunk-IK524ZDW.js.map +1 -0
- package/dist/chunk-IRU7NBOT.js +141 -0
- package/dist/chunk-IRU7NBOT.js.map +1 -0
- package/dist/chunk-J4CKQXQ6.js +806 -0
- package/dist/chunk-J4CKQXQ6.js.map +1 -0
- package/dist/chunk-JKGSJGCC.js +311 -0
- package/dist/chunk-JKGSJGCC.js.map +1 -0
- package/dist/chunk-JQOKQKQT.js +158 -0
- package/dist/chunk-JQOKQKQT.js.map +1 -0
- package/dist/chunk-JRFUTIEH.js +426 -0
- package/dist/chunk-JRFUTIEH.js.map +1 -0
- package/dist/chunk-K2BPYEH5.js +491 -0
- package/dist/chunk-K2BPYEH5.js.map +1 -0
- package/dist/chunk-KCQC7YBK.js +7795 -0
- package/dist/chunk-KCQC7YBK.js.map +1 -0
- package/dist/chunk-KDAV2GUT.js +1357 -0
- package/dist/chunk-KDAV2GUT.js.map +1 -0
- package/dist/chunk-KDDXZBMC.js +583 -0
- package/dist/chunk-KDDXZBMC.js.map +1 -0
- package/dist/chunk-KMWHZSEG.js +41 -0
- package/dist/chunk-KMWHZSEG.js.map +1 -0
- package/dist/chunk-KRI4R7EM.js +25 -0
- package/dist/chunk-KRI4R7EM.js.map +1 -0
- package/dist/chunk-LNJ3WZZX.js +186 -0
- package/dist/chunk-LNJ3WZZX.js.map +1 -0
- package/dist/chunk-MWXA4PFE.js +103 -0
- package/dist/chunk-MWXA4PFE.js.map +1 -0
- package/dist/chunk-MY62SSKC.js +183 -0
- package/dist/chunk-MY62SSKC.js.map +1 -0
- package/dist/chunk-NAGAJ5UM.js +145 -0
- package/dist/chunk-NAGAJ5UM.js.map +1 -0
- package/dist/chunk-NJ7WRKIQ.js +532 -0
- package/dist/chunk-NJ7WRKIQ.js.map +1 -0
- package/dist/chunk-OS6NUIBJ.js +38 -0
- package/dist/chunk-OS6NUIBJ.js.map +1 -0
- package/dist/chunk-PXU2OS26.js +238 -0
- package/dist/chunk-PXU2OS26.js.map +1 -0
- package/dist/chunk-QO4LBDVI.js +496 -0
- package/dist/chunk-QO4LBDVI.js.map +1 -0
- package/dist/chunk-QRZPQNLX.js +65 -0
- package/dist/chunk-QRZPQNLX.js.map +1 -0
- package/dist/chunk-SNVAMWB7.js +40 -0
- package/dist/chunk-SNVAMWB7.js.map +1 -0
- package/dist/chunk-SPRVUATR.js +430 -0
- package/dist/chunk-SPRVUATR.js.map +1 -0
- package/dist/chunk-SY7G5QEI.js +35 -0
- package/dist/chunk-SY7G5QEI.js.map +1 -0
- package/dist/chunk-SZNBUIDR.js +6438 -0
- package/dist/chunk-SZNBUIDR.js.map +1 -0
- package/dist/chunk-TQ2NA4Z4.js +24 -0
- package/dist/chunk-TQ2NA4Z4.js.map +1 -0
- package/dist/chunk-TYULB6ZY.js +2959 -0
- package/dist/chunk-TYULB6ZY.js.map +1 -0
- package/dist/chunk-UJYFTXHV.js +296 -0
- package/dist/chunk-UJYFTXHV.js.map +1 -0
- package/dist/chunk-VC6OKCJF.js +184 -0
- package/dist/chunk-VC6OKCJF.js.map +1 -0
- package/dist/chunk-VL2NWCZV.js +118 -0
- package/dist/chunk-VL2NWCZV.js.map +1 -0
- package/dist/chunk-VL7BGD47.js +514 -0
- package/dist/chunk-VL7BGD47.js.map +1 -0
- package/dist/chunk-VQVUJYYY.js +244 -0
- package/dist/chunk-VQVUJYYY.js.map +1 -0
- package/dist/chunk-VZQG2JDV.js +9 -0
- package/dist/chunk-VZQG2JDV.js.map +1 -0
- package/dist/chunk-XFZQVYIN.js +115 -0
- package/dist/chunk-XFZQVYIN.js.map +1 -0
- package/dist/chunk-XGTTOO4R.js +84 -0
- package/dist/chunk-XGTTOO4R.js.map +1 -0
- package/dist/chunk-XQFT4PEP.js +60 -0
- package/dist/chunk-XQFT4PEP.js.map +1 -0
- package/dist/chunk-YDD3ES2K.js +571 -0
- package/dist/chunk-YDD3ES2K.js.map +1 -0
- package/dist/chunk-ZY2MZ2KQ.js +1140 -0
- package/dist/chunk-ZY2MZ2KQ.js.map +1 -0
- package/dist/compile-57EEIUMB.js +161 -0
- package/dist/compile-57EEIUMB.js.map +1 -0
- package/dist/config-4EJ3D7QJ.js +438 -0
- package/dist/config-4EJ3D7QJ.js.map +1 -0
- package/dist/doctor-EEV6P5CH.js +111 -0
- package/dist/doctor-EEV6P5CH.js.map +1 -0
- package/dist/environment-WFEG4DAT.js +2745 -0
- package/dist/environment-WFEG4DAT.js.map +1 -0
- package/dist/github-BSMQD72A.js +114 -0
- package/dist/github-BSMQD72A.js.map +1 -0
- package/dist/harness-VX3PNVQW.js +746 -0
- package/dist/harness-VX3PNVQW.js.map +1 -0
- package/dist/help-AW2HKX63.js +2079 -0
- package/dist/help-AW2HKX63.js.map +1 -0
- package/dist/help-BVFOZD7E.js +1892 -0
- package/dist/help-BVFOZD7E.js.map +1 -0
- package/dist/index.d.ts +164 -1
- package/dist/index.js +50 -59246
- package/dist/index.js.map +1 -1
- package/dist/init-SPN2GEZ4.js +873 -0
- package/dist/init-SPN2GEZ4.js.map +1 -0
- package/dist/lock-K2LLUU7H.js +455 -0
- package/dist/lock-K2LLUU7H.js.map +1 -0
- package/dist/marketplace-VEKSWGX3.js +495 -0
- package/dist/marketplace-VEKSWGX3.js.map +1 -0
- package/dist/mcp-T6DKIKSF.js +202 -0
- package/dist/mcp-T6DKIKSF.js.map +1 -0
- package/dist/migrate-OO37WSB2.js +1043 -0
- package/dist/migrate-OO37WSB2.js.map +1 -0
- package/dist/open-3V3QK5RK.js +32 -0
- package/dist/open-3V3QK5RK.js.map +1 -0
- package/dist/pack-V32UPC7W.js +99 -0
- package/dist/pack-V32UPC7W.js.map +1 -0
- package/dist/plugin-KOBNQ7GT.js +64 -0
- package/dist/plugin-KOBNQ7GT.js.map +1 -0
- package/dist/plugin-from-project-X3VO3MB6.js +16 -0
- package/dist/plugin-from-project-X3VO3MB6.js.map +1 -0
- package/dist/policy-F5MKZNOC.js +105 -0
- package/dist/policy-F5MKZNOC.js.map +1 -0
- package/dist/profile-H4PMH4XT.js +1886 -0
- package/dist/profile-H4PMH4XT.js.map +1 -0
- package/dist/project-QVNEJJGH.js +1392 -0
- package/dist/project-QVNEJJGH.js.map +1 -0
- package/dist/resource-GL4RLSGI.js +555 -0
- package/dist/resource-GL4RLSGI.js.map +1 -0
- package/dist/version-PBHZK44K.js +17 -0
- package/dist/version-PBHZK44K.js.map +1 -0
- package/package.json +21 -14
- package/schemas/ap-package.v1.json +36 -0
- package/schemas/fixtures/catalog-missing-schema.ap.json +13 -0
- package/schemas/fixtures/confidence.ap.json +13 -0
- package/schemas/fixtures/context7.ap.json +13 -0
- package/schemas/fixtures/minimal-with-schema.ap.json +13 -0
- package/schemas/fixtures/superpowers.ap.json +13 -0
- package/schemas/fixtures/third-party-skills.ap.json +13 -0
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catalogPluginKey,
|
|
3
|
+
renderCatalogListViewport,
|
|
4
|
+
renderCatalogPluginShow,
|
|
5
|
+
renderCatalogSearchViewport
|
|
6
|
+
} from "./chunk-EIWXS4RM.js";
|
|
7
|
+
import {
|
|
8
|
+
useTerminalSize
|
|
9
|
+
} from "./chunk-KMWHZSEG.js";
|
|
10
|
+
import {
|
|
11
|
+
buildHelpLine,
|
|
12
|
+
clampActiveIndex,
|
|
13
|
+
interactivePromptTheme,
|
|
14
|
+
isEscapeKey,
|
|
15
|
+
isSearchCharacter
|
|
16
|
+
} from "./chunk-3FIWOI3H.js";
|
|
17
|
+
import {
|
|
18
|
+
projectNameFromUrl
|
|
19
|
+
} from "./chunk-KCQC7YBK.js";
|
|
20
|
+
import {
|
|
21
|
+
APM_MANIFEST_FILENAME
|
|
22
|
+
} from "./chunk-7L2K4N25.js";
|
|
23
|
+
import {
|
|
24
|
+
createImportedSnapshot,
|
|
25
|
+
detectPlatforms,
|
|
26
|
+
hasPluginSourceLayout
|
|
27
|
+
} from "./chunk-3IWTJCPA.js";
|
|
28
|
+
import {
|
|
29
|
+
getAllPlatforms,
|
|
30
|
+
normalizeResourceInput,
|
|
31
|
+
skillMetadataFromDir,
|
|
32
|
+
upsertResource
|
|
33
|
+
} from "./chunk-2EIJYDNI.js";
|
|
34
|
+
import {
|
|
35
|
+
discoverSkillPackage,
|
|
36
|
+
refreshGitSource
|
|
37
|
+
} from "./chunk-6BY4BV5G.js";
|
|
38
|
+
import {
|
|
39
|
+
theme
|
|
40
|
+
} from "./chunk-YDD3ES2K.js";
|
|
41
|
+
import {
|
|
42
|
+
formatCanonicalPublishedSelectorWithVersion
|
|
43
|
+
} from "./chunk-ZY2MZ2KQ.js";
|
|
44
|
+
|
|
45
|
+
// src/services/repo-profile.ts
|
|
46
|
+
import { existsSync } from "fs";
|
|
47
|
+
import { join } from "path";
|
|
48
|
+
function classifyRepo(rootPath) {
|
|
49
|
+
const profiles = [];
|
|
50
|
+
if (discoverSkillPackage(rootPath).length > 0) {
|
|
51
|
+
profiles.push("skill-package");
|
|
52
|
+
}
|
|
53
|
+
if (hasPluginSourceLayout(rootPath)) {
|
|
54
|
+
profiles.push("plugin-source");
|
|
55
|
+
}
|
|
56
|
+
if (existsSync(join(rootPath, APM_MANIFEST_FILENAME))) {
|
|
57
|
+
profiles.push("project-config");
|
|
58
|
+
}
|
|
59
|
+
if (detectPlatforms(rootPath).length > 0) {
|
|
60
|
+
profiles.push("harness-project");
|
|
61
|
+
}
|
|
62
|
+
const primary = profiles.includes("skill-package") ? "skill-package" : profiles.includes("plugin-source") ? "plugin-source" : profiles.includes("project-config") ? "project-config" : profiles.includes("harness-project") ? "harness-project" : "unknown";
|
|
63
|
+
return { primary, profiles };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// src/services/source-resolver.ts
|
|
67
|
+
import { existsSync as existsSync2 } from "fs";
|
|
68
|
+
import { basename, resolve } from "path";
|
|
69
|
+
var GITHUB_SHORTHAND = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;
|
|
70
|
+
function parseOwnerRepo(label) {
|
|
71
|
+
const [owner, repo] = label.split("/");
|
|
72
|
+
if (!owner || !repo) {
|
|
73
|
+
throw new Error(`Invalid source: ${label}`);
|
|
74
|
+
}
|
|
75
|
+
return { owner, repo };
|
|
76
|
+
}
|
|
77
|
+
function resolveRemoteSource(input) {
|
|
78
|
+
const trimmed = input.trim();
|
|
79
|
+
if (existsSync2(trimmed)) {
|
|
80
|
+
return {
|
|
81
|
+
kind: "local",
|
|
82
|
+
path: resolve(trimmed),
|
|
83
|
+
label: basename(resolve(trimmed))
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (GITHUB_SHORTHAND.test(trimmed)) {
|
|
87
|
+
const { owner, repo } = parseOwnerRepo(trimmed);
|
|
88
|
+
return {
|
|
89
|
+
kind: "git",
|
|
90
|
+
url: `https://github.com/${owner}/${repo}.git`,
|
|
91
|
+
label: trimmed,
|
|
92
|
+
owner,
|
|
93
|
+
repo
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (trimmed.startsWith("git@") || trimmed.startsWith("http://") || trimmed.startsWith("https://")) {
|
|
97
|
+
const label = projectNameFromUrl(trimmed);
|
|
98
|
+
const { owner, repo } = parseOwnerRepo(label);
|
|
99
|
+
const url = trimmed.endsWith(".git") ? trimmed : `${trimmed.replace(/\/$/, "")}.git`;
|
|
100
|
+
return { kind: "git", url, label, owner, repo };
|
|
101
|
+
}
|
|
102
|
+
throw new Error(
|
|
103
|
+
`Unrecognized source "${input}". Use owner/repo, a Git URL, or a local path.`
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function sourceCacheDir(harnesstapDir, owner, repo) {
|
|
107
|
+
return `${harnesstapDir}/cache/sources/${owner}/${repo}`;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// src/services/skill-package-resolve.ts
|
|
111
|
+
var DEFAULT_EXCLUDED_SKILL_CATEGORIES = ["dbt-migration"];
|
|
112
|
+
function skillPackageHint(primary) {
|
|
113
|
+
return `Source is not a skill package (detected: ${primary}). Use a repo with skills/ or .agents/skills/ containing SKILL.md files.`;
|
|
114
|
+
}
|
|
115
|
+
function defaultInteractiveSkillNames(discovered, excludeCategories = DEFAULT_EXCLUDED_SKILL_CATEGORIES) {
|
|
116
|
+
const excluded = new Set(excludeCategories);
|
|
117
|
+
return discovered.filter((skill) => !excluded.has(skill.category)).map((skill) => skill.name);
|
|
118
|
+
}
|
|
119
|
+
function resolveSkillPackageCheckout(source, harnesstapDir) {
|
|
120
|
+
const resolved = resolveRemoteSource(source);
|
|
121
|
+
let checkoutRoot;
|
|
122
|
+
let gitUrl;
|
|
123
|
+
let gitSha;
|
|
124
|
+
if (resolved.kind === "git") {
|
|
125
|
+
const cacheDir = sourceCacheDir(
|
|
126
|
+
harnesstapDir,
|
|
127
|
+
resolved.owner,
|
|
128
|
+
resolved.repo
|
|
129
|
+
);
|
|
130
|
+
const refresh = refreshGitSource({
|
|
131
|
+
url: resolved.url,
|
|
132
|
+
targetDir: cacheDir
|
|
133
|
+
});
|
|
134
|
+
if (!refresh.ok) {
|
|
135
|
+
throw new Error(refresh.message);
|
|
136
|
+
}
|
|
137
|
+
checkoutRoot = cacheDir;
|
|
138
|
+
gitUrl = resolved.url;
|
|
139
|
+
gitSha = refresh.sha;
|
|
140
|
+
} else {
|
|
141
|
+
checkoutRoot = resolved.path;
|
|
142
|
+
}
|
|
143
|
+
const classification = classifyRepo(checkoutRoot);
|
|
144
|
+
if (classification.primary !== "skill-package") {
|
|
145
|
+
throw new Error(skillPackageHint(classification.primary));
|
|
146
|
+
}
|
|
147
|
+
const discovered = discoverSkillPackage(checkoutRoot);
|
|
148
|
+
if (discovered.length === 0) {
|
|
149
|
+
throw new Error(`No skills found in skill package: ${checkoutRoot}`);
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
checkoutRoot,
|
|
153
|
+
namespace: resolved.label,
|
|
154
|
+
gitUrl,
|
|
155
|
+
gitSha,
|
|
156
|
+
discovered
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function resolveSelectedSkills(discovered, options) {
|
|
160
|
+
const discoveredNames = new Set(discovered.map((skill) => skill.name));
|
|
161
|
+
const excludeCategories = new Set(options.excludeCategories ?? []);
|
|
162
|
+
const applyCategoryExclusions = (skills) => {
|
|
163
|
+
if (excludeCategories.size === 0) {
|
|
164
|
+
return skills;
|
|
165
|
+
}
|
|
166
|
+
return skills.filter((skill) => !excludeCategories.has(skill.category));
|
|
167
|
+
};
|
|
168
|
+
if (options.all) {
|
|
169
|
+
const selected = applyCategoryExclusions(discovered);
|
|
170
|
+
if (selected.length === 0) {
|
|
171
|
+
throw new Error("No skills selected after applying category exclusions.");
|
|
172
|
+
}
|
|
173
|
+
return selected;
|
|
174
|
+
}
|
|
175
|
+
if (options.skillNames && options.skillNames.length > 0) {
|
|
176
|
+
const missing = options.skillNames.filter((name) => !discoveredNames.has(name));
|
|
177
|
+
if (missing.length > 0) {
|
|
178
|
+
throw new Error(`Skill(s) not found: ${missing.join(", ")}`);
|
|
179
|
+
}
|
|
180
|
+
const selected = new Set(options.skillNames);
|
|
181
|
+
const skills = discovered.filter((skill) => selected.has(skill.name));
|
|
182
|
+
const filtered = applyCategoryExclusions(skills);
|
|
183
|
+
if (filtered.length === 0) {
|
|
184
|
+
throw new Error("No skills selected after applying category exclusions.");
|
|
185
|
+
}
|
|
186
|
+
return filtered;
|
|
187
|
+
}
|
|
188
|
+
throw new Error(
|
|
189
|
+
"No skills selected. Pass --skill <names>, --all, or use the wizard."
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// src/services/skill-package-import.ts
|
|
194
|
+
import { readFileSync } from "fs";
|
|
195
|
+
import { isAbsolute, join as join2 } from "path";
|
|
196
|
+
import matter from "gray-matter";
|
|
197
|
+
function assertSafeResourceName(name, filePath) {
|
|
198
|
+
const trimmed = name.trim();
|
|
199
|
+
if (trimmed.length === 0 || trimmed === "." || trimmed === ".." || trimmed.includes("/") || trimmed.includes("\\") || isAbsolute(trimmed)) {
|
|
200
|
+
throw new Error(`Invalid imported resource name in ${filePath}: ${name}`);
|
|
201
|
+
}
|
|
202
|
+
return trimmed;
|
|
203
|
+
}
|
|
204
|
+
function resolvePluginDisplayName(sourceLabel, pluginDisplayName) {
|
|
205
|
+
if (pluginDisplayName?.trim()) {
|
|
206
|
+
return pluginDisplayName.trim();
|
|
207
|
+
}
|
|
208
|
+
const segment = sourceLabel.split("/").pop();
|
|
209
|
+
return segment?.trim() || sourceLabel;
|
|
210
|
+
}
|
|
211
|
+
function buildCategoriesMap(skills) {
|
|
212
|
+
const categories = {};
|
|
213
|
+
for (const skill of skills) {
|
|
214
|
+
let bucket = categories[skill.category];
|
|
215
|
+
if (!bucket) {
|
|
216
|
+
bucket = [];
|
|
217
|
+
categories[skill.category] = bucket;
|
|
218
|
+
}
|
|
219
|
+
bucket.push(skill.name);
|
|
220
|
+
}
|
|
221
|
+
for (const names of Object.values(categories)) {
|
|
222
|
+
names.sort((a, b) => a.localeCompare(b));
|
|
223
|
+
}
|
|
224
|
+
return categories;
|
|
225
|
+
}
|
|
226
|
+
function buildProvenance(input) {
|
|
227
|
+
return {
|
|
228
|
+
source_kind: "skill-package",
|
|
229
|
+
source_label: input.sourceLabel,
|
|
230
|
+
plugin_name: input.pluginName,
|
|
231
|
+
source_plugin_kind: "skill-package",
|
|
232
|
+
relative_path: input.relativePath,
|
|
233
|
+
imported_at: input.importedAt
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
function buildSkillResource(input) {
|
|
237
|
+
const skillPath = join2(input.rootPath, input.skill.skillMdRelative);
|
|
238
|
+
const raw = readFileSync(skillPath, "utf-8");
|
|
239
|
+
let parsed;
|
|
240
|
+
try {
|
|
241
|
+
parsed = matter(raw);
|
|
242
|
+
} catch {
|
|
243
|
+
throw new Error(`Malformed resource frontmatter: ${skillPath}`);
|
|
244
|
+
}
|
|
245
|
+
if (raw.startsWith("---") && parsed.content === raw) {
|
|
246
|
+
throw new Error(`Malformed resource frontmatter: ${skillPath}`);
|
|
247
|
+
}
|
|
248
|
+
const skillDir = join2(input.rootPath, input.skill.skillDirRelative);
|
|
249
|
+
const provenance = buildProvenance({
|
|
250
|
+
importedAt: input.importedAt,
|
|
251
|
+
sourceLabel: input.sourceLabel,
|
|
252
|
+
pluginName: input.pluginName,
|
|
253
|
+
relativePath: input.skill.skillMdRelative
|
|
254
|
+
});
|
|
255
|
+
const metadata = {
|
|
256
|
+
...skillMetadataFromDir(skillDir),
|
|
257
|
+
imported_from: provenance
|
|
258
|
+
};
|
|
259
|
+
return {
|
|
260
|
+
type: "skill",
|
|
261
|
+
name: assertSafeResourceName(
|
|
262
|
+
typeof parsed.data.name === "string" && parsed.data.name.trim() ? parsed.data.name : input.skill.name,
|
|
263
|
+
skillPath
|
|
264
|
+
),
|
|
265
|
+
description: typeof parsed.data.description === "string" ? parsed.data.description : "",
|
|
266
|
+
content: parsed.content.trim(),
|
|
267
|
+
source: input.skill.skillMdRelative,
|
|
268
|
+
metadata
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
async function importSkillPackage(options) {
|
|
272
|
+
const { rootPath, sourceLabel, gitUrl, gitSha, pluginDisplayName } = options;
|
|
273
|
+
const skills = discoverSkillPackage(rootPath);
|
|
274
|
+
if (skills.length === 0) {
|
|
275
|
+
throw new Error(`No skills found in skill package: ${rootPath}`);
|
|
276
|
+
}
|
|
277
|
+
const pluginName = resolvePluginDisplayName(sourceLabel, pluginDisplayName);
|
|
278
|
+
const importedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
279
|
+
const originRef = `${sourceLabel}@${gitSha ?? "local"}`;
|
|
280
|
+
const resourceInputs = skills.map(
|
|
281
|
+
(skill) => buildSkillResource({
|
|
282
|
+
rootPath,
|
|
283
|
+
skill,
|
|
284
|
+
sourceLabel,
|
|
285
|
+
pluginName,
|
|
286
|
+
importedAt
|
|
287
|
+
})
|
|
288
|
+
);
|
|
289
|
+
const resources = [];
|
|
290
|
+
const resourceIds = [];
|
|
291
|
+
for (const resource of resourceInputs) {
|
|
292
|
+
const upserted = upsertResource(
|
|
293
|
+
normalizeResourceInput({
|
|
294
|
+
...resource,
|
|
295
|
+
namespace: sourceLabel,
|
|
296
|
+
origin_kind: "local_snapshot",
|
|
297
|
+
origin_ref: originRef
|
|
298
|
+
}),
|
|
299
|
+
{ policy: "overwrite" }
|
|
300
|
+
);
|
|
301
|
+
const saved = upserted.action === "skipped" ? upserted.existing : upserted.resource;
|
|
302
|
+
resourceIds.push(saved.id);
|
|
303
|
+
resources.push(saved);
|
|
304
|
+
}
|
|
305
|
+
const snapshot = createImportedSnapshot({
|
|
306
|
+
source_kind: "skill-package",
|
|
307
|
+
source_label: sourceLabel,
|
|
308
|
+
plugin_name: pluginName,
|
|
309
|
+
resource_ids: resourceIds,
|
|
310
|
+
metadata: {
|
|
311
|
+
git_url: gitUrl,
|
|
312
|
+
git_sha: gitSha,
|
|
313
|
+
categories: buildCategoriesMap(skills)
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
return { snapshot, resources };
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// src/services/skill-install.ts
|
|
320
|
+
import { cpSync, existsSync as existsSync3, mkdirSync, rmSync, symlinkSync } from "fs";
|
|
321
|
+
import { dirname, join as join3, relative, resolve as resolve2 } from "path";
|
|
322
|
+
function resolveConfiguredPath(baseRoot, configured) {
|
|
323
|
+
return configured.startsWith("~/") ? join3(baseRoot, configured.slice(2)) : join3(baseRoot, configured);
|
|
324
|
+
}
|
|
325
|
+
function resolveGlobalSkillPath(homeRoot, platformId) {
|
|
326
|
+
const platform = getAllPlatforms().find((p) => p.id === platformId);
|
|
327
|
+
const configured = platform?.globalPaths.skills;
|
|
328
|
+
if (!configured) return void 0;
|
|
329
|
+
return resolveConfiguredPath(homeRoot, configured);
|
|
330
|
+
}
|
|
331
|
+
function resolveProjectSkillPath(projectRoot, platformId) {
|
|
332
|
+
const platform = getAllPlatforms().find((p) => p.id === platformId);
|
|
333
|
+
const configured = platform?.projectPaths.skills;
|
|
334
|
+
if (!configured) return void 0;
|
|
335
|
+
return join3(projectRoot, configured);
|
|
336
|
+
}
|
|
337
|
+
function ensureSymlink(linkPath, targetPath) {
|
|
338
|
+
mkdirSync(dirname(linkPath), { recursive: true });
|
|
339
|
+
if (existsSync3(linkPath)) {
|
|
340
|
+
rmSync(linkPath, { recursive: true, force: true });
|
|
341
|
+
}
|
|
342
|
+
symlinkSync(resolve2(targetPath), linkPath);
|
|
343
|
+
}
|
|
344
|
+
function installSkillAtPath(linkPath, targetPath, method) {
|
|
345
|
+
if (method === "copy") {
|
|
346
|
+
mkdirSync(linkPath, { recursive: true });
|
|
347
|
+
cpSync(targetPath, linkPath, { recursive: true });
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
ensureSymlink(linkPath, targetPath);
|
|
351
|
+
}
|
|
352
|
+
function resolveEffectiveMethod(method, materializationStrategy) {
|
|
353
|
+
if (materializationStrategy === "copy") {
|
|
354
|
+
return "copy";
|
|
355
|
+
}
|
|
356
|
+
if (materializationStrategy === "symlink-preferred") {
|
|
357
|
+
return "symlink";
|
|
358
|
+
}
|
|
359
|
+
return method;
|
|
360
|
+
}
|
|
361
|
+
function relativeFromRoot(root, absolutePath) {
|
|
362
|
+
const prefix = root.endsWith("/") ? root : `${root}/`;
|
|
363
|
+
return absolutePath.startsWith(prefix) ? absolutePath.slice(prefix.length) : relative(root, absolutePath);
|
|
364
|
+
}
|
|
365
|
+
async function installSkillsToGlobal(options) {
|
|
366
|
+
const installed = [];
|
|
367
|
+
const files = [];
|
|
368
|
+
for (const skill of options.skills) {
|
|
369
|
+
const sourceDir = join3(options.checkoutRoot, skill.skillDirRelative);
|
|
370
|
+
const hubDir = join3(options.homeRoot, ".agents/skills", skill.name);
|
|
371
|
+
installSkillAtPath(hubDir, sourceDir, options.method);
|
|
372
|
+
files.push(join3(".agents/skills", skill.name));
|
|
373
|
+
installed.push(skill.name);
|
|
374
|
+
for (const harness of options.harnesses) {
|
|
375
|
+
const targetRoot = resolveGlobalSkillPath(options.homeRoot, harness);
|
|
376
|
+
if (!targetRoot) continue;
|
|
377
|
+
const targetDir = join3(targetRoot, skill.name);
|
|
378
|
+
if (targetDir === hubDir) continue;
|
|
379
|
+
installSkillAtPath(targetDir, hubDir, options.method);
|
|
380
|
+
files.push(relativeFromRoot(options.homeRoot, targetDir));
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return { installed, files };
|
|
384
|
+
}
|
|
385
|
+
async function installSkillsToProject(options) {
|
|
386
|
+
const effectiveMethod = resolveEffectiveMethod(options.method, options.materializationStrategy);
|
|
387
|
+
const installed = [];
|
|
388
|
+
const files = [];
|
|
389
|
+
for (const skill of options.skills) {
|
|
390
|
+
const sourceDir = join3(options.checkoutRoot, skill.skillDirRelative);
|
|
391
|
+
const hubDir = join3(options.projectRoot, ".agents/skills", skill.name);
|
|
392
|
+
installSkillAtPath(hubDir, sourceDir, effectiveMethod);
|
|
393
|
+
files.push(join3(".agents/skills", skill.name));
|
|
394
|
+
installed.push(skill.name);
|
|
395
|
+
for (const harness of options.harnesses) {
|
|
396
|
+
const targetRoot = resolveProjectSkillPath(options.projectRoot, harness);
|
|
397
|
+
if (!targetRoot) continue;
|
|
398
|
+
const targetDir = join3(targetRoot, skill.name);
|
|
399
|
+
if (targetDir === hubDir) continue;
|
|
400
|
+
installSkillAtPath(targetDir, hubDir, effectiveMethod);
|
|
401
|
+
files.push(relativeFromRoot(options.projectRoot, targetDir));
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
return { installed, files };
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// src/services/wizards/prompts/hooks/use-debounced-remote-search.ts
|
|
408
|
+
import { useEffect, useRef, useState } from "@inquirer/core";
|
|
409
|
+
function createDebouncedRemoteSearchRunner(config) {
|
|
410
|
+
const debounceMs = config.debounceMs ?? 300;
|
|
411
|
+
const requestRef = { current: 0 };
|
|
412
|
+
const debounceRef = { current: null };
|
|
413
|
+
async function runSearch(nextQuery) {
|
|
414
|
+
const requestId = ++requestRef.current;
|
|
415
|
+
config.setLoading(true);
|
|
416
|
+
config.setError(null);
|
|
417
|
+
try {
|
|
418
|
+
const results = await config.searchFn(nextQuery, config.limitFor(nextQuery));
|
|
419
|
+
if (requestId !== requestRef.current) {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
config.setItems(results);
|
|
423
|
+
} catch (searchError) {
|
|
424
|
+
if (requestId !== requestRef.current) {
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
config.setItems([]);
|
|
428
|
+
config.setError(searchError instanceof Error ? searchError.message : String(searchError));
|
|
429
|
+
} finally {
|
|
430
|
+
if (requestId === requestRef.current) {
|
|
431
|
+
config.setLoading(false);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
function scheduleSearch(nextQuery) {
|
|
436
|
+
if (debounceRef.current) {
|
|
437
|
+
clearTimeout(debounceRef.current);
|
|
438
|
+
}
|
|
439
|
+
debounceRef.current = setTimeout(() => {
|
|
440
|
+
void runSearch(nextQuery);
|
|
441
|
+
}, debounceMs);
|
|
442
|
+
}
|
|
443
|
+
function invalidate() {
|
|
444
|
+
requestRef.current += 1;
|
|
445
|
+
if (debounceRef.current) {
|
|
446
|
+
clearTimeout(debounceRef.current);
|
|
447
|
+
debounceRef.current = null;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
return { runSearch, scheduleSearch, invalidate };
|
|
451
|
+
}
|
|
452
|
+
function useDebouncedRemoteSearch(config) {
|
|
453
|
+
const [items, setItems] = useState([]);
|
|
454
|
+
const [loading, setLoading] = useState(true);
|
|
455
|
+
const [error, setError] = useState(null);
|
|
456
|
+
const runnerRef = useRef(null);
|
|
457
|
+
const limitForRef = useRef(config.limitFor);
|
|
458
|
+
limitForRef.current = config.limitFor;
|
|
459
|
+
if (!runnerRef.current) {
|
|
460
|
+
runnerRef.current = createDebouncedRemoteSearchRunner({
|
|
461
|
+
debounceMs: config.debounceMs,
|
|
462
|
+
limitFor: (query) => limitForRef.current(query),
|
|
463
|
+
searchFn: config.searchFn,
|
|
464
|
+
setItems,
|
|
465
|
+
setLoading,
|
|
466
|
+
setError
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
const { runSearch, scheduleSearch, invalidate } = runnerRef.current;
|
|
470
|
+
useEffect(() => {
|
|
471
|
+
void runSearch(config.initialQuery ?? "");
|
|
472
|
+
return invalidate;
|
|
473
|
+
}, []);
|
|
474
|
+
return { items, loading, error, scheduleSearch };
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// src/services/wizards/prompts/create-remote-catalog-list-prompt.ts
|
|
478
|
+
import {
|
|
479
|
+
createPrompt,
|
|
480
|
+
ExitPromptError,
|
|
481
|
+
isBackspaceKey,
|
|
482
|
+
isDownKey,
|
|
483
|
+
isEnterKey,
|
|
484
|
+
isSpaceKey,
|
|
485
|
+
isUpKey,
|
|
486
|
+
makeTheme,
|
|
487
|
+
useKeypress,
|
|
488
|
+
usePrefix,
|
|
489
|
+
useState as useState2
|
|
490
|
+
} from "@inquirer/core";
|
|
491
|
+
function toSelection(plugin) {
|
|
492
|
+
return {
|
|
493
|
+
orgSlug: plugin.orgSlug,
|
|
494
|
+
catalogSlug: plugin.catalogSlug,
|
|
495
|
+
slug: plugin.slug,
|
|
496
|
+
version: plugin.latestVersion,
|
|
497
|
+
selector: formatCanonicalPublishedSelectorWithVersion({
|
|
498
|
+
org: plugin.orgSlug,
|
|
499
|
+
catalog: plugin.catalogSlug,
|
|
500
|
+
name: plugin.slug,
|
|
501
|
+
version: plugin.latestVersion ?? void 0
|
|
502
|
+
})
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
var createRemoteCatalogListPrompt = createPrompt((config, done) => {
|
|
506
|
+
const isApplyMode = config.mode.kind === "apply";
|
|
507
|
+
const promptTheme = makeTheme(interactivePromptTheme, {});
|
|
508
|
+
const prefix = usePrefix({ status: "idle", theme: promptTheme });
|
|
509
|
+
const [query, setQuery] = useState2(config.initialQuery ?? "");
|
|
510
|
+
const [active, setActive] = useState2(0);
|
|
511
|
+
const [checkedPlugins, setCheckedPlugins] = useState2(
|
|
512
|
+
() => /* @__PURE__ */ new Map()
|
|
513
|
+
);
|
|
514
|
+
const [view, setView] = useState2("browse");
|
|
515
|
+
const [showingPlugin, setShowingPlugin] = useState2(null);
|
|
516
|
+
const [pendingExitMessage, setPendingExitMessage] = useState2(null);
|
|
517
|
+
const { width: terminalWidth, height: terminalRows } = useTerminalSize();
|
|
518
|
+
const { items: plugins, loading, error, scheduleSearch } = useDebouncedRemoteSearch({
|
|
519
|
+
initialQuery: config.initialQuery,
|
|
520
|
+
limitFor: (nextQuery) => nextQuery.trim() ? 25 : 10,
|
|
521
|
+
searchFn: (nextQuery, limit) => config.listPlugins({ q: nextQuery, limit })
|
|
522
|
+
});
|
|
523
|
+
const clampedActive = clampActiveIndex(active, plugins.length);
|
|
524
|
+
const activePlugin = plugins[clampedActive];
|
|
525
|
+
const activePluginKey = activePlugin ? catalogPluginKey(activePlugin) : void 0;
|
|
526
|
+
function togglePlugin(plugin) {
|
|
527
|
+
const key = catalogPluginKey(plugin);
|
|
528
|
+
const next = new Map(checkedPlugins);
|
|
529
|
+
if (next.has(key)) {
|
|
530
|
+
next.delete(key);
|
|
531
|
+
} else {
|
|
532
|
+
next.set(key, plugin);
|
|
533
|
+
}
|
|
534
|
+
setCheckedPlugins(next);
|
|
535
|
+
}
|
|
536
|
+
function selectVisiblePlugins() {
|
|
537
|
+
const next = new Map(checkedPlugins);
|
|
538
|
+
for (const plugin of plugins) {
|
|
539
|
+
next.set(catalogPluginKey(plugin), plugin);
|
|
540
|
+
}
|
|
541
|
+
setCheckedPlugins(next);
|
|
542
|
+
}
|
|
543
|
+
function clearVisiblePlugins() {
|
|
544
|
+
const next = new Map(checkedPlugins);
|
|
545
|
+
for (const plugin of plugins) {
|
|
546
|
+
next.delete(catalogPluginKey(plugin));
|
|
547
|
+
}
|
|
548
|
+
setCheckedPlugins(next);
|
|
549
|
+
}
|
|
550
|
+
function finishInstall(plugin) {
|
|
551
|
+
const result = toSelection(plugin);
|
|
552
|
+
done(result);
|
|
553
|
+
}
|
|
554
|
+
function finishApply() {
|
|
555
|
+
const result = {
|
|
556
|
+
selections: [...checkedPlugins.values()].map(toSelection)
|
|
557
|
+
};
|
|
558
|
+
done(result);
|
|
559
|
+
}
|
|
560
|
+
useKeypress((key) => {
|
|
561
|
+
if (isApplyMode && view === "show") {
|
|
562
|
+
if (isEscapeKey(key)) {
|
|
563
|
+
setView("browse");
|
|
564
|
+
setShowingPlugin(null);
|
|
565
|
+
}
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
if (isEscapeKey(key)) {
|
|
569
|
+
setPendingExitMessage(
|
|
570
|
+
isApplyMode ? "Catalog search cancelled." : "Catalog browse cancelled."
|
|
571
|
+
);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
if (isApplyMode && key.ctrl && key.name === "s") {
|
|
575
|
+
if (checkedPlugins.size > 0) {
|
|
576
|
+
finishApply();
|
|
577
|
+
}
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
if (isEnterKey(key)) {
|
|
581
|
+
if (!activePlugin) {
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
if (isApplyMode) {
|
|
585
|
+
setShowingPlugin(activePlugin);
|
|
586
|
+
setView("show");
|
|
587
|
+
} else {
|
|
588
|
+
finishInstall(activePlugin);
|
|
589
|
+
}
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
if (plugins.length > 0 && (isUpKey(key) || isDownKey(key))) {
|
|
593
|
+
const direction = isUpKey(key) ? -1 : 1;
|
|
594
|
+
setActive(clampActiveIndex(clampedActive + direction, plugins.length));
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
if (isApplyMode && plugins.length > 0 && isSpaceKey(key) && activePlugin) {
|
|
598
|
+
togglePlugin(activePlugin);
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
if (isApplyMode && key.ctrl && key.name === "a") {
|
|
602
|
+
selectVisiblePlugins();
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
if (isApplyMode && key.ctrl && key.name === "x") {
|
|
606
|
+
clearVisiblePlugins();
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
if (isBackspaceKey(key)) {
|
|
610
|
+
const nextQuery = query.slice(0, -1);
|
|
611
|
+
setQuery(nextQuery);
|
|
612
|
+
setActive(0);
|
|
613
|
+
scheduleSearch(nextQuery);
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
if (isSearchCharacter(key)) {
|
|
617
|
+
const nextQuery = query + key.sequence;
|
|
618
|
+
setQuery(nextQuery);
|
|
619
|
+
setActive(0);
|
|
620
|
+
scheduleSearch(nextQuery);
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
if (pendingExitMessage) {
|
|
624
|
+
throw new ExitPromptError(pendingExitMessage);
|
|
625
|
+
}
|
|
626
|
+
if (isApplyMode && view === "show" && showingPlugin) {
|
|
627
|
+
const helpLine2 = buildHelpLine([["esc", "back"]]);
|
|
628
|
+
return [renderCatalogPluginShow(showingPlugin), "", helpLine2].join("\n");
|
|
629
|
+
}
|
|
630
|
+
const helpLine = isApplyMode ? buildHelpLine([
|
|
631
|
+
["\u2191\u2193", "navigate"],
|
|
632
|
+
["space", "toggle"],
|
|
633
|
+
["type", "search"],
|
|
634
|
+
["\u232B", "erase"],
|
|
635
|
+
["\u23CE", "show"],
|
|
636
|
+
["ctrl+s", "apply"],
|
|
637
|
+
["esc", "cancel"],
|
|
638
|
+
["ctrl+a", "all"],
|
|
639
|
+
["ctrl+x", "none"]
|
|
640
|
+
]) : buildHelpLine([
|
|
641
|
+
["\u2191\u2193", "select"],
|
|
642
|
+
["type", "search"],
|
|
643
|
+
["\u232B", "erase"],
|
|
644
|
+
["\u23CE", "install"],
|
|
645
|
+
["esc", "cancel"]
|
|
646
|
+
]);
|
|
647
|
+
const tableSection = error ? theme.danger(error) : isApplyMode ? renderCatalogSearchViewport(plugins, new Set(checkedPlugins.keys()), {
|
|
648
|
+
activePluginKey,
|
|
649
|
+
activeIndex: clampedActive,
|
|
650
|
+
terminalRows,
|
|
651
|
+
maxWidth: terminalWidth
|
|
652
|
+
}) : renderCatalogListViewport(plugins, {
|
|
653
|
+
activeIndex: clampedActive,
|
|
654
|
+
terminalRows,
|
|
655
|
+
maxWidth: terminalWidth
|
|
656
|
+
});
|
|
657
|
+
return [
|
|
658
|
+
`${prefix} ${promptTheme.style.message(config.message, "idle")}`,
|
|
659
|
+
theme.muted(`Catalog: ${config.scopeLabel}`),
|
|
660
|
+
...isApplyMode ? [theme.muted("Apply writes harness files: choose project or global scope after selecting")] : [],
|
|
661
|
+
`${theme.label("Search:")} ${query ? theme.entity(query) : theme.muted("(type to filter)")}`,
|
|
662
|
+
...isApplyMode ? [`Selected: ${checkedPlugins.size} to apply`] : [],
|
|
663
|
+
...loading && plugins.length === 0 ? [theme.muted("Loading plugins...")] : [],
|
|
664
|
+
"",
|
|
665
|
+
tableSection,
|
|
666
|
+
"",
|
|
667
|
+
helpLine
|
|
668
|
+
].join("\n");
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
export {
|
|
672
|
+
useDebouncedRemoteSearch,
|
|
673
|
+
createRemoteCatalogListPrompt,
|
|
674
|
+
importSkillPackage,
|
|
675
|
+
installSkillsToGlobal,
|
|
676
|
+
installSkillsToProject,
|
|
677
|
+
DEFAULT_EXCLUDED_SKILL_CATEGORIES,
|
|
678
|
+
defaultInteractiveSkillNames,
|
|
679
|
+
resolveSkillPackageCheckout,
|
|
680
|
+
resolveSelectedSkills
|
|
681
|
+
};
|
|
682
|
+
//# sourceMappingURL=chunk-H6DVP2SI.js.map
|