UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

45 lines • 2.56 kB
/** * The wire of `admit_external_message` (senpi#6233): a message another agent sent this session, relayed over RPC and * admitted the way `pi.session.admitExternalMessage` admits it in process. The fields mirror * `AdmitExternalMessageInput` in the wire's camelCase, plus a thread call's `chainCount`; turn ids are strings, as * `get_state.currentTurnId`. The field checks run on the local connection and inside `validateRpcInboundRecord`, so * both paths refuse the same records. */ import type { HoldKind } from "../../core/engine-turn-hold.ts"; import type { ExternalAdmissionKind, ExternalDeliverAs, SessionControlSender } from "../../core/extensions/session-control-types.ts"; export interface RpcAdmitExternalMessageCommand { id?: string; type: "admit_external_message"; /** The delivery's id: admitting an id this runtime already holds or wrote answers `already_admitted`. */ deliveryId: string; /** What the model reads, provenance included. */ text: string; /** Who the caller says sent it, for the surfaces a human reads; a claim, shown after the engine-stamped device. */ sender?: SessionControlSender; /** The message as its sender wrote it, for human surfaces. */ displayText?: string; deliverAs: ExternalDeliverAs; /** The turn the sender observed (`get_state.currentTurnId`); a steer is admitted only while it is current. */ expectedTurnId?: string; /** What an idle session does with it: `start` (the default) starts a turn, `queue` holds it for the next one. */ whenIdle?: "start" | "queue"; /** A thread call's hop count (1 for a chain's first hop), checked against the user's chain limit first (K8). */ chainCount?: number; } export interface RpcAdmitExternalMessageReply { kind: ExternalAdmissionKind; /** The session's turn when the delivery was admitted, in `get_state.currentTurnId`'s form. */ turnId: string; /** `held` only: the kinds of the holds that keep the delivery until a person releases them (senpi#6490). */ holds?: HoldKind[]; } export interface RpcAdmitExternalMessageResponse { id?: string; type: "response"; command: "admit_external_message"; success: true; data: RpcAdmitExternalMessageReply; } /** Why an `admit_external_message` record is refused, prefixed with its type; `undefined` for any other record. */ export declare function admitExternalMessageFieldError(value: Record<string, unknown>, maxTextCharacters: number): string | undefined; //# sourceMappingURL=admit-external-message-wire.d.ts.map