// The tool forge_token_lease (design 47 H2 §808, the tools table): the mint lease's holder and since when, and each // account's token age, read from the vault's `changed-at`; never the token. import type { ToolDefinition } from "@novox/mesh-sdk/tools"; import { tokenLease, type MintLease, type TokenVault } from "../token.js"; export function tokenLeaseTool(vault: TokenVault, lease: MintLease, accounts: readonly string[], now: () => Date = () => new Date()): ToolDefinition { return { name: "forge_token_lease", description: "The forge token's mint lease and each account's token age (design 47 H2 §808): who holds the lease `mint` in the " + "state token-lease and since when, and for each account (" + accounts.join(", ") + ") the vault's generation of its token " + "and when it changed, never the token itself.", input: { type: "object", properties: {} }, run: async () => tokenLease(vault, lease, accounts, now()), }; }