@ritualai/cli 0.7.3 → 0.7.5
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 +36 -1
- package/dist/commands/init.js +174 -43
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.js +120 -13
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +55 -8
- package/dist/commands/logout.js.map +1 -1
- package/dist/index.js +8 -66
- package/dist/index.js.map +1 -1
- package/dist/lib/auth-flow.js +1 -1
- package/dist/lib/auth-flow.js.map +1 -1
- package/dist/lib/colors.js +182 -0
- package/dist/lib/colors.js.map +1 -0
- package/dist/lib/config.js +30 -17
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/credentials-backup.js +282 -0
- package/dist/lib/credentials-backup.js.map +1 -0
- package/dist/lib/identity-banner.js +88 -0
- package/dist/lib/identity-banner.js.map +1 -0
- package/dist/lib/oidc.js +55 -0
- package/dist/lib/oidc.js.map +1 -1
- package/dist/lib/package-info.js +76 -0
- package/dist/lib/package-info.js.map +1 -0
- package/dist/lib/welcome-banner.js +290 -0
- package/dist/lib/welcome-banner.js.map +1 -0
- package/package.json +1 -1
- package/skills/claude-code/ritual/agents/openai.yaml +2 -2
- package/skills/codex/ritual/agents/openai.yaml +2 -2
- package/skills/cursor/ritual/agents/openai.yaml +2 -2
- package/skills/gemini/ritual/agents/openai.yaml +2 -2
- package/skills/kiro/ritual/agents/openai.yaml +2 -2
- package/skills/vscode/ritual/agents/openai.yaml +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":";;;;;AA6BA,sCAwDC;AArFD,gDAAwB;AACxB,0CAAsF;AACtF,sCAA6C;AAkB7C;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CA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C,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC;YACJ,MAAM,IAAA,cAAI,EAAC,GAAG,CAAC,CAAC;QACjB,CAAC;QAAC,MAAM,CAAC;YACR,0DAA0D;QAC3D,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,6EAA6E,CAAC,CAAC;QAC3F,OAAO,CAAC,GAAG,CAAC,oFAAoF,CAAC,CAAC;QAClG,OAAO,CAAC,GAAG,CAAC,iFAAiF,CAAC,CAAC;QAC/F,OAAO,CAAC,GAAG,CAAC,qEAAqE,CAAC,CAAC;IACpF,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACjB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,42 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
4
|
const commander_1 = require("commander");
|
|
38
|
-
const fs = __importStar(require("node:fs"));
|
|
39
|
-
const path = __importStar(require("node:path"));
|
|
40
5
|
const login_1 = require("./commands/login");
|
|
41
6
|
const logout_1 = require("./commands/logout");
|
|
42
7
|
const whoami_1 = require("./commands/whoami");
|
|
@@ -44,41 +9,13 @@ const refresh_1 = require("./commands/refresh");
|
|
|
44
9
|
const init_1 = require("./commands/init");
|
|
45
10
|
const doctor_1 = require("./commands/doctor");
|
|
46
11
|
const graph_1 = require("./commands/graph");
|
|
47
|
-
|
|
48
|
-
* Read the package version at runtime so `ritual --version` always
|
|
49
|
-
* matches the installed package, instead of drifting from a hardcoded
|
|
50
|
-
* literal (we hit this from 0.5.0 → 0.7.2: every published version
|
|
51
|
-
* still reported `0.5.0`). After build the CLI ships as
|
|
52
|
-
* `dist/index.js`, which sits one level below `package.json` — so
|
|
53
|
-
* `__dirname/../package.json` resolves correctly both for the
|
|
54
|
-
* published package (`dist/`) and for `pnpm dev` (where `tsx` runs
|
|
55
|
-
* from `src/`).
|
|
56
|
-
*/
|
|
57
|
-
function readPackageVersion() {
|
|
58
|
-
const candidates = [
|
|
59
|
-
path.join(__dirname, '..', 'package.json'),
|
|
60
|
-
path.join(__dirname, '..', '..', 'package.json'),
|
|
61
|
-
];
|
|
62
|
-
for (const candidate of candidates) {
|
|
63
|
-
try {
|
|
64
|
-
const raw = fs.readFileSync(candidate, 'utf-8');
|
|
65
|
-
const parsed = JSON.parse(raw);
|
|
66
|
-
if (typeof parsed.version === 'string' && parsed.version.length > 0) {
|
|
67
|
-
return parsed.version;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
// try next candidate
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return '0.0.0-unknown';
|
|
75
|
-
}
|
|
12
|
+
const package_info_1 = require("./lib/package-info");
|
|
76
13
|
const program = new commander_1.Command();
|
|
77
14
|
program
|
|
78
15
|
.name('ritual')
|
|
79
16
|
.description('Ritual CLI — connect AI coding agents to Ritual Cloud. ' +
|
|
80
17
|
'Scaffold skills, register MCP servers, manage sessions.')
|
|
81
|
-
.version(
|
|
18
|
+
.version((0, package_info_1.readPackageVersionSafe)());
|
|
82
19
|
// `init` is the headline command: scaffold + register against every
|
|
83
20
|
// detected agent. Listed first so `ritual --help` surfaces it.
|
|
84
21
|
program
|
|
@@ -90,6 +27,8 @@ program
|
|
|
90
27
|
.option('--client-id <id>', 'OIDC client id (defaults to "ritual-cli")')
|
|
91
28
|
.option('--dev', '[internal] shortcut for --issuer https://auth.dev.ritualapp.cloud/realms/ritual')
|
|
92
29
|
.option('--no-workspace', 'Skip the "create a workspace for this repo?" prompt. Useful for CI or when you want to bind a workspace by hand later.')
|
|
30
|
+
.option('--switch-account', 'Force a fresh sign-in even if you already have valid local credentials. Uses OIDC prompt=login so Keycloak ignores its SSO cookie. Atomic — your previous session is restored if anything fails.')
|
|
31
|
+
.option('--yes', 'Skip interactive confirmation prompts (required for --switch-account in non-TTY mode).')
|
|
93
32
|
.action(init_1.initCommand);
|
|
94
33
|
program
|
|
95
34
|
.command('login')
|
|
@@ -97,10 +36,13 @@ program
|
|
|
97
36
|
.option('--issuer <url>', 'OIDC issuer (defaults to https://auth.ritualapp.cloud/realms/ritual or RITUAL_KEYCLOAK_URL env)')
|
|
98
37
|
.option('--client-id <id>', 'OIDC client id (defaults to "ritual-cli" or RITUAL_KEYCLOAK_CLIENT_ID env)')
|
|
99
38
|
.option('--dev', '[internal] shortcut for --issuer https://auth.dev.ritualapp.cloud/realms/ritual')
|
|
39
|
+
.option('--switch-account', 'Force a fresh sign-in even if you already have valid local credentials. Uses OIDC prompt=login so Keycloak ignores its SSO cookie.')
|
|
40
|
+
.option('--yes', 'Skip interactive confirmation prompts (required for --switch-account in non-TTY mode).')
|
|
100
41
|
.action(login_1.loginCommand);
|
|
101
42
|
program
|
|
102
43
|
.command('logout')
|
|
103
|
-
.description('Clear local credentials')
|
|
44
|
+
.description('Clear local credentials. With --all, also end the Keycloak browser SSO session.')
|
|
45
|
+
.option('--all', 'Also open the browser to end your Keycloak SSO session (so the next sign-in shows the form instead of auto-re-using your previous account).')
|
|
104
46
|
.action(logout_1.logoutCommand);
|
|
105
47
|
program
|
|
106
48
|
.command('whoami')
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,4CAAgD;AAChD,8CAAkD;AAClD,8CAAkD;AAClD,gDAAoD;AACpD,0CAA8C;AAC9C,8CAAkD;AAClD,4CAAsD;AACtD,qDAA4D;AAE5D,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACL,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CACX,yDAAyD;IACxD,yDAAyD,CAC1D;KACA,OAAO,CAAC,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CAAC,CAAC;AAEzB,OAAO;KACL,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,2EAA2E,CAAC;KACxF,MAAM,CAAC,sBAAa,CAAC,CAAC;AAExB,iEAAiE;AACjE,+DAA+D;AAC/D,kDAAkD;AAClD,MAAM,KAAK,GAAG,OAAO;KACnB,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,oEAAoE,CAAC,CAAC;AAEpF,KAAK;KACH,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,mEAAmE,CAAC;KAChF,MAAM,CACN,kBAAkB,EAClB,0FAA0F,CAC1F;KACA,MAAM,CAAC,aAAa,EAAE,8DAA8D,CAAC;KACrF,MAAM,CAAC,0BAAkB,CAAC,CAAC;AAE7B,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;IACrD,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
package/dist/lib/auth-flow.js
CHANGED
|
@@ -39,7 +39,7 @@ async function runBrowserLoginAndSave(opts = {}) {
|
|
|
39
39
|
const issuer = opts.issuer ?? exports.DEFAULT_ISSUER;
|
|
40
40
|
const clientId = opts.clientId ?? exports.DEFAULT_CLIENT_ID;
|
|
41
41
|
const onMessage = opts.onMessage ?? ((msg) => console.log(` ${msg}`));
|
|
42
|
-
const tokenSet = await (0, oidc_1.performLoginFlow)({ issuer, clientId, scope: exports.DEFAULT_SCOPE }, (url) => (0, open_1.default)(url), onMessage);
|
|
42
|
+
const tokenSet = await (0, oidc_1.performLoginFlow)({ issuer, clientId, scope: exports.DEFAULT_SCOPE, forceLogin: opts.forceLogin }, (url) => (0, open_1.default)(url), onMessage);
|
|
43
43
|
const claims = (0, oidc_1.decodeJwtPayloadUnsafe)(tokenSet.access_token);
|
|
44
44
|
const creds = {
|
|
45
45
|
version: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-flow.js","sourceRoot":"","sources":["../../src/lib/auth-flow.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"auth-flow.js","sourceRoot":"","sources":["../../src/lib/auth-flow.ts"],"names":[],"mappings":";;;;;;AAqDA,wDAoCC;AAzFD,gDAAwB;AACxB,iCAAkE;AAClE,qCAAgE;AAEhE;;;;;;;;;GASG;AAEU,QAAA,cAAc,GAC1B,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,4CAA4C,CAAC;AACpE,QAAA,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,YAAY,CAAC;AAC1E,QAAA,aAAa,GAAG,+CAA+C,CAAC;AAqB7E;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,sBAAsB,CAC3C,OAA4B,EAAE;IAE9B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,sBAAc,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,yBAAiB,CAAC;IACpD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC;IAE/E,MAAM,QAAQ,GAAG,MAAM,IAAA,uBAAgB,EACtC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAa,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,EACvE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,cAAI,EAAC,GAAG,CAAC,EAClB,SAAS,CACT,CAAC;IAEF,MAAM,MAAM,GAAG,IAAA,6BAAsB,EAIlC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAE1B,MAAM,KAAK,GAAmB;QAC7B,OAAO,EAAE,CAAC;QACV,MAAM;QACN,QAAQ;QACR,QAAQ,EAAE;YACT,YAAY,EAAE,QAAQ,CAAC,YAAY;YACnC,aAAa,EAAE,QAAQ,CAAC,aAAa;YACrC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,UAAU;YAC/D,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,KAAK,EAAE,QAAQ,CAAC,KAAK;SACrB;QACD,IAAI,EAAE,MAAM;YACX,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,kBAAkB,EAAE;YACvE,CAAC,CAAC,SAAS;KACZ,CAAC;IACF,IAAA,wBAAe,EAAC,KAAK,CAAC,CAAC;IACvB,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tiny ANSI color helper. Zero dependencies — we hand-roll the
|
|
4
|
+
* escape codes so the CLI install footprint stays minimal.
|
|
5
|
+
*
|
|
6
|
+
* Capabilities:
|
|
7
|
+
*
|
|
8
|
+
* - **Truecolor (24-bit)** when the terminal advertises it
|
|
9
|
+
* (`COLORTERM=truecolor|24bit`) — used to render Ritual's exact
|
|
10
|
+
* brand teal `#1FAF9F` faithfully.
|
|
11
|
+
* - **256-color (8-bit) fallback** for terminals that only
|
|
12
|
+
* advertise 256 colors — quantized to the nearest 256-color slot
|
|
13
|
+
* so brand identity survives.
|
|
14
|
+
* - **No color at all** when the user has set `NO_COLOR` (see
|
|
15
|
+
* <https://no-color.org/>), is piping output to a non-TTY, or is
|
|
16
|
+
* on a terminal that doesn't claim color support.
|
|
17
|
+
*
|
|
18
|
+
* Detection precedence (highest to lowest):
|
|
19
|
+
*
|
|
20
|
+
* 1. `process.env.NO_COLOR` set → strip all color
|
|
21
|
+
* 2. Not a TTY (`!process.stdout.isTTY`) → strip all color
|
|
22
|
+
* 3. `process.env.FORCE_COLOR=1|2|3` → force on (debug, screenshots)
|
|
23
|
+
* 4. `process.env.COLORTERM=truecolor|24bit` → 24-bit
|
|
24
|
+
* 5. `process.env.TERM` includes `256color` → 8-bit
|
|
25
|
+
* 6. Anything else → 4-bit (16 colors) basic ANSI
|
|
26
|
+
*/
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.RITUAL_TEAL = exports.DIM = exports.BOLD = exports.RESET = void 0;
|
|
29
|
+
exports.detectColorMode = detectColorMode;
|
|
30
|
+
exports.fg = fg;
|
|
31
|
+
exports.color = color;
|
|
32
|
+
exports.boldColor = boldColor;
|
|
33
|
+
exports.dim = dim;
|
|
34
|
+
/**
|
|
35
|
+
* Detect the highest color tier we can use on this terminal. Cached
|
|
36
|
+
* after first call since env vars don't change mid-process for
|
|
37
|
+
* practical terminal sessions. Re-exported as a function (not a
|
|
38
|
+
* constant) so tests can `jest.resetModules()` and re-detect.
|
|
39
|
+
*/
|
|
40
|
+
function detectColorMode() {
|
|
41
|
+
if (process.env.NO_COLOR !== undefined)
|
|
42
|
+
return 'none';
|
|
43
|
+
if (!process.stdout.isTTY && process.env.FORCE_COLOR === undefined)
|
|
44
|
+
return 'none';
|
|
45
|
+
if (process.env.FORCE_COLOR === '3')
|
|
46
|
+
return 'truecolor';
|
|
47
|
+
const colorterm = (process.env.COLORTERM ?? '').toLowerCase();
|
|
48
|
+
if (colorterm === 'truecolor' || colorterm === '24bit')
|
|
49
|
+
return 'truecolor';
|
|
50
|
+
const term = (process.env.TERM ?? '').toLowerCase();
|
|
51
|
+
if (term.includes('256color'))
|
|
52
|
+
return 'ansi256';
|
|
53
|
+
if (term && term !== 'dumb')
|
|
54
|
+
return 'ansi16';
|
|
55
|
+
return process.env.FORCE_COLOR !== undefined ? 'ansi16' : 'none';
|
|
56
|
+
}
|
|
57
|
+
/** Reset all formatting. */
|
|
58
|
+
exports.RESET = '\x1b[0m';
|
|
59
|
+
/** Bold. */
|
|
60
|
+
exports.BOLD = '\x1b[1m';
|
|
61
|
+
/** Dim. Used for secondary text in the welcome box. */
|
|
62
|
+
exports.DIM = '\x1b[2m';
|
|
63
|
+
/**
|
|
64
|
+
* Build a foreground-color escape sequence for the given RGB triple,
|
|
65
|
+
* downgraded according to the terminal's color tier.
|
|
66
|
+
*
|
|
67
|
+
* - `truecolor` → `\x1b[38;2;R;G;Bm`
|
|
68
|
+
* - `ansi256` → `\x1b[38;5;Nm` (quantized to nearest 256-color slot)
|
|
69
|
+
* - `ansi16` → `\x1b[36m` (nearest base color — for teal/cyan we
|
|
70
|
+
* pick cyan; same for any cool color)
|
|
71
|
+
* - `none` → empty string
|
|
72
|
+
*/
|
|
73
|
+
function fg(rgb, mode = detectColorMode()) {
|
|
74
|
+
if (mode === 'none')
|
|
75
|
+
return '';
|
|
76
|
+
if (mode === 'truecolor') {
|
|
77
|
+
return `\x1b[38;2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
78
|
+
}
|
|
79
|
+
if (mode === 'ansi256') {
|
|
80
|
+
return `\x1b[38;5;${rgbToAnsi256(rgb)}m`;
|
|
81
|
+
}
|
|
82
|
+
// ansi16: pick the closest of the 16 base colors. We classify by
|
|
83
|
+
// hue rather than by Euclidean distance — for brand teal that
|
|
84
|
+
// means "cyan-ish" not "green-ish."
|
|
85
|
+
return `\x1b[${rgbToBase16Fg(rgb)}m`;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Convenience: Ritual brand teal. Pulled from the canonical SVG icon
|
|
89
|
+
* at `apps/cli/assets/...` (`fill="#1FAF9F"`). One place to change
|
|
90
|
+
* if the brand ever shifts.
|
|
91
|
+
*/
|
|
92
|
+
exports.RITUAL_TEAL = [0x1f, 0xaf, 0x9f]; // #1FAF9F
|
|
93
|
+
/**
|
|
94
|
+
* Convenience helper to wrap text in foreground color + reset.
|
|
95
|
+
*
|
|
96
|
+
* color(RITUAL_TEAL, 'Hello') → '\x1b[38;2;31;175;159mHello\x1b[0m'
|
|
97
|
+
*
|
|
98
|
+
* Safe when color mode is `none` — returns the text untouched (no
|
|
99
|
+
* empty escape sequences in the output).
|
|
100
|
+
*/
|
|
101
|
+
function color(rgb, text) {
|
|
102
|
+
const mode = detectColorMode();
|
|
103
|
+
if (mode === 'none')
|
|
104
|
+
return text;
|
|
105
|
+
return `${fg(rgb, mode)}${text}${exports.RESET}`;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Bold-and-colored variant. Used for the brand wordmark in the
|
|
109
|
+
* welcome box header.
|
|
110
|
+
*/
|
|
111
|
+
function boldColor(rgb, text) {
|
|
112
|
+
const mode = detectColorMode();
|
|
113
|
+
if (mode === 'none')
|
|
114
|
+
return text;
|
|
115
|
+
return `${exports.BOLD}${fg(rgb, mode)}${text}${exports.RESET}`;
|
|
116
|
+
}
|
|
117
|
+
/** Wrap text in dim. Used for secondary info inside the welcome box. */
|
|
118
|
+
function dim(text) {
|
|
119
|
+
const mode = detectColorMode();
|
|
120
|
+
if (mode === 'none')
|
|
121
|
+
return text;
|
|
122
|
+
return `${exports.DIM}${text}${exports.RESET}`;
|
|
123
|
+
}
|
|
124
|
+
// ─── internal: color-space conversions ──────────────────────────────────────
|
|
125
|
+
/**
|
|
126
|
+
* Map an RGB triple to its nearest 256-color (xterm 256) slot.
|
|
127
|
+
*
|
|
128
|
+
* The 256-color palette is structured as:
|
|
129
|
+
* - 0–15: the 16 base ANSI colors (varies by terminal theme)
|
|
130
|
+
* - 16–231: a 6×6×6 RGB cube (each channel ∈ {0,95,135,175,215,255})
|
|
131
|
+
* - 232–255: a 24-step grayscale ramp
|
|
132
|
+
*
|
|
133
|
+
* For brand fidelity we map into the 6×6×6 cube — the base 16 are
|
|
134
|
+
* user-themeable and unreliable for "exact" colors.
|
|
135
|
+
*/
|
|
136
|
+
function rgbToAnsi256(rgb) {
|
|
137
|
+
const cubeAxis = (c) => {
|
|
138
|
+
// 6×6×6 cube quantization: 0, 95, 135, 175, 215, 255.
|
|
139
|
+
if (c < 48)
|
|
140
|
+
return 0;
|
|
141
|
+
if (c < 115)
|
|
142
|
+
return 1;
|
|
143
|
+
return Math.floor((c - 35) / 40);
|
|
144
|
+
};
|
|
145
|
+
const r = cubeAxis(rgb[0]);
|
|
146
|
+
const g = cubeAxis(rgb[1]);
|
|
147
|
+
const b = cubeAxis(rgb[2]);
|
|
148
|
+
return 16 + 36 * r + 6 * g + b;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Map an RGB triple to the nearest of the 8 standard ANSI foreground
|
|
152
|
+
* codes (30–37). We extend to bright variants (90–97) when the input
|
|
153
|
+
* is bright enough — `#1FAF9F` is mid-saturation cyan so it lands on
|
|
154
|
+
* 36 (cyan) cleanly.
|
|
155
|
+
*/
|
|
156
|
+
function rgbToBase16Fg(rgb) {
|
|
157
|
+
const [r, g, b] = rgb;
|
|
158
|
+
const max = Math.max(r, g, b);
|
|
159
|
+
const min = Math.min(r, g, b);
|
|
160
|
+
const bright = max > 170;
|
|
161
|
+
// Grayscale-ish (low saturation): default to white if bright, else neutral.
|
|
162
|
+
if (max - min < 30) {
|
|
163
|
+
return bright ? 97 : 37;
|
|
164
|
+
}
|
|
165
|
+
// Color classification by dominant channel(s):
|
|
166
|
+
// - High green + high blue → cyan
|
|
167
|
+
// - High red + high blue → magenta
|
|
168
|
+
// - High red + high green → yellow
|
|
169
|
+
// - High red → red, high green → green, high blue → blue
|
|
170
|
+
if (g > 80 && b > 80 && g + b > r * 1.5)
|
|
171
|
+
return bright ? 96 : 36; // cyan
|
|
172
|
+
if (r > 80 && b > 80 && r + b > g * 1.5)
|
|
173
|
+
return bright ? 95 : 35; // magenta
|
|
174
|
+
if (r > 80 && g > 80 && r + g > b * 1.5)
|
|
175
|
+
return bright ? 93 : 33; // yellow
|
|
176
|
+
if (r >= g && r >= b)
|
|
177
|
+
return bright ? 91 : 31; // red
|
|
178
|
+
if (g >= r && g >= b)
|
|
179
|
+
return bright ? 92 : 32; // green
|
|
180
|
+
return bright ? 94 : 34; // blue
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/lib/colors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;AAUH,0CAUC;AAqBD,gBAYC;AAiBD,sBAIC;AAMD,8BAIC;AAGD,kBAIC;AAvFD;;;;;GAKG;AACH,SAAgB,eAAe;IAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACtD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IAClF,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,GAAG;QAAE,OAAO,WAAW,CAAC;IACxD,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9D,IAAI,SAAS,KAAK,WAAW,IAAI,SAAS,KAAK,OAAO;QAAE,OAAO,WAAW,CAAC;IAC3E,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACpD,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO,SAAS,CAAC;IAChD,IAAI,IAAI,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,QAAQ,CAAC;IAC7C,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;AAClE,CAAC;AAED,4BAA4B;AACf,QAAA,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ANGED
|
@@ -10,6 +10,7 @@ const node_fs_1 = require("node:fs");
|
|
|
10
10
|
const node_os_1 = require("node:os");
|
|
11
11
|
const node_path_1 = require("node:path");
|
|
12
12
|
const oidc_1 = require("./oidc");
|
|
13
|
+
const credentials_backup_1 = require("./credentials-backup");
|
|
13
14
|
/**
|
|
14
15
|
* Local credentials store for the Ritual CLI.
|
|
15
16
|
*
|
|
@@ -41,16 +42,32 @@ const oidc_1 = require("./oidc");
|
|
|
41
42
|
* CLIs reading an older file run a tiny migration. We're at v1 so this
|
|
42
43
|
* is theoretical until v2.
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Resolve the directory we store CLI state in. Honors XDG by way of
|
|
47
|
+
* `XDG_CONFIG_HOME` — both a standard Linux convention for users who
|
|
48
|
+
* relocate dotfiles AND a clean override seam for tests (Jest
|
|
49
|
+
* snapshots `$HOME` at worker boot on macOS, so a test setting HOME
|
|
50
|
+
* mid-run doesn't change what `os.homedir()` returns).
|
|
51
|
+
*
|
|
52
|
+
* Evaluated lazily on every call so test harnesses can change env vars
|
|
53
|
+
* between sub-tests without resetting the module cache.
|
|
54
|
+
*/
|
|
55
|
+
function configDir() {
|
|
56
|
+
const xdg = process.env.XDG_CONFIG_HOME;
|
|
57
|
+
const base = xdg && xdg.length > 0 ? xdg : (0, node_path_1.join)((0, node_os_1.homedir)(), '.config');
|
|
58
|
+
return (0, node_path_1.join)(base, 'ritual');
|
|
59
|
+
}
|
|
60
|
+
function credsPath() {
|
|
61
|
+
return (0, node_path_1.join)(configDir(), 'credentials.json');
|
|
62
|
+
}
|
|
46
63
|
function getCredentialsPath() {
|
|
47
|
-
return
|
|
64
|
+
return credsPath();
|
|
48
65
|
}
|
|
49
66
|
function loadCredentials() {
|
|
50
|
-
if (!(0, node_fs_1.existsSync)(
|
|
67
|
+
if (!(0, node_fs_1.existsSync)(credsPath()))
|
|
51
68
|
return null;
|
|
52
69
|
try {
|
|
53
|
-
const raw = (0, node_fs_1.readFileSync)(
|
|
70
|
+
const raw = (0, node_fs_1.readFileSync)(credsPath(), 'utf-8');
|
|
54
71
|
const parsed = JSON.parse(raw);
|
|
55
72
|
if (parsed.version !== 1)
|
|
56
73
|
return null;
|
|
@@ -62,21 +79,17 @@ function loadCredentials() {
|
|
|
62
79
|
}
|
|
63
80
|
}
|
|
64
81
|
function saveCredentials(creds) {
|
|
65
|
-
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(
|
|
66
|
-
(
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
/* ignore */
|
|
74
|
-
}
|
|
82
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(credsPath()), { recursive: true });
|
|
83
|
+
// Create-with-mode 0o600 (not chmod-after) — eliminates the
|
|
84
|
+
// permission-race window where another process on a shared
|
|
85
|
+
// machine could read the file in the gap between create and
|
|
86
|
+
// chmod. See `writeFileMode0600` in ./credentials-backup.ts.
|
|
87
|
+
(0, credentials_backup_1.writeFileMode0600)(credsPath(), JSON.stringify(creds, null, 2));
|
|
75
88
|
}
|
|
76
89
|
function clearCredentials() {
|
|
77
|
-
if ((0, node_fs_1.existsSync)(
|
|
90
|
+
if ((0, node_fs_1.existsSync)(credsPath())) {
|
|
78
91
|
try {
|
|
79
|
-
(0, node_fs_1.unlinkSync)(
|
|
92
|
+
(0, node_fs_1.unlinkSync)(credsPath());
|
|
80
93
|
}
|
|
81
94
|
catch {
|
|
82
95
|
/* ignore */
|
package/dist/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":";;AA2EA,gDAEC;AAED,0CAWC;AAED,0CAOC;AAED,4CAQC;AAG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