@sigloch/graph-view-edit 0.22.0 → 0.22.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.
package/dist/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>graph-view-edit</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-DzxcrONp.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-B3cgYeCa.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigloch/graph-view-edit",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"description": "React/Vite viewer+editor over @sigloch/graphcode — 12 graph-views + 16 doc-views via a declarative View-Registry, plus an SE-Dashboard sibling route. Reads docs/graph/<member>.graph.json client-side (no 2nd Kuzu handle).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"bin",
|
|
12
12
|
"vite.config.js",
|
|
13
13
|
"src/config.mjs",
|
|
14
|
-
"src/code-lookup.mjs"
|
|
14
|
+
"src/code-lookup.mjs",
|
|
15
|
+
"src/host-verlauf.mjs"
|
|
15
16
|
],
|
|
16
17
|
"scripts": {
|
|
17
18
|
"dev": "vite",
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
"comment:deps": "Runtime = what vite.config.js + bin/gve.mjs load at Node level when serving the prebuilt dist/. The UI libs (react, react-dom, elkjs, @tanstack/react-table, zustand) are bundled INTO dist/ by vite and must stay devDependencies — shipping them would make consumers download the whole UI stack twice.",
|
|
24
25
|
"dependencies": {
|
|
25
26
|
"@sigloch/contracts": ">=12.9 <13",
|
|
26
|
-
"@sigloch/graph-api-core": ">=5.11 <
|
|
27
|
+
"@sigloch/graph-api-core": ">=5.11 <7",
|
|
27
28
|
"@sigloch/graphcode-client": ">=3.2 <4",
|
|
28
29
|
"@sigloch/se-engine": ">=3 <4",
|
|
29
30
|
"@vitejs/plugin-react": "^4.3.4",
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@playwright/test": "^1.58.2",
|
|
35
|
-
"@sigloch/graphcode": "^0.
|
|
36
|
+
"@sigloch/graphcode": "^0.41.0",
|
|
36
37
|
"@tanstack/react-table": "^8.20.5",
|
|
37
38
|
"@testing-library/react": "^16.0.1",
|
|
38
39
|
"elkjs": "^0.11.1",
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verlauf und Ablehnung vom graphcode-Host (CR-GVE-403).
|
|
3
|
+
*
|
|
4
|
+
* Beide Zahlenquellen gehören dem Host: `graph_readiness({verlauf})` misst die jüngsten
|
|
5
|
+
* Stände, `audit_stats` zählt Anwendung und Ablehnung am Gate. gve reicht durch und
|
|
6
|
+
* filtert für die Anzeige — es rechnet nichts nach. Ohne Host: `available: false`, keine
|
|
7
|
+
* Ersatzrechnung. Derselbe `host.sock`-Weg wie /api/suggest und /api/mutate.
|
|
8
|
+
*
|
|
9
|
+
* @author andreas@siglochconsulting
|
|
10
|
+
*/
|
|
11
|
+
import { join } from 'node:path';
|
|
12
|
+
import { callHost, HOST_SOCK_BASENAME } from '@sigloch/graphcode-client';
|
|
13
|
+
|
|
14
|
+
/** Zahl der jüngsten Stände, die die Karte „Wirkt die Arbeit?" zeigt. */
|
|
15
|
+
export const VERLAUF_WINDOW = 24;
|
|
16
|
+
|
|
17
|
+
const sockOf = (repoRoot) => join(repoRoot, '.graphcode', HOST_SOCK_BASENAME);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Der Verlauf der jüngsten Stände. Eine Antwort ohne `verlauf.states` (Host vor
|
|
21
|
+
* graphcode CR-GC-946) ist nicht verwertbar und zählt wie „kein Host".
|
|
22
|
+
*/
|
|
23
|
+
export async function fetchVerlauf(repoRoot, callHostImpl = callHost) {
|
|
24
|
+
try {
|
|
25
|
+
const report = await callHostImpl(sockOf(repoRoot), 'graph_readiness', { verlauf: VERLAUF_WINDOW });
|
|
26
|
+
if (!Array.isArray(report?.verlauf?.states)) {
|
|
27
|
+
return { available: false, reason: 'graph_readiness lieferte keinen Verlauf (verlauf.states)' };
|
|
28
|
+
}
|
|
29
|
+
return { available: true, verlauf: report.verlauf };
|
|
30
|
+
} catch (err) {
|
|
31
|
+
return { available: false, reason: err.message };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Die Ablehnung am Gate aus `audit_stats`: Gesamtzahl, die blockenden Regeln
|
|
37
|
+
* (`blocked` > 0, Reihenfolge des Hosts) und je Skill angewandt/abgelehnt.
|
|
38
|
+
* `skill: null` bleibt null — die Anzeige sagt „nicht erfasst".
|
|
39
|
+
*/
|
|
40
|
+
export function ablehnungPayload(stats) {
|
|
41
|
+
if (!stats?.totals || !Array.isArray(stats.byRule) || !Array.isArray(stats.bySkill)) return null;
|
|
42
|
+
return {
|
|
43
|
+
available: true,
|
|
44
|
+
window: { since: stats.window?.since ?? null, until: stats.window?.until ?? null },
|
|
45
|
+
totals: { applied: stats.totals.applied, rejected: stats.totals.rejected },
|
|
46
|
+
rules: stats.byRule
|
|
47
|
+
.filter((r) => r.blocked > 0)
|
|
48
|
+
.map((r) => ({ ruleId: r.ruleId, blocked: r.blocked, firedIn: r.firedIn ?? null })),
|
|
49
|
+
skills: stats.bySkill.map((s) => ({
|
|
50
|
+
skill: s.skill ?? null,
|
|
51
|
+
applied: s.applied,
|
|
52
|
+
rejected: s.rejected,
|
|
53
|
+
topBlockingRule: s.topBlockingRule ?? null,
|
|
54
|
+
})),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export async function fetchAblehnung(repoRoot, callHostImpl = callHost) {
|
|
59
|
+
try {
|
|
60
|
+
const payload = ablehnungPayload(await callHostImpl(sockOf(repoRoot), 'audit_stats', {}));
|
|
61
|
+
return payload ?? { available: false, reason: 'audit_stats lieferte keine verwertbare Antwort (totals, byRule, bySkill)' };
|
|
62
|
+
} catch (err) {
|
|
63
|
+
return { available: false, reason: err.message };
|
|
64
|
+
}
|
|
65
|
+
}
|