UNPKG

wowok_agent

Version:

Making It Easy for AI Agents to Communicate, Collaborate, Trade, and Trust.

38 lines (37 loc) 3.52 kB
import { z } from "zod"; import { WithPermissionObjectSchema, CallEnvSchema, SubmissionCallSchema } from "./base.js"; import { NameOrAddressSchema, ReceivedObjectsOrRecentlySchema, DescriptionSchema, LongNameSchema, NameSchema } from "../common/index.js"; export const ImEntrySchema = z.object({ at: NameOrAddressSchema.describe("Contact's account address or name for instant messaging"), description: LongNameSchema.optional().describe("Optional description or note about this contact"), }).strict().describe("An instant messaging contact entry with address and optional description"); export const ImsOperationSchema = z.discriminatedUnion("op", [ z.object({ op: z.literal("add").describe("Add new IM contacts to the list"), im: z.array(ImEntrySchema).describe("List of IM contacts to add"), }).strict().describe("Add operation: Append new contacts to the existing IM list"), z.object({ op: z.literal("set").describe("Set/replace all IM contacts"), im: z.array(ImEntrySchema).describe("Complete list of IM contacts to set"), }).strict().describe("Set operation: Replace entire IM list with new contacts"), z.object({ op: z.literal("remove").describe("Remove specific IM contacts"), im: z.array(NameOrAddressSchema).describe("List of contact addresses or names to remove"), }).strict().describe("Remove operation: Delete specified contacts from the IM list"), z.object({ op: z.literal("clear").describe("Clear all IM contacts"), }).strict().describe("Clear operation: Remove all contacts from the IM list"), ]).describe("IM list operation: add, set, remove, or clear contacts"); export const CallContact_DataSchema = z.object({ object: WithPermissionObjectSchema, my_status: NameSchema.optional().describe("Set your status message in this contact list. Only valid if your account is already in the IM list"), description: DescriptionSchema.optional().describe("Contact object description or public information"), location: LongNameSchema.optional().describe("Physical or virtual location information for this contact"), ims: ImsOperationSchema.optional().describe("IM contact list operation: add, set, remove, or clear instant messaging contacts"), owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Receive objects sent to this contact object and unwrap them to the permission owner"), }).strict().describe("On-chain Contact operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, permission, ...} to create a Contact. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation."); export const CallContact_InputSchema = z.object({ data: CallContact_DataSchema.describe("Contact operation data containing object reference and operations to perform"), env: CallEnvSchema.optional().describe("Call environment parameters including account, network, and cache settings"), submission: SubmissionCallSchema.optional().describe("Guard submission data for permission verification"), }).strict().describe("Contact object operation data. Manage on-chain contact information and instant messaging addresses for real-time encrypted communication");