UNPKG

@code-yeongyu/senpi

Version:

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

35 lines • 1.22 kB
export type TokenFamily = "ctrl" | "sgml" | "bracket"; export interface ControlToken { readonly family: TokenFamily; readonly name: string; readonly tokenId: string; readonly text: string; readonly startOffset: number; readonly endOffset: number; } export type CandidateOutcome = { readonly kind: "ground"; readonly value: string; readonly offset: number; } | { readonly kind: "token"; readonly token: ControlToken; } | { readonly kind: "reject"; readonly text: string; readonly startOffset: number; }; /** * Angle-bracket special tokens that tokenizers actually define (SentencePiece/Llama `<s>`, * BERT-style `<pad>`/`<unk>`/`<mask>`, Gemma turn markers, reasoning and tool-call delimiters). * Matched case-insensitively, with or without the closing slash. Anything else in angle * brackets is markup, not a control token. */ export declare const SGML_CONTROL_TOKEN_NAMES: ReadonlySet<string>; export declare function isSgmlControlTokenName(rawName: string): boolean; export declare class CandidateParser { #private; feed(value: string, offset: number): CandidateOutcome[]; get pendingLength(): number; } //# sourceMappingURL=token-grammar.d.ts.map