MaxAgents
untyped bigintValue
(100 <untyped> bigint)
MaxNameLen
untyped bigintValue
(100 <untyped> bigint)
MaxDescLen
untyped bigintValue
(1000 <untyped> bigint)
MaxCapsLen
untyped bigintValue
(2000 <untyped> bigint)
MaxReviewLen
untyped bigintValue
(500 <untyped> bigint)
ReviewRenderMax
untyped bigintValue
(20 <untyped> bigint)
AdminAddress
untyped string// samcrew-core-test1 multisig
Value
"g1x7k4628w93a7wzdhqc06atzx0v50rnshweuxu0"
MaxAgentsPerCreator
untyped bigintValue
(10 <untyped> bigint)
MaxDepositorsPerAgent
untyped bigintValue
(50 <untyped> bigint)
Agent
typeValue
agent_registry_v2.Agent
Review
typeValue
agent_registry_v2.Review
agents
*avl.Tree// id -> \*Agent
- OID
- 0a156c…d400:40
agents details
reviews
*avl.Tree// agentId -> \[]\*Review
- OID
- 0a156c…d400:42
reviews details
reviewers
*avl.Tree// "agentId/addr" -> true (dedup: one review per agent per address)
- OID
- 0a156c…d400:44
reviewers details
credits
*avl.Tree// "agentId/userAddr" -> int64 (prepaid credits in ugnot)
- OID
- 0a156c…d400:46
credits details
usage
*avl.Tree// "agentId/userAddr" -> int64 (total calls)
- OID
- 0a156c…d400:48
usage details
earnings
*avl.Tree// agentId -> int64 (accumulated creator earnings in ugnot)
- OID
- 0a156c…d400:50
earnings details
paused
boolValue
false
init.18
func()- OID
- 0a156c…d400:10
init.18 details
assertNotPaused
func()- OID
- 0a156c…d400:12
assertNotPaused details
Pause
func()Pause blocks all state-mutating operations EXCEPT RefundCredits (users keep the right to reclaim their own deposits). Admin only. See the pause policy above.
- OID
- 0a156c…d400:13
Pause details
Unpause
func()Unpause resumes normal operations. Admin only.
- OID
- 0a156c…d400:14
Unpause details
IsPaused
func() boolIsPaused returns the current pause state.
- OID
- 0a156c…d400:15
IsPaused details
RegisterAgent
func(id string, name string, description string, category string, capabilities string, endpoint string, transport string, pricing string, version string, pricePerCall int64)RegisterAgent registers a new agent in the registry.
- OID
- 0a156c…d400:16
RegisterAgent details
UpdateAgent
func(id string, description string, capabilities string, endpoint string, version string, pricing string, pricePerCall int64)UpdateAgent allows the creator to update their agent.
- OID
- 0a156c…d400:17
UpdateAgent details
ReviewAgent
func(agentId string, rating int, comment string)ReviewAgent adds a review for an agent. One review per address per agent.
- OID
- 0a156c…d400:18
ReviewAgent details
RemoveAgent
func(id string)RemoveAgent removes an agent (admin or creator only). All outstanding credits are refunded to their depositors before removal.
- OID
- 0a156c…d400:19
RemoveAgent details
DepositCredits
func(agentId string)DepositCredits deposits GNOT as prepaid credits for an agent. Send ugnot with the transaction to fund the credits.
- OID
- 0a156c…d400:20
DepositCredits details
UseCredit
func(agentId string, userAddr string) int64UseCredit deducts one invocation credit. Only the agent creator or admin can call. Returns the remaining credits.
- OID
- 0a156c…d400:21
UseCredit details
GetCredits
func(agentId string, userAddr string) int64GetCredits returns the credit balance for a user on an agent.
- OID
- 0a156c…d400:22
GetCredits details
GetUsage
func(agentId string, userAddr string) int64GetUsage returns the total invocation count for a user on an agent.
- OID
- 0a156c…d400:23
GetUsage details
GetEarnings
func(agentId string) int64GetEarnings returns accumulated earnings for an agent.
- OID
- 0a156c…d400:24
GetEarnings details
WithdrawEarnings
func(agentId string)WithdrawEarnings allows the agent creator to withdraw accumulated usage fees. Earnings accumulate when UseCredit deducts from user credit balances.
- OID
- 0a156c…d400:25
WithdrawEarnings details
RefundCredits
func(agentId string)RefundCredits refunds remaining credits to the caller.
- OID
- 0a156c…d400:26
RefundCredits details
Render
func(path string) string- OID
- 0a156c…d400:27
Render details
renderHome
func() string- OID
- 0a156c…d400:28
renderHome details
renderAgent
func(id string) string- OID
- 0a156c…d400:29
renderAgent details
renderStats
func() string- OID
- 0a156c…d400:30
renderStats details
formatRating
func(sum int64, count int64) stringformatRating formats a rating as "X.Y" using integer math (no float in ufmt).
- OID
- 0a156c…d400:31
formatRating details
truncAddr
func(addr .uverse.address) string- OID
- 0a156c…d400:32
truncAddr details
isValidTransport
func(t string) bool- OID
- 0a156c…d400:33
isValidTransport details
isValidPricing
func(p string) bool- OID
- 0a156c…d400:34
isValidPricing details
sanitizeForRender
func(s string) stringsanitizeForRender strips markdown-sensitive characters from user-controlled strings before rendering in gnoweb to prevent injection attacks.
- OID
- 0a156c…d400:35
sanitizeForRender details
countAgentsByCreator
func(creator .uverse.address) intcountAgentsByCreator counts how many agents \`creator\` currently owns (B4 cap). Bounded by MaxAgents (global), so O(MaxAgents) worst case.
- OID
- 0a156c…d400:36
countAgentsByCreator details
countDepositors
func(agentId string) intcountDepositors counts the distinct credit entries for an agent (B4 cap). Bounded by MaxDepositorsPerAgent in steady state (the cap enforces its own bound), so the scan stays cheap.
- OID
- 0a156c…d400:37
countDepositors details
hasAnyCreditsEntry
func(agentId string) boolhasAnyCreditsEntry returns true if ANY credit entry exists for the agent, even with zero balance. This prevents a price-lock bypass where the creator drains a user's balance to 0, then raises the price, then the user tops up. Zero-balance entries remain as markers until explicitly cleaned via RefundCredits (which removes the entry) or RemoveAgent.
- OID
- 0a156c…d400:38
hasAnyCreditsEntry details
isValidAgentID
func(id string) boolisValidAgentID ensures the ID contains only safe characters (no "/" or other delimiters that would cause key collisions in the credits/usage AVL trees).
- OID
- 0a156c…d400:39