@autoship/react 0.2.0 → 0.4.0

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.
package/README.md ADDED
@@ -0,0 +1,166 @@
1
+ # Autoship
2
+
3
+ A drop-in autonomous coding agent that records tasks in your app and implements them in a Github Action.
4
+
5
+ ## How It Works
6
+
7
+ 1. Users submit tasks via React components (or directly via Supabase)
8
+ 2. A GitHub Action wakes up periodically and runs Claude Code
9
+ 3. Claude picks up the highest priority task, implements it, and creates a PR
10
+ 4. If Claude needs clarification, it asks a question and blocks the task until you answer
11
+ 5. You review the PR and merge
12
+
13
+ ## Packages
14
+
15
+ - **`@autoship/react`** - React components and CLI for task submission
16
+ - **`mcp-servers/autoship-mcp`** - MCP server for Claude Code integration
17
+
18
+ ## Quick Start
19
+
20
+ ### 1. Create Supabase Project
21
+
22
+ Create a new Supabase project (or use an existing one). Get the SUPABASE_URL and your database password.
23
+
24
+ ### 2. Set Up Supabase Database
25
+
26
+ Run the migrations using the CLI:
27
+
28
+ ```bash
29
+ npx @autoship init
30
+ ```
31
+
32
+ The CLI will prompt you for credentials. You can provide them in two ways:
33
+
34
+ **Option A: Full DATABASE_URL**
35
+
36
+ ```bash
37
+ # Find this in Supabase Dashboard > Project Settings > Database > Connection string > URI
38
+ npx @autoship init --database-url "postgresql://postgres.xxx:password@aws-0-region.pooler.supabase.com:6543/postgres"
39
+ ```
40
+
41
+ **Option B: Supabase URL + Database Password**
42
+
43
+ ```bash
44
+ npx @autoship init --supabase-url https://xxx.supabase.co --db-password yourpassword
45
+ ```
46
+
47
+ **Using environment variables:**
48
+
49
+ ```bash
50
+ # Option A
51
+ DATABASE_URL="postgresql://..." npx @autoship init
52
+
53
+ # Option B
54
+ SUPABASE_URL="https://xxx.supabase.co" DB_PASSWORD="yourpassword" npx @autoship/react init
55
+ ```
56
+
57
+ ### 3. Add React Components (Optional)
58
+
59
+ Install the package:
60
+
61
+ ```bash
62
+ npm install @autoship/react
63
+ ```
64
+
65
+ Add the provider and button to your app:
66
+
67
+ ```tsx
68
+ import { AutoshipProvider, AutoshipButton } from "@autoship/react";
69
+
70
+ function App() {
71
+ return (
72
+ <AutoshipProvider
73
+ supabaseUrl={process.env.SUPABASE_URL}
74
+ supabaseAnonKey={process.env.SUPABASE_ANON_KEY}
75
+ userId="optional-user-id"
76
+ >
77
+ <YourApp />
78
+ <AutoshipButton />
79
+ </AutoshipProvider>
80
+ );
81
+ }
82
+ ```
83
+
84
+ Available components:
85
+
86
+ - `AutoshipProvider` - Context provider for Supabase connection
87
+ - `AutoshipButton` - Floating button to open task submission dialog
88
+ - `TaskDialog` - Modal for submitting new tasks
89
+ - `TaskList` - List of submitted tasks with status
90
+ - `TaskDetailDialog` - View task details and answer questions
91
+ - `QuestionDialog` - Answer clarifying questions from Claude
92
+
93
+ ### 4. Set Up GitHub Actions
94
+
95
+ Copy these files into your project:
96
+
97
+ ```
98
+ mcp-servers/autoship-mcp/ # The MCP server
99
+ .mcp.json # MCP configuration
100
+ .github/workflows/claude-agent.yml # GitHub Actions workflow
101
+ ```
102
+
103
+ Add GitHub Secrets (Settings > Secrets and variables > Actions):
104
+
105
+ | Secret | Description |
106
+ | ---------------------- | ----------------------------------------------------------- |
107
+ | `ANTHROPIC_API_KEY` | Your Anthropic API key |
108
+ | `SUPABASE_URL` | Your Supabase project URL (e.g., `https://xxx.supabase.co`) |
109
+ | `SUPABASE_SERVICE_KEY` | Supabase service role key (not the anon key) |
110
+
111
+ ### 5. Test Locally (Optional)
112
+
113
+ Build the MCP server:
114
+
115
+ ```bash
116
+ cd mcp-servers/autoship-mcp && npm install && npm run build
117
+ ```
118
+
119
+ ```bash
120
+ # Set environment variables
121
+ export SUPABASE_URL="https://your-project.supabase.co"
122
+ export SUPABASE_SERVICE_KEY="your-service-key"
123
+
124
+ # Test the MCP tools
125
+ claude "Use the autoship-mcp tools to list pending tasks"
126
+ ```
127
+
128
+ ## Manual Trigger
129
+
130
+ You can manually trigger the agent from the GitHub Actions tab, optionally with a custom prompt:
131
+
132
+ 1. Go to Actions > Claude Agent
133
+ 2. Click "Run workflow"
134
+ 3. Optionally enter a custom prompt
135
+ 4. Click "Run workflow"
136
+
137
+ ## Monitoring
138
+
139
+ ### GitHub Actions Logs
140
+
141
+ Check the Actions tab in your repository to see Claude's output for each run.
142
+
143
+ ## Available MCP Tools
144
+
145
+ | Tool | Description |
146
+ | -------------------------- | ---------------------------------------------------- |
147
+ | `list_pending_tasks` | List all pending tasks by priority |
148
+ | `get_task` | Get full details including categories and questions |
149
+ | `claim_task` | Mark a task as in_progress |
150
+ | `complete_task` | Mark as complete with branch name |
151
+ | `fail_task` | Mark as failed with error message |
152
+ | `add_task` | Create new tasks |
153
+ | `list_categories` | List all categories |
154
+ | `create_category` | Create a new category |
155
+ | `assign_category` | Tag a task with a category |
156
+ | `ask_question` | Ask a clarifying question (marks task as needs_info) |
157
+ | `get_unanswered_questions` | List all unanswered questions |
158
+ | `check_answered_questions` | Check answers for a specific task |
159
+ | `resume_task` | Move a needs_info task back to pending |
160
+
161
+ ## Cost Estimation
162
+
163
+ - Each run uses API tokens based on context length and task complexity
164
+ - A typical task costs $0.10-$1.00
165
+ - With 4 runs/day, expect ~$10-30/month (varies by task complexity)
166
+ - Monitor usage at console.anthropic.com
package/dist/README.md ADDED
@@ -0,0 +1,166 @@
1
+ # Autoship
2
+
3
+ A drop-in autonomous coding agent that records tasks in your app and implements them in a Github Action.
4
+
5
+ ## How It Works
6
+
7
+ 1. Users submit tasks via React components (or directly via Supabase)
8
+ 2. A GitHub Action wakes up periodically and runs Claude Code
9
+ 3. Claude picks up the highest priority task, implements it, and creates a PR
10
+ 4. If Claude needs clarification, it asks a question and blocks the task until you answer
11
+ 5. You review the PR and merge
12
+
13
+ ## Packages
14
+
15
+ - **`@autoship/react`** - React components and CLI for task submission
16
+ - **`mcp-servers/autoship-mcp`** - MCP server for Claude Code integration
17
+
18
+ ## Quick Start
19
+
20
+ ### 1. Create Supabase Project
21
+
22
+ Create a new Supabase project (or use an existing one). Get the SUPABASE_URL and your database password.
23
+
24
+ ### 2. Set Up Supabase Database
25
+
26
+ Run the migrations using the CLI:
27
+
28
+ ```bash
29
+ npx @autoship init
30
+ ```
31
+
32
+ The CLI will prompt you for credentials. You can provide them in two ways:
33
+
34
+ **Option A: Full DATABASE_URL**
35
+
36
+ ```bash
37
+ # Find this in Supabase Dashboard > Project Settings > Database > Connection string > URI
38
+ npx @autoship init --database-url "postgresql://postgres.xxx:password@aws-0-region.pooler.supabase.com:6543/postgres"
39
+ ```
40
+
41
+ **Option B: Supabase URL + Database Password**
42
+
43
+ ```bash
44
+ npx @autoship init --supabase-url https://xxx.supabase.co --db-password yourpassword
45
+ ```
46
+
47
+ **Using environment variables:**
48
+
49
+ ```bash
50
+ # Option A
51
+ DATABASE_URL="postgresql://..." npx @autoship init
52
+
53
+ # Option B
54
+ SUPABASE_URL="https://xxx.supabase.co" DB_PASSWORD="yourpassword" npx @autoship/react init
55
+ ```
56
+
57
+ ### 3. Add React Components (Optional)
58
+
59
+ Install the package:
60
+
61
+ ```bash
62
+ npm install @autoship/react
63
+ ```
64
+
65
+ Add the provider and button to your app:
66
+
67
+ ```tsx
68
+ import { AutoshipProvider, AutoshipButton } from "@autoship/react";
69
+
70
+ function App() {
71
+ return (
72
+ <AutoshipProvider
73
+ supabaseUrl={process.env.SUPABASE_URL}
74
+ supabaseAnonKey={process.env.SUPABASE_ANON_KEY}
75
+ userId="optional-user-id"
76
+ >
77
+ <YourApp />
78
+ <AutoshipButton />
79
+ </AutoshipProvider>
80
+ );
81
+ }
82
+ ```
83
+
84
+ Available components:
85
+
86
+ - `AutoshipProvider` - Context provider for Supabase connection
87
+ - `AutoshipButton` - Floating button to open task submission dialog
88
+ - `TaskDialog` - Modal for submitting new tasks
89
+ - `TaskList` - List of submitted tasks with status
90
+ - `TaskDetailDialog` - View task details and answer questions
91
+ - `QuestionDialog` - Answer clarifying questions from Claude
92
+
93
+ ### 4. Set Up GitHub Actions
94
+
95
+ Copy these files into your project:
96
+
97
+ ```
98
+ mcp-servers/autoship-mcp/ # The MCP server
99
+ .mcp.json # MCP configuration
100
+ .github/workflows/claude-agent.yml # GitHub Actions workflow
101
+ ```
102
+
103
+ Add GitHub Secrets (Settings > Secrets and variables > Actions):
104
+
105
+ | Secret | Description |
106
+ | ---------------------- | ----------------------------------------------------------- |
107
+ | `ANTHROPIC_API_KEY` | Your Anthropic API key |
108
+ | `SUPABASE_URL` | Your Supabase project URL (e.g., `https://xxx.supabase.co`) |
109
+ | `SUPABASE_SERVICE_KEY` | Supabase service role key (not the anon key) |
110
+
111
+ ### 5. Test Locally (Optional)
112
+
113
+ Build the MCP server:
114
+
115
+ ```bash
116
+ cd mcp-servers/autoship-mcp && npm install && npm run build
117
+ ```
118
+
119
+ ```bash
120
+ # Set environment variables
121
+ export SUPABASE_URL="https://your-project.supabase.co"
122
+ export SUPABASE_SERVICE_KEY="your-service-key"
123
+
124
+ # Test the MCP tools
125
+ claude "Use the autoship-mcp tools to list pending tasks"
126
+ ```
127
+
128
+ ## Manual Trigger
129
+
130
+ You can manually trigger the agent from the GitHub Actions tab, optionally with a custom prompt:
131
+
132
+ 1. Go to Actions > Claude Agent
133
+ 2. Click "Run workflow"
134
+ 3. Optionally enter a custom prompt
135
+ 4. Click "Run workflow"
136
+
137
+ ## Monitoring
138
+
139
+ ### GitHub Actions Logs
140
+
141
+ Check the Actions tab in your repository to see Claude's output for each run.
142
+
143
+ ## Available MCP Tools
144
+
145
+ | Tool | Description |
146
+ | -------------------------- | ---------------------------------------------------- |
147
+ | `list_pending_tasks` | List all pending tasks by priority |
148
+ | `get_task` | Get full details including categories and questions |
149
+ | `claim_task` | Mark a task as in_progress |
150
+ | `complete_task` | Mark as complete with branch name |
151
+ | `fail_task` | Mark as failed with error message |
152
+ | `add_task` | Create new tasks |
153
+ | `list_categories` | List all categories |
154
+ | `create_category` | Create a new category |
155
+ | `assign_category` | Tag a task with a category |
156
+ | `ask_question` | Ask a clarifying question (marks task as needs_info) |
157
+ | `get_unanswered_questions` | List all unanswered questions |
158
+ | `check_answered_questions` | Check answers for a specific task |
159
+ | `resume_task` | Move a needs_info task back to pending |
160
+
161
+ ## Cost Estimation
162
+
163
+ - Each run uses API tokens based on context length and task complexity
164
+ - A typical task costs $0.10-$1.00
165
+ - With 4 runs/day, expect ~$10-30/month (varies by task complexity)
166
+ - Monitor usage at console.anthropic.com
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoship/react",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "dist"
18
18
  ],
19
19
  "scripts": {
20
- "build": "tsc && npm run copy-migrations",
20
+ "build": "tsc && cp ../../README.md README.md && npm run copy-migrations",
21
21
  "copy-migrations": "mkdir -p dist/migrations && cp ../../supabase/migrations/*.sql dist/migrations/",
22
22
  "dev": "tsc --watch",
23
23
  "cli": "node dist/cli/autoship.js"