opencode-puter-auth 1.0.34 → 1.0.35
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 +63 -25
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +303 -6
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
[](https://ko-fi.com/chindrismihai)
|
|
7
7
|
|
|
8
|
-
> Access Claude Opus 4.5, Sonnet 4.5, GPT-5, Gemini, DeepSeek, and 500+ AI models through Puter.com
|
|
8
|
+
> Access Claude Opus 4.5, Sonnet 4.5, GPT-5, Gemini, DeepSeek, and 500+ AI models through Puter.com OAuth. No API keys needed - free tier available with undocumented limits.
|
|
9
9
|
|
|
10
|
-
Enable OpenCode to authenticate with [Puter.com](https://puter.com) via OAuth, giving you
|
|
10
|
+
Enable OpenCode to authenticate with [Puter.com](https://puter.com) via OAuth, giving you access to premium AI models through your Puter account. Ideal for app developers using the "User-Pays" model where each user covers their own AI costs.
|
|
11
11
|
|
|
12
12
|
## What You Get
|
|
13
13
|
|
|
@@ -22,13 +22,36 @@ Enable OpenCode to authenticate with [Puter.com](https://puter.com) via OAuth, g
|
|
|
22
22
|
|
|
23
23
|
## How It Works
|
|
24
24
|
|
|
25
|
-
Puter.com uses a **
|
|
25
|
+
Puter.com uses a **"User-Pays" model**:
|
|
26
26
|
|
|
27
27
|
1. **No API keys** - Just sign in with your Puter account
|
|
28
|
-
2. **
|
|
29
|
-
3. **
|
|
28
|
+
2. **Users pay their own usage** - Each Puter account has its own credit allocation
|
|
29
|
+
3. **Free tier available** - New accounts get free credits to start
|
|
30
|
+
4. **Credits run out** - When exhausted, you pay Puter directly or create a new account
|
|
30
31
|
|
|
31
|
-
> **Important:**
|
|
32
|
+
> **Important Reality Check:** Puter's marketing says "Free, Unlimited" but this is misleading. In practice:
|
|
33
|
+
> - Free tier limits exist but are **undocumented** ([GitHub Issue #1704](https://github.com/HeyPuter/puter/issues/1704))
|
|
34
|
+
> - Users report limits trigger after "minimal usage" ([GitHub Issue #1291](https://github.com/HeyPuter/puter/issues/1291))
|
|
35
|
+
> - When limits hit, you'll see: `"usage-limited-chat": Permission denied`
|
|
36
|
+
|
|
37
|
+
## Understanding the "User-Pays" Model
|
|
38
|
+
|
|
39
|
+
### For App Developers (Building apps for others)
|
|
40
|
+
**Great fit!** Your infrastructure cost is $0. Each of YOUR users authenticates with their OWN Puter account and pays for their own AI usage.
|
|
41
|
+
|
|
42
|
+
### For Personal/Development Use (Using it yourself)
|
|
43
|
+
**Caution:** When YOU use this plugin during development, YOU are the user. YOUR Puter account's free tier gets consumed. Based on community reports, the free tier is limited and undocumented.
|
|
44
|
+
|
|
45
|
+
### Free Tier Reality
|
|
46
|
+
|
|
47
|
+
| Aspect | What Puter Claims | What Actually Happens |
|
|
48
|
+
|--------|-------------------|----------------------|
|
|
49
|
+
| **Pricing** | "Free, Unlimited" | Free tier exists but has limits |
|
|
50
|
+
| **Limits** | "No usage restrictions" | Undocumented limits trigger unexpectedly |
|
|
51
|
+
| **Documentation** | Not specified | Limits are not publicly documented |
|
|
52
|
+
| **When exceeded** | Not mentioned | Error: `usage-limited-chat: Permission denied` |
|
|
53
|
+
|
|
54
|
+
**Estimated free tier:** ~100 requests/day (unconfirmed, based on third-party reports)
|
|
32
55
|
|
|
33
56
|
## Installation
|
|
34
57
|
|
|
@@ -225,20 +248,33 @@ The plugin adds these tools to OpenCode:
|
|
|
225
248
|
- **`puter-models`** - List all available Puter models
|
|
226
249
|
- **`puter-account`** - Show current account info
|
|
227
250
|
|
|
228
|
-
## Comparison: Puter vs Antigravity
|
|
229
|
-
|
|
230
|
-
| Feature | Puter | Antigravity |
|
|
231
|
-
|
|
232
|
-
| **
|
|
233
|
-
| **
|
|
234
|
-
| **Claude
|
|
235
|
-
| **
|
|
236
|
-
| **
|
|
237
|
-
| **
|
|
238
|
-
| **
|
|
239
|
-
| **
|
|
240
|
-
|
|
241
|
-
|
|
251
|
+
## Comparison: Puter vs Antigravity vs Alternatives
|
|
252
|
+
|
|
253
|
+
| Feature | Puter | Antigravity | Netlify AI Gateway |
|
|
254
|
+
|---------|-------|-------------|-------------------|
|
|
255
|
+
| **Free Quota** | Undocumented limits | ~300K tokens/day | 300 credits/mo |
|
|
256
|
+
| **Limits Documented?** | No | Unofficial | Yes |
|
|
257
|
+
| **Claude Opus 4.5** | Yes | Yes | Yes |
|
|
258
|
+
| **Claude Sonnet 4.5** | Yes | Yes | Yes |
|
|
259
|
+
| **GPT-5** | Yes | No | No |
|
|
260
|
+
| **DeepSeek R1** | Yes | No | No |
|
|
261
|
+
| **Gemini 3** | No | Yes | No |
|
|
262
|
+
| **Best For** | App builders | Dev work | Very light use |
|
|
263
|
+
|
|
264
|
+
### Recommendations by Use Case
|
|
265
|
+
|
|
266
|
+
| Use Case | Recommended Provider |
|
|
267
|
+
|----------|---------------------|
|
|
268
|
+
| **Building apps** (users pay their own usage) | **Puter** |
|
|
269
|
+
| **Development/testing** (you are the user) | **Antigravity** (more predictable) |
|
|
270
|
+
| **Heavy development work** | Paid API (Anthropic, OpenAI) |
|
|
271
|
+
| **Occasional Claude access** | Puter (while free tier lasts) |
|
|
272
|
+
| **GPT-5 / DeepSeek access** | **Puter** (only option) |
|
|
273
|
+
|
|
274
|
+
**Bottom line**:
|
|
275
|
+
- Use **Puter** for building apps where your users authenticate with their own accounts
|
|
276
|
+
- Use **Antigravity** for your own development (more predictable ~300K tokens/day)
|
|
277
|
+
- Use **Puter** if you specifically need GPT-5 or DeepSeek (not available elsewhere free)
|
|
242
278
|
|
|
243
279
|
## Migrating from Old Config (v1.0.27 and earlier)
|
|
244
280
|
|
|
@@ -309,14 +345,16 @@ The new standalone provider offers:
|
|
|
309
345
|
|
|
310
346
|
## Troubleshooting
|
|
311
347
|
|
|
312
|
-
### "You have reached your AI usage limit"
|
|
348
|
+
### "usage-limited-chat: Permission denied" or "You have reached your AI usage limit"
|
|
313
349
|
|
|
314
|
-
This means your Puter account has exhausted its credits.
|
|
350
|
+
This means your Puter account has exhausted its free tier credits. Despite Puter's "Free Unlimited" marketing, limits do exist.
|
|
315
351
|
|
|
316
352
|
**Solutions:**
|
|
317
|
-
1.
|
|
318
|
-
2.
|
|
319
|
-
3. Create a new Puter account (new accounts get
|
|
353
|
+
1. **Wait** - Limits may reset (timing undocumented)
|
|
354
|
+
2. **Add credits** on [Puter.com](https://puter.com) (paid)
|
|
355
|
+
3. **New account** - Create a new Puter account (new accounts get free credits)
|
|
356
|
+
4. **Switch providers** - Use Antigravity, OpenRouter free tier, or other free providers
|
|
357
|
+
5. **Use lighter models** - Haiku/Flash models may consume fewer credits than Opus
|
|
320
358
|
|
|
321
359
|
### Clear cached plugin and reinstall
|
|
322
360
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* opencode-puter-auth - Puter.com OAuth Plugin for OpenCode
|
|
3
3
|
*
|
|
4
|
-
* Provides
|
|
4
|
+
* Provides access to Claude Opus 4.5, Sonnet 4.5, GPT-5, Gemini,
|
|
5
5
|
* and 500+ AI models through Puter.com's "User-Pays" model.
|
|
6
|
+
* Free tier available with undocumented limits.
|
|
6
7
|
*
|
|
7
8
|
* @author chindris-mihai-alexandru
|
|
8
9
|
* @license MIT
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAI9C,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGrH,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* opencode-puter-auth - Puter.com OAuth Plugin for OpenCode
|
|
3
3
|
*
|
|
4
|
-
* Provides
|
|
4
|
+
* Provides access to Claude Opus 4.5, Sonnet 4.5, GPT-5, Gemini,
|
|
5
5
|
* and 500+ AI models through Puter.com's "User-Pays" model.
|
|
6
|
+
* Free tier available with undocumented limits.
|
|
6
7
|
*
|
|
7
8
|
* @author chindris-mihai-alexandru
|
|
8
9
|
* @license MIT
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,kDAAkD;AAClD,2DAA2D;AAC3D,wEAAwE;AACxE,yFAAyF;AACzF,gFAAgF;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,gEAAgE;AAChE,uEAAuE;AACvE,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEhE,0BAA0B;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAsB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAsB,MAAM,qBAAqB,CAAC;AAmWtE;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAoS7B,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -33,6 +33,305 @@ let pluginConfig = {};
|
|
|
33
33
|
// OAuth server state
|
|
34
34
|
const CALLBACK_PORT = 19847;
|
|
35
35
|
const AUTH_TIMEOUT_MS = 300000;
|
|
36
|
+
/**
|
|
37
|
+
* Generate the HTML login page for Puter authentication.
|
|
38
|
+
* Puter uses username/password login via REST API, not OAuth redirects.
|
|
39
|
+
* This page handles the login flow entirely in the browser, including 2FA.
|
|
40
|
+
*/
|
|
41
|
+
function getLoginPage(callbackPort) {
|
|
42
|
+
return `<!DOCTYPE html>
|
|
43
|
+
<html lang="en">
|
|
44
|
+
<head>
|
|
45
|
+
<meta charset="UTF-8">
|
|
46
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
47
|
+
<title>Sign in to Puter - OpenCode</title>
|
|
48
|
+
<style>
|
|
49
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
50
|
+
body {
|
|
51
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
52
|
+
min-height: 100vh;
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
align-items: center;
|
|
56
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
57
|
+
padding: 20px;
|
|
58
|
+
}
|
|
59
|
+
.card {
|
|
60
|
+
background: white;
|
|
61
|
+
padding: 40px;
|
|
62
|
+
border-radius: 16px;
|
|
63
|
+
box-shadow: 0 10px 40px rgba(0,0,0,0.2);
|
|
64
|
+
width: 100%;
|
|
65
|
+
max-width: 400px;
|
|
66
|
+
}
|
|
67
|
+
.logo {
|
|
68
|
+
text-align: center;
|
|
69
|
+
margin-bottom: 24px;
|
|
70
|
+
}
|
|
71
|
+
.logo h1 {
|
|
72
|
+
font-size: 28px;
|
|
73
|
+
color: #333;
|
|
74
|
+
}
|
|
75
|
+
.logo p {
|
|
76
|
+
color: #666;
|
|
77
|
+
font-size: 14px;
|
|
78
|
+
margin-top: 8px;
|
|
79
|
+
}
|
|
80
|
+
.form-group {
|
|
81
|
+
margin-bottom: 20px;
|
|
82
|
+
}
|
|
83
|
+
label {
|
|
84
|
+
display: block;
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
margin-bottom: 6px;
|
|
87
|
+
color: #333;
|
|
88
|
+
}
|
|
89
|
+
input {
|
|
90
|
+
width: 100%;
|
|
91
|
+
padding: 12px 16px;
|
|
92
|
+
border: 2px solid #e2e8f0;
|
|
93
|
+
border-radius: 8px;
|
|
94
|
+
font-size: 16px;
|
|
95
|
+
transition: border-color 0.2s;
|
|
96
|
+
}
|
|
97
|
+
input:focus {
|
|
98
|
+
outline: none;
|
|
99
|
+
border-color: #667eea;
|
|
100
|
+
}
|
|
101
|
+
button {
|
|
102
|
+
width: 100%;
|
|
103
|
+
padding: 14px;
|
|
104
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
105
|
+
color: white;
|
|
106
|
+
border: none;
|
|
107
|
+
border-radius: 8px;
|
|
108
|
+
font-size: 16px;
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
transition: opacity 0.2s;
|
|
112
|
+
}
|
|
113
|
+
button:hover { opacity: 0.9; }
|
|
114
|
+
button:disabled {
|
|
115
|
+
opacity: 0.6;
|
|
116
|
+
cursor: not-allowed;
|
|
117
|
+
}
|
|
118
|
+
.error {
|
|
119
|
+
background: #fee2e2;
|
|
120
|
+
border: 1px solid #fca5a5;
|
|
121
|
+
color: #dc2626;
|
|
122
|
+
padding: 12px;
|
|
123
|
+
border-radius: 8px;
|
|
124
|
+
margin-bottom: 20px;
|
|
125
|
+
display: none;
|
|
126
|
+
}
|
|
127
|
+
.info {
|
|
128
|
+
background: #dbeafe;
|
|
129
|
+
border: 1px solid #93c5fd;
|
|
130
|
+
color: #1d4ed8;
|
|
131
|
+
padding: 12px;
|
|
132
|
+
border-radius: 8px;
|
|
133
|
+
margin-bottom: 20px;
|
|
134
|
+
font-size: 14px;
|
|
135
|
+
}
|
|
136
|
+
.signup-link {
|
|
137
|
+
text-align: center;
|
|
138
|
+
margin-top: 20px;
|
|
139
|
+
font-size: 14px;
|
|
140
|
+
color: #666;
|
|
141
|
+
}
|
|
142
|
+
.signup-link a {
|
|
143
|
+
color: #667eea;
|
|
144
|
+
text-decoration: none;
|
|
145
|
+
}
|
|
146
|
+
.signup-link a:hover { text-decoration: underline; }
|
|
147
|
+
#otp-section { display: none; }
|
|
148
|
+
.spinner {
|
|
149
|
+
display: inline-block;
|
|
150
|
+
width: 16px;
|
|
151
|
+
height: 16px;
|
|
152
|
+
border: 2px solid transparent;
|
|
153
|
+
border-top: 2px solid white;
|
|
154
|
+
border-radius: 50%;
|
|
155
|
+
animation: spin 1s linear infinite;
|
|
156
|
+
margin-right: 8px;
|
|
157
|
+
vertical-align: middle;
|
|
158
|
+
}
|
|
159
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
160
|
+
</style>
|
|
161
|
+
</head>
|
|
162
|
+
<body>
|
|
163
|
+
<div class="card">
|
|
164
|
+
<div class="logo">
|
|
165
|
+
<h1>Puter</h1>
|
|
166
|
+
<p>Sign in to access 500+ AI models via OpenCode</p>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<div class="error" id="error"></div>
|
|
170
|
+
|
|
171
|
+
<div class="info">
|
|
172
|
+
Sign in with your Puter.com account. If you don't have one,
|
|
173
|
+
<a href="https://puter.com" target="_blank">create a free account</a> first.
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<form id="login-form">
|
|
177
|
+
<div id="credentials-section">
|
|
178
|
+
<div class="form-group">
|
|
179
|
+
<label for="username">Username</label>
|
|
180
|
+
<input type="text" id="username" name="username" required autocomplete="username">
|
|
181
|
+
</div>
|
|
182
|
+
<div class="form-group">
|
|
183
|
+
<label for="password">Password</label>
|
|
184
|
+
<input type="password" id="password" name="password" required autocomplete="current-password">
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
<div id="otp-section">
|
|
189
|
+
<div class="form-group">
|
|
190
|
+
<label for="otp">Authenticator Code (2FA)</label>
|
|
191
|
+
<input type="text" id="otp" name="otp" maxlength="6" pattern="[0-9]{6}"
|
|
192
|
+
placeholder="Enter 6-digit code" autocomplete="one-time-code">
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
<button type="submit" id="submit-btn">Sign In</button>
|
|
197
|
+
</form>
|
|
198
|
+
|
|
199
|
+
<div class="signup-link">
|
|
200
|
+
Don't have an account? <a href="https://puter.com" target="_blank">Sign up for Puter</a>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<script>
|
|
205
|
+
const form = document.getElementById('login-form');
|
|
206
|
+
const errorDiv = document.getElementById('error');
|
|
207
|
+
const submitBtn = document.getElementById('submit-btn');
|
|
208
|
+
const credentialsSection = document.getElementById('credentials-section');
|
|
209
|
+
const otpSection = document.getElementById('otp-section');
|
|
210
|
+
const otpInput = document.getElementById('otp');
|
|
211
|
+
|
|
212
|
+
let otpJwtToken = null; // For 2FA flow
|
|
213
|
+
|
|
214
|
+
function showError(message) {
|
|
215
|
+
errorDiv.textContent = message;
|
|
216
|
+
errorDiv.style.display = 'block';
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function hideError() {
|
|
220
|
+
errorDiv.style.display = 'none';
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function setLoading(loading) {
|
|
224
|
+
submitBtn.disabled = loading;
|
|
225
|
+
submitBtn.innerHTML = loading
|
|
226
|
+
? '<span class="spinner"></span>Signing in...'
|
|
227
|
+
: 'Sign In';
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
async function handleLogin(e) {
|
|
231
|
+
e.preventDefault();
|
|
232
|
+
hideError();
|
|
233
|
+
setLoading(true);
|
|
234
|
+
|
|
235
|
+
try {
|
|
236
|
+
let response, data;
|
|
237
|
+
|
|
238
|
+
if (otpJwtToken) {
|
|
239
|
+
// 2FA step
|
|
240
|
+
const otp = otpInput.value.trim();
|
|
241
|
+
if (otp.length !== 6) {
|
|
242
|
+
showError('Please enter a 6-digit code');
|
|
243
|
+
setLoading(false);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
response = await fetch('https://puter.com/login/otp', {
|
|
248
|
+
method: 'POST',
|
|
249
|
+
headers: {
|
|
250
|
+
'Content-Type': 'application/json',
|
|
251
|
+
'Origin': 'https://puter.com',
|
|
252
|
+
'Referer': 'https://puter.com/'
|
|
253
|
+
},
|
|
254
|
+
body: JSON.stringify({
|
|
255
|
+
token: otpJwtToken,
|
|
256
|
+
code: otp
|
|
257
|
+
})
|
|
258
|
+
});
|
|
259
|
+
} else {
|
|
260
|
+
// Initial login
|
|
261
|
+
const username = document.getElementById('username').value.trim();
|
|
262
|
+
const password = document.getElementById('password').value;
|
|
263
|
+
|
|
264
|
+
response = await fetch('https://puter.com/login', {
|
|
265
|
+
method: 'POST',
|
|
266
|
+
headers: {
|
|
267
|
+
'Content-Type': 'application/json',
|
|
268
|
+
'Origin': 'https://puter.com',
|
|
269
|
+
'Referer': 'https://puter.com/'
|
|
270
|
+
},
|
|
271
|
+
body: JSON.stringify({ username, password })
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const contentType = response.headers.get('content-type') || '';
|
|
276
|
+
if (!contentType.includes('application/json')) {
|
|
277
|
+
const text = await response.text();
|
|
278
|
+
throw new Error(text || 'Login failed');
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
data = await response.json();
|
|
282
|
+
|
|
283
|
+
// Handle multi-step login (2FA)
|
|
284
|
+
while (data.proceed && data.next_step) {
|
|
285
|
+
if (data.next_step === 'otp') {
|
|
286
|
+
// Show 2FA input
|
|
287
|
+
otpJwtToken = data.otp_jwt_token;
|
|
288
|
+
credentialsSection.style.display = 'none';
|
|
289
|
+
otpSection.style.display = 'block';
|
|
290
|
+
submitBtn.textContent = 'Verify Code';
|
|
291
|
+
setLoading(false);
|
|
292
|
+
otpInput.focus();
|
|
293
|
+
return; // Wait for user to submit OTP
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (data.next_step === 'complete') {
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
throw new Error('Unrecognized login step: ' + data.next_step);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Success - we have the token
|
|
304
|
+
if (data.proceed && data.token) {
|
|
305
|
+
// Get user info to get username
|
|
306
|
+
let username = document.getElementById('username').value.trim();
|
|
307
|
+
|
|
308
|
+
// Redirect to callback with token
|
|
309
|
+
const callbackUrl = new URL('http://localhost:${callbackPort}/callback');
|
|
310
|
+
callbackUrl.searchParams.set('token', data.token);
|
|
311
|
+
callbackUrl.searchParams.set('username', username);
|
|
312
|
+
if (data.email) {
|
|
313
|
+
callbackUrl.searchParams.set('email', data.email);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
window.location.href = callbackUrl.toString();
|
|
317
|
+
} else {
|
|
318
|
+
throw new Error('Login failed. Please check your credentials.');
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
} catch (err) {
|
|
322
|
+
showError(err.message || 'Login failed');
|
|
323
|
+
setLoading(false);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
form.addEventListener('submit', handleLogin);
|
|
328
|
+
|
|
329
|
+
// Focus username on load
|
|
330
|
+
document.getElementById('username').focus();
|
|
331
|
+
</script>
|
|
332
|
+
</body>
|
|
333
|
+
</html>`;
|
|
334
|
+
}
|
|
36
335
|
/**
|
|
37
336
|
* Load plugin configuration from puter.json
|
|
38
337
|
*/
|
|
@@ -175,11 +474,9 @@ export const PuterAuthPlugin = async (_input) => {
|
|
|
175
474
|
}
|
|
176
475
|
}
|
|
177
476
|
else if (url.pathname === '/') {
|
|
178
|
-
//
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
res.writeHead(302, { Location: authUrl });
|
|
182
|
-
res.end();
|
|
477
|
+
// Serve login page - Puter uses username/password, not OAuth redirects
|
|
478
|
+
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
479
|
+
res.end(getLoginPage(CALLBACK_PORT));
|
|
183
480
|
}
|
|
184
481
|
else {
|
|
185
482
|
res.writeHead(404);
|
|
@@ -204,7 +501,7 @@ export const PuterAuthPlugin = async (_input) => {
|
|
|
204
501
|
});
|
|
205
502
|
resolve({
|
|
206
503
|
url: `http://localhost:${CALLBACK_PORT}`,
|
|
207
|
-
instructions: 'Opening browser for Puter.com
|
|
504
|
+
instructions: 'Opening browser for Puter.com login. Enter your Puter username and password to authenticate.',
|
|
208
505
|
method: 'auto',
|
|
209
506
|
callback: () => callbackPromise,
|
|
210
507
|
});
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,aA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C,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC;oBACrG,CAAC;gBACH,CAAC;aACF,CAAC;SACH;QAED,2CAA2C;QAC3C,gBAAgB;QAChB,2CAA2C;QAC3C,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE;YACnB,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;gBACvB,OAAO,CAAC,GAAG,CAAC,uBAAuB,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-puter-auth",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.35",
|
|
4
4
|
"description": "Puter.com OAuth plugin for OpenCode - Easy access to Claude, GPT, Gemini & 500+ AI models. No API keys needed, credit-based usage.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"puter-auth": "dist/cli.js"
|