示例工程 58-agent-app-architecture

58-agent-app-architecture/app/.tsc/shared/arch.d.ts

typescript · 1.0 KB

export type Layer = {
    id: "ui" | "preload" | "main" | "data" | "system" | "provider";
    title: string;
    items: string[];
    note: string;
};
export type Edge = {
    from: string;
    to: string;
    kind: "allowed" | "forbidden";
    label: string;
};
export type Tool = {
    id: string;
    name: string;
    risk: "read" | "write" | "exec" | "network";
};
export type ApprovalMode = "never" | "once" | "session" | "always";
export type Decision = {
    allowed: boolean;
    needApproval: boolean;
    reason: string;
};
export type Failure = {
    id: string;
    symptom: string;
    detect: string;
    retry: string;
    fallback: string;
};
export declare const LAYERS: Layer[];
export declare const EDGES: Edge[];
export declare const TOOLS: Tool[];
export declare const FAILURES: Failure[];
export declare function decide(tool: Tool, mode: ApprovalMode, granted?: boolean, trusted?: boolean): Decision;
export declare function validateArchitecture(edges: Edge[]): string[];
//# sourceMappingURL=arch.d.ts.map