@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
29 lines • 1.43 kB
TypeScript
/**
* How a worker isolate turns the delegation descriptor a bind or command carries into the one it reads
* (omo-relay-daemon#307). Structured clone gives every message a new wrapper around the same memory, so the worker
* keeps the FIRST buffer it saw for an incarnation and compares scalars only, never wrapper identity.
*/
import type { DelegationDescriptor } from "./delegation-record.ts";
export type DelegationResolution =
/** Read `descriptor` (the retained buffer for its incarnation). */
{
readonly kind: "use";
readonly descriptor: DelegationDescriptor;
}
/** An older incarnation than the retained one: the command runs, its role checks read retired. */
| {
readonly kind: "stale";
readonly descriptor: DelegationDescriptor;
}
/** A principal, mode or stamp that cannot belong to this connection: that one command is refused. */
| {
readonly kind: "conflict";
};
export declare const DELEGATION_AUTHORITY_CONFLICT = "delegation_authority_conflict";
/** The one command's refusal when its carried delegation conflicts: non-fatal, no `session_worker_` prefix. */
export declare function authorityConflict(command: object): object;
export declare function resolveDelegation(retained: DelegationDescriptor | undefined, wire: DelegationDescriptor): {
readonly resolution: DelegationResolution;
readonly retain?: DelegationDescriptor;
};
//# sourceMappingURL=delegation-resolve.d.ts.map