Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/agents-walkthrough/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generate an API key at https://platform.claude.com/settings/keys
ANTHROPIC_API_KEY=sk-ant-...
31 changes: 31 additions & 0 deletions examples/agents-walkthrough/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# dev
.yarn/
!.yarn/releases
.vscode/*
!.vscode/launch.json
!.vscode/*.code-snippets
.idea/workspace.xml
.idea/usage.statistics.xml
.idea/shelf

# deps
node_modules/

# build
dist/

# env
.env
.env.production

# logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# misc
.DS_Store
16 changes: 16 additions & 0 deletions examples/agents-walkthrough/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
log default {
level ERROR
}
}

localhost:4438 {
reverse_proxy localhost:4437 {
flush_interval -1
}
encode gzip
header {
Cache-Control "no-cache, no-transform"
X-Accel-Buffering "no"
}
}
14 changes: 14 additions & 0 deletions examples/agents-walkthrough/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Electric Agents - Walkthrough Example

This example contains reference code for the [Electric Agents Walkthrough guide](https://electric.ax/docs/agents/walkthrough).

See the guide for more information. You'll want to run the agents runtime server and then install and run this web app:

```sh
pnpm install
pnpm dev
```

The source code is in the various `src/index.ts` files (`src/index0.ts`, `src/index1.ts`, ..., `src/index5.ts`). These show the progression through the walkthrough steps.

The default index.ts is a copy of index5.ts — the last "hybrid control flow" section of the guide.
25 changes: 25 additions & 0 deletions examples/agents-walkthrough/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@electric-ax/example-agents-walkthrough",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "tsx watch --env-file=.env src/index.ts",
"build": "tsc",
"start": "node dist/index.js",
"typecheck": "tsc --noEmit",
"test": "vitest run"
},
"dependencies": {
"@electric-ax/agents-runtime": "workspace:*",
"@hono/node-server": "^1.19.14",
"@sinclair/typebox": "^0.34.49",
"hono": "^4.12.23"
},
"devDependencies": {
"@types/node": "^20.11.17",
"tsx": "^4.7.1",
"typescript": "^5.8.3",
"vitest": "^3.2.4"
}
}
Loading
Loading