@oneie/sdk 0.16.6 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/receivers.js CHANGED
@@ -1089,6 +1089,220 @@ export const RECEIVERS = {
1089
1089
  auth: "manage_integrations", roleAction: "manage_integrations",
1090
1090
  examples: [{ endpoint: "thumbs", input: { title: "How we shipped in a week", style: "bold" } }],
1091
1091
  }),
1092
+ // ── agentverse: — a ONE actor as a uAgent on Fetch.ai's Agentverse ─────────
1093
+ // Handlers: one.ie/web/src/lib/resolvers/agentverse.ts. The address is a
1094
+ // SIGNING identity derived from the worker secret UAGENT_MASTER_SECRET (HKDF,
1095
+ // lib/uagents/identity.ts) — never a wallet, never stored. Messages arrive at
1096
+ // POST /api/uagents and are answered by agent:run's own handler, so the
1097
+ // workspace pays for each turn exactly as it does in chat.
1098
+ "agentverse:enroll": receiver({
1099
+ receiver: "agentverse:enroll",
1100
+ summary: "Make one of the workspace's agents reachable on Agentverse / ASI:One: derive its uAgents address, enable it at https://one.ie/api/uagents, and register it in the Agentverse almanac with the chat protocol. Idempotent — re-enrolling converges on the same address and refreshes the registration.",
1101
+ request: () => z.object({
1102
+ workspace: z.string().optional().describe("Group slug. Omit for your own. A scope REQUEST — refused when the authority walk says no, never swapped for your own."),
1103
+ actor: z.string().describe("The actor id of the agent to publish (the persona channels resolves for agent:run), e.g. `ceo`."),
1104
+ }),
1105
+ response: () => z.object({
1106
+ ok: z.boolean(),
1107
+ workspace: z.string().optional(),
1108
+ actor: z.string().optional(),
1109
+ address: z.string().optional().describe("The agent's uAgents address (bech32 `agent1…`). Message it from ASI:One or any uAgent."),
1110
+ endpoint: z.string().optional(),
1111
+ registered: z.boolean().optional().describe("true once the almanac accepted the attestation and the status update. false with `error` means the row is enabled but the almanac refused — the daily re-registration retries it."),
1112
+ registeredUntil: z.number().optional().describe("Almanac record expiry, ms since epoch. Re-registered daily before it."),
1113
+ protocols: z.array(z.string()).optional().describe("The protocol digests the almanac record advertises: the chat protocol, plus the payment seller role when the agent is actually charging (agentverse:price)."),
1114
+ manifests: z.record(z.string(), z.string()).optional().describe("Per advertised digest, `ok` or the named reason the almanac refused its manifest (almanac_manifest_<status> · almanac_unreachable). A refused manifest is retried by the daily tick; it does not undo the registration."),
1115
+ error: z.string().optional().describe("Named: unauthorized · forbidden · bad_request · uagent_secret_unset · not_configured · almanac_<status> · almanac_status_<status> · almanac_unreachable."),
1116
+ }),
1117
+ effect: "ask", cost: "free", reversible: true, idempotent: true,
1118
+ auth: "manage_integrations", roleAction: "manage_integrations",
1119
+ examples: [{ workspace: "one", actor: "ceo" }],
1120
+ }),
1121
+ "agentverse:unenroll": receiver({
1122
+ receiver: "agentverse:unenroll",
1123
+ summary: "Unpublish one of the workspace's agents from Agentverse / ASI:One: disable its row so https://one.ie/api/uagents stops routing to it at once, and the daily re-registration stops refreshing it. The almanac record is not deleted (the almanac has no delete) — it lapses on its own within about 7 days (`lapsesAt`). agentverse:enroll re-publishes the same address.",
1124
+ request: () => z.object({
1125
+ workspace: z.string().optional().describe("Group slug. Omit for your own. Refused when the authority walk says no."),
1126
+ actor: z.string().describe("The enrolled actor id, e.g. `ceo`."),
1127
+ }),
1128
+ response: () => z.object({
1129
+ ok: z.boolean(),
1130
+ workspace: z.string().optional(),
1131
+ actor: z.string().optional(),
1132
+ address: z.string().optional(),
1133
+ enabled: z.literal(false).optional(),
1134
+ lapsesAt: z.number().nullable().optional().describe("When the almanac record expires by itself, ms since epoch. null = it was never confirmed or has already lapsed."),
1135
+ error: z.string().optional().describe("Named: unauthorized · forbidden · bad_request · not_enrolled · not_configured."),
1136
+ }),
1137
+ effect: "ask", cost: "free", reversible: true, idempotent: true,
1138
+ auth: "manage_integrations", roleAction: "manage_integrations",
1139
+ examples: [{ workspace: "one", actor: "ceo" }],
1140
+ }),
1141
+ "agentverse:status": receiver({
1142
+ receiver: "agentverse:status",
1143
+ summary: "Read which of the workspace's agents are enrolled on Agentverse, their uAgents addresses and when each almanac registration expires. Read-only.",
1144
+ request: () => z.object({
1145
+ workspace: z.string().optional().describe("Group slug. Omit for your own. Refused when the authority walk says no."),
1146
+ actor: z.string().optional().describe("Only this actor's row."),
1147
+ }),
1148
+ response: () => z.object({
1149
+ ok: z.boolean(),
1150
+ workspace: z.string().optional(),
1151
+ endpoint: z.string().optional(),
1152
+ agents: z.array(z.object({
1153
+ actor: z.string(),
1154
+ address: z.string(),
1155
+ enabled: z.boolean(),
1156
+ registeredUntil: z.number().nullable(),
1157
+ registered: z.boolean().describe("registeredUntil is in the future."),
1158
+ })).optional(),
1159
+ error: z.string().optional(),
1160
+ }),
1161
+ effect: "ask", cost: "free", idempotent: true,
1162
+ auth: "manage_integrations", roleAction: "manage_integrations",
1163
+ examples: [{ workspace: "one" }],
1164
+ }),
1165
+ // ── agentverse: OUTBOUND — a ONE agent messaging an Agentverse agent ───────
1166
+ // Handlers: one.ie/web/src/lib/resolvers/agentverse-outbound.ts; the wire is
1167
+ // lib/uagents/outbound.ts. No `roleAction` on send/reply on purpose: a workflow
1168
+ // `tool` step (`config.receiver: "agentverse:send"`) must not be ceiling-denied
1169
+ // below the integrations rung — the resolver's workspace-control check is the gate.
1170
+ // `surfaces.chat` makes all three chat tools for ONE's own agents (channels
1171
+ // from-registry.ts), dispatched through the ask door with the attested workspace.
1172
+ "agentverse:search": receiver({
1173
+ receiver: "agentverse:search",
1174
+ summary: "Search the Fetch.ai Agentverse index for agents to talk to. Returns each agent's address (what agentverse:send takes), name, description, protocols, whether it speaks the chat protocol, and status. Read-only, cached for a minute; `short` says when the index holds more matches than this answer.",
1175
+ request: () => z.object({
1176
+ query: z.string().describe("What to search for, in words — e.g. `weather`, `flight booking`."),
1177
+ protocol: z.string().optional().describe("`chat` (default — only agents agentverse:send can talk to), `any`, or a protocol digest (`proto:<64 hex>`)."),
1178
+ limit: z.number().optional().describe("How many to return. Default 10; capped at 30 and the answer says `capped: true` when you asked for more."),
1179
+ }),
1180
+ response: () => z.object({
1181
+ ok: z.boolean(),
1182
+ query: z.string().optional(),
1183
+ protocol: z.string().nullable().optional(),
1184
+ agents: z.array(z.object({
1185
+ address: z.string(),
1186
+ name: z.string(),
1187
+ description: z.string().describe("Cut at 300 characters."),
1188
+ protocols: z.array(z.object({ digest: z.string(), name: z.string().nullable(), version: z.string().nullable() })),
1189
+ chat: z.boolean().describe("Speaks the uAgents chat protocol."),
1190
+ status: z.string().describe("active · inactive · unresponsive (the index's own flag)."),
1191
+ type: z.string().nullable(),
1192
+ rating: z.number().nullable(),
1193
+ interactions: z.number().nullable(),
1194
+ })).optional(),
1195
+ returned: z.number().optional(),
1196
+ total: z.number().nullable().optional().describe("The index's own count of matches."),
1197
+ short: z.boolean().optional().describe("true when total > returned — this answer is a page, not every match."),
1198
+ capped: z.boolean().optional(),
1199
+ limit: z.number().optional(),
1200
+ cached: z.boolean().optional(),
1201
+ error: z.string().optional().describe("Named: bad_request · agentverse_rate_limited · agentverse_<status> · agentverse_unreachable · agentverse_too_large · agentverse_bad_response."),
1202
+ }),
1203
+ effect: "ask", cost: "free", idempotent: true,
1204
+ auth: "read",
1205
+ surfaces: { chat: true },
1206
+ examples: [{ query: "weather", limit: 5 }],
1207
+ }),
1208
+ "agentverse:send": receiver({
1209
+ receiver: "agentverse:send",
1210
+ summary: "Message one Agentverse agent by address, as one of your workspace's enrolled agents (agentverse:enroll), and wait up to timeout_s for its reply. Signs a uAgents ChatMessage, delivers it only to an endpoint that passes the SSRF guard, and answers `replied` with the text, `pending` with a session to poll through agentverse:reply, or `payment_requested` with the target's terms. Costs no FET and NEVER pays — a payment request is surfaced, not settled.",
1211
+ request: () => z.object({
1212
+ workspace: z.string().optional().describe("Group slug. Omit for your own. A scope REQUEST — refused when the authority walk says no."),
1213
+ from_actor: z.string().describe("The actor id of YOUR enrolled agent to speak as, e.g. `ceo`. Must be enrolled and registered (agentverse:status)."),
1214
+ to_address: z.string().describe("The target's Agentverse address, `agent1…` — from agentverse:search."),
1215
+ text: z.string().describe("What to say. Cut at 4000 characters, and the answer says `text_truncated: true`."),
1216
+ timeout_s: z.number().optional().describe("Seconds to wait for the reply inside this call. Default 20; capped at 40 (`timeout_capped: true`). 0 sends and returns `pending` at once."),
1217
+ }),
1218
+ response: () => z.object({
1219
+ ok: z.boolean(),
1220
+ workspace: z.string().optional(),
1221
+ from: z.string().optional().describe("Our agent's address the message was signed by."),
1222
+ to: z.string().optional(),
1223
+ session: z.string().optional().describe("The conversation id — pass it to agentverse:reply."),
1224
+ status: z.enum(["replied", "pending", "payment_requested", "failed", "expired"]).optional(),
1225
+ reply: z.string().optional().describe("Every text the target sent on this conversation, joined; cut at 8000 characters (`truncated: true`)."),
1226
+ replies: z.number().optional(),
1227
+ truncated: z.boolean().optional(),
1228
+ payment: z.object({
1229
+ accepted_funds: z.array(z.object({ amount: z.string(), currency: z.string(), payment_method: z.string() })),
1230
+ recipient: z.string(),
1231
+ deadline_seconds: z.number().nullable(),
1232
+ reference: z.string().nullable(),
1233
+ description: z.string().nullable(),
1234
+ }).optional().describe("Present when status is payment_requested. NOT paid."),
1235
+ poll: z.object({ receiver: z.literal("agentverse:reply"), data: z.object({ session: z.string() }) }).optional(),
1236
+ timeout_s: z.number().optional(),
1237
+ timeout_capped: z.boolean().optional(),
1238
+ text_truncated: z.boolean().optional(),
1239
+ detail: z.string().optional(),
1240
+ retryAfterS: z.number().optional(),
1241
+ error: z.string().optional().describe("Named: unauthorized · forbidden · bad_request · not_configured · not_enrolled · not_registered · own_agent · rate_limited · uagent_secret_unset · identity_mismatch · endpoint_blocked:<reasons> · unreachable:<almanac error> · delivery_failed_<status> · delivery_redirect_refused_<status>."),
1242
+ }),
1243
+ effect: "ask", cost: "free", reversible: false, idempotent: false,
1244
+ auth: "manage_integrations",
1245
+ surfaces: { chat: true },
1246
+ examples: [{ from_actor: "ceo", to_address: "agent1qfvydlgcxrvga2kqjxhj3hpngegtysm2c7uk48ywdue0kgvtc2f5cwhyffv", text: "What is the weather in Dublin?", timeout_s: 30 }],
1247
+ }),
1248
+ "agentverse:reply": receiver({
1249
+ receiver: "agentverse:reply",
1250
+ summary: "Read a conversation agentverse:send started: `replied` with the text, `pending` while the target has not answered, `payment_requested` with its terms (never paid), `failed`, or `expired` after an hour with no reply. Read-only.",
1251
+ request: () => z.object({
1252
+ session: z.string().describe("The `session` agentverse:send returned."),
1253
+ }),
1254
+ response: () => z.object({
1255
+ ok: z.boolean(),
1256
+ workspace: z.string().optional(),
1257
+ from: z.string().optional(),
1258
+ to: z.string().optional(),
1259
+ session: z.string().optional(),
1260
+ status: z.enum(["replied", "pending", "payment_requested", "failed", "expired"]).optional(),
1261
+ reply: z.string().optional(),
1262
+ replies: z.number().optional(),
1263
+ truncated: z.boolean().optional(),
1264
+ payment: z.unknown().optional(),
1265
+ poll: z.unknown().optional(),
1266
+ detail: z.string().optional(),
1267
+ error: z.string().optional().describe("Named: bad_request · not_configured · not_found (also what a session you cannot see answers)."),
1268
+ }),
1269
+ effect: "ask", cost: "free", idempotent: true,
1270
+ auth: "manage_integrations",
1271
+ surfaces: { chat: true },
1272
+ examples: [{ session: "6f1c2a0e-1b7d-4c55-9a43-2f0d8f1e9b21" }],
1273
+ }),
1274
+ // Handler: one.ie/web/src/lib/resolvers/agentverse-price.ts. A priced agent
1275
+ // answers ASI:One only after a verified FET payment (uAgents payment protocol,
1276
+ // seller role — lib/uagents/payment.ts). Money only comes IN.
1277
+ "agentverse:price": receiver({
1278
+ receiver: "agentverse:price",
1279
+ summary: "Set (or, without `priceFet`, read) what one answer from an enrolled Agentverse agent costs in native FET. A priced agent sends a RequestPayment instead of answering, verifies the buyer's FET transfer on the ASI chain (fetchhub-4), then answers. It is only CHARGED when the agent or its workspace treasury has a registered asi address on a mainnet deploy — otherwise it stays free and `reason` says why.",
1280
+ request: () => z.object({
1281
+ workspace: z.string().optional().describe("Group slug. Omit for your own. Refused when the authority walk says no."),
1282
+ actor: z.string().describe("The enrolled actor id (agentverse:enroll first), e.g. `ceo`."),
1283
+ priceFet: z.union([z.string(), z.number(), z.null()]).optional().describe("Whole FET per answer as a decimal, e.g. \"0.5\" (at most 18 decimals). null, \"\" or 0 = free. Omit to read the current price without changing it."),
1284
+ }),
1285
+ response: () => z.object({
1286
+ ok: z.boolean(),
1287
+ workspace: z.string().optional(),
1288
+ actor: z.string().optional(),
1289
+ address: z.string().optional(),
1290
+ priceFet: z.string().nullable().optional().describe("The stored price, canonical decimal FET. null = free."),
1291
+ currency: z.literal("FET").optional(),
1292
+ charging: z.boolean().optional().describe("true only when the price is set AND there is a real asi address to be paid at AND the deploy is on mainnet."),
1293
+ recipient: z.string().optional().describe("The `fetch1…` address buyers pay — the agent's own asi address, else the workspace treasury's."),
1294
+ custody: z.enum(["self", "via-treasury"]).optional(),
1295
+ reason: z.string().optional().describe("Why it is free: free · no_asi_address · no_fetch_network."),
1296
+ protocols: z.array(z.string()).optional().describe("Set on a price change to an enabled agent: the digests now advertised — the payment seller role is added when charging, dropped when not."),
1297
+ reregistered: z.boolean().optional().describe("Set on a price change: whether the almanac took the new protocol list now. false keeps the price; `reregisterError` says why, and the daily tick retries."),
1298
+ reregisterError: z.string().optional(),
1299
+ manifests: z.record(z.string(), z.string()).optional().describe("Per advertised digest, `ok` or the named reason the almanac refused its manifest."),
1300
+ error: z.string().optional().describe("Named: unauthorized · forbidden · bad_request · not_enrolled · not_configured."),
1301
+ }),
1302
+ effect: "ask", cost: "free", reversible: true, idempotent: true,
1303
+ auth: "manage_integrations", roleAction: "manage_integrations",
1304
+ examples: [{ workspace: "one", actor: "ceo", priceFet: "0.5" }],
1305
+ }),
1092
1306
  "brand:set": receiver({
1093
1307
  receiver: "brand:set",
1094
1308
  summary: "Write up to 6 brand color tokens (primary/secondary/accent/bg/text/border) to a workspace theme",
@@ -4805,6 +5019,9 @@ export const RECEIVERS = {
4805
5019
  evm: z.string().nullable().optional(),
4806
5020
  solana: z.string().nullable().optional(),
4807
5021
  btc: z.string().nullable().optional(),
5022
+ // ASI (Fetch.ai) — bech32 `fetch1…` today; stored as sent, shown as `asi1…`
5023
+ // after the rename via reencodeAsiAddress (@oneie/sdk/address-proof).
5024
+ asi: z.string().nullable().optional(),
4808
5025
  }).optional(),
4809
5026
  // An AGENT's addresses are written only with proof of control: the token
4810
5027
  // wallet:challenge issued, and one signature per address over
@@ -4815,6 +5032,7 @@ export const RECEIVERS = {
4815
5032
  evm: z.object({ publicKey: z.string().optional(), signature: z.string() }).optional(),
4816
5033
  solana: z.object({ publicKey: z.string().optional(), signature: z.string() }).optional(),
4817
5034
  btc: z.object({ publicKey: z.string().optional(), signature: z.string() }).optional(),
5035
+ asi: z.object({ publicKey: z.string().optional(), signature: z.string() }).optional(),
4818
5036
  }).optional(),
4819
5037
  }),
4820
5038
  response: () => z.object({
@@ -4827,6 +5045,7 @@ export const RECEIVERS = {
4827
5045
  evm: z.string().nullable().optional(),
4828
5046
  solana: z.string().nullable().optional(),
4829
5047
  btc: z.string().nullable().optional(),
5048
+ asi: z.string().nullable().optional(),
4830
5049
  }).optional(),
4831
5050
  error: z.string().optional(),
4832
5051
  field: z.string().optional(),