slashvibe-mcp 0.2.9 → 0.3.13
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 +1 -0
- package/analytics.js +107 -0
- package/auth-store.js +148 -0
- package/auto-update.js +130 -0
- package/bridges/bridge-monitor.js +388 -0
- package/bridges/discord-bot.js +431 -0
- package/bridges/farcaster.js +299 -0
- package/bridges/telegram.js +261 -0
- package/bridges/webhook-health.js +420 -0
- package/bridges/webhook-server.js +437 -0
- package/bridges/whatsapp.js +441 -0
- package/bridges/x-webhook.js +423 -0
- package/config.js +154 -5
- package/crypto.js +3 -8
- package/games/arcade.js +406 -0
- package/games/chess.js +451 -0
- package/games/colorguess.js +343 -0
- package/games/crossword-words.js +171 -0
- package/games/crossword.js +461 -0
- package/games/drawing.js +347 -0
- package/games/gameroulette.js +300 -0
- package/games/gamerouter.js +336 -0
- package/games/gamestatus.js +337 -0
- package/games/guessnumber.js +209 -0
- package/games/hangman.js +279 -0
- package/games/memory.js +338 -0
- package/games/multiplayer-tictactoe.js +389 -0
- package/games/pixelart.js +399 -0
- package/games/quickduel.js +354 -0
- package/games/riddle.js +371 -0
- package/games/rockpaperscissors.js +291 -0
- package/games/snake.js +406 -0
- package/games/storybuilder.js +343 -0
- package/games/tictactoe.js +345 -0
- package/games/twentyquestions.js +286 -0
- package/games/twotruths.js +207 -0
- package/games/werewolf.js +508 -0
- package/games/wordassociation.js +247 -0
- package/games/wordchain.js +135 -0
- package/index.js +105 -216
- package/intelligence/index.js +45 -0
- package/intelligence/infer.js +316 -0
- package/intelligence/interests.js +369 -0
- package/intelligence/patterns.js +651 -0
- package/intelligence/proactive.js +358 -0
- package/intelligence/serendipity.js +306 -0
- package/memory.js +166 -0
- package/notification-emitter.js +77 -0
- package/notify.js +102 -1
- package/package.json +21 -7
- package/prompts.js +1 -1
- package/protocol/index.js +161 -1
- package/setup.js +402 -0
- package/store/api.js +528 -82
- package/store/profiles.js +160 -12
- package/tools/_actions.js +463 -16
- package/tools/_deprecated/auto-suggest-connections.js +304 -0
- package/tools/_deprecated/bootstrap-skills.js +231 -0
- package/tools/_deprecated/bridge-dashboard.js +342 -0
- package/tools/_deprecated/bridge-health.js +400 -0
- package/tools/_deprecated/bridge-live.js +384 -0
- package/tools/_deprecated/bridges.js +383 -0
- package/tools/_deprecated/colorguess.js +281 -0
- package/tools/_deprecated/discover-insights.js +379 -0
- package/tools/_deprecated/discover-momentum.js +256 -0
- package/tools/_deprecated/discovery-analytics.js +345 -0
- package/tools/_deprecated/discovery-auto-suggest.js +275 -0
- package/tools/_deprecated/discovery-bootstrap.js +267 -0
- package/tools/_deprecated/discovery-daily.js +375 -0
- package/tools/_deprecated/discovery-dashboard.js +385 -0
- package/tools/_deprecated/discovery-digest.js +314 -0
- package/tools/_deprecated/discovery-hub.js +357 -0
- package/tools/_deprecated/discovery-insights.js +384 -0
- package/tools/_deprecated/discovery-momentum.js +281 -0
- package/tools/_deprecated/discovery-monitor.js +319 -0
- package/tools/_deprecated/discovery-proactive.js +300 -0
- package/tools/_deprecated/draw.js +317 -0
- package/tools/_deprecated/farcaster.js +307 -0
- package/tools/_deprecated/forget.js +119 -0
- package/tools/_deprecated/games-catalog.js +376 -0
- package/tools/_deprecated/games.js +313 -0
- package/tools/_deprecated/guessnumber.js +194 -0
- package/tools/_deprecated/hangman.js +129 -0
- package/tools/_deprecated/multiplayer-tictactoe.js +303 -0
- package/tools/_deprecated/recall.js +147 -0
- package/tools/_deprecated/remember.js +86 -0
- package/tools/_deprecated/riddle.js +240 -0
- package/tools/_deprecated/run-bootstrap.js +69 -0
- package/tools/_deprecated/skills-analytics.js +349 -0
- package/tools/_deprecated/skills-bootstrap.js +301 -0
- package/tools/_deprecated/skills-dashboard.js +268 -0
- package/tools/_deprecated/skills.js +380 -0
- package/tools/_deprecated/smart-intro.js +353 -0
- package/tools/_deprecated/storybuilder.js +331 -0
- package/tools/_deprecated/telegram-bot.js +183 -0
- package/tools/_deprecated/telegram-setup.js +214 -0
- package/tools/_deprecated/twentyquestions.js +143 -0
- package/tools/_discovery-enhanced.js +290 -0
- package/tools/_discovery.js +439 -0
- package/tools/_proactive-discovery.js +301 -0
- package/tools/_shared/index.js +64 -0
- package/tools/_shared.js +234 -0
- package/tools/_work-context.js +338 -0
- package/tools/_work-context.manual-test.js +199 -0
- package/tools/_work-context.test.js +260 -0
- package/tools/activity.js +220 -0
- package/tools/admin-inbox.js +218 -0
- package/tools/agent-treasury.js +288 -0
- package/tools/analytics.js +191 -0
- package/tools/approve.js +197 -0
- package/tools/arcade.js +173 -0
- package/tools/artifact-create.js +17 -11
- package/tools/artifact-view.js +31 -1
- package/tools/artifacts-price.js +47 -43
- package/tools/ask-expert.js +160 -0
- package/tools/available.js +120 -0
- package/tools/become-expert.js +150 -0
- package/tools/broadcast.js +286 -0
- package/tools/chat.js +202 -0
- package/tools/collaborative-drawing.js +286 -0
- package/tools/connection-status.js +178 -0
- package/tools/crossword.js +17 -1
- package/tools/discover.js +350 -34
- package/tools/dm.js +115 -73
- package/tools/drawing.js +1 -1
- package/tools/earnings.js +126 -0
- package/tools/echo.js +16 -0
- package/tools/feed.js +51 -7
- package/tools/follow.js +224 -0
- package/tools/friends.js +207 -0
- package/tools/game.js +2 -2
- package/tools/genesis.js +233 -0
- package/tools/gig-browse.js +206 -0
- package/tools/gig-complete.js +144 -0
- package/tools/handoff.js +7 -1
- package/tools/help.js +4 -4
- package/tools/idea.js +9 -2
- package/tools/inbox.js +334 -28
- package/tools/init.js +727 -36
- package/tools/invite.js +15 -4
- package/tools/l2-bridge.js +272 -0
- package/tools/l2-status.js +217 -0
- package/tools/l2.js +206 -0
- package/tools/migrate.js +156 -0
- package/tools/mint.js +377 -0
- package/tools/multiplayer-game.js +1 -1
- package/tools/notifications.js +415 -0
- package/tools/observe.js +200 -0
- package/tools/onboarding.js +147 -0
- package/tools/open.js +143 -12
- package/tools/party-game.js +2 -2
- package/tools/plan.js +225 -0
- package/tools/presence-agent.js +7 -0
- package/tools/proof-of-work.js +100 -104
- package/tools/pulse.js +218 -0
- package/tools/reply.js +166 -0
- package/tools/report.js +2 -2
- package/tools/reputation.js +175 -0
- package/tools/request.js +17 -3
- package/tools/schedule.js +367 -0
- package/tools/search-messages.js +123 -0
- package/tools/session.js +420 -0
- package/tools/session_price.js +128 -0
- package/tools/settings.js +126 -3
- package/tools/ship.js +31 -8
- package/tools/shipback.js +326 -0
- package/tools/smart-check.js +201 -0
- package/tools/social-processor.js +445 -0
- package/tools/solo-game.js +1 -1
- package/tools/start.js +335 -93
- package/tools/status.js +53 -6
- package/tools/stuck.js +297 -0
- package/tools/subscribe.js +148 -0
- package/tools/subscriptions.js +134 -0
- package/tools/suggest-tags.js +6 -8
- package/tools/tag-suggestions.js +257 -0
- package/tools/tip.js +193 -0
- package/tools/token.js +103 -0
- package/tools/update.js +1 -1
- package/tools/wallet.js +239 -186
- package/tools/watch.js +157 -0
- package/tools/webhook-test.js +388 -0
- package/tools/who.js +54 -3
- package/tools/withdraw.js +145 -0
- package/tools/work-summary.js +96 -0
- package/tools/workshop.js +327 -0
- package/tools/x-mentions.js +1 -1
- package/version.json +14 -3
- package/tools/artifacts-buy.js +0 -111
- package/tools/connect.js +0 -284
- package/tools/gigs-apply.js +0 -99
- package/tools/gigs-browse.js +0 -114
- package/tools/gigs-complete.js +0 -128
- package/tools/gigs-post.js +0 -140
- package/tools/live-off.js +0 -109
- package/tools/live-watch.js +0 -176
- package/tools/live.js +0 -128
- package/tools/sessions-browse.js +0 -105
- package/tools/whats-happening.js +0 -125
- /package/tools/{away.js → _deprecated/away.js} +0 -0
- /package/tools/{back.js → _deprecated/back.js} +0 -0
- /package/tools/{mute.js → _deprecated/mute.js} +0 -0
- /package/tools/{skills-exchange.js → _deprecated/skills-exchange.js} +0 -0
- /package/tools/{tictactoe.js → _deprecated/tictactoe.js} +0 -0
- /package/tools/{wordassociation.js → _deprecated/wordassociation.js} +0 -0
package/tools/l2.js
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vibe_l2 - Unified VIBE L2 Command
|
|
3
|
+
*
|
|
4
|
+
* One command to rule them all.
|
|
5
|
+
*
|
|
6
|
+
* Examples:
|
|
7
|
+
* - "vibe l2" - Overview and status
|
|
8
|
+
* - "vibe l2 status" - Chain health
|
|
9
|
+
* - "vibe l2 shipback" - View earnings
|
|
10
|
+
* - "vibe l2 bridge" - Bridge info
|
|
11
|
+
* - "vibe l2 mint" - Mint artifact on L2
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const config = require('../config');
|
|
15
|
+
|
|
16
|
+
const definition = {
|
|
17
|
+
name: 'vibe_l2',
|
|
18
|
+
description: 'VIBE L2 commands: status, shipback, bridge, mint. Run "vibe l2" for overview.',
|
|
19
|
+
inputSchema: {
|
|
20
|
+
type: 'object',
|
|
21
|
+
properties: {
|
|
22
|
+
command: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
description: 'Command: status, shipback, bridge, mint, or omit for overview'
|
|
25
|
+
},
|
|
26
|
+
args: {
|
|
27
|
+
type: 'object',
|
|
28
|
+
description: 'Arguments for the command'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
async function handler(args) {
|
|
35
|
+
const { command, args: cmdArgs = {} } = args;
|
|
36
|
+
|
|
37
|
+
if (!config.isInitialized()) {
|
|
38
|
+
return {
|
|
39
|
+
display: 'Run `vibe init` first to set your identity.'
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const handle = config.getHandle();
|
|
44
|
+
|
|
45
|
+
// No command = show overview
|
|
46
|
+
if (!command) {
|
|
47
|
+
return showOverview(handle);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Route to specific tool
|
|
51
|
+
switch (command.toLowerCase()) {
|
|
52
|
+
case 'status':
|
|
53
|
+
const statusTool = require('./l2-status');
|
|
54
|
+
return statusTool.handler(cmdArgs);
|
|
55
|
+
|
|
56
|
+
case 'shipback':
|
|
57
|
+
case 'earnings':
|
|
58
|
+
const shipbackTool = require('./shipback');
|
|
59
|
+
return shipbackTool.handler(cmdArgs);
|
|
60
|
+
|
|
61
|
+
case 'bridge':
|
|
62
|
+
const bridgeTool = require('./l2-bridge');
|
|
63
|
+
return bridgeTool.handler(cmdArgs);
|
|
64
|
+
|
|
65
|
+
case 'mint':
|
|
66
|
+
return showMintInfo(handle);
|
|
67
|
+
|
|
68
|
+
case 'help':
|
|
69
|
+
return showHelp();
|
|
70
|
+
|
|
71
|
+
default:
|
|
72
|
+
return {
|
|
73
|
+
display: `Unknown command: ${command}\n\nRun "vibe l2 help" for available commands.`
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function showOverview(handle) {
|
|
79
|
+
return {
|
|
80
|
+
display: `
|
|
81
|
+
╔═══════════════════════════════════════════════════════════════════╗
|
|
82
|
+
║ VIBE L2 ║
|
|
83
|
+
║ Creator-First Economics for the AI Coding Era ║
|
|
84
|
+
╠═══════════════════════════════════════════════════════════════════╣
|
|
85
|
+
║ ║
|
|
86
|
+
║ "You shipped it, you earn from it" ║
|
|
87
|
+
║ ║
|
|
88
|
+
║ VIBE L2 is an OP Stack chain where creators earn 80% of ║
|
|
89
|
+
║ gas fees from interactions with their deployed contracts. ║
|
|
90
|
+
║ ║
|
|
91
|
+
╠═══════════════════════════════════════════════════════════════════╣
|
|
92
|
+
║ ║
|
|
93
|
+
║ SHIPBACK ECONOMICS ║
|
|
94
|
+
║ ┌──────────────────────────────────────────────────────────┐ ║
|
|
95
|
+
║ │ User interacts with your artifact │ ║
|
|
96
|
+
║ │ ↓ │ ║
|
|
97
|
+
║ │ Gas fee collected → Distributed: │ ║
|
|
98
|
+
║ │ │ ║
|
|
99
|
+
║ │ ████████████████████░░░░░ 80% → You (Creator) │ ║
|
|
100
|
+
║ │ ███░░░░░░░░░░░░░░░░░░░░░░ 15% → Protocol Treasury │ ║
|
|
101
|
+
║ │ █░░░░░░░░░░░░░░░░░░░░░░░░ 5% → Foundation Grants │ ║
|
|
102
|
+
║ └──────────────────────────────────────────────────────────┘ ║
|
|
103
|
+
║ ║
|
|
104
|
+
╠═══════════════════════════════════════════════════════════════════╣
|
|
105
|
+
║ ║
|
|
106
|
+
║ COMMANDS ║
|
|
107
|
+
║ ──────────────────────────────────────────────────────────── ║
|
|
108
|
+
║ vibe l2 status Check chain health & contracts ║
|
|
109
|
+
║ vibe l2 shipback View/claim your earnings ║
|
|
110
|
+
║ vibe l2 bridge Move ETH between Base ↔ VIBE L2 ║
|
|
111
|
+
║ vibe l2 mint Mint an artifact on VIBE L2 ║
|
|
112
|
+
║ ║
|
|
113
|
+
╠═══════════════════════════════════════════════════════════════════╣
|
|
114
|
+
║ ║
|
|
115
|
+
║ QUICK START ║
|
|
116
|
+
║ 1. Bridge ETH: vibe l2 bridge deposit 0.1 ║
|
|
117
|
+
║ 2. Link wallet: vibe l2 shipback link ║
|
|
118
|
+
║ 3. Create art: vibe create artifact ║
|
|
119
|
+
║ 4. Mint on L2: vibe l2 mint ║
|
|
120
|
+
║ 5. Earn forever: vibe l2 shipback ║
|
|
121
|
+
║ ║
|
|
122
|
+
╚═══════════════════════════════════════════════════════════════════╝
|
|
123
|
+
|
|
124
|
+
Logged in as: @${handle}
|
|
125
|
+
`.trim()
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function showMintInfo(handle) {
|
|
130
|
+
return {
|
|
131
|
+
display: `
|
|
132
|
+
🎨 MINT ON VIBE L2
|
|
133
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
134
|
+
|
|
135
|
+
Minting on VIBE L2 gives you:
|
|
136
|
+
• 80% of all gas fees from interactions (Shipback)
|
|
137
|
+
• Ultra-low minting costs (~0.0001 ETH)
|
|
138
|
+
• Session provenance on-chain
|
|
139
|
+
• Automatic royalties (10% default)
|
|
140
|
+
|
|
141
|
+
To mint an artifact:
|
|
142
|
+
|
|
143
|
+
1. First, create the artifact content:
|
|
144
|
+
vibe create artifact
|
|
145
|
+
|
|
146
|
+
2. Then mint it on VIBE L2:
|
|
147
|
+
vibe mint --chain vibe-l2
|
|
148
|
+
|
|
149
|
+
Or use the API directly:
|
|
150
|
+
POST /api/nft/mint
|
|
151
|
+
{
|
|
152
|
+
"artifact_id": "art_xxx",
|
|
153
|
+
"chain": "vibe-l2"
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
Prerequisites:
|
|
157
|
+
• ETH on VIBE L2 (use: vibe l2 bridge deposit 0.1)
|
|
158
|
+
• Linked wallet (use: vibe l2 shipback link)
|
|
159
|
+
|
|
160
|
+
Current handle: @${handle}
|
|
161
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
162
|
+
`.trim()
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function showHelp() {
|
|
167
|
+
return {
|
|
168
|
+
display: `
|
|
169
|
+
VIBE L2 COMMANDS
|
|
170
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
171
|
+
|
|
172
|
+
vibe l2 Show this overview
|
|
173
|
+
vibe l2 status Chain health, contracts, gas prices
|
|
174
|
+
vibe l2 shipback View Shipback earnings
|
|
175
|
+
vibe l2 shipback link Link wallet to handle
|
|
176
|
+
vibe l2 shipback claim Claim accumulated earnings
|
|
177
|
+
vibe l2 shipback contracts List registered contracts
|
|
178
|
+
vibe l2 bridge Bridge overview
|
|
179
|
+
vibe l2 bridge deposit X Deposit X ETH to VIBE L2
|
|
180
|
+
vibe l2 bridge withdraw X Withdraw X ETH to Base
|
|
181
|
+
vibe l2 bridge estimate Gas cost estimates
|
|
182
|
+
vibe l2 mint Mint artifact info
|
|
183
|
+
|
|
184
|
+
ARCHITECTURE
|
|
185
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
186
|
+
|
|
187
|
+
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
|
188
|
+
│ Ethereum │────▶│ Base │────▶│ VIBE L2 │
|
|
189
|
+
│ (Security) │ │ (Bridge) │ │ (Apps) │
|
|
190
|
+
└─────────────┘ └─────────────┘ └─────────────┘
|
|
191
|
+
|
|
192
|
+
Stack: OP Stack via Conduit
|
|
193
|
+
DA: Celestia
|
|
194
|
+
Gas: ETH (not token)
|
|
195
|
+
|
|
196
|
+
LINKS
|
|
197
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
198
|
+
|
|
199
|
+
Explorer: https://explorer.vibe.network
|
|
200
|
+
Bridge: https://bridge.vibe.network
|
|
201
|
+
Docs: https://docs.slashvibe.dev/l2
|
|
202
|
+
`.trim()
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
module.exports = { definition, handler };
|
package/tools/migrate.js
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vibe migrate — Migrate existing handle to GitHub auth
|
|
3
|
+
*
|
|
4
|
+
* For users who have existing handles with local keypairs,
|
|
5
|
+
* this command helps them migrate to GitHub OAuth auth.
|
|
6
|
+
*
|
|
7
|
+
* Flow:
|
|
8
|
+
* 1. Check if user has existing handle and keys
|
|
9
|
+
* 2. Sign migration request with old key (proves ownership)
|
|
10
|
+
* 3. Get migration URL from server
|
|
11
|
+
* 4. User completes GitHub auth in browser
|
|
12
|
+
* 5. Token pasted via `vibe token`
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const config = require('../config');
|
|
16
|
+
const crypto = require('../crypto');
|
|
17
|
+
|
|
18
|
+
const definition = {
|
|
19
|
+
name: 'vibe_migrate',
|
|
20
|
+
description: 'Migrate your existing handle to GitHub authentication. Use this if you have an existing handle with local keys.',
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties: {}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
async function handler(args) {
|
|
28
|
+
const handle = config.getHandle();
|
|
29
|
+
|
|
30
|
+
if (!handle) {
|
|
31
|
+
return {
|
|
32
|
+
display: `❌ **No handle found**
|
|
33
|
+
|
|
34
|
+
You need to have an existing handle to migrate.
|
|
35
|
+
If you're new, use \`vibe init @yourhandle "what you're building"\` instead.`
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Check if already using GitHub auth
|
|
40
|
+
if (config.hasOAuth()) {
|
|
41
|
+
return {
|
|
42
|
+
display: `✅ **Already using GitHub auth**
|
|
43
|
+
|
|
44
|
+
@${handle} is already authenticated via GitHub.
|
|
45
|
+
No migration needed!`
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Check if we have a keypair to sign with
|
|
50
|
+
const keypair = config.getKeypair();
|
|
51
|
+
|
|
52
|
+
// Build migration request
|
|
53
|
+
const https = require('https');
|
|
54
|
+
const apiUrl = config.getApiUrl();
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
const timestamp = Date.now();
|
|
58
|
+
let signature = null;
|
|
59
|
+
|
|
60
|
+
// If we have a keypair, sign the migration request
|
|
61
|
+
if (keypair) {
|
|
62
|
+
const messageToSign = {
|
|
63
|
+
action: 'migrate',
|
|
64
|
+
handle: handle,
|
|
65
|
+
timestamp: timestamp
|
|
66
|
+
};
|
|
67
|
+
signature = crypto.sign(messageToSign, keypair.privateKey);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Request migration token from server
|
|
71
|
+
const result = await new Promise((resolve, reject) => {
|
|
72
|
+
const url = new URL('/api/auth/migrate', apiUrl);
|
|
73
|
+
const data = JSON.stringify({
|
|
74
|
+
handle,
|
|
75
|
+
legacy_signature: signature,
|
|
76
|
+
timestamp
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const req = https.request({
|
|
80
|
+
hostname: url.hostname,
|
|
81
|
+
port: 443,
|
|
82
|
+
path: url.pathname,
|
|
83
|
+
method: 'POST',
|
|
84
|
+
headers: {
|
|
85
|
+
'Content-Type': 'application/json',
|
|
86
|
+
'Content-Length': data.length
|
|
87
|
+
}
|
|
88
|
+
}, (res) => {
|
|
89
|
+
let body = '';
|
|
90
|
+
res.on('data', chunk => body += chunk);
|
|
91
|
+
res.on('end', () => {
|
|
92
|
+
try {
|
|
93
|
+
resolve(JSON.parse(body));
|
|
94
|
+
} catch (e) {
|
|
95
|
+
resolve({ success: false, error: body });
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
req.on('error', reject);
|
|
101
|
+
req.write(data);
|
|
102
|
+
req.end();
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
if (!result.success) {
|
|
106
|
+
return {
|
|
107
|
+
display: `❌ **Migration failed**
|
|
108
|
+
|
|
109
|
+
Error: ${result.error}
|
|
110
|
+
${result.message || ''}
|
|
111
|
+
|
|
112
|
+
If you're having trouble, try:
|
|
113
|
+
1. Make sure your handle is registered
|
|
114
|
+
2. Check that your local keys match what's on the server
|
|
115
|
+
3. Contact support if the issue persists`
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Success - show auth URL
|
|
120
|
+
return {
|
|
121
|
+
display: `## Migrate @${handle} to GitHub Auth
|
|
122
|
+
|
|
123
|
+
${result.verified ? '✅ **Ownership verified** via signature' : '⚠️ **Unverified** — GitHub auth will claim this handle'}
|
|
124
|
+
|
|
125
|
+
🔐 **Open this URL in your browser:**
|
|
126
|
+
|
|
127
|
+
${result.authUrl}
|
|
128
|
+
|
|
129
|
+
After authenticating:
|
|
130
|
+
\`vibe token <paste-token-here>\`
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
**Why migrate?**
|
|
135
|
+
• Your identity is verified via GitHub (no impersonation)
|
|
136
|
+
• Messages are signed server-side (more secure)
|
|
137
|
+
• No private keys stored locally
|
|
138
|
+
|
|
139
|
+
_Migration token expires in 1 hour._`,
|
|
140
|
+
authUrl: result.authUrl,
|
|
141
|
+
verified: result.verified,
|
|
142
|
+
migrationToken: result.migrationToken
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
} catch (e) {
|
|
146
|
+
return {
|
|
147
|
+
display: `❌ **Migration request failed**
|
|
148
|
+
|
|
149
|
+
Error: ${e.message}
|
|
150
|
+
|
|
151
|
+
Make sure you have internet connectivity and try again.`
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
module.exports = { definition, handler };
|