Official
palette
Built-in command palette (⌘⇧P) and chat search (⌘P).
The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install convergence/palette@0.2.1
Permissions in 0.2.1
Files
main.ts1.2 KB
// Register the palette synchronously, then restore its recent-command ordering in the activation scope.
// Catalog loading and handlers use the same state layer as the pure overlay renderer.
import * as Effect from "effect/Effect";
import * as Stream from "effect/Stream";
import { Commands, Events, Views, runPlugin } from "convergence/effect";
import { controller } from "./controller.ts";
import { PaletteState } from "./state.ts";
import { render } from "./view.ts";
const program = Effect.gen(function* () {
const palette = yield* controller();
const views = yield* Views;
const commands = yield* Commands;
palette.state.view = yield* views.slot("title", (ctx) => render(palette, ctx), { order: 1000, on: ["app_state"] });
yield* commands.register("palette.commands", palette.openCommands());
yield* commands.register("palette.chats", palette.openChats());
yield* Effect.forkScoped(palette.loadRecent(), { startImmediately: true });
const events = yield* Events;
yield* events.stream("plugins_changed").pipe(
Stream.runForEach(() => palette.refresh().pipe(Effect.ignore)),
Effect.ignore,
Effect.forkScoped({ startImmediately: true }),
);
});
export const activate = runPlugin(PaletteState.layer, program);
No comments yet.