@sigloch/graph-view-edit 0.17.1 → 0.19.0

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.
@@ -0,0 +1 @@
1
+ .gve-ctx{position:absolute;z-index:30;min-width:220px;max-width:320px;max-height:60vh;overflow-y:auto;display:flex;flex-direction:column;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);box-shadow:var(--shadow-1);padding:var(--space-1);font-family:var(--font-ui);font-size:var(--text-sm)}.gve-ctx-head{padding:var(--space-1) var(--space-2);font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-dim);border-bottom:1px solid var(--color-border);margin-bottom:var(--space-1)}.gve-ctx-item{text-align:left;padding:var(--space-1) var(--space-2);background:none;border:none;border-radius:var(--radius-sm);color:var(--color-text);cursor:pointer}.gve-ctx-item:hover:not(:disabled){background:var(--color-accent-soft)}.gve-ctx-item:disabled{color:var(--color-text-dim);cursor:not-allowed}.gve-ctx-form{display:flex;flex-direction:column;gap:var(--space-1);padding:var(--space-2)}.gve-ctx-form label{font-size:var(--text-xs);color:var(--color-text-dim)}.gve-ctx-form input,.gve-ctx-form textarea{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:var(--space-1) var(--space-2)}.gve-ctx-empty{padding:var(--space-1) var(--space-2);color:var(--color-text-dim);font-size:var(--text-xs)}.gve-genesis{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:20;display:flex;flex-direction:column;gap:var(--space-2);min-width:240px;padding:var(--space-3);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);box-shadow:var(--shadow-1);font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text);text-align:center}.gve-genesis-title{font-family:var(--font-mono);font-size:var(--text-xs);text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-dim)}.gve-genesis-hint{margin:0;color:var(--color-text-dim)}.gve-genesis-input{font-family:var(--font-ui);font-size:var(--text-sm);color:var(--color-text);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:var(--space-1) var(--space-2)}.gve-genesis-create{padding:var(--space-1) var(--space-2);background:var(--color-accent-soft);border:1px solid var(--color-border);border-radius:var(--radius-sm);color:var(--color-text);cursor:pointer}.gve-genesis-create:disabled{color:var(--color-text-dim);cursor:not-allowed}.gve-doc{font-family:var(--font-ui);font-size:var(--text-base);line-height:1.55;color:var(--color-text);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);padding:var(--space-8) var(--space-6);margin:var(--space-3) auto;max-width:820px}.gve-doc h1{font-size:var(--text-xl);margin:0 0 var(--space-3)}.gve-doc h2{font-size:var(--text-lg);margin:var(--space-6) 0 var(--space-3);padding-bottom:var(--space-1);border-bottom:1px solid var(--color-border)}.gve-doc h3{font-size:var(--text-base);margin:var(--space-4) 0 var(--space-2)}.gve-doc h4,.gve-doc h5,.gve-doc h6{font-size:var(--text-sm);margin:var(--space-3) 0 var(--space-1)}.gve-doc h5 code,.gve-doc h6 code{color:var(--color-text-dim)}.gve-doc p{margin:0 0 var(--space-2)}.gve-doc code{font-family:var(--font-mono);font-size:.92em;background:var(--color-surface-2);border-radius:var(--radius-sm);padding:0 var(--space-1)}.gve-doc blockquote{margin:0 0 var(--space-2);padding-left:var(--space-3);border-left:2px solid var(--color-border);color:var(--color-text-dim);font-size:var(--text-sm)}.gve-doc hr{border:0;border-top:1px solid var(--color-border);margin:var(--space-4) 0}.gve-doc pre.md-code{font-family:var(--font-mono);font-size:var(--text-sm);background:var(--color-surface-2);border-radius:var(--radius-sm);padding:var(--space-2) var(--space-3);overflow-x:auto}.edit-pen{margin-left:var(--space-2);font-size:var(--text-xs);background:var(--color-surface-2);border:1px solid var(--color-border);border-radius:var(--radius-sm);cursor:pointer}.edit-box{margin:var(--space-2) 0;padding:var(--space-3);background:var(--color-surface-2);border:1px solid var(--color-accent);border-radius:var(--radius-md)}.edit-box textarea{width:100%;box-sizing:border-box;font-family:var(--font-mono);font-size:var(--text-sm);color:var(--color-text);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:var(--space-2)}.cmd-preview{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-dim);background:var(--color-surface);border:1px dashed var(--color-border);border-radius:var(--radius-sm);padding:var(--space-2);overflow-x:auto;white-space:pre-wrap}.edit-actions{display:flex;gap:var(--space-2);align-items:center;margin-top:var(--space-2)}.edit-actions .btn-primary{background:var(--color-accent);color:var(--color-text-inverse);border:1px solid var(--color-accent);border-radius:var(--radius-sm);padding:var(--space-1) var(--space-3);cursor:pointer}.edit-actions .btn-primary:disabled{opacity:.5;cursor:not-allowed}[data-testid=edit-errors],[data-testid=formate-errors]{color:var(--color-error);font-size:var(--text-xs)}[data-testid=edit-verdict][data-tier=block]{color:var(--color-error)}[data-testid=edit-verdict]{font-size:var(--text-xs);color:var(--color-text-dim)}.gve-source-banner{margin:var(--space-4) var(--space-4) 0;padding:var(--space-2) var(--space-3);border:1px solid var(--color-warn);border-radius:var(--radius-md);background:var(--color-surface-2);color:var(--color-text);font-size:var(--text-sm)}.gve-source-reason{display:block;margin-top:var(--space-1);color:var(--color-text-dim);font-family:var(--font-mono);font-size:var(--text-xs)}.gve-cards{flex:1;overflow:auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:var(--space-4);padding:var(--space-4);align-content:start}.gve-card{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);box-shadow:var(--shadow-1);padding:var(--space-4)}.gve-card-wide{grid-column:1 / -1}.gve-card h3{font-size:var(--text-xs);font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-dim);margin-bottom:var(--space-3);display:flex;align-items:center;gap:var(--space-2)}.gve-card h4{font-size:var(--text-xs);font-weight:600;color:var(--color-text-dim);margin-bottom:var(--space-2);display:flex;align-items:center;gap:var(--space-2)}.gve-count{font-size:var(--text-xs);font-weight:600;color:var(--color-text-inverse);background:var(--color-accent);border-radius:999px;padding:0 var(--space-2)}.gve-kpi-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:var(--space-3);margin-bottom:var(--space-4)}.gve-kpi-tile{display:flex;flex-direction:column;gap:var(--space-1);background:var(--color-surface-2);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:var(--space-3)}.gve-kpi-value{font-size:var(--text-xl);font-weight:600;line-height:1.1}.gve-kpi-label{font-size:var(--text-xs);color:var(--color-text-dim)}.gve-kpi-tile[data-tone=ok] .gve-kpi-value{color:var(--color-ok)}.gve-kpi-tile[data-tone=warn] .gve-kpi-value{color:var(--color-warn)}.gve-kpi-tile[data-tone=error] .gve-kpi-value{color:var(--color-error)}.gve-marks{list-style:none;padding:0;margin-top:var(--space-2);display:flex;flex-direction:column;gap:var(--space-2)}.gve-mark{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--space-2);font-size:var(--text-sm)}.gve-light{width:10px;height:10px;border-radius:50%;flex-shrink:0}.gve-light[data-state=reached]{background:var(--color-ok)}.gve-light[data-state=open]{background:var(--color-warn)}.gve-mark-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gve-mark-state{font-size:var(--text-xs);text-align:right}.gve-mark-state[data-state=reached]{color:var(--color-ok)}.gve-mark-state[data-state=open]{color:var(--color-warn)}.gve-mark-holding{grid-column:1 / -1;font-size:var(--text-xs)}.gve-mark-holding>summary{cursor:pointer;color:var(--color-text-dim)}.gve-mark-holding[open]>summary{margin-bottom:var(--space-1)}.gve-stages{list-style:none;padding:0;margin-top:var(--space-2);display:flex;flex-direction:column;gap:var(--space-1);max-width:24rem}.gve-stage{display:grid;grid-template-columns:1.5rem 1fr auto;align-items:baseline;gap:var(--space-2);font-size:var(--text-sm)}.gve-stage-no{font-size:var(--text-xs);color:var(--color-text-dim);text-align:right;font-variant-numeric:tabular-nums}.gve-stage-count{text-align:right;font-variant-numeric:tabular-nums}.gve-stage[data-findings="0"]{color:var(--color-text-dim)}.gve-legend{margin-top:var(--space-3);font-size:var(--text-xs);color:var(--color-text-dim)}.gve-autopilot-row{margin-bottom:0}.gve-autopilot-row .gve-kpi-value{font-size:var(--text-lg)}.gve-rec-group{margin-bottom:var(--space-4)}.gve-rec-group h4[data-severity=error] .gve-count{background:var(--color-error)}.gve-rec-group h4[data-severity=warning] .gve-count{background:var(--color-warn)}.gve-rec-group h4[data-severity=info] .gve-count{background:var(--color-accent)}.gve-rec{border:1px solid var(--color-border);border-left-width:3px;border-radius:var(--radius-sm);padding:var(--space-2) var(--space-3);margin-bottom:var(--space-2);background:var(--color-surface-2)}.gve-rec[data-severity=error]{border-left-color:var(--color-error)}.gve-rec[data-severity=warning]{border-left-color:var(--color-warn)}.gve-rec[data-severity=info]{border-left-color:var(--color-accent)}.gve-rec-head{display:flex;align-items:center;gap:var(--space-2);cursor:pointer;-webkit-user-select:none;user-select:none;list-style-position:outside}.gve-rec-head::-webkit-details-marker{display:none}.gve-rec-head:before{content:"▸";font-size:var(--text-xs);color:var(--color-text-dim)}.gve-rec[open]>.gve-rec-head:before{content:"▾"}.gve-rec[open]>.gve-rec-head{margin-bottom:var(--space-2)}.gve-rec-count{font-family:var(--font-mono);font-size:var(--text-sm);font-weight:600;min-width:var(--space-6);text-align:right}.gve-rec-count[data-severity=error]{color:var(--color-error)}.gve-rec-count[data-severity=warning]{color:var(--color-warn)}.gve-rec-count[data-severity=info]{color:var(--color-accent)}.gve-rec-els{list-style:none;padding:0;display:flex;flex-wrap:wrap;gap:var(--space-1) var(--space-3)}.gve-rec-el-item{font-size:var(--text-xs)}.gve-rec-more{font-size:var(--text-xs);font-style:italic;color:var(--color-text-dim)}.gve-rid{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-dim)}.gve-rec-el{color:var(--color-accent)}.gve-sev{font-size:var(--text-xs);font-weight:600;text-transform:uppercase;border-radius:var(--radius-sm);padding:0 var(--space-2)}.gve-sev[data-severity=error]{color:var(--color-error)}.gve-sev[data-severity=warning]{color:var(--color-warn)}.gve-sev[data-severity=info]{color:var(--color-accent)}.gve-rec-msg{font-size:var(--text-sm)}.gve-hint{margin-top:var(--space-1);font-size:var(--text-xs);color:var(--color-text-dim)}.gve-empty{font-size:var(--text-sm);color:var(--color-text-dim)}.gve-rollup summary{cursor:pointer;font-size:var(--text-sm);color:var(--color-text-dim);padding:var(--space-1) 0;-webkit-user-select:none;user-select:none}.gve-rollup summary:hover{color:var(--color-text)}.gve-rollup[open] summary{margin-bottom:var(--space-2)}.gve-fresh-list{list-style:none;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}.gve-fresh-2col{display:grid;grid-template-columns:1fr 1fr;column-gap:var(--space-4)}.gve-fresh-list li{display:flex;align-items:center;gap:var(--space-2);font-size:var(--text-sm)}.gve-fresh-row{display:flex;align-items:center;gap:var(--space-2);flex:1;min-width:0;text-align:left;font:inherit;color:inherit;background:none;border:0;padding:0;text-decoration:none}.gve-fresh-open{cursor:pointer}.gve-fresh-open:hover .gve-fresh-label{color:var(--color-accent);text-decoration:underline}.gve-fresh-open:focus-visible{outline:2px solid var(--color-accent);outline-offset:var(--space-1)}.gve-fresh-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gve-fresh-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.gve-fresh-dot[data-freshness=live]{background:var(--color-ok)}.gve-fresh-dot[data-freshness=stale]{background:var(--color-warn)}.gve-fresh-dot[data-freshness=absent]{background:var(--color-error)}.gve-pill{font-size:var(--text-xs);border:1px solid var(--color-border);border-radius:999px;padding:0 var(--space-2)}.gve-pill[data-freshness=live]{border-color:var(--color-ok);color:var(--color-ok)}.gve-pill[data-freshness=stale]{border-color:var(--color-warn);color:var(--color-warn)}.gve-pill[data-freshness=absent]{border-color:var(--color-error);color:var(--color-error)}.gve-health-status{margin-bottom:var(--space-3);text-transform:uppercase}.gve-health-status[data-state=ok]{color:var(--color-ok)}.gve-health-status[data-state=error]{color:var(--color-error)}.gve-vtable{width:100%;border-collapse:collapse;font-size:var(--text-sm)}.gve-vtable td{padding:var(--space-1) var(--space-2);border-bottom:1px solid var(--color-border)}.gve-vtable td:first-child{font-family:var(--font-mono);color:var(--color-text-dim);white-space:nowrap}.gve-nextmove{border-left:var(--space-1) solid var(--color-accent)}.gve-nextmove-cols{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-4);align-items:start}@media (max-width: 900px){.gve-nextmove-cols{grid-template-columns:1fr}.gve-nextmove-col+.gve-nextmove-col{border-left:none;border-top:1px solid var(--color-border);padding-left:0;padding-top:var(--space-3)}}.gve-nextmove-col+.gve-nextmove-col{border-left:1px solid var(--color-border);padding-left:var(--space-4)}.gve-nextmove-col h4{margin:0 0 var(--space-2)}.gve-nextmove-head{margin:0 0 var(--space-1);font-size:var(--text-sm)}.gve-nextmove-msg{margin:0 0 var(--space-2);color:var(--color-text-dim);font-size:var(--text-sm)}.gve-nextmove-delta{margin:0 0 var(--space-2);font-size:var(--text-sm)}.gve-nextmove-delta .gve-kpi-value{color:var(--color-accent)}.gve-nextmove-edit,.gve-nextmove-clears,.gve-nextmove-codeimpact{margin:0 0 var(--space-2);font-size:var(--text-xs);color:var(--color-text-dim)}.gve-nextmove-edit code,.gve-nextmove-codeimpact code{font-family:var(--font-mono)}.gve-nextmove-finding{margin:0 0 var(--space-2);font-size:var(--text-sm);color:var(--color-warn)}.gve-nextmove-blockers{margin:0 0 var(--space-2);font-size:var(--text-sm)}.gve-nextmove-blockers[data-tone=error]{color:var(--color-error);font-weight:600}.gve-nextmove-blockers[data-tone=ok]{color:var(--color-text-dim)}.gve-arch-tech{text-transform:none;letter-spacing:normal;font-weight:400;font-family:var(--font-mono)}.gve-coh-kpi{margin:0;font-size:var(--text-sm);color:var(--color-text-dim)}.gve-coh-kpi .gve-kpi-value{color:var(--color-text)}.gve-plain-title{display:flex;flex-direction:column;gap:1px;cursor:help;margin:0}.gve-plain-title .plain{font-size:var(--text-base);font-weight:600;color:var(--color-text)}.gve-plain-title .tech{font-size:var(--text-xs);font-family:var(--font-mono);font-weight:400;color:var(--color-text-dim)}.gve-mm-table th .gve-plain-title .plain{font-size:var(--text-xs);text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-dim)}.gve-mm-scroll{overflow-x:auto}.gve-mm-table{width:100%;border-collapse:collapse;font-size:var(--text-sm)}.gve-mm-table th,.gve-mm-table td{text-align:left;padding:var(--space-1) var(--space-2);border-bottom:1px solid var(--color-border);white-space:nowrap}.gve-mm-table th{vertical-align:bottom;border-bottom-width:2px}.gve-mm-table tbody tr:last-child td{border-bottom:none}.gve-mm-table td.gve-mm-num,.gve-mm-table th.gve-mm-num{text-align:right}.gve-mm-table td.gve-mm-num{font-variant-numeric:tabular-nums;font-family:var(--font-mono)}.gve-rollup-mark{margin-left:var(--space-2);padding:0 var(--space-1);border:1px solid var(--color-border);border-radius:var(--radius-sm);font-size:var(--text-xs);font-family:inherit;color:var(--color-text-dim);vertical-align:middle}.gve-mm-table th.gve-mm-num .gve-plain-title{align-items:flex-end}.gve-mm-table tr[data-verdict=na] td{color:var(--color-text-dim)}.gve-verdict{display:inline-block;font-size:var(--text-xs);font-weight:600;padding:1px var(--space-2);border-radius:999px;border:1px solid}.gve-verdict[data-state=ok]{color:var(--color-ok);border-color:var(--color-ok)}.gve-verdict[data-state=info]{color:var(--color-accent);border-color:var(--color-accent)}.gve-verdict[data-state=warn]{color:var(--color-warn);border-color:var(--color-warn)}.gve-verdict[data-state=na]{color:var(--color-text-dim);border-color:var(--color-border);font-weight:400;font-style:italic}.gve-fit-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-3)}.gve-fit-row{display:grid;grid-template-columns:170px 1fr;align-items:center;gap:var(--space-3)}.gve-fit-row{grid-template-columns:170px 1fr auto}.gve-fit-name{font-size:var(--text-sm);cursor:help}.gve-fit-name .plain{display:block}.gve-fit-name .tech{display:block;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-dim)}.gve-fit-name .tech[data-only=true]{font-size:var(--text-sm);color:var(--color-text)}.gve-fit-scale{position:relative;height:20px;background:var(--color-surface-2);border:1px solid var(--color-border);border-radius:var(--radius-sm)}.gve-fit-fill{position:absolute;top:0;bottom:0;left:0;background:var(--color-accent);border-radius:var(--radius-sm) 0 0 var(--radius-sm)}.gve-fit-tick{position:absolute;top:0;bottom:0;width:1px;background:var(--color-border)}.gve-fit-val{position:absolute;top:50%;transform:translateY(-50%);font-family:var(--font-mono);font-size:var(--text-xs);font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--color-text);margin-left:var(--space-1);padding:0 3px;background:var(--color-surface);border-radius:2px}.gve-fit-was{position:absolute;top:2px;bottom:2px;width:2px;background:var(--color-text-dim);opacity:.55;border-radius:1px}.gve-fit-delta{font-family:var(--font-mono);font-size:var(--text-xs);font-variant-numeric:tabular-nums;text-align:right;min-width:5ch;color:var(--color-text-dim)}.gve-fit-axis{display:grid;grid-template-columns:170px 1fr auto;gap:var(--space-3);font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-dim)}.gve-fit-axis .marks{display:flex;justify-content:space-between}.gve-arch-count{margin-bottom:var(--space-3);color:var(--color-text-dim);font-size:var(--text-sm)}.gve-arch-table{border-collapse:collapse;width:100%;font-size:var(--text-sm);margin-bottom:var(--space-3)}.gve-arch-table th,.gve-arch-table td{text-align:left;padding:var(--space-1) var(--space-2);border-bottom:1px solid var(--color-border)}.gve-arch-table th{font-size:var(--text-xs);text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-dim);font-weight:600}.gve-arch-table .gve-arch-num{text-align:right;font-family:var(--font-mono);font-variant-numeric:tabular-nums}.gve-arch-table td[data-applicable=true]{color:var(--color-ok);font-weight:600}.gve-arch-table td[data-applicable=false]{color:var(--color-warn)}.gve-arch-table td[data-applicable=null]{color:var(--color-text-dim)}.gve-fr-svg{width:100%;height:auto;display:block;margin:var(--space-2) 0}.gve-fr-now{font-size:var(--text-sm);margin-bottom:var(--space-2)}.gve-fr-now .gve-kpi-value[data-tone=ok]{color:var(--color-ok)}.gve-fr-axis{stroke:var(--color-border);stroke-width:1}.gve-fr-axis-label{fill:var(--color-text-dim);font-size:var(--text-xs);font-family:var(--font-mono)}.gve-fr-path{stroke:var(--color-accent);stroke-width:2;stroke-linejoin:round}.gve-fr-last{fill:var(--color-accent)}.gve-fr-errorfree{font-size:var(--text-sm);font-weight:600}.gve-fr-errorfree[data-tone=ok]{color:var(--color-ok)}.gve-fr-errorfree[data-tone=warn]{color:var(--color-warn)}.gve-fr-sev{stroke-width:1.25;stroke-linejoin:round;opacity:.8}.gve-fr-sev[data-sev=errors]{stroke:var(--color-error)}.gve-fr-sev[data-sev=warnings]{stroke:var(--color-warn)}.gve-fr-sev[data-sev=infos]{stroke:var(--color-text-dim)}.gve-fr-severity{margin-top:var(--space-1);font-size:var(--text-sm);color:var(--color-text-dim)}.gve-fr-caveat{margin-top:var(--space-2);padding-left:var(--space-2);border-left:2px solid var(--color-warn);font-size:var(--text-xs);color:var(--color-text-dim)}.gve-rid[data-explained=true]{cursor:help;border-bottom:1px dotted var(--color-text-dim)}.gve-nextmove-what{margin:0 0 var(--space-2);font-weight:600}.gve-nextmove-prompt{margin:0 0 var(--space-2)}.gve-nextmove-prompt code{display:inline-block;padding:var(--space-1) var(--space-2);border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-surface-alt);font-family:var(--font-mono);-webkit-user-select:all;user-select:all}.gve-nextmove-why{margin:0;color:var(--color-text-dim)}.gve-nextmove-alt{margin-top:var(--space-3);border-top:1px solid var(--color-border);padding-top:var(--space-2)}.gve-nextmove-alt>summary{cursor:pointer;color:var(--color-text-dim)}a.gve-btn{text-decoration:none;display:inline-block}.gve-appbar .title{font-size:var(--text-base);display:flex;align-items:baseline;gap:var(--space-2)}.gve-appbar .title .project{font-size:var(--text-lg);font-weight:600;color:var(--color-text)}.gve-appbar .title .tool{font-size:var(--text-sm);font-weight:400;color:var(--color-text-dim)}.gve .gve{height:auto;flex:1;min-height:0}.gve-chip .dash{width:12px;height:0;border-top:2px solid var(--color-text-dim)}.gve .gve-body{flex:1;min-height:0}.gve-canvas,.gve-explorer .exp-tree,.gve-details{overflow:auto}.gve-tree .tw{cursor:pointer;-webkit-user-select:none;user-select:none}.gve-tree .row.sel{box-shadow:inset 2px 0 0 var(--color-accent)}.gve-tree .row.dim{opacity:.45;cursor:default}.gve-grid-scroll{overflow:auto;flex:1;min-height:0}.gve-grid{border-collapse:collapse;font-size:var(--text-sm)}.gve-grid th,.gve-grid td{border:1px solid var(--color-border);padding:var(--space-1) var(--space-2);text-align:left;white-space:nowrap}.gve-grid thead th{position:sticky;top:0;z-index:1;cursor:pointer;-webkit-user-select:none;user-select:none;background:var(--color-surface-alt, var(--color-surface));color:var(--color-text)}.gve-grid thead th.corner{left:0;z-index:2}.gve-grid td.rowhead,.gve-grid th.corner{font-weight:600}.gve-grid td.rowhead{position:sticky;left:0;background:var(--color-surface)}.gve-grid td.hit{background:var(--color-accent-soft);color:var(--color-accent);text-align:center;font-weight:600}.tabular-grid th,.tabular-grid td{max-width:20rem}.tabular-grid:not(.wrap) th,.tabular-grid:not(.wrap) td{overflow:hidden;text-overflow:ellipsis}.tabular-grid.wrap th,.tabular-grid.wrap td{white-space:normal;word-break:break-word;vertical-align:top}.gve-group.tabs .gve-chip.active{background:var(--color-accent-soft);color:var(--color-accent);border-color:var(--color-accent)}.gve-details .det-group{margin-top:var(--space-2)}.gve-details .det-head,.gve-details .det-link{display:flex;align-items:baseline;gap:6px;width:100%;font:inherit;text-align:left;background:none;border:none;border-radius:var(--radius-sm);cursor:pointer;color:inherit}.gve-details .det-head{padding:0;font-size:var(--text-xs);color:var(--color-text-dim)}.gve-details .det-head:hover{color:var(--color-text)}.gve-details .det-head .tw{width:10px;flex:none}.gve-details .det-head .roll{margin-left:auto;font-variant-numeric:tabular-nums;white-space:nowrap}.gve-details .det-link{flex-wrap:wrap;padding:1px var(--space-1)}.gve-details .det-link:hover{background:var(--color-accent-soft)}.gve-details .det-code-where{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-1);padding-left:16px}.gve-details .det-code-where .sub{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-dim);overflow-wrap:anywhere}.gve-details .det-code{margin:var(--space-1) 0 0;padding:var(--space-1) var(--space-2);max-height:320px;overflow:auto;font-family:var(--font-mono);font-size:var(--text-xs);background:var(--color-surface-alt, var(--color-surface));border:1px solid var(--color-border);border-radius:4px}.gve-details .det-link .dot{width:8px;height:8px;border-radius:2px;flex:none;align-self:center}.gve-details .det-link .nm{flex:1;min-width:0;overflow-wrap:anywhere}.gve-details .det-link .sub{flex-basis:100%;padding-left:14px;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-dim);overflow-wrap:anywhere}.gve-details .det-link .st.done{color:var(--color-ok)}.rr{background:var(--color-bg)}.rr .mono{font-family:var(--font-mono);font-size:var(--text-xs);color:var(--color-text-dim)}.rr-bar{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-4);background:var(--color-surface);border-bottom:1px solid var(--color-border)}.rr-progress{margin-left:auto;font-size:var(--text-sm);font-variant-numeric:tabular-nums}.rr-band{position:sticky;top:0;z-index:2;display:flex;align-items:baseline;gap:var(--space-2);padding:var(--space-2) var(--space-4);background:var(--color-bg);border:none;border-bottom:1px solid var(--color-border);width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer}.rr-band:hover{background:var(--color-surface-2)}.rr-band .tw{width:10px;flex:none;font-size:var(--text-xs);color:var(--color-text-dim)}.rr-band.closed .name,.rr-band.closed .desc{opacity:.6}.rr-band .dot{width:9px;height:9px;border-radius:2px;align-self:center;flex:none}.rr-band .dot.warn{background:var(--color-error)}.rr-band .name{font-weight:600;white-space:nowrap}.rr-band .desc{flex:1;min-width:0;color:var(--color-text-dim);font-size:var(--text-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rr-band .cnt{font-size:var(--text-xs);color:var(--color-text-dim);font-variant-numeric:tabular-nums;white-space:nowrap}.rr-row{display:grid;grid-template-columns:22px minmax(0,1fr) auto;column-gap:var(--space-2);align-items:start;max-width:1100px;padding:var(--space-2) var(--space-4) var(--space-2) var(--space-3);background:var(--color-surface);border-bottom:1px solid var(--color-border);cursor:pointer}.rr-row:hover{background:var(--color-surface-2)}.rr-row.sel{background:var(--color-accent-soft);box-shadow:inset 3px 0 0 var(--color-accent)}.rr-row.dirty{outline:1px dashed var(--color-accent);outline-offset:-2px}.rr-row.dim{opacity:.28}.rr-row .name{font-weight:600}.rr-row .kind{font-size:var(--text-xs);color:var(--color-text-dim);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:0 var(--space-1);margin:0 var(--space-2)}.rr-row .desc{margin-top:2px;color:var(--color-text-dim);font-size:var(--text-sm);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.rr-row .chev{font:inherit;font-size:var(--text-xs);width:22px;height:22px;cursor:pointer;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--color-text-dim)}.rr-row .chev:hover{background:var(--color-accent-soft);color:var(--color-text)}.rr-row .pill{font:inherit;font-size:var(--text-xs);white-space:nowrap;border-radius:999px;padding:2px var(--space-2);border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text-dim)}.rr-row button.pill{cursor:pointer}.rr-row button.pill:hover{border-color:var(--color-ok)}.rr-row .pill.reviewed{background:var(--color-ok);border-color:var(--color-ok);color:var(--color-text-inverse)}.rr-row .form{grid-column:2 / 4;margin-top:var(--space-2);display:grid;grid-template-columns:90px minmax(0,1fr);gap:var(--space-2);align-items:start;cursor:default}.rr-row .form label{font-size:var(--text-xs);color:var(--color-text-dim);padding-top:6px}.rr-row .form input,.rr-row .form textarea{width:100%;font:inherit;font-size:var(--text-sm);color:var(--color-text);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:var(--space-1) var(--space-2)}.rr-row .form textarea{min-height:96px;resize:vertical;line-height:1.45}.rr-row .form .changed{border-color:var(--color-accent);border-style:dashed}.rr-row .form .actions{grid-column:2;display:flex;gap:var(--space-2);align-items:center}.rr-row .form .hint{font-size:var(--text-xs);color:var(--color-text-dim)}.rr-row .verdict{grid-column:2 / 4;margin-top:var(--space-1);font-size:var(--text-sm);color:var(--color-error)}.rr-row .ev{font-size:var(--text-xs);margin-left:var(--space-2);padding:0 6px;border-radius:8px;border:1px solid currentColor}.rr-row .ev-rot{color:var(--color-error)}.rr-row .ev-ohne{color:var(--color-text-dim)}.rr-row .ev-offen{color:var(--color-warn)}.rr-row .ev-grün{color:var(--color-ok)}:root{--color-bg: #f6f7f9;--color-surface: #ffffff;--color-surface-2: #eef0f3;--color-border: #d7dbe0;--color-text: #1a1d21;--color-text-dim: #5c6470;--color-text-inverse: #ffffff;--color-accent: #2563eb;--color-accent-soft: #dbeafe;--color-ok: #16a34a;--color-warn: #d97706;--color-error: #dc2626;--color-hotspot: #e11d48;--color-type-1: #1f2937;--color-type-2: #db2777;--color-type-3: #0891b2;--color-type-4: #5b21b6;--color-type-5: #4d7c0f;--color-type-6: #86198f;--color-type-7: #3730a3;--color-type-8: #0d9488;--color-type-func: #16a34a;--color-type-flow: #0d9488;--color-type-fchain: #065f46;--color-type-ms: #475569;--color-type-schema: #9333ea;--color-link: #6b7280;--color-state-new: #0ea5e9;--color-state-on-new: #0b1220;--color-state-changed: #eab308;--color-state-on-changed: #1a1d21;--color-state-deleted: #dc2626;--color-state-on-deleted: #ffffff;--color-joint-badge: #e5e7eb;--frame-tint: .08;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-6: 24px;--space-8: 32px;--text-xs: 11px;--text-sm: 12.5px;--text-base: 14px;--text-lg: 16px;--text-xl: 20px;--font-ui: -apple-system, "Segoe UI", Roboto, sans-serif;--font-mono: ui-monospace, "SF Mono", Menlo, monospace;--radius-sm: 4px;--radius-md: 8px;--shadow-1: 0 1px 3px rgba(0,0,0,.12)}@media (prefers-color-scheme: dark){:root{--color-bg: #14161a;--color-surface: #1e2126;--color-surface-2: #262a31;--color-border: #363c45;--color-text: #e8eaed;--color-text-dim: #9aa3af;--color-text-inverse: #14161a;--color-accent: #60a5fa;--color-accent-soft: #1e3a5f;--color-type-1: #e5e7eb;--color-type-2: #ec4899;--color-type-3: #22d3ee;--color-type-4: #a78bfa;--color-type-5: #a3e635;--color-type-6: #d946ef;--color-type-7: #818cf8;--color-type-func: #86efac;--color-type-flow: #2dd4bf;--color-type-fchain: #059669;--color-type-ms: #94a3b8;--color-type-schema: #c084fc;--color-link: #6b7280;--color-state-new: #38bdf8;--color-state-on-new: #0b1220;--color-state-changed: #facc15;--color-state-on-changed: #1a1d21;--color-state-deleted: #ef4444;--color-state-on-deleted: #ffffff;--color-joint-badge: #2f343c;--frame-tint: .16;--shadow-1: 0 1px 3px rgba(0,0,0,.5)}}*{box-sizing:border-box;margin:0}.gve{font-family:var(--font-ui);font-size:var(--text-base);background:var(--color-bg);color:var(--color-text);display:flex;flex-direction:column;height:100vh;overflow:hidden}.gve-bar{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-4);background:var(--color-surface);border-bottom:1px solid var(--color-border);flex-wrap:wrap}.gve-bar .title{font-size:var(--text-lg);font-weight:600;margin-right:var(--space-4)}.gve-bar .title small{color:var(--color-text-dim);font-weight:400;margin-left:var(--space-2)}.gve-group{display:flex;align-items:center;gap:var(--space-1);background:var(--color-surface-2);border:1px solid var(--color-border);border-radius:var(--radius-md);padding:2px var(--space-2)}.gve-group label{font-size:var(--text-xs);color:var(--color-text-dim);margin-right:var(--space-1)}.gve-btn{font:inherit;font-size:var(--text-sm);color:var(--color-text);background:transparent;border:none;border-radius:var(--radius-sm);padding:var(--space-1) var(--space-2);cursor:pointer}.gve-btn:hover{background:var(--color-accent-soft)}.gve-btn.active{background:var(--color-accent);color:var(--color-text-inverse)}.gve-input{font:inherit;font-size:var(--text-sm);color:var(--color-text);background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:var(--space-1) var(--space-2);width:160px}.gve-select{font:inherit;font-size:var(--text-sm);background:var(--color-surface);color:var(--color-text);border:1px solid var(--color-border);border-radius:var(--radius-sm);padding:var(--space-1)}.gve-chip{display:inline-flex;align-items:center;gap:4px;font-size:var(--text-xs);border:1px solid var(--color-border);border-radius:999px;padding:2px var(--space-2);cursor:pointer;background:var(--color-surface);color:var(--color-text)}.gve-chip .dot{width:8px;height:8px;border-radius:50%}.gve-chip.off{opacity:.35}.gve-crumbs{font-size:var(--text-sm);color:var(--color-text-dim)}.gve-crumbs a{color:var(--color-accent);text-decoration:none}.gve-body{flex:1;display:flex;min-height:0}.gve-canvas{flex:1;overflow:auto;position:relative;min-width:0}.gve-explorer{width:260px;flex:0 0 260px;display:flex;flex-direction:column;background:var(--color-surface);border-right:1px solid var(--color-border);overflow:hidden;resize:horizontal}.gve-explorer .exp-tabs{display:flex;border-bottom:1px solid var(--color-border)}.gve-explorer .exp-tab{flex:1;font:inherit;font-size:var(--text-sm);cursor:pointer;background:transparent;border:none;padding:var(--space-2);color:var(--color-text-dim);border-bottom:2px solid transparent}.gve-explorer .exp-tab.active{color:var(--color-text);border-bottom-color:var(--color-accent);font-weight:600}.gve-explorer .exp-tree{flex:1;overflow:auto;padding:var(--space-2) 0;font-size:var(--text-sm)}.gve-tree,.gve-tree ul{list-style:none;margin:0;padding:0}.gve-tree ul{margin-left:14px;border-left:1px solid var(--color-border)}.gve-tree li{position:relative}.gve-tree .row{display:flex;align-items:center;gap:6px;padding:2px var(--space-2);white-space:nowrap;cursor:pointer;border-radius:var(--radius-sm)}.gve-tree .row:hover,.gve-tree .row.sel{background:var(--color-accent-soft)}.gve-tree .tw{width:14px;color:var(--color-text-dim);font-size:1.5em;line-height:.67;flex:none}.gve-tree .ic{width:8px;height:8px;border-radius:2px;flex:none}.gve-tree .ic.ell{border-radius:50%}.gve-tree .lbl{overflow:hidden;text-overflow:ellipsis}.gve-tree .kind{font-size:var(--text-xs);color:var(--color-text-dim)}.gve-details{width:240px;flex:0 0 240px;overflow:auto;background:var(--color-surface);border-left:1px solid var(--color-border);padding:var(--space-3);font-size:var(--text-sm)}.gve-details h4{font-size:var(--text-sm);margin-bottom:var(--space-2)}.gve-details dt{font-size:var(--text-xs);color:var(--color-text-dim);margin-top:var(--space-2)}.gve-details dd{margin:0}.gve-status{display:flex;gap:var(--space-6);align-items:center;padding:var(--space-1) var(--space-4);font-size:var(--text-xs);color:var(--color-text-dim);background:var(--color-surface);border-top:1px solid var(--color-border)}.gve-node rect,.gve-node ellipse{fill:var(--color-surface);stroke:var(--t, var(--color-border));stroke-width:1.5}.gve-node text{font-family:var(--font-ui);font-size:var(--text-sm);fill:var(--color-text)}.gve-node .pill{fill:var(--t)}.gve-node .pill-text{fill:var(--color-text-inverse);font-size:var(--text-xs);font-weight:600}.gve-node.hotspot rect,.gve-node.hotspot ellipse{stroke:var(--color-hotspot);stroke-width:3}.gve-edge{stroke:var(--color-text-dim);fill:none;opacity:.55}.gve-edge.emph{stroke:var(--color-accent);opacity:1}.gve-edge-label{font-size:var(--text-xs);fill:var(--color-text-dim)}.gve-grid{border-collapse:collapse;margin:var(--space-4);font-size:var(--text-sm)}.gve-grid th,.gve-grid td{border:1px solid var(--color-border);padding:var(--space-1) var(--space-2);text-align:left}.gve-grid th{background:var(--color-surface-2);position:sticky;top:0}.gve-grid td.hit{background:var(--color-accent-soft);text-align:center}.gve-grid td.miss{color:var(--color-error);text-align:center}.gve-toast{position:absolute;right:var(--space-4);bottom:var(--space-4);background:var(--color-surface);border:1px solid var(--color-border);border-left:4px solid var(--color-warn);border-radius:var(--radius-md);box-shadow:var(--shadow-1);padding:var(--space-3) var(--space-4);font-size:var(--text-sm);max-width:360px}
package/dist/index.html CHANGED
@@ -4,8 +4,8 @@
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-THFbzRp1.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-OC2jPCGy.css">
7
+ <script type="module" crossorigin src="/assets/index-CfTNfVFl.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-CkDyV1d2.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigloch/graph-view-edit",
3
- "version": "0.17.1",
3
+ "version": "0.19.0",
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": {
@@ -10,7 +10,8 @@
10
10
  "dist",
11
11
  "bin",
12
12
  "vite.config.js",
13
- "src/config.mjs"
13
+ "src/config.mjs",
14
+ "src/code-lookup.mjs"
14
15
  ],
15
16
  "scripts": {
16
17
  "dev": "vite",
@@ -21,9 +22,9 @@
21
22
  },
22
23
  "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.",
23
24
  "dependencies": {
24
- "@sigloch/contracts": ">=12 <13",
25
- "@sigloch/graph-api-core": ">=5.10.3 <6",
26
- "@sigloch/graphcode-client": ">=3.1 <4",
25
+ "@sigloch/contracts": ">=12.9 <13",
26
+ "@sigloch/graph-api-core": ">=5.11 <6",
27
+ "@sigloch/graphcode-client": ">=3.2 <4",
27
28
  "@sigloch/se-engine": ">=3 <4",
28
29
  "@vitejs/plugin-react": "^4.3.4",
29
30
  "vite": "^5.4.11",
@@ -31,7 +32,7 @@
31
32
  },
32
33
  "devDependencies": {
33
34
  "@playwright/test": "^1.58.2",
34
- "@sigloch/graphcode": ">=0.30 <1",
35
+ "@sigloch/graphcode": "^0.36.0",
35
36
  "@tanstack/react-table": "^8.20.5",
36
37
  "@testing-library/react": "^16.0.1",
37
38
  "elkjs": "^0.11.1",
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Code einer FUNC (CR-GVE-390) — Server-Seite. Der `realRef` kommt aus dem Graphen, nie aus der Anfrage: der Browser
3
+ * nennt nur die FUNC, kann also keine beliebige Datei lesen oder öffnen.
4
+ *
5
+ * Eine FUNC ohne Code ist ein gültiger Stand, kein Fehler: ein Block hat seinen Code in den Teilen (`block`), eine
6
+ * ungebaute Funktion noch keinen (`missing`). Ein Skill hat kein `symbol`: die Datei ist die Funktion, Zeile 1.
7
+ *
8
+ * @author andreas@siglochconsulting
9
+ */
10
+ import { spawn } from 'node:child_process';
11
+ import { existsSync, readFileSync } from 'node:fs';
12
+ import { isAbsolute, relative, resolve } from 'node:path';
13
+
14
+ /** So viele Zeilen ab dem Symbol zeigt die Detailspalte. */
15
+ export const EXCERPT_LINES = 40;
16
+
17
+ const DECLARES = (name) => new RegExp(`(?:^|\\s)(?:function\\*?|class|const|let|var|def|interface|type|enum)\\s+${name}\\b|^\\s*(?:(?:async|static|public|private|protected)\\s+)*${name}\\s*[(<]`);
18
+
19
+ /** Zeile der Deklaration, sonst der ersten Erwähnung, sonst 1. `Store.load` und `load(graph)` meinen `load`. */
20
+ export function symbolLine(text, symbol) {
21
+ const name = String(symbol).replace(/\(.*$/, '').split(/[.#:]/).pop().trim().replace(/[^\w$]/g, '');
22
+ if (!name) return 1;
23
+ const lines = text.split('\n');
24
+ const declared = DECLARES(name);
25
+ const mentioned = new RegExp(`\\b${name}\\b`);
26
+ const at = lines.findIndex((l) => declared.test(l));
27
+ return (at === -1 ? lines.findIndex((l) => mentioned.test(l)) : at) + 1 || 1;
28
+ }
29
+
30
+ /**
31
+ * @param {{elements?: object[], traces?: object[]}} graph
32
+ * @param {string} funcId
33
+ * @param {string} repoRoot
34
+ * @returns {{status: 'ok', file: string, path: string, line: number, total: number, excerpt: string[]}
35
+ * | {status: 'block', parts: number} | {status: 'missing'} | {status: 'no-file', file: string} | {status: 'unknown'}}
36
+ */
37
+ export function codeOf(graph, funcId, repoRoot) {
38
+ const elements = graph?.elements ?? [];
39
+ const el = elements.find((e) => e.id === funcId);
40
+ if (el?.type !== 'FUNC') return { status: 'unknown' };
41
+ const ref = el.realRef;
42
+ if (!ref?.file) {
43
+ const isFunc = new Set(elements.filter((e) => e.type === 'FUNC').map((e) => e.id));
44
+ const parts = (graph.traces ?? []).filter((t) => t.type === 'compose' && t.source === funcId && isFunc.has(t.target)).length;
45
+ return parts ? { status: 'block', parts } : { status: 'missing' };
46
+ }
47
+ const path = resolve(repoRoot, ref.file);
48
+ const inside = relative(repoRoot, path);
49
+ if (inside.startsWith('..') || isAbsolute(inside) || !existsSync(path)) return { status: 'no-file', file: ref.file };
50
+ const text = readFileSync(path, 'utf8');
51
+ const lines = text.split('\n');
52
+ const line = ref.symbol ? symbolLine(text, ref.symbol) : 1;
53
+ return { status: 'ok', file: ref.file, path, line, total: lines.length, excerpt: lines.slice(line - 1, line - 1 + EXCERPT_LINES) };
54
+ }
55
+
56
+ /**
57
+ * Startet den Editor (`config.editor.command`) ohne Shell an `<pfad>:<zeile>`.
58
+ * @returns {Promise<{success: true} | {success: false, error: string}>}
59
+ */
60
+ export function openInEditor({ path, line }, command, spawnImpl = spawn) {
61
+ const [bin, ...args] = command;
62
+ return new Promise((done) => {
63
+ const child = spawnImpl(bin, [...args, `${path}:${line}`], { stdio: 'ignore', detached: true });
64
+ child.once('error', (e) => done({ success: false, error: `Editor nicht gestartet: ${bin} (${e.code ?? e.message})` }));
65
+ child.once('spawn', () => {
66
+ child.unref();
67
+ done({ success: true });
68
+ });
69
+ });
70
+ }
package/src/config.mjs CHANGED
@@ -87,6 +87,12 @@ export const ConfigSchema = z.object({
87
87
  actorConnectorThreshold: z.number().int().nonnegative().default(3),
88
88
  })
89
89
  .prefault({}),
90
+ // CR-GVE-390: Befehl für „Im Editor öffnen"; der Server hängt `<pfad>:<zeile>` an.
91
+ editor: z
92
+ .object({
93
+ command: z.array(z.string().min(1)).min(1).default(['code', '-g']),
94
+ })
95
+ .prefault({}),
90
96
  });
91
97
 
92
98
  export function loadConfig(path = process.env.GVE_CONFIG_PATH || resolve(process.cwd(), 'config.json')) {
package/vite.config.js CHANGED
@@ -1,4 +1,4 @@
1
- import { readFileSync, writeFileSync, mkdirSync, unlinkSync, existsSync, readdirSync, realpathSync, statSync, watch } from 'node:fs';
1
+ import { readFileSync, writeFileSync, mkdirSync, unlinkSync, existsSync, readdirSync, realpathSync, statSync } from 'node:fs';
2
2
  import { execFileSync } from 'node:child_process';
3
3
  import { join, basename, dirname, sep } from 'node:path';
4
4
  import { createRequire } from 'node:module';
@@ -38,9 +38,12 @@ import {
38
38
  groupViolations,
39
39
  countByStage,
40
40
  callHost,
41
+ readHostSnapshot,
42
+ subscribeHost,
41
43
  HOST_SOCK_BASENAME,
42
44
  } from '@sigloch/graphcode-client';
43
45
  import { loadConfig } from './src/config.mjs';
46
+ import { codeOf, openInEditor } from './src/code-lookup.mjs';
44
47
 
45
48
  /**
46
49
  * Static config (CR-GVE-138 / REQ-ops-config-static) — loadConfig validates
@@ -83,6 +86,14 @@ function resolveRepoRoot() {
83
86
  return process.env.GVE_REPO_ROOT || process.cwd();
84
87
  }
85
88
 
89
+ /** Der Graph dieses Repos: der konfigurierte Pfad, sonst die erste Datei in docs/graph/. */
90
+ function servedGraphPath(repoRoot) {
91
+ if (existsSync(join(repoRoot, APP_CONFIG.graph.path))) return APP_CONFIG.graph.path;
92
+ const graphDir = join(repoRoot, 'docs', 'graph');
93
+ const hit = existsSync(graphDir) ? readdirSync(graphDir).find((f) => f.endsWith('.graph.json')) : null;
94
+ return hit ? `docs/graph/${hit}` : APP_CONFIG.graph.path;
95
+ }
96
+
86
97
  /**
87
98
  * The repo this instance serves, as a PHYSICAL path — the identity signal a
88
99
  * launcher needs to tell "the viewer already serving MY repo" apart from "some
@@ -222,6 +233,8 @@ function graphStaticPlugin() {
222
233
  res.setHeader('Content-Type', 'application/json');
223
234
  // Die Frische-Ampel der Doc-View vergleicht gegen diesen Stempel.
224
235
  res.setHeader('Last-Modified', statSync(filePath).mtime.toUTCString());
236
+ // Ohne Cache-Control hält der Browser die Datei heuristisch und zeigt nach einem Export den alten Stand.
237
+ res.setHeader('Cache-Control', 'no-cache');
225
238
  res.end(readFileSync(filePath));
226
239
  };
227
240
  return {
@@ -259,13 +272,7 @@ function configApiPlugin() {
259
272
  const repoRoot = resolveRepoRoot();
260
273
  const config = structuredClone(APP_CONFIG);
261
274
  config.repoRoot = servedRepoRoot();
262
- if (!existsSync(join(repoRoot, config.graph.path))) {
263
- const graphDir = join(repoRoot, 'docs', 'graph');
264
- const hit = existsSync(graphDir)
265
- ? readdirSync(graphDir).find((f) => f.endsWith('.graph.json'))
266
- : null;
267
- if (hit) config.graph.path = `docs/graph/${hit}`;
268
- }
275
+ config.graph.path = servedGraphPath(repoRoot);
269
276
  res.setHeader('Content-Type', 'application/json');
270
277
  res.end(JSON.stringify(config));
271
278
  };
@@ -468,14 +475,12 @@ function cohesionRollup(rawModules) {
468
475
  * woher Modulzahlen, Schwellen und Zielmarke kommen, und die es ANSAGT.
469
476
  *
470
477
  * Mit Host: alles aus `graph_metrics`, unverändert durchgereicht — Modulzeilen,
471
- * `policy`/`policySource` (CR-GC-329) und `fit` mit Ist-Vektor, Zielgewichten,
472
- * Zielwerten und der Widerspruchsliste (CR-GC-451/457).
478
+ * `policy`/`policySource` (CR-GC-329) und `fit` mit dem Ist-Vektor (CR-GC-451).
473
479
  *
474
480
  * Ohne Host: der bisherige lokale Weg, und `origin: 'local'` mit `reason` sagt es
475
481
  * an — dasselbe Muster wie `readinessSource`. Was der lokale Weg NICHT kennt, ist
476
482
  * dann `null`, nie ein erfundener Wert: `fit` gibt es lokal gar nicht (der
477
- * Ist-Vektor kommt aus der se-engine, die gve nicht lädt), und aus dem Zielprofil
478
- * liest der Fallback nur die Gewichte.
483
+ * Ist-Vektor kommt aus der se-engine, die gve nicht lädt).
479
484
  */
480
485
  export function architecturePayload({ hostMetrics, hostError, ontologyJson, repoRoot }) {
481
486
  if (hostMetrics) {
@@ -500,13 +505,10 @@ export function architecturePayload({ hostMetrics, hostError, ontologyJson, repo
500
505
  policySource: local.source,
501
506
  // CR-GVE-280: der Grund reist mit, sonst ist `invalid` eine Behauptung ohne Fundstelle.
502
507
  ...(local.reason ? { policyError: local.reason } : {}),
503
- // Der Ist-Vektor ist eine Host-Zahl; ohne Host gibt es ihn nicht. Die
504
- // Zielrichtung aus der Profildatei bleibt lesbar, der Zielwert kommt bewusst
505
- // NICHT mit: er ist nur zusammen mit dem Ist-Wert sinnvoll, gegen den er steht.
508
+ // Der Ist-Vektor ist eine Host-Zahl; ohne Host gibt es ihn nicht.
506
509
  fit: null,
507
510
  // Ebenso host-only: ohne Host keine Kettenzahl je FUNC, also null, nicht [].
508
511
  functions: null,
509
- profile: targetProfilePayload(repoRoot),
510
512
  };
511
513
  }
512
514
 
@@ -557,23 +559,6 @@ export function architectureFindings(violations, suggest) {
557
559
  });
558
560
  }
559
561
 
560
- /**
561
- * Das hinterlegte Zielprofil (CR-GC-295, committete Steuer-Config
562
- * `.graphcode/target-profile.json` des bedienten Repos) — nur GELESEN für die
563
- * Zielmarken der Karte 2. Fehlt es oder ist es unlesbar: null — die Karte
564
- * zeigt dann den Hinweis statt einer erfundenen Zielrichtung (AC 4).
565
- */
566
- export function targetProfilePayload(repoRoot) {
567
- const file = join(repoRoot, '.graphcode', 'target-profile.json');
568
- if (!existsSync(file)) return null;
569
- try {
570
- const { weights } = JSON.parse(readFileSync(file, 'utf8'));
571
- return weights && typeof weights === 'object' ? { weights } : null;
572
- } catch {
573
- return null;
574
- }
575
- }
576
-
577
562
  /**
578
563
  * DIE Regel-Engine-Konstruktion — eine für den Live-Stand (buildDashboard)
579
564
  * und für die History-Messung (CR-GC-410): derselbe Messpfad, keine zweite
@@ -696,14 +681,13 @@ export async function fetchHostReadiness(repoRoot, callHostImpl = callHost) {
696
681
  * Die Architektur-Kennzahlen vom HOST (CR-GVE-272) — dieselbe Linie wie
697
682
  * `fetchHostReadiness` eine Etage höher: der Host besitzt die Zahlen.
698
683
  *
699
- * Vorher beantwortete gve dieselbe Frage an DREI Stellen lokal: `cohesionPayload`
684
+ * Vorher beantwortete gve dieselbe Frage lokal: `cohesionPayload`
700
685
  * rechnete `moduleMetrics()` über die COMMITTETE Datei (der Host misst den
701
686
  * Live-Store — zwischen Mutation und Export sagen die zwei Verschiedenes),
702
- * `readMetricPolicy` las `graphcode.config.jsonc` selbst, und
703
- * `targetProfilePayload` las das Zielprofil selbst und behielt daraus nur die
704
- * Gewichte. Genau diese Aufteilung verbietet CR-GC-329/451/457: Wert, Schwelle
705
- * und Zielmarke verlassen den Host in EINER Antwort, und wer eine davon selbst
706
- * hält, ist eine zweite Quelle für dieselbe Zahl.
687
+ * und `readMetricPolicy` las `graphcode.config.jsonc` selbst. Genau diese
688
+ * Aufteilung verbietet CR-GC-329/451: Wert und Schwelle verlassen den Host in
689
+ * EINER Antwort, und wer eine davon selbst hält, ist eine zweite Quelle für
690
+ * dieselbe Zahl.
707
691
  *
708
692
  * `modules` UND `policy` müssen da sein, sonst ist die Antwort nicht verwertbar:
709
693
  * ein alter Host (vor CR-GC-329) liefert Zeilen ohne Schwellen, und eine Karte,
@@ -1220,9 +1204,8 @@ function dashboardApiPlugin() {
1220
1204
  // CR-GVE-262: die zwei Architektur-Karten — Kohäsion aus der
1221
1205
  // graph_metrics-Referenzrechnung (contracts moduleMetrics, auf dem RAW
1222
1206
  // OntologyGraph der committeten Datei), Befunde aus demselben
1223
- // Engine-Lauf wie rules_evaluate, applicable/Zielmarken aus
1224
- // graph_suggest + Zielprofil.
1225
- // CR-GVE-272: Modulzahlen, Schwellen und Zielmarke kommen aus EINER
1207
+ // Engine-Lauf wie rules_evaluate, applicable aus graph_suggest.
1208
+ // CR-GVE-272: Modulzahlen, Schwellen und Ist-Vektor kommen aus EINER
1226
1209
  // Host-Antwort (graph_metrics) statt aus drei lokalen Pfaden; `origin`
1227
1210
  // sagt an, wenn stattdessen der Fallback gerechnet hat. `findings` bleibt,
1228
1211
  // was es war — ein Filter über die vorhandenen Violations, keine Rechnung.
@@ -1508,15 +1491,66 @@ function mutateApiPlugin() {
1508
1491
  }
1509
1492
 
1510
1493
  /**
1511
- * SSE Invalidate hub (CR-GVE-139 / REQ-live-sse), factored out of the plugin
1512
- * HTTP glue for direct unit-testability (same DI pattern as
1513
- * handleMutateRequest). GET /api/events holds the response open as a
1514
- * text/event-stream client; broadcast() pushes an `invalidate`
1515
- * LiveUpdateEvent naming the affected domains, which sse-client.mjs
1516
- * (createSSEClient) hands to each panel for a SELECTIVE refresh.
1494
+ * GET /api/code?func=<id> und POST /api/open-code { funcId } (CR-GVE-390) — der Code einer FUNC für die Detailspalte
1495
+ * und der Start des Editors. Beide lesen den `realRef` aus dem Graphen auf der Platte; siehe src/code-lookup.mjs.
1496
+ */
1497
+ function codeApiPlugin() {
1498
+ const repoRoot = resolveRepoRoot();
1499
+ const locate = (funcId) => codeOf(JSON.parse(readFileSync(join(repoRoot, servedGraphPath(repoRoot)), 'utf8')), funcId, repoRoot);
1500
+ const send = (res, status, body) => {
1501
+ res.statusCode = status;
1502
+ res.setHeader('Content-Type', 'application/json');
1503
+ res.end(JSON.stringify(body));
1504
+ };
1505
+
1506
+ const middleware = (req, res, next) => {
1507
+ const url = new URL(req.url ?? '/', 'http://localhost');
1508
+ if (url.pathname === '/api/code') {
1509
+ const code = locate(url.searchParams.get('func'));
1510
+ send(res, code.status === 'unknown' ? 404 : 200, code);
1511
+ return;
1512
+ }
1513
+ if (url.pathname !== '/api/open-code' || req.method !== 'POST') return next();
1514
+ let raw = '';
1515
+ req.on('data', (chunk) => { raw += chunk; });
1516
+ req.on('end', async () => {
1517
+ let funcId;
1518
+ try {
1519
+ ({ funcId } = JSON.parse(raw));
1520
+ } catch {
1521
+ send(res, 400, { success: false, error: 'invalid JSON body' });
1522
+ return;
1523
+ }
1524
+ const code = locate(funcId);
1525
+ if (code.status !== 'ok') {
1526
+ send(res, 404, { success: false, error: `kein Code zu ${funcId}: ${code.status}` });
1527
+ return;
1528
+ }
1529
+ send(res, 200, await openInEditor(code, APP_CONFIG.editor.command));
1530
+ });
1531
+ };
1532
+
1533
+ return {
1534
+ name: 'gve-code-api',
1535
+ configureServer(server) {
1536
+ server.middlewares.use(middleware);
1537
+ },
1538
+ configurePreviewServer(server) {
1539
+ server.middlewares.use(middleware);
1540
+ },
1541
+ };
1542
+ }
1543
+
1544
+ /**
1545
+ * SSE hub (CR-GVE-139 / REQ-live-sse), factored out of the plugin HTTP glue for direct unit-testability (same DI
1546
+ * pattern as handleMutateRequest). GET /api/events holds the response open as a text/event-stream client; `broadcast`
1547
+ * forwards a host event unchanged under its own type, sse-client.mjs hands it on. A new client hears at once whether
1548
+ * a host is there and at which version: that is its gap check after a reconnect (CR-GVE-394).
1517
1549
  */
1518
1550
  export function createEventsHub() {
1519
1551
  const clients = new Set();
1552
+ let host = { type: 'host', connected: false };
1553
+ const frameOf = (event) => `event: ${event.type}\ndata: ${JSON.stringify(event)}\n\n`;
1520
1554
  return {
1521
1555
  middleware(req, res, next) {
1522
1556
  if (req.url !== '/api/events') return next();
@@ -1525,12 +1559,14 @@ export function createEventsHub() {
1525
1559
  'Cache-Control': 'no-cache',
1526
1560
  Connection: 'keep-alive',
1527
1561
  });
1528
- res.write('retry: 3000\n\n');
1562
+ res.write(`retry: 3000\n\n${frameOf(host)}`);
1529
1563
  clients.add(res);
1530
1564
  req.on('close', () => clients.delete(res));
1531
1565
  },
1532
- broadcast(domains) {
1533
- const frame = `event: invalidate\ndata: ${JSON.stringify({ domains })}\n\n`;
1566
+ broadcast(event) {
1567
+ if (event.type === 'host') host = event;
1568
+ else if (event.version !== undefined) host = { ...host, version: event.version };
1569
+ const frame = frameOf(event);
1534
1570
  for (const res of clients) res.write(frame);
1535
1571
  },
1536
1572
  clientCount: () => clients.size,
@@ -1538,39 +1574,98 @@ export function createEventsHub() {
1538
1574
  }
1539
1575
 
1540
1576
  /**
1541
- * GET /api/events (CR-GVE-139). The invalidate TRIGGER is a watcher on
1542
- * docs/graph/*.graph.json — the single point every write converges on
1543
- * (own edits via /api/mutate's post-mutate export AND external writers like
1544
- * a graphcode MCP session exporting), so there's exactly one refresh path
1545
- * instead of a per-writer special case. A graph change also invalidates
1546
- * rules/readiness — both are derived from the same committed file.
1577
+ * Das Abo am Host (CR-GVE-356, CR-GVE-394): reicht jedes Event an die Browser und meldet, ob ein Host da ist. Stirbt
1578
+ * der Host, baut der Nachfolger seinen Socket neu auf; bis dahin läuft der Versuch im Takt `retryMs` weiter.
1547
1579
  */
1548
- function eventsApiPlugin() {
1549
- const hub = createEventsHub();
1550
- const graphDir = join(resolveRepoRoot(), 'docs', 'graph');
1551
- let debounce = null;
1552
- function armWatcher() {
1553
- if (!existsSync(graphDir)) return;
1554
- const watcher = watch(graphDir, (eventType, filename) => {
1555
- if (!filename?.endsWith('.graph.json')) return;
1556
- clearTimeout(debounce);
1557
- debounce = setTimeout(() => hub.broadcast(['graph', 'rules', 'readiness']), 150);
1580
+ export function startHostFeed({ socketPath, hub, subscribe = subscribeHost, retryMs = 1000 }) {
1581
+ let sub = null;
1582
+ let timer = null;
1583
+ let stopped = false;
1584
+ const connect = () => {
1585
+ sub = subscribe(socketPath, (frame) => {
1586
+ if (frame.type === 'snapshot') hub.broadcast({ type: 'host', connected: true, version: frame.version });
1587
+ else hub.broadcast(frame);
1588
+ }, () => {
1589
+ if (stopped) return;
1590
+ hub.broadcast({ type: 'host', connected: false });
1591
+ timer = setTimeout(connect, retryMs);
1592
+ timer.unref?.();
1558
1593
  });
1559
- // Never hold the process open (vitest runs this config's plugins too —
1560
- // an un-unref'd FSWatcher kept its worker from exiting).
1561
- watcher.unref();
1594
+ };
1595
+ connect();
1596
+ return { stop() { stopped = true; clearTimeout(timer); sub?.close(); } };
1597
+ }
1598
+
1599
+ /**
1600
+ * GET /api/graph (CR-GVE-356): der ganze Graph samt Version beim Host. 503 = kein Host, 409 = der Viewer zeigt per
1601
+ * `graph.path` einen anderen Graphen, als der Host bedient: beide Antworten schicken den Browser an die Datei.
1602
+ */
1603
+ export function createGraphApi({ repoRoot, readSnapshot = readHostSnapshot }) {
1604
+ return async (req, res, next) => {
1605
+ if (req.url !== '/api/graph') return next();
1606
+ res.setHeader('Content-Type', 'application/json');
1607
+ res.setHeader('Cache-Control', 'no-store');
1608
+ if (!servedGraphPath(repoRoot).startsWith('docs/graph/')) {
1609
+ res.statusCode = 409;
1610
+ res.end(JSON.stringify({ error: 'graph.path zeigt nicht auf den Graphen des Hosts' }));
1611
+ return;
1612
+ }
1613
+ try {
1614
+ const { version, formatE } = await readSnapshot(join(repoRoot, '.graphcode', HOST_SOCK_BASENAME));
1615
+ res.end(JSON.stringify({ version, formatE }));
1616
+ } catch (err) {
1617
+ res.statusCode = 503;
1618
+ res.end(JSON.stringify({ error: err.message }));
1619
+ }
1620
+ };
1621
+ }
1622
+
1623
+ /**
1624
+ * Wer hat seit dem Commit was geändert (CR-GVE-358): je uid der letzte `consumerId` aus dem Audit. `commands` nennen
1625
+ * den Batch, nicht seine Kaskaden; ein mitgelöschtes Element trägt deshalb keinen Urheber.
1626
+ */
1627
+ export function authorsSince(auditText, since) {
1628
+ const authors = {};
1629
+ for (const line of auditText.split('\n')) {
1630
+ if (!line.trim()) continue;
1631
+ const entry = JSON.parse(line);
1632
+ if (entry.result !== 'applied' || entry.timestamp <= since) continue;
1633
+ for (const c of entry.commands ?? []) {
1634
+ const uid = c.node?.uid ?? c.uid ?? c.targetUid;
1635
+ if (uid) authors[uid] = entry.consumerId;
1636
+ }
1562
1637
  }
1563
- return {
1564
- name: 'gve-events-api',
1565
- configureServer(server) {
1566
- armWatcher();
1567
- server.middlewares.use(hub.middleware);
1568
- },
1569
- configurePreviewServer(server) {
1570
- armWatcher();
1571
- server.middlewares.use(hub.middleware);
1572
- },
1638
+ return authors;
1639
+ }
1640
+
1641
+ /** GET /api/changes (CR-GVE-358): der Graph im letzten Commit samt Urhebern. Vergleichen tut der Browser. */
1642
+ export function createChangesApi({ repoRoot, git = gitOut }) {
1643
+ return (req, res, next) => {
1644
+ if (req.url !== '/api/changes') return next();
1645
+ res.setHeader('Content-Type', 'application/json');
1646
+ res.setHeader('Cache-Control', 'no-store');
1647
+ const path = servedGraphPath(repoRoot);
1648
+ const text = git(repoRoot, ['show', `HEAD:${path}`]);
1649
+ if (!text) return res.end(JSON.stringify({ base: null, authors: {} }));
1650
+ const since = new Date(git(repoRoot, ['log', '-1', '--format=%cI', '--', path]).trim()).toISOString();
1651
+ const audit = join(repoRoot, '.graphcode', 'audit.jsonl');
1652
+ res.end(JSON.stringify({ base: JSON.parse(text), authors: existsSync(audit) ? authorsSince(readFileSync(audit, 'utf8'), since) : {} }));
1653
+ };
1654
+ }
1655
+
1656
+ function eventsApiPlugin() {
1657
+ const hub = createEventsHub();
1658
+ const repoRoot = resolveRepoRoot();
1659
+ const graphApi = createGraphApi({ repoRoot });
1660
+ const changesApi = createChangesApi({ repoRoot });
1661
+ const wire = (server) => {
1662
+ const feed = startHostFeed({ socketPath: join(repoRoot, '.graphcode', HOST_SOCK_BASENAME), hub });
1663
+ server.httpServer?.once('close', () => feed.stop());
1664
+ server.middlewares.use(hub.middleware);
1665
+ server.middlewares.use(graphApi);
1666
+ server.middlewares.use(changesApi);
1573
1667
  };
1668
+ return { name: 'gve-events-api', configureServer: wire, configurePreviewServer: wire };
1574
1669
  }
1575
1670
 
1576
1671
  /**
@@ -1614,7 +1709,7 @@ function dashboardUrlPlugin() {
1614
1709
  }
1615
1710
 
1616
1711
  export default defineConfig({
1617
- plugins: [react(), graphStaticPlugin(), configApiPlugin(), dashboardApiPlugin(), mutateApiPlugin(), eventsApiPlugin(), dashboardUrlPlugin()],
1712
+ plugins: [react(), graphStaticPlugin(), configApiPlugin(), dashboardApiPlugin(), mutateApiPlugin(), codeApiPlugin(), eventsApiPlugin(), dashboardUrlPlugin()],
1618
1713
  // config.port is the default; an explicit CLI --port (e.g. the test suites'
1619
1714
  // tests/helpers/dev-server.mjs, which picks a free OS-assigned port with
1620
1715
  // --strictPort) still overrides it, per Vite's precedence.