You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/dojo/README.md
+54-29Lines changed: 54 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,48 +22,73 @@ To run the Demo Viewer locally for development, follow these steps:
22
22
brew install protobuf
23
23
```
24
24
25
+
Note that running the dojo currently requires the use of `pnpm` (vs `yarn` or `npm`) do to how we handle workspace dependencies.
25
26
```bash
26
-
npm i turbo
27
+
curl -fsSL https://get.pnpm.io/install.sh | sh -
27
28
```
28
29
29
-
```bash
30
-
curl -fsSL https://get.pnpm.io/install.sh | sh -
30
+
The first time you want to run, you need to build all of the dojos dependencies throught the repository.
31
+
```
32
+
# from the ag-ui repository root
33
+
pnpm i
34
+
pnpm build --filter=demo-viewer
31
35
```
32
36
33
37
### Run the Demo Viewer
34
38
35
-
In a new terminal, navigate to the project root and start the Demo Viewer:
39
+
There are 3 ways to run the demo viewer
36
40
37
-
```bash
38
-
pnpm install
39
-
pnpm run dev
40
-
```
41
+
- Run just the demo viewer, and run the agent(s) separately
42
+
- Run the dev script for the entire repo, and run the agent(s) separately
43
+
- use the `dojo-everything` scripts
41
44
42
-
The Demo Viewer should now be running at [http://localhost:3000](http://localhost:3000).
45
+
#### Run just the demo viewer, and run the agent(s) separately.
43
46
44
-
### Adding a new integration
47
+
In one terminal, you can `cd` into the dojo directory and run `pnpm dev` to just run the dojo
48
+
This will not capture updates to dependencies of the dojo
49
+
In another terminal, you'll need to run any other agents you want to test separately, see "Run Agents" below.
50
+
The dojo will start on port 3000 by default
51
+
52
+
Note that some agents may run on colliding ports
53
+
54
+
#### Run the dev script for the entire repo, and run the agent(s) separately
55
+
In one terminal, you can run `pnpm dev` from the *repository root*
56
+
This WILL automatically rebuild dependencies, for example if you change the mastra integration, it will automatically rebuild and be bundled into the dojo with HMR.
57
+
In another terminal, you'll need to run any other agents you want to test separately, see "Run Agents" below.
58
+
The dojo will start on port 3000 by default
45
59
46
-
On a fresh clone of this repo, you'll find that we've created a mock agent that represents all of the events needed to create an ACP compliant agent. To extend this to support
47
-
your own integration, you'll need to:
60
+
Note that some agents may run on colliding ports
48
61
49
-
1. Edit `src/examples/your-custom-http-agent.ts` to implement your own agent.
50
-
2. Alternatively, edit `src/examples/your-custom-agent.ts` to implement a non http based integration.
51
-
3. Read `src/app/api/sse/agentic_chat/route.ts` to understand what events need to be emitted on the agent side.
62
+
#### Run Agents
63
+
Agent examples for the dojo are generally located in `integrations/{integrationName}/{language}/examples`. A readme there should explain what you need to do to run the example, but it's usually either `npm dev` for typescript packages, or `poetry install && poetry run dev` or `uv sync && uv run dev` for python servers.
52
64
53
-
## Project Structure
65
+
Note that some agents may run on colliding ports
54
66
55
-
-`src/examples` - Example agents
56
-
-`src/app` - Next.js app router files
57
-
-`src/components` - Reusable UI components
58
-
-`src/demos` - Demo configuration and utilities
59
-
-`src/hooks` - Custom React hooks
60
-
-`src/types` - TypeScript type definitions
61
-
-`public` - Static assets
67
+
#### Use the `dojo-everything` scripts
62
68
63
-
## Technologies
69
+
These are the easiest ways to run everything. They will automatically configure all of your ports to not be colliding, provide that information to the dojo, and spin up the dojo.
64
70
65
-
- Next.js
66
-
- React
67
-
- TypeScript
68
-
- Tailwind CSS
69
-
- CopilotKit
71
+
```
72
+
# In the apps/dojo directory
73
+
./scripts/prep-dojo-everything.js
74
+
./scripts/run-dojo-everything.js
75
+
```
76
+
77
+
The demo viewer will now run on port 9999.
78
+
79
+
The one caveat here is that (for precompiled speed while running tests) this runs a production nextjs build, and that build has to be redone if you modify the dojo code at all (or any of the typescript integrations).
80
+
81
+
You can look in the `run-dojo-everything.js` script and see which ports it runs agents at, and export those as environment variables, which can be found in `apps/dojo/src/env.ts`. Then you can run the dojo via `pnpm dev` at the repo root, to get live updates to typescript integrations and the dojo. There is not HMR on most of the python framework agent examples.
82
+
83
+
To choose which agents or services the `run-dojo-everything.js` script runs you can use the `--only` flag, like this: `./scripts/run-dojo-everything.js --only adk-middleware,langgraph-fastapi`. The names for these IDs match what is in `src/agents.ts` as well as being findable in the run-dojo-everything script. .
84
+
85
+
### Adding a new integration
86
+
Integrations should go in `integrations/{integrationID}`. There should always be a typescript folder that at least contains the client, and possibly a python (or other language) folder.
87
+
88
+
To add it to the dojo, please make sure it gets added to
89
+
- src/agents.ts
90
+
- src/menu.ts
91
+
- scripts/prep-dojo-everything.js
92
+
- scripts/run-dojo-everything.js
93
+
- e2e.yml
94
+
- the `apps/dojo/e2e` folder, look in the tests folder of other frameworks, and you should be able to mostly dupiclate these.
0 commit comments