@qvac/harness 0.8.10 → 0.8.11
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 +12 -1
- package/dist-lib/lib/tools/skills/cli-argv.js +25 -5
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,16 @@ While the major version is `0`, a breaking change bumps the minor version.
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [0.8.11] - 2026-10-16
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- A skill CLI call the schema rejects names what the command accepts: an
|
|
16
|
+
`unknown parameter`, `unknown flag` or `unexpected argument` error now ends
|
|
17
|
+
with the node's parameters or subcommands, e.g.
|
|
18
|
+
`unknown parameter "title"; create takes: name, path, …`. The message
|
|
19
|
+
prefixes are unchanged. (#523)
|
|
20
|
+
|
|
11
21
|
## [0.8.10] - 2026-10-16
|
|
12
22
|
|
|
13
23
|
### Added
|
|
@@ -2068,7 +2078,8 @@ Install 0.2.12 or later to get them.
|
|
|
2068
2078
|
- Every dependency installs from the public npm registry: GPU stats are read
|
|
2069
2079
|
through `bare-gpu-info`. (#12)
|
|
2070
2080
|
|
|
2071
|
-
[Unreleased]: https://github.com/tetherto/qvac-harness/compare/v0.8.
|
|
2081
|
+
[Unreleased]: https://github.com/tetherto/qvac-harness/compare/v0.8.11...HEAD
|
|
2082
|
+
[0.8.11]: https://github.com/tetherto/qvac-harness/compare/v0.8.10...v0.8.11
|
|
2072
2083
|
[0.8.10]: https://github.com/tetherto/qvac-harness/compare/v0.8.9...v0.8.10
|
|
2073
2084
|
[0.8.9]: https://github.com/tetherto/qvac-harness/compare/v0.8.8...v0.8.9
|
|
2074
2085
|
[0.8.8]: https://github.com/tetherto/qvac-harness/compare/v0.8.7...v0.8.8
|
|
@@ -19,7 +19,7 @@ export function walkCommands(argv, schema) {
|
|
|
19
19
|
}
|
|
20
20
|
export function argvToObject(argv, schema) {
|
|
21
21
|
const { node, pathSegs, index } = walkCommands(argv, schema);
|
|
22
|
-
const leaf = parseParams(argv.slice(index), node);
|
|
22
|
+
const leaf = parseParams(argv.slice(index), node, pathSegs.join(' '));
|
|
23
23
|
if (typeof leaf === 'string') {
|
|
24
24
|
return leaf;
|
|
25
25
|
}
|
|
@@ -52,7 +52,27 @@ function flagParts(tok) {
|
|
|
52
52
|
}
|
|
53
53
|
return { key: body.slice(0, ieq), inline: body.slice(ieq + 1) };
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function accepted(schema, command) {
|
|
56
|
+
const commands = [];
|
|
57
|
+
const params = [];
|
|
58
|
+
for (const [key, prop] of Object.entries(objectProps(schema))) {
|
|
59
|
+
if (isObjectSchema(prop)) {
|
|
60
|
+
commands.push(key);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
params.push(key);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const parts = [];
|
|
67
|
+
if (commands.length) {
|
|
68
|
+
parts.push(`commands: ${commands.join(', ')}`);
|
|
69
|
+
}
|
|
70
|
+
if (params.length) {
|
|
71
|
+
parts.push(`${command || 'it'} takes: ${params.join(', ')}`);
|
|
72
|
+
}
|
|
73
|
+
return parts.length ? `; ${parts.join('; ')}` : '';
|
|
74
|
+
}
|
|
75
|
+
function parseParams(tokens, schema, command) {
|
|
56
76
|
const props = objectProps(schema);
|
|
57
77
|
const propSchemas = new Map(Object.entries(props));
|
|
58
78
|
const boolKeys = new Set(Object.entries(props)
|
|
@@ -77,7 +97,7 @@ function parseParams(tokens, schema) {
|
|
|
77
97
|
continue;
|
|
78
98
|
}
|
|
79
99
|
if (!canAbsorb) {
|
|
80
|
-
return `unknown parameter "${key}"`;
|
|
100
|
+
return `unknown parameter "${key}"${accepted(schema, command)}`;
|
|
81
101
|
}
|
|
82
102
|
}
|
|
83
103
|
const flag = tok.startsWith('-') ? flagParts(tok) : null;
|
|
@@ -103,7 +123,7 @@ function parseParams(tokens, schema) {
|
|
|
103
123
|
continue;
|
|
104
124
|
}
|
|
105
125
|
if (flag && !canAbsorb) {
|
|
106
|
-
return `unknown flag "--${flag.key}"`;
|
|
126
|
+
return `unknown flag "--${flag.key}"${accepted(schema, command)}`;
|
|
107
127
|
}
|
|
108
128
|
if (boolKeys.has(tok)) {
|
|
109
129
|
out[tok] = true;
|
|
@@ -131,7 +151,7 @@ function parseParams(tokens, schema) {
|
|
|
131
151
|
i++;
|
|
132
152
|
continue;
|
|
133
153
|
}
|
|
134
|
-
return `unexpected argument "${tok}"`;
|
|
154
|
+
return `unexpected argument "${tok}"${accepted(schema, command)}`;
|
|
135
155
|
}
|
|
136
156
|
if (restName && restVals.length > 0) {
|
|
137
157
|
out[restName] = restVals;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qvac/harness",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"bare": ">=1.34.0"
|
|
@@ -789,7 +789,7 @@
|
|
|
789
789
|
"@qvac/langdetect-text": "^0.1.2",
|
|
790
790
|
"@qvac/logging": "0.1.1",
|
|
791
791
|
"@qvac/sdk": "^0.21.0",
|
|
792
|
-
"@qvac/skills": "0.1.
|
|
792
|
+
"@qvac/skills": "^0.1.16",
|
|
793
793
|
"@xmldom/xmldom": "^0.9.12",
|
|
794
794
|
"asenion": "^0.1.0",
|
|
795
795
|
"b4a": "^1.9.0",
|