antenna-fyi 1.3.34 → 1.3.36
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 +5 -3
- package/lib/core.js +8 -1
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -66,7 +66,7 @@ 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 --personal-description '...' --looking-for '...' --conversation-style '...' --hide --visible true]");
|
|
69
|
+
if (!id) return console.error("Usage: antenna profile --id <platform>:<user_id> [--name Yi --personal-description '...' --looking-for '...' --conversation-style '...' --more-information '...' --contact 'WeChat: yi' --slug mira --hide --visible true]");
|
|
70
70
|
if (f.name || f["personal-description"] !== undefined || f.line1 !== undefined || f["looking-for"] !== undefined || f.line2 !== undefined || f["conversation-style"] !== undefined || f.line3 !== undefined || f["more-information"] !== undefined || f.contact !== undefined || f.slug !== undefined || 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 };
|
|
@@ -80,7 +80,9 @@ export async function handleProfile(f) {
|
|
|
80
80
|
if (f["more-information"] !== undefined) payload.matching_context = f["more-information"];
|
|
81
81
|
if (f.contact !== undefined) payload.contact_info = f.contact;
|
|
82
82
|
if (f.slug !== undefined) payload.profile_slug = f.slug;
|
|
83
|
-
|
|
83
|
+
if (visible !== undefined) payload.visible = visible;
|
|
84
|
+
const config = loadConfig();
|
|
85
|
+
if (config.key) payload.api_key = config.key;
|
|
84
86
|
const data = await setProfile(payload);
|
|
85
87
|
if (data?.error) {
|
|
86
88
|
console.error("❌ " + data.error);
|
|
@@ -1075,7 +1077,7 @@ export function printHelp() {
|
|
|
1075
1077
|
Usage:
|
|
1076
1078
|
antenna scan --lat 39.99 --lng 116.48 [--radius 500] (max 1000) [--id <platform>:<user_id>]
|
|
1077
1079
|
antenna checkin --id <platform>:<user_id> --lat 39.99 --lng 116.48
|
|
1078
|
-
antenna profile --id <platform>:<user_id> [--name Yi --personal-description '...' --looking-for '...' --conversation-style '...' --contact 'WeChat: yi' --hide --visible true]
|
|
1080
|
+
antenna profile --id <platform>:<user_id> [--name Yi --personal-description '...' --looking-for '...' --conversation-style '...' --more-information '...' --contact 'WeChat: yi' --slug mira --hide --visible true]
|
|
1079
1081
|
antenna accept --id <platform>:<user_id> --target <ref_or_device_id> [--contact 'WeChat: yi']
|
|
1080
1082
|
antenna pass --id <platform>:<user_id> --target <ref_or_device_id> (or --ref 1)
|
|
1081
1083
|
antenna matches --id <platform>:<user_id>
|
package/lib/core.js
CHANGED
|
@@ -258,6 +258,7 @@ export async function setProfile({
|
|
|
258
258
|
profile_slug,
|
|
259
259
|
is_active,
|
|
260
260
|
archetype_override,
|
|
261
|
+
api_key,
|
|
261
262
|
supabaseUrl,
|
|
262
263
|
supabaseKey,
|
|
263
264
|
}) {
|
|
@@ -265,7 +266,8 @@ export async function setProfile({
|
|
|
265
266
|
|
|
266
267
|
// Pack structured fields into matching_context JSON
|
|
267
268
|
let contextJson = matching_context;
|
|
268
|
-
|
|
269
|
+
const needsContextPack = matching_context || interest_tags || city || links || is_active !== undefined || archetype_override !== undefined || (line1 && !matching_context) || (line2 && !matching_context) || (line3 && !matching_context);
|
|
270
|
+
if (needsContextPack) {
|
|
269
271
|
// Read existing context from DB to merge
|
|
270
272
|
let existing = {};
|
|
271
273
|
try {
|
|
@@ -284,6 +286,10 @@ export async function setProfile({
|
|
|
284
286
|
existing.context = matching_context;
|
|
285
287
|
}
|
|
286
288
|
}
|
|
289
|
+
// If no explicit context but lines are being set, auto-generate context from lines
|
|
290
|
+
if (!matching_context && !existing.context && (line1 || line2 || line3)) {
|
|
291
|
+
existing.context = [line1, line2, line3].filter(Boolean).join(". ");
|
|
292
|
+
}
|
|
287
293
|
if (interest_tags) existing.interestTags = interest_tags;
|
|
288
294
|
if (city) existing.city = city;
|
|
289
295
|
if (links) existing.links = links;
|
|
@@ -303,6 +309,7 @@ export async function setProfile({
|
|
|
303
309
|
p_visible: visible,
|
|
304
310
|
p_matching_context: contextJson || null,
|
|
305
311
|
p_contact_info: contact_info || null,
|
|
312
|
+
...(api_key ? { p_api_key: api_key } : {}),
|
|
306
313
|
});
|
|
307
314
|
if (error) throw new Error(error.message);
|
|
308
315
|
|