Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(e2e): add auth state helper for e2e tests

Steven Enamakel532505afeef4
diff --git a/app/test/e2e/helpers/auth-state.ts b/app/test/e2e/helpers/auth-state.ts
new file mode 100644
index 0000000000..334f589686
--- /dev/null
+++ b/app/test/e2e/helpers/auth-state.ts
@@ -0,0 +1,12 @@
+/** Auth state returned by `openhuman.auth_get_state`. */
+export interface AuthStateResponse {
+ isAuthenticated: boolean;
+ userId?: string | null;
+ credential?: 'session' | 'api-key' | 'local';
+}
+
+/** Read the auth DTO from the core RPC response. */
+export function authStateValue(state: { result?: unknown }): AuthStateResponse {
+ const raw = (state.result ?? {}) as { value?: AuthStateResponse } & AuthStateResponse;
+ return raw.value ?? raw;
+}