mesh-sdk drops compare, take-over and hand-back from the keeper's and config's seats (ADR 0590): there is no controller to compare with or hand back to. mesh-conditions loses those verbs, its take-over key and asks; mesh-config reads its own sources always and pull-declares is gone; and mesh-hand-acts no longer names the controller's log (issue 1126). Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
40 lines
1.4 KiB
Go
40 lines
1.4 KiB
Go
package main
|
|
|
|
// The module's own tools beside the seat's verb (novox/hq ADR 0565 §15): the read of `declared` and resync. compare,
|
|
// take-over and hand-back went with the controller (ADR 0590).
|
|
|
|
import (
|
|
"strings"
|
|
|
|
stdio "git.novox.be/novox/mesh-sdk/go"
|
|
)
|
|
|
|
// The switch's tools.
|
|
const (
|
|
DeclaredTool = "config_declared"
|
|
ResyncTool = "config_resync"
|
|
)
|
|
|
|
// SeatVerbs are the seat's verbs, as the manifest claims them.
|
|
var SeatVerbs = []string{Verb}
|
|
|
|
func switchTools(c *Config) []stdio.Tool { return ownSwitchTools(c) }
|
|
|
|
func ownSwitchTools(c *Config) []stdio.Tool {
|
|
return []stdio.Tool{
|
|
{Name: DeclaredTool,
|
|
Description: "Each placed module's declarations as config keeps them (its state declared): the manifest and " +
|
|
"commit they come from and how many keys, or one module whole; and which source holds now.",
|
|
Input: map[string]any{"type": "object", "properties": map[string]any{
|
|
"module": map[string]any{"type": "string", "description": "one module, whole"}}},
|
|
Run: func(a map[string]any) (any, error) {
|
|
m, _ := a["module"].(string)
|
|
return c.Declared(strings.TrimSpace(m))
|
|
}},
|
|
{Name: ResyncTool,
|
|
Description: "Read every source again and write what differs: the published list of predefined keys, the " +
|
|
"resolved values, declared, and the indexer's config candidates.",
|
|
Run: func(map[string]any) (any, error) { return c.Resync() }},
|
|
}
|
|
}
|