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 @@ -67,6 +67,9 @@
agentName: (config.agentName as string) || undefined,
agentDescription: (config.agentDescription as string) || undefined,
agentGenre: (config.agentGenre as string) || undefined,
agentLlmModel: (config.agentLlmModel as string) || undefined,
agentRegisteredBy: (config.agentRegisteredBy as string) || undefined,
agentRegisteredAt: (config.agentRegisteredAt as string) || undefined,
});
} catch (err: unknown) {
const msg = err instanceof Error ? err.message : "Failed to generate binding proof";
Expand Down Expand Up @@ -107,13 +110,14 @@
} catch { /* not registered — continue */ }

// Build agentURI as inline JSON
const registeredAt = new Date().toISOString();
const agentURI = JSON.stringify({
name: body.name.trim(),
description: body.description.trim(),
...(body.genre?.trim() && { genre: body.genre.trim() }),
llmModel: "Claude",
registeredBy: "plotlink-ows",
registeredAt: new Date().toISOString(),
registeredAt,
});

// Create OWS-backed wallet client and call register()
Expand Down Expand Up @@ -155,12 +159,15 @@
return c.json({ error: "Transaction succeeded but Registered event not found" }, 500);
}

// Cache agent data in config.json (survives npx reinstalls, no Prisma dependency)
// Cache full tokenURI data in config.json (survives npx reinstalls, no Prisma dependency)
writeConfig({
agentId,
agentName: body.name,
agentDescription: body.description,
...(body.genre && { agentGenre: body.genre }),
agentName: body.name.trim(),
agentDescription: body.description.trim(),
...(body.genre?.trim() && { agentGenre: body.genre.trim() }),
agentLlmModel: "Claude",
agentRegisteredBy: "plotlink-ows",
agentRegisteredAt: registeredAt,
});

return c.json({
Expand Down
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.21",
"version": "1.0.22",
"bin": {
"plotlink-ows": "./bin/plotlink-ows.js"
},
Expand Down
Loading