Restore helper layout in auth, isolation, runtime, and profiles from main
This commit is contained in:
+1
-14
@@ -1,18 +1,9 @@
|
||||
export type ProfileType = "claude" | "codex" | "opencode";
|
||||
|
||||
export interface BotProfile {
|
||||
type: ProfileType;
|
||||
type: "claude" | "codex" | "opencode";
|
||||
model: string;
|
||||
token?: string;
|
||||
}
|
||||
|
||||
const PROFILE_TYPES: Set<unknown> = new Set(["claude", "codex", "opencode"]);
|
||||
const FAILURE_REASONS: Set<unknown> = new Set(["sign-in failed", "usage exhausted", "failed"]);
|
||||
|
||||
export function isProfileType(value: unknown): value is ProfileType {
|
||||
return PROFILE_TYPES.has(value);
|
||||
}
|
||||
|
||||
export function profileFooter(profile: Pick<BotProfile, "type" | "model">): string {
|
||||
return `> Profile: \`${profile.type}\` · \`${profile.model}\``;
|
||||
}
|
||||
@@ -23,10 +14,6 @@ export function withProfile(body: string, profile: Pick<BotProfile, "type" | "mo
|
||||
|
||||
export type FailureReason = "sign-in failed" | "usage exhausted" | "failed";
|
||||
|
||||
export function isFailureReason(value: unknown): value is FailureReason {
|
||||
return FAILURE_REASONS.has(value);
|
||||
}
|
||||
|
||||
export type ProfileFailure = Pick<BotProfile, "type" | "model"> & {
|
||||
reason: FailureReason;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user