1.6 KiB
1.6 KiB
Menu providers (drop-in menu customization)
Providers let you add/override menu entries without editing the core menu patch.
Default entries directory (on robot):
/opt/jibo/Jibo/Skills/@be/menu-entries.d/
Legacy fallback (yea ik its the same stop talking):
/opt/jibo/Jibo/Skills/@be/menu-providers.d/
Provider file types
JSON provider (*.json)
Supported shapes:
- An array of entries:
[ { ... }, { ... } ] - Or
{ "entries": [ ... ] }
Entry schema (same as menuEntry.json scan output):
id(string, required)type(skillorsubmenu)titleiconcolordescriptionorder(number)skillId(for typeskill)submenuTitle(for typesubmenu)children(array of skill entries, for typesubmenu)childrenDir(for typesubmenu, optional):- Absolute path (starts with
/) or relative toskillsRoot - If provided and
childrenis missing/empty, the patch will scan this directory for child skills (subfolders containingmenuEntry.json).
- Absolute path (starts with
Example submenu that lists a directory:
[
{
"id": "fun_stuff",
"type": "submenu",
"title": "Fun Stuff",
"icon": "resources/icons/fun-stuff.png",
"order": 20,
"childrenDir": "FunStuff"
}
]
JS provider (*.js)
Exports one of:
module.exports = function(ctx) { return [ ...entries... ]; }exports.getEntries = function(ctx) { return [ ...entries... ]; }exports.entries = [ ...entries... ]
ctx includes:
skillsRootprovidersDirlog(function)
Conflict rules
- If a provider entry has the same
idas a scanned entry, the provider entry wins. - Sorting: by
orderthen by title.