The seat is defined whole in mesh-contracts (ADR 0613 §3), so mesh-sdk takes its names from there (ADR 0613 §5):
EngineSeat and EngineEvents are nodeengine's, EngineComposeCandidateVerb is nodeengine.VerbComposeCandidate, and
ComposeCandidateAsk, ComposeCandidateAnswer and ModuleComposed are aliases of nodeengine's ComposeCandidateInput,
ComposeCandidateAnswer and Module. The encode and decode checks stay here over those types until the seat has a client
package (ADR 0625 §4). For importers: a module's fingerprint is Fp, and the answer's Input is a JSON object
(map[string]any), not raw bytes. compose-candidate's input is the boolean the engine and the checker read; the seat
set's test takes that correction, and the whole seat's added verbs as da653ce reads them. EngineSeat leaves
testdata/seat-names.txt.
Claude-Session: https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn
34 lines
1.3 KiB
Go
34 lines
1.3 KiB
Go
package catalogue
|
|
|
|
import "git.novox.be/novox/mesh-contracts/go/seats/nodeengine"
|
|
|
|
// EngineSeat is the node seat every node's engine holds.
|
|
//
|
|
// Deprecated: the seat is defined whole in mesh-contracts (nodeengine.Seat, its verbs, events, subjects and message
|
|
// types); kept for its importers until their next change takes it from there (testdata/seat-names.txt).
|
|
const EngineSeat = nodeengine.Seat
|
|
|
|
// EngineVerbs are the node-engine seat's verbs, in the order ADR 0563 §1 names them: its definition's, read from the
|
|
// generated seat list (design 26), each with its description and its input's schema as discovery shows them. Their
|
|
// names are nodeengine.Verbs().
|
|
func EngineVerbs() []Verb {
|
|
s, _ := seatIn(defaultSeats, EngineSeat)
|
|
return append([]Verb(nil), s.Serves...)
|
|
}
|
|
|
|
// EngineEvents are what the seat says: of an act, each naming the act, the path or access, the caller as the runtime
|
|
// proved it and the ask (ADR 0563 §1), and that what its engine reads of a manifest changed (ADR 0618 §4).
|
|
//
|
|
// Deprecated: the seat's contract names them, nodeengine.Events(); kept for its importers.
|
|
var EngineEvents = nodeengine.Events()
|
|
|
|
// seatIn is the seat of that name in a list.
|
|
func seatIn(list []Seat, name string) (Seat, bool) {
|
|
for _, s := range list {
|
|
if s.Name == name {
|
|
return s, true
|
|
}
|
|
}
|
|
return Seat{}, false
|
|
}
|