-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add WebRTC signaling and peer connection support #285
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||||||
| # dependencies (bun install) | ||||||||||
|
|
||||||||||
| node_modules | ||||||||||
|
|
||||||||||
| # output | ||||||||||
|
|
||||||||||
| out | ||||||||||
| dist | ||||||||||
| *.tgz | ||||||||||
|
|
||||||||||
| # code coverage | ||||||||||
|
|
||||||||||
| coverage | ||||||||||
| *.lcov | ||||||||||
|
|
||||||||||
| # logs | ||||||||||
|
|
||||||||||
| /logs | ||||||||||
| _.log | ||||||||||
| report.[0-9]_.[0-9]_.[0-9]_.[0-9]\*.json | ||||||||||
|
|
||||||||||
| # dotenv environment variable files | ||||||||||
|
|
||||||||||
| .env | ||||||||||
| .env.\* | ||||||||||
|
Comment on lines
+24
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Escaped asterisk in The backslash may cause this pattern to not match 🔎 Suggested fix-.env.\*
+.env.*📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| # caches | ||||||||||
|
|
||||||||||
| .eslintcache | ||||||||||
| .cache | ||||||||||
| *.tsbuildinfo | ||||||||||
|
|
||||||||||
| # IntelliJ based IDEs | ||||||||||
|
|
||||||||||
| .idea | ||||||||||
|
|
||||||||||
| # Finder (MacOS) folder config | ||||||||||
|
|
||||||||||
| .DS_Store | ||||||||||
|
|
||||||||||
| # Agentuity build files | ||||||||||
|
|
||||||||||
| .agentuity | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "search.exclude": { | ||
| "**/.git/**": true, | ||
| "**/node_modules/**": true, | ||
| "**/bun.lock": true, | ||
| "**/.agentuity/**": true | ||
| }, | ||
| "json.schemas": [ | ||
| { | ||
| "fileMatch": [ | ||
| "agentuity.json" | ||
| ], | ||
| "url": "https://agentuity.dev/schema/cli/v1/agentuity.json" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Agent Guidelines for webrtc-test | ||
|
|
||
| ## Commands | ||
|
|
||
| - **Build**: `bun run build` (compiles your application) | ||
| - **Dev**: `bun run dev` (starts development server) | ||
| - **Typecheck**: `bun run typecheck` (runs TypeScript type checking) | ||
| - **Deploy**: `bun run deploy` (deploys your app to the Agentuity cloud) | ||
|
|
||
| ## Agent-Friendly CLI | ||
|
|
||
| The Agentuity CLI is designed to be agent-friendly with programmatic interfaces, structured output, and comprehensive introspection. | ||
|
|
||
| Read the [AGENTS.md](./node_modules/@agentuity/cli/AGENTS.md) file in the Agentuity CLI for more information on how to work with this project. | ||
|
|
||
| ## Instructions | ||
|
|
||
| - This project uses Bun instead of NodeJS and TypeScript for all source code | ||
| - This is an Agentuity Agent project | ||
|
|
||
| ## Web Frontend (src/web/) | ||
|
|
||
| The `src/web/` folder contains your React frontend, which is automatically bundled by the Agentuity build system. | ||
|
|
||
| **File Structure:** | ||
|
|
||
| - `index.html` - Main HTML file with `<script type="module" src="./frontend.tsx">` | ||
| - `frontend.tsx` - Entry point that renders the React app to `#root` | ||
| - `App.tsx` - Your main React component | ||
| - `public/` - Static assets (optional) | ||
|
|
||
| **How It Works:** | ||
|
|
||
| 1. The build system automatically bundles `frontend.tsx` and all its imports (including `App.tsx`) | ||
| 2. The bundled JavaScript is placed in `.agentuity/web/chunk/` | ||
| 3. The HTML file is served at the root `/` route | ||
| 4. Script references like `./frontend.tsx` are automatically resolved to the bundled chunks | ||
|
|
||
| **Key Points:** | ||
|
|
||
| - Use proper TypeScript/TSX syntax - the bundler handles all compilation | ||
| - No need for Babel or external bundlers | ||
| - React is bundled into the output (no CDN needed) | ||
| - Supports hot module reloading in dev mode with `import.meta.hot` | ||
| - Components can use all modern React features and TypeScript | ||
|
|
||
| **Example:** | ||
|
|
||
| ```tsx | ||
| // src/web/App.tsx | ||
| import { useState } from 'react'; | ||
|
|
||
| export function App() { | ||
| const [count, setCount] = useState(0); | ||
| return <button onClick={() => setCount((c) => c + 1)}>{count}</button>; | ||
| } | ||
| ``` | ||
|
|
||
| ## Learn More | ||
|
|
||
| - [Agentuity Documentation](https://agentuity.dev) | ||
| - [Bun Documentation](https://bun.sh/docs) | ||
| - [Hono Documentation](https://hono.dev/) | ||
| - [Zod Documentation](https://zod.dev/) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| # webrtc-test | ||
|
|
||
| A new Agentuity project created with `agentuity create`. | ||
|
|
||
| ## What You Get | ||
|
|
||
| A fully configured Agentuity project with: | ||
|
|
||
| - ✅ **TypeScript** - Full type safety out of the box | ||
| - ✅ **Bun runtime** - Fast JavaScript runtime and package manager | ||
| - ✅ **Hot reload** - Development server with auto-rebuild | ||
| - ✅ **Example agent** - Sample "hello" agent to get started | ||
| - ✅ **React frontend** - Pre-configured web interface | ||
| - ✅ **API routes** - Example API endpoints | ||
| - ✅ **Type checking** - TypeScript configuration ready to go | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| my-app/ | ||
| ├── src/ | ||
| │ ├── agent/ # Agent definitions | ||
| │ │ └── hello/ | ||
| │ │ ├── agent.ts # Example agent | ||
| │ │ └── index.ts # Default exports | ||
| │ ├── api/ # API definitions | ||
| │ │ └── index.ts # Example routes | ||
| │ └── web/ # React web application | ||
| │ ├── public/ # Static assets | ||
| │ ├── App.tsx # Main React component | ||
| │ ├── frontend.tsx # Entry point | ||
| │ └── index.html # HTML template | ||
| ├── AGENTS.md # Agent guidelines | ||
| ├── app.ts # Application entry point | ||
| ├── tsconfig.json # TypeScript configuration | ||
| ├── package.json # Dependencies and scripts | ||
| └── README.md # Project documentation | ||
| ``` | ||
|
|
||
| ## Available Commands | ||
|
|
||
| After creating your project, you can run: | ||
|
|
||
| ### Development | ||
|
|
||
| ```bash | ||
| bun dev | ||
| ``` | ||
|
|
||
| Starts the development server at `http://localhost:3500` | ||
|
|
||
| ### Build | ||
|
|
||
| ```bash | ||
| bun build | ||
| ``` | ||
|
|
||
| Compiles your application into the `.agentuity/` directory | ||
|
|
||
| ### Type Check | ||
|
|
||
| ```bash | ||
| bun typecheck | ||
| ``` | ||
|
|
||
| Runs TypeScript type checking | ||
|
|
||
| ### Deploy to Agentuity | ||
|
|
||
| ```bash | ||
| bun run deploy | ||
| ``` | ||
|
|
||
| Deploys your application to the Agentuity cloud | ||
|
|
||
| ## Next Steps | ||
|
|
||
| After creating your project: | ||
|
|
||
| 1. **Customize the example agent** - Edit `src/agent/hello/agent.ts` | ||
| 2. **Add new agents** - Create new folders in `src/agent/` | ||
| 3. **Add new APIs** - Create new folders in `src/api/` | ||
| 4. **Add Web files** - Create new routes in `src/web/` | ||
| 5. **Customize the UI** - Edit `src/web/app.tsx` | ||
| 6. **Configure your app** - Modify `app.ts` to add middleware, configure services, etc. | ||
|
|
||
| ## Creating Custom Agents | ||
|
|
||
| Create a new agent by adding a folder in `src/agent/`: | ||
|
|
||
| ```typescript | ||
| // src/agent/my-agent/agent.ts | ||
| import { createAgent } from '@agentuity/runtime'; | ||
| import { s } from '@agentuity/schema'; | ||
|
|
||
| const agent = createAgent({ | ||
| description: 'My amazing agent', | ||
| schema: { | ||
| input: s.object({ | ||
| name: s.string(), | ||
| }), | ||
| output: s.string(), | ||
| }, | ||
| handler: async (_ctx, { name }) => { | ||
| return `Hello, ${name}! This is my custom agent.`; | ||
| }, | ||
| }); | ||
|
|
||
| export default agent; | ||
| ``` | ||
|
|
||
| ## Adding API Routes | ||
|
|
||
| Create custom routes in `src/api/`: | ||
|
|
||
| ```typescript | ||
| // src/api/my-agent/route.ts | ||
| import { createRouter } from '@agentuity/runtime'; | ||
| import myAgent from './agent'; | ||
|
|
||
| const router = createRouter(); | ||
|
|
||
| router.get('/', async (c) => { | ||
| const result = await myAgent.run({ message: 'Hello!' }); | ||
| return c.json(result); | ||
| }); | ||
|
|
||
| router.post('/', myAgent.validator(), async (c) => { | ||
| const data = c.req.valid('json'); | ||
| const result = await myAgent.run(data); | ||
| return c.json(result); | ||
| }); | ||
|
|
||
| export default router; | ||
| ``` | ||
|
|
||
| ## Learn More | ||
|
|
||
| - [Agentuity Documentation](https://agentuity.dev) | ||
| - [Bun Documentation](https://bun.sh/docs) | ||
| - [Hono Documentation](https://hono.dev/) | ||
| - [Zod Documentation](https://zod.dev/) | ||
|
|
||
| ## Requirements | ||
|
|
||
| - [Bun](https://bun.sh/) v1.0 or higher | ||
| - TypeScript 5+ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /** | ||
| * Agentuity Configuration | ||
| * | ||
| * @see https://agentuity.com/docs/configuration | ||
| */ | ||
|
|
||
| import type { AgentuityConfig } from '@agentuity/cli'; | ||
|
|
||
| export default { | ||
| /** | ||
| * Workbench (development only) | ||
| * | ||
| * Visual UI for testing agents during development. Not included in production builds. | ||
| * Omit this section to disable. Access at http://localhost:3500/workbench | ||
| */ | ||
| workbench: { | ||
| route: '/workbench', | ||
| headers: {}, | ||
| }, | ||
|
|
||
| /** | ||
| * Vite Plugins | ||
| * | ||
| * Custom Vite plugins for the client build (src/web/). | ||
| * Added after built-in plugins: React, browserEnvPlugin, patchPlugin | ||
| * | ||
| * Example (Tailwind CSS): | ||
| * bun add -d tailwindcss @tailwindcss/vite | ||
| * import tailwindcss from '@tailwindcss/vite'; | ||
| * plugins: [tailwindcss()] | ||
| * | ||
| * @see https://vitejs.dev/plugins/ | ||
| */ | ||
| // plugins: [], | ||
| } satisfies AgentuityConfig; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "$schema": "https://agentuity.dev/schema/cli/v1/agentuity.json", | ||
| "projectId": "proj_4ab8672d04f2ad11bf1481a29cf39d23", | ||
| "orgId": "org_2sr8VkWocx9J2ZRgCohc00I5m3d", | ||
| "deployment": { | ||
| "resources": { | ||
| "memory": "500Mi", | ||
| "cpu": "500m", | ||
| "disk": "500Mi" | ||
| } | ||
| }, | ||
| "region": "usc" | ||
| } |
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.
Glob patterns appear malformed.
_.logwill only match a file literally named_.log, not*.log(all log files).report.[0-9]_.[0-9]_.[0-9]_.[0-9]\*.jsonhas unusual escaping that may not match intended files.If the intent is to ignore all log files and report files, consider:
🔎 Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents