antenna-fyi 1.3.17 ā 1.3.19
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/lib/cli.js +31 -28
- package/lib/core.js +6 -0
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -47,9 +47,9 @@ export async function handleScan(f) {
|
|
|
47
47
|
}
|
|
48
48
|
result.profiles.forEach((p) => {
|
|
49
49
|
console.log(` ${p.emoji} ${p.name}${p.distance_m != null ? ` (${Math.round(p.distance_m)}m)` : ""}`);
|
|
50
|
-
if (p.
|
|
51
|
-
if (p.
|
|
52
|
-
if (p.
|
|
50
|
+
if (p.personal_description) console.log(` ${p.personal_description}`);
|
|
51
|
+
if (p.looking_for) console.log(` ${p.looking_for}`);
|
|
52
|
+
if (p.conversation_style) console.log(` ${p.conversation_style}`);
|
|
53
53
|
console.log(` ref: ${p.ref}\n`);
|
|
54
54
|
});
|
|
55
55
|
|
|
@@ -66,26 +66,29 @@ export async function handleScan(f) {
|
|
|
66
66
|
|
|
67
67
|
export async function handleProfile(f) {
|
|
68
68
|
const id = resolveId(f);
|
|
69
|
-
if (!id) return console.error("Usage: antenna profile --id <platform>:<user_id> [--name Yi --emoji 𦦠--
|
|
70
|
-
if (f.name || f
|
|
69
|
+
if (!id) return console.error("Usage: antenna profile --id <platform>:<user_id> [--name Yi --emoji 𦦠--personal-description '...' --looking-for '...' --conversation-style '...'].']");
|
|
70
|
+
if (f.name || f["personal-description"] || f["looking-for"] || f["conversation-style"] || f.visible !== undefined || f.hide !== undefined) {
|
|
71
71
|
const visible = f.hide ? false : (f.visible !== undefined ? f.visible === 'true' || f.visible === true : undefined);
|
|
72
72
|
const payload = { device_id: id };
|
|
73
73
|
if (f.name) payload.display_name = f.name;
|
|
74
74
|
if (f.emoji) payload.emoji = f.emoji;
|
|
75
|
-
if (f
|
|
76
|
-
if (f
|
|
77
|
-
if (f
|
|
75
|
+
if (f["personal-description"] !== undefined) payload.line1 = f["personal-description"];
|
|
76
|
+
if (f["looking-for"] !== undefined) payload.line2 = f["looking-for"];
|
|
77
|
+
if (f["conversation-style"] !== undefined) payload.line3 = f["conversation-style"];
|
|
78
78
|
if (visible !== undefined) payload.visible = visible;
|
|
79
79
|
const data = await setProfile(payload);
|
|
80
80
|
console.log("ā
Profile saved");
|
|
81
81
|
console.log(JSON.stringify(data, null, 2));
|
|
82
82
|
} else {
|
|
83
83
|
const data = await getProfile({ device_id: id });
|
|
84
|
-
if (!data) return console.log("No profile yet. Create one with --name and --
|
|
84
|
+
if (!data) return console.log("No profile yet. Create one with --name and --personal-description");
|
|
85
85
|
console.log(`${data.emoji || "š¤"} ${data.display_name || "Anonymous"}`);
|
|
86
|
-
if (data.
|
|
87
|
-
if (data.
|
|
88
|
-
if (data.
|
|
86
|
+
if (data.personal_description) console.log(` ${data.personal_description}`);
|
|
87
|
+
if (data.looking_for) console.log(` Looking for: ${data.looking_for}`);
|
|
88
|
+
if (data.conversation_style) console.log(` Conversation: ${data.conversation_style}`);
|
|
89
|
+
if (data.interest_tags?.length) console.log(` Tags: ${data.interest_tags.join(", ")}`);
|
|
90
|
+
if (data.city) console.log(` š ${data.city}`);
|
|
91
|
+
if (data.context) console.log(` More info: ${data.context}`);
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
|
|
@@ -128,7 +131,7 @@ export async function handleMatches(f) {
|
|
|
128
131
|
}
|
|
129
132
|
for (const m of result.incoming_accepts) {
|
|
130
133
|
console.log(`š© WANTS TO MEET YOU: ${m.emoji} ${m.name}`);
|
|
131
|
-
if (m.
|
|
134
|
+
if (m.personal_description) console.log(` ${m.personal_description}`);
|
|
132
135
|
console.log(` Accept: antenna accept --id ${f.id} --ref ${m.ref}`);
|
|
133
136
|
console.log();
|
|
134
137
|
}
|
|
@@ -142,9 +145,9 @@ export async function handleDiscover(f) {
|
|
|
142
145
|
console.log(`š Global discover:\n`);
|
|
143
146
|
result.profiles.forEach((p) => {
|
|
144
147
|
console.log(` ${p.emoji} ${p.name}`);
|
|
145
|
-
if (p.
|
|
146
|
-
if (p.
|
|
147
|
-
if (p.
|
|
148
|
+
if (p.personal_description) console.log(` ${p.personal_description}`);
|
|
149
|
+
if (p.looking_for) console.log(` ${p.looking_for}`);
|
|
150
|
+
if (p.conversation_style) console.log(` ${p.conversation_style}`);
|
|
148
151
|
if (p.match_reason) console.log(` ā ${p.match_reason}`);
|
|
149
152
|
console.log(` ref: ${p.ref}\n`);
|
|
150
153
|
});
|
|
@@ -229,7 +232,7 @@ export async function handleEvent(f) {
|
|
|
229
232
|
const creatorTag = p.role === "creator" ? " [äø»å]" : "";
|
|
230
233
|
const statusTag = p.status === "pending" ? " š”å¾
å®”ę¹" : "";
|
|
231
234
|
console.log(` ${p.emoji} ${p.name}${creatorTag}${badge}${statusTag}`);
|
|
232
|
-
if (p.
|
|
235
|
+
if (p.personal_description) console.log(` ${p.personal_description}`);
|
|
233
236
|
if (p.application_context) console.log(` š ${p.application_context}`);
|
|
234
237
|
console.log(` ref: ${p.ref}\n`);
|
|
235
238
|
});
|
|
@@ -334,9 +337,9 @@ export async function handleSetup(f) {
|
|
|
334
337
|
|
|
335
338
|
const name = await ask("Display name: ");
|
|
336
339
|
const emoji = (await ask("Emoji (default š¤): ")) || "š¤";
|
|
337
|
-
const
|
|
338
|
-
const
|
|
339
|
-
const
|
|
340
|
+
const personalDesc = await ask("Personal description ā who you are, what you do: ");
|
|
341
|
+
const lookingFor = await ask("Looking for ā the kind of people you want to meet: ");
|
|
342
|
+
const convStyle = await ask("Conversation style ā the type of conversations you want: ");
|
|
340
343
|
|
|
341
344
|
rl.close();
|
|
342
345
|
|
|
@@ -344,16 +347,16 @@ export async function handleSetup(f) {
|
|
|
344
347
|
device_id: id,
|
|
345
348
|
display_name: name || null,
|
|
346
349
|
emoji,
|
|
347
|
-
line1:
|
|
348
|
-
line2:
|
|
349
|
-
line3:
|
|
350
|
+
line1: personalDesc || null,
|
|
351
|
+
line2: lookingFor || null,
|
|
352
|
+
line3: convStyle || null,
|
|
350
353
|
});
|
|
351
354
|
|
|
352
355
|
console.log("\nā
Profile saved!\n");
|
|
353
356
|
console.log(` ${emoji} ${name || "Anonymous"}`);
|
|
354
|
-
if (
|
|
355
|
-
if (
|
|
356
|
-
if (
|
|
357
|
+
if (personalDesc) console.log(` ${personalDesc}`);
|
|
358
|
+
if (lookingFor) console.log(` ${lookingFor}`);
|
|
359
|
+
if (convStyle) console.log(` ${convStyle}`);
|
|
357
360
|
console.log();
|
|
358
361
|
}
|
|
359
362
|
|
|
@@ -763,7 +766,7 @@ export async function handleWatch(f) {
|
|
|
763
766
|
for (const m of initial.incoming_accepts) {
|
|
764
767
|
const key = `incoming:${m._device_id}`;
|
|
765
768
|
notified.add(key);
|
|
766
|
-
_log(` ${m.emoji || "š¤"} ${m.name} ā ${m.
|
|
769
|
+
_log(` ${m.emoji || "š¤"} ${m.name} ā ${m.personal_description || ""}`);
|
|
767
770
|
}
|
|
768
771
|
saveNotified(notified);
|
|
769
772
|
_log("");
|
|
@@ -971,7 +974,7 @@ export function printHelp() {
|
|
|
971
974
|
Usage:
|
|
972
975
|
antenna scan --lat 39.99 --lng 116.48 [--radius 500] (max 1000) [--id <platform>:<user_id>]
|
|
973
976
|
antenna checkin --id <platform>:<user_id> --lat 39.99 --lng 116.48
|
|
974
|
-
antenna profile --id <platform>:<user_id> [--name Yi --emoji 𦦠--
|
|
977
|
+
antenna profile --id <platform>:<user_id> [--name Yi --emoji 𦦠--personal-description '...']
|
|
975
978
|
antenna accept --id <platform>:<user_id> --target <ref_or_device_id> [--contact 'WeChat: yi']
|
|
976
979
|
antenna pass --id <platform>:<user_id> --target <ref_or_device_id> (or --ref 1)
|
|
977
980
|
antenna matches --id <platform>:<user_id>
|
package/lib/core.js
CHANGED
|
@@ -215,6 +215,12 @@ export async function getProfile({ device_id, supabaseUrl, supabaseKey }) {
|
|
|
215
215
|
data.context = ctx.context || null;
|
|
216
216
|
} catch {}
|
|
217
217
|
}
|
|
218
|
+
|
|
219
|
+
// Add semantic field aliases
|
|
220
|
+
data.personal_description = data.line1 || null;
|
|
221
|
+
data.looking_for = data.line2 || null;
|
|
222
|
+
data.conversation_style = data.line3 || null;
|
|
223
|
+
|
|
218
224
|
return data;
|
|
219
225
|
}
|
|
220
226
|
|