@andrian.yablonskyy/thub-agent 1.0.25 → 1.0.26

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/cli.js +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrian.yablonskyy/thub-agent",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "TestHub Agent CLI — the single entry point CI/CD and developers use to submit and follow test jobs",
5
5
  "bin": {
6
6
  "thub": "./src/cli.js"
@@ -12,7 +12,7 @@
12
12
  "lint:fix": "eslint . --fix"
13
13
  },
14
14
  "dependencies": {
15
- "@andrian.yablonskyy/thub-common": "*",
15
+ "@andrian.yablonskyy/thub-common": "^1.0.26",
16
16
  "commander": "^13.1.0"
17
17
  },
18
18
  "devDependencies": {
package/src/cli.js CHANGED
@@ -108,6 +108,17 @@ function usageError(message){
108
108
 
109
109
  function fail(err){
110
110
  console.error(`Error: ${err.message}`);
111
+ // The Coordinator validates the spec with its own thub-common: an unknown
112
+ // field means it's older than this Agent.
113
+ if (/Invalid job spec.*must NOT have additional properties/.test(err.message)){
114
+ let url = 'the configured URL';
115
+ try {
116
+ ({ url } = resolveConnection(program.opts()));
117
+ }
118
+ catch { /* keep the generic wording */ }
119
+ console.error(`Hint: the Coordinator at ${url} doesn't know an option ` +
120
+ `this Agent (v${version}) sent — update the Coordinator (dashboard → Update app, or npm i -g @andrian.yablonskyy/thub-coordinator@latest).`);
121
+ }
111
122
  process.exit(err.status && Number.isInteger(err.status) && err.status < 100 ? err.status : EXIT_CODES.USAGE);
112
123
  }
113
124