Skip to content

plugin-resource

Placement compiled-in (in-process)
Source github.com/opencharly/charly/candy/plugin-resource
Version 2026.176.3206
Candy plugin-resource

This plugin is listed in charly/charly.yml’s compiled_plugins:, so its providers are compiled into the charly binary and register in-process.

The reserved words this plugin serves:

  • resource — kind class

The resource plugin KIND relocated into a candy: a KIND provider dispatching via the pb Invoke(OpLoad) envelope (decode the authored resource: entity into its core spec type, re-marshal as canonical JSON). Serves itself in BOTH placements (compiled-in OR out-of-process) like the matching/exampleprobe verbs + the init kind — no kit contract needed (kinds are pb-shape).

The CUE schema below is the authoritative grammar for this plugin’s input. It is the same single source that generates the plugin’s Go parameter types and answers the runtime Describe RPC, so this page cannot disagree with either.

// The BUILT-IN `resource` plugin's OWN CUE schema — the typed input for the `resource`
// KIND (exclusive host-resource tokens for GPU arbitration, formerly a core `resource:`
// kind decoded into the typed core map uf.Resource). SINGLE SOURCE for this plugin's
// params, used two ways (the same contract the package-group/agent/module/sidecar/
// distro/builder/init plugins and core `spec` use):
//
// 1. GENERATE the Go param struct — `cue exp gengotypes` (task cue:gen) →
// ../params/cue_types_gen.go.
// 2. VALIDATE authored input AT RUNTIME — served over Describe (InProcTransport),
// spliced base ++ plugin, every authored `resource:` body validated against
// #ResourceInput BEFORE runPluginKind dispatches.
//
// SELF-CONTAINED: the core #Resource (schema/resource.cue) references NO _common.cue
// def, so this is a verbatim reproduction with the inner #GpuSelector renamed
// #RsGpuSelector (prefix #Rs) and the @go() annotation dropped (CORE codegen only). The
// plugin's Invoke canonicalises the body back through the core spec.Resource type (which
// ResourceDef aliases and the GPU-arbitration code consumes via the Resources()
// accessor). Both shapes valid: `{}` (bare arbitration token) and `{gpu: {vendor: …}}`
// (selector token). NAME: the entity name is the node KEY, never a body field.
#ResourceInput: {
gpu?: #RsGpuSelector
}
// vendor required + non-empty; NOT regex-pinned (normalizePCIVendor accepts
// "10DE"/"0X10de"/"0x10de" — a strict regex would reject Go-valid input).
#RsGpuSelector: {
vendor: string & !=""
}

See also the candy reference for this candy’s install surface.