skilld 1.7.4 → 2.1.0
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 +25 -0
- package/dist/_chunks/add.mjs +67 -0
- package/dist/_chunks/add.mjs.map +1 -0
- package/dist/_chunks/agent-prompt.mjs +88 -0
- package/dist/_chunks/agent-prompt.mjs.map +1 -0
- package/dist/_chunks/agent.mjs +359 -157
- package/dist/_chunks/agent.mjs.map +1 -1
- package/dist/_chunks/args.mjs +42 -0
- package/dist/_chunks/args.mjs.map +1 -0
- package/dist/_chunks/assemble.mjs +12 -9
- package/dist/_chunks/assemble.mjs.map +1 -1
- package/dist/_chunks/author.mjs +35 -19
- package/dist/_chunks/author.mjs.map +1 -1
- package/dist/_chunks/cache.mjs +153 -185
- package/dist/_chunks/cache.mjs.map +1 -1
- package/dist/_chunks/cache2.mjs +9 -8
- package/dist/_chunks/cache2.mjs.map +1 -1
- package/dist/_chunks/client.mjs +118 -0
- package/dist/_chunks/client.mjs.map +1 -0
- package/dist/_chunks/core.mjs +5 -5
- package/dist/_chunks/detect.mjs +54 -44
- package/dist/_chunks/detect.mjs.map +1 -1
- package/dist/_chunks/detect2.mjs +1 -1
- package/dist/_chunks/eject.mjs +69 -0
- package/dist/_chunks/eject.mjs.map +1 -0
- package/dist/_chunks/embedding-cache.mjs +1 -1
- package/dist/_chunks/embedding-cache2.mjs +2 -2
- package/dist/_chunks/embedding-cache2.mjs.map +1 -1
- package/dist/_chunks/env.mjs +19 -0
- package/dist/_chunks/env.mjs.map +1 -0
- package/dist/_chunks/install-many.mjs +377 -0
- package/dist/_chunks/install-many.mjs.map +1 -0
- package/dist/_chunks/install.mjs +93 -334
- package/dist/_chunks/install.mjs.map +1 -1
- package/dist/_chunks/intro.mjs +63 -0
- package/dist/_chunks/intro.mjs.map +1 -0
- package/dist/_chunks/list.mjs +5 -4
- package/dist/_chunks/list.mjs.map +1 -1
- package/dist/_chunks/lockfile.mjs +10 -7
- package/dist/_chunks/lockfile.mjs.map +1 -1
- package/dist/_chunks/login.mjs +234 -0
- package/dist/_chunks/login.mjs.map +1 -0
- package/dist/_chunks/logout.mjs +27 -0
- package/dist/_chunks/logout.mjs.map +1 -0
- package/dist/_chunks/map.mjs +11 -0
- package/dist/_chunks/map.mjs.map +1 -0
- package/dist/_chunks/markdown.mjs +81 -56
- package/dist/_chunks/markdown.mjs.map +1 -1
- package/dist/_chunks/menu.mjs +33 -0
- package/dist/_chunks/menu.mjs.map +1 -0
- package/dist/_chunks/model-picker.mjs +61 -0
- package/dist/_chunks/model-picker.mjs.map +1 -0
- package/dist/_chunks/monorepo.mjs +7 -4
- package/dist/_chunks/monorepo.mjs.map +1 -1
- package/dist/_chunks/package-json.mjs +7 -5
- package/dist/_chunks/package-json.mjs.map +1 -1
- package/dist/_chunks/paths.mjs +3 -5
- package/dist/_chunks/paths.mjs.map +1 -1
- package/dist/_chunks/{sync-pipeline.mjs → pipeline.mjs} +360 -323
- package/dist/_chunks/pipeline.mjs.map +1 -0
- package/dist/_chunks/pool.mjs +1 -1
- package/dist/_chunks/pool2.mjs +2 -2
- package/dist/_chunks/pool2.mjs.map +1 -1
- package/dist/_chunks/portable.mjs +151 -0
- package/dist/_chunks/portable.mjs.map +1 -0
- package/dist/_chunks/prepare-hook.mjs +2 -0
- package/dist/_chunks/prepare-hook2.mjs +61 -0
- package/dist/_chunks/prepare-hook2.mjs.map +1 -0
- package/dist/_chunks/prepare.mjs +58 -8
- package/dist/_chunks/prepare.mjs.map +1 -1
- package/dist/_chunks/prepare2.mjs +14 -11
- package/dist/_chunks/prepare2.mjs.map +1 -1
- package/dist/_chunks/prompts.mjs +488 -76
- package/dist/_chunks/prompts.mjs.map +1 -1
- package/dist/_chunks/pull.mjs +220 -0
- package/dist/_chunks/pull.mjs.map +1 -0
- package/dist/_chunks/regex.mjs +19 -0
- package/dist/_chunks/regex.mjs.map +1 -0
- package/dist/_chunks/retriv.mjs +2 -171
- package/dist/_chunks/retriv2.mjs +159 -0
- package/dist/_chunks/retriv2.mjs.map +1 -0
- package/dist/_chunks/sanitize.mjs +13 -10
- package/dist/_chunks/sanitize.mjs.map +1 -1
- package/dist/_chunks/search-helpers.mjs +11 -9
- package/dist/_chunks/search-helpers.mjs.map +1 -1
- package/dist/_chunks/search-interactive.mjs +25 -22
- package/dist/_chunks/search-interactive.mjs.map +1 -1
- package/dist/_chunks/search.mjs +6 -6
- package/dist/_chunks/search.mjs.map +1 -1
- package/dist/_chunks/semver.mjs +2793 -5
- package/dist/_chunks/semver.mjs.map +1 -1
- package/dist/_chunks/skill-installer.mjs +1 -1
- package/dist/_chunks/skill-installer2.mjs +31 -23
- package/dist/_chunks/skill-installer2.mjs.map +1 -1
- package/dist/_chunks/skills.mjs +9 -10
- package/dist/_chunks/skills.mjs.map +1 -1
- package/dist/_chunks/store.mjs +107 -0
- package/dist/_chunks/store.mjs.map +1 -0
- package/dist/_chunks/sync.mjs +422 -915
- package/dist/_chunks/sync.mjs.map +1 -1
- package/dist/_chunks/sync2.mjs +2 -5
- package/dist/_chunks/telemetry.mjs +26 -0
- package/dist/_chunks/telemetry.mjs.map +1 -0
- package/dist/_chunks/uninstall.mjs +38 -32
- package/dist/_chunks/uninstall.mjs.map +1 -1
- package/dist/_chunks/update.mjs +172 -0
- package/dist/_chunks/update.mjs.map +1 -0
- package/dist/_chunks/upload.mjs +16 -13
- package/dist/_chunks/upload.mjs.map +1 -1
- package/dist/_chunks/validate.mjs +1 -1
- package/dist/_chunks/validate.mjs.map +1 -1
- package/dist/_chunks/version.mjs +16 -17
- package/dist/_chunks/version.mjs.map +1 -1
- package/dist/_chunks/whoami.mjs +21 -0
- package/dist/_chunks/whoami.mjs.map +1 -0
- package/dist/_chunks/wizard.mjs +2 -190
- package/dist/_chunks/wizard2.mjs +200 -0
- package/dist/_chunks/wizard2.mjs.map +1 -0
- package/dist/_chunks/yaml.mjs +1 -1
- package/dist/_chunks/yaml.mjs.map +1 -1
- package/dist/cli-entry.d.mts +1 -1
- package/dist/cli.d.mts +1 -1
- package/dist/cli.mjs +94 -71
- package/dist/cli.mjs.map +1 -1
- package/dist/prepare.d.mts +1 -1
- package/dist/prepare.mjs +9 -6
- package/dist/prepare.mjs.map +1 -1
- package/dist/retriv/worker.d.mts +5 -1
- package/dist/retriv/worker.d.mts.map +1 -1
- package/dist/retriv/worker.mjs +1 -1
- package/dist/retriv/worker.mjs.map +1 -1
- package/package.json +27 -37
- package/dist/_chunks/author-group.mjs +0 -17
- package/dist/_chunks/author-group.mjs.map +0 -1
- package/dist/_chunks/cli-helpers.mjs +0 -335
- package/dist/_chunks/cli-helpers.mjs.map +0 -1
- package/dist/_chunks/cli-helpers2.mjs +0 -2
- package/dist/_chunks/index.d.mts +0 -344
- package/dist/_chunks/index.d.mts.map +0 -1
- package/dist/_chunks/index2.d.mts +0 -279
- package/dist/_chunks/index2.d.mts.map +0 -1
- package/dist/_chunks/index3.d.mts +0 -44
- package/dist/_chunks/index3.d.mts.map +0 -1
- package/dist/_chunks/index4.d.mts +0 -553
- package/dist/_chunks/index4.d.mts.map +0 -1
- package/dist/_chunks/package-registry.mjs +0 -465
- package/dist/_chunks/package-registry.mjs.map +0 -1
- package/dist/_chunks/retriv.mjs.map +0 -1
- package/dist/_chunks/setup.mjs +0 -17
- package/dist/_chunks/setup.mjs.map +0 -1
- package/dist/_chunks/sources.mjs +0 -2654
- package/dist/_chunks/sources.mjs.map +0 -1
- package/dist/_chunks/sync-pipeline.mjs.map +0 -1
- package/dist/_chunks/sync-registry.mjs +0 -65
- package/dist/_chunks/sync-registry.mjs.map +0 -1
- package/dist/_chunks/types.d.mts +0 -76
- package/dist/_chunks/types.d.mts.map +0 -1
- package/dist/_chunks/types2.d.mts +0 -88
- package/dist/_chunks/types2.d.mts.map +0 -1
- package/dist/_chunks/wizard.mjs.map +0 -1
- package/dist/agent/index.d.mts +0 -2
- package/dist/agent/index.mjs +0 -4
- package/dist/cache/index.d.mts +0 -2
- package/dist/cache/index.mjs +0 -5
- package/dist/index.d.mts +0 -6
- package/dist/index.mjs +0 -6
- package/dist/retriv/index.d.mts +0 -3
- package/dist/retriv/index.mjs +0 -2
- package/dist/sources/index.d.mts +0 -3
- package/dist/sources/index.mjs +0 -3
- package/dist/types.d.mts +0 -4
- package/dist/types.mjs +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,31 +1,40 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
2
|
+
import { detectInstalledAgents, detectTargetAgent, getAgentVersion, targets } from "./_chunks/detect.mjs";
|
|
3
|
+
import { detectImportedPackages, getAvailableModels, getModelName, getOAuthProviderList, loginOAuthProvider, logoutOAuthProvider } from "./_chunks/agent.mjs";
|
|
4
|
+
import { formatSource, timeAgo, timedSpinner, unlinkSkillFromAgents } from "./_chunks/prompts.mjs";
|
|
5
|
+
import { CACHE_DIR, getPackageDbPath, getSharedSkillsDir, skillInternalDir } from "./_chunks/paths.mjs";
|
|
6
|
+
import { COMMA_OR_WHITESPACE_RE, VERSION_RANGE_PREFIX_RE } from "./_chunks/regex.mjs";
|
|
7
|
+
import { getCacheDir } from "./_chunks/prepare.mjs";
|
|
8
|
+
import { readPackageJsonSafe } from "./_chunks/package-json.mjs";
|
|
9
|
+
import { defaultFeatures, hasCompletedWizard, hasConfig, readConfig, updateConfig } from "./_chunks/cache.mjs";
|
|
10
|
+
import { isInteractive, isRunningInsideAgent, requireInteractive } from "./_chunks/env.mjs";
|
|
11
|
+
import { promptForAgent, resolveAgent } from "./_chunks/agent-prompt.mjs";
|
|
12
|
+
import { sharedArgs } from "./_chunks/args.mjs";
|
|
13
|
+
import { version } from "./_chunks/version.mjs";
|
|
14
|
+
import { formatStatus, getInstalledGenerators, getRepoHint, introLine, relativeTime } from "./_chunks/intro.mjs";
|
|
15
|
+
import { guard, menuLoop } from "./_chunks/menu.mjs";
|
|
16
|
+
import { hasPrepareHook, suggestPrepareHook } from "./_chunks/prepare-hook2.mjs";
|
|
17
|
+
import { NO_MODELS_MESSAGE, OAUTH_NOTE, pickModel } from "./_chunks/model-picker.mjs";
|
|
18
|
+
import { fetchLatestVersion, fetchNpmRegistryMeta, resolveSkillName, semverGt, toStoragePackageName } from "./_chunks/semver.mjs";
|
|
19
|
+
import { mapInsert } from "./_chunks/map.mjs";
|
|
20
|
+
import { parsePackages, removeLockEntry } from "./_chunks/lockfile.mjs";
|
|
21
|
+
import { getProjectState, getSkillsDir, isOutdated, iterateSkills } from "./_chunks/skills.mjs";
|
|
22
|
+
import { runWizard } from "./_chunks/wizard2.mjs";
|
|
15
23
|
import "./_chunks/core.mjs";
|
|
16
24
|
import { existsSync, readFileSync, readdirSync, realpathSync, rmSync, statSync } from "node:fs";
|
|
17
|
-
import {
|
|
18
|
-
import pLimit from "p-limit";
|
|
25
|
+
import { styleText } from "node:util";
|
|
19
26
|
import * as p from "@clack/prompts";
|
|
20
27
|
import { defineCommand, runMain } from "citty";
|
|
28
|
+
import pLimit from "p-limit";
|
|
29
|
+
import { join, resolve } from "pathe";
|
|
21
30
|
import logUpdate from "log-update";
|
|
22
31
|
async function configCommand() {
|
|
23
32
|
const initConfig = readConfig();
|
|
24
33
|
const agentId = initConfig.agent || detectTargetAgent() || void 0;
|
|
25
|
-
const cyan = (s) =>
|
|
34
|
+
const cyan = (s) => styleText("cyan", s);
|
|
26
35
|
const modelLabel = initConfig.skipLlm ? "skip" : initConfig.model ? cyan(getModelName(initConfig.model)) : "auto";
|
|
27
36
|
const agentLabel = agentId && targets[agentId] ? cyan(targets[agentId].displayName) : "auto-detect";
|
|
28
|
-
p.note(
|
|
37
|
+
p.note(styleText("gray", `Fetch docs → Enhance with ${modelLabel} → Install to ${agentLabel}`), "How skilld works");
|
|
29
38
|
await menuLoop({
|
|
30
39
|
message: "Settings",
|
|
31
40
|
options: () => {
|
|
@@ -135,7 +144,7 @@ async function configureOAuth() {
|
|
|
135
144
|
return getOAuthProviderList().map((pr) => ({
|
|
136
145
|
label: pr.name,
|
|
137
146
|
value: pr.id,
|
|
138
|
-
hint: pr.loggedIn ? "
|
|
147
|
+
hint: pr.loggedIn ? styleText("green", "connected") : "not connected"
|
|
139
148
|
}));
|
|
140
149
|
},
|
|
141
150
|
onSelect: async (providerId) => {
|
|
@@ -152,7 +161,7 @@ async function configureOAuth() {
|
|
|
152
161
|
value: "back"
|
|
153
162
|
}]
|
|
154
163
|
})) === "disconnect") {
|
|
155
|
-
logoutOAuthProvider(providerId);
|
|
164
|
+
await logoutOAuthProvider(providerId);
|
|
156
165
|
p.log.success(`Disconnected from ${pr.name}`);
|
|
157
166
|
}
|
|
158
167
|
return;
|
|
@@ -162,8 +171,8 @@ async function configureOAuth() {
|
|
|
162
171
|
const success = await loginOAuthProvider(providerId, {
|
|
163
172
|
onAuth: (url, instructions) => {
|
|
164
173
|
spinner.stop("Open this URL in your browser:");
|
|
165
|
-
p.log.info(`
|
|
166
|
-
if (instructions) p.log.info(`
|
|
174
|
+
p.log.info(` ${styleText("cyan", url)}`);
|
|
175
|
+
if (instructions) p.log.info(` ${styleText("gray", instructions)}`);
|
|
167
176
|
spinner.start("Waiting for authentication...");
|
|
168
177
|
},
|
|
169
178
|
onPrompt: async (message, placeholder) => {
|
|
@@ -244,7 +253,8 @@ const configCommandDef = defineCommand({
|
|
|
244
253
|
args: {},
|
|
245
254
|
async run() {
|
|
246
255
|
requireInteractive("config");
|
|
247
|
-
const
|
|
256
|
+
const cwd = process.cwd();
|
|
257
|
+
const state = await getProjectState(cwd);
|
|
248
258
|
p.intro(introLine({ state }));
|
|
249
259
|
return configCommand();
|
|
250
260
|
}
|
|
@@ -343,7 +353,7 @@ const removeCommandDef = defineCommand({
|
|
|
343
353
|
packages: args.package ? [...new Set([args.package, ...args._ || []].map((s) => s.trim()).filter(Boolean).map((s) => {
|
|
344
354
|
const name = resolveSkillName(s);
|
|
345
355
|
if (!name) {
|
|
346
|
-
p.log.warn(`Cannot remove
|
|
356
|
+
p.log.warn(`Cannot remove ${styleText("cyan", s)}: curator/collection inputs are not addressable here.`);
|
|
347
357
|
return null;
|
|
348
358
|
}
|
|
349
359
|
return name;
|
|
@@ -409,9 +419,9 @@ function countRefDocs(skillDir) {
|
|
|
409
419
|
walk(refsDir);
|
|
410
420
|
return count;
|
|
411
421
|
}
|
|
412
|
-
const dim = (s) =>
|
|
413
|
-
const bold = (s) =>
|
|
414
|
-
const green = (s) =>
|
|
422
|
+
const dim = (s) => styleText("gray", s);
|
|
423
|
+
const bold = (s) => styleText("bold", s);
|
|
424
|
+
const green = (s) => styleText("green", s);
|
|
415
425
|
function getLastSynced() {
|
|
416
426
|
let latest = null;
|
|
417
427
|
for (const skill of iterateSkills()) if (skill.info?.syncedAt) {
|
|
@@ -461,7 +471,8 @@ async function statusCommand(opts = {}) {
|
|
|
461
471
|
const globalPkgs = /* @__PURE__ */ new Map();
|
|
462
472
|
for (const skill of allSkills) {
|
|
463
473
|
const key = skill.info?.packageName || skill.name;
|
|
464
|
-
|
|
474
|
+
const map = skill.scope === "local" ? localPkgs : globalPkgs;
|
|
475
|
+
mapInsert(map, key, () => ({
|
|
465
476
|
name: skill.name,
|
|
466
477
|
info: skill.info || {},
|
|
467
478
|
agents: /* @__PURE__ */ new Set(),
|
|
@@ -474,7 +485,8 @@ async function statusCommand(opts = {}) {
|
|
|
474
485
|
const { info } = pkg;
|
|
475
486
|
const icon = info.source === "shipped" ? "▶" : "◆";
|
|
476
487
|
const pkgsList = parsePackages(info.packages);
|
|
477
|
-
const
|
|
488
|
+
const nameDisplay = pkgsList.length > 1 ? `${pkg.name} ${dim(`(${pkgsList.map((p) => p.name).join(", ")})`)}` : pkg.name;
|
|
489
|
+
const parts = [`${icon} ${bold(nameDisplay)}`];
|
|
478
490
|
if (info.version) parts.push(dim(info.version));
|
|
479
491
|
const source = formatSource(info.source);
|
|
480
492
|
if (source && source !== "shipped") parts.push(dim(source));
|
|
@@ -581,8 +593,8 @@ function brandFrame(t, floor = 0, density = 0) {
|
|
|
581
593
|
async function brandLoader(work, minMs = 1500) {
|
|
582
594
|
if (process.env.SKILLD_EFFECT === "none") return work();
|
|
583
595
|
const name = "\x1B[1m\x1B[38;2;255;255;255mskilld\x1B[0m";
|
|
584
|
-
const verStr =
|
|
585
|
-
const status = "
|
|
596
|
+
const verStr = styleText("dim", `v${version}`);
|
|
597
|
+
const status = styleText("dim", "Setting up your environment");
|
|
586
598
|
const start = Date.now();
|
|
587
599
|
const sub = (raw) => raw.replace("%NAME%", name).replace("%VER%", verStr);
|
|
588
600
|
let done = false;
|
|
@@ -591,7 +603,8 @@ async function brandLoader(work, minMs = 1500) {
|
|
|
591
603
|
return v;
|
|
592
604
|
});
|
|
593
605
|
while (!done) {
|
|
594
|
-
|
|
606
|
+
const t = (Date.now() - start) / 1e3;
|
|
607
|
+
logUpdate(`\n ${sub(brandFrame(t))}\n\n ${status}`);
|
|
595
608
|
await new Promise((r) => setTimeout(r, 60));
|
|
596
609
|
}
|
|
597
610
|
const outroMs = 500;
|
|
@@ -607,6 +620,7 @@ async function brandLoader(work, minMs = 1500) {
|
|
|
607
620
|
logUpdate.done();
|
|
608
621
|
return result;
|
|
609
622
|
}
|
|
623
|
+
const STATIC_REGEX_3 = /^[\^~>=<]/;
|
|
610
624
|
const _emit = process.emit;
|
|
611
625
|
process.emit = (event, ...args) => event === "warning" && args[0]?.name === "ExperimentalWarning" && args[0]?.message?.includes("SQLite") ? false : _emit.apply(process, [event, ...args]);
|
|
612
626
|
function deprecatedForwarder(oldName, newName, loader) {
|
|
@@ -619,7 +633,7 @@ function deprecatedForwarder(oldName, newName, loader) {
|
|
|
619
633
|
name: oldName
|
|
620
634
|
},
|
|
621
635
|
async run(ctx) {
|
|
622
|
-
console.warn(
|
|
636
|
+
console.warn(styleText("yellow", `⚠ \`skilld ${oldName}\` is deprecated. Use \`skilld ${newName}\` instead.`));
|
|
623
637
|
return original(ctx);
|
|
624
638
|
}
|
|
625
639
|
});
|
|
@@ -643,9 +657,13 @@ const SUBCOMMAND_NAMES = [
|
|
|
643
657
|
"prepare",
|
|
644
658
|
"author",
|
|
645
659
|
"publish",
|
|
646
|
-
"upload"
|
|
660
|
+
"upload",
|
|
661
|
+
"login",
|
|
662
|
+
"logout",
|
|
663
|
+
"whoami",
|
|
664
|
+
"pull"
|
|
647
665
|
];
|
|
648
|
-
|
|
666
|
+
const main = defineCommand({
|
|
649
667
|
meta: {
|
|
650
668
|
name: "skilld",
|
|
651
669
|
version,
|
|
@@ -653,8 +671,8 @@ runMain(defineCommand({
|
|
|
653
671
|
},
|
|
654
672
|
args: { agent: sharedArgs.agent },
|
|
655
673
|
subCommands: {
|
|
656
|
-
add: () => import("./_chunks/
|
|
657
|
-
update: () => import("./_chunks/
|
|
674
|
+
add: () => import("./_chunks/add.mjs").then((m) => m.addCommandDef),
|
|
675
|
+
update: () => import("./_chunks/update.mjs").then((m) => m.updateCommandDef),
|
|
658
676
|
info: () => infoCommandDef,
|
|
659
677
|
list: () => import("./_chunks/list.mjs").then((m) => m.listCommandDef),
|
|
660
678
|
config: () => configCommandDef,
|
|
@@ -664,9 +682,13 @@ runMain(defineCommand({
|
|
|
664
682
|
uninstall: () => import("./_chunks/uninstall.mjs").then((m) => m.uninstallCommandDef),
|
|
665
683
|
search: () => import("./_chunks/search.mjs").then((m) => m.searchCommandDef),
|
|
666
684
|
cache: () => import("./_chunks/cache2.mjs").then((m) => m.cacheCommandDef),
|
|
667
|
-
setup: () => import("./_chunks/
|
|
668
|
-
|
|
669
|
-
|
|
685
|
+
setup: () => import("./_chunks/wizard.mjs").then((m) => m.setupCommandDef),
|
|
686
|
+
login: () => import("./_chunks/login.mjs").then((m) => m.loginCommandDef),
|
|
687
|
+
logout: () => import("./_chunks/logout.mjs").then((m) => m.logoutCommandDef),
|
|
688
|
+
whoami: () => import("./_chunks/whoami.mjs").then((m) => m.whoamiCommandDef),
|
|
689
|
+
pull: () => import("./_chunks/pull.mjs").then((m) => m.pullCommandDef),
|
|
690
|
+
author: () => import("./_chunks/author.mjs").then((m) => m.authorGroupDef),
|
|
691
|
+
eject: deprecatedForwarder("eject", "author eject", () => import("./_chunks/eject.mjs").then((m) => m.ejectCommandDef)),
|
|
670
692
|
validate: deprecatedForwarder("validate", "author validate", () => import("./_chunks/validate.mjs").then((m) => m.validateCommandDef)),
|
|
671
693
|
assemble: deprecatedForwarder("assemble", "author assemble", () => import("./_chunks/assemble.mjs").then((m) => m.assembleCommandDef)),
|
|
672
694
|
publish: deprecatedForwarder("publish", "author publish", () => import("./_chunks/upload.mjs").then((m) => m.uploadCommandDef)),
|
|
@@ -692,7 +714,8 @@ runMain(defineCommand({
|
|
|
692
714
|
if (!hasCompletedWizard()) {
|
|
693
715
|
if (!await runWizard()) return;
|
|
694
716
|
}
|
|
695
|
-
p.log.info(
|
|
717
|
+
p.log.info(`No agent selected - skills export as portable PROMPT_*.md files.
|
|
718
|
+
Run ${styleText("cyan", "skilld add <pkg>")} to generate prompts for any package.\n Run ${styleText("cyan", "skilld config")} to set a target agent later.`);
|
|
696
719
|
return;
|
|
697
720
|
}
|
|
698
721
|
const agent = currentAgent;
|
|
@@ -733,9 +756,9 @@ runMain(defineCommand({
|
|
|
733
756
|
};
|
|
734
757
|
});
|
|
735
758
|
if (selfUpdate) {
|
|
736
|
-
const released = selfUpdate.releasedAt ?
|
|
759
|
+
const released = selfUpdate.releasedAt ? styleText("gray", ` · ${relativeTime(new Date(selfUpdate.releasedAt))}`) : "";
|
|
737
760
|
const cmd = `npx nypm add${realpathSync(process.argv[1]).startsWith(resolve(cwd, "node_modules")) ? "" : " -g"} skilld@${selfUpdate.latest}`;
|
|
738
|
-
p.note(
|
|
761
|
+
p.note(`${styleText("gray", version)} → ${styleText(["bold", "green"], selfUpdate.latest)}${released}\n${styleText("cyan", cmd)}`, styleText("yellow", "Update available"));
|
|
739
762
|
}
|
|
740
763
|
if (state.skills.length === 0) {
|
|
741
764
|
if (!hasCompletedWizard()) {
|
|
@@ -744,16 +767,17 @@ runMain(defineCommand({
|
|
|
744
767
|
showOutro: false
|
|
745
768
|
})) return;
|
|
746
769
|
} else p.log.step("No skills installed yet - pick some packages to get started.");
|
|
747
|
-
const
|
|
770
|
+
const pkgJsonPath = join(cwd, "package.json");
|
|
771
|
+
const projectPkg = readPackageJsonSafe(pkgJsonPath);
|
|
748
772
|
const hasPkgJson = !!projectPkg;
|
|
749
773
|
const projectName = projectPkg?.parsed.name;
|
|
750
|
-
const projectLabel = projectName ? `Generating skills for
|
|
774
|
+
const projectLabel = projectName ? `Generating skills for ${styleText("cyan", projectName)}` : "Generating skills for current directory";
|
|
751
775
|
p.log.step(projectLabel);
|
|
752
776
|
if (!hasPkgJson) p.log.warn("No package.json found - enter npm package names manually.\n For best results, run skilld inside a JS/TS project directory.");
|
|
753
777
|
if (state.shipped.length > 0) {
|
|
754
778
|
const totalShipped = state.shipped.reduce((sum, s) => sum + s.skills.length, 0);
|
|
755
779
|
const names = state.shipped.map((s) => s.packageName).join(", ");
|
|
756
|
-
p.log.info(
|
|
780
|
+
p.log.info(`${styleText("cyan", `${totalShipped} ready-to-use skill${totalShipped > 1 ? "s" : ""}`)} shipped by your dependencies: ${names}`);
|
|
757
781
|
}
|
|
758
782
|
p.log.info("Tip: Add skills for packages with complex APIs or frequent breaking changes - not every dependency needs one.");
|
|
759
783
|
let setupComplete = false;
|
|
@@ -761,7 +785,7 @@ runMain(defineCommand({
|
|
|
761
785
|
const shippedOption = state.shipped.length > 0 ? [{
|
|
762
786
|
label: "Install shipped skills",
|
|
763
787
|
value: "shipped",
|
|
764
|
-
hint:
|
|
788
|
+
hint: styleText("cyan", `${state.shipped.reduce((sum, s) => sum + s.skills.length, 0)} ready to use`)
|
|
765
789
|
}] : [];
|
|
766
790
|
const source = hasPkgJson ? await p.select({
|
|
767
791
|
message: "How should I find packages?",
|
|
@@ -793,13 +817,13 @@ runMain(defineCommand({
|
|
|
793
817
|
return;
|
|
794
818
|
}
|
|
795
819
|
if (source === "skip") {
|
|
796
|
-
p.log.info(
|
|
820
|
+
p.log.info(`Run ${styleText("cyan", "skilld add <pkg>")} or ${styleText("cyan", "skilld")} anytime to add skills.`);
|
|
797
821
|
return;
|
|
798
822
|
}
|
|
799
823
|
if (source === "shipped") {
|
|
800
824
|
const { handleShippedSkills: installShipped } = await import("./_chunks/skill-installer.mjs");
|
|
801
825
|
for (const pkg of state.shipped) {
|
|
802
|
-
const version = state.deps.get(pkg.packageName)?.replace(
|
|
826
|
+
const version = state.deps.get(pkg.packageName)?.replace(VERSION_RANGE_PREFIX_RE, "") || "0.0.0";
|
|
803
827
|
installShipped(pkg.packageName, version, cwd, agent, false);
|
|
804
828
|
for (const sk of pkg.skills) p.log.success(`Installed shipped skill: ${sk.skillName}`);
|
|
805
829
|
}
|
|
@@ -823,7 +847,7 @@ runMain(defineCommand({
|
|
|
823
847
|
p.log.warn("No packages entered");
|
|
824
848
|
continue;
|
|
825
849
|
}
|
|
826
|
-
selected = input.split(
|
|
850
|
+
selected = input.split(COMMA_OR_WHITESPACE_RE).map((s) => s.trim()).filter(Boolean);
|
|
827
851
|
if (selected.length === 0) {
|
|
828
852
|
p.log.warn("No valid packages entered");
|
|
829
853
|
continue;
|
|
@@ -861,7 +885,7 @@ runMain(defineCommand({
|
|
|
861
885
|
const maxLen = Math.max(...packages.map((n) => n.length));
|
|
862
886
|
const preselect = packages.filter((name) => {
|
|
863
887
|
if (sourceMap.get(name) === "preset") return true;
|
|
864
|
-
return new Set([
|
|
888
|
+
return (/* @__PURE__ */ new Set([
|
|
865
889
|
"vue",
|
|
866
890
|
"nuxt",
|
|
867
891
|
"react",
|
|
@@ -874,12 +898,12 @@ runMain(defineCommand({
|
|
|
874
898
|
"typescript",
|
|
875
899
|
"vite",
|
|
876
900
|
"vitest"
|
|
877
|
-
]).has(name);
|
|
901
|
+
])).has(name);
|
|
878
902
|
});
|
|
879
903
|
const choice = await p.multiselect({
|
|
880
904
|
message: `Select packages (${packages.length} found)`,
|
|
881
905
|
options: packages.map((name) => {
|
|
882
|
-
const ver = state.deps.get(name)?.replace(
|
|
906
|
+
const ver = state.deps.get(name)?.replace(STATIC_REGEX_3, "") || "";
|
|
883
907
|
const repo = getRepoHint(name, cwd);
|
|
884
908
|
const hint = sourceMap.get(name) === "preset" ? "nuxt module" : void 0;
|
|
885
909
|
const pad = " ".repeat(maxLen - name.length + 2);
|
|
@@ -889,7 +913,7 @@ runMain(defineCommand({
|
|
|
889
913
|
repo
|
|
890
914
|
].filter(Boolean).join(" ");
|
|
891
915
|
return {
|
|
892
|
-
label: meta ? `${name}${pad}
|
|
916
|
+
label: meta ? `${name}${pad}${styleText("gray", meta)}` : name,
|
|
893
917
|
value: name
|
|
894
918
|
};
|
|
895
919
|
}),
|
|
@@ -920,7 +944,7 @@ runMain(defineCommand({
|
|
|
920
944
|
const previewContent = readFileSync(previewPath, "utf-8");
|
|
921
945
|
const previewLines = previewContent.split("\n").slice(0, 20).join("\n").replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, "").replace(/\x1B\].*?(?:\x07|\x1B\\)/g, "");
|
|
922
946
|
const fileSize = (Buffer.byteLength(previewContent) / 1024).toFixed(1);
|
|
923
|
-
p.note(
|
|
947
|
+
p.note(styleText("gray", `${previewLines}\n...`), `${targets[agent].skillsDir}/${previewSkill.name}/SKILL.md (${fileSize} KB)`);
|
|
924
948
|
}
|
|
925
949
|
}
|
|
926
950
|
const agentName = targets[agent].displayName;
|
|
@@ -936,10 +960,10 @@ runMain(defineCommand({
|
|
|
936
960
|
"amp": "Start a new Amp session.\nReads skill descriptions at startup, full content on invocation.",
|
|
937
961
|
"opencode": "Start a new OpenCode session.\nSkills are discovered automatically at startup.",
|
|
938
962
|
"roo": "Restart your editor. Roo reads skill descriptions at startup."
|
|
939
|
-
}[agent] ?? "" : `Skills are ready in ${targets[agent].skillsDir}/.\n
|
|
963
|
+
}[agent] ?? "" : `Skills are ready in ${targets[agent].skillsDir}/.\n${styleText("gray", `${agentName} was not detected on this machine.\nInstall it to use these skills, or run \`skilld config\` to change agents.`)}`;
|
|
940
964
|
const firstPkg = previewSkill?.info?.packageName || previewSkill?.name;
|
|
941
|
-
const trySuggestion = firstPkg ? `\n\n
|
|
942
|
-
p.note(`${verifyLine}${trySuggestion}\n\nRun
|
|
965
|
+
const trySuggestion = firstPkg ? `\n\n${styleText("cyan", "Try it:")} ask your agent "What are the gotchas or breaking changes in ${firstPkg}?"` : "";
|
|
966
|
+
p.note(`${verifyLine}${trySuggestion}\n\nRun ${styleText("cyan", "skilld info")} to see installed skills.\nRun ${styleText("cyan", "skilld")} again to add more, update, or search.`, `${agentName} - next steps`);
|
|
943
967
|
try {
|
|
944
968
|
await suggestPrepareHook(cwd);
|
|
945
969
|
} catch (err) {
|
|
@@ -950,11 +974,11 @@ runMain(defineCommand({
|
|
|
950
974
|
const status = formatStatus(state.synced.length, state.outdated.length);
|
|
951
975
|
p.log.info(status);
|
|
952
976
|
let needsPrepareHook = !hasPrepareHook(cwd);
|
|
953
|
-
if (needsPrepareHook) p.log.warn(
|
|
977
|
+
if (needsPrepareHook) p.log.warn(`${styleText("yellow", "No prepare hook.")} Skills won't auto-restore on ${styleText("cyan", "npm install")}.`);
|
|
954
978
|
if (state.shipped.length > 0) {
|
|
955
979
|
const totalSkills = state.shipped.reduce((sum, s) => sum + s.skills.length, 0);
|
|
956
980
|
const names = state.shipped.map((s) => s.packageName).join(", ");
|
|
957
|
-
p.log.info(
|
|
981
|
+
p.log.info(`${styleText("cyan", `${totalSkills} ready-to-use skill${totalSkills > 1 ? "s" : ""}`)} shipped by your dependencies: ${names}`);
|
|
958
982
|
}
|
|
959
983
|
const refreshState = async () => {
|
|
960
984
|
state = await getProjectState(cwd);
|
|
@@ -968,7 +992,7 @@ runMain(defineCommand({
|
|
|
968
992
|
opts.push({
|
|
969
993
|
label: "Install shipped skills",
|
|
970
994
|
value: "shipped",
|
|
971
|
-
hint:
|
|
995
|
+
hint: styleText("cyan", `${total} available`)
|
|
972
996
|
});
|
|
973
997
|
}
|
|
974
998
|
opts.push({
|
|
@@ -978,12 +1002,12 @@ runMain(defineCommand({
|
|
|
978
1002
|
if (state.outdated.length > 0) opts.push({
|
|
979
1003
|
label: "Update skills",
|
|
980
1004
|
value: "update",
|
|
981
|
-
hint:
|
|
1005
|
+
hint: styleText("yellow", `${state.outdated.length} outdated`)
|
|
982
1006
|
});
|
|
983
1007
|
if (needsPrepareHook) opts.push({
|
|
984
1008
|
label: "Setup prepare hook",
|
|
985
1009
|
value: "prepare-hook",
|
|
986
|
-
hint: "
|
|
1010
|
+
hint: styleText("yellow", "recommended")
|
|
987
1011
|
});
|
|
988
1012
|
opts.push({
|
|
989
1013
|
label: "Remove skills",
|
|
@@ -1022,7 +1046,7 @@ runMain(defineCommand({
|
|
|
1022
1046
|
for (const s of selected) {
|
|
1023
1047
|
if (seen.has(s.packageName)) continue;
|
|
1024
1048
|
seen.add(s.packageName);
|
|
1025
|
-
const version = state.deps.get(s.packageName)?.replace(
|
|
1049
|
+
const version = state.deps.get(s.packageName)?.replace(VERSION_RANGE_PREFIX_RE, "") || "0.0.0";
|
|
1026
1050
|
installShipped(s.packageName, version, cwd, agent, false);
|
|
1027
1051
|
}
|
|
1028
1052
|
p.log.success(`Installed ${selected.length} shipped skill${selected.length > 1 ? "s" : ""}`);
|
|
@@ -1061,7 +1085,7 @@ runMain(defineCommand({
|
|
|
1061
1085
|
placeholder: "vue nuxt pinia"
|
|
1062
1086
|
}));
|
|
1063
1087
|
if (!input) return;
|
|
1064
|
-
selected = input.split(
|
|
1088
|
+
selected = input.split(COMMA_OR_WHITESPACE_RE).map((s) => s.trim()).filter(Boolean);
|
|
1065
1089
|
if (selected.length === 0) return;
|
|
1066
1090
|
} else {
|
|
1067
1091
|
let usages;
|
|
@@ -1099,7 +1123,7 @@ runMain(defineCommand({
|
|
|
1099
1123
|
}
|
|
1100
1124
|
const usageMap = new Map(usages.map((u) => [u.name, u]));
|
|
1101
1125
|
const sourceMap = new Map(usages.map((u) => [u.name, u.source]));
|
|
1102
|
-
const frameworks = new Set([
|
|
1126
|
+
const frameworks = /* @__PURE__ */ new Set([
|
|
1103
1127
|
"vue",
|
|
1104
1128
|
"nuxt",
|
|
1105
1129
|
"react",
|
|
@@ -1117,7 +1141,7 @@ runMain(defineCommand({
|
|
|
1117
1141
|
const choice = guard(await p.multiselect({
|
|
1118
1142
|
message: `Select packages your agent struggles with or that are new to you (${packages.length} found)`,
|
|
1119
1143
|
options: packages.map((name) => {
|
|
1120
|
-
const ver = state.deps.get(name)?.replace(
|
|
1144
|
+
const ver = state.deps.get(name)?.replace(STATIC_REGEX_3, "") || "";
|
|
1121
1145
|
const repo = getRepoHint(name, cwd);
|
|
1122
1146
|
const hint = sourceMap.get(name) === "preset" ? "nuxt module" : frameworks.has(name) ? "framework" : (usageMap.get(name)?.count ?? 0) >= 5 ? `${usageMap.get(name).count} imports` : void 0;
|
|
1123
1147
|
const pad = " ".repeat(maxLen - name.length + 2);
|
|
@@ -1127,7 +1151,7 @@ runMain(defineCommand({
|
|
|
1127
1151
|
repo
|
|
1128
1152
|
].filter(Boolean).join(" ");
|
|
1129
1153
|
return {
|
|
1130
|
-
label: meta ? `${name}${pad}
|
|
1154
|
+
label: meta ? `${name}${pad}${styleText("gray", meta)}` : name,
|
|
1131
1155
|
value: name
|
|
1132
1156
|
};
|
|
1133
1157
|
}),
|
|
@@ -1206,14 +1230,13 @@ runMain(defineCommand({
|
|
|
1206
1230
|
await configCommand();
|
|
1207
1231
|
await refreshState();
|
|
1208
1232
|
break;
|
|
1209
|
-
case "prepare-hook":
|
|
1210
|
-
if (await suggestPrepareHook(cwd)) needsPrepareHook = false;
|
|
1211
|
-
break;
|
|
1233
|
+
case "prepare-hook": if (await suggestPrepareHook(cwd)) needsPrepareHook = false;
|
|
1212
1234
|
}
|
|
1213
1235
|
}
|
|
1214
1236
|
});
|
|
1215
1237
|
}
|
|
1216
|
-
})
|
|
1238
|
+
});
|
|
1239
|
+
runMain(main);
|
|
1217
1240
|
export {};
|
|
1218
1241
|
|
|
1219
1242
|
//# sourceMappingURL=cli.mjs.map
|