@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
20 lines • 887 B
JavaScript
import { isUserDirectedTurn } from "./engine-turn-limit.js";
export function inputOriginOf(source) {
return source === "extension" ? "extension" : "person";
}
/**
* The `input` event's attribution. Extension and engine input is an agent's. RPC input is the user's only when its
* connection declared `interactive_user`; any other RPC client (a parent agent driving a child session) is an agent.
* Every other person's input (TUI, a person's answer delivered through the extension API) is the user's.
*/
export function inputAttributionOf(input) {
if (input.origin !== "person")
return "agent";
if (input.source === "rpc")
return input.interactiveUser === true ? "user" : "agent";
return "user";
}
export function customTurnOrigin(customType) {
return isUserDirectedTurn(customType) ? "person" : "engine";
}
//# sourceMappingURL=input-origin.js.map