plotlink-ows 1.0.18 → 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
CHANGED
|
@@ -56,10 +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 agent data from config.json if available
|
|
60
|
+
const config = readConfig();
|
|
61
|
+
|
|
59
62
|
return c.json({
|
|
60
63
|
message,
|
|
61
64
|
signature,
|
|
62
65
|
owsWallet,
|
|
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,
|
|
63
70
|
});
|
|
64
71
|
} catch (err: unknown) {
|
|
65
72
|
const msg = err instanceof Error ? err.message : "Failed to generate binding proof";
|
|
@@ -148,8 +155,13 @@ settings.post("/register-agent", async (c) => {
|
|
|
148
155
|
return c.json({ error: "Transaction succeeded but Registered event not found" }, 500);
|
|
149
156
|
}
|
|
150
157
|
|
|
151
|
-
// Cache
|
|
152
|
-
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
|
+
});
|
|
153
165
|
|
|
154
166
|
return c.json({
|
|
155
167
|
agentId,
|
|
@@ -18,7 +18,7 @@ export function Settings({ token, onLogout }: { token: string; onLogout: () => v
|
|
|
18
18
|
|
|
19
19
|
// Link to PlotLink (binding proof for DB link)
|
|
20
20
|
const [humanWallet, setHumanWallet] = useState("");
|
|
21
|
-
const [bindingResult, setBindingResult] = useState<{ message: string; signature: string; owsWallet: string } | null>(null);
|
|
21
|
+
const [bindingResult, setBindingResult] = useState<{ message: string; signature: string; owsWallet: string; agentId?: number } | null>(null);
|
|
22
22
|
const [generating, setGenerating] = useState(false);
|
|
23
23
|
const [bindingError, setBindingError] = useState<string | null>(null);
|
|
24
24
|
const [copied, setCopied] = useState<"signature" | "wallet" | null>(null);
|
|
@@ -268,8 +268,24 @@ export function Settings({ token, onLogout }: { token: string; onLogout: () => v
|
|
|
268
268
|
</button>
|
|
269
269
|
</div>
|
|
270
270
|
</div>
|
|
271
|
+
{bindingResult.agentId && (
|
|
272
|
+
<div>
|
|
273
|
+
<label className="text-muted text-xs block mb-1">Agent ID</label>
|
|
274
|
+
<div className="relative">
|
|
275
|
+
<div className="bg-surface border-border rounded border p-2 text-xs font-mono text-foreground pr-16">
|
|
276
|
+
{bindingResult.agentId}
|
|
277
|
+
</div>
|
|
278
|
+
<button
|
|
279
|
+
onClick={() => copyToClipboard(String(bindingResult.agentId), "agentId")}
|
|
280
|
+
className="absolute top-1 right-1 text-xs px-2 py-1 rounded border border-border text-muted hover:text-accent hover:border-accent transition-colors"
|
|
281
|
+
>
|
|
282
|
+
{copied === "agentId" ? "Copied!" : "Copy"}
|
|
283
|
+
</button>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
)}
|
|
271
287
|
<p className="text-xs text-accent">
|
|
272
|
-
Now go to plotlink.xyz/agents and paste
|
|
288
|
+
Now go to plotlink.xyz/agents and paste the values in the "Link AI Writer" section.
|
|
273
289
|
</p>
|
|
274
290
|
</div>
|
|
275
291
|
)}
|