twindex-openclaw-plugin 0.8.0 → 0.8.2
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/openclaw.plugin.json +5 -1
- package/package.json +1 -1
- package/src/index.ts +21 -0
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "twindex",
|
|
3
3
|
"name": "New Lore",
|
|
4
4
|
"description": "Music intelligence for AI agents. Get notified about tours, merch drops, releases, and presales for your favorite artists.",
|
|
5
|
-
"version": "0.8.
|
|
5
|
+
"version": "0.8.2",
|
|
6
6
|
"skills": ["./skills"],
|
|
7
7
|
"configSchema": {
|
|
8
8
|
"type": "object",
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
"enum": ["telegram", "slack"],
|
|
33
33
|
"default": "telegram",
|
|
34
34
|
"description": "Delivery channel."
|
|
35
|
+
},
|
|
36
|
+
"city": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "User's city. Tour notifications highlight shows near this city."
|
|
35
39
|
}
|
|
36
40
|
}
|
|
37
41
|
},
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -96,6 +96,17 @@ export default function register(api: any) {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
persistConfig(updates);
|
|
99
|
+
|
|
100
|
+
// Set city if configured
|
|
101
|
+
if (config.city) {
|
|
102
|
+
try {
|
|
103
|
+
await twindex.setCity(apiKey, config.city);
|
|
104
|
+
api.logger?.info?.(`NewLore: city set to ${config.city}`);
|
|
105
|
+
} catch (err: any) {
|
|
106
|
+
api.logger?.warn?.(`NewLore: failed to set city: ${err.message}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
99
110
|
pollService.start();
|
|
100
111
|
api.logger?.info?.(
|
|
101
112
|
"NewLore: auto-bootstrap complete. Delivery via polling.",
|
|
@@ -106,6 +117,16 @@ export default function register(api: any) {
|
|
|
106
117
|
} finally {
|
|
107
118
|
bootstrapping = false;
|
|
108
119
|
}
|
|
120
|
+
|
|
121
|
+
// Sync city on every reload (city often arrives after bootstrap via config.patch)
|
|
122
|
+
const postConfig = cfg();
|
|
123
|
+
if (postConfig.apiKey && postConfig.city) {
|
|
124
|
+
twindex.setCity(postConfig.apiKey, postConfig.city).then(() => {
|
|
125
|
+
api.logger?.info?.(`NewLore: city synced to ${postConfig.city}`);
|
|
126
|
+
}).catch((err: any) => {
|
|
127
|
+
api.logger?.warn?.(`NewLore: failed to sync city: ${err.message}`);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
109
130
|
})();
|
|
110
131
|
|
|
111
132
|
// ── Tools ──────────────────────────────────────────────────────────
|