git-smart-flow 0.3.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/CHANGELOG.md +33 -0
- package/LICENSE +21 -0
- package/README.md +130 -0
- package/bin/git-smart-flow.js +2 -0
- package/bin/gsf.js +2 -0
- package/bin/gsfc.js +3 -0
- package/bin/gsfm.js +3 -0
- package/bin/gsfp.js +3 -0
- package/bin/gsfpr.js +3 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +214 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/aliases.d.ts +2 -0
- package/dist/commands/aliases.js +37 -0
- package/dist/commands/aliases.js.map +1 -0
- package/dist/commands/branch.d.ts +2 -0
- package/dist/commands/branch.js +414 -0
- package/dist/commands/branch.js.map +1 -0
- package/dist/commands/commit-message.d.ts +7 -0
- package/dist/commands/commit-message.js +95 -0
- package/dist/commands/commit-message.js.map +1 -0
- package/dist/commands/commit.d.ts +3 -0
- package/dist/commands/commit.js +597 -0
- package/dist/commands/commit.js.map +1 -0
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.js +88 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.js +246 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/info.d.ts +2 -0
- package/dist/commands/info.js +155 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/install-hooks.d.ts +2 -0
- package/dist/commands/install-hooks.js +66 -0
- package/dist/commands/install-hooks.js.map +1 -0
- package/dist/commands/log.d.ts +2 -0
- package/dist/commands/log.js +101 -0
- package/dist/commands/log.js.map +1 -0
- package/dist/commands/menu.d.ts +2 -0
- package/dist/commands/menu.js +297 -0
- package/dist/commands/menu.js.map +1 -0
- package/dist/commands/merge.d.ts +6 -0
- package/dist/commands/merge.js +128 -0
- package/dist/commands/merge.js.map +1 -0
- package/dist/commands/pr.d.ts +2 -0
- package/dist/commands/pr.js +731 -0
- package/dist/commands/pr.js.map +1 -0
- package/dist/commands/push.d.ts +7 -0
- package/dist/commands/push.js +225 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/reflog.d.ts +2 -0
- package/dist/commands/reflog.js +162 -0
- package/dist/commands/reflog.js.map +1 -0
- package/dist/commands/repo-init.d.ts +2 -0
- package/dist/commands/repo-init.js +466 -0
- package/dist/commands/repo-init.js.map +1 -0
- package/dist/commands/revert.d.ts +7 -0
- package/dist/commands/revert.js +694 -0
- package/dist/commands/revert.js.map +1 -0
- package/dist/commands/setup.d.ts +2 -0
- package/dist/commands/setup.js +86 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/stash.d.ts +2 -0
- package/dist/commands/stash.js +130 -0
- package/dist/commands/stash.js.map +1 -0
- package/dist/commands/sync.d.ts +2 -0
- package/dist/commands/sync.js +335 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/tag.d.ts +2 -0
- package/dist/commands/tag.js +163 -0
- package/dist/commands/tag.js.map +1 -0
- package/dist/commands/validate.d.ts +2 -0
- package/dist/commands/validate.js +203 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/config/config.d.ts +10 -0
- package/dist/config/config.js +126 -0
- package/dist/config/config.js.map +1 -0
- package/dist/git/ai-context-builder.d.ts +11 -0
- package/dist/git/ai-context-builder.js +112 -0
- package/dist/git/ai-context-builder.js.map +1 -0
- package/dist/git/convention-detector.d.ts +3 -0
- package/dist/git/convention-detector.js +211 -0
- package/dist/git/convention-detector.js.map +1 -0
- package/dist/git/ensure-repo.d.ts +7 -0
- package/dist/git/ensure-repo.js +141 -0
- package/dist/git/ensure-repo.js.map +1 -0
- package/dist/git/gitignore.d.ts +8 -0
- package/dist/git/gitignore.js +261 -0
- package/dist/git/gitignore.js.map +1 -0
- package/dist/git/remote-setup.d.ts +2 -0
- package/dist/git/remote-setup.js +129 -0
- package/dist/git/remote-setup.js.map +1 -0
- package/dist/git/repo.d.ts +73 -0
- package/dist/git/repo.js +308 -0
- package/dist/git/repo.js.map +1 -0
- package/dist/git/validate.d.ts +36 -0
- package/dist/git/validate.js +113 -0
- package/dist/git/validate.js.map +1 -0
- package/dist/providers/base.provider.d.ts +10 -0
- package/dist/providers/base.provider.js +40 -0
- package/dist/providers/base.provider.js.map +1 -0
- package/dist/providers/claude.provider.d.ts +14 -0
- package/dist/providers/claude.provider.js +85 -0
- package/dist/providers/claude.provider.js.map +1 -0
- package/dist/providers/copilot.provider.d.ts +12 -0
- package/dist/providers/copilot.provider.js +88 -0
- package/dist/providers/copilot.provider.js.map +1 -0
- package/dist/providers/heuristic.provider.d.ts +9 -0
- package/dist/providers/heuristic.provider.js +163 -0
- package/dist/providers/heuristic.provider.js.map +1 -0
- package/dist/providers/ollama.provider.d.ts +14 -0
- package/dist/providers/ollama.provider.js +83 -0
- package/dist/providers/ollama.provider.js.map +1 -0
- package/dist/providers/openai.provider.d.ts +14 -0
- package/dist/providers/openai.provider.js +84 -0
- package/dist/providers/openai.provider.js.map +1 -0
- package/dist/providers/provider.factory.d.ts +5 -0
- package/dist/providers/provider.factory.js +51 -0
- package/dist/providers/provider.factory.js.map +1 -0
- package/dist/security/scanner.d.ts +13 -0
- package/dist/security/scanner.js +138 -0
- package/dist/security/scanner.js.map +1 -0
- package/dist/types/index.d.ts +146 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ux/components/BranchTree.d.ts +8 -0
- package/dist/ux/components/BranchTree.js +57 -0
- package/dist/ux/components/BranchTree.js.map +1 -0
- package/dist/ux/components/CommitProposal.d.ts +13 -0
- package/dist/ux/components/CommitProposal.js +127 -0
- package/dist/ux/components/CommitProposal.js.map +1 -0
- package/dist/ux/components/DiagnosticReport.d.ts +18 -0
- package/dist/ux/components/DiagnosticReport.js +19 -0
- package/dist/ux/components/DiagnosticReport.js.map +1 -0
- package/dist/ux/components/ErrorBox.d.ts +7 -0
- package/dist/ux/components/ErrorBox.js +9 -0
- package/dist/ux/components/ErrorBox.js.map +1 -0
- package/dist/ux/components/FileSelector.d.ts +14 -0
- package/dist/ux/components/FileSelector.js +87 -0
- package/dist/ux/components/FileSelector.js.map +1 -0
- package/dist/ux/components/Logo.d.ts +6 -0
- package/dist/ux/components/Logo.js +21 -0
- package/dist/ux/components/Logo.js.map +1 -0
- package/dist/ux/components/RepoContext.d.ts +8 -0
- package/dist/ux/components/RepoContext.js +17 -0
- package/dist/ux/components/RepoContext.js.map +1 -0
- package/dist/ux/components/SecurityAlert.d.ts +9 -0
- package/dist/ux/components/SecurityAlert.js +16 -0
- package/dist/ux/components/SecurityAlert.js.map +1 -0
- package/dist/ux/components/StatusDashboard.d.ts +14 -0
- package/dist/ux/components/StatusDashboard.js +36 -0
- package/dist/ux/components/StatusDashboard.js.map +1 -0
- package/dist/ux/components/SuccessBox.d.ts +7 -0
- package/dist/ux/components/SuccessBox.js +9 -0
- package/dist/ux/components/SuccessBox.js.map +1 -0
- package/dist/ux/components/ValidationReport.d.ts +16 -0
- package/dist/ux/components/ValidationReport.js +19 -0
- package/dist/ux/components/ValidationReport.js.map +1 -0
- package/dist/ux/components/WarningBox.d.ts +7 -0
- package/dist/ux/components/WarningBox.js +9 -0
- package/dist/ux/components/WarningBox.js.map +1 -0
- package/dist/ux/display.d.ts +21 -0
- package/dist/ux/display.js +96 -0
- package/dist/ux/display.js.map +1 -0
- package/dist/ux/hooks/useActivation.d.ts +8 -0
- package/dist/ux/hooks/useActivation.js +16 -0
- package/dist/ux/hooks/useActivation.js.map +1 -0
- package/dist/ux/hooks/useSpinner.d.ts +2 -0
- package/dist/ux/hooks/useSpinner.js +13 -0
- package/dist/ux/hooks/useSpinner.js.map +1 -0
- package/dist/ux/menu.d.ts +7 -0
- package/dist/ux/menu.js +56 -0
- package/dist/ux/menu.js.map +1 -0
- package/dist/ux/prompt.d.ts +7 -0
- package/dist/ux/prompt.js +361 -0
- package/dist/ux/prompt.js.map +1 -0
- package/dist/ux/renderer.d.ts +9 -0
- package/dist/ux/renderer.js +45 -0
- package/dist/ux/renderer.js.map +1 -0
- package/dist/ux/spinner.d.ts +6 -0
- package/dist/ux/spinner.js +42 -0
- package/dist/ux/spinner.js.map +1 -0
- package/dist/ux/statusbar.d.ts +2 -0
- package/dist/ux/statusbar.js +44 -0
- package/dist/ux/statusbar.js.map +1 -0
- package/dist/ux/theme.d.ts +37 -0
- package/dist/ux/theme.js +55 -0
- package/dist/ux/theme.js.map +1 -0
- package/package.json +125 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { basename } from 'path';
|
|
2
|
+
const SECRET_PATTERNS = [
|
|
3
|
+
{ name: 'password assignment', regex: /password\s*=\s*['"][^'"]{4,}/i },
|
|
4
|
+
{ name: 'passwd assignment', regex: /passwd\s*=\s*['"][^'"]{4,}/i },
|
|
5
|
+
{ name: 'secret assignment', regex: /secret\s*=\s*['"][^'"]{4,}/i },
|
|
6
|
+
{ name: 'token assignment', regex: /token\s*=\s*['"][^'"]{4,}/i },
|
|
7
|
+
{ name: 'api_key assignment', regex: /api_?key\s*=\s*['"][^'"]{4,}/i },
|
|
8
|
+
{ name: 'private_key', regex: /private[_-]key/i },
|
|
9
|
+
{
|
|
10
|
+
name: 'Authorization header',
|
|
11
|
+
regex: /Authorization\s*:\s*['"]?\s*Bearer\s+[A-Za-z0-9._\-+/]{10,}/i,
|
|
12
|
+
},
|
|
13
|
+
{ name: 'client_secret', regex: /client[_-]secret\s*[:=]\s*['"][^'"]{4,}/i },
|
|
14
|
+
{ name: 'access_token', regex: /access[_-]token\s*[:=]\s*['"][^'"]{4,}/i },
|
|
15
|
+
{ name: 'refresh_token', regex: /refresh[_-]token\s*[:=]\s*['"][^'"]{4,}/i },
|
|
16
|
+
{ name: 'AWS_SECRET', regex: /AWS_SECRET_ACCESS_KEY\s*[:=]\s*['"]?[A-Za-z0-9/+]{20,}/i },
|
|
17
|
+
{ name: 'GITHUB_TOKEN', regex: /GITHUB_TOKEN\s*[:=]\s*['"]?ghp_[A-Za-z0-9]{36}/i },
|
|
18
|
+
{ name: 'private key block', regex: /-----BEGIN\s+\w*\s*PRIVATE KEY-----/ },
|
|
19
|
+
{ name: 'certificate block', regex: /-----BEGIN CERTIFICATE-----/ },
|
|
20
|
+
{ name: 'long alphanumeric token', regex: /['"` ][A-Za-z0-9_\-]{40,}['"` ]/ },
|
|
21
|
+
];
|
|
22
|
+
const SENSITIVE_FILE_PATTERNS = [
|
|
23
|
+
/^\.env(\..+)?$/,
|
|
24
|
+
/\.pem$/,
|
|
25
|
+
/\.key$/,
|
|
26
|
+
/\.p12$/,
|
|
27
|
+
/^id_rsa$/,
|
|
28
|
+
/^id_dsa$/,
|
|
29
|
+
/^id_ed25519$/,
|
|
30
|
+
/^id_ecdsa$/,
|
|
31
|
+
/^credentials\.json$/,
|
|
32
|
+
/^secrets\.json$/,
|
|
33
|
+
/^\.npmrc$/,
|
|
34
|
+
/^\.netrc$/,
|
|
35
|
+
];
|
|
36
|
+
export function scanFiles(targets, blockedFilePatterns) {
|
|
37
|
+
const blockedFiles = [];
|
|
38
|
+
const detectedSecrets = [];
|
|
39
|
+
for (const target of targets) {
|
|
40
|
+
const name = basename(target.path);
|
|
41
|
+
if (isSensitiveFile(name, blockedFilePatterns)) {
|
|
42
|
+
blockedFiles.push(target.path);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (target.content) {
|
|
46
|
+
const secrets = scanContent(target.path, target.content);
|
|
47
|
+
detectedSecrets.push(...secrets);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const clean = blockedFiles.length === 0 && detectedSecrets.length === 0;
|
|
51
|
+
return {
|
|
52
|
+
clean,
|
|
53
|
+
blockedFiles,
|
|
54
|
+
detectedSecrets,
|
|
55
|
+
redactionsApplied: 0,
|
|
56
|
+
summary: buildSummary(blockedFiles, detectedSecrets),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function scanDiff(diff, filePaths, blockedFilePatterns) {
|
|
60
|
+
const targets = filePaths.map((path) => ({
|
|
61
|
+
path,
|
|
62
|
+
content: extractDiffContent(diff, path),
|
|
63
|
+
}));
|
|
64
|
+
return scanFiles(targets, blockedFilePatterns);
|
|
65
|
+
}
|
|
66
|
+
export function redactContent(content) {
|
|
67
|
+
let redacted = content;
|
|
68
|
+
let count = 0;
|
|
69
|
+
for (const { regex } of SECRET_PATTERNS) {
|
|
70
|
+
const newContent = redacted.replace(regex, (match) => {
|
|
71
|
+
count++;
|
|
72
|
+
return match.substring(0, 8) + '***REDACTED***';
|
|
73
|
+
});
|
|
74
|
+
redacted = newContent;
|
|
75
|
+
}
|
|
76
|
+
return { redacted, count };
|
|
77
|
+
}
|
|
78
|
+
export function isSensitiveFile(filename, extraPatterns = []) {
|
|
79
|
+
for (const pattern of SENSITIVE_FILE_PATTERNS) {
|
|
80
|
+
if (pattern.test(filename))
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
for (const pattern of extraPatterns) {
|
|
84
|
+
const regex = globToRegex(pattern);
|
|
85
|
+
if (regex.test(filename))
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
function scanContent(filePath, content) {
|
|
91
|
+
const findings = [];
|
|
92
|
+
const lines = content.split('\n');
|
|
93
|
+
for (let i = 0; i < lines.length; i++) {
|
|
94
|
+
for (const { name, regex } of SECRET_PATTERNS) {
|
|
95
|
+
if (regex.test(lines[i] ?? '')) {
|
|
96
|
+
findings.push({ file: filePath, line: i + 1, pattern: name });
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return findings;
|
|
102
|
+
}
|
|
103
|
+
function extractDiffContent(diff, filePath) {
|
|
104
|
+
const lines = diff.split('\n');
|
|
105
|
+
const fileStart = lines.findIndex((l) => l.startsWith('+++ b/') && l.includes(filePath));
|
|
106
|
+
if (fileStart === -1)
|
|
107
|
+
return '';
|
|
108
|
+
const added = [];
|
|
109
|
+
for (let i = fileStart + 1; i < lines.length; i++) {
|
|
110
|
+
if ((lines[i] ?? '').startsWith('diff --git'))
|
|
111
|
+
break;
|
|
112
|
+
if ((lines[i] ?? '').startsWith('+') && !(lines[i] ?? '').startsWith('+++')) {
|
|
113
|
+
added.push((lines[i] ?? '').slice(1));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return added.join('\n');
|
|
117
|
+
}
|
|
118
|
+
function buildSummary(blocked, secrets) {
|
|
119
|
+
if (blocked.length === 0 && secrets.length === 0)
|
|
120
|
+
return 'No security issues found.';
|
|
121
|
+
const parts = [];
|
|
122
|
+
if (blocked.length > 0)
|
|
123
|
+
parts.push(`${blocked.length} sensitive file(s) blocked`);
|
|
124
|
+
if (secrets.length > 0)
|
|
125
|
+
parts.push(`${secrets.length} potential secret(s) detected`);
|
|
126
|
+
return parts.join('; ');
|
|
127
|
+
}
|
|
128
|
+
function globToRegex(pattern) {
|
|
129
|
+
// Order matters: escape special regex chars first, then expand glob tokens.
|
|
130
|
+
const escaped = pattern
|
|
131
|
+
.replace(/[.+^${}()|[\]\\]/g, '\\$&') // escape regex metacharacters
|
|
132
|
+
.replace(/\*\*/g, '\x00') // temporarily protect **
|
|
133
|
+
.replace(/\*/g, '[^/]*') // * = any chars except separator
|
|
134
|
+
.replace(/\x00/g, '.*') // ** = any chars including separator
|
|
135
|
+
.replace(/\?/g, '[^/]'); // ? = any single char except separator
|
|
136
|
+
return new RegExp(`^${escaped}$`, 'i');
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=scanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner.js","sourceRoot":"","sources":["../../src/security/scanner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAGhC,MAAM,eAAe,GAA2C;IAC9D,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,+BAA+B,EAAE;IACvE,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAA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CAAC;IAC3B,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,4BAA4B,CAAC,CAAC;IAClF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,+BAA+B,CAAC,CAAC;IACrF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,WAAW,CAAC,OAAe;IAClC,4EAA4E;IAC5E,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,8BAA8B;SACnE,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,yBAAyB;SAClD,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,iCAAiC;SACzD,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,qCAAqC;SAC5D,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,uCAAuC;IAClE,OAAO,IAAI,MAAM,CAAC,IAAI,OAAO,GAAG,EAAE,GAAG,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export type ConventionType = 'conventional' | 'angular' | 'custom' | 'unknown';
|
|
2
|
+
export type SubjectCase = 'lower-case' | 'upper-case' | 'sentence-case' | 'start-case' | 'any';
|
|
3
|
+
export type AIMode = 'enriched' | 'summary' | 'full';
|
|
4
|
+
export type ProviderName = 'heuristic' | 'copilot' | 'openai' | 'claude' | 'ollama';
|
|
5
|
+
export type Language = 'en' | 'es' | 'fr' | 'de' | 'pt' | 'it' | 'ja' | 'zh';
|
|
6
|
+
export interface CommitConvention {
|
|
7
|
+
type: ConventionType;
|
|
8
|
+
allowedTypes: string[];
|
|
9
|
+
allowedScopes?: string[];
|
|
10
|
+
scopeRequired: boolean;
|
|
11
|
+
maxHeaderLength: number;
|
|
12
|
+
requireTicket: boolean | 'auto';
|
|
13
|
+
ticketPattern: string;
|
|
14
|
+
subjectCase: SubjectCase;
|
|
15
|
+
hasCommitlint: boolean;
|
|
16
|
+
hasHusky: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface RepoContext {
|
|
19
|
+
name: string;
|
|
20
|
+
branch: string;
|
|
21
|
+
ticket?: string;
|
|
22
|
+
convention: CommitConvention;
|
|
23
|
+
isMonorepo: boolean;
|
|
24
|
+
upstream?: string;
|
|
25
|
+
hasUncommittedChanges: boolean;
|
|
26
|
+
stagedFiles: StagedFile[];
|
|
27
|
+
unstagedFiles: string[];
|
|
28
|
+
untrackedFiles: string[];
|
|
29
|
+
conflictsActive: boolean;
|
|
30
|
+
aheadCount: number;
|
|
31
|
+
behindCount: number;
|
|
32
|
+
}
|
|
33
|
+
export interface StagedFile {
|
|
34
|
+
path: string;
|
|
35
|
+
status: 'added' | 'modified' | 'deleted' | 'renamed' | 'copied' | 'unknown';
|
|
36
|
+
}
|
|
37
|
+
export interface AIContext {
|
|
38
|
+
repository: string;
|
|
39
|
+
branch: string;
|
|
40
|
+
ticket?: string;
|
|
41
|
+
detectedCommitConvention: CommitConvention;
|
|
42
|
+
changedFiles: {
|
|
43
|
+
path: string;
|
|
44
|
+
status: string;
|
|
45
|
+
}[];
|
|
46
|
+
localSummary: string[];
|
|
47
|
+
sanitizedFragments: {
|
|
48
|
+
file: string;
|
|
49
|
+
summary: string;
|
|
50
|
+
}[];
|
|
51
|
+
}
|
|
52
|
+
export interface AIProvider {
|
|
53
|
+
name: ProviderName;
|
|
54
|
+
isAvailable(): Promise<boolean>;
|
|
55
|
+
generateCommitMessage(context: AIContext): Promise<string>;
|
|
56
|
+
generatePRDescription(context: AIContext): Promise<PRProposal>;
|
|
57
|
+
}
|
|
58
|
+
export interface SecurityScanResult {
|
|
59
|
+
clean: boolean;
|
|
60
|
+
blockedFiles: string[];
|
|
61
|
+
detectedSecrets: {
|
|
62
|
+
file: string;
|
|
63
|
+
line: number;
|
|
64
|
+
pattern: string;
|
|
65
|
+
}[];
|
|
66
|
+
redactionsApplied: number;
|
|
67
|
+
summary: string;
|
|
68
|
+
}
|
|
69
|
+
export interface GlobalConfig {
|
|
70
|
+
language: {
|
|
71
|
+
commit: Language;
|
|
72
|
+
prTitle: Language;
|
|
73
|
+
prBody: Language;
|
|
74
|
+
};
|
|
75
|
+
ai: {
|
|
76
|
+
enabled: boolean;
|
|
77
|
+
provider: ProviderName;
|
|
78
|
+
mode: AIMode;
|
|
79
|
+
allowRawDiff: boolean;
|
|
80
|
+
showPromptBeforeSend: boolean;
|
|
81
|
+
model?: string;
|
|
82
|
+
apiKey?: string;
|
|
83
|
+
ollamaModel?: string;
|
|
84
|
+
ollamaUrl?: string;
|
|
85
|
+
copilotCommand?: string;
|
|
86
|
+
};
|
|
87
|
+
git: {
|
|
88
|
+
protectedBranches: string[];
|
|
89
|
+
defaultBaseBranches: string[];
|
|
90
|
+
githubIntegration?: boolean;
|
|
91
|
+
autoFetch?: boolean;
|
|
92
|
+
autoFetchIntervalMinutes?: number;
|
|
93
|
+
};
|
|
94
|
+
commit: {
|
|
95
|
+
convention: ConventionType;
|
|
96
|
+
maxHeaderLength: number;
|
|
97
|
+
requireTicket: boolean | 'auto';
|
|
98
|
+
ticketPattern: string;
|
|
99
|
+
};
|
|
100
|
+
security: {
|
|
101
|
+
blockOnSecrets: boolean;
|
|
102
|
+
redactSecrets: boolean;
|
|
103
|
+
blockedFiles: string[];
|
|
104
|
+
};
|
|
105
|
+
aliases: {
|
|
106
|
+
gsfc: boolean;
|
|
107
|
+
gsfm: boolean;
|
|
108
|
+
gsfp: boolean;
|
|
109
|
+
gsfpr: boolean;
|
|
110
|
+
gsfs: boolean;
|
|
111
|
+
gsfr: boolean;
|
|
112
|
+
gsfb: boolean;
|
|
113
|
+
gsft: boolean;
|
|
114
|
+
};
|
|
115
|
+
ui?: {
|
|
116
|
+
historyLimit?: number;
|
|
117
|
+
syncCommitsShown?: number;
|
|
118
|
+
logLimit?: number;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export interface LocalConfig {
|
|
122
|
+
ai?: Partial<GlobalConfig['ai']>;
|
|
123
|
+
git?: Partial<GlobalConfig['git']>;
|
|
124
|
+
commit?: Partial<GlobalConfig['commit']>;
|
|
125
|
+
security?: Partial<GlobalConfig['security']>;
|
|
126
|
+
}
|
|
127
|
+
export interface MergedConfig extends GlobalConfig {
|
|
128
|
+
_source: 'merged';
|
|
129
|
+
}
|
|
130
|
+
export interface ValidationResult {
|
|
131
|
+
valid: boolean;
|
|
132
|
+
errors: string[];
|
|
133
|
+
warnings: string[];
|
|
134
|
+
}
|
|
135
|
+
export interface CommitProposal {
|
|
136
|
+
message: string;
|
|
137
|
+
validation: ValidationResult;
|
|
138
|
+
aiContextVisible?: AIContext;
|
|
139
|
+
provider: ProviderName;
|
|
140
|
+
}
|
|
141
|
+
export interface PRProposal {
|
|
142
|
+
title: string;
|
|
143
|
+
body: string;
|
|
144
|
+
checklist?: string[];
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Box, Text } from 'ink';
|
|
4
|
+
import { spawnSync } from 'child_process';
|
|
5
|
+
import { branchColor, theme } from '../theme.js';
|
|
6
|
+
// Format: graph_prefix + sha \x1f subject \x1f relative-date \x1f decoration
|
|
7
|
+
function parseGraphLine(line) {
|
|
8
|
+
const parts = line.split('\x1f');
|
|
9
|
+
if (parts.length >= 4) {
|
|
10
|
+
const graphAndSha = parts[0] ?? '';
|
|
11
|
+
const rawMsg = parts[1] ?? '';
|
|
12
|
+
const ago = parts[2] ?? '';
|
|
13
|
+
const refsStr = parts[3] ?? '';
|
|
14
|
+
const refs = refsStr
|
|
15
|
+
? refsStr
|
|
16
|
+
.split(', ')
|
|
17
|
+
.map((r) => r.replace(/^HEAD -> /, '').trim())
|
|
18
|
+
.filter(Boolean)
|
|
19
|
+
: [];
|
|
20
|
+
const shaMatch = graphAndSha.match(/\b([0-9a-f]{6,10})\b/);
|
|
21
|
+
const sha = shaMatch ? (shaMatch[1] ?? '') : '';
|
|
22
|
+
const graphPart = graphAndSha.replace(/\b[0-9a-f]{7,}\b.*/, '').trimEnd();
|
|
23
|
+
const graphUnicode = toUnicodeGraph(graphPart);
|
|
24
|
+
const msg = rawMsg.length > 38 ? rawMsg.slice(0, 37) + '…' : rawMsg;
|
|
25
|
+
return { graph: graphUnicode, sha, msg, refs, ago };
|
|
26
|
+
}
|
|
27
|
+
// Pure graph continuation line (no commit data on this line)
|
|
28
|
+
return { graph: toUnicodeGraph(parts[0] ?? ''), sha: '', msg: '', refs: [], ago: '' };
|
|
29
|
+
}
|
|
30
|
+
function toUnicodeGraph(s) {
|
|
31
|
+
return s
|
|
32
|
+
.replace(/\*/g, '●')
|
|
33
|
+
.replace(/\|/g, '│')
|
|
34
|
+
.replace(/\//g, '╭')
|
|
35
|
+
.replace(/\\/g, '╰')
|
|
36
|
+
.replace(/-/g, '─');
|
|
37
|
+
}
|
|
38
|
+
export function BranchTree({ cwd = process.cwd(), limit = 8, showMeta = false, }) {
|
|
39
|
+
const [lines, setLines] = useState([]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
const result = spawnSync('git', ['log', '--graph', '--format=%h\x1f%s\x1f%ar\x1f%D', '--color=never', '--all', `-${limit}`], { cwd, encoding: 'utf-8' });
|
|
42
|
+
if (result.status === 0 && result.stdout) {
|
|
43
|
+
setLines(result.stdout.trim().split('\n').filter(Boolean));
|
|
44
|
+
}
|
|
45
|
+
}, [cwd, limit]);
|
|
46
|
+
if (lines.length === 0) {
|
|
47
|
+
return (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: theme.muted, children: " \u25CF (no commits yet)" }) }));
|
|
48
|
+
}
|
|
49
|
+
return (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: lines.map((rawLine, i) => {
|
|
50
|
+
const { graph, sha, msg, refs, ago } = parseGraphLine(rawLine);
|
|
51
|
+
const mainRef = refs[0];
|
|
52
|
+
const refColor = mainRef ? branchColor(mainRef) : theme.muted;
|
|
53
|
+
const isHead = refs.some((r) => r === 'HEAD' || r.startsWith('HEAD'));
|
|
54
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { color: theme.muted, children: [graph, " "] }), sha ? (_jsxs(_Fragment, { children: [_jsxs(Text, { color: isHead ? theme.accent : theme.muted, children: [sha, " "] }), _jsx(Text, { bold: isHead, color: isHead ? 'white' : '#d1d5db', children: msg }), mainRef && mainRef !== 'HEAD' && _jsxs(Text, { color: refColor, children: [" ", mainRef] }), showMeta && ago && _jsxs(Text, { color: theme.muted, children: [" ", ago] })] })) : null] }, i));
|
|
55
|
+
}) }));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=BranchTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BranchTree.js","sourceRoot":"","sources":["../../../src/ux/components/BranchTree.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAgBjD,6EAA6E;AAC7E,SAAS,cAAc,CAAC,IAAY;IAClC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACtB,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AAK,EAAE,KAAK,CAAC,KAAK,kBAAI,GAAG,IAAQ,IAC1D,CACJ,CAAC,CAAC,CAAC,IAAI,KAXA,CAAC,CAYL,CACP,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CommitProposal } from '../../types/index.js';
|
|
2
|
+
type CommitAction = 'accept' | 'edit' | 'regenerate' | 'context' | 'cancel';
|
|
3
|
+
interface Props {
|
|
4
|
+
proposal: CommitProposal;
|
|
5
|
+
stagedCount: number;
|
|
6
|
+
linesAdded?: number;
|
|
7
|
+
linesRemoved?: number;
|
|
8
|
+
branchType?: string;
|
|
9
|
+
onAction: (action: CommitAction, extra?: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function CommitProposalView({ proposal, stagedCount, linesAdded, linesRemoved, branchType, onAction, }: Props): JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=CommitProposal.d.ts.map
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { Box, Text } from 'ink';
|
|
4
|
+
import { Select, TextInput } from '@inkjs/ui';
|
|
5
|
+
import { commitTypeColor, theme } from '../theme.js';
|
|
6
|
+
import { useActivation } from '../hooks/useActivation.js';
|
|
7
|
+
const COMMIT_TYPES = [
|
|
8
|
+
{ value: 'feat', label: 'feat — nueva funcionalidad' },
|
|
9
|
+
{ value: 'fix', label: 'fix — corrección de bug' },
|
|
10
|
+
{ value: 'docs', label: 'docs — documentación' },
|
|
11
|
+
{ value: 'style', label: 'style — formato, sin lógica' },
|
|
12
|
+
{ value: 'refactor', label: 'refactor — refactorización' },
|
|
13
|
+
{ value: 'test', label: 'test — tests' },
|
|
14
|
+
{ value: 'chore', label: 'chore — mantenimiento, deps' },
|
|
15
|
+
{ value: 'ci', label: 'ci — CI/CD' },
|
|
16
|
+
{ value: 'perf', label: 'perf — rendimiento' },
|
|
17
|
+
{ value: 'build', label: 'build — sistema de build' },
|
|
18
|
+
{ value: 'revert', label: 'revert — revertir commit' },
|
|
19
|
+
];
|
|
20
|
+
const VALID_TYPES = new Set(COMMIT_TYPES.map((t) => t.value));
|
|
21
|
+
function ValidationRow({ status, label, value, }) {
|
|
22
|
+
const icon = status === 'ok' ? (_jsx(Text, { color: theme.success, children: "\u2705" })) : status === 'warn' ? (_jsx(Text, { color: theme.warning, children: "\u26A0\uFE0F " })) : (_jsx(Text, { color: theme.error, children: "\u274C" }));
|
|
23
|
+
return (_jsxs(Box, { gap: 1, children: [icon, _jsx(Text, { color: "#d1d5db", children: label.padEnd(22) }), value && _jsx(Text, { color: theme.muted, children: value })] }));
|
|
24
|
+
}
|
|
25
|
+
function parseCommitHeader(msg) {
|
|
26
|
+
const match = msg.match(/^(\w+)(?:\(([^)]*)\))?!?\s*:\s*(.+)/);
|
|
27
|
+
if (match) {
|
|
28
|
+
return { type: match[1] ?? '', scope: match[2] ?? '', desc: match[3] ?? '' };
|
|
29
|
+
}
|
|
30
|
+
return { type: '', scope: '', desc: msg };
|
|
31
|
+
}
|
|
32
|
+
function buildValidations(msg, validation, maxLen) {
|
|
33
|
+
const header = msg.split('\n')[0] ?? '';
|
|
34
|
+
const { type, scope } = parseCommitHeader(header);
|
|
35
|
+
const pct = header.length / maxLen;
|
|
36
|
+
const lenStatus = pct > 1 ? 'error' : pct > 0.8 ? 'warn' : 'ok';
|
|
37
|
+
const lenLabel = `${header.length} / ${maxLen} caracteres`;
|
|
38
|
+
return [
|
|
39
|
+
{ status: type ? 'ok' : 'warn', label: 'Tipo válido', value: type || '(no detectado)' },
|
|
40
|
+
{ status: scope ? 'ok' : 'warn', label: 'Scope detectado', value: scope || 'ninguno' },
|
|
41
|
+
{ status: lenStatus, label: 'Header', value: lenLabel },
|
|
42
|
+
...validation.errors.map((e) => ({ status: 'error', label: 'Error', value: e })),
|
|
43
|
+
...validation.warnings.map((w) => ({ status: 'warn', label: 'Aviso', value: w })),
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
export function CommitProposalView({ proposal, stagedCount, linesAdded, linesRemoved, branchType, onAction, }) {
|
|
47
|
+
const isActive = useActivation();
|
|
48
|
+
const [mode, setMode] = useState('menu');
|
|
49
|
+
// Resets to false on every mode change to prevent ghost key events bleeding
|
|
50
|
+
// from one step's Enter into the next step's input.
|
|
51
|
+
const [stepActive, setStepActive] = useState(false);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (mode === 'menu')
|
|
54
|
+
return;
|
|
55
|
+
setStepActive(false);
|
|
56
|
+
const t = setTimeout(() => setStepActive(true), 150);
|
|
57
|
+
return () => clearTimeout(t);
|
|
58
|
+
}, [mode]);
|
|
59
|
+
const header = proposal.message.split('\n')[0] ?? '';
|
|
60
|
+
const { type: parsedType, scope: parsedScope, desc: parsedDesc } = parseCommitHeader(header);
|
|
61
|
+
// Infer type from branch prefix, falling back to what the AI generated
|
|
62
|
+
const inferredType = branchType && VALID_TYPES.has(branchType) ? branchType : parsedType || 'feat';
|
|
63
|
+
const [guidedType, setGuidedType] = useState(inferredType);
|
|
64
|
+
const [guidedScope, setGuidedScope] = useState(parsedScope);
|
|
65
|
+
const [guidedDesc, _setGuidedDesc] = useState(parsedDesc);
|
|
66
|
+
const [regenHint, setRegenHint] = useState('');
|
|
67
|
+
const width = Math.min(process.stdout.columns ?? 80, 78);
|
|
68
|
+
const typeColor = commitTypeColor(parsedType);
|
|
69
|
+
const validations = buildValidations(proposal.message, proposal.validation, 100);
|
|
70
|
+
// Put the current/inferred type first so pressing Enter immediately accepts it
|
|
71
|
+
const typeOptions = [
|
|
72
|
+
{ value: guidedType, label: `${guidedType.padEnd(10)} ← actual` },
|
|
73
|
+
...COMMIT_TYPES.filter((t) => t.value !== guidedType),
|
|
74
|
+
];
|
|
75
|
+
const menuOptions = [
|
|
76
|
+
{ label: 'Aceptar y commitear', value: 'accept' },
|
|
77
|
+
{ label: 'Editar mensaje', value: 'edit' },
|
|
78
|
+
{ label: 'Regenerar con otra instrucción', value: 'regenerate' },
|
|
79
|
+
{ label: 'Ver contexto enviado a la IA', value: 'context' },
|
|
80
|
+
{ label: 'Cancelar', value: 'cancel' },
|
|
81
|
+
];
|
|
82
|
+
if (mode === 'guided-type') {
|
|
83
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, paddingX: 1, children: [_jsx(Text, { bold: true, color: theme.accent, children: "Tipo de commit" }), _jsx(Text, { color: theme.muted, children: '─'.repeat(40) }), _jsx(Text, { children: " " }), _jsx(Select, { isDisabled: !stepActive, options: typeOptions, onChange: (val) => {
|
|
84
|
+
setGuidedType(val);
|
|
85
|
+
setMode('guided-scope');
|
|
86
|
+
} }), _jsx(Text, { color: theme.muted, children: " \u2191\u2193 navegar Enter seleccionar" })] }));
|
|
87
|
+
}
|
|
88
|
+
if (mode === 'guided-scope') {
|
|
89
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, paddingX: 1, children: [_jsxs(Text, { bold: true, color: theme.accent, children: ["Scope ", _jsx(Text, { color: theme.muted, children: "(opcional \u2014 Enter para omitir)" })] }), _jsx(Text, { color: theme.muted, children: '─'.repeat(40) }), _jsx(TextInput, { isDisabled: !stepActive, defaultValue: guidedScope, placeholder: "auth, api, ui...", onSubmit: (val) => {
|
|
90
|
+
setGuidedScope(val);
|
|
91
|
+
setMode('guided-desc');
|
|
92
|
+
} })] }));
|
|
93
|
+
}
|
|
94
|
+
if (mode === 'guided-desc') {
|
|
95
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, paddingX: 1, children: [_jsxs(Text, { bold: true, color: theme.accent, children: ["Descripci\u00F3n ", _jsx(Text, { color: theme.muted, children: "(imperativo, tiempo presente)" })] }), _jsx(Text, { color: theme.muted, children: '─'.repeat(40) }), _jsx(TextInput, { isDisabled: !stepActive, defaultValue: guidedDesc, placeholder: "add user authentication", onSubmit: (val) => {
|
|
96
|
+
const desc = val.trim();
|
|
97
|
+
if (!desc)
|
|
98
|
+
return;
|
|
99
|
+
const newMsg = `${guidedType}${guidedScope.trim() ? `(${guidedScope.trim()})` : ''}: ${desc}`;
|
|
100
|
+
setMode('menu');
|
|
101
|
+
onAction('edit', newMsg);
|
|
102
|
+
} }), _jsx(Text, { color: theme.muted, children: " Enter para confirmar" })] }));
|
|
103
|
+
}
|
|
104
|
+
if (mode === 'regen') {
|
|
105
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, paddingX: 1, children: [_jsx(Text, { bold: true, color: theme.accent, children: "Instrucci\u00F3n adicional para la IA" }), _jsx(Text, { color: theme.muted, children: '─'.repeat(40) }), _jsx(TextInput, { isDisabled: !stepActive, defaultValue: regenHint, placeholder: "ej: hazlo m\u00E1s corto, a\u00F1ade m\u00E1s contexto...", onSubmit: (val) => {
|
|
106
|
+
setRegenHint(val);
|
|
107
|
+
setMode('menu');
|
|
108
|
+
onAction('regenerate', val);
|
|
109
|
+
} }), _jsxs(Text, { color: theme.muted, children: [' ', "Enter para confirmar \u00B7 vac\u00EDo para regenerar sin instrucci\u00F3n"] })] }));
|
|
110
|
+
}
|
|
111
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, children: [_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, marginBottom: 1, children: [_jsx(Text, { color: theme.muted, children: "Mensaje propuesto" }), _jsx(Text, { children: " " }), _jsx(Text, { bold: true, color: typeColor, children: header }), proposal.message
|
|
112
|
+
.split('\n')
|
|
113
|
+
.slice(1)
|
|
114
|
+
.filter(Boolean)
|
|
115
|
+
.map((line, i) => (_jsxs(Text, { color: "#d1d5db", children: [' ', line] }, i))), _jsx(Text, { children: " " })] }), _jsx(Text, { bold: true, color: "#d1d5db", children: "Validaciones" }), _jsx(Text, { color: theme.muted, children: '─'.repeat(42) }), validations.map((v, i) => (_jsx(ValidationRow, { status: v.status, label: v.label, value: v.value }, i))), _jsx(Text, { children: " " }), _jsx(Text, { bold: true, color: "#d1d5db", children: "Contexto enviado a la IA" }), _jsx(Text, { color: theme.muted, children: '─'.repeat(42) }), _jsxs(Text, { color: theme.muted, children: ["\uD83D\uDCC1 ", stagedCount, " archivo(s)", linesAdded !== undefined && (_jsxs(Text, { children: [' ', "\u00B7 ", _jsxs(Text, { color: theme.success, children: ["+", linesAdded] })] })), linesRemoved !== undefined && (_jsxs(Text, { children: [' ', "/ ", _jsxs(Text, { color: theme.error, children: ["-", linesRemoved] })] })), ' ', "\u00B7 ", proposal.provider] }), _jsx(Text, { children: " " }), _jsx(Select, { isDisabled: !isActive, options: menuOptions, onChange: (val) => {
|
|
116
|
+
if (val === 'edit') {
|
|
117
|
+
setMode('guided-type');
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (val === 'regenerate') {
|
|
121
|
+
setMode('regen');
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
onAction(val);
|
|
125
|
+
} })] }));
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=CommitProposal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommitProposal.js","sourceRoot":"","sources":["../../../src/ux/components/CommitProposal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,YAAY,GAAG;IACnB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,iCAAiC,EAAE;IAC3D,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,+BAA+B,EAAE;IACxD,EAAE,KAAK,EAAE,MAAM,EA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AAC,IAAI,eACF,GAAG,QACF,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,kBAAI,YAAY,IAAQ,IAC7C,CACR,EAAE,GAAG,aACH,QAAQ,CAAC,QAAQ,IACf,EACP,KAAC,IAAI,oBAAS,EAEd,KAAC,MAAM,IACL,UAAU,EAAE,CAAC,QAAQ,EACrB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE;oBAChB,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;wBACnB,OAAO,CAAC,aAAa,CAAC,CAAC;wBACvB,OAAO;oBACT,CAAC;oBACD,IAAI,GAAG,KAAK,YAAY,EAAE,CAAC;wBACzB,OAAO,CAAC,OAAO,CAAC,CAAC;wBACjB,OAAO;oBACT,CAAC;oBACD,QAAQ,CAAC,GAAmB,CAAC,CAAC;gBAChC,CAAC,GACD,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface DiagItem {
|
|
2
|
+
status: 'ok' | 'warn' | 'error' | 'info' | 'muted';
|
|
3
|
+
label: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
active?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface DiagSection {
|
|
8
|
+
title: string;
|
|
9
|
+
items: DiagItem[];
|
|
10
|
+
}
|
|
11
|
+
interface Props {
|
|
12
|
+
title: string;
|
|
13
|
+
sections: DiagSection[];
|
|
14
|
+
allOk?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function DiagnosticReport({ title, sections, allOk }: Props): JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=DiagnosticReport.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { theme } from '../theme.js';
|
|
4
|
+
function StatusIcon({ status }) {
|
|
5
|
+
const map = {
|
|
6
|
+
ok: _jsx(Text, { color: theme.success, children: "\u2705" }),
|
|
7
|
+
warn: _jsx(Text, { color: theme.warning, children: "\u26A0\uFE0F " }),
|
|
8
|
+
error: _jsx(Text, { color: theme.error, children: "\u274C" }),
|
|
9
|
+
info: _jsx(Text, { color: theme.info, children: "\u2139 " }),
|
|
10
|
+
muted: _jsx(Text, { color: theme.muted, children: "\u2500\u2500" }),
|
|
11
|
+
};
|
|
12
|
+
return map[status];
|
|
13
|
+
}
|
|
14
|
+
export function DiagnosticReport({ title, sections, allOk }) {
|
|
15
|
+
const width = Math.min(process.stdout.columns ?? 80, 78);
|
|
16
|
+
const divider = '─'.repeat(Math.min(width - 2, 46));
|
|
17
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, children: [_jsx(Text, { bold: true, color: "white", children: title }), _jsx(Text, { color: theme.muted, children: '━'.repeat(Math.min(title.length + 4, width - 2)) }), _jsx(Text, { children: " " }), sections.map((sec) => (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, color: "#d1d5db", children: sec.title }), _jsx(Text, { color: theme.muted, children: divider }), sec.items.map((item, i) => (_jsxs(Box, { gap: 1, children: [_jsx(StatusIcon, { status: item.status }), _jsx(Text, { color: "white", children: item.label }), item.value && (_jsxs(Text, { color: item.active ? theme.success : theme.muted, children: [item.value, item.active ? ' ← activo' : ''] }))] }, i)))] }, sec.title))), allOk !== undefined && (_jsx(Box, { marginTop: 1, children: allOk ? (_jsx(Text, { bold: true, color: theme.success, children: "\u2714 Todo en orden" })) : (_jsx(Text, { bold: true, color: theme.warning, children: "\u26A0 Revisa los elementos marcados" })) }))] }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=DiagnosticReport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiagnosticReport.js","sourceRoot":"","sources":["../../../src/ux/components/DiagnosticReport.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,E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@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { theme } from '../theme.js';
|
|
4
|
+
export function ErrorBox({ title = 'Error', messages }) {
|
|
5
|
+
const lines = Array.isArray(messages) ? messages : [messages];
|
|
6
|
+
const width = Math.min(process.stdout.columns ?? 80, 78);
|
|
7
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "double", borderColor: theme.error, paddingX: 1, width: width, children: [_jsxs(Text, { bold: true, color: theme.error, children: ["\u2716 ", title] }), _jsx(Text, { children: " " }), lines.map((line, i) => (_jsxs(Text, { color: "white", children: [' ', line] }, i)))] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=ErrorBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBox.js","sourceRoot":"","sources":["../../../src/ux/components/ErrorBox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAOpC,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,EAAE,QAAQ,EAAS;IAC3D,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC9D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAEzD,OAAO,CACL,MAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAC,QAAQ,EACpB,WAAW,EAAE,KAAK,CAAC,KAAK,EACxB,QAAQ,EAAE,CAAC,EACX,KAAK,EAAE,KAAK,aAEZ,MAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,KAAK,CAAC,KAAK,wBACxB,KAAK,IACH,EACP,KAAC,IAAI,oBAAS,EACb,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,MAAC,IAAI,IAAS,KAAK,EAAC,OAAO,aACxB,GAAG,EACH,IAAI,KAFI,CAAC,CAGL,CACR,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StagedFile } from '../../types/index.js';
|
|
2
|
+
interface FileEntry {
|
|
3
|
+
path: string;
|
|
4
|
+
status: StagedFile['status'] | 'untracked' | 'unstaged';
|
|
5
|
+
blocked?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
files: FileEntry[];
|
|
9
|
+
blockedFiles?: string[];
|
|
10
|
+
onSelect: (paths: string[]) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function FileSelector({ files, blockedFiles, onSelect }: Props): JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=FileSelector.d.ts.map
|