claudemesh-cli 0.10.3 → 0.10.4
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/dist/index.js +73 -68
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -40189,7 +40189,7 @@ var package_default;
|
|
|
40189
40189
|
var init_package = __esm(() => {
|
|
40190
40190
|
package_default = {
|
|
40191
40191
|
name: "claudemesh-cli",
|
|
40192
|
-
version: "0.10.
|
|
40192
|
+
version: "0.10.4",
|
|
40193
40193
|
description: "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
|
|
40194
40194
|
keywords: [
|
|
40195
40195
|
"claude-code",
|
|
@@ -55030,6 +55030,68 @@ async function runPeers(flags) {
|
|
|
55030
55030
|
// src/commands/welcome.ts
|
|
55031
55031
|
init_colors();
|
|
55032
55032
|
init_spinner();
|
|
55033
|
+
async function browserAuthFlow(action) {
|
|
55034
|
+
const { generatePairingCode: generatePairingCode2, startCallbackListener: startCallbackListener2, openBrowser: openBrowser2 } = await Promise.resolve().then(() => (init_auth(), exports_auth));
|
|
55035
|
+
const code = generatePairingCode2();
|
|
55036
|
+
const listener = await startCallbackListener2();
|
|
55037
|
+
const baseUrl = action === "register" ? `https://claudemesh.com/register?callbackUrl=${encodeURIComponent(`/cli-auth?port=${listener.port}&code=${code}&action=sync`)}` : `https://claudemesh.com/cli-auth?port=${listener.port}&code=${code}&action=sync`;
|
|
55038
|
+
console.log(dim(action === "register" ? ` Opening browser to create your account...
|
|
55039
|
+
` : ` Opening browser to sign in...
|
|
55040
|
+
`));
|
|
55041
|
+
const opened = await openBrowser2(baseUrl);
|
|
55042
|
+
if (!opened) {
|
|
55043
|
+
console.log(" Couldn't open browser. Visit:");
|
|
55044
|
+
}
|
|
55045
|
+
console.log(dim(` ${baseUrl}
|
|
55046
|
+
`));
|
|
55047
|
+
const manualPromise = new Promise((resolve2) => {
|
|
55048
|
+
const rl = createInterface3({ input: process.stdin, output: process.stdout });
|
|
55049
|
+
rl.question(" Paste sync token (or wait for browser): ", (answer) => {
|
|
55050
|
+
rl.close();
|
|
55051
|
+
if (answer.trim())
|
|
55052
|
+
resolve2(answer.trim());
|
|
55053
|
+
});
|
|
55054
|
+
});
|
|
55055
|
+
const timeoutPromise = new Promise((resolve2) => {
|
|
55056
|
+
setTimeout(() => resolve2(null), 900000);
|
|
55057
|
+
});
|
|
55058
|
+
const syncToken = await Promise.race([
|
|
55059
|
+
listener.token,
|
|
55060
|
+
manualPromise,
|
|
55061
|
+
timeoutPromise
|
|
55062
|
+
]);
|
|
55063
|
+
listener.close();
|
|
55064
|
+
if (!syncToken) {
|
|
55065
|
+
console.error(`
|
|
55066
|
+
Timed out waiting for sign-in.`);
|
|
55067
|
+
process.exit(1);
|
|
55068
|
+
}
|
|
55069
|
+
const { generateKeypair: generateKeypair3 } = await Promise.resolve().then(() => (init_keypair(), exports_keypair));
|
|
55070
|
+
const keypair = await generateKeypair3();
|
|
55071
|
+
const displayName = `${hostname4()}-${process.pid}`;
|
|
55072
|
+
const { syncWithBroker: syncWithBroker2 } = await Promise.resolve().then(() => exports_sync_with_broker);
|
|
55073
|
+
const result = await syncWithBroker2(syncToken, keypair.publicKey, displayName);
|
|
55074
|
+
const config2 = loadConfig();
|
|
55075
|
+
const { saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), exports_config));
|
|
55076
|
+
for (const m of result.meshes) {
|
|
55077
|
+
config2.meshes.push({
|
|
55078
|
+
meshId: m.mesh_id,
|
|
55079
|
+
memberId: m.member_id,
|
|
55080
|
+
slug: m.slug,
|
|
55081
|
+
name: m.slug,
|
|
55082
|
+
pubkey: keypair.publicKey,
|
|
55083
|
+
secretKey: keypair.secretKey,
|
|
55084
|
+
brokerUrl: m.broker_url,
|
|
55085
|
+
joinedAt: new Date().toISOString()
|
|
55086
|
+
});
|
|
55087
|
+
}
|
|
55088
|
+
config2.accountId = result.account_id;
|
|
55089
|
+
saveConfig2(config2);
|
|
55090
|
+
console.log(`
|
|
55091
|
+
${green("✓")} Synced ${result.meshes.length} mesh(es): ${result.meshes.map((m) => m.slug).join(", ")}
|
|
55092
|
+
`);
|
|
55093
|
+
await runLaunch({}, []);
|
|
55094
|
+
}
|
|
55033
55095
|
function detectState() {
|
|
55034
55096
|
const claudeConfig = join6(homedir6(), ".claude.json");
|
|
55035
55097
|
let mcpRegistered = false;
|
|
@@ -55110,84 +55172,27 @@ async function runWelcome() {
|
|
|
55110
55172
|
}
|
|
55111
55173
|
spinner.stop();
|
|
55112
55174
|
const choice = await menuSelect({
|
|
55113
|
-
title: "
|
|
55175
|
+
title: "Get started",
|
|
55114
55176
|
items: [
|
|
55115
|
-
"
|
|
55177
|
+
"Create account (new to claudemesh)",
|
|
55178
|
+
"Sign in (existing account)",
|
|
55116
55179
|
"Paste an invite URL",
|
|
55117
55180
|
"Exit"
|
|
55118
55181
|
],
|
|
55119
55182
|
row
|
|
55120
55183
|
});
|
|
55121
|
-
|
|
55122
|
-
|
|
55184
|
+
exitFullScreen();
|
|
55185
|
+
if (choice === 3)
|
|
55123
55186
|
return;
|
|
55124
|
-
}
|
|
55125
55187
|
if (choice === 0) {
|
|
55126
|
-
|
|
55127
|
-
console.log(dim(` Opening browser for sign-in...
|
|
55128
|
-
`));
|
|
55129
|
-
const { generatePairingCode: generatePairingCode2 } = await Promise.resolve().then(() => (init_auth(), exports_auth));
|
|
55130
|
-
const { startCallbackListener: startCallbackListener2, openBrowser: openBrowser2 } = await Promise.resolve().then(() => (init_auth(), exports_auth));
|
|
55131
|
-
const code = generatePairingCode2();
|
|
55132
|
-
const listener = await startCallbackListener2();
|
|
55133
|
-
const url = `https://claudemesh.com/cli-auth?port=${listener.port}&code=${code}&action=sync`;
|
|
55134
|
-
const opened = await openBrowser2(url);
|
|
55135
|
-
if (!opened) {
|
|
55136
|
-
console.log(" Couldn't open browser. Visit:");
|
|
55137
|
-
}
|
|
55138
|
-
console.log(dim(` ${url}
|
|
55139
|
-
`));
|
|
55140
|
-
const manualPromise = new Promise((resolve2) => {
|
|
55141
|
-
const rl = createInterface3({ input: process.stdin, output: process.stdout });
|
|
55142
|
-
rl.question(" Paste sync token (or wait for browser): ", (answer) => {
|
|
55143
|
-
rl.close();
|
|
55144
|
-
if (answer.trim())
|
|
55145
|
-
resolve2(answer.trim());
|
|
55146
|
-
});
|
|
55147
|
-
});
|
|
55148
|
-
const timeoutPromise = new Promise((resolve2) => {
|
|
55149
|
-
setTimeout(() => resolve2(null), 900000);
|
|
55150
|
-
});
|
|
55151
|
-
const syncToken = await Promise.race([
|
|
55152
|
-
listener.token,
|
|
55153
|
-
manualPromise,
|
|
55154
|
-
timeoutPromise
|
|
55155
|
-
]);
|
|
55156
|
-
listener.close();
|
|
55157
|
-
if (!syncToken) {
|
|
55158
|
-
console.error(`
|
|
55159
|
-
Timed out waiting for sign-in.`);
|
|
55160
|
-
process.exit(1);
|
|
55161
|
-
}
|
|
55162
|
-
const { generateKeypair: generateKeypair3 } = await Promise.resolve().then(() => (init_keypair(), exports_keypair));
|
|
55163
|
-
const keypair = await generateKeypair3();
|
|
55164
|
-
const displayName = `${hostname4()}-${process.pid}`;
|
|
55165
|
-
const { syncWithBroker: syncWithBroker2 } = await Promise.resolve().then(() => exports_sync_with_broker);
|
|
55166
|
-
const result = await syncWithBroker2(syncToken, keypair.publicKey, displayName);
|
|
55167
|
-
const config2 = loadConfig();
|
|
55168
|
-
const { saveConfig: saveConfig2 } = await Promise.resolve().then(() => (init_config(), exports_config));
|
|
55169
|
-
for (const m of result.meshes) {
|
|
55170
|
-
config2.meshes.push({
|
|
55171
|
-
meshId: m.mesh_id,
|
|
55172
|
-
memberId: m.member_id,
|
|
55173
|
-
slug: m.slug,
|
|
55174
|
-
name: m.slug,
|
|
55175
|
-
pubkey: keypair.publicKey,
|
|
55176
|
-
secretKey: keypair.secretKey,
|
|
55177
|
-
brokerUrl: m.broker_url,
|
|
55178
|
-
joinedAt: new Date().toISOString()
|
|
55179
|
-
});
|
|
55180
|
-
}
|
|
55181
|
-
config2.accountId = result.account_id;
|
|
55182
|
-
saveConfig2(config2);
|
|
55183
|
-
console.log(`
|
|
55184
|
-
${green("✓")} Synced ${result.meshes.length} mesh(es): ${result.meshes.map((m) => m.slug).join(", ")}
|
|
55185
|
-
`);
|
|
55186
|
-
await runLaunch({}, []);
|
|
55188
|
+
await browserAuthFlow("register");
|
|
55187
55189
|
return;
|
|
55188
55190
|
}
|
|
55189
55191
|
if (choice === 1) {
|
|
55190
|
-
|
|
55192
|
+
await browserAuthFlow("sync");
|
|
55193
|
+
return;
|
|
55194
|
+
}
|
|
55195
|
+
if (choice === 2) {
|
|
55191
55196
|
const rl = createInterface3({ input: process.stdin, output: process.stdout });
|
|
55192
55197
|
const url = await new Promise((resolve2) => {
|
|
55193
55198
|
rl.question(" Invite URL: ", (answer) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudemesh-cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"typescript": "5.9.3",
|
|
50
50
|
"vitest": "4.0.14",
|
|
51
51
|
"@turbostarter/tsconfig": "0.1.0",
|
|
52
|
-
"@turbostarter/prettier-config": "0.1.0",
|
|
53
52
|
"@turbostarter/vitest-config": "0.1.0",
|
|
53
|
+
"@turbostarter/prettier-config": "0.1.0",
|
|
54
54
|
"@turbostarter/eslint-config": "0.1.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|