Creative mode walkthrough
The mayfly-cordis preset can hot-mount a dynamic Cordis prototype in the current process. The prototype is still an ordinary Cordis plugin with direct access to the current service graph.
Workflow:
- list current service/event/tool providers with
cordis_inspect_list; - query exact method schemas;
- use
cordis_definefor a host package withname / inject / apply(ctx); - activate with
cordis_run; define a new immutable package andupdatewhen iterating; - pause with
cordis_stop, remove withcordis_undefine; - after acceptance, ask for local/GitHub/npm/ephemeral before persistence.
js
return {
name: 'health-probe',
inject: ['commands', 'mayflyOverlays'],
apply(ctx) {
ctx.commands.register({
name: 'health-probe',
description: 'Open health',
handler() {
ctx.mayflyOverlays.open({
id: 'probe.health',
capturing: true,
}, { kind: 'text', content: 'healthy' })
return { kind: 'success', text: 'opened health' }
},
})
},
}Dynamic code.host is a plain JavaScript function body: no import, require, or TypeScript. The prototype disappears after restart. Persistence uses a normal package.json, compiled entry, and cordis.patch.yml.