chief-clancy 0.8.22 → 0.9.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/bin/clancy.js +153 -0
- package/package.json +8 -88
- package/README.md +0 -292
- package/dist/bundle/clancy-afk.js +0 -6
- package/dist/bundle/clancy-once.js +0 -239
- package/dist/installer/file-ops/file-ops.d.ts +0 -32
- package/dist/installer/file-ops/file-ops.d.ts.map +0 -1
- package/dist/installer/file-ops/file-ops.js +0 -58
- package/dist/installer/file-ops/file-ops.js.map +0 -1
- package/dist/installer/hook-installer/hook-installer.d.ts +0 -31
- package/dist/installer/hook-installer/hook-installer.d.ts.map +0 -1
- package/dist/installer/hook-installer/hook-installer.js +0 -137
- package/dist/installer/hook-installer/hook-installer.js.map +0 -1
- package/dist/installer/install.d.ts +0 -3
- package/dist/installer/install.d.ts.map +0 -1
- package/dist/installer/install.js +0 -270
- package/dist/installer/install.js.map +0 -1
- package/dist/installer/manifest/manifest.d.ts +0 -41
- package/dist/installer/manifest/manifest.d.ts.map +0 -1
- package/dist/installer/manifest/manifest.js +0 -97
- package/dist/installer/manifest/manifest.js.map +0 -1
- package/dist/installer/prompts/prompts.d.ts +0 -33
- package/dist/installer/prompts/prompts.d.ts.map +0 -1
- package/dist/installer/prompts/prompts.js +0 -55
- package/dist/installer/prompts/prompts.js.map +0 -1
- package/dist/installer/role-filter/role-filter.d.ts +0 -15
- package/dist/installer/role-filter/role-filter.d.ts.map +0 -1
- package/dist/installer/role-filter/role-filter.js +0 -48
- package/dist/installer/role-filter/role-filter.js.map +0 -1
- package/dist/installer/ui/ui.d.ts +0 -9
- package/dist/installer/ui/ui.d.ts.map +0 -1
- package/dist/installer/ui/ui.js +0 -94
- package/dist/installer/ui/ui.js.map +0 -1
- package/dist/scripts/shared/env-parser/env-parser.d.ts +0 -30
- package/dist/scripts/shared/env-parser/env-parser.d.ts.map +0 -1
- package/dist/scripts/shared/env-parser/env-parser.js +0 -64
- package/dist/scripts/shared/env-parser/env-parser.js.map +0 -1
- package/dist/utils/ansi/ansi.d.ts +0 -55
- package/dist/utils/ansi/ansi.d.ts.map +0 -1
- package/dist/utils/ansi/ansi.js +0 -55
- package/dist/utils/ansi/ansi.js.map +0 -1
- package/hooks/clancy-branch-guard.js +0 -128
- package/hooks/clancy-check-update.js +0 -114
- package/hooks/clancy-context-monitor.js +0 -189
- package/hooks/clancy-credential-guard.js +0 -120
- package/hooks/clancy-drift-detector.js +0 -96
- package/hooks/clancy-notification.js +0 -105
- package/hooks/clancy-post-compact.js +0 -53
- package/hooks/clancy-statusline.js +0 -82
- package/hooks/package.json +0 -3
- package/registry/boards.json +0 -44
- package/src/agents/arch-agent.md +0 -72
- package/src/agents/concerns-agent.md +0 -89
- package/src/agents/design-agent.md +0 -130
- package/src/agents/devils-advocate.md +0 -53
- package/src/agents/quality-agent.md +0 -161
- package/src/agents/tech-agent.md +0 -92
- package/src/agents/verification-gate.md +0 -128
- package/src/roles/implementer/commands/dry-run.md +0 -14
- package/src/roles/implementer/commands/once.md +0 -17
- package/src/roles/implementer/commands/run.md +0 -11
- package/src/roles/implementer/workflows/once.md +0 -146
- package/src/roles/implementer/workflows/run.md +0 -127
- package/src/roles/planner/commands/approve-plan.md +0 -10
- package/src/roles/planner/commands/plan.md +0 -20
- package/src/roles/planner/workflows/approve-plan.md +0 -535
- package/src/roles/planner/workflows/plan.md +0 -536
- package/src/roles/reviewer/commands/logs.md +0 -7
- package/src/roles/reviewer/commands/review.md +0 -9
- package/src/roles/reviewer/commands/status.md +0 -9
- package/src/roles/reviewer/workflows/logs.md +0 -104
- package/src/roles/reviewer/workflows/review.md +0 -186
- package/src/roles/reviewer/workflows/status.md +0 -134
- package/src/roles/setup/commands/doctor.md +0 -7
- package/src/roles/setup/commands/help.md +0 -80
- package/src/roles/setup/commands/init.md +0 -7
- package/src/roles/setup/commands/map-codebase.md +0 -16
- package/src/roles/setup/commands/settings.md +0 -7
- package/src/roles/setup/commands/uninstall.md +0 -5
- package/src/roles/setup/commands/update-docs.md +0 -9
- package/src/roles/setup/commands/update.md +0 -12
- package/src/roles/setup/workflows/doctor.md +0 -124
- package/src/roles/setup/workflows/init.md +0 -1073
- package/src/roles/setup/workflows/map-codebase.md +0 -125
- package/src/roles/setup/workflows/scaffold.md +0 -845
- package/src/roles/setup/workflows/settings.md +0 -944
- package/src/roles/setup/workflows/uninstall.md +0 -161
- package/src/roles/setup/workflows/update-docs.md +0 -92
- package/src/roles/setup/workflows/update.md +0 -277
- package/src/roles/strategist/commands/approve-brief.md +0 -21
- package/src/roles/strategist/commands/brief.md +0 -27
- package/src/roles/strategist/workflows/approve-brief.md +0 -834
- package/src/roles/strategist/workflows/brief.md +0 -890
- package/src/templates/CLAUDE.md +0 -87
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Manifest-based change detection for installed files.
|
|
3
|
-
*
|
|
4
|
-
* Tracks SHA-256 hashes of installed files so that user modifications can
|
|
5
|
-
* be detected and backed up before an update overwrites them.
|
|
6
|
-
*/
|
|
7
|
-
import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync, } from 'node:fs';
|
|
8
|
-
import { dirname, join } from 'node:path';
|
|
9
|
-
import { fileHash } from '../../installer/file-ops/file-ops.js';
|
|
10
|
-
/**
|
|
11
|
-
* Build a manifest of installed files with SHA-256 hashes.
|
|
12
|
-
*
|
|
13
|
-
* Recursively walks a directory and records the hash of every file.
|
|
14
|
-
*
|
|
15
|
-
* @param baseDir - Root directory to scan.
|
|
16
|
-
* @returns A record mapping relative paths to their SHA-256 hashes.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* const manifest = buildManifest('/path/to/.claude/commands/clancy');
|
|
21
|
-
* // { "init.md": "abc123...", "run.md": "def456..." }
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export function buildManifest(baseDir) {
|
|
25
|
-
const manifest = {};
|
|
26
|
-
function walk(dir, prefix) {
|
|
27
|
-
for (const entry of readdirSync(dir, {
|
|
28
|
-
withFileTypes: true,
|
|
29
|
-
})) {
|
|
30
|
-
const full = join(dir, entry.name);
|
|
31
|
-
const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
32
|
-
if (entry.isDirectory()) {
|
|
33
|
-
walk(full, rel);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
manifest[rel] = fileHash(full);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
walk(baseDir, '');
|
|
41
|
-
return manifest;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Detect files modified by the user since last install.
|
|
45
|
-
*
|
|
46
|
-
* Compares current file hashes against the stored manifest to find changes.
|
|
47
|
-
*
|
|
48
|
-
* @param baseDir - The installed directory to check.
|
|
49
|
-
* @param manifestPath - Path to the stored manifest JSON.
|
|
50
|
-
* @returns Array of modified file records with relative and absolute paths.
|
|
51
|
-
*/
|
|
52
|
-
export function detectModifiedFiles(baseDir, manifestPath) {
|
|
53
|
-
if (!existsSync(manifestPath))
|
|
54
|
-
return [];
|
|
55
|
-
let manifest;
|
|
56
|
-
try {
|
|
57
|
-
manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
const modified = [];
|
|
63
|
-
for (const [rel, hash] of Object.entries(manifest)) {
|
|
64
|
-
const absPath = join(baseDir, rel);
|
|
65
|
-
if (!existsSync(absPath))
|
|
66
|
-
continue;
|
|
67
|
-
if (fileHash(absPath) !== hash) {
|
|
68
|
-
modified.push({ rel, absPath });
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return modified;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Back up modified files to a patches directory.
|
|
75
|
-
*
|
|
76
|
-
* Copies each modified file and writes a `backup-meta.json` with metadata.
|
|
77
|
-
*
|
|
78
|
-
* @param modified - Array of modified file records.
|
|
79
|
-
* @param patchesDir - Directory to store backups.
|
|
80
|
-
* @returns The patches directory path, or `null` if no files were backed up.
|
|
81
|
-
*/
|
|
82
|
-
export function backupModifiedFiles(modified, patchesDir) {
|
|
83
|
-
if (modified.length === 0)
|
|
84
|
-
return null;
|
|
85
|
-
mkdirSync(patchesDir, { recursive: true });
|
|
86
|
-
for (const { rel, absPath } of modified) {
|
|
87
|
-
const backupPath = join(patchesDir, rel);
|
|
88
|
-
mkdirSync(dirname(backupPath), { recursive: true });
|
|
89
|
-
copyFileSync(absPath, backupPath);
|
|
90
|
-
}
|
|
91
|
-
writeFileSync(join(patchesDir, 'backup-meta.json'), JSON.stringify({
|
|
92
|
-
backed_up: modified.map((m) => m.rel),
|
|
93
|
-
date: new Date().toISOString(),
|
|
94
|
-
}, null, 2));
|
|
95
|
-
return patchesDir;
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=manifest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/installer/manifest/manifest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAM5D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,QAAQ,GAA2B,EAAE,CAAC;IAE5C,SAAS,IAAI,CAAC,GAAW,EAAE,MAAc;QACvC,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,GAAG,EAAE;YACnC,aAAa,EAAE,IAAI;SACpB,CAAiB,EAAE,CAAC;YACnB,MAAM,IAAI,GAAG,IAAI,CAAC,G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IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAwB,EACxB,UAAkB;IAElB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEvC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3C,KAAK,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,QAAQ,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QACzC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACpD,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACpC,CAAC;IAED,aAAa,CACX,IAAI,CAAC,UAAU,EAAE,kBAAkB,CAAC,EACpC,IAAI,CAAC,SAAS,CACZ;QACE,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QACrC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KAC/B,EACD,IAAI,EACJ,CAAC,CACF,CACF,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prompt the user for text input.
|
|
3
|
-
*
|
|
4
|
-
* @param label - The prompt text to display.
|
|
5
|
-
* @returns The user's response string.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* const name = await ask('Enter your name: ');
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
export declare function ask(label: string): Promise<string>;
|
|
13
|
-
/**
|
|
14
|
-
* Present a numbered list of options and return the user's choice.
|
|
15
|
-
*
|
|
16
|
-
* @param question - The question to display above the options.
|
|
17
|
-
* @param options - Array of option labels.
|
|
18
|
-
* @param defaultChoice - The default option number (1-based).
|
|
19
|
-
* @returns The user's choice as a string (e.g., `'1'` or `'2'`).
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```ts
|
|
23
|
-
* const choice = await choose('Pick a colour:', ['Red', 'Blue'], 1);
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export declare function choose(question: string, options: string[], defaultChoice?: number): Promise<string>;
|
|
27
|
-
/**
|
|
28
|
-
* Close the readline interface.
|
|
29
|
-
*
|
|
30
|
-
* Call this before exiting the process to release stdin.
|
|
31
|
-
*/
|
|
32
|
-
export declare function closePrompts(): void;
|
|
33
|
-
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/installer/prompts/prompts.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;GAUG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAElD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,MAAM,CAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EAAE,EACjB,aAAa,SAAI,GAChB,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interactive CLI prompt helpers for the installer.
|
|
3
|
-
*
|
|
4
|
-
* Manages a shared readline interface and provides `ask()` and `choose()`
|
|
5
|
-
* helpers for user interaction.
|
|
6
|
-
*/
|
|
7
|
-
import { createInterface } from 'node:readline';
|
|
8
|
-
import { blue, cyan } from '../../utils/ansi/ansi.js';
|
|
9
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
10
|
-
process.on('exit', () => rl.close());
|
|
11
|
-
/**
|
|
12
|
-
* Prompt the user for text input.
|
|
13
|
-
*
|
|
14
|
-
* @param label - The prompt text to display.
|
|
15
|
-
* @returns The user's response string.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```ts
|
|
19
|
-
* const name = await ask('Enter your name: ');
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export function ask(label) {
|
|
23
|
-
return new Promise((resolve) => rl.question(label, resolve));
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Present a numbered list of options and return the user's choice.
|
|
27
|
-
*
|
|
28
|
-
* @param question - The question to display above the options.
|
|
29
|
-
* @param options - Array of option labels.
|
|
30
|
-
* @param defaultChoice - The default option number (1-based).
|
|
31
|
-
* @returns The user's choice as a string (e.g., `'1'` or `'2'`).
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```ts
|
|
35
|
-
* const choice = await choose('Pick a colour:', ['Red', 'Blue'], 1);
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export async function choose(question, options, defaultChoice = 1) {
|
|
39
|
-
console.log('');
|
|
40
|
-
console.log(blue(question));
|
|
41
|
-
console.log('');
|
|
42
|
-
options.forEach((opt, i) => console.log(` ${i + 1}) ${opt}`));
|
|
43
|
-
console.log('');
|
|
44
|
-
const raw = await ask(cyan(`Choice [${defaultChoice}]: `));
|
|
45
|
-
return raw.trim() || String(defaultChoice);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Close the readline interface.
|
|
49
|
-
*
|
|
50
|
-
* Call this before exiting the process to release stdin.
|
|
51
|
-
*/
|
|
52
|
-
export function closePrompts() {
|
|
53
|
-
rl.close();
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=prompts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/installer/prompts/prompts.ts"],"names":[],"mappings":"AAAA;;;;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IAC1B,EAAE,CAAC,KAAK,EAAE,CAAC;AACb,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copy files from role subdirectories into a flat destination directory.
|
|
3
|
-
*
|
|
4
|
-
* Walks `src/roles/{role}/{subdir}/` for each role and copies all files
|
|
5
|
-
* flat into `dest`. Core roles (implementer, reviewer, setup) are always
|
|
6
|
-
* copied. Optional roles (planner, etc.) are only copied if listed in
|
|
7
|
-
* the CLANCY_ROLES env var, or if no .clancy/.env exists yet (first install).
|
|
8
|
-
*
|
|
9
|
-
* @param rolesDir - The roles source directory (`src/roles/`).
|
|
10
|
-
* @param subdir - The subdirectory within each role (`commands` or `workflows`).
|
|
11
|
-
* @param dest - The flat destination directory.
|
|
12
|
-
* @param enabledRoles - Set of enabled optional roles, or null to install all (first install).
|
|
13
|
-
*/
|
|
14
|
-
export declare function copyRoleFiles(rolesDir: string, subdir: string, dest: string, enabledRoles: Set<string> | null): void;
|
|
15
|
-
//# sourceMappingURL=role-filter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"role-filter.d.ts","sourceRoot":"","sources":["../../../src/installer/role-filter/role-filter.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,GAC/B,IAAI,CAyBN"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Role-based file filtering for the installer.
|
|
3
|
-
*
|
|
4
|
-
* Copies command/workflow files from role directories into a flat destination,
|
|
5
|
-
* applying core vs optional role filtering. Disabled optional roles have their
|
|
6
|
-
* previously-installed files removed.
|
|
7
|
-
*/
|
|
8
|
-
import { existsSync, mkdirSync, readdirSync, unlinkSync } from 'node:fs';
|
|
9
|
-
import { join } from 'node:path';
|
|
10
|
-
import { copyDir } from '../../installer/file-ops/file-ops.js';
|
|
11
|
-
/** Roles that are always installed regardless of CLANCY_ROLES. */
|
|
12
|
-
const CORE_ROLES = new Set(['implementer', 'reviewer', 'setup']);
|
|
13
|
-
/**
|
|
14
|
-
* Copy files from role subdirectories into a flat destination directory.
|
|
15
|
-
*
|
|
16
|
-
* Walks `src/roles/{role}/{subdir}/` for each role and copies all files
|
|
17
|
-
* flat into `dest`. Core roles (implementer, reviewer, setup) are always
|
|
18
|
-
* copied. Optional roles (planner, etc.) are only copied if listed in
|
|
19
|
-
* the CLANCY_ROLES env var, or if no .clancy/.env exists yet (first install).
|
|
20
|
-
*
|
|
21
|
-
* @param rolesDir - The roles source directory (`src/roles/`).
|
|
22
|
-
* @param subdir - The subdirectory within each role (`commands` or `workflows`).
|
|
23
|
-
* @param dest - The flat destination directory.
|
|
24
|
-
* @param enabledRoles - Set of enabled optional roles, or null to install all (first install).
|
|
25
|
-
*/
|
|
26
|
-
export function copyRoleFiles(rolesDir, subdir, dest, enabledRoles) {
|
|
27
|
-
mkdirSync(dest, { recursive: true });
|
|
28
|
-
const roles = readdirSync(rolesDir, { withFileTypes: true }).filter((d) => d.isDirectory());
|
|
29
|
-
for (const role of roles) {
|
|
30
|
-
const srcDir = join(rolesDir, role.name, subdir);
|
|
31
|
-
if (!existsSync(srcDir))
|
|
32
|
-
continue;
|
|
33
|
-
// Core roles always install; optional roles need explicit opt-in
|
|
34
|
-
if (!CORE_ROLES.has(role.name) && enabledRoles !== null) {
|
|
35
|
-
if (!enabledRoles.has(role.name)) {
|
|
36
|
-
// Remove previously-installed files for disabled optional roles
|
|
37
|
-
for (const file of readdirSync(srcDir)) {
|
|
38
|
-
const target = join(dest, file);
|
|
39
|
-
if (existsSync(target))
|
|
40
|
-
unlinkSync(target);
|
|
41
|
-
}
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
copyDir(srcDir, dest);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=role-filter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"role-filter.js","sourceRoot":"","sources":["../../../src/installer/role-filter/role-filter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,kEAAkE;AAClE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AAEjE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAC3B,QAAgB,EAChB,MAAc,EACd,IAAY,EACZ,YAAgC;IAEhC,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAErC,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACxE,CAAC,CAAC,WAAW,EAAE,CAChB,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,SAAS;QAElC,iEAAiE;QACjE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;YACxD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,gEAAgE;gBAChE,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;oBACvC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;oBAChC,IAAI,UAAU,CAAC,MAAM,CAAC;wBAAE,UAAU,CAAC,MAAM,CAAC,CAAC;gBAC7C,CAAC;gBACD,SAAS;YACX,CAAC;QACH,CAAC;QAED,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACxB,CAAC;AACH,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Print the Clancy ASCII banner and version info.
|
|
3
|
-
*/
|
|
4
|
-
export declare function printBanner(version: string): void;
|
|
5
|
-
/**
|
|
6
|
-
* Print the post-install success message with available commands.
|
|
7
|
-
*/
|
|
8
|
-
export declare function printSuccess(enabledRoles: Set<string> | null): void;
|
|
9
|
-
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/installer/ui/ui.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAmBjD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CA2EnE"}
|
package/dist/installer/ui/ui.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Installer UI — banner and success message.
|
|
3
|
-
*/
|
|
4
|
-
import { blue, bold, cyan, dim, green } from '../../utils/ansi/ansi.js';
|
|
5
|
-
/**
|
|
6
|
-
* Print the Clancy ASCII banner and version info.
|
|
7
|
-
*/
|
|
8
|
-
export function printBanner(version) {
|
|
9
|
-
console.log('');
|
|
10
|
-
console.log(blue(' ██████╗██╗ █████╗ ███╗ ██╗ ██████╗██╗ ██╗'));
|
|
11
|
-
console.log(blue(' ██╔════╝██║ ██╔══██╗████╗ ██║██╔════╝╚██╗ ██╔╝'));
|
|
12
|
-
console.log(blue(' ██║ ██║ ███████║██╔██╗ ██║██║ ╚████╔╝ '));
|
|
13
|
-
console.log(blue(' ██║ ██║ ██╔══██║██║╚██╗██║██║ ╚██╔╝ '));
|
|
14
|
-
console.log(blue(' ╚██████╗███████╗██║ ██║██║ ╚████║╚██████╗ ██║ '));
|
|
15
|
-
console.log(blue(' ╚═════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ '));
|
|
16
|
-
console.log('');
|
|
17
|
-
console.log(' ' +
|
|
18
|
-
bold(`v${version}`) +
|
|
19
|
-
dim(' Autonomous, board-driven development for Claude Code.'));
|
|
20
|
-
console.log(dim(' Named after Chief Clancy Wiggum. Built on the Ralph technique by Geoffrey Huntley.'));
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Print the post-install success message with available commands.
|
|
24
|
-
*/
|
|
25
|
-
export function printSuccess(enabledRoles) {
|
|
26
|
-
console.log('');
|
|
27
|
-
console.log(green(' ✓ Clancy installed successfully.'));
|
|
28
|
-
console.log('');
|
|
29
|
-
console.log(' Next steps:');
|
|
30
|
-
console.log(dim(' 1. Open a project in Claude Code'));
|
|
31
|
-
console.log(` 2. Run: ${cyan('/clancy:init')}`);
|
|
32
|
-
console.log('');
|
|
33
|
-
console.log(' Commands available:');
|
|
34
|
-
const OPTIONAL_GROUPS = new Set(['planner', 'strategist']);
|
|
35
|
-
const groups = [
|
|
36
|
-
[
|
|
37
|
-
'Strategist',
|
|
38
|
-
[
|
|
39
|
-
['/clancy:brief', 'Generate a strategic brief for a feature'],
|
|
40
|
-
['/clancy:approve-brief', 'Convert brief into board tickets'],
|
|
41
|
-
],
|
|
42
|
-
],
|
|
43
|
-
[
|
|
44
|
-
'Planner',
|
|
45
|
-
[
|
|
46
|
-
['/clancy:plan', 'Refine backlog tickets into plans'],
|
|
47
|
-
['/clancy:approve-plan', 'Promote plan to ticket description'],
|
|
48
|
-
],
|
|
49
|
-
],
|
|
50
|
-
[
|
|
51
|
-
'Implementer',
|
|
52
|
-
[
|
|
53
|
-
['/clancy:once', 'Pick up one ticket and stop'],
|
|
54
|
-
['/clancy:run', 'Run Clancy in loop mode'],
|
|
55
|
-
['/clancy:dry-run', 'Preview next ticket without changes'],
|
|
56
|
-
],
|
|
57
|
-
],
|
|
58
|
-
[
|
|
59
|
-
'Reviewer',
|
|
60
|
-
[
|
|
61
|
-
['/clancy:review', 'Score next ticket and get recommendations'],
|
|
62
|
-
['/clancy:status', 'Show next tickets without running'],
|
|
63
|
-
['/clancy:logs', 'Display progress log'],
|
|
64
|
-
],
|
|
65
|
-
],
|
|
66
|
-
[
|
|
67
|
-
'Setup & Maintenance',
|
|
68
|
-
[
|
|
69
|
-
['/clancy:init', 'Set up Clancy in your project'],
|
|
70
|
-
['/clancy:map-codebase', 'Scan codebase with 5 parallel agents'],
|
|
71
|
-
['/clancy:settings', 'View and change configuration'],
|
|
72
|
-
['/clancy:doctor', 'Diagnose your setup'],
|
|
73
|
-
['/clancy:update-docs', 'Refresh codebase documentation'],
|
|
74
|
-
['/clancy:update', 'Update Clancy to latest version'],
|
|
75
|
-
['/clancy:uninstall', 'Remove Clancy from your project'],
|
|
76
|
-
['/clancy:help', 'Show all commands'],
|
|
77
|
-
],
|
|
78
|
-
],
|
|
79
|
-
];
|
|
80
|
-
for (const [group, cmds] of groups) {
|
|
81
|
-
const key = group.toLowerCase();
|
|
82
|
-
if (OPTIONAL_GROUPS.has(key) &&
|
|
83
|
-
enabledRoles !== null &&
|
|
84
|
-
!enabledRoles.has(key))
|
|
85
|
-
continue;
|
|
86
|
-
console.log('');
|
|
87
|
-
console.log(` ${bold(group)}`);
|
|
88
|
-
for (const [cmd, desc] of cmds) {
|
|
89
|
-
console.log(` ${cyan(cmd.padEnd(22))} ${dim(desc)}`);
|
|
90
|
-
}
|
|
91
|
-
}
|
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iC,CAAC;gBACrD,CAAC,mBAAmB,EAAE,iCAAiC,CAAC;gBACxD,CAAC,cAAc,EAAE,mBAAmB,CAAC;aACtC;SACF;KACF,CAAC;IAEF,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,MAAM,EAAE,CAAC;QACnC,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAChC,IACE,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC;YACxB,YAAY,KAAK,IAAI;YACrB,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC;YAEtB,SAAS;QAEX,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClC,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parse a .env file content string into a key-value record.
|
|
3
|
-
*
|
|
4
|
-
* Handles single-quoted, double-quoted, and unquoted values.
|
|
5
|
-
* Ignores blank lines and lines starting with `#`.
|
|
6
|
-
*
|
|
7
|
-
* @param content - The raw .env file content.
|
|
8
|
-
* @returns A record of environment variable key-value pairs.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* parseEnvContent('JIRA_BASE_URL=https://example.atlassian.net\nJIRA_USER=user@example.com');
|
|
13
|
-
* // { JIRA_BASE_URL: 'https://example.atlassian.net', JIRA_USER: 'user@example.com' }
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare function parseEnvContent(content: string): Record<string, string>;
|
|
17
|
-
/**
|
|
18
|
-
* Load environment variables from a `.clancy/.env` file.
|
|
19
|
-
*
|
|
20
|
-
* @param projectRoot - The root directory of the project containing `.clancy/`.
|
|
21
|
-
* @returns The parsed environment variables, or `undefined` if the file doesn't exist.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const env = loadClancyEnv('/path/to/project');
|
|
26
|
-
* // env?.JIRA_BASE_URL === 'https://example.atlassian.net'
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare function loadClancyEnv(projectRoot: string): Record<string, string> | undefined;
|
|
30
|
-
//# sourceMappingURL=env-parser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-parser.d.ts","sourceRoot":"","sources":["../../../../src/scripts/shared/env-parser/env-parser.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA4BvE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAQpC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Clancy .env file parser.
|
|
3
|
-
*
|
|
4
|
-
* Reads key=value pairs from `.clancy/.env` files. Supports quoted values,
|
|
5
|
-
* comments, and blank lines. Does NOT use dotenv — zero dependencies.
|
|
6
|
-
*/
|
|
7
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
8
|
-
import { join } from 'node:path';
|
|
9
|
-
/**
|
|
10
|
-
* Parse a .env file content string into a key-value record.
|
|
11
|
-
*
|
|
12
|
-
* Handles single-quoted, double-quoted, and unquoted values.
|
|
13
|
-
* Ignores blank lines and lines starting with `#`.
|
|
14
|
-
*
|
|
15
|
-
* @param content - The raw .env file content.
|
|
16
|
-
* @returns A record of environment variable key-value pairs.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* parseEnvContent('JIRA_BASE_URL=https://example.atlassian.net\nJIRA_USER=user@example.com');
|
|
21
|
-
* // { JIRA_BASE_URL: 'https://example.atlassian.net', JIRA_USER: 'user@example.com' }
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export function parseEnvContent(content) {
|
|
25
|
-
const env = {};
|
|
26
|
-
for (const line of content.split('\n')) {
|
|
27
|
-
const trimmed = line.trim();
|
|
28
|
-
if (!trimmed || trimmed.startsWith('#'))
|
|
29
|
-
continue;
|
|
30
|
-
const eqIndex = trimmed.indexOf('=');
|
|
31
|
-
if (eqIndex === -1)
|
|
32
|
-
continue;
|
|
33
|
-
const key = trimmed.slice(0, eqIndex).trim();
|
|
34
|
-
let value = trimmed.slice(eqIndex + 1).trim();
|
|
35
|
-
// Strip surrounding quotes (minimum 2 chars to avoid stripping a lone quote)
|
|
36
|
-
if (value.length >= 2 &&
|
|
37
|
-
((value.startsWith('"') && value.endsWith('"')) ||
|
|
38
|
-
(value.startsWith("'") && value.endsWith("'")))) {
|
|
39
|
-
value = value.slice(1, -1);
|
|
40
|
-
}
|
|
41
|
-
env[key] = value;
|
|
42
|
-
}
|
|
43
|
-
return env;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Load environment variables from a `.clancy/.env` file.
|
|
47
|
-
*
|
|
48
|
-
* @param projectRoot - The root directory of the project containing `.clancy/`.
|
|
49
|
-
* @returns The parsed environment variables, or `undefined` if the file doesn't exist.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```ts
|
|
53
|
-
* const env = loadClancyEnv('/path/to/project');
|
|
54
|
-
* // env?.JIRA_BASE_URL === 'https://example.atlassian.net'
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export function loadClancyEnv(projectRoot) {
|
|
58
|
-
const envPath = join(projectRoot, '.clancy', '.env');
|
|
59
|
-
if (!existsSync(envPath))
|
|
60
|
-
return undefined;
|
|
61
|
-
const content = readFileSync(envPath, 'utf8');
|
|
62
|
-
return parseEnvContent(content);
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=env-parser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-parser.js","sourceRoot":"","sources":["../../../../src/scripts/shared/env-parser/env-parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,MAAM,GAAG,GAA2B,EAAE,CAAC;IAEvC,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAE5B,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QAElD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAErC,IAAI,OAAO,KAAK,CAAC,CAAC;YAAE,SAAS;QAE7B,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7C,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAE9C,6EAA6E;QAC7E,IACE,KAAK,CAAC,MAAM,IAAI,CAAC;YACjB,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAC7C,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EACjD,CAAC;YACD,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7B,CAAC;QAED,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAC3B,WAAmB;IAEnB,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAErD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IAE3C,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAE9C,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ANSI escape code helpers for terminal output.
|
|
3
|
-
*
|
|
4
|
-
* Wraps strings in ANSI sequences for styling in CLI environments.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Dim the given string (reduced intensity).
|
|
8
|
-
*
|
|
9
|
-
* @param s - The string to style.
|
|
10
|
-
* @returns The string wrapped in ANSI dim codes.
|
|
11
|
-
*/
|
|
12
|
-
export declare const dim: (s: string) => string;
|
|
13
|
-
/**
|
|
14
|
-
* Bold the given string.
|
|
15
|
-
*
|
|
16
|
-
* @param s - The string to style.
|
|
17
|
-
* @returns The string wrapped in ANSI bold codes.
|
|
18
|
-
*/
|
|
19
|
-
export declare const bold: (s: string) => string;
|
|
20
|
-
/**
|
|
21
|
-
* Colour the given string blue (bold).
|
|
22
|
-
*
|
|
23
|
-
* @param s - The string to style.
|
|
24
|
-
* @returns The string wrapped in ANSI blue codes.
|
|
25
|
-
*/
|
|
26
|
-
export declare const blue: (s: string) => string;
|
|
27
|
-
/**
|
|
28
|
-
* Colour the given string cyan.
|
|
29
|
-
*
|
|
30
|
-
* @param s - The string to style.
|
|
31
|
-
* @returns The string wrapped in ANSI cyan codes.
|
|
32
|
-
*/
|
|
33
|
-
export declare const cyan: (s: string) => string;
|
|
34
|
-
/**
|
|
35
|
-
* Colour the given string green.
|
|
36
|
-
*
|
|
37
|
-
* @param s - The string to style.
|
|
38
|
-
* @returns The string wrapped in ANSI green codes.
|
|
39
|
-
*/
|
|
40
|
-
export declare const green: (s: string) => string;
|
|
41
|
-
/**
|
|
42
|
-
* Colour the given string red.
|
|
43
|
-
*
|
|
44
|
-
* @param s - The string to style.
|
|
45
|
-
* @returns The string wrapped in ANSI red codes.
|
|
46
|
-
*/
|
|
47
|
-
export declare const red: (s: string) => string;
|
|
48
|
-
/**
|
|
49
|
-
* Colour the given string yellow.
|
|
50
|
-
*
|
|
51
|
-
* @param s - The string to style.
|
|
52
|
-
* @returns The string wrapped in ANSI yellow codes.
|
|
53
|
-
*/
|
|
54
|
-
export declare const yellow: (s: string) => string;
|
|
55
|
-
//# sourceMappingURL=ansi.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ansi.d.ts","sourceRoot":"","sources":["../../../src/utils/ansi/ansi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,KAAG,MAA8B,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,KAAG,MAA8B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,KAAG,MAAiC,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,KAAG,MAA+B,CAAC;AAEjE;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,GAAG,MAAM,KAAG,MAA+B,CAAC;AAElE;;;;;GAKG;AACH,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,KAAG,MAA+B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,GAAG,MAAM,KAAG,MAA+B,CAAC"}
|
package/dist/utils/ansi/ansi.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ANSI escape code helpers for terminal output.
|
|
3
|
-
*
|
|
4
|
-
* Wraps strings in ANSI sequences for styling in CLI environments.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Dim the given string (reduced intensity).
|
|
8
|
-
*
|
|
9
|
-
* @param s - The string to style.
|
|
10
|
-
* @returns The string wrapped in ANSI dim codes.
|
|
11
|
-
*/
|
|
12
|
-
export const dim = (s) => `\x1b[2m${s}\x1b[0m`;
|
|
13
|
-
/**
|
|
14
|
-
* Bold the given string.
|
|
15
|
-
*
|
|
16
|
-
* @param s - The string to style.
|
|
17
|
-
* @returns The string wrapped in ANSI bold codes.
|
|
18
|
-
*/
|
|
19
|
-
export const bold = (s) => `\x1b[1m${s}\x1b[0m`;
|
|
20
|
-
/**
|
|
21
|
-
* Colour the given string blue (bold).
|
|
22
|
-
*
|
|
23
|
-
* @param s - The string to style.
|
|
24
|
-
* @returns The string wrapped in ANSI blue codes.
|
|
25
|
-
*/
|
|
26
|
-
export const blue = (s) => `\x1b[1;34m${s}\x1b[0m`;
|
|
27
|
-
/**
|
|
28
|
-
* Colour the given string cyan.
|
|
29
|
-
*
|
|
30
|
-
* @param s - The string to style.
|
|
31
|
-
* @returns The string wrapped in ANSI cyan codes.
|
|
32
|
-
*/
|
|
33
|
-
export const cyan = (s) => `\x1b[36m${s}\x1b[0m`;
|
|
34
|
-
/**
|
|
35
|
-
* Colour the given string green.
|
|
36
|
-
*
|
|
37
|
-
* @param s - The string to style.
|
|
38
|
-
* @returns The string wrapped in ANSI green codes.
|
|
39
|
-
*/
|
|
40
|
-
export const green = (s) => `\x1b[32m${s}\x1b[0m`;
|
|
41
|
-
/**
|
|
42
|
-
* Colour the given string red.
|
|
43
|
-
*
|
|
44
|
-
* @param s - The string to style.
|
|
45
|
-
* @returns The string wrapped in ANSI red codes.
|
|
46
|
-
*/
|
|
47
|
-
export const red = (s) => `\x1b[31m${s}\x1b[0m`;
|
|
48
|
-
/**
|
|
49
|
-
* Colour the given string yellow.
|
|
50
|
-
*
|
|
51
|
-
* @param s - The string to style.
|
|
52
|
-
* @returns The string wrapped in ANSI yellow codes.
|
|
53
|
-
*/
|
|
54
|
-
export const yellow = (s) => `\x1b[33m${s}\x1b[0m`;
|
|
55
|
-
//# sourceMappingURL=ansi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ansi.js","sourceRoot":"","sources":["../../../src/utils/ansi/ansi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC;AAElE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC"}
|