skild 0.10.20 → 0.10.22

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -7
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -332,17 +332,22 @@ async function promptSkillsTreeInteractive(skills, tree, options = {}) {
332
332
  async function promptPlatformsInteractive(options = {}) {
333
333
  const platforms = options.platforms && options.platforms.length > 0 ? options.platforms : PLATFORMS;
334
334
  const platformItems = platforms.map((p) => ({ platform: p }));
335
+ const installedSet = new Set(options.installedPlatforms ?? []);
336
+ const defaultSelected = installedSet.size > 0 ? new Set(platforms.flatMap((p, idx) => installedSet.has(p) ? [idx] : [])) : void 0;
335
337
  const selectedIndices = await interactiveTreeSelect(platformItems, {
336
338
  title: "Select target platforms",
337
339
  subtitle: "\u2191\u2193 navigate \u2022 Space toggle \u2022 Enter confirm",
338
340
  buildTree: buildPlatformTree,
339
341
  formatNode: (node, selection, isCursor, maxWidth) => {
340
342
  const displayName = node.name === "All Platforms" ? node.name : PLATFORM_DISPLAY[node.name] || node.name;
343
+ const installedSuffix = node.name !== "All Platforms" && installedSet.has(node.name) ? " [installed]" : "";
341
344
  return formatTreeNode({ ...node, name: displayName }, selection, isCursor, maxWidth, {
345
+ suffixText: installedSuffix,
342
346
  hintText: buildSpaceHint(node, selection)
343
347
  });
344
348
  },
345
- defaultAll: options.defaultAll !== false
349
+ defaultAll: options.defaultAll !== false,
350
+ defaultSelected
346
351
  });
347
352
  if (!selectedIndices) return null;
348
353
  const selected = selectedIndices.map((i) => platforms[i]);
@@ -1098,8 +1103,8 @@ function getInstalledPlatforms(scope) {
1098
1103
  return PLATFORMS2.filter((platform) => listSkills({ platform, scope }).length > 0);
1099
1104
  }
1100
1105
  function getPlatformPromptList(scope) {
1101
- const installed = getInstalledPlatforms(scope);
1102
- return installed.length > 0 ? installed : [...PLATFORMS2];
1106
+ void scope;
1107
+ return [...PLATFORMS2];
1103
1108
  }
1104
1109
  function normalizeSkillSelector(input) {
1105
1110
  const trimmed = input.trim();
@@ -1364,9 +1369,11 @@ async function promptSelections(ctx) {
1364
1369
  if (ctx.isSingleSkill) {
1365
1370
  if (ctx.needsPlatformPrompt) {
1366
1371
  if (ctx.spinner) ctx.spinner.stop();
1372
+ const installedPlatforms = getInstalledPlatforms(ctx.scope);
1367
1373
  const selectedPlatforms = await promptPlatformsInteractive({
1368
- defaultAll: true,
1369
- platforms: getPlatformPromptList(ctx.scope)
1374
+ defaultAll: installedPlatforms.length === 0,
1375
+ platforms: getPlatformPromptList(ctx.scope),
1376
+ installedPlatforms
1370
1377
  });
1371
1378
  if (!selectedPlatforms) {
1372
1379
  console.log(chalk3.red("No platforms selected."));
@@ -1431,9 +1438,11 @@ async function promptSelections(ctx) {
1431
1438
  }
1432
1439
  ctx.selectedSkills = selected;
1433
1440
  if (ctx.needsPlatformPrompt) {
1441
+ const installedPlatforms = getInstalledPlatforms(ctx.scope);
1434
1442
  const selectedPlatforms = await promptPlatformsInteractive({
1435
- defaultAll: true,
1436
- platforms: getPlatformPromptList(ctx.scope)
1443
+ defaultAll: installedPlatforms.length === 0,
1444
+ platforms: getPlatformPromptList(ctx.scope),
1445
+ installedPlatforms
1437
1446
  });
1438
1447
  if (!selectedPlatforms) {
1439
1448
  console.log(chalk3.red("No platforms selected."));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skild",
3
- "version": "0.10.20",
3
+ "version": "0.10.22",
4
4
  "description": "The npm for Agent Skills — Discover, install, manage, and publish AI Agent Skills with ease.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,7 +43,7 @@
43
43
  "string-width": "^8.1.0",
44
44
  "tar": "^7.4.3",
45
45
  "unified": "^11.0.4",
46
- "@skild/core": "^0.10.19"
46
+ "@skild/core": "^0.10.22"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/mdast": "^4.0.4",