@agent-native/core 0.51.11 → 0.51.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/connect.d.ts +3 -0
- package/dist/cli/connect.d.ts.map +1 -1
- package/dist/cli/connect.js +17 -7
- package/dist/cli/connect.js.map +1 -1
- package/dist/cli/skills.d.ts +1 -0
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +142 -34
- package/dist/cli/skills.js.map +1 -1
- package/package.json +11 -13
package/dist/cli/skills.d.ts
CHANGED
package/dist/cli/skills.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAKL,KAAK,gBAAgB,EAEtB,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AA6jBjE,eAAO,MAAM,sBAAsB,0tfAQlC,CAAC;AAmVF,eAAO,MAAM,mBAAmB,i1NAQ/B,CAAC;AAEF,eAAO,MAAM,6BAA6B,+2WASzC,CAAC;AAEF,eAAO,MAAM,qBAAqB,+gIAOjC,CAAC;AAyBF,eAAO,MAAM,qBAAqB,ys4BAsdjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,q6iCA0iBjC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoN/B,CAAC;AAIF,eAAO,MAAM,gCAAgC,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EA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CAAC,IAAI,CAAC,CAAC;IAC/C;;;;;OAKG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED,UAAU,yBAAyB;IACjC,cAAc,EAAE,QAAQ,EAAE,CAAC;IAC3B,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjE,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,yBAAyB;IACjC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE;AAED,UAAU,+BAA+B;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,wBAAwB;IAChC,YAAY,EAAE,SAAS,GAAG,MAAM,CAAC;CAClC;AAED,UAAU,2BAA2B;IACnC,WAAW,EAAE,eAAe,CAAC;CAC9B;AAi+BD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,gBAAgB,CA8GhE;AAqdD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAkW1B;AAyMD,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,IAAI,CAAC,CA0Xf"}
|
package/dist/cli/skills.js
CHANGED
|
@@ -45,16 +45,16 @@ Examples:
|
|
|
45
45
|
The add command installs the SKILL.md instructions, registers the app-backed
|
|
46
46
|
MCP connector, and then authenticates it in one step so you do not hit an OAuth
|
|
47
47
|
wall on the first tool call. By default, add targets every supported local
|
|
48
|
-
client this CLI can configure (Claude Code,
|
|
48
|
+
client this CLI can configure (Claude Code, Codex, and Cowork);
|
|
49
49
|
pass --client to narrow it. Authentication reuses "npx @agent-native/core@latest connect":
|
|
50
50
|
OAuth-capable clients (Claude Code) get a URL-only entry and a /mcp authenticate
|
|
51
51
|
prompt, while Codex / Cowork run the browser device-code flow. In a
|
|
52
52
|
non-interactive shell or CI the auth step is skipped and the exact
|
|
53
53
|
"npx @agent-native/core@latest connect <url> --client all" command is printed instead.
|
|
54
54
|
|
|
55
|
-
Running "npx @agent-native/skills@latest add ..."
|
|
56
|
-
|
|
57
|
-
register
|
|
55
|
+
Running "npx @agent-native/skills@latest add ..." uses this same shared install
|
|
56
|
+
flow with the broader BuilderIO skills catalog enabled. Pass --no-connect to
|
|
57
|
+
register MCP where possible without authenticating (leave auth to the host or run
|
|
58
58
|
"npx @agent-native/core@latest connect" later). Pass --mcp-url to register that connector against
|
|
59
59
|
a custom origin (an ngrok tunnel, a local dev server, or a self-hosted
|
|
60
60
|
deployment) instead of the built-in hosted default — a bare origin gets the
|
|
@@ -2246,6 +2246,14 @@ const CLIENT_HINTS = {
|
|
|
2246
2246
|
codex: "$CODEX_HOME/config.toml or ~/.codex/config.toml",
|
|
2247
2247
|
cowork: "~/.cowork/mcp.json",
|
|
2248
2248
|
};
|
|
2249
|
+
const SKILLS_CLIENTS = ["claude-code", "codex", "cowork"];
|
|
2250
|
+
const SKILL_INSTRUCTION_CLIENTS = ["claude-code", "codex"];
|
|
2251
|
+
const SKILL_INSTRUCTION_CLIENT_HINTS = {
|
|
2252
|
+
"claude-code": ".claude/skills or .claude/commands",
|
|
2253
|
+
"claude-code-cli": ".claude/skills or .claude/commands",
|
|
2254
|
+
codex: ".agents/skills or ~/.codex/skills",
|
|
2255
|
+
cowork: "MCP only",
|
|
2256
|
+
};
|
|
2249
2257
|
function normalizeKnownSkillTarget(value) {
|
|
2250
2258
|
const key = value?.trim().toLowerCase();
|
|
2251
2259
|
if (!key)
|
|
@@ -2632,11 +2640,36 @@ function normalizeClientIds(values) {
|
|
|
2632
2640
|
}
|
|
2633
2641
|
return out;
|
|
2634
2642
|
}
|
|
2635
|
-
function
|
|
2636
|
-
|
|
2643
|
+
function normalizeSkillsClientIds(values) {
|
|
2644
|
+
const seen = new Set();
|
|
2645
|
+
const out = [];
|
|
2646
|
+
for (const client of normalizeClientIds(values)) {
|
|
2647
|
+
const normalized = client === "claude-code-cli" ? "claude-code" : client;
|
|
2648
|
+
if (seen.has(normalized))
|
|
2649
|
+
continue;
|
|
2650
|
+
seen.add(normalized);
|
|
2651
|
+
out.push(normalized);
|
|
2652
|
+
}
|
|
2653
|
+
return out;
|
|
2654
|
+
}
|
|
2655
|
+
function resolveSkillsClientArg(client) {
|
|
2656
|
+
return normalizeSkillsClientIds(resolveClients(client));
|
|
2657
|
+
}
|
|
2658
|
+
function skillsClients(installsMcp) {
|
|
2659
|
+
return installsMcp ? SKILLS_CLIENTS : SKILL_INSTRUCTION_CLIENTS;
|
|
2660
|
+
}
|
|
2661
|
+
function filterSkillsClients(clients, installsMcp) {
|
|
2662
|
+
if (installsMcp)
|
|
2663
|
+
return clients;
|
|
2664
|
+
return clients.filter((client) => SKILL_INSTRUCTION_CLIENTS.includes(client));
|
|
2665
|
+
}
|
|
2666
|
+
function clientPromptOptions(installsMcp) {
|
|
2667
|
+
return skillsClients(installsMcp).map((client) => ({
|
|
2637
2668
|
value: client,
|
|
2638
2669
|
label: CLIENT_LABELS[client],
|
|
2639
|
-
hint:
|
|
2670
|
+
hint: installsMcp
|
|
2671
|
+
? CLIENT_HINTS[client]
|
|
2672
|
+
: SKILL_INSTRUCTION_CLIENT_HINTS[client],
|
|
2640
2673
|
}));
|
|
2641
2674
|
}
|
|
2642
2675
|
const DEFAULT_PUBLIC_SKILLS_SOURCE = "BuilderIO/skills";
|
|
@@ -2703,6 +2736,12 @@ function skillPromptOptions(options = {}) {
|
|
|
2703
2736
|
...publicSkillPromptOptions(options),
|
|
2704
2737
|
];
|
|
2705
2738
|
}
|
|
2739
|
+
function defaultSkillPromptTargets(options) {
|
|
2740
|
+
return [
|
|
2741
|
+
...DEFAULT_SKILL_PROMPT_TARGETS,
|
|
2742
|
+
...publicSkillEntries(options).map((entry) => entry.name),
|
|
2743
|
+
];
|
|
2744
|
+
}
|
|
2706
2745
|
function publicSkillSelectionTarget(skillNames) {
|
|
2707
2746
|
return `${PUBLIC_SKILL_TARGET_PREFIX}${skillNames.join(",")}`;
|
|
2708
2747
|
}
|
|
@@ -2756,9 +2795,13 @@ function shouldPrompt(parsed, options) {
|
|
|
2756
2795
|
}
|
|
2757
2796
|
async function promptForClients(context) {
|
|
2758
2797
|
const clack = await import("@clack/prompts");
|
|
2798
|
+
const message = context.installsMcp
|
|
2799
|
+
? "Install the MCP connector and skills for which local agents?\n" +
|
|
2800
|
+
" (space toggles, enter confirms; saved for next time)"
|
|
2801
|
+
: "Install skill instructions for which local agents?\n" +
|
|
2802
|
+
" (space toggles, enter confirms; saved for next time)";
|
|
2759
2803
|
const result = await clack.multiselect({
|
|
2760
|
-
message
|
|
2761
|
-
" (space toggles, enter confirms; saved for next time)",
|
|
2804
|
+
message,
|
|
2762
2805
|
options: context.options,
|
|
2763
2806
|
initialValues: context.initialClients,
|
|
2764
2807
|
required: true,
|
|
@@ -2801,7 +2844,7 @@ async function promptForPlanMode(context) {
|
|
|
2801
2844
|
{
|
|
2802
2845
|
value: "hosted",
|
|
2803
2846
|
label: "Hosted Plans, shareable links",
|
|
2804
|
-
hint: "Stores plans at plan.agent-native.com
|
|
2847
|
+
hint: "100% free and open source. Stores plans at plan.agent-native.com with sharing, comments, and browser editor. Requires one-time browser sign-in.",
|
|
2805
2848
|
},
|
|
2806
2849
|
{
|
|
2807
2850
|
value: "local-files",
|
|
@@ -2872,15 +2915,20 @@ async function promptForSkills(context) {
|
|
|
2872
2915
|
return [];
|
|
2873
2916
|
return result.filter((value) => typeof value === "string");
|
|
2874
2917
|
}
|
|
2875
|
-
async function resolveSkillsClients(parsed, options) {
|
|
2918
|
+
async function resolveSkillsClients(parsed, options, installsMcp) {
|
|
2876
2919
|
if (parsed.clientExplicit || !shouldPrompt(parsed, options)) {
|
|
2877
|
-
|
|
2920
|
+
const clients = filterSkillsClients(resolveSkillsClientArg(parsed.client), installsMcp);
|
|
2921
|
+
if (clients.length === 0) {
|
|
2922
|
+
throw new Error("Local-file skill instructions only support Codex or Claude Code clients.");
|
|
2923
|
+
}
|
|
2924
|
+
return clients;
|
|
2878
2925
|
}
|
|
2879
|
-
const initialClients =
|
|
2926
|
+
const initialClients = skillsClients(installsMcp);
|
|
2880
2927
|
const prompt = options.promptClients ?? promptForClients;
|
|
2881
|
-
const selected =
|
|
2928
|
+
const selected = normalizeSkillsClientIds(await prompt({
|
|
2882
2929
|
initialClients,
|
|
2883
|
-
options: clientPromptOptions(),
|
|
2930
|
+
options: clientPromptOptions(installsMcp),
|
|
2931
|
+
installsMcp,
|
|
2884
2932
|
}));
|
|
2885
2933
|
if (selected.length === 0)
|
|
2886
2934
|
return null;
|
|
@@ -2919,6 +2967,9 @@ function targetsIncludePlans(targets) {
|
|
|
2919
2967
|
function planSkillNamesSelected(skillNames) {
|
|
2920
2968
|
return Boolean(skillNames?.some((name) => normalizeKnownSkillTarget(name) === "visual-plans"));
|
|
2921
2969
|
}
|
|
2970
|
+
function shouldForwardPlanModeFlag(target, skillNames) {
|
|
2971
|
+
return targetIncludesPlans(target) || planSkillNamesSelected(skillNames);
|
|
2972
|
+
}
|
|
2922
2973
|
function recapSkillNamesSelected(skillNames) {
|
|
2923
2974
|
return Boolean(skillNames?.some((name) => {
|
|
2924
2975
|
const normalized = name.trim().toLowerCase();
|
|
@@ -2983,7 +3034,7 @@ async function resolveSkillTargets(parsed, options) {
|
|
|
2983
3034
|
available: promptOptions.map((option) => option.value).join(","),
|
|
2984
3035
|
});
|
|
2985
3036
|
const selected = await prompt({
|
|
2986
|
-
initialTargets:
|
|
3037
|
+
initialTargets: defaultSkillPromptTargets(options),
|
|
2987
3038
|
options: promptOptions,
|
|
2988
3039
|
});
|
|
2989
3040
|
if (!selected || selected.length === 0)
|
|
@@ -3221,7 +3272,7 @@ function preserveMcpUrlAppPathOverride(target, input) {
|
|
|
3221
3272
|
};
|
|
3222
3273
|
}
|
|
3223
3274
|
function dryRunInstallCommand(parsed, target) {
|
|
3224
|
-
const clients = parsed.clients ??
|
|
3275
|
+
const clients = parsed.clients ?? resolveSkillsClientArg(parsed.client);
|
|
3225
3276
|
const args = [
|
|
3226
3277
|
"@agent-native/core@latest",
|
|
3227
3278
|
"skills",
|
|
@@ -3232,7 +3283,8 @@ function dryRunInstallCommand(parsed, target) {
|
|
|
3232
3283
|
"--scope",
|
|
3233
3284
|
parsed.scope,
|
|
3234
3285
|
];
|
|
3235
|
-
|
|
3286
|
+
const forwardsPlanFlags = shouldForwardPlanModeFlag(target, parsed.plainSkillNames);
|
|
3287
|
+
if (forwardsPlanFlags && parsed.planMode)
|
|
3236
3288
|
args.push("--mode", parsed.planMode);
|
|
3237
3289
|
if (parsed.mcpUrl)
|
|
3238
3290
|
args.push("--mcp-url", parsed.mcpUrl);
|
|
@@ -3353,24 +3405,28 @@ function isGithubSkillRepoTarget(target) {
|
|
|
3353
3405
|
function isPlainSkillRepoTarget(target) {
|
|
3354
3406
|
return isPlainSkillRepoPath(target) || isGithubSkillRepoTarget(target);
|
|
3355
3407
|
}
|
|
3356
|
-
function agentNativeSkillsInstallArgs(parsed, target, clients) {
|
|
3408
|
+
function agentNativeSkillsInstallArgs(parsed, target, clients, baseDir) {
|
|
3357
3409
|
const args = [
|
|
3358
3410
|
"--yes",
|
|
3359
3411
|
"@agent-native/skills@latest",
|
|
3360
3412
|
"add",
|
|
3413
|
+
"--copy",
|
|
3361
3414
|
target,
|
|
3362
3415
|
"--client",
|
|
3363
3416
|
clientArgForClients(clients),
|
|
3364
3417
|
"--scope",
|
|
3365
3418
|
parsed.scope,
|
|
3366
3419
|
];
|
|
3420
|
+
if (baseDir)
|
|
3421
|
+
args.push("--cwd", baseDir);
|
|
3367
3422
|
if (parsed.withGithubAction)
|
|
3368
3423
|
args.push("--with-github-action");
|
|
3369
3424
|
if (parsed.force)
|
|
3370
3425
|
args.push("--force");
|
|
3371
|
-
|
|
3426
|
+
const forwardsPlanFlags = shouldForwardPlanModeFlag(target, parsed.plainSkillNames);
|
|
3427
|
+
if (forwardsPlanFlags && parsed.planMode)
|
|
3372
3428
|
args.push("--mode", parsed.planMode);
|
|
3373
|
-
if (parsed.mcpUrl)
|
|
3429
|
+
if (forwardsPlanFlags && parsed.mcpUrl)
|
|
3374
3430
|
args.push("--mcp-url", parsed.mcpUrl);
|
|
3375
3431
|
if (!parsed.mcp)
|
|
3376
3432
|
args.push("--no-mcp");
|
|
@@ -3397,13 +3453,13 @@ async function addPlainSkillRepo(parsed, options) {
|
|
|
3397
3453
|
if (parsed.mcpUrl && !planSkillNamesSelected(parsed.plainSkillNames)) {
|
|
3398
3454
|
throw new Error("--mcp-url only applies to app-backed Agent Native skills.");
|
|
3399
3455
|
}
|
|
3400
|
-
const clients = parsed.clients ??
|
|
3456
|
+
const clients = parsed.clients ?? resolveSkillsClientArg(parsed.client);
|
|
3401
3457
|
const skillsAgents = skillsAgentsForClients(clients);
|
|
3402
3458
|
const selectedSkillNames = parsed.plainSkillNames ?? [];
|
|
3403
3459
|
if (skillsAgents.length === 0) {
|
|
3404
3460
|
throw new Error("Plain skill repositories can only install instructions for Codex or Claude Code clients.");
|
|
3405
3461
|
}
|
|
3406
|
-
const args = agentNativeSkillsInstallArgs(parsed, target, clients);
|
|
3462
|
+
const args = agentNativeSkillsInstallArgs(parsed, target, clients, options.baseDir);
|
|
3407
3463
|
if (!parsed.dryRun) {
|
|
3408
3464
|
const code = await (options.runCommand ?? runCommand)("npx", args, {
|
|
3409
3465
|
stdio: parsed.yes ? "silent" : "inherit",
|
|
@@ -3483,13 +3539,29 @@ async function connectAfterEnsure(installTarget, clients, parsed, options) {
|
|
|
3483
3539
|
options.log?.(`Authenticating ${installTarget.displayName}…`);
|
|
3484
3540
|
options.telemetry?.track("skills_cli connect started");
|
|
3485
3541
|
try {
|
|
3486
|
-
|
|
3542
|
+
const connectArgs = [
|
|
3487
3543
|
hostedUrl,
|
|
3488
3544
|
"--client",
|
|
3489
3545
|
clientArgForClients(clients),
|
|
3490
3546
|
"--scope",
|
|
3491
3547
|
parsed.scope,
|
|
3492
|
-
]
|
|
3548
|
+
];
|
|
3549
|
+
if (options.runConnect) {
|
|
3550
|
+
await options.runConnect(connectArgs);
|
|
3551
|
+
}
|
|
3552
|
+
else {
|
|
3553
|
+
await runConnect(connectArgs, {
|
|
3554
|
+
isInteractive: options.isInteractive,
|
|
3555
|
+
logOut: (message) => {
|
|
3556
|
+
if (message.trim())
|
|
3557
|
+
options.log?.(message);
|
|
3558
|
+
},
|
|
3559
|
+
logErr: (message) => {
|
|
3560
|
+
if (message.trim())
|
|
3561
|
+
options.log?.(message);
|
|
3562
|
+
},
|
|
3563
|
+
});
|
|
3564
|
+
}
|
|
3493
3565
|
options.telemetry?.track("skills_cli connect completed");
|
|
3494
3566
|
return { connected: true, connectCommand: "" };
|
|
3495
3567
|
}
|
|
@@ -3550,7 +3622,7 @@ export async function addAgentNativeSkill(parsed, options = {}) {
|
|
|
3550
3622
|
if (!parsed.instructions && parsed.mcp) {
|
|
3551
3623
|
throw new Error("Context X-Ray does not need MCP config yet. Run without --mcp-only.");
|
|
3552
3624
|
}
|
|
3553
|
-
const clients = parsed.clients ??
|
|
3625
|
+
const clients = parsed.clients ?? resolveSkillsClientArg(parsed.client);
|
|
3554
3626
|
const skillsAgents = skillsAgentsForClients(clients);
|
|
3555
3627
|
if (parsed.dryRun) {
|
|
3556
3628
|
const githubActionPath = parsed.withGithubAction && knownTarget === "visual-plans"
|
|
@@ -3605,7 +3677,7 @@ export async function addAgentNativeSkill(parsed, options = {}) {
|
|
|
3605
3677
|
if (parsed.mcpUrl) {
|
|
3606
3678
|
installTarget = withMcpUrlOverride(installTarget, parsed.mcpUrl);
|
|
3607
3679
|
}
|
|
3608
|
-
const clients = parsed.clients ??
|
|
3680
|
+
const clients = parsed.clients ?? resolveSkillsClientArg(parsed.client);
|
|
3609
3681
|
installTarget = preserveMcpUrlAppPathOverride(installTarget, parsed.mcpUrl);
|
|
3610
3682
|
const skillsAgents = skillsAgentsForClients(clients);
|
|
3611
3683
|
if (parsed.dryRun) {
|
|
@@ -3648,6 +3720,7 @@ export async function addAgentNativeSkill(parsed, options = {}) {
|
|
|
3648
3720
|
let instructionsWritten;
|
|
3649
3721
|
let connected = false;
|
|
3650
3722
|
let connectCommand;
|
|
3723
|
+
let registeredMcpClients = shouldRegisterMcp ? clients : [];
|
|
3651
3724
|
try {
|
|
3652
3725
|
if (parsed.instructions) {
|
|
3653
3726
|
if (skillsAgents.length === 0) {
|
|
@@ -3710,7 +3783,7 @@ export async function addAgentNativeSkill(parsed, options = {}) {
|
|
|
3710
3783
|
if (shouldRegisterMcp) {
|
|
3711
3784
|
commands.push(`npx @agent-native/core@latest app-skill ensure --manifest ${installTarget.loaded.file} --client ${parsed.client} --scope ${parsed.scope} --yes`);
|
|
3712
3785
|
if (!parsed.dryRun) {
|
|
3713
|
-
await ensureAppSkill(installTarget.loaded, {
|
|
3786
|
+
const ensureResult = await ensureAppSkill(installTarget.loaded, {
|
|
3714
3787
|
clients,
|
|
3715
3788
|
scope: parsed.scope,
|
|
3716
3789
|
baseDir: options.baseDir,
|
|
@@ -3718,6 +3791,7 @@ export async function addAgentNativeSkill(parsed, options = {}) {
|
|
|
3718
3791
|
confirm: true,
|
|
3719
3792
|
log: options.log,
|
|
3720
3793
|
});
|
|
3794
|
+
registeredMcpClients = ensureResult.written.map((written) => written.client);
|
|
3721
3795
|
options.telemetry?.track("skills_cli mcp registered", {
|
|
3722
3796
|
skills: installTarget.skillNames.join(","),
|
|
3723
3797
|
});
|
|
@@ -3729,9 +3803,18 @@ export async function addAgentNativeSkill(parsed, options = {}) {
|
|
|
3729
3803
|
const result = await connectAfterEnsure(installTarget, clients, parsed, options);
|
|
3730
3804
|
connected = result.connected;
|
|
3731
3805
|
connectCommand = result.connectCommand || undefined;
|
|
3806
|
+
if (connected)
|
|
3807
|
+
registeredMcpClients = clients;
|
|
3732
3808
|
if (connectCommand)
|
|
3733
3809
|
commands.push(connectCommand);
|
|
3734
3810
|
}
|
|
3811
|
+
else {
|
|
3812
|
+
const pendingClients = clients.filter((client) => !registeredMcpClients.includes(client));
|
|
3813
|
+
if (pendingClients.length > 0) {
|
|
3814
|
+
connectCommand = connectCommandFor(installTarget.loaded.manifest.hosted.url, pendingClients, parsed.scope);
|
|
3815
|
+
commands.push(connectCommand);
|
|
3816
|
+
}
|
|
3817
|
+
}
|
|
3735
3818
|
}
|
|
3736
3819
|
}
|
|
3737
3820
|
// `--with-github-action`: also drop the PR Visual Recap workflow into the
|
|
@@ -3791,7 +3874,7 @@ export async function addAgentNativeSkill(parsed, options = {}) {
|
|
|
3791
3874
|
mcpUrl: knownTarget === "visual-plans" && planMode === "local-files"
|
|
3792
3875
|
? ""
|
|
3793
3876
|
: installTarget.loaded.manifest.hosted.mcpUrl,
|
|
3794
|
-
mcpClients:
|
|
3877
|
+
mcpClients: registeredMcpClients,
|
|
3795
3878
|
dryRun: parsed.dryRun,
|
|
3796
3879
|
commands,
|
|
3797
3880
|
written: instructionsWritten,
|
|
@@ -3863,6 +3946,22 @@ function planModeSummary(mode) {
|
|
|
3863
3946
|
return "Self-hosted/custom Plan app";
|
|
3864
3947
|
return "Hosted Plans - shareable links and comments";
|
|
3865
3948
|
}
|
|
3949
|
+
function targetInstallsMcp(target, parsed) {
|
|
3950
|
+
if (!parsed.mcp)
|
|
3951
|
+
return false;
|
|
3952
|
+
if (publicSkillSelectionNames(target))
|
|
3953
|
+
return false;
|
|
3954
|
+
const knownTarget = normalizeKnownSkillTarget(target);
|
|
3955
|
+
if (knownTarget === "visual-plans")
|
|
3956
|
+
return parsed.planMode !== "local-files";
|
|
3957
|
+
if (knownTarget) {
|
|
3958
|
+
return !isLocalOnlyBuiltInSkill(BUILT_IN_APP_SKILLS[knownTarget]);
|
|
3959
|
+
}
|
|
3960
|
+
return true;
|
|
3961
|
+
}
|
|
3962
|
+
function targetsInstallMcp(targets, parsed) {
|
|
3963
|
+
return targets.some((target) => targetInstallsMcp(target, parsed));
|
|
3964
|
+
}
|
|
3866
3965
|
function instructionContentForSkill(skillName) {
|
|
3867
3966
|
if (skillName === "quick-recap") {
|
|
3868
3967
|
return "When writing final response status indicators, use the /quick-recap skill always.";
|
|
@@ -3955,9 +4054,16 @@ export async function runSkills(argv, options = {}) {
|
|
|
3955
4054
|
if (parsed.baseDir) {
|
|
3956
4055
|
options = { ...options, baseDir: path.resolve(parsed.baseDir) };
|
|
3957
4056
|
}
|
|
4057
|
+
const clackForLog = parsed.printJson
|
|
4058
|
+
? undefined
|
|
4059
|
+
: await import("@clack/prompts");
|
|
3958
4060
|
const log = parsed.printJson
|
|
3959
4061
|
? undefined
|
|
3960
|
-
: (message) =>
|
|
4062
|
+
: (message) => {
|
|
4063
|
+
if (!message.trim())
|
|
4064
|
+
return;
|
|
4065
|
+
clackForLog?.log.info(message);
|
|
4066
|
+
};
|
|
3961
4067
|
if (parsed.command === "help") {
|
|
3962
4068
|
process.stdout.write(`${HELP}\n`);
|
|
3963
4069
|
return;
|
|
@@ -4062,7 +4168,8 @@ export async function runSkills(argv, options = {}) {
|
|
|
4062
4168
|
mode: parsed.planMode,
|
|
4063
4169
|
});
|
|
4064
4170
|
}
|
|
4065
|
-
const
|
|
4171
|
+
const installsMcp = targetsInstallMcp(targets, parsed);
|
|
4172
|
+
const clients = await resolveSkillsClients(parsed, optionsWithTelemetry, installsMcp);
|
|
4066
4173
|
if (!clients) {
|
|
4067
4174
|
telemetry.track("skills_cli cancelled", { step: "clients" });
|
|
4068
4175
|
return;
|
|
@@ -4230,15 +4337,16 @@ export async function runSkills(argv, options = {}) {
|
|
|
4230
4337
|
clack.note(summary.join("\n"), `Installed ${installedNames} skill${results.length === 1 ? "" : "s"}`);
|
|
4231
4338
|
// GitHub Action follow-ups — kept as exact, copy-pasteable command lines.
|
|
4232
4339
|
for (const line of [githubActionLine, githubActionSuggestionLine].filter(Boolean)) {
|
|
4233
|
-
|
|
4340
|
+
clack.log.info(line);
|
|
4234
4341
|
}
|
|
4235
4342
|
const slashCommands = completedSkills.map((name) => `/${name}`).join(" ");
|
|
4236
|
-
const configuredEveryClient =
|
|
4343
|
+
const configuredEveryClient = SKILLS_CLIENTS.every((client) => clients.includes(client));
|
|
4237
4344
|
const clientHint = configuredEveryClient
|
|
4238
4345
|
? ""
|
|
4239
4346
|
: "\n Add another client later with --client <client> (e.g. --client claude-code).";
|
|
4347
|
+
const reloadTarget = mcpClients.length > 0 ? "skill + MCP server" : "skill";
|
|
4240
4348
|
clack.outro(`✅ All set! Start using ${slashCommands || "your new skills"} in your agent client.` +
|
|
4241
|
-
`\n You may need to reload the client for the
|
|
4349
|
+
`\n You may need to reload the client for the ${reloadTarget} to appear.` +
|
|
4242
4350
|
clientHint);
|
|
4243
4351
|
}
|
|
4244
4352
|
catch (error) {
|