@runtypelabs/cli 2.59.1 → 2.59.4
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/chunk-0x7UKC1U.js +17 -0
- package/dist/chunk-2ySxXtcg.js +418 -0
- package/dist/chunk-3An_BRHv.js +501 -0
- package/dist/chunk-6uTxgdiY.js +16218 -0
- package/dist/chunk-87nRnNRG.js +1363 -0
- package/dist/chunk-B3wo8uRx.js +322 -0
- package/dist/chunk-BGp3ZdBy.js +560 -0
- package/dist/chunk-BJQv9Elp.js +107 -0
- package/dist/chunk-BOpO6xE-.js +6053 -0
- package/dist/chunk-BQXXCL8B.js +102 -0
- package/dist/chunk-BV-8isOd.js +34 -0
- package/dist/chunk-BVMhjGVe.js +826 -0
- package/dist/chunk-BW2fg46T.js +141 -0
- package/dist/chunk-BWJdY5Ag.js +36 -0
- package/dist/chunk-BYJOrLhh.js +302 -0
- package/dist/chunk-BYab8EVL.js +127 -0
- package/dist/chunk-BfEKvp7h.js +82 -0
- package/dist/chunk-BhgLSfH6.js +1123 -0
- package/dist/chunk-BirUxTtH.js +296 -0
- package/dist/chunk-BmB6UVZ9.js +1559 -0
- package/dist/chunk-BnWhIqW1.js +109 -0
- package/dist/chunk-Bpfnfk0t.js +123 -0
- package/dist/chunk-BrhgdnM3.js +108 -0
- package/dist/chunk-Bt0XAgX5.js +327 -0
- package/dist/chunk-Bu0FJr6S.js +84 -0
- package/dist/chunk-BvEoKpN3.js +255 -0
- package/dist/chunk-BxNJgYbE.js +28 -0
- package/dist/chunk-C1OFhd7F.js +6131 -0
- package/dist/chunk-C7e7WwbU.js +331 -0
- package/dist/chunk-CDTYP6bN.js +558 -0
- package/dist/chunk-CGDQoqDC.js +24 -0
- package/dist/chunk-CJraEBVd.js +127 -0
- package/dist/chunk-CQrNhOtv.js +40 -0
- package/dist/chunk-CW6AzBH6.js +128 -0
- package/dist/chunk-CXgL4w-9.js +317 -0
- package/dist/chunk-CZrqoPyf.js +233 -0
- package/dist/chunk-CcFCyqbB.js +83 -0
- package/dist/chunk-CdaIvO-y.js +485 -0
- package/dist/chunk-CehSXtgK.js +624 -0
- package/dist/chunk-Ciqkop65.js +218 -0
- package/dist/chunk-CoAWdSiE.js +43 -0
- package/dist/chunk-Crb4y7t4.js +830 -0
- package/dist/chunk-CrlqIfmb.js +337 -0
- package/dist/chunk-Cs4pwCQ-.js +324 -0
- package/dist/chunk-CwM_9y01.js +519 -0
- package/dist/chunk-CyRbIJg8.js +440 -0
- package/dist/chunk-D0OHsyMy.js +212 -0
- package/dist/chunk-D3y2bURs.js +1347 -0
- package/dist/chunk-D4_mJk03.js +2338 -0
- package/dist/chunk-D6C8rned.js +578 -0
- package/dist/chunk-D9ZbUnks.js +11 -0
- package/dist/chunk-DEPmLshX.js +834 -0
- package/dist/chunk-DFj1UPB2.js +330 -0
- package/dist/chunk-DGdFdZVf.js +197 -0
- package/dist/chunk-DGv7X9S_.js +63 -0
- package/dist/chunk-DJQ47WYZ.js +664 -0
- package/dist/chunk-DJw3O61j.js +1974 -0
- package/dist/chunk-DK4FbWVK.js +100 -0
- package/dist/chunk-DPuofXMp.js +3907 -0
- package/dist/chunk-DSRYhUus.js +993 -0
- package/dist/chunk-DajZ9Eg4.js +299 -0
- package/dist/chunk-Df4dunvU.js +195 -0
- package/dist/chunk-DjNTPhfO.js +481 -0
- package/dist/chunk-Dn8eaJuu.js +1042 -0
- package/dist/chunk-DwDWqSxM.js +637 -0
- package/dist/chunk-Dz7cEtxl.js +84 -0
- package/dist/chunk-E_0bgjrS.js +359 -0
- package/dist/chunk-KPYN2vUp.js +776 -0
- package/dist/chunk-KcqPQJBi.js +86 -0
- package/dist/chunk-N9H0JnoG.js +349 -0
- package/dist/chunk-NONFcXkn.js +728 -0
- package/dist/chunk-PrFjcpmH.js +256 -0
- package/dist/chunk-QSfNYiw9.js +11 -0
- package/dist/chunk-R265bzj9.js +226 -0
- package/dist/chunk-X9V_r6jM.js +166 -0
- package/dist/chunk-ZBtPUtyA.js +55 -0
- package/dist/chunk-ZCTfmOs7.js +4939 -0
- package/dist/chunk-h6oavj0t.js +97 -0
- package/dist/chunk-i7DwkvvD.js +42 -0
- package/dist/chunk-mG-4eZ6S.js +203 -0
- package/dist/chunk-o0ygUbCf.js +313 -0
- package/dist/chunk-ucu5lrDZ.js +5715 -0
- package/dist/index.js +11367 -73789
- package/package.json +5 -5
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { D as runSkillsInstall, E as promptConfirm, T as getDetectedAgents, t as isTTY, w as SKILLS_REPO } from "./index.js";
|
|
3
|
+
import { a as printJson } from "./chunk-CcFCyqbB.js";
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
// src/commands/skills.ts
|
|
7
|
+
const skillsCommand = new Command("skills").description("Install Runtype agent skills into your AI coding agents (Claude Code, Cursor, Codex, …)");
|
|
8
|
+
skillsCommand.command("list").description("List AI coding agents detected on this machine").option("--json", "Structured JSON output").action(async (options, cmd) => {
|
|
9
|
+
const globals = cmd.optsWithGlobals();
|
|
10
|
+
const jsonMode = !!(options.json ?? globals.json);
|
|
11
|
+
let agents;
|
|
12
|
+
try {
|
|
13
|
+
agents = await getDetectedAgents();
|
|
14
|
+
} catch (err) {
|
|
15
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
16
|
+
if (jsonMode) printJson({
|
|
17
|
+
status: "error",
|
|
18
|
+
error: message,
|
|
19
|
+
code: "DETECT_FAILED"
|
|
20
|
+
});
|
|
21
|
+
else console.error(chalk.red(`Could not detect agents: ${message}`));
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
if (jsonMode) {
|
|
25
|
+
printJson({
|
|
26
|
+
source: SKILLS_REPO,
|
|
27
|
+
agents
|
|
28
|
+
});
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (agents.length === 0) {
|
|
32
|
+
console.log(chalk.yellow("No supported AI coding agents detected on this machine."));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
console.log(chalk.cyan("Detected AI coding agents:"));
|
|
36
|
+
for (const agent of agents) console.log(` ${chalk.bold(agent.name)} ${chalk.dim(`(${agent.rosieId})`)} → ${chalk.dim(agent.installPath)}`);
|
|
37
|
+
console.log(chalk.dim("\nRun `runtype skills install` to add Runtype skills."));
|
|
38
|
+
});
|
|
39
|
+
skillsCommand.command("install").description(`Install Runtype skills (${SKILLS_REPO}) into detected AI coding agents`).option("--agent <ids...>", "Restrict to specific agent ids (e.g. claude cursor codex)").option("-y, --yes", "Skip the confirmation prompt").option("--verbose", "Print rosie progress logs").option("--json", "Structured JSON output (non-interactive)").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options, cmd) => {
|
|
40
|
+
const globals = cmd.optsWithGlobals();
|
|
41
|
+
const jsonMode = !!(options.json ?? globals.json);
|
|
42
|
+
const verbose = !!(options.verbose ?? globals.verbose);
|
|
43
|
+
const tty = isTTY(options);
|
|
44
|
+
let detected;
|
|
45
|
+
try {
|
|
46
|
+
detected = await getDetectedAgents();
|
|
47
|
+
} catch (err) {
|
|
48
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
49
|
+
if (jsonMode) printJson({
|
|
50
|
+
status: "error",
|
|
51
|
+
error: message,
|
|
52
|
+
code: "DETECT_FAILED"
|
|
53
|
+
});
|
|
54
|
+
else console.error(chalk.red(`Could not detect agents: ${message}`));
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
let agents = detected;
|
|
58
|
+
if (options.agent?.length) {
|
|
59
|
+
const wanted = new Set(options.agent.map((a) => a.toLowerCase()));
|
|
60
|
+
agents = detected.filter((a) => wanted.has(a.rosieId.toLowerCase()));
|
|
61
|
+
const missing = [...wanted].filter((id) => !detected.some((a) => a.rosieId.toLowerCase() === id));
|
|
62
|
+
if (missing.length && !jsonMode) console.log(chalk.yellow(`Not detected (skipping): ${missing.join(", ")}`));
|
|
63
|
+
}
|
|
64
|
+
if (agents.length === 0) {
|
|
65
|
+
if (jsonMode) printJson({
|
|
66
|
+
status: "no-agents",
|
|
67
|
+
installedAgents: [],
|
|
68
|
+
failedAgents: []
|
|
69
|
+
});
|
|
70
|
+
else {
|
|
71
|
+
console.log(chalk.yellow("No matching AI coding agents detected. Nothing to install."));
|
|
72
|
+
console.log(chalk.dim("See `runtype skills list` for what was detected."));
|
|
73
|
+
}
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (tty && !!process.stdin.isTTY && !jsonMode && !options.yes) {
|
|
77
|
+
if (!await promptConfirm(`Install Runtype skills for: ${chalk.bold(agents.map((a) => a.name).join(", "))}?`, true)) {
|
|
78
|
+
console.log(chalk.gray("Aborted."));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const outcome = await runSkillsInstall(agents, {
|
|
83
|
+
verbose,
|
|
84
|
+
accepted: true,
|
|
85
|
+
quiet: jsonMode
|
|
86
|
+
});
|
|
87
|
+
const hadFailure = !outcome || outcome.failedAgents.length > 0;
|
|
88
|
+
if (jsonMode) {
|
|
89
|
+
printJson({
|
|
90
|
+
status: !outcome ? "error" : outcome.failedAgents.length > 0 ? "partial" : "ok",
|
|
91
|
+
source: SKILLS_REPO,
|
|
92
|
+
requested: agents.map((a) => a.rosieId),
|
|
93
|
+
installedAgents: outcome?.installedAgents ?? [],
|
|
94
|
+
failedAgents: outcome?.failedAgents ?? agents.map((a) => a.rosieId)
|
|
95
|
+
});
|
|
96
|
+
if (hadFailure) process.exit(1);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (hadFailure) process.exit(1);
|
|
100
|
+
});
|
|
101
|
+
export { skillsCommand };
|
|
102
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { b as CredentialStore } from "./index.js";
|
|
3
|
+
import { S as selectAccountId } from "./chunk-ucu5lrDZ.js";
|
|
4
|
+
import { t as ApiKeyManager } from "./chunk-BW2fg46T.js";
|
|
5
|
+
// src/lib/account-context.ts
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the Clerk ID (`org_...` preferred, else `user_...`) to embed as `?account=` in dashboard URLs.
|
|
8
|
+
* When an API key is provided, prefer asking the API who that key belongs to.
|
|
9
|
+
* This avoids a stale locally-stored `orgId` when using `RUNTYPE_API_KEY` or after switching accounts.
|
|
10
|
+
* If the identity lookup is unavailable, fall back to stored creds only if they share the same API key.
|
|
11
|
+
*/
|
|
12
|
+
async function getCurrentAccountId(options) {
|
|
13
|
+
if (options?.apiKey) try {
|
|
14
|
+
const user = await new ApiKeyManager().getCurrentUser(options.apiKey, options.apiUrl);
|
|
15
|
+
const account = selectAccountId({
|
|
16
|
+
userId: user.userId,
|
|
17
|
+
organizationId: user.orgId
|
|
18
|
+
});
|
|
19
|
+
if (account) return account;
|
|
20
|
+
} catch {}
|
|
21
|
+
try {
|
|
22
|
+
const creds = await new CredentialStore().getCredentials();
|
|
23
|
+
if (!creds) return void 0;
|
|
24
|
+
if (options?.apiKey && creds.apiKey !== options.apiKey) return void 0;
|
|
25
|
+
return selectAccountId({
|
|
26
|
+
userId: creds.userId,
|
|
27
|
+
organizationId: creds.orgId
|
|
28
|
+
});
|
|
29
|
+
} catch {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export { getCurrentAccountId as t };
|
|
34
|
+
|