-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.3.0 #166
Merged
Merged
1.3.0 #166
Changes from 5 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b063d21
push
humanagent 2e4b9e3
docs
humanagent 1086a27
docs
humanagent 8605532
0.0.4
humanagent a1c9d71
agent-client
humanagent 5250988
deploy
humanagent dd9b0d1
deploy
humanagent 227e26d
testing ok
humanagent 500ce97
deploy
humanagent c2433ec
deploy
humanagent 7578ccb
update git
humanagent 553bdd9
refactor
humanagent 1fe8969
1.3.0
humanagent b057323
0.0.7
humanagent 17ece8d
agent inbox
humanagent 8d9c43a
xmtp
humanagent 7f932d5
merge
humanagent c6adccc
eploy
humanagent 0ce9452
deploy
humanagent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Baselinks | ||
|
||
See [Baselinks](https://message-kit.org/plugins/baselinks) in MessageKit |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "agent-client", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"build": "next build ", | ||
"dev": "next dev", | ||
"lint": "next lint", | ||
"start": "next start" | ||
}, | ||
"dependencies": { | ||
"@farcaster/frame-sdk": "0.0.10", | ||
"@types/next": "^9.0.0", | ||
"cheerio": "^1.0.0", | ||
"ethers": "^6.13.4", | ||
"geist": "^1.3.1", | ||
"next": "^15.0.3", | ||
"qrcode": "^1.5.4", | ||
"qrcode.react": "^4.1.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"viem": "^2.21.45", | ||
"xmtp-client": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20", | ||
"@types/react": "^18", | ||
"@types/react-dom": "^18", | ||
"typescript": "^5" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": ">=20" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
.page { | ||
--gray-rgb: 255, 255, 255; | ||
--gray-alpha-200: rgba(var(--gray-rgb), 0.08); | ||
--gray-alpha-100: rgba(var(--gray-rgb), 0.05); | ||
|
||
--button-primary-hover: #0052ff; | ||
--button-secondary-hover: #e6f0ff; | ||
|
||
display: grid; | ||
grid-template-rows: 20px 1fr 20px; | ||
align-items: center; | ||
justify-items: center; | ||
min-height: 100svh; | ||
padding: 80px; | ||
gap: 64px; | ||
font-family: var(--font-geist-sans); | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
.page { | ||
--gray-rgb: 0, 0, 0; | ||
--gray-alpha-200: rgba(var(--gray-rgb), 0.145); | ||
--gray-alpha-100: rgba(var(--gray-rgb), 0.06); | ||
|
||
--button-primary-hover: #003bb3; | ||
--button-secondary-hover: #1a1a1a; | ||
} | ||
} | ||
|
||
.main { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 32px; | ||
grid-row-start: 2; | ||
} | ||
|
||
.main ol { | ||
font-family: var(--font-geist-mono); | ||
padding-left: 0; | ||
margin: 0; | ||
font-size: 14px; | ||
line-height: 24px; | ||
letter-spacing: -0.01em; | ||
list-style-position: inside; | ||
} | ||
|
||
.main li:not(:last-of-type) { | ||
margin-bottom: 8px; | ||
} | ||
|
||
.main code { | ||
font-family: inherit; | ||
background: var(--gray-alpha-100); | ||
padding: 2px 4px; | ||
border-radius: 4px; | ||
font-weight: 600; | ||
} | ||
|
||
.ctas { | ||
display: flex; | ||
gap: 16px; | ||
} | ||
|
||
.ctas a { | ||
appearance: none; | ||
border-radius: 128px; | ||
height: 48px; | ||
padding: 0 20px; | ||
border: none; | ||
border: 1px solid transparent; | ||
transition: | ||
background 0.2s, | ||
color 0.2s, | ||
border-color 0.2s; | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: 16px; | ||
line-height: 20px; | ||
font-weight: 500; | ||
} | ||
|
||
a.primary { | ||
background: #0052ff; | ||
color: #ffffff; | ||
gap: 8px; | ||
} | ||
|
||
a.secondary { | ||
border-color: #e6f0ff; | ||
min-width: 180px; | ||
} | ||
|
||
.footer { | ||
grid-row-start: 3; | ||
display: flex; | ||
gap: 24px; | ||
} | ||
|
||
.footer a { | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
} | ||
|
||
.footer img { | ||
flex-shrink: 0; | ||
} | ||
|
||
/* Enable hover only on non-touch devices */ | ||
@media (hover: hover) and (pointer: fine) { | ||
a.primary:hover { | ||
background: var(--button-primary-hover); | ||
border-color: transparent; | ||
} | ||
|
||
a.secondary:hover { | ||
background: var(--button-secondary-hover); | ||
border-color: transparent; | ||
} | ||
|
||
.footer a:hover { | ||
text-decoration: underline; | ||
text-underline-offset: 4px; | ||
} | ||
} | ||
|
||
@media (max-width: 600px) { | ||
.page { | ||
padding: 32px; | ||
padding-bottom: 80px; | ||
} | ||
|
||
.main { | ||
align-items: center; | ||
} | ||
|
||
.main ol { | ||
text-align: center; | ||
} | ||
|
||
.ctas { | ||
flex-direction: column; | ||
} | ||
|
||
.ctas a { | ||
font-size: 14px; | ||
height: 40px; | ||
padding: 0 16px; | ||
} | ||
|
||
a.secondary { | ||
min-width: auto; | ||
} | ||
|
||
.footer { | ||
flex-wrap: wrap; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
.logo { | ||
filter: invert(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
"use client"; | ||
import React, { Suspense, useEffect, useState } from "react"; | ||
import { useSearchParams } from "next/navigation"; | ||
import sdk, { type FrameContext } from "@farcaster/frame-sdk"; | ||
import { getUserInfo, type UserInfo } from "@/app/utils/resolver"; | ||
import Chat from "../components/Chat"; | ||
|
||
export default function Home(): JSX.Element { | ||
return ( | ||
<Suspense fallback={<div>Loading...</div>}> | ||
<HomeContent /> | ||
</Suspense> | ||
); | ||
} | ||
|
||
function HomeContent(): JSX.Element { | ||
const searchParams = useSearchParams(); | ||
const address = searchParams.get("address"); | ||
console.log("address", address); | ||
const [user, setUser] = useState<UserInfo | null>(null); | ||
const [loading, setLoading] = useState(true); | ||
|
||
useEffect(() => { | ||
const fetchUserInfo = async () => { | ||
try { | ||
console.log("Fetching user info for address:", address); | ||
const userInfo = await getUserInfo(address as string); | ||
console.log("Fetched user info:", userInfo); | ||
|
||
setUser(userInfo ?? null); | ||
} catch (error) { | ||
console.error("Error fetching user info:", error); | ||
} finally { | ||
setLoading(false); | ||
} | ||
}; | ||
fetchUserInfo(); | ||
}, [address]); | ||
|
||
if (loading) { | ||
return <div>Loading...</div>; | ||
} | ||
|
||
if (!user) { | ||
return <div>User not found</div>; | ||
} | ||
|
||
return ( | ||
<FrameHTML user={user}> | ||
<Suspense fallback={<div>Loading...</div>}> | ||
<ChatContent user={user} /> | ||
</Suspense> | ||
</FrameHTML> | ||
); | ||
} | ||
|
||
// Create a wrapper component that will render the full HTML | ||
function FrameHTML({ | ||
children, | ||
user, | ||
}: { | ||
children: React.ReactNode; | ||
user: UserInfo; | ||
}) { | ||
return <>{children}</>; | ||
} | ||
|
||
function ChatContent({ user }: { user: UserInfo }): JSX.Element { | ||
const [isSDKLoaded, setIsSDKLoaded] = useState(false); | ||
const [context, setContext] = useState<FrameContext>(); | ||
|
||
useEffect(() => { | ||
const initFrame = async () => { | ||
setContext(await sdk.context); | ||
sdk.actions.ready(); | ||
}; | ||
|
||
if (sdk && !isSDKLoaded) { | ||
setIsSDKLoaded(true); | ||
initFrame(); | ||
} | ||
}, [isSDKLoaded]); | ||
|
||
return ( | ||
<div style={{ height: "100vh", width: "100%" }}> | ||
<Chat user={user} /> | ||
</div> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider refactoring FrameHTML component