@argus-design/protocol 2026.4.12
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/dist/index.d.mts +468 -0
- package/dist/index.d.ts +468 -0
- package/dist/index.js +309 -0
- package/dist/index.mjs +265 -0
- package/package.json +26 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
ARGUS_DIR: () => ARGUS_DIR,
|
|
24
|
+
ARGUS_VERSION: () => ARGUS_VERSION,
|
|
25
|
+
CONTRAST_THRESHOLDS: () => CONTRAST_THRESHOLDS,
|
|
26
|
+
DEFAULT_CONFIG: () => DEFAULT_CONFIG,
|
|
27
|
+
DEFAULT_GATEWAY_PORT: () => DEFAULT_GATEWAY_PORT,
|
|
28
|
+
DEFAULT_MCP_PORT: () => DEFAULT_MCP_PORT,
|
|
29
|
+
DEFAULT_THRESHOLD: () => DEFAULT_THRESHOLD,
|
|
30
|
+
GRADE_BOUNDARIES: () => GRADE_BOUNDARIES,
|
|
31
|
+
MAX_ELEMENTS: () => MAX_ELEMENTS,
|
|
32
|
+
MAX_TEXT_LENGTH: () => MAX_TEXT_LENGTH,
|
|
33
|
+
MCP_TOOLS: () => MCP_TOOLS,
|
|
34
|
+
RULE_CATEGORIES: () => RULE_CATEGORIES,
|
|
35
|
+
SPACING_SCALE: () => SPACING_SCALE,
|
|
36
|
+
TOUCH_TARGETS: () => TOUCH_TARGETS,
|
|
37
|
+
TYPE_SCALE_RATIOS: () => TYPE_SCALE_RATIOS,
|
|
38
|
+
err: () => err,
|
|
39
|
+
ok: () => ok,
|
|
40
|
+
scoreToGrade: () => scoreToGrade
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(index_exports);
|
|
43
|
+
|
|
44
|
+
// src/types.ts
|
|
45
|
+
function ok(value) {
|
|
46
|
+
return { ok: true, value };
|
|
47
|
+
}
|
|
48
|
+
function err(error) {
|
|
49
|
+
return { ok: false, error };
|
|
50
|
+
}
|
|
51
|
+
var RULE_CATEGORIES = [
|
|
52
|
+
"spacing",
|
|
53
|
+
"typography",
|
|
54
|
+
"color",
|
|
55
|
+
"hierarchy",
|
|
56
|
+
"accessibility",
|
|
57
|
+
"consistency"
|
|
58
|
+
];
|
|
59
|
+
var MCP_TOOLS = [
|
|
60
|
+
{
|
|
61
|
+
name: "design.inspect",
|
|
62
|
+
description: "Analyze a page or component's visual structure. Returns element positions, computed styles, accessibility data, and structural relationships.",
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: "object",
|
|
65
|
+
properties: {
|
|
66
|
+
url: {
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "URL to inspect"
|
|
69
|
+
},
|
|
70
|
+
selector: {
|
|
71
|
+
type: "string",
|
|
72
|
+
description: "CSS selector to scope inspection"
|
|
73
|
+
},
|
|
74
|
+
html: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "Raw HTML string to inspect"
|
|
77
|
+
},
|
|
78
|
+
maxElements: {
|
|
79
|
+
type: "number",
|
|
80
|
+
description: "Maximum elements to inspect (default: 500)"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "design.score",
|
|
87
|
+
description: "Score design quality against established principles. Returns per-rule findings, category scores, and aggregate score (0-100).",
|
|
88
|
+
inputSchema: {
|
|
89
|
+
type: "object",
|
|
90
|
+
properties: {
|
|
91
|
+
snapshot: {
|
|
92
|
+
type: "object",
|
|
93
|
+
description: "PageSnapshot from design.inspect"
|
|
94
|
+
},
|
|
95
|
+
categories: {
|
|
96
|
+
type: "array",
|
|
97
|
+
items: { type: "string" },
|
|
98
|
+
description: "Categories to score (default: all). Options: spacing, typography, color, hierarchy, accessibility, consistency"
|
|
99
|
+
},
|
|
100
|
+
threshold: {
|
|
101
|
+
type: "number",
|
|
102
|
+
description: "Minimum acceptable score (default: 70)"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
required: ["snapshot"]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "design.suggest",
|
|
110
|
+
description: "Get specific, actionable improvement suggestions for design issues.",
|
|
111
|
+
inputSchema: {
|
|
112
|
+
type: "object",
|
|
113
|
+
properties: {
|
|
114
|
+
snapshot: {
|
|
115
|
+
type: "object",
|
|
116
|
+
description: "PageSnapshot from design.inspect"
|
|
117
|
+
},
|
|
118
|
+
maxSuggestions: {
|
|
119
|
+
type: "number",
|
|
120
|
+
description: "Maximum suggestions to return (default: 10)"
|
|
121
|
+
},
|
|
122
|
+
focus: {
|
|
123
|
+
type: "string",
|
|
124
|
+
description: "Category to focus suggestions on"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
required: ["snapshot"]
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "design.apply",
|
|
132
|
+
description: "Apply a design fix and verify the improvement with before/after scoring.",
|
|
133
|
+
inputSchema: {
|
|
134
|
+
type: "object",
|
|
135
|
+
properties: {
|
|
136
|
+
selector: { type: "string", description: "Element to modify" },
|
|
137
|
+
changes: {
|
|
138
|
+
type: "array",
|
|
139
|
+
description: "CSS property changes",
|
|
140
|
+
items: {
|
|
141
|
+
type: "object",
|
|
142
|
+
properties: {
|
|
143
|
+
property: { type: "string" },
|
|
144
|
+
value: { type: "string" }
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
verify: {
|
|
149
|
+
type: "boolean",
|
|
150
|
+
description: "Re-score after applying (default: true)"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
required: ["selector", "changes"]
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "design.compare",
|
|
158
|
+
description: "Compare two page states. Shows score deltas, structural changes, regressions, and fixes.",
|
|
159
|
+
inputSchema: {
|
|
160
|
+
type: "object",
|
|
161
|
+
properties: {
|
|
162
|
+
before: { type: "object", description: "PageSnapshot of before state" },
|
|
163
|
+
after: { type: "object", description: "PageSnapshot of after state" }
|
|
164
|
+
},
|
|
165
|
+
required: ["before", "after"]
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "design.preferences",
|
|
170
|
+
description: "Read or export the user's design taste profile for system prompt injection.",
|
|
171
|
+
inputSchema: {
|
|
172
|
+
type: "object",
|
|
173
|
+
properties: {
|
|
174
|
+
action: {
|
|
175
|
+
type: "string",
|
|
176
|
+
enum: ["read", "export"],
|
|
177
|
+
description: "Read profile or export as structured format"
|
|
178
|
+
},
|
|
179
|
+
format: {
|
|
180
|
+
type: "string",
|
|
181
|
+
enum: ["xml", "json"],
|
|
182
|
+
description: "Export format (default: xml)"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
required: ["action"]
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "design.audit",
|
|
190
|
+
description: "Run comprehensive design quality + accessibility audit with prioritized fix list.",
|
|
191
|
+
inputSchema: {
|
|
192
|
+
type: "object",
|
|
193
|
+
properties: {
|
|
194
|
+
url: { type: "string", description: "URL to audit" },
|
|
195
|
+
selector: { type: "string", description: "Scope to specific section" },
|
|
196
|
+
wcag: {
|
|
197
|
+
type: "string",
|
|
198
|
+
enum: ["AA", "AAA"],
|
|
199
|
+
description: "WCAG conformance level (default: AA)"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "design.doctor",
|
|
206
|
+
description: "Check Argus installation health, configuration, and version info.",
|
|
207
|
+
inputSchema: {
|
|
208
|
+
type: "object",
|
|
209
|
+
properties: {}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
];
|
|
213
|
+
var ARGUS_VERSION = "2026.4.12";
|
|
214
|
+
var ARGUS_DIR = ".argus";
|
|
215
|
+
var DEFAULT_MCP_PORT = 18790;
|
|
216
|
+
var DEFAULT_GATEWAY_PORT = 18791;
|
|
217
|
+
var MAX_ELEMENTS = 1e3;
|
|
218
|
+
var MAX_TEXT_LENGTH = 200;
|
|
219
|
+
var DEFAULT_THRESHOLD = 70;
|
|
220
|
+
var SPACING_SCALE = [0, 2, 4, 8, 12, 16, 20, 24, 32, 40, 48, 56, 64, 80, 96, 128];
|
|
221
|
+
var TYPE_SCALE_RATIOS = {
|
|
222
|
+
minorSecond: 1.067,
|
|
223
|
+
majorSecond: 1.125,
|
|
224
|
+
minorThird: 1.2,
|
|
225
|
+
majorThird: 1.25,
|
|
226
|
+
perfectFourth: 1.333,
|
|
227
|
+
augmentedFourth: 1.414,
|
|
228
|
+
perfectFifth: 1.5,
|
|
229
|
+
goldenRatio: 1.618
|
|
230
|
+
};
|
|
231
|
+
var CONTRAST_THRESHOLDS = {
|
|
232
|
+
AALargeText: 3,
|
|
233
|
+
AANormalText: 4.5,
|
|
234
|
+
AAALargeText: 4.5,
|
|
235
|
+
AAANormalText: 7
|
|
236
|
+
};
|
|
237
|
+
var TOUCH_TARGETS = {
|
|
238
|
+
minimum: 24,
|
|
239
|
+
recommended: 44,
|
|
240
|
+
comfortable: 48
|
|
241
|
+
};
|
|
242
|
+
var GRADE_BOUNDARIES = {
|
|
243
|
+
"A+": 95,
|
|
244
|
+
A: 90,
|
|
245
|
+
"B+": 85,
|
|
246
|
+
B: 75,
|
|
247
|
+
"C+": 65,
|
|
248
|
+
C: 55,
|
|
249
|
+
D: 40,
|
|
250
|
+
F: 0
|
|
251
|
+
};
|
|
252
|
+
function scoreToGrade(score) {
|
|
253
|
+
if (score >= GRADE_BOUNDARIES["A+"]) return "A+";
|
|
254
|
+
if (score >= GRADE_BOUNDARIES.A) return "A";
|
|
255
|
+
if (score >= GRADE_BOUNDARIES["B+"]) return "B+";
|
|
256
|
+
if (score >= GRADE_BOUNDARIES.B) return "B";
|
|
257
|
+
if (score >= GRADE_BOUNDARIES["C+"]) return "C+";
|
|
258
|
+
if (score >= GRADE_BOUNDARIES.C) return "C";
|
|
259
|
+
if (score >= GRADE_BOUNDARIES.D) return "D";
|
|
260
|
+
return "F";
|
|
261
|
+
}
|
|
262
|
+
var DEFAULT_CONFIG = {
|
|
263
|
+
version: 1,
|
|
264
|
+
mcp: {
|
|
265
|
+
port: DEFAULT_MCP_PORT,
|
|
266
|
+
bind: "loopback",
|
|
267
|
+
auth: { mode: "none" }
|
|
268
|
+
},
|
|
269
|
+
gateway: {
|
|
270
|
+
port: DEFAULT_GATEWAY_PORT,
|
|
271
|
+
bind: "loopback"
|
|
272
|
+
},
|
|
273
|
+
scoring: {
|
|
274
|
+
threshold: DEFAULT_THRESHOLD,
|
|
275
|
+
enabledCategories: [...RULE_CATEGORIES],
|
|
276
|
+
customRulePaths: []
|
|
277
|
+
},
|
|
278
|
+
memory: {
|
|
279
|
+
profileName: "default",
|
|
280
|
+
historyEnabled: false,
|
|
281
|
+
maxHistoryDays: 90
|
|
282
|
+
},
|
|
283
|
+
inspector: {
|
|
284
|
+
maxElements: MAX_ELEMENTS,
|
|
285
|
+
includeHidden: false,
|
|
286
|
+
includeCustomProperties: true
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
290
|
+
0 && (module.exports = {
|
|
291
|
+
ARGUS_DIR,
|
|
292
|
+
ARGUS_VERSION,
|
|
293
|
+
CONTRAST_THRESHOLDS,
|
|
294
|
+
DEFAULT_CONFIG,
|
|
295
|
+
DEFAULT_GATEWAY_PORT,
|
|
296
|
+
DEFAULT_MCP_PORT,
|
|
297
|
+
DEFAULT_THRESHOLD,
|
|
298
|
+
GRADE_BOUNDARIES,
|
|
299
|
+
MAX_ELEMENTS,
|
|
300
|
+
MAX_TEXT_LENGTH,
|
|
301
|
+
MCP_TOOLS,
|
|
302
|
+
RULE_CATEGORIES,
|
|
303
|
+
SPACING_SCALE,
|
|
304
|
+
TOUCH_TARGETS,
|
|
305
|
+
TYPE_SCALE_RATIOS,
|
|
306
|
+
err,
|
|
307
|
+
ok,
|
|
308
|
+
scoreToGrade
|
|
309
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
// src/types.ts
|
|
2
|
+
function ok(value) {
|
|
3
|
+
return { ok: true, value };
|
|
4
|
+
}
|
|
5
|
+
function err(error) {
|
|
6
|
+
return { ok: false, error };
|
|
7
|
+
}
|
|
8
|
+
var RULE_CATEGORIES = [
|
|
9
|
+
"spacing",
|
|
10
|
+
"typography",
|
|
11
|
+
"color",
|
|
12
|
+
"hierarchy",
|
|
13
|
+
"accessibility",
|
|
14
|
+
"consistency"
|
|
15
|
+
];
|
|
16
|
+
var MCP_TOOLS = [
|
|
17
|
+
{
|
|
18
|
+
name: "design.inspect",
|
|
19
|
+
description: "Analyze a page or component's visual structure. Returns element positions, computed styles, accessibility data, and structural relationships.",
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
url: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "URL to inspect"
|
|
26
|
+
},
|
|
27
|
+
selector: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "CSS selector to scope inspection"
|
|
30
|
+
},
|
|
31
|
+
html: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Raw HTML string to inspect"
|
|
34
|
+
},
|
|
35
|
+
maxElements: {
|
|
36
|
+
type: "number",
|
|
37
|
+
description: "Maximum elements to inspect (default: 500)"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "design.score",
|
|
44
|
+
description: "Score design quality against established principles. Returns per-rule findings, category scores, and aggregate score (0-100).",
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
snapshot: {
|
|
49
|
+
type: "object",
|
|
50
|
+
description: "PageSnapshot from design.inspect"
|
|
51
|
+
},
|
|
52
|
+
categories: {
|
|
53
|
+
type: "array",
|
|
54
|
+
items: { type: "string" },
|
|
55
|
+
description: "Categories to score (default: all). Options: spacing, typography, color, hierarchy, accessibility, consistency"
|
|
56
|
+
},
|
|
57
|
+
threshold: {
|
|
58
|
+
type: "number",
|
|
59
|
+
description: "Minimum acceptable score (default: 70)"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
required: ["snapshot"]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "design.suggest",
|
|
67
|
+
description: "Get specific, actionable improvement suggestions for design issues.",
|
|
68
|
+
inputSchema: {
|
|
69
|
+
type: "object",
|
|
70
|
+
properties: {
|
|
71
|
+
snapshot: {
|
|
72
|
+
type: "object",
|
|
73
|
+
description: "PageSnapshot from design.inspect"
|
|
74
|
+
},
|
|
75
|
+
maxSuggestions: {
|
|
76
|
+
type: "number",
|
|
77
|
+
description: "Maximum suggestions to return (default: 10)"
|
|
78
|
+
},
|
|
79
|
+
focus: {
|
|
80
|
+
type: "string",
|
|
81
|
+
description: "Category to focus suggestions on"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
required: ["snapshot"]
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "design.apply",
|
|
89
|
+
description: "Apply a design fix and verify the improvement with before/after scoring.",
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: "object",
|
|
92
|
+
properties: {
|
|
93
|
+
selector: { type: "string", description: "Element to modify" },
|
|
94
|
+
changes: {
|
|
95
|
+
type: "array",
|
|
96
|
+
description: "CSS property changes",
|
|
97
|
+
items: {
|
|
98
|
+
type: "object",
|
|
99
|
+
properties: {
|
|
100
|
+
property: { type: "string" },
|
|
101
|
+
value: { type: "string" }
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
verify: {
|
|
106
|
+
type: "boolean",
|
|
107
|
+
description: "Re-score after applying (default: true)"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
required: ["selector", "changes"]
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "design.compare",
|
|
115
|
+
description: "Compare two page states. Shows score deltas, structural changes, regressions, and fixes.",
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: "object",
|
|
118
|
+
properties: {
|
|
119
|
+
before: { type: "object", description: "PageSnapshot of before state" },
|
|
120
|
+
after: { type: "object", description: "PageSnapshot of after state" }
|
|
121
|
+
},
|
|
122
|
+
required: ["before", "after"]
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "design.preferences",
|
|
127
|
+
description: "Read or export the user's design taste profile for system prompt injection.",
|
|
128
|
+
inputSchema: {
|
|
129
|
+
type: "object",
|
|
130
|
+
properties: {
|
|
131
|
+
action: {
|
|
132
|
+
type: "string",
|
|
133
|
+
enum: ["read", "export"],
|
|
134
|
+
description: "Read profile or export as structured format"
|
|
135
|
+
},
|
|
136
|
+
format: {
|
|
137
|
+
type: "string",
|
|
138
|
+
enum: ["xml", "json"],
|
|
139
|
+
description: "Export format (default: xml)"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
required: ["action"]
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "design.audit",
|
|
147
|
+
description: "Run comprehensive design quality + accessibility audit with prioritized fix list.",
|
|
148
|
+
inputSchema: {
|
|
149
|
+
type: "object",
|
|
150
|
+
properties: {
|
|
151
|
+
url: { type: "string", description: "URL to audit" },
|
|
152
|
+
selector: { type: "string", description: "Scope to specific section" },
|
|
153
|
+
wcag: {
|
|
154
|
+
type: "string",
|
|
155
|
+
enum: ["AA", "AAA"],
|
|
156
|
+
description: "WCAG conformance level (default: AA)"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "design.doctor",
|
|
163
|
+
description: "Check Argus installation health, configuration, and version info.",
|
|
164
|
+
inputSchema: {
|
|
165
|
+
type: "object",
|
|
166
|
+
properties: {}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
];
|
|
170
|
+
var ARGUS_VERSION = "2026.4.12";
|
|
171
|
+
var ARGUS_DIR = ".argus";
|
|
172
|
+
var DEFAULT_MCP_PORT = 18790;
|
|
173
|
+
var DEFAULT_GATEWAY_PORT = 18791;
|
|
174
|
+
var MAX_ELEMENTS = 1e3;
|
|
175
|
+
var MAX_TEXT_LENGTH = 200;
|
|
176
|
+
var DEFAULT_THRESHOLD = 70;
|
|
177
|
+
var SPACING_SCALE = [0, 2, 4, 8, 12, 16, 20, 24, 32, 40, 48, 56, 64, 80, 96, 128];
|
|
178
|
+
var TYPE_SCALE_RATIOS = {
|
|
179
|
+
minorSecond: 1.067,
|
|
180
|
+
majorSecond: 1.125,
|
|
181
|
+
minorThird: 1.2,
|
|
182
|
+
majorThird: 1.25,
|
|
183
|
+
perfectFourth: 1.333,
|
|
184
|
+
augmentedFourth: 1.414,
|
|
185
|
+
perfectFifth: 1.5,
|
|
186
|
+
goldenRatio: 1.618
|
|
187
|
+
};
|
|
188
|
+
var CONTRAST_THRESHOLDS = {
|
|
189
|
+
AALargeText: 3,
|
|
190
|
+
AANormalText: 4.5,
|
|
191
|
+
AAALargeText: 4.5,
|
|
192
|
+
AAANormalText: 7
|
|
193
|
+
};
|
|
194
|
+
var TOUCH_TARGETS = {
|
|
195
|
+
minimum: 24,
|
|
196
|
+
recommended: 44,
|
|
197
|
+
comfortable: 48
|
|
198
|
+
};
|
|
199
|
+
var GRADE_BOUNDARIES = {
|
|
200
|
+
"A+": 95,
|
|
201
|
+
A: 90,
|
|
202
|
+
"B+": 85,
|
|
203
|
+
B: 75,
|
|
204
|
+
"C+": 65,
|
|
205
|
+
C: 55,
|
|
206
|
+
D: 40,
|
|
207
|
+
F: 0
|
|
208
|
+
};
|
|
209
|
+
function scoreToGrade(score) {
|
|
210
|
+
if (score >= GRADE_BOUNDARIES["A+"]) return "A+";
|
|
211
|
+
if (score >= GRADE_BOUNDARIES.A) return "A";
|
|
212
|
+
if (score >= GRADE_BOUNDARIES["B+"]) return "B+";
|
|
213
|
+
if (score >= GRADE_BOUNDARIES.B) return "B";
|
|
214
|
+
if (score >= GRADE_BOUNDARIES["C+"]) return "C+";
|
|
215
|
+
if (score >= GRADE_BOUNDARIES.C) return "C";
|
|
216
|
+
if (score >= GRADE_BOUNDARIES.D) return "D";
|
|
217
|
+
return "F";
|
|
218
|
+
}
|
|
219
|
+
var DEFAULT_CONFIG = {
|
|
220
|
+
version: 1,
|
|
221
|
+
mcp: {
|
|
222
|
+
port: DEFAULT_MCP_PORT,
|
|
223
|
+
bind: "loopback",
|
|
224
|
+
auth: { mode: "none" }
|
|
225
|
+
},
|
|
226
|
+
gateway: {
|
|
227
|
+
port: DEFAULT_GATEWAY_PORT,
|
|
228
|
+
bind: "loopback"
|
|
229
|
+
},
|
|
230
|
+
scoring: {
|
|
231
|
+
threshold: DEFAULT_THRESHOLD,
|
|
232
|
+
enabledCategories: [...RULE_CATEGORIES],
|
|
233
|
+
customRulePaths: []
|
|
234
|
+
},
|
|
235
|
+
memory: {
|
|
236
|
+
profileName: "default",
|
|
237
|
+
historyEnabled: false,
|
|
238
|
+
maxHistoryDays: 90
|
|
239
|
+
},
|
|
240
|
+
inspector: {
|
|
241
|
+
maxElements: MAX_ELEMENTS,
|
|
242
|
+
includeHidden: false,
|
|
243
|
+
includeCustomProperties: true
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
export {
|
|
247
|
+
ARGUS_DIR,
|
|
248
|
+
ARGUS_VERSION,
|
|
249
|
+
CONTRAST_THRESHOLDS,
|
|
250
|
+
DEFAULT_CONFIG,
|
|
251
|
+
DEFAULT_GATEWAY_PORT,
|
|
252
|
+
DEFAULT_MCP_PORT,
|
|
253
|
+
DEFAULT_THRESHOLD,
|
|
254
|
+
GRADE_BOUNDARIES,
|
|
255
|
+
MAX_ELEMENTS,
|
|
256
|
+
MAX_TEXT_LENGTH,
|
|
257
|
+
MCP_TOOLS,
|
|
258
|
+
RULE_CATEGORIES,
|
|
259
|
+
SPACING_SCALE,
|
|
260
|
+
TOUCH_TARGETS,
|
|
261
|
+
TYPE_SCALE_RATIOS,
|
|
262
|
+
err,
|
|
263
|
+
ok,
|
|
264
|
+
scoreToGrade
|
|
265
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@argus-design/protocol",
|
|
3
|
+
"version": "2026.4.12",
|
|
4
|
+
"description": "Shared types, interfaces, and constants for the Argus design intelligence runtime",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": ["dist"],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
20
|
+
"dev": "tsup src/index.ts --format esm,cjs --dts --watch"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"tsup": "^8.0.0",
|
|
24
|
+
"typescript": "^5.7.0"
|
|
25
|
+
}
|
|
26
|
+
}
|