@sema-agent/core
Version:
Stateless, task-oriented AI agent core
21 lines (20 loc) • 1.41 kB
TypeScript
/** What a quoted span of a refusal sentence IS: a file path, a command line, or a deny/rule pattern. */
export declare const REFUSAL_ECHO_KINDS: readonly ["path", "command", "pattern"];
export type RefusalEchoKind = (typeof REFUSAL_ECHO_KINDS)[number];
/** Membership test for {@link RefusalEchoKind}. */
export declare function isRefusalEchoKind(v: unknown): v is RefusalEchoKind;
/**
* One literal the sentence quotes, in the order the sentence quotes them. `value` is the literal as the refusing judge
* held it — the sentence elides the middle of a long one, this member never does. `canonical` stands on a `path` whose
* canonical target the sentence also names because the two differ.
*/
export interface RefusalEcho {
readonly kind: RefusalEchoKind;
readonly value: string;
readonly canonical?: string;
}
/** The defects of `v` read as a list of {@link RefusalEcho} (an empty list is a clean one): a dense non-empty array holding nothing
* but its elements (no hole, no member of its own beside them — a method name or a symbol on the array is read by nobody here and
* JSON drops it), of records that hold exactly `kind` (a member of the set), `value` (a non-empty string) and, on a `path`, an
* optional non-empty `canonical`. Reads the list by index alone: no method of a caller's array is ever called. */
export declare function refusalEchoDefects(v: unknown): string[];