sf-git-ai-meta-insights 2.5.0 → 2.6.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 +14 -0
- package/README.md +84 -68
- package/lib/commands/sgai/metadata/summarize.js +3 -139
- package/lib/commands/sgai/metadata/summarize.js.map +1 -1
- package/lib/metadata/summarizeCore.d.ts +20 -0
- package/lib/metadata/summarizeCore.js +49 -0
- package/lib/metadata/summarizeCore.js.map +1 -0
- package/lib/metadata/summarizeHelpers.d.ts +25 -0
- package/lib/metadata/summarizeHelpers.js +97 -0
- package/lib/metadata/summarizeHelpers.js.map +1 -0
- package/lib/salesforce/sfdxPackagePaths.js +3 -2
- package/lib/salesforce/sfdxPackagePaths.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +34 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.6.0](https://github.com/mcarvin8/sf-git-ai-meta-insights/compare/v2.5.1...v2.6.0) (2026-06-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **ai:** bump the ai-sdk group with 8 updates ([#35](https://github.com/mcarvin8/sf-git-ai-meta-insights/issues/35)) ([78689f3](https://github.com/mcarvin8/sf-git-ai-meta-insights/commit/78689f38a4d214f58b33c8b208e0bc014f8b932e))
|
|
9
|
+
|
|
10
|
+
## [2.5.1](https://github.com/mcarvin8/sf-git-ai-meta-insights/compare/v2.5.0...v2.5.1) (2026-05-26)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **deps:** pin direct dependencies to exact versions ([#29](https://github.com/mcarvin8/sf-git-ai-meta-insights/issues/29)) ([daac7f6](https://github.com/mcarvin8/sf-git-ai-meta-insights/commit/daac7f66f6d3440dc62c84e8649dc6198a267c26))
|
|
16
|
+
|
|
3
17
|
## [2.5.0](https://github.com/mcarvin8/sf-git-ai-meta-insights/compare/v2.4.0...v2.5.0) (2026-05-03)
|
|
4
18
|
|
|
5
19
|
|
package/README.md
CHANGED
|
@@ -4,77 +4,104 @@
|
|
|
4
4
|
[](https://npmjs.org/package/sf-git-ai-meta-insights)
|
|
5
5
|
[](https://raw.githubusercontent.com/salesforcecli/sf-git-ai-meta-insights/main/LICENSE.md)
|
|
6
6
|
[](https://codecov.io/gh/mcarvin8/sf-git-ai-meta-insights)
|
|
7
|
+
[](https://dashboard.stryker-mutator.io/reports/github.com/mcarvin8/sf-git-ai-meta-insights/main)
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Salesforce CLI plugin that generates AI-written Markdown summaries of metadata changes between two Git refs. Supports every LLM provider in the [Vercel AI SDK](https://sdk.vercel.ai): OpenAI, Anthropic, Google Gemini, Amazon Bedrock, Mistral, Cohere, Groq, xAI, DeepSeek, and any OpenAI-compatible gateway.
|
|
9
10
|
|
|
10
11
|

|
|
11
12
|
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
- Salesforce CLI (`sf`)
|
|
16
|
+
- Node.js 20+
|
|
17
|
+
- [Git Bash](https://git-scm.com/install/)
|
|
18
|
+
- A Salesforce DX project with `sfdx-project.json` at the repo root (unless you supply all paths via `--include-package-directory`)
|
|
19
|
+
- An LLM provider — see [Provider configuration](#provider-configuration)
|
|
20
|
+
|
|
12
21
|
## Installation
|
|
13
22
|
|
|
14
23
|
```bash
|
|
15
24
|
sf plugins install sf-git-ai-meta-insights@latest
|
|
16
25
|
```
|
|
17
26
|
|
|
27
|
+
No extra `npm install` needed. All supported provider SDKs ship with the plugin.
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
Set a provider credential, then run:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# OpenAI
|
|
35
|
+
export OPENAI_API_KEY="sk-..."
|
|
36
|
+
sf sgai metadata summarize --from HEAD~1
|
|
37
|
+
|
|
38
|
+
# Anthropic
|
|
39
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
40
|
+
sf sgai metadata summarize --from HEAD~1 --model claude-3-5-sonnet-latest
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Output defaults to `metadata-summary.md` in the current directory.
|
|
44
|
+
|
|
18
45
|
## Command
|
|
19
46
|
|
|
20
47
|
### `sf sgai metadata summarize`
|
|
21
48
|
|
|
22
|
-
|
|
49
|
+
Diffs Salesforce metadata between two Git refs, optionally filters commits by message, and writes an AI-generated Markdown summary.
|
|
23
50
|
|
|
24
51
|
#### Flags
|
|
25
52
|
|
|
26
|
-
| Flag | Short | Required | Default | Description
|
|
27
|
-
| ----------------------------- | ----- | -------- | --------------------- |
|
|
28
|
-
| `--from` | `-f` | Yes
|
|
29
|
-
| `--to` | `-t` | No | `HEAD` | End
|
|
30
|
-
| `--commit-message-include` | `-m` | No | | Include commits whose messages match
|
|
31
|
-
| `--commit-message-exclude` | `-e` | No | | Exclude commits whose messages match
|
|
32
|
-
| `--include-package-directory` | `-i` | No | | Extra repo-relative package paths merged with `sfdx-project.json` directories (repeatable).
|
|
33
|
-
| `--exclude-package-directory` | `-x` | No | |
|
|
34
|
-
| `--team` | | No | | Team or squad label
|
|
35
|
-
| `--output` | `-p` | No | `metadata-summary.md` | Output file path
|
|
36
|
-
| `--model` | | No | _provider default_ |
|
|
37
|
-
| `--max-diff-chars` | | No | | Max characters of unified diff text sent to the model (5,000–5,000,000).
|
|
38
|
-
| `--context-lines` | | No |
|
|
39
|
-
| `--ignore-whitespace` | | No | `false` | Pass `-w`
|
|
40
|
-
| `--strip-diff-preamble` | | No | `false` |
|
|
41
|
-
| `--max-hunk-lines` | | No | | Cap each hunk
|
|
42
|
-
| `--exclude-default-noise` | | No | `false` |
|
|
53
|
+
| Flag | Short | Required | Default | Description |
|
|
54
|
+
| ----------------------------- | ----- | -------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| `--from` | `-f` | **Yes** | | Start ref for the diff range (e.g. `HEAD~1`, a tag, or a commit hash). |
|
|
56
|
+
| `--to` | `-t` | No | `HEAD` | End ref for the diff range. |
|
|
57
|
+
| `--commit-message-include` | `-m` | No | | Include only commits whose messages match these regex patterns (repeatable, OR logic). |
|
|
58
|
+
| `--commit-message-exclude` | `-e` | No | | Exclude commits whose messages match these regex patterns (repeatable, OR logic). |
|
|
59
|
+
| `--include-package-directory` | `-i` | No | | Extra repo-relative package paths merged with `sfdx-project.json` directories (repeatable). |
|
|
60
|
+
| `--exclude-package-directory` | `-x` | No | | Paths to remove from the configured list; also adds `:(exclude)` pathspecs to the diff (repeatable). |
|
|
61
|
+
| `--team` | | No | | Team or squad label shown in the summary. Also settable via `METADATA_AUDIT_TEAM` or `SF_GIT_AI_TEAM`. |
|
|
62
|
+
| `--output` | `-p` | No | `metadata-summary.md` | Output file path. |
|
|
63
|
+
| `--model` | | No | _provider default_ | Chat model ID. Overrides the provider default (e.g. `gpt-4o-mini`, `claude-3-5-haiku-latest`). Also settable via `LLM_MODEL`. |
|
|
64
|
+
| `--max-diff-chars` | | No | | Max characters of unified diff text sent to the model (5,000–5,000,000). |
|
|
65
|
+
| `--context-lines` | | No | `3` (git default) | Lines of context around each change (`-U<n>`). Lower values reduce token usage on large diffs. |
|
|
66
|
+
| `--ignore-whitespace` | | No | `false` | Pass `-w` to `git diff` to skip whitespace-only changes. Applied to both the unified diff and `--numstat`/`--name-status`. |
|
|
67
|
+
| `--strip-diff-preamble` | | No | `false` | Remove low-signal `diff --git`, `index`, `mode`, `similarity`, `rename`, and `copy` lines. Hunk headers (`--- a/…`, `+++ b/…`, `@@`) are kept. |
|
|
68
|
+
| `--max-hunk-lines` | | No | | Cap each hunk body at N lines (1–100,000); excess is replaced with a single elision marker. Hunk headers and change counts stay intact. |
|
|
69
|
+
| `--exclude-default-noise` | | No | `false` | Exclude common noise paths: lockfiles, `dist`, `build`, `out`, `coverage`, `node_modules`, `__snapshots__`. |
|
|
43
70
|
|
|
44
71
|
#### Examples
|
|
45
72
|
|
|
46
73
|
Summarize changes since the previous commit:
|
|
47
74
|
|
|
48
75
|
```bash
|
|
49
|
-
sf sgai metadata summarize --from HEAD~1
|
|
76
|
+
sf sgai metadata summarize --from HEAD~1
|
|
50
77
|
```
|
|
51
78
|
|
|
52
|
-
Summarize changes from the past week on main
|
|
79
|
+
Summarize changes from the past week on `main`:
|
|
53
80
|
|
|
54
81
|
```bash
|
|
55
82
|
FROM=$(git log origin/main -1 --before="1 week ago" --pretty=format:%H)
|
|
56
|
-
sf sgai metadata summarize --from "$FROM"
|
|
83
|
+
sf sgai metadata summarize --from "$FROM" --to origin/main
|
|
57
84
|
```
|
|
58
85
|
|
|
59
|
-
|
|
86
|
+
Save output to a custom file:
|
|
60
87
|
|
|
61
88
|
```bash
|
|
62
89
|
sf sgai metadata summarize --from HEAD~5 --to HEAD --output changes.md
|
|
63
90
|
```
|
|
64
91
|
|
|
65
|
-
|
|
92
|
+
Include only commits matching a pattern:
|
|
66
93
|
|
|
67
94
|
```bash
|
|
68
95
|
sf sgai metadata summarize --from main --to HEAD --commit-message-include "(feature|fix)"
|
|
69
96
|
```
|
|
70
97
|
|
|
71
|
-
Override the
|
|
98
|
+
Override the model:
|
|
72
99
|
|
|
73
100
|
```bash
|
|
74
|
-
sf sgai metadata summarize --from HEAD~1 --
|
|
101
|
+
sf sgai metadata summarize --from HEAD~1 --model claude-3-5-sonnet-latest
|
|
75
102
|
```
|
|
76
103
|
|
|
77
|
-
Reduce LLM token cost
|
|
104
|
+
Reduce LLM token cost by shaping the diff:
|
|
78
105
|
|
|
79
106
|
```bash
|
|
80
107
|
sf sgai metadata summarize \
|
|
@@ -85,65 +112,54 @@ sf sgai metadata summarize \
|
|
|
85
112
|
--max-hunk-lines 400
|
|
86
113
|
```
|
|
87
114
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## Requirements
|
|
91
|
-
|
|
92
|
-
- `sf` CLI installed
|
|
93
|
-
- Node.js 20 or later
|
|
94
|
-
- A configured LLM provider—see [Provider configuration](#provider-configuration)
|
|
95
|
-
- A Salesforce DX project repository with a `sfdx-project.json` file present in the repo root (unless you pass only `--include-package-directory` paths)
|
|
96
|
-
- [Git Bash](https://git-scm.com/install/)
|
|
97
|
-
|
|
98
|
-
This plugin reads `packageDirectories` from `sfdx-project.json` (when present) to scope the git diff, merges optional CLI include/exclude paths, then sends context to the model.
|
|
115
|
+
> The diff-shaping flags only affect the text sent to the model. The structured change inventory (file counts, additions, deletions) is computed separately and is always accurate. See the [`@mcarvin/smart-diff` "Reducing tokens" guide](https://github.com/mcarvin8/smart-diff#reducing-tokens) for details.
|
|
99
116
|
|
|
100
|
-
|
|
117
|
+
## Provider configuration
|
|
101
118
|
|
|
102
|
-
|
|
119
|
+
Provider resolution is handled by [`@mcarvin/smart-diff`](https://github.com/mcarvin8/smart-diff) via the Vercel AI SDK. Set credentials for whichever provider you want to use. If multiple providers are configured, set `LLM_PROVIDER` to pick one explicitly; otherwise the resolver auto-detects from env vars.
|
|
103
120
|
|
|
104
|
-
| Provider (`LLM_PROVIDER`) | Credential env vars
|
|
105
|
-
| ------------------------- |
|
|
106
|
-
| `openai` | `OPENAI_API_KEY` or `LLM_API_KEY`
|
|
107
|
-
| `openai-compatible` | `LLM_BASE_URL
|
|
108
|
-
| `anthropic` | `ANTHROPIC_API_KEY`
|
|
109
|
-
| `google` | `GOOGLE_GENERATIVE_AI_API_KEY` or `GOOGLE_API_KEY`
|
|
110
|
-
| `bedrock` | Standard AWS credential chain (env / profile / role)
|
|
111
|
-
| `mistral` | `MISTRAL_API_KEY`
|
|
112
|
-
| `cohere` | `COHERE_API_KEY`
|
|
113
|
-
| `groq` | `GROQ_API_KEY`
|
|
114
|
-
| `xai` | `XAI_API_KEY`
|
|
115
|
-
| `deepseek` | `DEEPSEEK_API_KEY`
|
|
121
|
+
| Provider (`LLM_PROVIDER`) | Credential env vars | Default model |
|
|
122
|
+
| ------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------ |
|
|
123
|
+
| `openai` | `OPENAI_API_KEY` or `LLM_API_KEY` | `gpt-4o-mini` |
|
|
124
|
+
| `openai-compatible` | `LLM_BASE_URL` or `OPENAI_BASE_URL` (required); optional API key / custom headers | `gpt-4o-mini` |
|
|
125
|
+
| `anthropic` | `ANTHROPIC_API_KEY` | `claude-3-5-haiku-latest` |
|
|
126
|
+
| `google` | `GOOGLE_GENERATIVE_AI_API_KEY` or `GOOGLE_API_KEY` | `gemini-2.0-flash` |
|
|
127
|
+
| `bedrock` | Standard AWS credential chain (env / profile / role) | `anthropic.claude-3-5-haiku-20241022-v1:0` |
|
|
128
|
+
| `mistral` | `MISTRAL_API_KEY` | `mistral-small-latest` |
|
|
129
|
+
| `cohere` | `COHERE_API_KEY` | `command-r-08-2024` |
|
|
130
|
+
| `groq` | `GROQ_API_KEY` | `llama-3.1-8b-instant` |
|
|
131
|
+
| `xai` | `XAI_API_KEY` | `grok-2-latest` |
|
|
132
|
+
| `deepseek` | `DEEPSEEK_API_KEY` | `deepseek-chat` |
|
|
116
133
|
|
|
117
|
-
|
|
134
|
+
### Common env vars
|
|
118
135
|
|
|
119
|
-
|
|
136
|
+
| Variable | Purpose |
|
|
137
|
+
| ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
|
|
138
|
+
| `LLM_PROVIDER` | Explicit provider ID from the table above. |
|
|
139
|
+
| `LLM_MODEL` | Overrides the provider's default model. Also settable per-run via `--model`. |
|
|
140
|
+
| `OPENAI_BASE_URL` / `LLM_BASE_URL` | Base URL for an OpenAI-compatible gateway. Presence alone auto-selects the `openai-compatible` provider. |
|
|
141
|
+
| `OPENAI_DEFAULT_HEADERS` / `LLM_DEFAULT_HEADERS` | JSON object of extra headers for OpenAI / OpenAI-compatible requests. `LLM_*` overrides `OPENAI_*` key-by-key. |
|
|
142
|
+
| `OPENAI_MAX_DIFF_CHARS` / `LLM_MAX_DIFF_CHARS` | Max unified diff characters sent to the model (default ~120k). Also settable via `--max-diff-chars`. |
|
|
120
143
|
|
|
121
|
-
|
|
122
|
-
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
|
|
123
|
-
| `LLM_PROVIDER` | Explicit provider id from the table above. |
|
|
124
|
-
| `LLM_MODEL` | Overrides the per-provider default model id (also settable per-run via `--model`). |
|
|
125
|
-
| `OPENAI_BASE_URL` / `LLM_BASE_URL` | Base URL for an OpenAI-compatible gateway; presence alone auto-selects the `openai-compatible` provider. |
|
|
126
|
-
| `OPENAI_DEFAULT_HEADERS` / `LLM_DEFAULT_HEADERS` | JSON object of extra headers merged onto OpenAI / OpenAI-compatible requests. `LLM_*` overrides `OPENAI_*` key-by-key. |
|
|
127
|
-
| `OPENAI_MAX_DIFF_CHARS` / `LLM_MAX_DIFF_CHARS` | Max size of unified diff text sent to the model (default ~120k characters). Also settable per-run via `--max-diff-chars`. |
|
|
144
|
+
`LLM_*` variants override their `OPENAI_*` counterparts when both are set. For the full env var reference, see the [`@mcarvin/smart-diff` documentation](https://github.com/mcarvin8/smart-diff#provider-configuration).
|
|
128
145
|
|
|
129
|
-
|
|
130
|
-
> For the full list of supported environment variables, see the [`@mcarvin/smart-diff` documentation](https://github.com/mcarvin8/smart-diff#provider-configuration).
|
|
146
|
+
### Provider examples
|
|
131
147
|
|
|
132
|
-
|
|
148
|
+
**OpenAI**
|
|
133
149
|
|
|
134
150
|
```powershell
|
|
135
151
|
$env:OPENAI_API_KEY = "sk-..."
|
|
136
152
|
sf sgai metadata summarize --from HEAD~1 --to HEAD
|
|
137
153
|
```
|
|
138
154
|
|
|
139
|
-
|
|
155
|
+
**Anthropic Claude**
|
|
140
156
|
|
|
141
157
|
```powershell
|
|
142
158
|
$env:ANTHROPIC_API_KEY = "sk-ant-..."
|
|
143
159
|
sf sgai metadata summarize --from HEAD~1 --to HEAD --model claude-3-5-sonnet-latest
|
|
144
160
|
```
|
|
145
161
|
|
|
146
|
-
|
|
162
|
+
**Company-managed OpenAI-compatible gateway**
|
|
147
163
|
|
|
148
164
|
```powershell
|
|
149
165
|
$env:LLM_BASE_URL = "https://llm-gateway.mycompany.example/v1"
|
|
@@ -151,9 +167,9 @@ $env:LLM_DEFAULT_HEADERS = '{"Authorization":"Bearer <token>","x-tenant-id":"sal
|
|
|
151
167
|
sf sgai metadata summarize --from HEAD~1 --to HEAD
|
|
152
168
|
```
|
|
153
169
|
|
|
154
|
-
##
|
|
170
|
+
## How it works
|
|
155
171
|
|
|
156
|
-
The plugin
|
|
172
|
+
The plugin reads `packageDirectories` from `sfdx-project.json` to scope the diff, merges any CLI include/exclude paths, then sends the structured diff context to the configured model. Core logic is provided by [`@mcarvin/smart-diff`](https://github.com/mcarvin8/smart-diff), a general-purpose library that turns git diffs into Markdown summaries using any Vercel AI SDK provider.
|
|
157
173
|
|
|
158
174
|
## License
|
|
159
175
|
|
|
@@ -1,103 +1,8 @@
|
|
|
1
|
-
import { writeFile } from 'node:fs/promises';
|
|
2
1
|
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import { Messages
|
|
4
|
-
import {
|
|
5
|
-
import { SALESFORCE_METADATA_SYSTEM_PROMPT } from '../../../ai/salesforceMetadataPrompt.js';
|
|
6
|
-
import { resolveMetadataSummaryTeam } from '../../../salesforce/metadataSummaryContext.js';
|
|
7
|
-
import { getSalesforceMetadataIncludeFolders, normalizeRepoRelativeFolderPath, } from '../../../salesforce/sfdxPackagePaths.js';
|
|
2
|
+
import { Messages } from '@salesforce/core';
|
|
3
|
+
import { runMetadataSummarize } from '../../../metadata/summarizeCore.js';
|
|
8
4
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
9
5
|
const messages = Messages.loadMessages('sf-git-ai-meta-insights', 'sgai.metadata.summarize');
|
|
10
|
-
function validateMaxDiffCharsRange(maxDiffChars) {
|
|
11
|
-
if (maxDiffChars === undefined)
|
|
12
|
-
return;
|
|
13
|
-
if (maxDiffChars < 5000 || maxDiffChars > 5_000_000) {
|
|
14
|
-
throw new SfError(`--max-diff-chars must be between 5000 and 5,000,000 (received ${maxDiffChars}).`, 'InvalidMaxDiffChars');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function validateContextLinesRange(contextLines) {
|
|
18
|
-
if (contextLines === undefined)
|
|
19
|
-
return;
|
|
20
|
-
if (!Number.isInteger(contextLines) || contextLines < 0 || contextLines > 1000) {
|
|
21
|
-
throw new SfError(`--context-lines must be an integer between 0 and 1000 (received ${contextLines}).`, 'InvalidContextLines');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function validateMaxHunkLinesRange(maxHunkLines) {
|
|
25
|
-
if (maxHunkLines === undefined)
|
|
26
|
-
return;
|
|
27
|
-
if (!Number.isInteger(maxHunkLines) || maxHunkLines < 1 || maxHunkLines > 100_000) {
|
|
28
|
-
throw new SfError(`--max-hunk-lines must be an integer between 1 and 100,000 (received ${maxHunkLines}).`, 'InvalidMaxHunkLines');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function getValidatedCommitMessageRegexLists(flags) {
|
|
32
|
-
const include = mergeUniqueStrings((flags['commit-message-include'] ?? []).map((s) => s.trim()).filter((s) => s.length > 0));
|
|
33
|
-
const exclude = (flags['commit-message-exclude'] ?? []).map((s) => s.trim()).filter((s) => s.length > 0);
|
|
34
|
-
if (include.length > 0) {
|
|
35
|
-
validateCommitMessageRegexes(include, 'include');
|
|
36
|
-
}
|
|
37
|
-
if (exclude.length > 0) {
|
|
38
|
-
validateCommitMessageRegexes(exclude, 'exclude');
|
|
39
|
-
}
|
|
40
|
-
return { include, exclude };
|
|
41
|
-
}
|
|
42
|
-
async function resolveIncludeFoldersAndExclude(git, flags) {
|
|
43
|
-
const excludePackageDirectories = mergeUniqueRepoRelativePaths(flags['exclude-package-directory'] ?? []);
|
|
44
|
-
const includeFoldersFromProject = await getSalesforceMetadataIncludeFolders(git, excludePackageDirectories.length > 0 ? excludePackageDirectories : undefined);
|
|
45
|
-
const includeFoldersFromCli = mergeUniqueRepoRelativePaths(flags['include-package-directory'] ?? []);
|
|
46
|
-
const includeFolders = mergeUniqueRepoRelativePaths(includeFoldersFromProject, includeFoldersFromCli);
|
|
47
|
-
return { includeFolders, excludePackageDirectories };
|
|
48
|
-
}
|
|
49
|
-
function throwIfNoCommitsAfterMessageFilter(commits, filteredCommits, includeRegexes, excludeRegexes, from, to) {
|
|
50
|
-
if (commits.length > 0 && filteredCommits.length === 0 && (includeRegexes.length > 0 || excludeRegexes.length > 0)) {
|
|
51
|
-
throw new SfError(messages.getMessage('errors.noCommitsAfterFilter', [
|
|
52
|
-
from,
|
|
53
|
-
to,
|
|
54
|
-
JSON.stringify(includeRegexes),
|
|
55
|
-
JSON.stringify(excludeRegexes),
|
|
56
|
-
]), 'NoCommitsAfterFilter');
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function validateCommitMessageRegexes(patterns, kind) {
|
|
60
|
-
for (const pattern of patterns) {
|
|
61
|
-
try {
|
|
62
|
-
filterCommitsByMessageRegexes([{ hash: '_', message: ' ' }], kind === 'include' ? [pattern] : undefined, kind === 'exclude' ? [pattern] : undefined);
|
|
63
|
-
}
|
|
64
|
-
catch (err) {
|
|
65
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
66
|
-
const needle = kind === 'include' ? 'Invalid commit message include pattern' : 'Invalid commit message exclude pattern';
|
|
67
|
-
if (message.includes(needle)) {
|
|
68
|
-
throw new SfError(`Invalid commit message ${kind} regular expression: ${JSON.stringify(pattern)}`, kind === 'include' ? 'InvalidMessageInclude' : 'InvalidMessageExclude');
|
|
69
|
-
}
|
|
70
|
-
throw err;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function mergeUniqueStrings(...groups) {
|
|
75
|
-
const seen = new Set();
|
|
76
|
-
const out = [];
|
|
77
|
-
for (const group of groups) {
|
|
78
|
-
for (const s of group) {
|
|
79
|
-
if (seen.has(s))
|
|
80
|
-
continue;
|
|
81
|
-
seen.add(s);
|
|
82
|
-
out.push(s);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return out;
|
|
86
|
-
}
|
|
87
|
-
function mergeUniqueRepoRelativePaths(...groups) {
|
|
88
|
-
const seen = new Set();
|
|
89
|
-
const out = [];
|
|
90
|
-
for (const group of groups) {
|
|
91
|
-
for (const raw of group) {
|
|
92
|
-
const norm = normalizeRepoRelativeFolderPath(raw);
|
|
93
|
-
if (norm.length === 0 || seen.has(norm))
|
|
94
|
-
continue;
|
|
95
|
-
seen.add(norm);
|
|
96
|
-
out.push(norm);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return out;
|
|
100
|
-
}
|
|
101
6
|
export default class SgaiMetadataSummarize extends SfCommand {
|
|
102
7
|
static summary = messages.getMessage('summary');
|
|
103
8
|
static description = messages.getMessage('description');
|
|
@@ -196,48 +101,7 @@ export default class SgaiMetadataSummarize extends SfCommand {
|
|
|
196
101
|
};
|
|
197
102
|
async run() {
|
|
198
103
|
const { flags } = await this.parse(SgaiMetadataSummarize);
|
|
199
|
-
|
|
200
|
-
validateContextLinesRange(flags['context-lines']);
|
|
201
|
-
validateMaxHunkLinesRange(flags['max-hunk-lines']);
|
|
202
|
-
if (!isLlmProviderConfigured()) {
|
|
203
|
-
throw new SfError(LLM_GATEWAY_REQUIRED_MESSAGE, 'NoLlmProvider');
|
|
204
|
-
}
|
|
205
|
-
const from = flags.from;
|
|
206
|
-
const to = flags.to ?? 'HEAD';
|
|
207
|
-
const outputPath = flags.output ?? 'metadata-summary.md';
|
|
208
|
-
const { include: commitMessageIncludeRegexes, exclude: commitMessageExcludeFromFlag } = getValidatedCommitMessageRegexLists(flags);
|
|
209
|
-
const git = createGitClient(process.cwd());
|
|
210
|
-
const { includeFolders, excludePackageDirectories } = await resolveIncludeFoldersAndExclude(git, flags);
|
|
211
|
-
if (includeFolders.length === 0) {
|
|
212
|
-
throw new SfError(messages.getMessage('errors.noPackageDirectories'), 'NoPackageDirectories');
|
|
213
|
-
}
|
|
214
|
-
const commits = await getCommits(git, from, to);
|
|
215
|
-
const filteredCommits = filterCommitsByMessageRegexes(commits, commitMessageIncludeRegexes.length > 0 ? commitMessageIncludeRegexes : undefined, commitMessageExcludeFromFlag.length > 0 ? commitMessageExcludeFromFlag : undefined);
|
|
216
|
-
throwIfNoCommitsAfterMessageFilter(commits, filteredCommits, commitMessageIncludeRegexes, commitMessageExcludeFromFlag, from, to);
|
|
217
|
-
const teamName = resolveMetadataSummaryTeam(flags.team);
|
|
218
|
-
const maxDiffCharsFlag = flags['max-diff-chars'];
|
|
219
|
-
const summary = await summarizeGitDiff({
|
|
220
|
-
from,
|
|
221
|
-
to: flags.to,
|
|
222
|
-
git,
|
|
223
|
-
cwd: process.cwd(),
|
|
224
|
-
includeFolders,
|
|
225
|
-
excludeFolders: excludePackageDirectories.length > 0 ? excludePackageDirectories : undefined,
|
|
226
|
-
systemPrompt: SALESFORCE_METADATA_SYSTEM_PROMPT,
|
|
227
|
-
teamName,
|
|
228
|
-
model: flags.model,
|
|
229
|
-
maxDiffChars: maxDiffCharsFlag,
|
|
230
|
-
commitMessageIncludeRegexes: commitMessageIncludeRegexes.length > 0 ? commitMessageIncludeRegexes : undefined,
|
|
231
|
-
commitMessageExcludeRegexes: commitMessageExcludeFromFlag.length > 0 ? commitMessageExcludeFromFlag : undefined,
|
|
232
|
-
contextLines: flags['context-lines'],
|
|
233
|
-
ignoreWhitespace: flags['ignore-whitespace'] || undefined,
|
|
234
|
-
stripDiffPreamble: flags['strip-diff-preamble'] || undefined,
|
|
235
|
-
maxHunkLines: flags['max-hunk-lines'],
|
|
236
|
-
excludeDefaultNoise: flags['exclude-default-noise'] || undefined,
|
|
237
|
-
});
|
|
238
|
-
await writeFile(outputPath, summary, 'utf8');
|
|
239
|
-
this.log(`Generated metadata summary at ${outputPath}`);
|
|
240
|
-
return { path: outputPath };
|
|
104
|
+
return runMetadataSummarize(flags, messages.getMessage('errors.noPackageDirectories'), (from, to, include, exclude) => messages.getMessage('errors.noCommitsAfterFilter', [from, to, include, exclude]), (msg) => this.log(msg));
|
|
241
105
|
}
|
|
242
106
|
}
|
|
243
107
|
//# sourceMappingURL=summarize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarize.js","sourceRoot":"","sources":["../../../../src/commands/sgai/metadata/summarize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"summarize.js","sourceRoot":"","sources":["../../../../src/commands/sgai/metadata/summarize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAyB,MAAM,oCAAoC,CAAC;AAEjG,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,yBAAyB,CAAC,CAAC;AAM7F,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,SAAsC;IAChF,MAAM,CAAmB,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAClE,MAAM,CAAmB,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAC1E,MAAM,CAAmB,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAErE,MAAM,CAAmB,KAAK,GAAG;QACtC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;YAClD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;YAC1D,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,EAAE,EAAE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directory'?: string[];
|
|
7
|
+
'exclude-package-directory'?: string[];
|
|
8
|
+
team?: string;
|
|
9
|
+
output: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
'max-diff-chars'?: number;
|
|
12
|
+
'context-lines'?: number;
|
|
13
|
+
'ignore-whitespace': boolean;
|
|
14
|
+
'strip-diff-preamble': boolean;
|
|
15
|
+
'max-hunk-lines'?: number;
|
|
16
|
+
'exclude-default-noise': boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare function runMetadataSummarize(options: SummarizeOptions, noPackageDirectoriesError: string, noCommitsAfterFilterError: (from: string, to: string, include: string, exclude: string) => string, log: (message: string) => void): Promise<{
|
|
19
|
+
path: string;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { writeFile } from 'node:fs/promises';
|
|
2
|
+
import { SfError } from '@salesforce/core';
|
|
3
|
+
import { createGitClient, filterCommitsByMessageRegexes, getCommits, isLlmProviderConfigured, LLM_GATEWAY_REQUIRED_MESSAGE, summarizeGitDiff, } from '@mcarvin/smart-diff';
|
|
4
|
+
import { SALESFORCE_METADATA_SYSTEM_PROMPT } from '../ai/salesforceMetadataPrompt.js';
|
|
5
|
+
import { resolveMetadataSummaryTeam } from '../salesforce/metadataSummaryContext.js';
|
|
6
|
+
import { getValidatedCommitMessageRegexLists, resolveIncludeFoldersAndExclude, throwIfNoCommitsAfterMessageFilter, validateContextLinesRange, validateMaxDiffCharsRange, validateMaxHunkLinesRange, } from './summarizeHelpers.js';
|
|
7
|
+
export async function runMetadataSummarize(options, noPackageDirectoriesError, noCommitsAfterFilterError, log) {
|
|
8
|
+
validateMaxDiffCharsRange(options['max-diff-chars']);
|
|
9
|
+
validateContextLinesRange(options['context-lines']);
|
|
10
|
+
validateMaxHunkLinesRange(options['max-hunk-lines']);
|
|
11
|
+
if (!isLlmProviderConfigured()) {
|
|
12
|
+
throw new SfError(LLM_GATEWAY_REQUIRED_MESSAGE, 'NoLlmProvider');
|
|
13
|
+
}
|
|
14
|
+
const from = options.from;
|
|
15
|
+
const to = options.to ?? 'HEAD';
|
|
16
|
+
const { include: commitMessageIncludeRegexes, exclude: commitMessageExcludeFromFlag } = getValidatedCommitMessageRegexLists(options);
|
|
17
|
+
const git = createGitClient(process.cwd());
|
|
18
|
+
const { includeFolders, excludePackageDirectories } = await resolveIncludeFoldersAndExclude(git, options);
|
|
19
|
+
if (includeFolders.length === 0) {
|
|
20
|
+
throw new SfError(noPackageDirectoriesError, 'NoPackageDirectories');
|
|
21
|
+
}
|
|
22
|
+
const commits = await getCommits(git, from, to);
|
|
23
|
+
const filteredCommits = filterCommitsByMessageRegexes(commits, commitMessageIncludeRegexes.length > 0 ? commitMessageIncludeRegexes : undefined, commitMessageExcludeFromFlag.length > 0 ? commitMessageExcludeFromFlag : undefined);
|
|
24
|
+
throwIfNoCommitsAfterMessageFilter(commits, filteredCommits, commitMessageIncludeRegexes, commitMessageExcludeFromFlag, noCommitsAfterFilterError(from, to, JSON.stringify(commitMessageIncludeRegexes), JSON.stringify(commitMessageExcludeFromFlag)));
|
|
25
|
+
const teamName = resolveMetadataSummaryTeam(options.team);
|
|
26
|
+
const summary = await summarizeGitDiff({
|
|
27
|
+
from,
|
|
28
|
+
to: options.to,
|
|
29
|
+
git,
|
|
30
|
+
cwd: process.cwd(),
|
|
31
|
+
includeFolders,
|
|
32
|
+
excludeFolders: excludePackageDirectories.length > 0 ? excludePackageDirectories : undefined,
|
|
33
|
+
systemPrompt: SALESFORCE_METADATA_SYSTEM_PROMPT,
|
|
34
|
+
teamName,
|
|
35
|
+
model: options.model,
|
|
36
|
+
maxDiffChars: options['max-diff-chars'],
|
|
37
|
+
commitMessageIncludeRegexes: commitMessageIncludeRegexes.length > 0 ? commitMessageIncludeRegexes : undefined,
|
|
38
|
+
commitMessageExcludeRegexes: commitMessageExcludeFromFlag.length > 0 ? commitMessageExcludeFromFlag : undefined,
|
|
39
|
+
contextLines: options['context-lines'],
|
|
40
|
+
ignoreWhitespace: options['ignore-whitespace'] || undefined,
|
|
41
|
+
stripDiffPreamble: options['strip-diff-preamble'] || undefined,
|
|
42
|
+
maxHunkLines: options['max-hunk-lines'],
|
|
43
|
+
excludeDefaultNoise: options['exclude-default-noise'] || undefined,
|
|
44
|
+
});
|
|
45
|
+
await writeFile(options.output, summary, 'utf8');
|
|
46
|
+
log(`Generated metadata summary at ${options.output}`);
|
|
47
|
+
return { path: options.output };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=summarizeCore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summarizeCore.js","sourceRoot":"","sources":["../../src/metadata/summarizeCore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EACL,eAAe,EACf,6BAA6B,EAC7B,UAAU,EACV,uBAAuB,EACvB,4BAA4B,EAC5B,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EACL,mCAAmC,EACnC,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAoB/B,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAyB,EACzB,yBAAiC,EACjC,yBAAiG,EACjG,GAA8B;IAE9B,yBAAyB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACrD,yBAAyB,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC;IACpD,yBAAyB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAErD,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC;QAC/B,MAAM,IAAI,OAAO,CAAC,4BAA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E,EAAE,OAAO,CAAC,EAAE;QACd,GAAG;QACH,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,cAAc;QACd,cAAc,EAAE,yBAAyB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,SAAS;QAC5F,YAAY,EAAE,iCAAiC;QAC/C,QAAQ;QACR,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,YAAY,EAAE,OAAO,CAAC,gBAAgB,CAAC;QACvC,2BAA2B,EAAE,2BAA2B,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,SAAS;QAC7G,2BAA2B,EAAE,4BAA4B,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,SAAS;QAC/G,YAAY,EAAE,OAAO,CAAC,eAAe,CAAC;QACtC,gBAAgB,EAAE,OAAO,CAAC,mBAAmB,CAAC,IAAI,SAAS;QAC3D,iBAAiB,EAAE,OAAO,CAAC,qBAAqB,CAAC,IAAI,SAAS;QAC9D,YAAY,EAAE,OAAO,CAAC,gBAAgB,CAAC;QACvC,mBAAmB,EAAE,OAAO,CAAC,uBAAuB,CAAC,IAAI,SAAS;KACnE,CAAC,CAAC;IAEH,MAAM,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACjD,GAAG,CAAC,iCAAiC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAEvD,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CommitInfo } from '@mcarvin/smart-diff';
|
|
2
|
+
import { type GitClient } from '../salesforce/sfdxPackagePaths.js';
|
|
3
|
+
export declare function validateMaxDiffCharsRange(maxDiffChars: number | undefined): void;
|
|
4
|
+
export declare function validateContextLinesRange(contextLines: number | undefined): void;
|
|
5
|
+
export declare function validateMaxHunkLinesRange(maxHunkLines: number | undefined): void;
|
|
6
|
+
export type CommitMessageRegexFlags = {
|
|
7
|
+
'commit-message-include'?: string[];
|
|
8
|
+
'commit-message-exclude'?: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare function getValidatedCommitMessageRegexLists(flags: CommitMessageRegexFlags): {
|
|
11
|
+
include: string[];
|
|
12
|
+
exclude: string[];
|
|
13
|
+
};
|
|
14
|
+
export type PackageDirectoryFlags = {
|
|
15
|
+
'exclude-package-directory'?: string[];
|
|
16
|
+
'include-package-directory'?: string[];
|
|
17
|
+
};
|
|
18
|
+
export declare function resolveIncludeFoldersAndExclude(git: GitClient, flags: PackageDirectoryFlags): Promise<{
|
|
19
|
+
includeFolders: string[];
|
|
20
|
+
excludePackageDirectories: string[];
|
|
21
|
+
}>;
|
|
22
|
+
export declare function throwIfNoCommitsAfterMessageFilter(commits: CommitInfo[], filteredCommits: CommitInfo[], includeRegexes: string[], excludeRegexes: string[], errorMessage: string): void;
|
|
23
|
+
export declare function validateCommitMessageRegexes(patterns: string[], kind: 'include' | 'exclude'): void;
|
|
24
|
+
export declare function mergeUniqueStrings(...groups: string[][]): string[];
|
|
25
|
+
export declare function mergeUniqueRepoRelativePaths(...groups: string[][]): string[];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { SfError } from '@salesforce/core';
|
|
2
|
+
import { filterCommitsByMessageRegexes } from '@mcarvin/smart-diff';
|
|
3
|
+
import { getSalesforceMetadataIncludeFolders, normalizeRepoRelativeFolderPath, } from '../salesforce/sfdxPackagePaths.js';
|
|
4
|
+
export function validateMaxDiffCharsRange(maxDiffChars) {
|
|
5
|
+
// Stryker disable-next-line ConditionalExpression
|
|
6
|
+
if (maxDiffChars === undefined)
|
|
7
|
+
return;
|
|
8
|
+
if (maxDiffChars < 5000 || maxDiffChars > 5_000_000) {
|
|
9
|
+
throw new SfError(`--max-diff-chars must be between 5000 and 5,000,000 (received ${maxDiffChars}).`, 'InvalidMaxDiffChars');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export function validateContextLinesRange(contextLines) {
|
|
13
|
+
if (contextLines === undefined)
|
|
14
|
+
return;
|
|
15
|
+
if (!Number.isInteger(contextLines) || contextLines < 0 || contextLines > 1000) {
|
|
16
|
+
throw new SfError(`--context-lines must be an integer between 0 and 1000 (received ${contextLines}).`, 'InvalidContextLines');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function validateMaxHunkLinesRange(maxHunkLines) {
|
|
20
|
+
if (maxHunkLines === undefined)
|
|
21
|
+
return;
|
|
22
|
+
if (!Number.isInteger(maxHunkLines) || maxHunkLines < 1 || maxHunkLines > 100_000) {
|
|
23
|
+
throw new SfError(`--max-hunk-lines must be an integer between 1 and 100,000 (received ${maxHunkLines}).`, 'InvalidMaxHunkLines');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function getValidatedCommitMessageRegexLists(flags) {
|
|
27
|
+
const include = mergeUniqueStrings((flags['commit-message-include'] ?? []).map((s) => s.trim()).filter((s) => s.length > 0));
|
|
28
|
+
const exclude = (flags['commit-message-exclude'] ?? []).map((s) => s.trim()).filter((s) => s.length > 0);
|
|
29
|
+
// Stryker disable-next-line ConditionalExpression, EqualityOperator
|
|
30
|
+
if (include.length > 0) {
|
|
31
|
+
validateCommitMessageRegexes(include, 'include');
|
|
32
|
+
}
|
|
33
|
+
// Stryker disable-next-line ConditionalExpression, EqualityOperator
|
|
34
|
+
if (exclude.length > 0) {
|
|
35
|
+
validateCommitMessageRegexes(exclude, 'exclude');
|
|
36
|
+
}
|
|
37
|
+
return { include, exclude };
|
|
38
|
+
}
|
|
39
|
+
export async function resolveIncludeFoldersAndExclude(git, flags) {
|
|
40
|
+
const excludePackageDirectories = mergeUniqueRepoRelativePaths(flags['exclude-package-directory'] ?? []);
|
|
41
|
+
const includeFoldersFromProject = await getSalesforceMetadataIncludeFolders(git, excludePackageDirectories.length > 0 ? excludePackageDirectories : undefined);
|
|
42
|
+
const includeFoldersFromCli = mergeUniqueRepoRelativePaths(flags['include-package-directory'] ?? []);
|
|
43
|
+
const includeFolders = mergeUniqueRepoRelativePaths(includeFoldersFromProject, includeFoldersFromCli);
|
|
44
|
+
return { includeFolders, excludePackageDirectories };
|
|
45
|
+
}
|
|
46
|
+
export function throwIfNoCommitsAfterMessageFilter(commits, filteredCommits, includeRegexes, excludeRegexes, errorMessage) {
|
|
47
|
+
if (commits.length > 0 && filteredCommits.length === 0 && (includeRegexes.length > 0 || excludeRegexes.length > 0)) {
|
|
48
|
+
throw new SfError(errorMessage, 'NoCommitsAfterFilter');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export function validateCommitMessageRegexes(patterns, kind) {
|
|
52
|
+
for (const pattern of patterns) {
|
|
53
|
+
try {
|
|
54
|
+
filterCommitsByMessageRegexes(
|
|
55
|
+
// Stryker disable-next-line ArrayDeclaration, ObjectLiteral, StringLiteral
|
|
56
|
+
[{ hash: '_', message: ' ' }], kind === 'include' ? [pattern] : undefined,
|
|
57
|
+
// Stryker disable-next-line ConditionalExpression
|
|
58
|
+
kind === 'exclude' ? [pattern] : undefined);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
62
|
+
const needle = kind === 'include' ? 'Invalid commit message include pattern' : 'Invalid commit message exclude pattern';
|
|
63
|
+
if (message.includes(needle)) {
|
|
64
|
+
throw new SfError(`Invalid commit message ${kind} regular expression: ${JSON.stringify(pattern)}`, kind === 'include' ? 'InvalidMessageInclude' : 'InvalidMessageExclude');
|
|
65
|
+
}
|
|
66
|
+
throw err;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export function mergeUniqueStrings(...groups) {
|
|
71
|
+
const seen = new Set();
|
|
72
|
+
const out = [];
|
|
73
|
+
for (const group of groups) {
|
|
74
|
+
for (const s of group) {
|
|
75
|
+
if (seen.has(s))
|
|
76
|
+
continue;
|
|
77
|
+
seen.add(s);
|
|
78
|
+
out.push(s);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
export function mergeUniqueRepoRelativePaths(...groups) {
|
|
84
|
+
const seen = new Set();
|
|
85
|
+
const out = [];
|
|
86
|
+
for (const group of groups) {
|
|
87
|
+
for (const raw of group) {
|
|
88
|
+
const norm = normalizeRepoRelativeFolderPath(raw);
|
|
89
|
+
if (norm.length === 0 || seen.has(norm))
|
|
90
|
+
continue;
|
|
91
|
+
seen.add(norm);
|
|
92
|
+
out.push(norm);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=summarizeHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summarizeHelpers.js","sourceRoot":"","sources":["../../src/metadata/summarizeHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAEL,mCAAmC,EACnC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAE3C,MAAM,UAAU,yBAAyB,CAAC,YAAgC;IACxE,kDAAkD;IAClD,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO;IACvC,IAAI,YAAY,GAAG,IAAI,IAAI,YAAY,GAAG,SAAS,EAAE,CAAC;QACpD,MAAM,IAAI,OAAO,CACf,iEAAiE,YAAY,IAAI,EACjF,qBAAqB,CACtB,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,YAAgC;IACxE,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO;IACvC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,YAAY,GAAG,CAAC,IAAI,YAAY,GAAG,IAAI,EAAE,CA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;IAC/B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;YACxB,MAAM,IAAI,GAAG,+BAA+B,CAAC,GAAG,CAAC,CAAC;YAClD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,SAAS;YAClD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -19,6 +19,7 @@ export async function readPackageDirectoryRelativePaths(repoRoot, ignorePackageD
|
|
|
19
19
|
const projectPath = join(repoRoot, SFDX_PROJECT_FILE_NAME);
|
|
20
20
|
let project;
|
|
21
21
|
try {
|
|
22
|
+
// Stryker disable-next-line StringLiteral
|
|
22
23
|
const raw = await readFile(projectPath, 'utf8');
|
|
23
24
|
const parsed = JSON.parse(raw);
|
|
24
25
|
project = parsed;
|
|
@@ -30,10 +31,10 @@ export async function readPackageDirectoryRelativePaths(repoRoot, ignorePackageD
|
|
|
30
31
|
.map((d) => (typeof d === 'string' ? d : d?.path))
|
|
31
32
|
.filter((d) => typeof d === 'string' && d.trim().length > 0)
|
|
32
33
|
.map((d) => d.trim());
|
|
33
|
-
|
|
34
|
-
return [];
|
|
34
|
+
// Stryker disable-next-line ArrayDeclaration
|
|
35
35
|
const ignored = (ignorePackageDirectories ?? []).map((d) => d.replace(/\\/g, '/').toLowerCase());
|
|
36
36
|
const kept = dirs.filter((dir) => {
|
|
37
|
+
// Stryker disable-next-line StringLiteral
|
|
37
38
|
const normalized = dir.replace(/\\/g, '/').toLowerCase();
|
|
38
39
|
return !ignored.some((ign) => normalized === ign || normalized.startsWith(ign + '/'));
|
|
39
40
|
});
|
|
@@ -1 +1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G,CAAC,CAAC,WAAW,EAAE,CAAC;QACzD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,KAAK,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;IACxF,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACtB,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACnC,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACpC,MAAM,IAAI,GAAG,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sf-git-ai-meta-insights",
|
|
3
3
|
"description": "Provide AI-generated summaries on Salesforce metadata changes by analyzing the git diff.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.6.0",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@ai-sdk/amazon-bedrock": "
|
|
7
|
-
"@ai-sdk/anthropic": "
|
|
8
|
-
"@ai-sdk/cohere": "
|
|
9
|
-
"@ai-sdk/deepseek": "
|
|
10
|
-
"@ai-sdk/google": "
|
|
11
|
-
"@ai-sdk/groq": "
|
|
12
|
-
"@ai-sdk/mistral": "
|
|
13
|
-
"@ai-sdk/xai": "
|
|
14
|
-
"@mcarvin/smart-diff": "
|
|
15
|
-
"@oclif/core": "
|
|
16
|
-
"@salesforce/core": "
|
|
17
|
-
"@salesforce/sf-plugins-core": "
|
|
18
|
-
"zod": "
|
|
6
|
+
"@ai-sdk/amazon-bedrock": "4.0.112",
|
|
7
|
+
"@ai-sdk/anthropic": "3.0.81",
|
|
8
|
+
"@ai-sdk/cohere": "3.0.36",
|
|
9
|
+
"@ai-sdk/deepseek": "2.0.35",
|
|
10
|
+
"@ai-sdk/google": "3.0.80",
|
|
11
|
+
"@ai-sdk/groq": "3.0.39",
|
|
12
|
+
"@ai-sdk/mistral": "3.0.37",
|
|
13
|
+
"@ai-sdk/xai": "3.0.93",
|
|
14
|
+
"@mcarvin/smart-diff": "2.2.1",
|
|
15
|
+
"@oclif/core": "4.11.4",
|
|
16
|
+
"@salesforce/core": "8.26.3",
|
|
17
|
+
"@salesforce/sf-plugins-core": "12.2.6",
|
|
18
|
+
"zod": "4.1.8"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@commitlint/config-conventional": "
|
|
22
|
-
"@oclif/plugin-command-snapshot": "
|
|
23
|
-
"@salesforce/cli-plugins-testkit": "
|
|
24
|
-
"@salesforce/dev-config": "
|
|
25
|
-
"@salesforce/prettier-config": "
|
|
26
|
-
"@
|
|
27
|
-
"@vitest
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
21
|
+
"@commitlint/config-conventional": "20.5.0",
|
|
22
|
+
"@oclif/plugin-command-snapshot": "5.3.15",
|
|
23
|
+
"@salesforce/cli-plugins-testkit": "5.3.52",
|
|
24
|
+
"@salesforce/dev-config": "4.3.3",
|
|
25
|
+
"@salesforce/prettier-config": "0.0.4",
|
|
26
|
+
"@stryker-mutator/core": "9.6.1",
|
|
27
|
+
"@stryker-mutator/vitest-runner": "9.6.1",
|
|
28
|
+
"@types/node": "20.11.0",
|
|
29
|
+
"@vitest/coverage-v8": "4.1.5",
|
|
30
|
+
"eslint-config-salesforce-typescript": "4.0.1",
|
|
31
|
+
"eslint-plugin-sf-plugin": "1.18.6",
|
|
32
|
+
"husky": "9.1.7",
|
|
33
|
+
"oclif": "4.23.0",
|
|
34
|
+
"shx": "0.4.0",
|
|
35
|
+
"ts-node": "10.9.2",
|
|
36
|
+
"typescript": "5.9.3",
|
|
37
|
+
"vitest": "4.1.5",
|
|
38
|
+
"wireit": "0.14.12"
|
|
37
39
|
},
|
|
38
40
|
"engines": {
|
|
39
41
|
"node": ">=20.0.0"
|
|
@@ -92,6 +94,8 @@
|
|
|
92
94
|
"prepack": "wireit",
|
|
93
95
|
"prepare": "husky install",
|
|
94
96
|
"test": "wireit",
|
|
97
|
+
"test:mutation": "stryker run",
|
|
98
|
+
"test:mutation:incremental": "node scripts/incremental-mutation.mjs",
|
|
95
99
|
"test:nuts": "oclif manifest && vitest run --config ./vitest.nut.config.ts",
|
|
96
100
|
"test:only": "wireit",
|
|
97
101
|
"version": "oclif readme"
|