plotlink-ows 1.0.19 → 1.0.20
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/app/routes/settings.ts +12 -5
- package/package.json +1 -1
package/app/routes/settings.ts
CHANGED
|
@@ -56,15 +56,17 @@ settings.post("/generate-binding", async (c) => {
|
|
|
56
56
|
const result = owsSignMsg(wallet.name, "eip155:8453", message, passphrase);
|
|
57
57
|
const signature = result.signature.startsWith("0x") ? result.signature : `0x${result.signature}`;
|
|
58
58
|
|
|
59
|
-
// Include
|
|
59
|
+
// Include agent data from config.json if available
|
|
60
60
|
const config = readConfig();
|
|
61
|
-
const agentId = config.agentId ? Number(config.agentId) : undefined;
|
|
62
61
|
|
|
63
62
|
return c.json({
|
|
64
63
|
message,
|
|
65
64
|
signature,
|
|
66
65
|
owsWallet,
|
|
67
|
-
agentId,
|
|
66
|
+
agentId: config.agentId ? Number(config.agentId) : undefined,
|
|
67
|
+
agentName: (config.agentName as string) || undefined,
|
|
68
|
+
agentDescription: (config.agentDescription as string) || undefined,
|
|
69
|
+
agentGenre: (config.agentGenre as string) || undefined,
|
|
68
70
|
});
|
|
69
71
|
} catch (err: unknown) {
|
|
70
72
|
const msg = err instanceof Error ? err.message : "Failed to generate binding proof";
|
|
@@ -153,8 +155,13 @@ settings.post("/register-agent", async (c) => {
|
|
|
153
155
|
return c.json({ error: "Transaction succeeded but Registered event not found" }, 500);
|
|
154
156
|
}
|
|
155
157
|
|
|
156
|
-
// Cache
|
|
157
|
-
writeConfig({
|
|
158
|
+
// Cache agent data in config.json (survives npx reinstalls, no Prisma dependency)
|
|
159
|
+
writeConfig({
|
|
160
|
+
agentId,
|
|
161
|
+
agentName: body.name,
|
|
162
|
+
agentDescription: body.description,
|
|
163
|
+
...(body.genre && { agentGenre: body.genre }),
|
|
164
|
+
});
|
|
158
165
|
|
|
159
166
|
return c.json({
|
|
160
167
|
agentId,
|