UNPKG

wowok_agent

Version:

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

27 lines (26 loc) 1.97 kB
import { z } from "zod"; import { CallEnvSchema, SubmissionCallSchema, ObjectsSchema } from "./base.js"; import { ProgressNamedOperatorSchema } from "./machine.js"; import { NameOrAddressSchema, NameSchema } from "../common/index.js"; export const ProgressNextSchema = z.object({ next_node_name: NameSchema.describe("Next node name."), forward: NameSchema.describe("Next forward name."), }).strict().describe("Specify a specific operation between current node and next node."); export const OperateSchema = z.object({ operation: ProgressNextSchema, hold: z.boolean().optional().describe("Whether to lock operation permission. When true, locks the permission; when false or omitted, submits operation result directly."), adminUnhold: z.boolean().optional().describe("Whether to allow admin to force unlock. Only applicable when hold is true."), message: z.string().optional().describe("Operation result message."), }).strict().describe("Advance Progress object: lock operation permission (hold=true) or submit operation result (hold=false or omitted)."); export const CallProgress_DataSchema = z.object({ object: NameOrAddressSchema.describe("Progress object ID or name."), task: NameOrAddressSchema.optional().describe("Task ID. Cannot be changed after setting."), repository: ObjectsSchema.optional().describe("Consensus data Repository object list."), progress_namedOperator: ProgressNamedOperatorSchema.optional().describe("Manage operators for Progress permission namespace."), operate: OperateSchema.optional().describe("Advance Progress object. Can be locking operation permission (to avoid competition for the same permission) or submitting operation result."), }).strict().describe("On-chain, operate an existing Progress object."); export const CallProgress_InputSchema = z.object({ data: CallProgress_DataSchema, env: CallEnvSchema.optional(), submission: SubmissionCallSchema.optional(), }).strict();