mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +00:00
The usePromptActions hook is the textbook "god hook" AGENTS.md warns against. As a first, safe slice, pull its module-level standalone helpers (no closure over hook state) into a focused, testable use-prompt-actions-utils.ts sibling: - error classifiers: isSessionNotFoundError, isSessionBusyError, isProviderSetupError, inlineErrorMessage - session-busy retry: withSessionBusyRetry (+ its constants) - attachment IO: base64FromDataUrl, imageFilenameFromPath, readImageForRemoteAttach, readFileDataUrlForAttach, friendlyRemoteAttachError - misc: delay, isSessionIdCandidate, blobToDataUrl, renderCommandsCatalog, slashStatusText, appendText, visibleUserOrdinal, visibleUserIndexAtOrdinal, the _submitInFlight guard set, and the GatewayRequest type Pure restructuring, no behavior change; the usePromptActions and uploadComposerAttachment exports (and their import paths) are unchanged. Adds unit tests for the pure helpers. use-prompt-actions.ts: 1,956 -> 1,772. |
||
|---|---|---|
| .. | ||
| agents | ||
| artifacts | ||
| chat | ||
| command-center | ||
| command-palette | ||
| cron | ||
| gateway/hooks | ||
| hooks | ||
| messaging | ||
| overlays | ||
| pet-generate | ||
| pet-overlay | ||
| profiles | ||
| right-sidebar | ||
| session/hooks | ||
| settings | ||
| shell | ||
| skills | ||
| desktop-controller.tsx | ||
| floating-hud.ts | ||
| index.tsx | ||
| layout-constants.ts | ||
| model-picker-overlay.tsx | ||
| model-visibility-overlay.tsx | ||
| page-search-shell.tsx | ||
| routes.ts | ||
| session-picker-overlay.tsx | ||
| session-switcher.tsx | ||
| types.ts | ||
| updates-overlay.tsx | ||