Skip to content

Commit

Permalink
Merge pull request #336 from UpstreetAI/multiplayer-client
Browse files Browse the repository at this point in the history
Libs refactor part 2
  • Loading branch information
avaer authored Oct 19, 2024
2 parents c408aaa + 32ef017 commit bc3080b
Show file tree
Hide file tree
Showing 275 changed files with 28,214 additions and 35,212 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/usdk-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
node-version: '20' # Specify the Node.js version you are using

- name: Install dependencies
run: npm install --no-optional
run: cd packages/usdk && npm install --no-optional

- name: Run USDK command
run: cd packages/usdk && ./usdk.js --version
2 changes: 1 addition & 1 deletion apps/chat/app/new/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
// XXX this is a bad dependency, this should be moved down to the lower layer
import {
generateMnemonic,
} from 'usdk/util/ethereum-utils.mjs';
} from '../../utils/etherium-utils.mjs';
import {
Chat,
} from '@/components/chat/chat';
Expand Down
10 changes: 4 additions & 6 deletions apps/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@monaco-editor/react": "^4.6.0",
"@mui/material": "^5.16.7",
"@mui/x-charts": "^7.13.0",
"@scure/bip39": "^1.3.0",
"@radix-ui/react-alert-dialog": "1.0.5",
"@radix-ui/react-dialog": "1.0.5",
"@radix-ui/react-dropdown-menu": "2.0.6",
Expand All @@ -51,16 +52,15 @@
"@tsndr/cloudflare-worker-jwt": "^2.5.3",
"@types/eventsource": "^1.1.15",
"@types/three": "^0.167.1",
"@upstreet/api": "file:../../packages/api",
"@upstreet/multiplayer": "file:../../packages/usdk/packages/upstreet-agent/packages/react-agents/lib/multiplayer",
"@upstreet/multiplayer": "file:../../packages/usdk/packages/upstreet-agent/packages/react-agents-client/packages/multiplayer",
"@vercel/analytics": "1.1.2",
"@vercel/kv": "1.0.1",
"@vercel/og": "0.6.2",
"ai": "3.1.5",
"class-variance-authority": "0.7.0",
"classnames": "2.5.1",
"clsx": "2.1.0",
"codecs": "file:../../packages/usdk/packages/upstreet-agent/packages/react-agents/lib/codecs",
"codecs": "file:../../packages/usdk/packages/upstreet-agent/packages/codecs",
"cookie": "^0.6.0",
"d3-scale": "4.0.2",
"date-fns": "3.3.1",
Expand Down Expand Up @@ -99,12 +99,10 @@
"tailwindcss": "3.4.1",
"tailwindcss-animate": "1.0.7",
"three": "^0.167.1",
"upstreet-agent": "file:../../packages/usdk/packages/upstreet-agent",
"usdk": "file:../../packages/usdk",
"ucom": "file:../../packages/ucom/src",
"usehooks-ts": "2.16.0",
"web-worker": "1.2.0",
"zjs": "file:../../packages/zjs",
"zjs": "file:../../packages/usdk/packages/upstreet-agent/packages/react-agents-client/packages/multiplayer/packages/zjs",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down
9 changes: 9 additions & 0 deletions apps/chat/utils/api.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { aiHost } from "./const/endpoints";


const prefix = `${aiHost}/api`;


export const aiProxyAPI = {
getUser: `${prefix}/getUser`,
};
4 changes: 4 additions & 0 deletions apps/chat/utils/etherium-utils.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import * as bip39 from '@scure/bip39';
import { wordlist } from '@scure/bip39/wordlists/english';

export const generateMnemonic = () => bip39.generateMnemonic(wordlist);
4 changes: 2 additions & 2 deletions apps/chat/utils/supabase/supabase-client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createClient } from '@supabase/supabase-js';
import jwt from '@tsndr/cloudflare-worker-jwt';
import { aiProxyAPI } from '@upstreet/api';
import { aiProxyAPI } from '../api.mjs';
// import { isStringSignatureValid } from './signature-utils.mjs';
import { aiHost } from '@/utils/const/endpoints';

Expand Down Expand Up @@ -139,7 +139,7 @@ export const getUserForJwt = async (jwt: string, {
private?: boolean,
} = {}) => {
try {
const u = new URL(`${aiHost}/${aiProxyAPI.getUser}`);
const u = new URL(`${aiProxyAPI.getUser}`);
_private && u.searchParams.set('private', true + '');
const res = await fetch(u, {
headers: {
Expand Down
Loading

0 comments on commit bc3080b

Please sign in to comment.