Skip to content

Commit 7fd1530

Browse files
committed
Fix occulsion issue
2 parents 2cc05f0 + cac914a commit 7fd1530

File tree

16 files changed

+239
-34
lines changed

16 files changed

+239
-34
lines changed

.github/workflows/release.yml

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Release Extension
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'extension/**'
9+
workflow_dispatch:
10+
inputs:
11+
version_bump:
12+
description: 'Version bump type'
13+
required: true
14+
default: 'patch'
15+
type: choice
16+
options:
17+
- patch
18+
- minor
19+
- major
20+
21+
jobs:
22+
check-changes:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
should_release: ${{ steps.check.outputs.changed }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Check for extension changes
32+
id: check
33+
run: |
34+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
35+
# For manual triggers, check if extension files changed since last tag
36+
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
37+
if [[ -z "$LAST_TAG" ]]; then
38+
# No tags exist, consider as changed
39+
echo "changed=true" >> $GITHUB_OUTPUT
40+
else
41+
CHANGED_FILES=$(git diff --name-only $LAST_TAG HEAD extension/)
42+
if [[ -n "$CHANGED_FILES" ]]; then
43+
echo "changed=true" >> $GITHUB_OUTPUT
44+
else
45+
echo "changed=false" >> $GITHUB_OUTPUT
46+
fi
47+
fi
48+
else
49+
# For push events, path filter already handled it
50+
echo "changed=true" >> $GITHUB_OUTPUT
51+
fi
52+
53+
build-and-release:
54+
needs: check-changes
55+
if: needs.check-changes.outputs.should_release == 'true'
56+
runs-on: ubuntu-latest
57+
permissions:
58+
contents: write
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- name: Setup Node.js
63+
uses: actions/setup-node@v4
64+
with:
65+
node-version: '20'
66+
cache: 'npm'
67+
cache-dependency-path: extension/package-lock.json
68+
69+
- name: Install Dependencies
70+
working-directory: extension
71+
run: npm ci
72+
73+
- name: Build Extension
74+
working-directory: extension
75+
run: npm run build
76+
77+
- name: Create ZIP Archive
78+
working-directory: extension/dist
79+
run: zip -r ../../extension.zip .
80+
81+
- name: Generate Release Tag
82+
id: tag
83+
run: |
84+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
85+
# Get current version from manifest.json
86+
current_version=$(jq -r '.version' extension/manifest.json)
87+
# Split version into components
88+
IFS='.' read -r major minor patch <<< "$current_version"
89+
90+
case "${{ github.event.inputs.version_bump }}" in
91+
"major")
92+
new_version="$((major + 1)).0.0"
93+
;;
94+
"minor")
95+
new_version="${major}.$((minor + 1)).0"
96+
;;
97+
"patch")
98+
new_version="${major}.${minor}.$((patch + 1))"
99+
;;
100+
esac
101+
echo "tag=v${new_version}" >> $GITHUB_OUTPUT
102+
# Update manifest.json with new version
103+
jq ".version = \"${new_version}\"" extension/manifest.json > temp.json && mv temp.json extension/manifest.json
104+
else
105+
echo "tag=v$(date +'%Y.%m.%d-%H%M')" >> $GITHUB_OUTPUT
106+
fi
107+
108+
- name: Create Release
109+
uses: softprops/action-gh-release@v1
110+
with:
111+
tag_name: ${{ steps.tag.outputs.tag }}
112+
name: Extension Beta ${{ steps.tag.outputs.tag }}
113+
files: extension.zip
114+
prerelease: true
115+
generate_release_notes: true

extension/config.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"RPC_URL": "https://rpc.nethermind.io/sepolia-juno/?apikey=BqyrrrCXajIYmrrDurtUBKlmsOCGcYCkm4PyBACuMtvtGmwODFz11RikUh1KueKd",
3+
"AGENT_REGISTRY_ADDRESS": "0x00f415ab3f224935ed532dfa06485881c526fef8cb31e6e7e95cafc95fdc5e8d"
4+
}

extension/manifest.json

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
22
"manifest_version": 3,
3-
"name": "Jack the Ether",
3+
"name": "Teeception",
44
"version": "1.0.0",
5-
"description": "Pay-to-tweet mechanism for interacting with AI agents on Twitter/X",
5+
"description": "Pay-to-tweet mechanism for interacting with AI agents on X, powered by Starknet, Phala, Cartridge, and Nethermind",
6+
"author": "[email protected]",
7+
"icons": {
8+
"16": "icons/teeception-16.png",
9+
"32": "icons/teeception-32.png",
10+
"48": "icons/teeception-48.png",
11+
"128": "icons/teeception-128.png"
12+
},
613
"permissions": [
714
"activeTab",
815
"tabs",
@@ -11,12 +18,11 @@
1118
"storage"
1219
],
1320
"host_permissions": [
14-
"https://*.twitter.com/*"
21+
"https://*.x.com/*"
1522
],
1623
"content_scripts": [
1724
{
1825
"matches": [
19-
"https://twitter.com/*",
2026
"https://x.com/*"
2127
],
2228
"css": [
@@ -30,7 +36,13 @@
3036
}
3137
],
3238
"action": {
33-
"default_popup": "index.html"
39+
"default_popup": "index.html",
40+
"default_icon": {
41+
"16": "icons/teeception-16.png",
42+
"32": "icons/teeception-32.png",
43+
"48": "icons/teeception-48.png",
44+
"128": "icons/teeception-128.png"
45+
}
3446
},
3547
"background": {
3648
"service_worker": "background.js"

extension/public/icons/cartridge.svg

+15
Loading
5.88 KB
Loading
600 Bytes
Loading
1.01 KB
Loading
1.53 KB
Loading

extension/src/Popup.tsx

+23-16
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,29 @@ const Popup = () => {
2020

2121
<div className="w-full flex flex-col gap-1">
2222
<p className="text-[#B8B8B8] text-[10.42px]">powered by</p>
23-
<div className="flex items-center gap-3">
24-
<a href="https://starknet.io" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
25-
<img src="/icons/starknet.svg" alt="starknet" className="w-[76px] h-[17px]" />
26-
</a>
27-
<span className="text-[#B8B8B8] text-lg">×</span>
28-
<a href="https://phala.network" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
29-
<img src="/icons/phala.svg" alt="phala network" className="w-[28px] h-[28px] bg-black rounded-sm" />
30-
</a>
31-
<span className="text-[#B8B8B8] text-lg">×</span>
32-
<a href="https://nethermind.io" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
33-
<img
34-
src="https://cdn.prod.website-files.com/63bcd69729ab7f3ec1ad210a/64bf04d14176fe2fb1aff258_Nethermind_Light_Horizontal%201.webp"
35-
alt="nethermind"
36-
className="h-[17px] w-auto"
37-
/>
38-
</a>
23+
<div className="flex flex-col gap-3 mb-3">
24+
<div className="flex items-center justify-center">
25+
<a href="https://nethermind.io" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
26+
<img
27+
src="https://cdn.prod.website-files.com/63bcd69729ab7f3ec1ad210a/64bf04d14176fe2fb1aff258_Nethermind_Light_Horizontal%201.webp"
28+
alt="nethermind"
29+
className="h-[17px] w-auto"
30+
/>
31+
</a>
32+
</div>
33+
<div className="flex items-center gap-3 justify-center">
34+
<a href="https://starknet.io" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
35+
<img src="/icons/starknet.svg" alt="starknet" className="w-[76px] h-[17px]" />
36+
</a>
37+
<span className="text-[#B8B8B8] text-lg">×</span>
38+
<a href="https://phala.network" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
39+
<img src="/icons/phala.svg" alt="phala network" className="w-[28px] h-[28px] bg-black rounded-sm" />
40+
</a>
41+
<span className="text-[#B8B8B8] text-lg">×</span>
42+
<a href="https://cartridge.gg" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
43+
<img src="/icons/cartridge.svg" alt="cartridge" className="h-[24px] w-auto" />
44+
</a>
45+
</div>
3946
</div>
4047
<p className="text-[#B8B8B8] text-xs">©2025 Nethermind. All Rights Reserved</p>
4148
</div>

extension/src/content-script/components/modals/ConfirmationModal.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import React from 'react'
21
import { Button } from '@/components/ui/button'
32
import { Dialog } from './Dialog'
43
import { cn } from '@/lib/utils'
54
import { MessageCircle } from 'lucide-react'
6-
import { debug } from '../../utils/debug'
75

86
interface ConfirmationModalProps {
97
open: boolean

extension/src/content-script/components/modals/PaymentModal.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ export const PaymentModal = ({
8686
try {
8787
const tweetIdBigInt = BigInt(tweetId)
8888

89-
// Find the tweet element and get its text
90-
const tweetElement = document.querySelector(`article[data-testid="tweet"]`)
89+
// Find the specific tweet by ID
90+
const tweetElement = document
91+
.querySelector(`article[data-testid="tweet"] a[href*="/${tweetId}"]`)
92+
?.closest('article[data-testid="tweet"]')
9193
const tweetTextElement = tweetElement?.querySelector(SELECTORS.TWEET_TEXT)
9294
const tweetText = tweetTextElement?.textContent || ''
9395

@@ -100,7 +102,6 @@ export const PaymentModal = ({
100102
return undefined
101103
}
102104

103-
console.log('tweetText', cleanPromptText(tweetText))
104105
return [
105106
tokenContract.populate('approve', [
106107
agentContract.address,

frontend/components/Footer.tsx

+28-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ export const Footer = () => {
1313
</li>
1414

1515
<li className="flex items-center gap-3">
16+
<Link
17+
href="https://nethermind.io"
18+
target="_blank"
19+
className="hover:opacity-80 transition-opacity"
20+
>
21+
<img
22+
src="https://cdn.prod.website-files.com/63bcd69729ab7f3ec1ad210a/64bf04d14176fe2fb1aff258_Nethermind_Light_Horizontal%201.webp"
23+
alt="nethermind"
24+
className="h-[17px] w-auto"
25+
/>
26+
</Link>
27+
<span className="text-[#B8B8B8] text-lg">×</span>
1628
<Link
1729
href="https://starknet.io"
1830
target="_blank"
@@ -36,29 +48,39 @@ export const Footer = () => {
3648
</Link>
3749
<span className="text-[#B8B8B8] text-lg">×</span>
3850
<Link
39-
href="https://nethermind.io"
51+
href="https://cartridge.gg"
4052
target="_blank"
4153
className="hover:opacity-80 transition-opacity"
4254
>
43-
<img
44-
src="https://cdn.prod.website-files.com/63bcd69729ab7f3ec1ad210a/64bf04d14176fe2fb1aff258_Nethermind_Light_Horizontal%201.webp"
45-
alt="nethermind"
46-
className="h-[17px] w-auto"
55+
<Image
56+
src="/icons/cartridge.svg"
57+
width={96}
58+
height={24}
59+
alt="cartridge"
60+
className="h-[24px] w-auto"
4761
/>
4862
</Link>
4963
</li>
5064

5165
<li className="text-xs">©2025 Nethermind. All Rights Reserved</li>
5266
</ul>
5367

54-
<div>
68+
<div className="flex flex-col gap-2">
5569
<Link
5670
href="https://github.com/NethermindEth/teeception/tree/main/contracts"
5771
className="underline hover:no-underline text-sm"
5872
target="_blank"
5973
>
6074
onchain contracts
6175
</Link>
76+
<Link
77+
href="https://github.com/NethermindEth/teeception/releases/latest"
78+
className="flex items-center gap-2 bg-blue-600 hover:bg-blue-700 text-white px-3 py-1.5 rounded-md text-sm transition-colors"
79+
target="_blank"
80+
>
81+
<Image src="/icons/download.svg" width={16} height={16} alt="" />
82+
Download Beta Extension
83+
</Link>
6284
</div>
6385

6486
<div className="flex items-center gap-4">

0 commit comments

Comments
 (0)