Skip to content

Commit

Permalink
Fix occulsion issue
Browse files Browse the repository at this point in the history
  • Loading branch information
satyambnsal committed Feb 6, 2025
2 parents 2cc05f0 + cac914a commit 7fd1530
Show file tree
Hide file tree
Showing 16 changed files with 239 additions and 34 deletions.
115 changes: 115 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Release Extension

on:
push:
branches:
- main
paths:
- 'extension/**'
workflow_dispatch:
inputs:
version_bump:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major

jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.check.outputs.changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for extension changes
id: check
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
# For manual triggers, check if extension files changed since last tag
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [[ -z "$LAST_TAG" ]]; then
# No tags exist, consider as changed
echo "changed=true" >> $GITHUB_OUTPUT
else
CHANGED_FILES=$(git diff --name-only $LAST_TAG HEAD extension/)
if [[ -n "$CHANGED_FILES" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
fi
else
# For push events, path filter already handled it
echo "changed=true" >> $GITHUB_OUTPUT
fi
build-and-release:
needs: check-changes
if: needs.check-changes.outputs.should_release == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: extension/package-lock.json

- name: Install Dependencies
working-directory: extension
run: npm ci

- name: Build Extension
working-directory: extension
run: npm run build

- name: Create ZIP Archive
working-directory: extension/dist
run: zip -r ../../extension.zip .

- name: Generate Release Tag
id: tag
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
# Get current version from manifest.json
current_version=$(jq -r '.version' extension/manifest.json)
# Split version into components
IFS='.' read -r major minor patch <<< "$current_version"
case "${{ github.event.inputs.version_bump }}" in
"major")
new_version="$((major + 1)).0.0"
;;
"minor")
new_version="${major}.$((minor + 1)).0"
;;
"patch")
new_version="${major}.${minor}.$((patch + 1))"
;;
esac
echo "tag=v${new_version}" >> $GITHUB_OUTPUT
# Update manifest.json with new version
jq ".version = \"${new_version}\"" extension/manifest.json > temp.json && mv temp.json extension/manifest.json
else
echo "tag=v$(date +'%Y.%m.%d-%H%M')" >> $GITHUB_OUTPUT
fi
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: Extension Beta ${{ steps.tag.outputs.tag }}
files: extension.zip
prerelease: true
generate_release_notes: true
4 changes: 4 additions & 0 deletions extension/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"RPC_URL": "https://rpc.nethermind.io/sepolia-juno/?apikey=BqyrrrCXajIYmrrDurtUBKlmsOCGcYCkm4PyBACuMtvtGmwODFz11RikUh1KueKd",
"AGENT_REGISTRY_ADDRESS": "0x00f415ab3f224935ed532dfa06485881c526fef8cb31e6e7e95cafc95fdc5e8d"
}
22 changes: 17 additions & 5 deletions extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"manifest_version": 3,
"name": "Jack the Ether",
"name": "Teeception",
"version": "1.0.0",
"description": "Pay-to-tweet mechanism for interacting with AI agents on Twitter/X",
"description": "Pay-to-tweet mechanism for interacting with AI agents on X, powered by Starknet, Phala, Cartridge, and Nethermind",
"author": "[email protected]",
"icons": {
"16": "icons/teeception-16.png",
"32": "icons/teeception-32.png",
"48": "icons/teeception-48.png",
"128": "icons/teeception-128.png"
},
"permissions": [
"activeTab",
"tabs",
Expand All @@ -11,12 +18,11 @@
"storage"
],
"host_permissions": [
"https://*.twitter.com/*"
"https://*.x.com/*"
],
"content_scripts": [
{
"matches": [
"https://twitter.com/*",
"https://x.com/*"
],
"css": [
Expand All @@ -30,7 +36,13 @@
}
],
"action": {
"default_popup": "index.html"
"default_popup": "index.html",
"default_icon": {
"16": "icons/teeception-16.png",
"32": "icons/teeception-32.png",
"48": "icons/teeception-48.png",
"128": "icons/teeception-128.png"
}
},
"background": {
"service_worker": "background.js"
Expand Down
15 changes: 15 additions & 0 deletions extension/public/icons/cartridge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extension/public/icons/teeception-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extension/public/icons/teeception-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extension/public/icons/teeception-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extension/public/icons/teeception-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 23 additions & 16 deletions extension/src/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,29 @@ const Popup = () => {

<div className="w-full flex flex-col gap-1">
<p className="text-[#B8B8B8] text-[10.42px]">powered by</p>
<div className="flex items-center gap-3">
<a href="https://starknet.io" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
<img src="/icons/starknet.svg" alt="starknet" className="w-[76px] h-[17px]" />
</a>
<span className="text-[#B8B8B8] text-lg">×</span>
<a href="https://phala.network" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
<img src="/icons/phala.svg" alt="phala network" className="w-[28px] h-[28px] bg-black rounded-sm" />
</a>
<span className="text-[#B8B8B8] text-lg">×</span>
<a href="https://nethermind.io" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
<img
src="https://cdn.prod.website-files.com/63bcd69729ab7f3ec1ad210a/64bf04d14176fe2fb1aff258_Nethermind_Light_Horizontal%201.webp"
alt="nethermind"
className="h-[17px] w-auto"
/>
</a>
<div className="flex flex-col gap-3 mb-3">
<div className="flex items-center justify-center">
<a href="https://nethermind.io" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
<img
src="https://cdn.prod.website-files.com/63bcd69729ab7f3ec1ad210a/64bf04d14176fe2fb1aff258_Nethermind_Light_Horizontal%201.webp"
alt="nethermind"
className="h-[17px] w-auto"
/>
</a>
</div>
<div className="flex items-center gap-3 justify-center">
<a href="https://starknet.io" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
<img src="/icons/starknet.svg" alt="starknet" className="w-[76px] h-[17px]" />
</a>
<span className="text-[#B8B8B8] text-lg">×</span>
<a href="https://phala.network" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
<img src="/icons/phala.svg" alt="phala network" className="w-[28px] h-[28px] bg-black rounded-sm" />
</a>
<span className="text-[#B8B8B8] text-lg">×</span>
<a href="https://cartridge.gg" target="_blank" rel="noopener noreferrer" className="hover:opacity-80 transition-opacity">
<img src="/icons/cartridge.svg" alt="cartridge" className="h-[24px] w-auto" />
</a>
</div>
</div>
<p className="text-[#B8B8B8] text-xs">©2025 Nethermind. All Rights Reserved</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React from 'react'
import { Button } from '@/components/ui/button'
import { Dialog } from './Dialog'
import { cn } from '@/lib/utils'
import { MessageCircle } from 'lucide-react'
import { debug } from '../../utils/debug'

interface ConfirmationModalProps {
open: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ export const PaymentModal = ({
try {
const tweetIdBigInt = BigInt(tweetId)

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

Expand All @@ -100,7 +102,6 @@ export const PaymentModal = ({
return undefined
}

console.log('tweetText', cleanPromptText(tweetText))
return [
tokenContract.populate('approve', [
agentContract.address,
Expand Down
34 changes: 28 additions & 6 deletions frontend/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ export const Footer = () => {
</li>

<li className="flex items-center gap-3">
<Link
href="https://nethermind.io"
target="_blank"
className="hover:opacity-80 transition-opacity"
>
<img
src="https://cdn.prod.website-files.com/63bcd69729ab7f3ec1ad210a/64bf04d14176fe2fb1aff258_Nethermind_Light_Horizontal%201.webp"
alt="nethermind"
className="h-[17px] w-auto"
/>
</Link>
<span className="text-[#B8B8B8] text-lg">×</span>
<Link
href="https://starknet.io"
target="_blank"
Expand All @@ -36,29 +48,39 @@ export const Footer = () => {
</Link>
<span className="text-[#B8B8B8] text-lg">×</span>
<Link
href="https://nethermind.io"
href="https://cartridge.gg"
target="_blank"
className="hover:opacity-80 transition-opacity"
>
<img
src="https://cdn.prod.website-files.com/63bcd69729ab7f3ec1ad210a/64bf04d14176fe2fb1aff258_Nethermind_Light_Horizontal%201.webp"
alt="nethermind"
className="h-[17px] w-auto"
<Image
src="/icons/cartridge.svg"
width={96}
height={24}
alt="cartridge"
className="h-[24px] w-auto"
/>
</Link>
</li>

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

<div>
<div className="flex flex-col gap-2">
<Link
href="https://github.com/NethermindEth/teeception/tree/main/contracts"
className="underline hover:no-underline text-sm"
target="_blank"
>
onchain contracts
</Link>
<Link
href="https://github.com/NethermindEth/teeception/releases/latest"
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"
target="_blank"
>
<Image src="/icons/download.svg" width={16} height={16} alt="" />
Download Beta Extension
</Link>
</div>

<div className="flex items-center gap-4">
Expand Down
Loading

0 comments on commit 7fd1530

Please sign in to comment.