@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
18 lines • 1.32 kB
TypeScript
import type { Rule, Ruleset } from "../permission-system/types.ts";
declare global {
interface Array<T> {
findLast<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: unknown): S | undefined;
findLast(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: unknown): T | undefined;
}
}
export declare function evaluate(permission: string, pattern: string | readonly string[], ...rulesets: Ruleset[]): Rule;
/** A rule matches when it covers a pattern as written, as executed, or by file identity of the request. */
export type IdentityMatcher = (rulePattern: string) => boolean;
/**
* `evaluate` plus the identity route (design 6.2): the predicate takes the RULE only and tests every
* canonical path of the request. The external-path matcher stays in place; identity is added to it.
*/
export declare function evaluateWithIdentity(permission: string, pattern: string | readonly string[], ruleset: Ruleset, matchesIdentity: IdentityMatcher | undefined): Rule;
/** Evaluate a lexical spelling without letting a resolved rule erase its ancestry. */
export declare function evaluateExternalSpelling(pattern: string | readonly string[], ruleset: Ruleset, canonicalCase?: (value: string) => string): Rule;
//# sourceMappingURL=evaluate.d.ts.map