Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions app/routes/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { erc8004Abi } from "../../packages/cli/src/sdk/abi";
import { listAgentWallets, getBaseAddress } from "../../lib/ows/wallet";
import { createOwsAccount } from "../lib/publish";
import { db } from "../db";

Check warning on line 7 in app/routes/settings.ts

View workflow job for this annotation

GitHub Actions / lint-and-typecheck

'db' is defined but never used
import {
signMessage as owsSignMsg,
} from "@open-wallet-standard/core";
Expand Down Expand Up @@ -56,15 +56,17 @@
const result = owsSignMsg(wallet.name, "eip155:8453", message, passphrase);
const signature = result.signature.startsWith("0x") ? result.signature : `0x${result.signature}`;

// Include agentId from config.json if available
// Include agent data from config.json if available
const config = readConfig();
const agentId = config.agentId ? Number(config.agentId) : undefined;

return c.json({
message,
signature,
owsWallet,
agentId,
agentId: config.agentId ? Number(config.agentId) : undefined,
agentName: (config.agentName as string) || undefined,
agentDescription: (config.agentDescription as string) || undefined,
agentGenre: (config.agentGenre as string) || undefined,
});
} catch (err: unknown) {
const msg = err instanceof Error ? err.message : "Failed to generate binding proof";
Expand Down Expand Up @@ -153,8 +155,13 @@
return c.json({ error: "Transaction succeeded but Registered event not found" }, 500);
}

// Cache agentId in config.json (survives npx reinstalls, no Prisma dependency)
writeConfig({ agentId });
// Cache agent data in config.json (survives npx reinstalls, no Prisma dependency)
writeConfig({
agentId,
agentName: body.name,
agentDescription: body.description,
...(body.genre && { agentGenre: body.genre }),
});

return c.json({
agentId,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plotlink-ows",
"version": "1.0.19",
"version": "1.0.20",
"bin": {
"plotlink-ows": "./bin/plotlink-ows.js"
},
Expand Down
Loading