myaiforone 1.1.67 → 1.1.68

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.
@@ -0,0 +1,125 @@
1
+ # License Provisioning
2
+
3
+ How MyAIforOne issues and verifies 30-day trial license keys.
4
+
5
+ ## Architecture
6
+
7
+ ```
8
+ [ User's browser ]
9
+ │ (1) fills email + name on myaiforone.com/get-key
10
+
11
+ [ myaiforone.com server ] ← holds admin key in env var, NEVER in browser
12
+ │ (2) calls POST /api/provision with x-api-key
13
+
14
+ [ ai41license.agenticledger.ai ]
15
+ │ (3) returns licenseKey + expiresAt (30-day trial)
16
+
17
+ [ myaiforone.com server ]
18
+ │ (4) emails key to user
19
+
20
+ [ User pastes key into local MyAIforOne install ]
21
+ ```
22
+
23
+ The licensing admin key lives **only** on the `myaiforone.com` backend. The browser never sees it. Local MyAIforOne installs never see it either — they just consume the key the user pastes into the license-activation modal (`public/license-check.js`).
24
+
25
+ The local "Generate one here →" link in the license-activation modal points to `https://myaiforone.com/get-key`.
26
+
27
+ ---
28
+
29
+ ## Get Key API — Integration Instructions
30
+
31
+ ### Endpoint
32
+
33
+ ```
34
+ POST https://myaiforone.com/api/get-key
35
+ ```
36
+
37
+ ### Headers
38
+
39
+ ```
40
+ Content-Type: application/json
41
+ ```
42
+
43
+ ### Request Body
44
+
45
+ ```json
46
+ {
47
+ "email": "user@example.com",
48
+ "name": "Jane Doe"
49
+ }
50
+ ```
51
+
52
+ | Field | Type | Required | Notes |
53
+ |-------|------|----------|-------|
54
+ | `email` | string | Yes | Must be a valid, non-disposable email address |
55
+ | `name` | string | Yes | 1–100 characters |
56
+
57
+ ### Success Response (200)
58
+
59
+ ```json
60
+ {
61
+ "success": true
62
+ }
63
+ ```
64
+
65
+ The license key is **not** returned in the response. It is emailed to the user at the address provided.
66
+
67
+ ### Error Responses
68
+
69
+ | Status | Body | Meaning |
70
+ |--------|------|---------|
71
+ | 400 | `{"error": "Please enter a valid email address."}` | Missing or invalid email |
72
+ | 400 | `{"error": "Please enter your name."}` | Missing or invalid name |
73
+ | 400 | `{"error": "Please use a permanent email address."}` | Disposable/temporary email domain |
74
+ | 429 | `{"error": "Too many requests. Try again in an hour."}` | IP rate limit (5 requests/hour) |
75
+ | 429 | `{"error": "A key was already sent to this email recently..."}` | Email rate limit (1 per 24h) |
76
+ | 500 | `{"error": "Something went wrong. Please try again in a few minutes."}` | Server/license server error |
77
+
78
+ ### Rate Limits
79
+
80
+ - **Per IP:** 5 requests per hour
81
+ - **Per email:** 1 request per 24 hours
82
+
83
+ ### What Happens
84
+
85
+ 1. Input is validated and email is checked against a disposable-domain blocklist.
86
+ 2. A 30-day trial license is provisioned on the licensing server.
87
+ 3. The license key is emailed to the user.
88
+ 4. If the email already has an active license, the existing key is re-sent (no duplicate created).
89
+
90
+ ### Example cURL
91
+
92
+ ```bash
93
+ curl -X POST https://myaiforone.com/api/get-key \
94
+ -H 'Content-Type: application/json' \
95
+ -d '{"email": "jane@example.com", "name": "Jane Doe"}'
96
+ ```
97
+
98
+ ### Frontend Page
99
+
100
+ Users can also obtain a key through the public web form at:
101
+
102
+ ```
103
+ https://myaiforone.com/get-key
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Verifying a License (local app side)
109
+
110
+ The local platform calls `/api/license` and `/api/license/check` (proxied to the upstream `POST https://ai41license.agenticledger.ai/api/license/verify`) to validate the pasted key and gate features. This endpoint requires no auth — the license key itself is the credential. See `public/license-check.js` and `src/web-ui.ts` for the wiring.
111
+
112
+ ## Default trial features (30 days)
113
+
114
+ - ✅ Web UI
115
+ - ✅ Up to 3 agents
116
+ - ✅ 1 channel
117
+ - ❌ Everything else (super agents, channels, MCPs, skills, memory, goals, projects, gym, multi-model)
118
+
119
+ Paid/enterprise plans unlock additional features via the same `/api/license/verify` response.
120
+
121
+ ## Related files
122
+
123
+ - `public/license-check.js` — the license-activation modal shown on unlicensed installs (link to `myaiforone.com/get-key` lives here)
124
+ - `src/web-ui.ts` — local `/api/license` and `/api/license/check` proxy routes
125
+ - `public/admin.html` — Admin → Settings → License section (manual key entry/verify)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myaiforone",
3
- "version": "1.1.67",
3
+ "version": "1.1.68",
4
4
  "type": "module",
5
5
  "description": "Routes messages from phone channels to project-specific Claude Code agents",
6
6
  "bin": {
@@ -146,10 +146,10 @@ function showLicenseModal(licenseData) {
146
146
  <div style="text-align:center;margin-top:16px">
147
147
  <p style="font-size:12px;color:var(--text-muted, #94a3b8);margin-bottom:8px">
148
148
  Don&rsquo;t have a key?
149
- <a href="https://aigym.agenticledger.ai/#download" target="_blank" style="color:var(--accent, #22d3ee);text-decoration:none;font-weight:600">
149
+ <a href="https://myaiforone.com/get-key" target="_blank" style="color:var(--accent, #22d3ee);text-decoration:none;font-weight:600">
150
150
  Generate one here &rarr;
151
151
  </a>
152
- <span style="color:var(--text-dim, #64748b);font-size:11px;display:block;margin-top:2px">(skip to Step 4)</span>
152
+ <span style="color:var(--text-dim, #64748b);font-size:11px;display:block;margin-top:2px">Free 30-day trial &mdash; key sent by email</span>
153
153
  </p>
154
154
  <a href="/admin?tab=settings" style="font-size:11px;color:var(--text-muted, #94a3b8);text-decoration:none">
155
155
  or go to Admin Settings &rarr;