Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T02:00:43.599Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

commandPalette.ts

31 lines · 813 B · typescript
1export type PaletteCommand = {
2  id: string;
3  label: string;
4  keywords: readonly string[];
5  run(): void;
6};
7
8export function filterCommands(
9  commands: readonly PaletteCommand[],
10  query: string,
11): PaletteCommand[] {
12  const normalizedQuery = query.trim().toLocaleLowerCase();
13  if (normalizedQuery.length === 0) return [...commands];
14
15  return commands.filter(({ label, keywords }) => {
16    const searchableText = [label, ...keywords].join(" ").toLocaleLowerCase();
17    return searchableText.includes(normalizedQuery);
18  });
19}
20
21export function nextActiveIndex(
22  currentIndex: number,
23  direction: "next" | "previous",
24  commandCount: number,
25): number {
26  if (commandCount === 0) return -1;
27
28  const offset = direction === "next" ? 1 : -1;
29  return (currentIndex + offset + commandCount) % commandCount;
30}
31
Served at tenant.openagents/omega Member data and write actions are omitted.