wowok_agent
Version:
Making It Easy for AI Agents to Communicate, Collaborate, Trade, and Trust.
69 lines (68 loc) • 3.39 kB
JavaScript
import { z } from "zod";
import { AccountOrMark_AddressAISchema, AccountOrMark_AddressSchema, DescriptionSchema, ManyAccountOrMark_AddressAISchema, NameSchema } from "../common/index.js";
import { RecordsInEntitySchema } from "../query/index.js";
import { CallEnvSchema } from "./base.js";
export const InformationAddSchema = z.object({
op: z.literal("add"),
data: z.array(RecordsInEntitySchema)
}).strict().describe("PUBLIC: Add personal info on-chain. Safe: social handles, URLs, public email. NEVER: phone, address, private keys.");
export const InformationRemoveSchema = z.object({
op: z.literal("remove"),
name: z.array(NameSchema)
}).strict().describe("PUBLIC: Remove specified personal info records from your public profile.");
export const InformationClearSchema = z.object({
op: z.literal("clear")
}).strict().describe("PUBLIC: Clear ALL personal info from your public profile.");
export const InformationSchema = z.discriminatedUnion("op", [
InformationAddSchema,
InformationRemoveSchema,
InformationClearSchema
]);
export const MarkAddSchema = z.object({
op: z.literal("add"),
data: z.array(z.object({
address: AccountOrMark_AddressAISchema,
name: NameSchema.optional(),
tags: z.array(NameSchema).optional()
}).strict()),
}).strict().describe("PUBLIC: Add ID name and tags on-chain for public identity. For private marks, use 'local' tool.");
export const MarkRemoveSchema = z.object({
op: z.literal("remove"),
data: z.array(z.object({
address: AccountOrMark_AddressAISchema,
tags: z.array(NameSchema).optional()
}).strict())
}).strict().describe("PUBLIC: Remove specified tags from your on-chain identity mark.");
export const MarkClearSchema = z.object({
op: z.literal("clear"),
address: ManyAccountOrMark_AddressAISchema
}).strict().describe("PUBLIC: Clear ALL tags from specified on-chain identity marks.");
export const MarkTransferSchema = z.object({
op: z.literal("transfer"),
to: AccountOrMark_AddressAISchema
}).strict().describe("PUBLIC: Transfer your on-chain identity mark to another address.");
export const MarkReplaceSchema = z.object({
op: z.literal("replace"),
new_mark_object: z.string().describe("New personal ID tag object ID.")
}).strict().describe("PUBLIC: Replace your on-chain identity mark with a new object.");
export const MarkDestroySchema = z.object({
op: z.literal("destroy")
}).strict().describe("PUBLIC: Destroy your on-chain identity mark permanently.");
export const MarkSchema = z.discriminatedUnion("op", [
MarkAddSchema,
MarkRemoveSchema,
MarkClearSchema,
MarkTransferSchema,
MarkReplaceSchema,
MarkDestroySchema
]);
export const CallPersonal_DataSchema = z.object({
description: DescriptionSchema.optional(),
referrer: z.union([z.string(), AccountOrMark_AddressSchema, z.null()]).optional().describe("Referrer ID (name or address) for joining the on-chain network."),
information: InformationSchema.optional().describe("PUBLIC: Personal info on-chain. Safe: social handles, URLs. NEVER: phone, address, private keys."),
mark: MarkSchema.optional().describe("PUBLIC: On-chain identity mark. For PRIVATE marks, use 'local' tool.")
}).strict();
export const CallPersonal_InputSchema = z.object({
data: CallPersonal_DataSchema,
env: CallEnvSchema.optional(),
}).strict();