Files
orca/src/shared/queued-message-edit-command.ts
T
Neil 89f9ce08de refactor(shared): organize session contracts and projections (#36979)
* refactor(shared): organize session contracts and projections

* chore: tighten dropped-path flaky pattern allowance

* docs: preserve current agent instructions with valid formatting
2026-11-01 03:14:46 -08:00

31 lines
1.0 KiB
TypeScript

import type { AgentType } from './agent-status-types'
import type { AgentSessionSlashCommand } from './agent-session/agent-session-wire'
import {
prepareStructuredAgentSessionComposerCommand,
isStructuredAgentSessionGoalCommand
} from './agent-session/view/structured-agent-session-composer'
/** Provider prompt commands remain content; host actions cannot replace a queued body. */
export function queuedMessageEditAcceptsText(
text: string,
agent: AgentType,
reported?: readonly AgentSessionSlashCommand[],
hostSetsGoals = false
): boolean {
return prepareQueuedMessageEditText(agent, reported, hostSetsGoals)(text)
}
export function prepareQueuedMessageEditText(
agent: AgentType,
reported?: readonly AgentSessionSlashCommand[],
hostSetsGoals = false
): (text: string) => boolean {
const hostCommand = prepareStructuredAgentSessionComposerCommand(agent, reported)
return (text) =>
!(
hostCommand(text) ||
(hostSetsGoals && isStructuredAgentSessionGoalCommand(text)) ||
/^\/resume(?:\s|$)/i.test(text)
)
}