agentfit 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +30 -34
  2. package/app/(dashboard)/daily/page.tsx +1 -1
  3. package/app/(dashboard)/flow/page.tsx +17 -0
  4. package/app/(dashboard)/layout.tsx +2 -0
  5. package/app/(dashboard)/page.tsx +24 -5
  6. package/app/(dashboard)/reports/[id]/page.tsx +72 -0
  7. package/app/(dashboard)/reports/page.tsx +132 -0
  8. package/app/(dashboard)/sessions/[id]/page.tsx +167 -0
  9. package/app/(dashboard)/settings/page.tsx +180 -0
  10. package/app/api/backup/route.ts +215 -0
  11. package/app/api/check/route.ts +11 -1
  12. package/app/api/command-insights/route.ts +13 -0
  13. package/app/api/images-analysis/route.ts +3 -4
  14. package/app/api/reports/[id]/route.ts +23 -0
  15. package/app/api/reports/route.ts +50 -0
  16. package/app/api/reset/route.ts +21 -0
  17. package/app/api/session/route.ts +40 -0
  18. package/app/api/usage/route.ts +25 -1
  19. package/app/layout.tsx +1 -1
  20. package/bin/agentfit.mjs +2 -2
  21. package/components/agent-coach.tsx +256 -129
  22. package/components/app-sidebar.tsx +258 -8
  23. package/components/backup-section.tsx +236 -0
  24. package/components/daily-chart.tsx +404 -83
  25. package/components/dashboard-shell.tsx +9 -24
  26. package/components/data-provider.tsx +66 -2
  27. package/components/fitness-score.tsx +95 -54
  28. package/components/overview-cards.tsx +148 -41
  29. package/components/report-view.tsx +307 -0
  30. package/components/screenshots-analysis.tsx +51 -46
  31. package/components/session-chatlog.tsx +124 -0
  32. package/components/session-timeline.tsx +184 -0
  33. package/components/session-workflow.tsx +183 -0
  34. package/components/sessions-table.tsx +9 -1
  35. package/components/tool-flow-graph.tsx +144 -0
  36. package/components/ui/carousel.tsx +242 -0
  37. package/components/ui/sidebar.tsx +1 -1
  38. package/components/ui/sonner.tsx +51 -0
  39. package/generated/prisma/browser.ts +5 -0
  40. package/generated/prisma/client.ts +5 -0
  41. package/generated/prisma/internal/class.ts +14 -4
  42. package/generated/prisma/internal/prismaNamespace.ts +96 -2
  43. package/generated/prisma/internal/prismaNamespaceBrowser.ts +20 -1
  44. package/generated/prisma/models/Report.ts +1219 -0
  45. package/generated/prisma/models/Session.ts +187 -1
  46. package/generated/prisma/models.ts +1 -0
  47. package/lib/coach.ts +530 -211
  48. package/lib/command-insights.ts +231 -0
  49. package/lib/db.ts +1 -1
  50. package/lib/parse-codex.ts +5 -0
  51. package/lib/parse-logs.ts +65 -0
  52. package/lib/queries-codex.ts +22 -0
  53. package/lib/queries.ts +42 -0
  54. package/lib/report.ts +156 -0
  55. package/lib/session-detail.ts +382 -0
  56. package/lib/sync.ts +77 -0
  57. package/lib/tool-flow.ts +71 -0
  58. package/next.config.mjs +6 -1
  59. package/package.json +16 -2
  60. package/plugins/cost-heatmap/component.tsx +72 -50
  61. package/prisma/schema.prisma +17 -0
  62. package/.claude/settings.local.json +0 -26
  63. package/CONTRIBUTING.md +0 -209
  64. package/prisma/migrations/20260328152517_init/migration.sql +0 -41
  65. package/prisma/migrations/20260328153801_add_image_model/migration.sql +0 -18
  66. package/prisma/migrations/migration_lock.toml +0 -3
  67. package/prisma.config.ts +0 -14
  68. package/setup.sh +0 -73
package/setup.sh DELETED
@@ -1,73 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # ─── AgentFit Installer ─────────────────────────────────────────────
5
- # Usage:
6
- # curl -fsSL https://raw.githubusercontent.com/harrywang/agentfit/main/setup.sh | bash
7
- #
8
- # Or clone manually:
9
- # git clone https://github.com/harrywang/agentfit.git && cd agentfit && ./setup.sh
10
- # ─────────────────────────────────────────────────────────────────────
11
-
12
- REPO="https://github.com/harrywang/agentfit.git"
13
- DIR="agentfit"
14
- PORT="${AGENTFIT_PORT:-3000}"
15
-
16
- info() { printf "\033[1;34m==>\033[0m %s\n" "$1"; }
17
- ok() { printf "\033[1;32m==>\033[0m %s\n" "$1"; }
18
- error() { printf "\033[1;31m==>\033[0m %s\n" "$1" >&2; }
19
-
20
- # ─── Prerequisites ───────────────────────────────────────────────────
21
-
22
- command -v node >/dev/null 2>&1 || { error "Node.js is required. Install it from https://nodejs.org"; exit 1; }
23
- command -v npm >/dev/null 2>&1 || { error "npm is required. It ships with Node.js."; exit 1; }
24
-
25
- NODE_MAJOR=$(node -e "process.stdout.write(String(process.versions.node.split('.')[0]))")
26
- if [ "$NODE_MAJOR" -lt 20 ]; then
27
- error "Node.js 20+ is required (found v$(node -v)). Please upgrade."
28
- exit 1
29
- fi
30
-
31
- # ─── Clone (skip if already inside the repo) ────────────────────────
32
-
33
- if [ ! -f "package.json" ] || ! grep -q '"agentfit"' package.json 2>/dev/null; then
34
- if [ -d "$DIR" ]; then
35
- info "Directory '$DIR' already exists — pulling latest..."
36
- cd "$DIR"
37
- git pull --ff-only
38
- else
39
- info "Cloning AgentFit..."
40
- git clone "$REPO" "$DIR"
41
- cd "$DIR"
42
- fi
43
- fi
44
-
45
- # ─── Install ─────────────────────────────────────────────────────────
46
-
47
- info "Installing dependencies..."
48
- npm install
49
-
50
- # ─── Database ────────────────────────────────────────────────────────
51
-
52
- info "Setting up database..."
53
- echo 'DATABASE_URL="file:./dev.db"' > .env
54
- npx prisma generate
55
- npx prisma migrate deploy
56
-
57
- # ─── Build ───────────────────────────────────────────────────────────
58
-
59
- info "Building production bundle..."
60
- npm run build
61
-
62
- # ─── Done ────────────────────────────────────────────────────────────
63
-
64
- ok "AgentFit is ready!"
65
- echo ""
66
- echo " Start the dashboard:"
67
- echo " cd ${DIR} && npm start"
68
- echo ""
69
- echo " Or run in dev mode:"
70
- echo " cd ${DIR} && npm run dev"
71
- echo ""
72
- echo " Then open http://localhost:${PORT}"
73
- echo ""