mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
feat(chord): keep services available during facet reloads
This commit is contained in:
parent
7cf456aa1c
commit
c4b0e35abe
13 changed files with 386 additions and 163 deletions
|
|
@ -11,14 +11,17 @@ export default defineFacet({
|
|||
const ui = env.use(PresentationUI);
|
||||
env.onActivate(() => {
|
||||
env.own(
|
||||
commands.register({
|
||||
commands.replace({
|
||||
name: "hello",
|
||||
description: "Call the bundled Session worker facet",
|
||||
argumentHint: "<name>",
|
||||
async run(args, context) {
|
||||
const message = args.length === 0 ? "from the TUI" : args;
|
||||
const reply = await example.greet({ name: message }, context);
|
||||
ui.showStatus(`${reply.message} Worker activations: ${reply.workerActivations}.`, context);
|
||||
ui.showStatus(
|
||||
`We got this: ${reply.message} Worker activations: ${reply.workerActivations}.`,
|
||||
context,
|
||||
);
|
||||
return controller.prompt({ message: `pong: ${message}`, images: null }, context);
|
||||
},
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue