<!-- source-hash: 433665c60d11f92235ffb1f5227d3b44 -->
Debounced React hook and stateless fetch helper for slash-command autocomplete suggestions in the OpenFrame chat interface.

## Key Components

| Export | Type | Description |
|--------|------|-------------|
| `fetchSlashCommands` | `async function` | Stateless fetch wrapper; resolves suggestions from a caller-supplied `commandsUrl`, returns empty array on any non-2xx response |
| `useSlashCommands` | React hook | Debounced (150ms), cancellable hook returning `{ commands, loading }` |
| `SlashCommandSummary` | Re-exported type | Canonical summary shape for a slash command |
| `SlashCommandSummaryAction` | Re-exported type | Action payload within a summary |
| `SlashCommandActionId` | Re-exported type | Identifier type for actions |

## Usage Example

```typescript
import {
  useSlashCommands,
  fetchSlashCommands,
} from "@flamingo-stack/openframe-frontend-core/components/chat/hooks";
import { useChatRuntime } from "./chat-runtime";

// Hook usage (preferred in React components)
function SlashCommandDropdown({ prefix }: { prefix: string | null }) {
  const { endpoints } = useChatRuntime();
  const { commands, loading } = useSlashCommands(prefix, endpoints.commandsUrl);

  if (loading) return <Spinner />;
  return <CommandList items={commands} />;
}

// Stateless usage (e.g. outside React, in a server action test)
const ctrl = new AbortController();
const suggestions = await fetchSlashCommands(
  "res",
  ctrl.signal,
  "/api/mingo-guide/commands",
);
```

## Notes

- `commandsUrl` has **no default** — always supply via `useChatRuntime().endpoints.commandsUrl`
- URL resolution uses `new URL(commandsUrl, window.location.origin)`, supporting both relative and absolute URLs
- Non-2xx responses (401, 403, 429) return `[]` silently — no error toasts
- `AbortError` on unmount/dependency change is swallowed; other errors emit a `console.warn`