impeccable 3.5.0 → 3.6.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.
@@ -206,10 +206,10 @@ function parseIgnoreColor(value) {
206
206
  if (rgb) {
207
207
  const parts = splitColorArgs(rgb[1]);
208
208
  if (parts.length < 3 || parts.length > 4) return null;
209
- const r = parseRgbChannel(parts[0]);
210
- const g = parseRgbChannel(parts[1]);
211
- const b = parseRgbChannel(parts[2]);
212
- const a = parts[3] === undefined ? 1 : parseAlphaChannel(parts[3]);
209
+ const r = parseColorChannel(parts[0], COLOR_CHANNEL_FORMATS.rgb);
210
+ const g = parseColorChannel(parts[1], COLOR_CHANNEL_FORMATS.rgb);
211
+ const b = parseColorChannel(parts[2], COLOR_CHANNEL_FORMATS.rgb);
212
+ const a = parts[3] === undefined ? 1 : parseColorChannel(parts[3], COLOR_CHANNEL_FORMATS.alpha);
213
213
  if ([r, g, b, a].some((v) => v === null)) return null;
214
214
  return { r, g, b, a };
215
215
  }
@@ -218,10 +218,10 @@ function parseIgnoreColor(value) {
218
218
  if (hsl) {
219
219
  const parts = splitColorArgs(hsl[1]);
220
220
  if (parts.length < 3 || parts.length > 4) return null;
221
- const h = parseHueChannel(parts[0]);
222
- const s = parsePercentChannel(parts[1]);
223
- const l = parsePercentChannel(parts[2]);
224
- const a = parts[3] === undefined ? 1 : parseAlphaChannel(parts[3]);
221
+ const h = parseColorChannel(parts[0], COLOR_CHANNEL_FORMATS.hue);
222
+ const s = parseColorChannel(parts[1], COLOR_CHANNEL_FORMATS.percent);
223
+ const l = parseColorChannel(parts[2], COLOR_CHANNEL_FORMATS.percent);
224
+ const a = parts[3] === undefined ? 1 : parseColorChannel(parts[3], COLOR_CHANNEL_FORMATS.alpha);
225
225
  if ([h, s, l, a].some((v) => v === null)) return null;
226
226
  return hslToRgb(h, s, l, a);
227
227
  }
@@ -230,18 +230,13 @@ function parseIgnoreColor(value) {
230
230
  }
231
231
 
232
232
  function parseHexIgnoreColor(hex) {
233
- if (hex.length === 3 || hex.length === 4) {
234
- const r = parseInt(hex[0] + hex[0], 16);
235
- const g = parseInt(hex[1] + hex[1], 16);
236
- const b = parseInt(hex[2] + hex[2], 16);
237
- const a = hex.length === 4 ? parseInt(hex[3] + hex[3], 16) / 255 : 1;
238
- return { r, g, b, a };
239
- }
240
- const r = parseInt(hex.slice(0, 2), 16);
241
- const g = parseInt(hex.slice(2, 4), 16);
242
- const b = parseInt(hex.slice(4, 6), 16);
243
- const a = hex.length === 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1;
244
- return { r, g, b, a };
233
+ const expanded = hex.length <= 4
234
+ ? [...hex].map((digit) => digit.repeat(2)).join('')
235
+ : hex;
236
+ const [r, g, b, alpha = 255] = expanded
237
+ .match(/../g)
238
+ .map((channel) => Number.parseInt(channel, 16));
239
+ return { r, g, b, a: alpha / 255 };
245
240
  }
246
241
 
247
242
  function splitColorArgs(body) {
@@ -259,47 +254,34 @@ function splitColorArgs(body) {
259
254
  return text.replace(/\s*\/\s*/g, ' / ').split(/\s+/).filter((part) => part && part !== '/');
260
255
  }
261
256
 
262
- function parseRgbChannel(raw) {
263
- const text = String(raw || '').trim();
264
- const match = text.match(/^(-?\d*\.?\d+)(%)?$/);
265
- if (!match) return null;
266
- const value = Number.parseFloat(match[1]);
267
- if (!Number.isFinite(value)) return null;
268
- const scaled = match[2] ? value * 2.55 : value;
269
- if (scaled < 0 || scaled > 255) return null;
270
- return Math.round(scaled);
271
- }
272
-
273
- function parseAlphaChannel(raw) {
274
- const text = String(raw || '').trim();
275
- const match = text.match(/^(-?\d*\.?\d+)(%)?$/);
276
- if (!match) return null;
277
- const value = Number.parseFloat(match[1]);
278
- if (!Number.isFinite(value)) return null;
279
- const alpha = match[2] ? value / 100 : value;
280
- return alpha >= 0 && alpha <= 1 ? alpha : null;
281
- }
282
-
283
- function parseHueChannel(raw) {
284
- const text = String(raw || '').trim();
285
- const match = text.match(/^(-?\d*\.?\d+)(deg|rad|turn|grad)?$/);
286
- if (!match) return null;
287
- const value = Number.parseFloat(match[1]);
288
- if (!Number.isFinite(value)) return null;
289
- const unit = match[2] || 'deg';
290
- if (unit === 'turn') return value * 360;
291
- if (unit === 'rad') return value * (180 / Math.PI);
292
- if (unit === 'grad') return value * 0.9;
293
- return value;
294
- }
295
-
296
- function parsePercentChannel(raw) {
257
+ const CSS_NUMBER_RE = /^(-?\d*\.?\d+)(%|deg|rad|turn|grad)?$/;
258
+ const identity = (value) => value;
259
+ const COLOR_CHANNEL_FORMATS = {
260
+ rgb: { units: { '': identity, '%': (value) => value * 2.55 }, min: 0, max: 255, round: true },
261
+ alpha: { units: { '': identity, '%': (value) => value / 100 }, min: 0, max: 1 },
262
+ hue: {
263
+ units: {
264
+ '': identity,
265
+ deg: identity,
266
+ rad: (value) => value * (180 / Math.PI),
267
+ turn: (value) => value * 360,
268
+ grad: (value) => value * 0.9,
269
+ },
270
+ },
271
+ percent: { units: { '%': (value) => value / 100 }, min: 0, max: 1 },
272
+ };
273
+
274
+ function parseColorChannel(raw, { units, min = -Infinity, max = Infinity, round = false }) {
297
275
  const text = String(raw || '').trim();
298
- const match = text.match(/^(-?\d*\.?\d+)%$/);
276
+ const match = text.match(CSS_NUMBER_RE);
299
277
  if (!match) return null;
300
- const value = Number.parseFloat(match[1]);
301
- if (!Number.isFinite(value)) return null;
302
- return value >= 0 && value <= 100 ? value / 100 : null;
278
+ const convert = units[match[2] || ''];
279
+ if (!convert) return null;
280
+ const number = Number.parseFloat(match[1]);
281
+ if (!Number.isFinite(number)) return null;
282
+ const value = convert(number);
283
+ if (value < min || value > max) return null;
284
+ return round ? Math.round(value) : value;
303
285
  }
304
286
 
305
287
  function hslToRgb(hue, saturation, lightness, alpha) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impeccable",
3
- "version": "3.5.0",
3
+ "version": "3.6.1",
4
4
  "author": "Paul Bakaus",
5
5
  "description": "Design skills, commands, and anti-pattern detection for AI coding agents",
6
6
  "keywords": [
@@ -24,7 +24,7 @@
24
24
  "url": "git+https://github.com/pbakaus/impeccable.git"
25
25
  },
26
26
  "engines": {
27
- "node": ">=22.12.0"
27
+ "node": ">=22.18.0"
28
28
  },
29
29
  "type": "module",
30
30
  "bin": {
@@ -56,6 +56,7 @@
56
56
  "test:live": "node scripts/run-tests.mjs live",
57
57
  "test:cli-e2e": "node scripts/run-tests.mjs cli-e2e",
58
58
  "test:cli-remote-e2e": "node scripts/run-tests.mjs cli-remote-e2e",
59
+ "test:plugin-e2e": "node scripts/run-tests.mjs plugin-e2e",
59
60
  "test:live-e2e": "node scripts/run-tests.mjs live-e2e",
60
61
  "test:live-e2e-accept-cleanup": "node scripts/run-tests.mjs live-e2e-accept-cleanup",
61
62
  "test:new-work-e2e": "node scripts/run-tests.mjs new-work-e2e",
@@ -88,8 +89,8 @@
88
89
  "@ai-sdk/google": "^4.0.8",
89
90
  "@ai-sdk/openai": "^4.0.7",
90
91
  "@anthropic-ai/claude-agent-sdk": "^0.3.165",
91
- "@anthropic-ai/sdk": "^0.115.0",
92
- "@babel/parser": "^7.29.3",
92
+ "@anthropic-ai/sdk": "^0.122.0",
93
+ "@babel/parser": "^8.0.4",
93
94
  "ai": "^7.0.14",
94
95
  "archiver": "^8.0.0",
95
96
  "playwright": "^1.59.1",