@vibe-agent-toolkit/cli 0.1.41-rc.6 → 0.1.41-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/bin/vat +25 -2
- package/dist/bin/vat.js +25 -2
- package/dist/bin/vat.js.map +1 -1
- package/dist/bin.js +12 -1
- package/dist/bin.js.map +1 -1
- package/dist/commands/agent/list.d.ts +11 -0
- package/dist/commands/agent/list.d.ts.map +1 -1
- package/dist/commands/agent/list.js +30 -11
- package/dist/commands/agent/list.js.map +1 -1
- package/dist/commands/audit/hierarchical-output.d.ts +6 -2
- package/dist/commands/audit/hierarchical-output.d.ts.map +1 -1
- package/dist/commands/audit/hierarchical-output.js +93 -50
- package/dist/commands/audit/hierarchical-output.js.map +1 -1
- package/dist/commands/audit-settings.d.ts +35 -0
- package/dist/commands/audit-settings.d.ts.map +1 -1
- package/dist/commands/audit-settings.js +121 -51
- package/dist/commands/audit-settings.js.map +1 -1
- package/dist/commands/audit.d.ts +97 -2
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +505 -231
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/build.d.ts +14 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +126 -32
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.d.ts +39 -2
- package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.js +114 -68
- package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
- package/dist/commands/claude/marketplace/publish.js +5 -4
- package/dist/commands/claude/marketplace/publish.js.map +1 -1
- package/dist/commands/claude/marketplace/validate.d.ts +97 -0
- package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/validate.js +157 -49
- package/dist/commands/claude/marketplace/validate.js.map +1 -1
- package/dist/commands/claude/org/skills.d.ts +11 -3
- package/dist/commands/claude/org/skills.d.ts.map +1 -1
- package/dist/commands/claude/org/skills.js +70 -20
- package/dist/commands/claude/org/skills.js.map +1 -1
- package/dist/commands/claude/org/stubs.d.ts +9 -1
- package/dist/commands/claude/org/stubs.d.ts.map +1 -1
- package/dist/commands/claude/org/stubs.js +11 -3
- package/dist/commands/claude/org/stubs.js.map +1 -1
- package/dist/commands/claude/plugin/build.d.ts +116 -0
- package/dist/commands/claude/plugin/build.d.ts.map +1 -1
- package/dist/commands/claude/plugin/build.js +173 -40
- package/dist/commands/claude/plugin/build.js.map +1 -1
- package/dist/commands/claude/plugin/marketplace-json.d.ts +36 -0
- package/dist/commands/claude/plugin/marketplace-json.d.ts.map +1 -0
- package/dist/commands/claude/plugin/marketplace-json.js +34 -0
- package/dist/commands/claude/plugin/marketplace-json.js.map +1 -0
- package/dist/commands/claude/plugin/plugin-json-merge.d.ts +30 -1
- package/dist/commands/claude/plugin/plugin-json-merge.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-json-merge.js +107 -14
- package/dist/commands/claude/plugin/plugin-json-merge.js.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.js +0 -1
- package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
- package/dist/commands/corpus/report.d.ts +22 -4
- package/dist/commands/corpus/report.d.ts.map +1 -1
- package/dist/commands/corpus/report.js +1 -0
- package/dist/commands/corpus/report.js.map +1 -1
- package/dist/commands/corpus/runner.d.ts +16 -1
- package/dist/commands/corpus/runner.d.ts.map +1 -1
- package/dist/commands/corpus/runner.js +55 -48
- package/dist/commands/corpus/runner.js.map +1 -1
- package/dist/commands/doctor.d.ts +57 -8
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +142 -67
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/inventory.d.ts +2 -0
- package/dist/commands/inventory.d.ts.map +1 -1
- package/dist/commands/inventory.js +45 -4
- package/dist/commands/inventory.js.map +1 -1
- package/dist/commands/phase-utils.d.ts +240 -11
- package/dist/commands/phase-utils.d.ts.map +1 -1
- package/dist/commands/phase-utils.js +352 -15
- package/dist/commands/phase-utils.js.map +1 -1
- package/dist/commands/rag/query-command.d.ts +40 -0
- package/dist/commands/rag/query-command.d.ts.map +1 -1
- package/dist/commands/rag/query-command.js +47 -20
- package/dist/commands/rag/query-command.js.map +1 -1
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +38 -13
- package/dist/commands/resources/index.js.map +1 -1
- package/dist/commands/resources/scan.d.ts +37 -0
- package/dist/commands/resources/scan.d.ts.map +1 -1
- package/dist/commands/resources/scan.js +47 -32
- package/dist/commands/resources/scan.js.map +1 -1
- package/dist/commands/resources/validate.d.ts +136 -1
- package/dist/commands/resources/validate.d.ts.map +1 -1
- package/dist/commands/resources/validate.js +121 -68
- package/dist/commands/resources/validate.js.map +1 -1
- package/dist/commands/skill/review.d.ts.map +1 -1
- package/dist/commands/skill/review.js +40 -23
- package/dist/commands/skill/review.js.map +1 -1
- package/dist/commands/skill/test/run.d.ts +1 -1
- package/dist/commands/skill/test/run.d.ts.map +1 -1
- package/dist/commands/skill/test/run.js +8 -6
- package/dist/commands/skill/test/run.js.map +1 -1
- package/dist/commands/skills/build.d.ts +140 -0
- package/dist/commands/skills/build.d.ts.map +1 -1
- package/dist/commands/skills/build.js +348 -94
- package/dist/commands/skills/build.js.map +1 -1
- package/dist/commands/skills/command-helpers.d.ts +6 -10
- package/dist/commands/skills/command-helpers.d.ts.map +1 -1
- package/dist/commands/skills/command-helpers.js +6 -22
- package/dist/commands/skills/command-helpers.js.map +1 -1
- package/dist/commands/skills/list.d.ts +18 -0
- package/dist/commands/skills/list.d.ts.map +1 -1
- package/dist/commands/skills/list.js +41 -15
- package/dist/commands/skills/list.js.map +1 -1
- package/dist/commands/skills/package.d.ts +17 -0
- package/dist/commands/skills/package.d.ts.map +1 -1
- package/dist/commands/skills/package.js +72 -43
- package/dist/commands/skills/package.js.map +1 -1
- package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
- package/dist/commands/skills/skill-discovery.js +9 -1
- package/dist/commands/skills/skill-discovery.js.map +1 -1
- package/dist/commands/skills/validate-command.d.ts.map +1 -1
- package/dist/commands/skills/validate-command.js +22 -6
- package/dist/commands/skills/validate-command.js.map +1 -1
- package/dist/commands/skills/validate.d.ts +79 -0
- package/dist/commands/skills/validate.d.ts.map +1 -1
- package/dist/commands/skills/validate.js +268 -79
- package/dist/commands/skills/validate.js.map +1 -1
- package/dist/commands/validate.d.ts +18 -0
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +79 -66
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/verify.d.ts +38 -1
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +247 -84
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/skill-resolution/index.d.ts +1 -1
- package/dist/skill-resolution/index.d.ts.map +1 -1
- package/dist/skill-resolution/index.js +1 -1
- package/dist/skill-resolution/index.js.map +1 -1
- package/dist/skill-resolution/packaging-config.d.ts +15 -2
- package/dist/skill-resolution/packaging-config.d.ts.map +1 -1
- package/dist/skill-resolution/packaging-config.js +39 -2
- package/dist/skill-resolution/packaging-config.js.map +1 -1
- package/dist/utils/command-error.d.ts +34 -1
- package/dist/utils/command-error.d.ts.map +1 -1
- package/dist/utils/command-error.js +32 -1
- package/dist/utils/command-error.js.map +1 -1
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +0 -2
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/help-loader.d.ts +6 -2
- package/dist/utils/help-loader.d.ts.map +1 -1
- package/dist/utils/help-loader.js +9 -16
- package/dist/utils/help-loader.js.map +1 -1
- package/dist/utils/issue-anchor.d.ts +26 -0
- package/dist/utils/issue-anchor.d.ts.map +1 -0
- package/dist/utils/issue-anchor.js +39 -0
- package/dist/utils/issue-anchor.js.map +1 -0
- package/dist/utils/issue-rendering.d.ts +149 -0
- package/dist/utils/issue-rendering.d.ts.map +1 -0
- package/dist/utils/issue-rendering.js +229 -0
- package/dist/utils/issue-rendering.js.map +1 -0
- package/dist/utils/output.d.ts +80 -9
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +138 -23
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/project-root-policy.d.ts +2 -2
- package/dist/utils/project-root-policy.js +2 -2
- package/dist/utils/relativize-paths.d.ts +45 -0
- package/dist/utils/relativize-paths.d.ts.map +1 -0
- package/dist/utils/relativize-paths.js +67 -0
- package/dist/utils/relativize-paths.js.map +1 -0
- package/dist/utils/resource-loader.d.ts +21 -2
- package/dist/utils/resource-loader.d.ts.map +1 -1
- package/dist/utils/resource-loader.js +85 -11
- package/dist/utils/resource-loader.js.map +1 -1
- package/dist/utils/skill-packaging-config.d.ts +22 -1
- package/dist/utils/skill-packaging-config.d.ts.map +1 -1
- package/dist/utils/skill-packaging-config.js +26 -0
- package/dist/utils/skill-packaging-config.js.map +1 -1
- package/dist/utils/validate-help-files.d.ts +3 -2
- package/dist/utils/validate-help-files.d.ts.map +1 -1
- package/dist/utils/validate-help-files.js +48 -5
- package/dist/utils/validate-help-files.js.map +1 -1
- package/dist/utils/verdict-helpers.d.ts +14 -5
- package/dist/utils/verdict-helpers.d.ts.map +1 -1
- package/dist/utils/verdict-helpers.js +19 -16
- package/dist/utils/verdict-helpers.js.map +1 -1
- package/docs/audit.md +40 -14
- package/docs/doctor.md +46 -10
- package/docs/index.md +1 -1
- package/docs/rag.md +9 -4
- package/docs/resources.md +54 -22
- package/docs/skills.md +11 -7
- package/package.json +12 -12
|
@@ -3,22 +3,76 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Handles SPDX shortcut identifiers (e.g., "mit" → full MIT license text)
|
|
5
5
|
* and file path references (e.g., "./LICENSE" → copy as-is).
|
|
6
|
+
*
|
|
7
|
+
* The output of {@link generateLicenseText} is written verbatim as the LICENSE
|
|
8
|
+
* file of a published marketplace, so VAT only accepts an SPDX shortcut when it
|
|
9
|
+
* carries that license's complete text. For everything else it refuses and
|
|
10
|
+
* directs the user at the file-path form — see {@link UNRENDERABLE_SPDX_IDS}.
|
|
6
11
|
*/
|
|
7
12
|
import { readFileSync } from 'node:fs';
|
|
8
13
|
import { safePath } from '@vibe-agent-toolkit/utils';
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
/** Build a lowercase-keyed lookup from canonical SPDX identifiers. */
|
|
15
|
+
function byLowercaseId(canonicalIds) {
|
|
16
|
+
return new Map(canonicalIds.map(id => [id.toLowerCase(), id]));
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Complete license texts VAT can emit, keyed by canonical SPDX identifier.
|
|
20
|
+
*
|
|
21
|
+
* This table — not a separate list of identifiers — is the source of truth for
|
|
22
|
+
* what VAT will render, so it is structurally impossible to vouch for an
|
|
23
|
+
* identifier without supplying its text. The returned string is written
|
|
24
|
+
* verbatim as the LICENSE file of a published marketplace, so every entry must
|
|
25
|
+
* be the license itself: not a summary, not a notice header.
|
|
26
|
+
*/
|
|
27
|
+
const LICENSE_TEXT_RENDERERS = {
|
|
28
|
+
MIT: (ownerName, year) => `MIT License
|
|
29
|
+
|
|
30
|
+
Copyright (c) ${year} ${ownerName}
|
|
31
|
+
|
|
32
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
33
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
34
|
+
in the Software without restriction, including without limitation the rights
|
|
35
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
36
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
37
|
+
furnished to do so, subject to the following conditions:
|
|
38
|
+
|
|
39
|
+
The above copyright notice and this permission notice shall be included in all
|
|
40
|
+
copies or substantial portions of the Software.
|
|
41
|
+
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
43
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
44
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
45
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
46
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
47
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
48
|
+
SOFTWARE.
|
|
49
|
+
`,
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* SPDX identifiers VAT embeds the complete license text for.
|
|
53
|
+
*
|
|
54
|
+
* Derived from {@link LICENSE_TEXT_RENDERERS} so the two can never disagree.
|
|
55
|
+
*/
|
|
56
|
+
export const RENDERABLE_SPDX_IDS = byLowercaseId(Object.keys(LICENSE_TEXT_RENDERERS));
|
|
57
|
+
/**
|
|
58
|
+
* SPDX identifiers VAT recognizes but refuses to render.
|
|
59
|
+
*
|
|
60
|
+
* VAT carries no vetted copy of these texts, and a summary or a notice header
|
|
61
|
+
* is not a license: GPL-3.0 §4 and Apache-2.0 §4(a) both require conveying a
|
|
62
|
+
* copy of the License with the work. Listing them here buys a specific,
|
|
63
|
+
* actionable error instead of a generic "unknown identifier".
|
|
64
|
+
*/
|
|
65
|
+
export const UNRENDERABLE_SPDX_IDS = byLowercaseId([
|
|
66
|
+
'Apache-2.0',
|
|
67
|
+
'GPL-2.0',
|
|
68
|
+
'GPL-3.0',
|
|
69
|
+
'LGPL-2.1',
|
|
70
|
+
'LGPL-3.0',
|
|
71
|
+
'BSD-2-Clause',
|
|
72
|
+
'BSD-3-Clause',
|
|
73
|
+
'ISC',
|
|
74
|
+
'MPL-2.0',
|
|
75
|
+
'Unlicense',
|
|
22
76
|
]);
|
|
23
77
|
/**
|
|
24
78
|
* Check if a license value looks like a file path.
|
|
@@ -35,10 +89,39 @@ export function isFilePath(value) {
|
|
|
35
89
|
return /\.[^\d]/.test(value);
|
|
36
90
|
}
|
|
37
91
|
/**
|
|
38
|
-
* Check if a value is
|
|
92
|
+
* Check if a value is an SPDX identifier VAT can turn into a complete LICENSE
|
|
93
|
+
* file (case-insensitive).
|
|
94
|
+
*
|
|
95
|
+
* `true` here is a promise that {@link generateLicenseText} will produce the
|
|
96
|
+
* full license text, not a summary of it.
|
|
39
97
|
*/
|
|
40
98
|
export function isSpdxIdentifier(value) {
|
|
41
|
-
return
|
|
99
|
+
return RENDERABLE_SPDX_IDS.has(value.toLowerCase());
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Explain why a license value cannot be turned into a LICENSE file, or return
|
|
103
|
+
* undefined when it can.
|
|
104
|
+
*
|
|
105
|
+
* Shared by every caller so the diagnosis is identical whether the value is
|
|
106
|
+
* rejected during option parsing or during tree composition.
|
|
107
|
+
*/
|
|
108
|
+
export function explainUnusableLicense(value) {
|
|
109
|
+
const id = value.toLowerCase();
|
|
110
|
+
if (RENDERABLE_SPDX_IDS.has(id)) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
const canonical = UNRENDERABLE_SPDX_IDS.get(id);
|
|
114
|
+
if (canonical !== undefined) {
|
|
115
|
+
return (`VAT cannot generate the full text of the "${value}" license. ` +
|
|
116
|
+
`Emitting a summary or a notice header would produce a legally void LICENSE ` +
|
|
117
|
+
`file — most licenses require that a complete copy be conveyed with the work. ` +
|
|
118
|
+
`Download the official text from https://spdx.org/licenses/${canonical}.html ` +
|
|
119
|
+
`and set \`license\` to its file path instead (e.g. ./LICENSE).`);
|
|
120
|
+
}
|
|
121
|
+
const renderable = [...RENDERABLE_SPDX_IDS.keys()].join(', ');
|
|
122
|
+
return (`"${value}" is neither an SPDX identifier VAT can generate nor a file path. ` +
|
|
123
|
+
`Set \`license\` to a LICENSE file path (e.g. ./LICENSE), ` +
|
|
124
|
+
`or to one of: ${renderable}.`);
|
|
42
125
|
}
|
|
43
126
|
/**
|
|
44
127
|
* Read a license file from disk.
|
|
@@ -49,58 +132,25 @@ export function readLicenseFile(filePath, baseDir) {
|
|
|
49
132
|
return readFileSync(resolved, 'utf-8');
|
|
50
133
|
}
|
|
51
134
|
/**
|
|
52
|
-
* Generate
|
|
135
|
+
* Generate the complete license text for a renderable SPDX identifier.
|
|
136
|
+
*
|
|
137
|
+
* @throws when the identifier is not in {@link RENDERABLE_SPDX_IDS} — including
|
|
138
|
+
* for identifiers VAT recognizes but has no vetted text for. Producing a
|
|
139
|
+
* plausible-looking stub is worse than refusing: the caller writes this
|
|
140
|
+
* string straight to disk as LICENSE.
|
|
53
141
|
*/
|
|
54
142
|
export function generateLicenseText(spdxId, ownerName, year) {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return `MIT License
|
|
59
|
-
|
|
60
|
-
Copyright (c) ${year} ${ownerName}
|
|
61
|
-
|
|
62
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
63
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
64
|
-
in the Software without restriction, including without limitation the rights
|
|
65
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
66
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
67
|
-
furnished to do so, subject to the following conditions:
|
|
68
|
-
|
|
69
|
-
The above copyright notice and this permission notice shall be included in all
|
|
70
|
-
copies or substantial portions of the Software.
|
|
71
|
-
|
|
72
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
73
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
74
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
75
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
76
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
77
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
78
|
-
SOFTWARE.
|
|
79
|
-
`;
|
|
80
|
-
case 'apache-2.0':
|
|
81
|
-
return `Copyright ${year} ${ownerName}
|
|
82
|
-
|
|
83
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
84
|
-
you may not use this file except in compliance with the License.
|
|
85
|
-
You may obtain a copy of the License at
|
|
86
|
-
|
|
87
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
88
|
-
|
|
89
|
-
Unless required by applicable law or agreed to in writing, software
|
|
90
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
91
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
92
|
-
See the License for the specific language governing permissions and
|
|
93
|
-
limitations under the License.
|
|
94
|
-
`;
|
|
95
|
-
default:
|
|
96
|
-
if (!KNOWN_SPDX_IDS.has(id)) {
|
|
97
|
-
throw new Error(`Unknown SPDX license identifier: "${spdxId}". Use a file path instead.`);
|
|
98
|
-
}
|
|
99
|
-
return `This software is licensed under the ${spdxId} license.
|
|
100
|
-
|
|
101
|
-
Copyright (c) ${year} ${ownerName}
|
|
102
|
-
`;
|
|
143
|
+
const problem = explainUnusableLicense(spdxId);
|
|
144
|
+
if (problem !== undefined) {
|
|
145
|
+
throw new Error(problem);
|
|
103
146
|
}
|
|
147
|
+
const canonical = RENDERABLE_SPDX_IDS.get(spdxId.toLowerCase()) ?? '';
|
|
148
|
+
const render = LICENSE_TEXT_RENDERERS[canonical];
|
|
149
|
+
if (render === undefined) {
|
|
150
|
+
// Unreachable while RENDERABLE_SPDX_IDS is derived from the renderer table.
|
|
151
|
+
throw new Error(`No license text renderer registered for "${spdxId}".`);
|
|
152
|
+
}
|
|
153
|
+
return render(ownerName, year);
|
|
104
154
|
}
|
|
105
155
|
/**
|
|
106
156
|
* Resolve a license config value to LICENSE file content.
|
|
@@ -114,10 +164,6 @@ export function resolveLicense(licenseValue, ownerName, baseDir) {
|
|
|
114
164
|
if (isFilePath(licenseValue)) {
|
|
115
165
|
return readLicenseFile(licenseValue, baseDir);
|
|
116
166
|
}
|
|
117
|
-
if (!isSpdxIdentifier(licenseValue)) {
|
|
118
|
-
throw new Error(`"${licenseValue}" is neither a known SPDX identifier nor a file path. ` +
|
|
119
|
-
`Use a known identifier (mit, apache-2.0, etc.) or a file path (./LICENSE).`);
|
|
120
|
-
}
|
|
121
167
|
return generateLicenseText(licenseValue, ownerName, new Date().getFullYear());
|
|
122
168
|
}
|
|
123
169
|
//# sourceMappingURL=license-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"license-utils.js","sourceRoot":"","sources":["../../../../src/commands/claude/marketplace/license-utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"license-utils.js","sourceRoot":"","sources":["../../../../src/commands/claude/marketplace/license-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,sEAAsE;AACtE,SAAS,aAAa,CAAC,YAA+B;IACpD,OAAO,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AAKD;;;;;;;;GAQG;AACH,MAA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OAAO,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,mBAAmB,CAAC,YAAY,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { writeYamlOutput } from '../../../utils/output.js';
|
|
|
14
14
|
import { redactUrlCredentials } from '../../../utils/url-redact.js';
|
|
15
15
|
import { loadClaudeProjectConfig } from '../claude-config.js';
|
|
16
16
|
import { createCommitMessage, publishToGitBranch } from './git-publish.js';
|
|
17
|
-
import {
|
|
17
|
+
import { explainUnusableLicense, isFilePath } from './license-utils.js';
|
|
18
18
|
import { composePublishTree } from './publish-tree.js';
|
|
19
19
|
export function createMarketplacePublishCommand() {
|
|
20
20
|
const command = new Command('publish');
|
|
@@ -78,10 +78,11 @@ function resolveLicenseOptions(licenseValue, ownerName) {
|
|
|
78
78
|
if (isFilePath(licenseValue)) {
|
|
79
79
|
return { type: 'file', filePath: licenseValue };
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
const problem = explainUnusableLicense(licenseValue);
|
|
82
|
+
if (problem !== undefined) {
|
|
83
|
+
throw new Error(problem);
|
|
83
84
|
}
|
|
84
|
-
|
|
85
|
+
return { type: 'spdx', value: licenseValue, ownerName };
|
|
85
86
|
}
|
|
86
87
|
/**
|
|
87
88
|
* Build ComposeOptions for a single marketplace entry.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../../src/commands/claude/marketplace/publish.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAItC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EA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,CAAC,4CAA4C,CACjD,CAAC;QACJ,CAAC;QAED,eAAe,CAAC;YACd,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,OAAO;SACnB,CAAC,CAAC;QAEH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,CAAC,CAAC;IACrE,CAAC;AACH,CAAC"}
|
|
@@ -8,6 +8,103 @@
|
|
|
8
8
|
* - README.md should exist (warning)
|
|
9
9
|
* - CHANGELOG.md should exist (warning)
|
|
10
10
|
*/
|
|
11
|
+
import { type SeverityCounts, type ValidationIssue } from '@vibe-agent-toolkit/agent-schema';
|
|
12
|
+
import { type ValidationResult } from '@vibe-agent-toolkit/agent-skills';
|
|
11
13
|
import { Command } from 'commander';
|
|
14
|
+
import { type FindingCountSummary } from '../../../utils/issue-rendering.js';
|
|
15
|
+
/** Every finding the command reports, all anchored at one marketplace root. */
|
|
16
|
+
export interface MarketplaceFindings {
|
|
17
|
+
marketplaceResult: ValidationResult;
|
|
18
|
+
/** Empty when the manifest failed: the run bails before reaching plugins. */
|
|
19
|
+
pluginResults: ValidationResult[];
|
|
20
|
+
/** Manifest, required-file, plugin and skill issues, in report order. */
|
|
21
|
+
issues: ValidationIssue[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Run every validator this command reports on, each anchored at
|
|
25
|
+
* `marketplacePath`.
|
|
26
|
+
*
|
|
27
|
+
* Anchoring is what makes this one function rather than four call sites in the
|
|
28
|
+
* command body. Unlike `path`, an issue `location` cannot be re-based at the
|
|
29
|
+
* document boundary — `relative()` is not idempotent, so an already-relative
|
|
30
|
+
* value is indistinguishable from an absolute one and re-basing it yields
|
|
31
|
+
* nonsense. "Relative to what?" therefore has to be answered identically by
|
|
32
|
+
* every producer at the moment it emits, and answering it in four places is how
|
|
33
|
+
* three producers agreed and the fourth silently anchored at the enclosing
|
|
34
|
+
* PROJECT root instead — putting two coordinate systems in one document, where
|
|
35
|
+
* `join(root, location)` resolved for some findings and named nothing for
|
|
36
|
+
* others.
|
|
37
|
+
*
|
|
38
|
+
* Exported so that contract is testable against a real marketplace without a
|
|
39
|
+
* CLI spawn; the command adds only the exit code and the emission.
|
|
40
|
+
*/
|
|
41
|
+
export declare function collectMarketplaceFindings(marketplacePath: string): Promise<MarketplaceFindings>;
|
|
42
|
+
/** Everything the emitted report is built from. */
|
|
43
|
+
export interface MarketplaceValidateReportInput {
|
|
44
|
+
status: 'success' | 'warning' | 'error';
|
|
45
|
+
/**
|
|
46
|
+
* The marketplace directory: the ONE base every reported `path` AND every
|
|
47
|
+
* issue `location` is relative to.
|
|
48
|
+
*
|
|
49
|
+
* `location` is the half that has to be got right upstream. This builder
|
|
50
|
+
* re-bases `path` (producers hand over absolute paths on purpose), but it
|
|
51
|
+
* cannot re-base a `location` — re-basing is not idempotent, so a location
|
|
52
|
+
* that arrived anchored elsewhere is indistinguishable from a correct one.
|
|
53
|
+
* Every producer feeding this report must therefore already have been told
|
|
54
|
+
* this root: `validatePlugin`/`validateSkill` via `locationRoot`,
|
|
55
|
+
* `checkMarketplaceFiles` via `issueLocation`.
|
|
56
|
+
*/
|
|
57
|
+
root: string;
|
|
58
|
+
marketplace: ValidationResult['metadata'];
|
|
59
|
+
pluginResults: readonly ValidationResult[];
|
|
60
|
+
issues: readonly ValidationIssue[];
|
|
61
|
+
issueCounts: SeverityCounts;
|
|
62
|
+
summary: string;
|
|
63
|
+
duration: string;
|
|
64
|
+
/**
|
|
65
|
+
* Publish the flat per-issue list instead of the per-location summary.
|
|
66
|
+
*
|
|
67
|
+
* Picks the UNIT of the `issues` listing, not the content: everything else in
|
|
68
|
+
* the document is a total about the run and is identical in both modes.
|
|
69
|
+
* Optional, and absent means the summary — a caller with no opinion gets the
|
|
70
|
+
* readable form rather than the corpus-scale one.
|
|
71
|
+
*/
|
|
72
|
+
verbose?: boolean;
|
|
73
|
+
}
|
|
74
|
+
/** One inspected asset's DEFAULT row: where, how many, of what code. */
|
|
75
|
+
export type LocationIssueSummary = FindingCountSummary & {
|
|
76
|
+
/** The asset, relative to the report's `root`. Absent iff `unlocated`. */
|
|
77
|
+
location?: string;
|
|
78
|
+
/** Set instead of `location` when the findings named no file at all. */
|
|
79
|
+
unlocated?: true;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Collapse a flat finding list onto one counts-only row per `location`.
|
|
83
|
+
*
|
|
84
|
+
* `location` is this command's per-asset unit: `plugins/alpha/.claude-plugin/
|
|
85
|
+
* plugin.json`, `plugins/beta/skills/x/SKILL.md`. Rows come out in first-seen
|
|
86
|
+
* order, and a location with no findings has no row — there is nothing to
|
|
87
|
+
* filter here, because a location only exists in this listing by having emitted
|
|
88
|
+
* something.
|
|
89
|
+
*
|
|
90
|
+
* Every value is passed through un-rebased: `location` is already relative to
|
|
91
|
+
* the report's stated `root`, and `relative()` is not idempotent (see
|
|
92
|
+
* {@link MarketplaceValidateReportInput.root}).
|
|
93
|
+
*/
|
|
94
|
+
export declare function summarizeIssuesByLocation(issues: readonly ValidationIssue[]): LocationIssueSummary[];
|
|
95
|
+
/**
|
|
96
|
+
* Build the report `vat claude marketplace validate` publishes on stdout.
|
|
97
|
+
*
|
|
98
|
+
* Pure — returns the document rather than writing it — so the emitted shape,
|
|
99
|
+
* `path` included, is under unit test instead of only under a CLI spawn. One
|
|
100
|
+
* builder serves both exits (manifest-missing bail and full run) so the
|
|
101
|
+
* document has a single shape either way.
|
|
102
|
+
*
|
|
103
|
+
* Being pure is also the limit of what it can guarantee: it re-bases `path`,
|
|
104
|
+
* and passes `issues` through verbatim. The single-coordinate-system property
|
|
105
|
+
* is therefore only as true as its inputs — see `root` above — and is enforced
|
|
106
|
+
* against a real marketplace in `payload-path-coordinates.test.ts`, not here.
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildMarketplaceValidateReport(input: MarketplaceValidateReportInput): Record<string, unknown>;
|
|
12
109
|
export declare function createMarketplaceValidateCommand(): Command;
|
|
13
110
|
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/commands/claude/marketplace/validate.ts"],"names":[],"mappings":"AACA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/commands/claude/marketplace/validate.ts"],"names":[],"mappings":"AACA;;;;;;;;;GASG;AAKH,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAqB,KAAK,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AA+FhG,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,EAAE,gBAAgB,CAAC;IACpC,6EAA6E;IAC7E,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,yEAAyE;IACzE,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,0BAA0B,CAC9C,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,mBAAmB,CAAC,CAkB9B;AAED,mDAAmD;AACnD,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACxC;;;;;;;;;;;OAWG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC1C,aAAa,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC3C,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;IACnC,WAAW,EAAE,cAAc,CAAC;IAC5B,OAAO,EAAE,MAAM,CA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