MCPcopy Create free account
hub / github.com/diillson/chatcli / IsReadOnly

Method IsReadOnly

cli/plugins/builtin_context_caps.go:26–33  ·  view source on GitHub ↗

IsReadOnly reports true only for the inspecting subcommands. create/attach/ detach/delete mutate the context store or the session, so they are NOT read-only and (in coder mode) go through the policy confirmation.

(args []string)

Source from the content-addressed store, hash-verified

24// detach/delete mutate the context store or the session, so they are NOT
25// read-only and (in coder mode) go through the policy confirmation.
26func (*BuiltinContextPlugin) IsReadOnly(args []string) bool {
27 switch cmd, _ := contextSubcommand(args); cmd {
28 case "list", "status", "show", "inspect", "metrics":
29 return true
30 default:
31 return false
32 }
33}
34
35// IsConcurrencySafe mirrors IsReadOnly: only the read-only inspections can run
36// in parallel with other tools. Mutations are serialized.

Callers 2

TestContextCapsReadOnlyFunction · 0.95
IsConcurrencySafeMethod · 0.95

Calls 1

contextSubcommandFunction · 0.85

Tested by 1

TestContextCapsReadOnlyFunction · 0.76