plotlink-ows 1.0.18 → 1.0.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.
@@ -56,10 +56,15 @@ 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 agentId from config.json if available
60
+ const config = readConfig();
61
+ const agentId = config.agentId ? Number(config.agentId) : undefined;
62
+
59
63
  return c.json({
60
64
  message,
61
65
  signature,
62
66
  owsWallet,
67
+ agentId,
63
68
  });
64
69
  } catch (err: unknown) {
65
70
  const msg = err instanceof Error ? err.message : "Failed to generate binding proof";
@@ -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 both values in the &quot;Link AI Writer&quot; section.
288
+ Now go to plotlink.xyz/agents and paste the values in the &quot;Link AI Writer&quot; section.
273
289
  </p>
274
290
  </div>
275
291
  )}