@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
22 lines • 1.15 kB
JavaScript
export const ASK_USER_SETTLED_EVENT = "ask-user:settled";
export const ASK_USER_CLOSED_EVENT = "ask-user:closed";
export const ASK_USER_ASKED_EVENT = "ask-user:asked";
/** UI-only session metadata; never included in the model-facing answer frame. */
export const ASK_USER_QUESTION_ENTRY = "ask-user:question";
/** Durable terminal outcome, including silent cancellation, for restart recovery. */
export const ASK_USER_SETTLEMENT_ENTRY = "ask-user:settlement";
/** Every terminal outcome, including cancellations that remain silent to settled listeners. */
export function emitAskUserClosed(pi, requestId, response) {
pi.events.emit(ASK_USER_CLOSED_EVENT, {
requestId,
status: response.status,
...(response.resolvedBy !== undefined ? { resolvedBy: response.resolvedBy } : {}),
});
}
/** Publish only; the active hooks builtin owns preparation and command execution. */
export function emitAskUserNotification(pi, ctx, request, response, variant) {
if (response.status === "cancelled")
return;
pi.events.emit(ASK_USER_SETTLED_EVENT, { ctx, request, response, variant });
}
//# sourceMappingURL=notify.js.map