@vibe-validate/git 0.17.6-rc.2 → 0.18.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gh-commands.d.ts +123 -0
- package/dist/gh-commands.d.ts.map +1 -0
- package/dist/gh-commands.js +152 -0
- package/dist/gh-commands.js.map +1 -0
- package/dist/git-commands.d.ts +27 -0
- package/dist/git-commands.d.ts.map +1 -1
- package/dist/git-commands.js +35 -0
- package/dist/git-commands.js.map +1 -1
- package/dist/git-executor.js +4 -4
- package/dist/git-executor.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub CLI Command Wrappers
|
|
3
|
+
*
|
|
4
|
+
* Centralized GitHub CLI (`gh`) command execution.
|
|
5
|
+
* All gh commands MUST go through these functions for:
|
|
6
|
+
* - Centralized execution logic
|
|
7
|
+
* - Easy mocking in tests
|
|
8
|
+
* - Architectural consistency
|
|
9
|
+
*
|
|
10
|
+
* **NEVER call safeExecSync('gh', ...) directly from other packages.**
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* GitHub Pull Request
|
|
16
|
+
*/
|
|
17
|
+
export interface GitHubPullRequest {
|
|
18
|
+
number: number;
|
|
19
|
+
title: string;
|
|
20
|
+
url: string;
|
|
21
|
+
headRefName: string;
|
|
22
|
+
baseRefName: string;
|
|
23
|
+
author: {
|
|
24
|
+
login: string;
|
|
25
|
+
};
|
|
26
|
+
isDraft?: boolean;
|
|
27
|
+
mergeable?: string;
|
|
28
|
+
mergeStateStatus?: string;
|
|
29
|
+
labels?: Array<{
|
|
30
|
+
name: string;
|
|
31
|
+
}>;
|
|
32
|
+
closingIssuesReferences?: Array<{
|
|
33
|
+
number: number;
|
|
34
|
+
title: string;
|
|
35
|
+
url: string;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* GitHub Workflow Run
|
|
40
|
+
*/
|
|
41
|
+
export interface GitHubRun {
|
|
42
|
+
databaseId: number;
|
|
43
|
+
name: string;
|
|
44
|
+
status: string;
|
|
45
|
+
conclusion: string | null;
|
|
46
|
+
workflowName: string;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
url: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Fetch PR details from GitHub
|
|
53
|
+
*
|
|
54
|
+
* @param prNumber - PR number
|
|
55
|
+
* @param owner - Repository owner (optional)
|
|
56
|
+
* @param repo - Repository name (optional)
|
|
57
|
+
* @param fields - Fields to fetch (optional, defaults to common fields)
|
|
58
|
+
* @returns PR data
|
|
59
|
+
*/
|
|
60
|
+
export declare function fetchPRDetails(prNumber: number, owner?: string, repo?: string, fields?: string[]): GitHubPullRequest;
|
|
61
|
+
/**
|
|
62
|
+
* Fetch PR checks (statusCheckRollup)
|
|
63
|
+
*
|
|
64
|
+
* @param prNumber - PR number
|
|
65
|
+
* @param owner - Repository owner (optional)
|
|
66
|
+
* @param repo - Repository name (optional)
|
|
67
|
+
* @returns PR checks data
|
|
68
|
+
*/
|
|
69
|
+
export declare function fetchPRChecks(prNumber: number, owner?: string, repo?: string): {
|
|
70
|
+
statusCheckRollup: Array<Record<string, unknown>>;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Get current PR for the current branch
|
|
74
|
+
*
|
|
75
|
+
* Uses `gh pr view` without specifying a PR number,
|
|
76
|
+
* which auto-detects based on current branch/HEAD.
|
|
77
|
+
*
|
|
78
|
+
* @param owner - Repository owner (optional)
|
|
79
|
+
* @param repo - Repository name (optional)
|
|
80
|
+
* @returns PR number, or null if no PR found
|
|
81
|
+
*/
|
|
82
|
+
export declare function getCurrentPR(owner?: string, repo?: string): number | null;
|
|
83
|
+
/**
|
|
84
|
+
* List open pull requests
|
|
85
|
+
*
|
|
86
|
+
* @param owner - Repository owner
|
|
87
|
+
* @param repo - Repository name
|
|
88
|
+
* @param limit - Max number of PRs to return (default: 5)
|
|
89
|
+
* @param fields - Fields to fetch (optional)
|
|
90
|
+
* @returns List of PRs
|
|
91
|
+
*/
|
|
92
|
+
export declare function listPullRequests(owner: string, repo: string, limit?: number, fields?: string[]): GitHubPullRequest[];
|
|
93
|
+
/**
|
|
94
|
+
* Fetch workflow run logs
|
|
95
|
+
*
|
|
96
|
+
* @param runId - GitHub run ID
|
|
97
|
+
* @param owner - Repository owner (optional)
|
|
98
|
+
* @param repo - Repository name (optional)
|
|
99
|
+
* @returns Raw log output
|
|
100
|
+
*/
|
|
101
|
+
export declare function fetchRunLogs(runId: number, owner?: string, repo?: string): string;
|
|
102
|
+
/**
|
|
103
|
+
* Fetch workflow run details
|
|
104
|
+
*
|
|
105
|
+
* @param runId - GitHub run ID
|
|
106
|
+
* @param owner - Repository owner (optional)
|
|
107
|
+
* @param repo - Repository name (optional)
|
|
108
|
+
* @param fields - Fields to fetch (optional)
|
|
109
|
+
* @returns Run details
|
|
110
|
+
*/
|
|
111
|
+
export declare function fetchRunDetails(runId: number, owner?: string, repo?: string, fields?: string[]): GitHubRun;
|
|
112
|
+
/**
|
|
113
|
+
* List workflow runs for a branch
|
|
114
|
+
*
|
|
115
|
+
* @param branch - Branch name
|
|
116
|
+
* @param owner - Repository owner (optional)
|
|
117
|
+
* @param repo - Repository name (optional)
|
|
118
|
+
* @param limit - Max number of runs to return (default: 20)
|
|
119
|
+
* @param fields - Fields to fetch (optional)
|
|
120
|
+
* @returns List of runs
|
|
121
|
+
*/
|
|
122
|
+
export declare function listWorkflowRuns(branch: string, owner?: string, repo?: string, limit?: number, fields?: string[]): GitHubRun[];
|
|
123
|
+
//# sourceMappingURL=gh-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gh-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,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG;IAC9E,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACnD,CAYA;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuBzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,SAAI,EACT,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,iBAAiB,EAAE,CAYrB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAQjF;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,SAAS,CAaX;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,SAAK,EACV,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,SAAS,EAAE,CAab"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub CLI Command Wrappers
|
|
3
|
+
*
|
|
4
|
+
* Centralized GitHub CLI (`gh`) command execution.
|
|
5
|
+
* All gh commands MUST go through these functions for:
|
|
6
|
+
* - Centralized execution logic
|
|
7
|
+
* - Easy mocking in tests
|
|
8
|
+
* - Architectural consistency
|
|
9
|
+
*
|
|
10
|
+
* **NEVER call safeExecSync('gh', ...) directly from other packages.**
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
import { safeExecSync } from '@vibe-validate/utils';
|
|
15
|
+
/**
|
|
16
|
+
* Fetch PR details from GitHub
|
|
17
|
+
*
|
|
18
|
+
* @param prNumber - PR number
|
|
19
|
+
* @param owner - Repository owner (optional)
|
|
20
|
+
* @param repo - Repository name (optional)
|
|
21
|
+
* @param fields - Fields to fetch (optional, defaults to common fields)
|
|
22
|
+
* @returns PR data
|
|
23
|
+
*/
|
|
24
|
+
export function fetchPRDetails(prNumber, owner, repo, fields) {
|
|
25
|
+
const repoFlag = owner && repo ? ['--repo', `${owner}/${repo}`] : [];
|
|
26
|
+
const fieldList = fields ?? [
|
|
27
|
+
'number',
|
|
28
|
+
'title',
|
|
29
|
+
'url',
|
|
30
|
+
'headRefName',
|
|
31
|
+
'baseRefName',
|
|
32
|
+
'author',
|
|
33
|
+
'isDraft',
|
|
34
|
+
'mergeable',
|
|
35
|
+
'mergeStateStatus',
|
|
36
|
+
'labels',
|
|
37
|
+
'closingIssuesReferences',
|
|
38
|
+
];
|
|
39
|
+
const response = safeExecSync('gh', ['pr', 'view', String(prNumber), ...repoFlag, '--json', fieldList.join(',')], {
|
|
40
|
+
encoding: 'utf8',
|
|
41
|
+
});
|
|
42
|
+
return JSON.parse(response);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Fetch PR checks (statusCheckRollup)
|
|
46
|
+
*
|
|
47
|
+
* @param prNumber - PR number
|
|
48
|
+
* @param owner - Repository owner (optional)
|
|
49
|
+
* @param repo - Repository name (optional)
|
|
50
|
+
* @returns PR checks data
|
|
51
|
+
*/
|
|
52
|
+
export function fetchPRChecks(prNumber, owner, repo) {
|
|
53
|
+
const repoFlag = owner && repo ? ['--repo', `${owner}/${repo}`] : [];
|
|
54
|
+
const response = safeExecSync('gh', ['pr', 'view', String(prNumber), ...repoFlag, '--json', 'statusCheckRollup'], {
|
|
55
|
+
encoding: 'utf8',
|
|
56
|
+
});
|
|
57
|
+
return JSON.parse(response);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get current PR for the current branch
|
|
61
|
+
*
|
|
62
|
+
* Uses `gh pr view` without specifying a PR number,
|
|
63
|
+
* which auto-detects based on current branch/HEAD.
|
|
64
|
+
*
|
|
65
|
+
* @param owner - Repository owner (optional)
|
|
66
|
+
* @param repo - Repository name (optional)
|
|
67
|
+
* @returns PR number, or null if no PR found
|
|
68
|
+
*/
|
|
69
|
+
export function getCurrentPR(owner, repo) {
|
|
70
|
+
const repoFlag = owner && repo ? ['--repo', `${owner}/${repo}`] : [];
|
|
71
|
+
try {
|
|
72
|
+
const response = safeExecSync('gh', ['pr', 'view', ...repoFlag, '--json', 'number'], {
|
|
73
|
+
encoding: 'utf8',
|
|
74
|
+
});
|
|
75
|
+
const prData = JSON.parse(response);
|
|
76
|
+
if (prData.number && typeof prData.number === 'number') {
|
|
77
|
+
return prData.number;
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// No PR found for current branch
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* List open pull requests
|
|
88
|
+
*
|
|
89
|
+
* @param owner - Repository owner
|
|
90
|
+
* @param repo - Repository name
|
|
91
|
+
* @param limit - Max number of PRs to return (default: 5)
|
|
92
|
+
* @param fields - Fields to fetch (optional)
|
|
93
|
+
* @returns List of PRs
|
|
94
|
+
*/
|
|
95
|
+
export function listPullRequests(owner, repo, limit = 5, fields) {
|
|
96
|
+
const fieldList = fields ?? ['number', 'title', 'author', 'headRefName'];
|
|
97
|
+
const response = safeExecSync('gh', ['pr', 'list', '--repo', `${owner}/${repo}`, '--limit', String(limit), '--json', fieldList.join(',')], {
|
|
98
|
+
encoding: 'utf8',
|
|
99
|
+
});
|
|
100
|
+
return JSON.parse(response);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Fetch workflow run logs
|
|
104
|
+
*
|
|
105
|
+
* @param runId - GitHub run ID
|
|
106
|
+
* @param owner - Repository owner (optional)
|
|
107
|
+
* @param repo - Repository name (optional)
|
|
108
|
+
* @returns Raw log output
|
|
109
|
+
*/
|
|
110
|
+
export function fetchRunLogs(runId, owner, repo) {
|
|
111
|
+
const repoFlag = owner && repo ? ['--repo', `${owner}/${repo}`] : [];
|
|
112
|
+
const logs = safeExecSync('gh', ['run', 'view', String(runId), ...repoFlag, '--log'], {
|
|
113
|
+
encoding: 'utf8',
|
|
114
|
+
});
|
|
115
|
+
return typeof logs === 'string' ? logs : logs.toString('utf8');
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Fetch workflow run details
|
|
119
|
+
*
|
|
120
|
+
* @param runId - GitHub run ID
|
|
121
|
+
* @param owner - Repository owner (optional)
|
|
122
|
+
* @param repo - Repository name (optional)
|
|
123
|
+
* @param fields - Fields to fetch (optional)
|
|
124
|
+
* @returns Run details
|
|
125
|
+
*/
|
|
126
|
+
export function fetchRunDetails(runId, owner, repo, fields) {
|
|
127
|
+
const repoFlag = owner && repo ? ['--repo', `${owner}/${repo}`] : [];
|
|
128
|
+
const fieldList = fields ?? ['databaseId', 'name', 'status', 'conclusion', 'workflowName', 'createdAt', 'updatedAt', 'url'];
|
|
129
|
+
const response = safeExecSync('gh', ['run', 'view', String(runId), ...repoFlag, '--json', fieldList.join(',')], {
|
|
130
|
+
encoding: 'utf8',
|
|
131
|
+
});
|
|
132
|
+
return JSON.parse(response);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* List workflow runs for a branch
|
|
136
|
+
*
|
|
137
|
+
* @param branch - Branch name
|
|
138
|
+
* @param owner - Repository owner (optional)
|
|
139
|
+
* @param repo - Repository name (optional)
|
|
140
|
+
* @param limit - Max number of runs to return (default: 20)
|
|
141
|
+
* @param fields - Fields to fetch (optional)
|
|
142
|
+
* @returns List of runs
|
|
143
|
+
*/
|
|
144
|
+
export function listWorkflowRuns(branch, owner, repo, limit = 20, fields) {
|
|
145
|
+
const repoFlag = owner && repo ? ['--repo', `${owner}/${repo}`] : [];
|
|
146
|
+
const fieldList = fields ?? ['databaseId', 'name', 'status', 'conclusion', 'workflowName', 'createdAt'];
|
|
147
|
+
const response = safeExecSync('gh', ['run', 'list', ...repoFlag, '--branch', branch, '--limit', String(limit), '--json', fieldList.join(',')], {
|
|
148
|
+
encoding: 'utf8',
|
|
149
|
+
});
|
|
150
|
+
return JSON.parse(response);
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=gh-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gh-commands.js","sourceRoot":"","sources":["../src/gh-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAqCpD;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,QAAgB,EAChB,KAAc,EACd,IAAa,EACb,MAAiB;IAEjB,MAAM,QAAQ,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrE,MAAM,SAAS,GAAG,MAAM,IAAI;QAC1B,QAAQ;QACR,OAAO;QACP,KAAK;QACL,aAAa;QACb,aAAa;QACb,QAAQ;QACR,SAAS;QACT,WAAW;QACX,kBAAkB;QAClB,QAAQ;QACR,yBAAyB;KAC1B,CAAC;IAEF,MAAM,QAAQ,GAAG,YAAY,CAC3B,IAAI,EACJ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAC5E;QACE,QAAQ,EAAE,MAAM;KACjB,CACF,CAAC;IAEF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ACjB,CACF,CAAC;IAEF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAkB,CAAC,CAAC;AACxC,CAAC"}
|
package/dist/git-commands.d.ts
CHANGED
|
@@ -27,6 +27,13 @@ export declare function getRepositoryRoot(): string;
|
|
|
27
27
|
* @throws Error if not on a branch (detached HEAD)
|
|
28
28
|
*/
|
|
29
29
|
export declare function getCurrentBranch(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Get the URL of a git remote
|
|
32
|
+
* @param remote - The name of the remote (default: 'origin')
|
|
33
|
+
* @returns The URL of the specified remote
|
|
34
|
+
* @throws Error if remote doesn't exist
|
|
35
|
+
*/
|
|
36
|
+
export declare function getRemoteUrl(remote?: string): string;
|
|
30
37
|
/**
|
|
31
38
|
* Get the commit SHA of HEAD
|
|
32
39
|
* @returns The full SHA of the current commit
|
|
@@ -63,4 +70,24 @@ export declare function hasNotesRef(notesRef: string): boolean;
|
|
|
63
70
|
* @returns true if MERGE_HEAD exists (merge in progress), false otherwise
|
|
64
71
|
*/
|
|
65
72
|
export declare function isMergeInProgress(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Get diff statistics between two refs
|
|
75
|
+
* @param baseRef - Base reference (e.g., 'origin/main')
|
|
76
|
+
* @param headRef - Head reference (default: 'HEAD')
|
|
77
|
+
* @returns Diff output from git diff --numstat
|
|
78
|
+
*/
|
|
79
|
+
export declare function getDiffStats(baseRef: string, headRef?: string): string;
|
|
80
|
+
/**
|
|
81
|
+
* Get commit count between two refs
|
|
82
|
+
* @param baseRef - Base reference (e.g., 'origin/main')
|
|
83
|
+
* @param headRef - Head reference (default: 'HEAD')
|
|
84
|
+
* @returns Number of commits as string
|
|
85
|
+
*/
|
|
86
|
+
export declare function getCommitCount(baseRef: string, headRef?: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* List notes references matching a pattern
|
|
89
|
+
* @param pattern - Pattern to match (e.g., 'refs/notes/vibe-validate/run/*')
|
|
90
|
+
* @returns Output from git for-each-ref
|
|
91
|
+
*/
|
|
92
|
+
export declare function getNotesRefs(pattern: string): string;
|
|
66
93
|
//# sourceMappingURL=git-commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-commands.d.ts","sourceRoot":"","sources":["../src/git-commands.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C"}
|
|
1
|
+
{"version":3,"file":"git-commands.d.ts","sourceRoot":"","sources":["../src/git-commands.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,SAAW,GAAG,MAAM,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,SAAS,GAAG,MAAM,CAEtE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,SAAS,GAAG,MAAM,CAExE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
package/dist/git-commands.js
CHANGED
|
@@ -36,6 +36,15 @@ export function getRepositoryRoot() {
|
|
|
36
36
|
export function getCurrentBranch() {
|
|
37
37
|
return execGitCommand(['rev-parse', '--abbrev-ref', 'HEAD']);
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Get the URL of a git remote
|
|
41
|
+
* @param remote - The name of the remote (default: 'origin')
|
|
42
|
+
* @returns The URL of the specified remote
|
|
43
|
+
* @throws Error if remote doesn't exist
|
|
44
|
+
*/
|
|
45
|
+
export function getRemoteUrl(remote = 'origin') {
|
|
46
|
+
return execGitCommand(['remote', 'get-url', remote]);
|
|
47
|
+
}
|
|
39
48
|
/**
|
|
40
49
|
* Get the commit SHA of HEAD
|
|
41
50
|
* @returns The full SHA of the current commit
|
|
@@ -84,4 +93,30 @@ export function hasNotesRef(notesRef) {
|
|
|
84
93
|
export function isMergeInProgress() {
|
|
85
94
|
return tryGitCommand(['rev-parse', '--verify', '--quiet', 'MERGE_HEAD']);
|
|
86
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Get diff statistics between two refs
|
|
98
|
+
* @param baseRef - Base reference (e.g., 'origin/main')
|
|
99
|
+
* @param headRef - Head reference (default: 'HEAD')
|
|
100
|
+
* @returns Diff output from git diff --numstat
|
|
101
|
+
*/
|
|
102
|
+
export function getDiffStats(baseRef, headRef = 'HEAD') {
|
|
103
|
+
return execGitCommand(['diff', '--numstat', `${baseRef}...${headRef}`]);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get commit count between two refs
|
|
107
|
+
* @param baseRef - Base reference (e.g., 'origin/main')
|
|
108
|
+
* @param headRef - Head reference (default: 'HEAD')
|
|
109
|
+
* @returns Number of commits as string
|
|
110
|
+
*/
|
|
111
|
+
export function getCommitCount(baseRef, headRef = 'HEAD') {
|
|
112
|
+
return execGitCommand(['rev-list', '--count', `${baseRef}...${headRef}`]);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* List notes references matching a pattern
|
|
116
|
+
* @param pattern - Pattern to match (e.g., 'refs/notes/vibe-validate/run/*')
|
|
117
|
+
* @returns Output from git for-each-ref
|
|
118
|
+
*/
|
|
119
|
+
export function getNotesRefs(pattern) {
|
|
120
|
+
return execGitCommand(['for-each-ref', pattern]);
|
|
121
|
+
}
|
|
87
122
|
//# sourceMappingURL=git-commands.js.map
|
package/dist/git-commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-commands.js","sourceRoot":"","sources":["../src/git-commands.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElE;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,aAAa,CAAC,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS;IACvB,O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;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,aAAa,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,aAAa,CAAC,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,OAAO,GAAG,MAAM;IAC5D,OAAO,cAAc,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,OAAO,GAAG,MAAM;IAC9D,OAAO,cAAc,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,cAAc,CAAC,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;AACnD,CAAC"}
|
package/dist/git-executor.js
CHANGED
|
@@ -55,12 +55,12 @@ export function executeGitCommand(args, options = {}) {
|
|
|
55
55
|
env: env ? { ...process.env, ...env } : process.env,
|
|
56
56
|
};
|
|
57
57
|
// Configure stdio
|
|
58
|
-
if (stdin
|
|
59
|
-
spawnOptions.
|
|
60
|
-
spawnOptions.stdio = ['pipe', 'pipe', suppressStderr ? 'ignore' : 'pipe'];
|
|
58
|
+
if (stdin === undefined) {
|
|
59
|
+
spawnOptions.stdio = ['ignore', 'pipe', suppressStderr ? 'ignore' : 'pipe'];
|
|
61
60
|
}
|
|
62
61
|
else {
|
|
63
|
-
spawnOptions.
|
|
62
|
+
spawnOptions.input = stdin;
|
|
63
|
+
spawnOptions.stdio = ['pipe', 'pipe', suppressStderr ? 'ignore' : 'pipe'];
|
|
64
64
|
}
|
|
65
65
|
// Execute command
|
|
66
66
|
const result = spawnSync('git', args, spawnOptions);
|
package/dist/git-executor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-executor.js","sourceRoot":"","sources":["../src/git-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAyB,MAAM,oBAAoB,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,aAAa;AAiExC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAc,EACd,UAA+B,EAAE;IAEjC,MAAM,EACJ,OAAO,GAAG,WAAW,EACrB,QAAQ,GAAG,MAAM,EACjB,KAAK,EACL,YAAY,GAAG,KAAK,EACpB,cAAc,GAAG,KAAK,EACtB,GAAG,GACJ,GAAG,OAAO,CAAC;IAEZ,qBAAqB;IACrB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IAED,sBAAsB;IACtB,MAAM,YAAY,GAAqB;QACrC,QAAQ;QACR,OAAO;QACP,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,cAAc;QAC3C,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG;KACpD,CAAC;IAEF,kBAAkB;IAClB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,YAAY,CAAC,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"git-executor.js","sourceRoot":"","sources":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AAc,CAAC,QAAQ,CAAC,CAAC;IAEzB,8DAA8D;IAC9D,6EAA6E;IAC7E,mDAAmD;IACnD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzF,MAAM,IAAI,KAAK,CAAC,2CAA2C,QAAQ,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IAED,8BAA8B;IAC9B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb,2EAA2E,QAAQ,KAAK;YACxF,uEAAuE;YACvE,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IAED,sEAAsE;IACtE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CACb,gEAAgE,QAAQ,CAAC,MAAM,UAAU;YACzF,cAAc,QAAQ,GAAG,CAC1B,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,9 +12,10 @@ export { BranchSyncChecker, checkBranchSync, type SyncCheckResult, type SyncChec
|
|
|
12
12
|
export { PostPRMergeCleanup, cleanupMergedBranches, type CleanupResult, type CleanupOptions } from './post-merge-cleanup.js';
|
|
13
13
|
export { encodeRunCacheKey } from './cache-key.js';
|
|
14
14
|
export { extractYamlContent, extractYamlWithPreamble } from './yaml-detection.js';
|
|
15
|
-
export { isGitRepository, getGitDir, getRepositoryRoot, getCurrentBranch, getHeadCommitSha, getHeadTreeSha, verifyRef, verifyRefOrThrow, hasNotesRef, isMergeInProgress } from './git-commands.js';
|
|
15
|
+
export { isGitRepository, getGitDir, getRepositoryRoot, getCurrentBranch, getRemoteUrl, getHeadCommitSha, getHeadTreeSha, verifyRef, verifyRefOrThrow, hasNotesRef, isMergeInProgress, getDiffStats, getCommitCount, getNotesRefs } from './git-commands.js';
|
|
16
16
|
export { executeGitCommand, execGitCommand, tryGitCommand, validateGitRef, validateNotesRef, validateTreeHash, type GitExecutionOptions, type GitExecutionResult } from './git-executor.js';
|
|
17
17
|
export { addNote, readNote, removeNote, listNotes, hasNote, listNotesRefs, removeNotesRefs, getNotesRefSha } from './git-notes.js';
|
|
18
18
|
export { getPartiallyStagedFiles } from './staging.js';
|
|
19
19
|
export { isCurrentBranchBehindTracking } from './tracking-branch.js';
|
|
20
|
+
export { fetchPRDetails, fetchPRChecks, getCurrentPR, listPullRequests, fetchRunLogs, fetchRunDetails, listWorkflowRuns, type GitHubPullRequest, type GitHubRun } from './gh-commands.js';
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGhE,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGhE,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,YAAY,EACb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,OAAO,EACP,QAAQ,EACR,UAAU,EACV,SAAS,EACT,OAAO,EACP,aAAa,EACb,eAAe,EACf,cAAc,EACf,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,uBAAuB,EACxB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,6BAA6B,EAC9B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,cAAc,EACd,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ export { encodeRunCacheKey } from './cache-key.js';
|
|
|
17
17
|
// YAML output detection
|
|
18
18
|
export { extractYamlContent, extractYamlWithPreamble } from './yaml-detection.js';
|
|
19
19
|
// Git command utilities (standardized rev-parse operations)
|
|
20
|
-
export { isGitRepository, getGitDir, getRepositoryRoot, getCurrentBranch, getHeadCommitSha, getHeadTreeSha, verifyRef, verifyRefOrThrow, hasNotesRef, isMergeInProgress } from './git-commands.js';
|
|
20
|
+
export { isGitRepository, getGitDir, getRepositoryRoot, getCurrentBranch, getRemoteUrl, getHeadCommitSha, getHeadTreeSha, verifyRef, verifyRefOrThrow, hasNotesRef, isMergeInProgress, getDiffStats, getCommitCount, getNotesRefs } from './git-commands.js';
|
|
21
21
|
// Secure git command execution (low-level - use high-level APIs when possible)
|
|
22
22
|
export { executeGitCommand, execGitCommand, tryGitCommand, validateGitRef, validateNotesRef, validateTreeHash } from './git-executor.js';
|
|
23
23
|
// Git notes operations (high-level abstraction)
|
|
@@ -26,4 +26,6 @@ export { addNote, readNote, removeNote, listNotes, hasNote, listNotesRefs, remov
|
|
|
26
26
|
export { getPartiallyStagedFiles } from './staging.js';
|
|
27
27
|
// Git tracking branch detection (check if current branch is behind remote)
|
|
28
28
|
export { isCurrentBranchBehindTracking } from './tracking-branch.js';
|
|
29
|
+
// GitHub CLI commands (centralized gh command execution)
|
|
30
|
+
export { fetchPRDetails, fetchPRChecks, getCurrentPR, listPullRequests, fetchRunLogs, fetchRunDetails, listWorkflowRuns } from './gh-commands.js';
|
|
29
31
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,uDAAuD;AACvD,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAExB,6CAA6C;AAC7C,OAAO,EACL,iBAAiB,EACjB,eAAe,EAGhB,MAAM,kBAAkB,CAAC;AAE1B,8CAA8C;AAC9C,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EAGtB,MAAM,yBAAyB,CAAC;AAEjC,qCAAqC;AACrC,OAAO,EACL,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAExB,wBAAwB;AACxB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,4DAA4D;AAC5D,OAAO,EACL,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,uDAAuD;AACvD,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAExB,6CAA6C;AAC7C,OAAO,EACL,iBAAiB,EACjB,eAAe,EAGhB,MAAM,kBAAkB,CAAC;AAE1B,8CAA8C;AAC9C,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EAGtB,MAAM,yBAAyB,CAAC;AAEjC,qCAAqC;AACrC,OAAO,EACL,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAExB,wBAAwB;AACxB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,4DAA4D;AAC5D,OAAO,EACL,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,+EAA+E;AAC/E,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAE3B,gDAAgD;AAChD,OAAO,EACL,OAAO,EACP,QAAQ,EACR,UAAU,EACV,SAAS,EACT,OAAO,EACP,aAAa,EACb,eAAe,EACf,cAAc,EACf,MAAM,gBAAgB,CAAC;AAExB,uEAAuE;AACvE,OAAO,EACL,uBAAuB,EACxB,MAAM,cAAc,CAAC;AAEtB,2EAA2E;AAC3E,OAAO,EACL,6BAA6B,EAC9B,MAAM,sBAAsB,CAAC;AAE9B,yDAAyD;AACzD,OAAO,EACL,cAAc,EACd,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,gBAAgB,EAGjB,MAAM,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibe-validate/git",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0-rc.1",
|
|
4
4
|
"description": "Git utilities for vibe-validate - tree hash calculation, branch sync, and post-merge cleanup",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@vibe-validate/utils": "0.
|
|
41
|
+
"@vibe-validate/utils": "0.18.0-rc.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^22.19.2",
|