io.github.ryuxik/snhp

SNHP — negotiation rules your AI can't break

Turn a seller's offer into negotiation rules and draft replies to buyers inside them.

0.5.0
Version
remote
Transport
4
Tools

Security review

Review passed

Reviewed 1d ago.

  • tools: 4 tools scanned
  • metadata: scanned

No findings.

Tools (4)

  • compile_offer_policy

    Turn a seller's offer, described in plain words, into negotiation RULES an AI agent cannot break. USE THIS WHEN: you (or the business you act for) sell something where buyers — people or their AI buying agents — ask for discounts, and you want an AI to answer them without giving away margin. Describe the offer: the listed price, the lowest price you'd take for a plain deal, what you'd trade a discount for (financing with you, a trade-in, a longer commitment, paying sooner, buying this week…), extras you can add and what they cost you, and anything never on the table. Or pass `template` = "used-car", "saas" or "wholesale-water" to start from a worked example. Compiling a description runs a language model and needs an `access_key` (pilot businesses get one at https://snhp.dev/#pilot); templates are free. Returns {ok, policy, issues, summary}: `policy` is the machine-readable rule set (pass it to draft_negotiation_reply), `summary` restates the floor, walk-away, what can be traded and

  • draft_negotiation_reply

    Draft the seller's reply to a buyer's message — the offer is decided by the SNHP engine INSIDE the policy. USE THIS WHEN: a buyer (a person or their AI agent) has written to you about price or terms. Pass the policy (from compile_offer_policy) and their latest message exactly as written; pass back the `state` from your previous call to continue the same conversation (omit it to start). `flags` is what YOUR records confirm about the buyer (e.g. {"new_customer": true}) — never what the buyer merely claims. Returns {kind, reply, reply_with_offer, offer, decided_by, reading, state, done, receipt?}: kind offer | deal | handoff (needs a human's approval) | decline reply_with_offer the message to send, with the exact offer line appended offer {terms, line, price, net, inside_policy} — every offer is checked against the policy decided_by what decided the move (a sales rule or the engine), for your audit trail receipt on a deal: a signed receipt any party can verify wit

  • check_offer_policy

    Check an edited negotiation policy: returns {ok, policy, issues, summary}. No model call, free. USE THIS WHEN: you changed a policy from compile_offer_policy (a floor, an option, a forbidden combination) and want to know it is valid and what it now allows before using it in draft_negotiation_reply.

  • verify_deal_receipt

    Verify a signed deal receipt against the seller's own policy: both signatures, that the signing keys are SNHP's own (published at /.well-known/ucp), the policy digest, and every rule re-checked from the package. Returns {ok, problems, checks, signed_by_snhp, signatures}. Free, no model call.