MCPcopy Index your code
hub / github.com/codeaashu/claude-code / action

Function action

src/components/messageActions.tsx:148–157  ·  view source on GitHub ↗
(a: {
  key: K;
  label: string | ((s: MessageActionsState) => string);
  types: readonly T[];
  applies?: (s: MessageActionsState) => boolean;
  stays?: true;
  run: (m: NavigableOf<T>, caps: MessageActionCaps) => void;
})

Source from the content-addressed store, hash-verified

146
147// Identity builder — preserves tuple type so `run`'s param narrows (array literal widens without this).
148function action<const T extends NavigableType, const K extends string>(a: {
149 key: K;
150 label: string | ((s: MessageActionsState) => string);
151 types: readonly T[];
152 applies?: (s: MessageActionsState) => boolean;
153 stays?: true;
154 run: (m: NavigableOf<T>, caps: MessageActionCaps) => void;
155}) {
156 return a;
157}
158export const MESSAGE_ACTIONS = [action({
159 key: 'enter',
160 label: s => s.expanded ? 'collapse' : 'expand',

Callers 2

messageActions.tsxFile · 0.85
REPLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected