A-7 tools: mesh_approvals reads and steers what was asked; mesh_describe says a mark and its source
The mesh MCP server gains mesh_approvals: with no argument the calls asked on the machine in the last day, newest first, with state and fingerprint, the marks the gate applies with their sources and the catalog revision, and the state's fill against its cap (every machine's keys together); an ask read whole with the act's digest; record asking the hand-act again, and cancel taking an open ask back, each recorded in the hand-act log first and refused when it cannot be. mesh_describe answers needs-approval with its source, and a marked call that reached no one names withheld and mesh-grants.grants_user_list. Builds: design 46 7-approval-mark §18, §6 (the mesh MCP server's withheld answer), §22 (eight tools) Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
@@ -147,3 +148,17 @@ func warranted(conn *bus.Conn) func(asker, ask string, open func() (bool, error)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// gateTools is the gate as mesh_approvals reads it, with its state's fill read from the bucket (§13, §18).
|
||||
type gateTools struct {
|
||||
*approval.Gate
|
||||
state approvalsState
|
||||
}
|
||||
|
||||
func (t gateTools) Fill() (uint64, int64, error) {
|
||||
info, err := t.state.conn.StateInfo(t.state.module, approval.StateName)
|
||||
if err != nil || info == nil {
|
||||
return 0, 0, fmt.Errorf("the state %s's fill cannot be read: %v", approval.StateName, err)
|
||||
}
|
||||
return info.Bytes, info.MaxBytes, nil
|
||||
}
|
||||
|
||||
@@ -118,7 +118,9 @@ func main() {
|
||||
node = "?"
|
||||
}
|
||||
who := node + "." + cred.Module
|
||||
up, err = console.Serve(console.NewSurface(conn, source, who), listen)
|
||||
surface := console.NewSurface(conn, source, who)
|
||||
surface.Approvals = gateTools{Gate: gate, state: approvalsState{conn: conn, module: cred.Module}}
|
||||
up, err = console.Serve(surface, listen)
|
||||
if err != nil {
|
||||
log.Fatalf("node-tools: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user