Jaspers Hub

jaspers / agents

pluginOfficialReviewed★ 0↓ 1

Research Agents: Agents you define that answer research chats from SEC filings, your documents, and the web, citing every passage.

1.4 KB
1import { useData } from '@jaspers-ai/sdk'
2import type { ReactElement } from 'react'
3import { SERVER } from './research'
4import type { Setup as SetupState } from './status'
5
6// Before the chat: the research store is a Jaspers service, reached as the account. Until the
7// Terminal is signed in with Jaspers, the panel says so; after, this never shows again.
8
9export function Setup({ setup }: { setup: SetupState | undefined }): ReactElement {
10 const connections = useData('connections') as Record<string, { error: string | null }> | undefined
11 const error = connections?.[SERVER]?.error ?? null
12 const status = setup?.status ?? 'starting'
13 return (
14 <>
15 <div className="ag-bar">
16 <span className="ag-title">Research agents</span>
17 </div>
18 <div className="ag-form">
19 <div className="ag-step">
20 <div className="ag-label">
21 <span className="ag-muted">□</span> Sign in with Jaspers
22 </div>
23 <div className="ag-step-body">
24 {status === 'needs-sign-in' ? (
25 'The research store is a Jaspers service: sign in with Jaspers in Settings to use the agents.'
26 ) : status === 'error' ? (
27 <span className="ag-error">The research store could not be reached{error ? `: ${error}` : '.'}</span>
28 ) : (
29 'Reaching the research store…'
30 )}
31 </div>
32 </div>
33 </div>
34 </>
35 )
36}