@usableapp/cardds 0.7.179 → 0.7.180
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 +7 -0
- package/bin/cardds.mjs +23 -3
- package/css/parts.css +4 -1
- package/css/stack.css +43 -1
- package/dist/cardds.css +47 -2
- package/dist/cards/Card.d.ts +1 -1
- package/dist/cards/Card.js +4 -1
- package/dist/catalog.json +1 -1
- package/dist/parts/Head.d.ts +3 -1
- package/dist/parts/Head.js +3 -1
- package/dist/sheets/SheetStack.d.ts +3 -1
- package/dist/sheets/SheetStack.js +2 -1
- package/dist/sheets/StackSheet.d.ts +6 -4
- package/dist/sheets/StackSheet.js +8 -3
- package/dist/sheets/stackCard.d.ts +2 -0
- package/dist/templates/Home.d.ts +3 -1
- package/dist/templates/Home.js +2 -2
- package/dist/type/Icon.js +1 -1
- package/docs/reference.md +37 -2
- package/lib/audit.mjs +330 -0
- package/lib/guide.mjs +1 -1
- package/lib/mcp.mjs +13 -0
- package/package.json +1 -1
package/lib/mcp.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { dirname, join } from 'node:path';
|
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import * as catalog from './catalog.mjs';
|
|
8
8
|
import { GUIDE } from './guide.mjs';
|
|
9
|
+
import { audit } from './audit.mjs';
|
|
9
10
|
|
|
10
11
|
const { version } = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf8'));
|
|
11
12
|
/* A server lives as long as its session — hours, across releases. What it serves must be the catalog as it is NOW (Lh 2026-10-10: a
|
|
@@ -75,6 +76,18 @@ const TOOLS = [
|
|
|
75
76
|
inputSchema: { type: 'object', properties: { code: str('the .tsx/.jsx source'), filename: str('its file name, for the report (default screen.tsx)') }, required: ['code'] },
|
|
76
77
|
run: (_cat, a) => catalog.check(a.code, a.filename),
|
|
77
78
|
},
|
|
79
|
+
{
|
|
80
|
+
name: 'audit_screen',
|
|
81
|
+
description: 'Audit a screen the way the member sees it, against the rules of cardds (docs/reference.md, "Rules of the system"). Three ways. A PICTURE: you are looking at an image of a screen — call it with nothing, and it returns one set of questions per rule ({ rule, name, questions }); put each set to the picture and answer rule by rule. ONE PAGE already built: pass html, the rendered DOM of that page (what the browser shows, document.body.outerHTML — not the source code) and it returns what the DOM shows against rule 16 (more than one layer open over the screen, a button that opens a Menu with no chevron-down icon, a card in an open sheet that repeats a card of the screen under it). A FLOW: pass pages, [{ name, html }] in the order the member walks them, and it returns each page\'s items and what is wrong across pages (the same card with other parts on another page: head · NoteRow · Rows · foot and its buttons). Every item is { rule, page?, where, says }: where is the selector and the words seen on the screen, says is the fault in one line. [] means nothing found; a document that is not cardds gives []. It reads no image and opens no browser.',
|
|
82
|
+
inputSchema: {
|
|
83
|
+
type: 'object',
|
|
84
|
+
properties: {
|
|
85
|
+
html: str('the rendered DOM of ONE page, as a string; omit it, and pages, to get the questions for a picture'),
|
|
86
|
+
pages: { type: 'array', items: { type: 'object', properties: { name: str('the page\'s name, in the report'), html: str('the rendered DOM of this page') }, required: ['html'] }, description: 'a flow: the pages in the order the member walks them' },
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
run: (_cat, a) => audit(a),
|
|
90
|
+
},
|
|
78
91
|
];
|
|
79
92
|
|
|
80
93
|
const reply = (id, result) => ({ jsonrpc: '2.0', id, result });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usableapp/cardds",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.180",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "card-first mobile design system, React-first: the components in src/ are thin wrappers over the CSS contract (css/*.css stays the only truth); gallery/ shows every story live (npm run dev).",
|