feat: port MCP retrieval and write hardening

- align os MCP/runtime/docs with ra-h contract
- add safe direct node lookup and context-optional flows
- gate edge and context writes behind confirmation
This commit is contained in:
“BeeRad”
2026-04-14 20:57:07 +10:00
parent d825e7a783
commit 929423cb21
35 changed files with 1172 additions and 534 deletions
@@ -315,12 +315,12 @@ export default function NodeSearchModal({
value={explanation}
onChange={(e) => setExplanation(e.target.value.slice(0, 500))}
onKeyDown={(e) => {
if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') {
if ((e.metaKey || e.ctrlKey) && e.key === 'Enter' && explanation.trim()) {
e.preventDefault();
void handleCreate(selectedNode, explanation);
}
}}
placeholder="Describe this connection... (optional, leave blank to auto-infer)"
placeholder="Describe this connection in one clear sentence"
rows={3}
style={{
width: '100%',
@@ -351,7 +351,7 @@ export default function NodeSearchModal({
<button
type="button"
onClick={() => { void handleCreate(selectedNode, explanation); }}
disabled={submitting}
disabled={submitting || !explanation.trim()}
style={{
width: '100%',
display: 'flex',
@@ -368,7 +368,7 @@ export default function NodeSearchModal({
opacity: submitting ? 0.6 : 1,
}}
>
{submitting ? 'Creating…' : explanation.trim() ? 'Create connection' : 'Create connection (auto-infer)'}
{submitting ? 'Creating…' : 'Create connection'}
</button>
</div>
)}