Agent SDK reference
Core clients, transaction builders, signers, policy and confirmation primitives.
The public package is @perkos/agent-sdk; the current release is 0.10.0. The complete source and
release history live in
PerkOS-Nayori-Agent-SDK.
Core modules
| Module | Responsibility |
|---|---|
NayoriNextClient | Reads, high-level actions and confirmations on the live Nayori contracts |
NayoriNextTransactionBuilder | Inert call plans for the live contracts, with exact deny-mode post-conditions |
NAYORI_NEXT_* constants | Live deployers, limits, statuses and error descriptions (describeNayoriNextError) |
PerkOSClient | Reads and actions for jobs on the earlier contracts, plus x402 and MPP helpers |
| Transaction builders | Inert Clarity call plans with exact post-conditions |
StacksConnectSigner | Browser request adapter for Leather and compatible wallets |
HeadlessSigner | Controlled key-provider integration for server-side automation |
SpendingPolicy | Asset, per-transaction and per-session limits |
TransactionTracker | Pending/success/abort/drop/timeout normalization |
| x402 adapters | Challenge codecs, intent binding, Stacks payment construction and verification |
| MPP adapters | PaymentAuth challenge, credential and USDCx receipt handling |
NayoriPartnerClient | Wallet-linked partner OAuth and MCP access |
Signing boundaries
The SDK never selects a browser wallet account by itself. The host application supplies the connected address and request function. For headless signing, the application supplies a secret manager or isolated signer callback; the SDK is not a key store.
Confirmation
const receipt = await nayori.executeAndConfirm(plan, {
timeoutMs: 10 * 60_000,
pollIntervalMs: 5_000,
});
if (receipt.confirmation.status !== "success") {
throw new Error(`Transaction ended with ${receipt.confirmation.status}`);
}See the package README for the full exported API and exact release-specific signatures.
Live contract methods
NayoriNextClient defaults to the live deployments (NAYORI_NEXT_DEPLOYERS): pass only
network. Pass deployer to target another deployment, such as a local devnet.
| Area | Methods |
|---|---|
| Escrow writes | createJob, fundJob, nameProvider, acceptJob, submitWork, recordDecision, recordDefaultApproval, appeal, resolveAppeal, settleJob, refundNoDelivery, closeUnfunded, rateProvider, retryReputation |
| Escrow reads | getJob, getSubmission, getDecision, getEscrowBalance, getJobCount, getReputationPending |
| Agents | registerAgent, updateAgent, getAgent, isRegisteredAgent, getAgentCount |
| Applications (sBTC) | applyToJob, withdrawApplication, declineApplication, releaseApplication, getApplications, getApplication |
| Reputation | getProviderStats, getOutcome |
| Roles | getTreasury, getAppealAuthority, getHandover, proposeHandover, cancelHandover, acceptHandover |
| Permissions | allowContractCaller, disallowContractCaller, getAllowance |
Escrow methods take the asset ("sbtc" or "stx") and the job id. fundJob, settleJob,
resolveAppeal, refundNoDelivery and the application refunds read the live job or application
first, so each post-condition carries the exact amount the contract will move. Builders reject
out-of-range input locally with details.clarityCode set to the matching contract error. See the
lifecycle guide and the contract reference.
Earlier contracts
PerkOSClient keeps its methods and defaults for jobs on the earlier contracts
(agentic-commerce-v6, sbtc-commerce-v5), including getDecision, finalizeDecision,
settleAppealTimeout and the service-fee ledger reads. Use it to read or close out those jobs;
new jobs go through NayoriNextClient.

PerkOS