Plugin Resources
How City creates, resolves, and reuses Plugin Resources
Plugin Resources
A Plugin Resource is a reusable complete configuration object owned by a Plugin. Its JSON Schema requires a stable id, a type, and a displayable name.
Users edit ordinary fields, writeOnly fields use secure input and are redacted from output, and the Plugin constructor static resolve_resource writes every readOnly field except the City-managed id. Create, edit, and refresh operations assemble and validate a complete Item before saving it atomically. Agent startup reads saved Items and never performs an implicit network refresh.
city plugin resource create chat --interactive
city plugin resource list chat
city plugin resource update chat <resource_id> --set '{"type":"telegram","bot_token":"new-token"}'
city plugin resource refresh chat <resource_id>
city plugin resource remove chat <resource_id>update --set replaces all user-writable fields. refresh preserves user fields and only lets the Resolver recompute dynamic fields.
An Agent Plugin Binding stores IDs rather than copying Resource contents:
{
"plugin_name": "chat",
"config": {},
"resource_ids": ["telegram-a1b2c3"]
}When an Agent starts, the CLI resolves and validates complete Resource Items, then gives immutable snapshots to the Plugin constructor. A running Plugin never reads the Resource Store; updates take effect at the next Agent assembly checkpoint.
Complete Resource Items are encrypted at rest. CLI Resource output recursively redacts every writeOnly field according to the Schema. A Resource referenced by any Binding cannot be removed, and a third-party Plugin that still owns Resources cannot be uninstalled. Before a Plugin update, City also validates every existing Resource against the new Schema so the update cannot leave unreadable data behind.