wowok_agent 2.1.38 → 2.1.39

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.
Files changed (39) hide show
  1. package/dist/index.d.ts +45 -2
  2. package/dist/index.js +1 -1319
  3. package/dist/schema/call/allocation.js +1 -27
  4. package/dist/schema/call/arbitration.js +1 -106
  5. package/dist/schema/call/base.js +1 -152
  6. package/dist/schema/call/contact.js +1 -41
  7. package/dist/schema/call/demand.js +1 -51
  8. package/dist/schema/call/guard.d.ts +6 -6
  9. package/dist/schema/call/guard.js +1 -67
  10. package/dist/schema/call/handler.d.ts +0 -45
  11. package/dist/schema/call/handler.js +1 -230
  12. package/dist/schema/call/index.js +1 -19
  13. package/dist/schema/call/machine.js +1 -164
  14. package/dist/schema/call/order.js +1 -39
  15. package/dist/schema/call/payment.js +1 -20
  16. package/dist/schema/call/permission.js +1 -118
  17. package/dist/schema/call/personal.js +1 -81
  18. package/dist/schema/call/progress.js +1 -28
  19. package/dist/schema/call/proof.js +1 -27
  20. package/dist/schema/call/repository.js +1 -85
  21. package/dist/schema/call/reward.d.ts +12 -0
  22. package/dist/schema/call/reward.js +1 -46
  23. package/dist/schema/call/service.js +1 -88
  24. package/dist/schema/call/treasury.d.ts +84 -0
  25. package/dist/schema/call/treasury.js +1 -76
  26. package/dist/schema/common/index.js +1 -395
  27. package/dist/schema/index.js +1 -8
  28. package/dist/schema/local/index.js +1 -913
  29. package/dist/schema/local/wip.js +1 -230
  30. package/dist/schema/messenger/index.d.ts +0 -2
  31. package/dist/schema/messenger/index.js +1 -479
  32. package/dist/schema/query/index.d.ts +155 -0
  33. package/dist/schema/query/index.js +1 -1256
  34. package/dist/schema/utils/guard-parser.js +1 -410
  35. package/dist/schema/utils/guard-query-utils.js +1 -22
  36. package/dist/schema/utils/node-parser.d.ts +0 -14
  37. package/dist/schema/utils/node-parser.js +1 -382
  38. package/dist/schema/utils/permission-index-utils.js +1 -10
  39. package/package.json +5 -3
@@ -1,39 +1 @@
1
- import { z } from "zod";
2
- import { CallEnvSchema, SubmissionCallSchema } from "./base.js";
3
- import { OperateSchema } from "./progress.js";
4
- import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, ManyAccountOrMark_AddressSchema, NameOrAddressSchema } from "../common/index.js";
5
- import { QueryReceivedResultSchema } from "../common/index.js";
6
- // 定义arb_confirm schema
7
- export const ArbConfirmSchema = z.object({
8
- arb: NameOrAddressSchema.describe("Arb object ID or name."),
9
- confirm: z.boolean().describe("Whether to confirm that the submitted arbitration materials are valid for arbitration."),
10
- description: DescriptionSchema.optional().describe("Message description for compensation application."),
11
- proposition: z.array(LongNameSchema).optional().describe("Compensation claims.")
12
- }).strict();
13
- // 定义arb_objection schema
14
- export const ArbObjectionSchema = z.object({
15
- arb: NameOrAddressSchema.describe("Arb object ID or name."),
16
- objection: DescriptionSchema.describe("Oppose and appeal the arbitration result, request re-arbitration"),
17
- }).strict();
18
- // 定义arb_claim_compensation schema
19
- export const ArbClaimCompensationSchema = z.object({
20
- arb: NameOrAddressSchema.describe("Arb object ID or name."),
21
- }).strict();
22
- // 定义CallOrder_Data schema
23
- export const CallOrder_DataSchema = z.object({
24
- object: NameOrAddressSchema.describe("Order object ID or name."),
25
- agents: ManyAccountOrMark_AddressSchema.optional().describe("Order agents. Agents can operate the order, such as canceling the order, modifying the order status, etc.; but cannot receive the funds received by the order."),
26
- required_info: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object ID (recipient) or WTS Proof object (delivery proof) that information has been delivered via Wowok Messenger."),
27
- progress: OperateSchema.optional().describe("Advance order process"),
28
- arb_confirm: ArbConfirmSchema.optional().describe("Submit compensation request and apply for arbitration"),
29
- arb_objection: ArbObjectionSchema.optional().describe("Oppose and appeal the arbitration result, request re-arbitration."),
30
- arb_claim_compensation: ArbClaimCompensationSchema.optional().describe("Specify the adjudicated Arb object to obtain order compensation."),
31
- receive: QueryReceivedResultSchema.optional().describe("Unwrap CoinWrapper objects or other objects received by the order and transfer them to the order owner"),
32
- transfer_to: AccountOrMark_AddressSchema.optional().describe("Set new owner of the order. Requires order owner permission to set."),
33
- }).strict().describe("On-chain, operate on an Order object.");
34
- // 定义输入schema
35
- export const CallOrder_InputSchema = z.object({
36
- data: CallOrder_DataSchema,
37
- env: CallEnvSchema.optional(),
38
- submission: SubmissionCallSchema.optional(),
39
- }).strict();
1
+ import{z}from'zod';import{CallEnvSchema,SubmissionCallSchema}from'./base.js';import{OperateSchema}from'./progress.js';import{AccountOrMark_AddressSchema,DescriptionSchema,LongNameSchema,ManyAccountOrMark_AddressSchema,NameOrAddressSchema}from'../common/index.js';import{QueryReceivedResultSchema}from'../common/index.js';export const ArbConfirmSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'confirm':z['boolean']()['describe']('Whether\x20to\x20confirm\x20that\x20the\x20submitted\x20arbitration\x20materials\x20are\x20valid\x20for\x20arbitration.'),'description':DescriptionSchema['optional']()['describe']('Message\x20description\x20for\x20compensation\x20application.'),'proposition':z['array'](LongNameSchema)['optional']()['describe']('Compensation\x20claims.')})['strict']();export const ArbObjectionSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'objection':DescriptionSchema['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration')})['strict']();export const ArbClaimCompensationSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.')})['strict']();export const CallOrder_DataSchema=z['object']({'object':NameOrAddressSchema['describe']('Order\x20object\x20ID\x20or\x20name.'),'agents':ManyAccountOrMark_AddressSchema['optional']()['describe']('Order\x20agents.\x20Agents\x20can\x20operate\x20the\x20order,\x20such\x20as\x20canceling\x20the\x20order,\x20modifying\x20the\x20order\x20status,\x20etc.;\x20but\x20cannot\x20receive\x20the\x20funds\x20received\x20by\x20the\x20order.'),'required_info':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20(recipient)\x20or\x20WTS\x20Proof\x20object\x20(delivery\x20proof)\x20that\x20information\x20has\x20been\x20delivered\x20via\x20Wowok\x20Messenger.'),'progress':OperateSchema['optional']()['describe']('Advance\x20order\x20process'),'arb_confirm':ArbConfirmSchema['optional']()['describe']('Submit\x20compensation\x20request\x20and\x20apply\x20for\x20arbitration'),'arb_objection':ArbObjectionSchema['optional']()['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration.'),'arb_claim_compensation':ArbClaimCompensationSchema['optional']()['describe']('Specify\x20the\x20adjudicated\x20Arb\x20object\x20to\x20obtain\x20order\x20compensation.'),'receive':QueryReceivedResultSchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20or\x20other\x20objects\x20received\x20by\x20the\x20order\x20and\x20transfer\x20them\x20to\x20the\x20order\x20owner'),'transfer_to':AccountOrMark_AddressSchema['optional']()['describe']('Set\x20new\x20owner\x20of\x20the\x20order.\x20Requires\x20order\x20owner\x20permission\x20to\x20set.')})['strict']()['describe']('On-chain,\x20operate\x20on\x20an\x20Order\x20object.');export const CallOrder_InputSchema=z['object']({'data':CallOrder_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
@@ -1,20 +1 @@
1
- import { z } from "zod";
2
- import { PaymentInfoSchema } from "../query/index.js";
3
- import { CoinParamSchema, CallEnvSchema, TypeNamedObjectSchema } from "./base.js";
4
- import { AccountOrMark_AddressSchema } from "../common/index.js";
5
- // 定义Revenue schema
6
- export const RevenueSchema = z.object({
7
- recipient: AccountOrMark_AddressSchema,
8
- amount: CoinParamSchema
9
- }).strict().describe("Payment recipient and amount");
10
- // 定义CallPayment_Data schema
11
- export const CallPayment_DataSchema = z.object({
12
- object: TypeNamedObjectSchema,
13
- revenue: z.array(RevenueSchema).describe("Array of payment recipients and amounts"),
14
- info: PaymentInfoSchema
15
- }).strict().describe("On-chain Payment creation. USAGE: Set 'object' field with {name, type, ...} to create a named Payment. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. Payment is an immutable object - it can only be created, not modified. The 'object' field is CRITICAL and REQUIRED.");
16
- // 定义输入schema
17
- export const CallPayment_InputSchema = z.object({
18
- data: CallPayment_DataSchema,
19
- env: CallEnvSchema.optional(),
20
- }).strict();
1
+ import{z}from'zod';import{PaymentInfoSchema}from'../query/index.js';import{CoinParamSchema,CallEnvSchema,TypeNamedObjectSchema}from'./base.js';import{AccountOrMark_AddressSchema}from'../common/index.js';export const RevenueSchema=z['object']({'recipient':AccountOrMark_AddressSchema,'amount':CoinParamSchema})['strict']()['describe']('Payment\x20recipient\x20and\x20amount');export const CallPayment_DataSchema=z['object']({'object':TypeNamedObjectSchema,'revenue':z['array'](RevenueSchema)['describe']('Array\x20of\x20payment\x20recipients\x20and\x20amounts'),'info':PaymentInfoSchema})['strict']()['describe']('On-chain\x20Payment\x20creation.\x20USAGE:\x20Set\x20\x27object\x27\x20field\x20with\x20{name,\x20type,\x20...}\x20to\x20create\x20a\x20named\x20Payment.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20Payment\x20is\x20an\x20immutable\x20object\x20-\x20it\x20can\x20only\x20be\x20created,\x20not\x20modified.\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED.');export const CallPayment_InputSchema=z['object']({'data':CallPayment_DataSchema,'env':CallEnvSchema['optional']()})['strict']();
@@ -1,118 +1 @@
1
- import { z } from "zod";
2
- import { PermissionIndexTypeSchema } from "../query/index.js";
3
- import { CallEnvSchema, SubmissionCallSchema, NormalObjectSchema } from "./base.js";
4
- import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, ManyAccountOrMark_AddressSchema, NameOrAddressSchema, ReceivedObjectsOrRecentlySchema } from "../common/index.js";
5
- // 定义remark的set操作 schema
6
- export const RemarkSetSchema = z.object({
7
- op: z.literal("set"),
8
- index: PermissionIndexTypeSchema,
9
- remark: LongNameSchema.describe("Permission remark.")
10
- }).strict().describe("Set remark for a permission.");
11
- // 定义remark的remove操作 schema
12
- export const RemarkRemoveSchema = z.object({
13
- op: z.literal("remove"),
14
- index: PermissionIndexTypeSchema
15
- }).strict().describe("Remove remark for a permission.");
16
- // 定义remark的clear操作 schema
17
- export const RemarkClearSchema = z.object({
18
- op: z.literal("clear")
19
- }).strict().describe("Clear remarks for all permissions.");
20
- // 定义remark schema(联合类型)
21
- export const RemarkSchema = z.discriminatedUnion("op", [
22
- RemarkSetSchema,
23
- RemarkRemoveSchema,
24
- RemarkClearSchema
25
- ]).describe("Set remarks for permissions.");
26
- // 定义table的add/set/remove perm by index操作 schema
27
- export const TablePermByIndexSchema = z.discriminatedUnion("op", [
28
- z.object({
29
- op: z.literal("add perm by index"),
30
- index: PermissionIndexTypeSchema,
31
- entity: ManyAccountOrMark_AddressSchema
32
- }).strict().describe("Grant a specific permission to multiple entities at once. USE WHEN: You need to assign the SAME permission to MULTIPLE users/Guards. Example: Give 'create service' permission to Alice, Bob, and Carol simultaneously."),
33
- z.object({
34
- op: z.literal("set perm by index"),
35
- index: PermissionIndexTypeSchema,
36
- entity: ManyAccountOrMark_AddressSchema
37
- }).strict().describe("Replace the entity list for a specific permission with a new set of entities. USE WHEN: You want to completely redefine WHO has this permission. WARNING: This overwrites the existing entity list for this permission."),
38
- z.object({
39
- op: z.literal("remove perm by index"),
40
- index: PermissionIndexTypeSchema,
41
- entity: ManyAccountOrMark_AddressSchema
42
- }).strict().describe("Revoke a specific permission from multiple entities at once. USE WHEN: You need to remove the SAME permission from MULTIPLE users/Guards. Example: Remove 'create service' permission from Alice, Bob, and Carol simultaneously."),
43
- ]).describe("Permission-centric operations: Manage WHO has a specific permission. Best for batch-assigning one permission to many users. Structure: {op: 'add|set|remove perm by index', index: permission_id, entity: [user1, user2, ...]}");
44
- // 定义table的add/set/remove perm by entity操作 schema
45
- export const TablePermByEntitySchema = z.discriminatedUnion("op", [
46
- z.object({
47
- op: z.literal("add perm by entity"),
48
- entity: AccountOrMark_AddressSchema,
49
- index: z.array(PermissionIndexTypeSchema)
50
- }).strict().describe("Grant multiple permissions to a single entity. USE WHEN: You need to give ONE user/Guard MANY permissions at once. Example: Give Alice all Machine-related permissions (create, edit, publish, pause, etc.) in one call."),
51
- z.object({
52
- op: z.literal("set perm by entity"),
53
- entity: AccountOrMark_AddressSchema,
54
- index: z.array(PermissionIndexTypeSchema)
55
- }).strict().describe("Replace all permissions of a single entity with a new permission set. USE WHEN: You want to completely redefine WHAT permissions a user/Guard has. WARNING: This overwrites all existing permissions for this entity."),
56
- z.object({
57
- op: z.literal("remove perm by entity"),
58
- entity: AccountOrMark_AddressSchema,
59
- index: z.array(PermissionIndexTypeSchema)
60
- }).strict().describe("Revoke multiple permissions from a single entity. USE WHEN: You need to remove MANY permissions from ONE user/Guard at once. Example: Remove all Machine-related permissions from Alice."),
61
- ]).describe("Entity-centric operations: Manage WHAT permissions a specific user/Guard has. Best for assigning many permissions to one user. Structure: {op: 'add|set|remove perm by entity', entity: user_id, index: [perm1, perm2, ...]}");
62
- // 定义table schema(联合类型)
63
- export const TableSchema = z.discriminatedUnion("op", [
64
- ...TablePermByIndexSchema.options,
65
- ...TablePermByEntitySchema.options
66
- ]).describe("Manage permission assignments using two complementary approaches. CHOOSE THE RIGHT APPROACH: (1) 'perm by index' - Use when granting ONE permission to MANY users (permission-centric). Example: Give 'create service' permission to Alice, Bob, and Carol. (2) 'perm by entity' - Use when granting MANY permissions to ONE user (entity-centric). Example: Give Alice all Machine-related permissions. Both approaches support add/set/remove operations. Requires admin permission.");
67
- // 定义entity的swap/replace/copy操作 schema
68
- export const EntitySwapReplaceCopySchema = z.discriminatedUnion("op", [
69
- z.object({
70
- op: z.literal("swap"),
71
- entity1: AccountOrMark_AddressSchema,
72
- entity2: AccountOrMark_AddressSchema
73
- }).strict().describe("Swap all permission indexes between two entities."),
74
- z.object({
75
- op: z.literal("replace"),
76
- entity1: AccountOrMark_AddressSchema,
77
- entity2: AccountOrMark_AddressSchema
78
- }).strict().describe("Remove all permission indexes from entity1 and add them to entity2's permission indexes."),
79
- z.object({
80
- op: z.literal("copy"),
81
- entity1: AccountOrMark_AddressSchema,
82
- entity2: AccountOrMark_AddressSchema
83
- }).strict().describe("Add all permission indexes from entity1 to entity2's permission indexes."),
84
- ]);
85
- // 定义entity的del操作 schema
86
- export const EntityDelSchema = z.object({
87
- op: z.literal("del"),
88
- entity: AccountOrMark_AddressSchema
89
- }).strict().describe("Delete all permission indexes from an entity.");
90
- // 定义entity schema(联合类型)
91
- export const EntitySchema = z.discriminatedUnion("op", [
92
- ...EntitySwapReplaceCopySchema.options,
93
- EntityDelSchema
94
- ]);
95
- // 定义admin schema
96
- export const AdminSchema = z.object({
97
- op: z.enum(["add", "remove", "set"]).describe("Admin operations: add, remove, set."),
98
- addresses: ManyAccountOrMark_AddressSchema.describe("List of admin addresses.")
99
- }).strict();
100
- // 定义CallPermission_Data schema
101
- export const CallPermission_DataSchema = z.object({
102
- object: NormalObjectSchema.optional(),
103
- description: DescriptionSchema.optional(),
104
- remark: RemarkSchema.optional(),
105
- table: TableSchema.optional().describe("Manage permission assignments using two approaches: (1) By Permission Index - add/set/remove entity IDs for a specific permission; (2) By Entity - add/set/remove permission indexes for a specific entity. Requires admin permission."),
106
- entity: EntitySchema.optional().describe("Advanced entity permission operations: swap permissions between two entities, replace one entity's permissions with another's, copy permissions from one entity to another, or delete all permissions of an entity. Entity can be a user ID or Guard object ID. Requires admin permission."),
107
- admin: AdminSchema.optional().describe("Manage Permission object admins: add new admins, remove existing admins, or set the complete admin list. Only the Permission object owner (builder) can perform this operation. The creator automatically becomes an admin with full permissions."),
108
- apply: z.array(NameOrAddressSchema).optional().describe("Array of object IDs or names to operate on, apply the Permission object to these objects' permission control. Note: The signer must be the owner of the existing Permission objects for these objects"),
109
- builder: AccountOrMark_AddressSchema.optional().describe("Set or transfer ownership of the Permission object to the specified user ID. The creator automatically becomes the builder; only the builder can transfer ownership to other users."),
110
- owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe('Unwrap CoinWrapper objects and other objects received by this object and send them to the builder(owner).'),
111
- um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object."),
112
- }).strict().describe("On-chain Permission operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, tags?, ...} to create a Permission. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. (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.");
113
- // 定义输入schema
114
- export const CallPermission_InputSchema = z.object({
115
- data: CallPermission_DataSchema,
116
- env: CallEnvSchema.optional(),
117
- submission: SubmissionCallSchema.optional(),
118
- }).strict();
1
+ import{z}from'zod';import{PermissionIndexTypeSchema}from'../query/index.js';import{CallEnvSchema,SubmissionCallSchema,NormalObjectSchema}from'./base.js';import{AccountOrMark_AddressSchema,DescriptionSchema,LongNameSchema,ManyAccountOrMark_AddressSchema,NameOrAddressSchema,ReceivedObjectsOrRecentlySchema}from'../common/index.js';export const RemarkSetSchema=z['object']({'op':z['literal']('set'),'index':PermissionIndexTypeSchema,'remark':LongNameSchema['describe']('Permission\x20remark.')})['strict']()['describe']('Set\x20remark\x20for\x20a\x20permission.');export const RemarkRemoveSchema=z['object']({'op':z['literal']('remove'),'index':PermissionIndexTypeSchema})['strict']()['describe']('Remove\x20remark\x20for\x20a\x20permission.');export const RemarkClearSchema=z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20remarks\x20for\x20all\x20permissions.');export const RemarkSchema=z['discriminatedUnion']('op',[RemarkSetSchema,RemarkRemoveSchema,RemarkClearSchema])['describe']('Set\x20remarks\x20for\x20permissions.');export const TablePermByIndexSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add\x20perm\x20by\x20index'),'index':PermissionIndexTypeSchema,'entity':ManyAccountOrMark_AddressSchema})['strict']()['describe']('Grant\x20a\x20specific\x20permission\x20to\x20multiple\x20entities\x20at\x20once.\x20USE\x20WHEN:\x20You\x20need\x20to\x20assign\x20the\x20SAME\x20permission\x20to\x20MULTIPLE\x20users/Guards.\x20Example:\x20Give\x20\x27create\x20service\x27\x20permission\x20to\x20Alice,\x20Bob,\x20and\x20Carol\x20simultaneously.'),z['object']({'op':z['literal']('set\x20perm\x20by\x20index'),'index':PermissionIndexTypeSchema,'entity':ManyAccountOrMark_AddressSchema})['strict']()['describe']('Replace\x20the\x20entity\x20list\x20for\x20a\x20specific\x20permission\x20with\x20a\x20new\x20set\x20of\x20entities.\x20USE\x20WHEN:\x20You\x20want\x20to\x20completely\x20redefine\x20WHO\x20has\x20this\x20permission.\x20WARNING:\x20This\x20overwrites\x20the\x20existing\x20entity\x20list\x20for\x20this\x20permission.'),z['object']({'op':z['literal']('remove\x20perm\x20by\x20index'),'index':PermissionIndexTypeSchema,'entity':ManyAccountOrMark_AddressSchema})['strict']()['describe']('Revoke\x20a\x20specific\x20permission\x20from\x20multiple\x20entities\x20at\x20once.\x20USE\x20WHEN:\x20You\x20need\x20to\x20remove\x20the\x20SAME\x20permission\x20from\x20MULTIPLE\x20users/Guards.\x20Example:\x20Remove\x20\x27create\x20service\x27\x20permission\x20from\x20Alice,\x20Bob,\x20and\x20Carol\x20simultaneously.')])['describe']('Permission-centric\x20operations:\x20Manage\x20WHO\x20has\x20a\x20specific\x20permission.\x20Best\x20for\x20batch-assigning\x20one\x20permission\x20to\x20many\x20users.\x20Structure:\x20{op:\x20\x27add|set|remove\x20perm\x20by\x20index\x27,\x20index:\x20permission_id,\x20entity:\x20[user1,\x20user2,\x20...]}');export const TablePermByEntitySchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add\x20perm\x20by\x20entity'),'entity':AccountOrMark_AddressSchema,'index':z['array'](PermissionIndexTypeSchema)})['strict']()['describe']('Grant\x20multiple\x20permissions\x20to\x20a\x20single\x20entity.\x20USE\x20WHEN:\x20You\x20need\x20to\x20give\x20ONE\x20user/Guard\x20MANY\x20permissions\x20at\x20once.\x20Example:\x20Give\x20Alice\x20all\x20Machine-related\x20permissions\x20(create,\x20edit,\x20publish,\x20pause,\x20etc.)\x20in\x20one\x20call.'),z['object']({'op':z['literal']('set\x20perm\x20by\x20entity'),'entity':AccountOrMark_AddressSchema,'index':z['array'](PermissionIndexTypeSchema)})['strict']()['describe']('Replace\x20all\x20permissions\x20of\x20a\x20single\x20entity\x20with\x20a\x20new\x20permission\x20set.\x20USE\x20WHEN:\x20You\x20want\x20to\x20completely\x20redefine\x20WHAT\x20permissions\x20a\x20user/Guard\x20has.\x20WARNING:\x20This\x20overwrites\x20all\x20existing\x20permissions\x20for\x20this\x20entity.'),z['object']({'op':z['literal']('remove\x20perm\x20by\x20entity'),'entity':AccountOrMark_AddressSchema,'index':z['array'](PermissionIndexTypeSchema)})['strict']()['describe']('Revoke\x20multiple\x20permissions\x20from\x20a\x20single\x20entity.\x20USE\x20WHEN:\x20You\x20need\x20to\x20remove\x20MANY\x20permissions\x20from\x20ONE\x20user/Guard\x20at\x20once.\x20Example:\x20Remove\x20all\x20Machine-related\x20permissions\x20from\x20Alice.')])['describe']('Entity-centric\x20operations:\x20Manage\x20WHAT\x20permissions\x20a\x20specific\x20user/Guard\x20has.\x20Best\x20for\x20assigning\x20many\x20permissions\x20to\x20one\x20user.\x20Structure:\x20{op:\x20\x27add|set|remove\x20perm\x20by\x20entity\x27,\x20entity:\x20user_id,\x20index:\x20[perm1,\x20perm2,\x20...]}');export const TableSchema=z['discriminatedUnion']('op',[...TablePermByIndexSchema['options'],...TablePermByEntitySchema['options']])['describe']('Manage\x20permission\x20assignments\x20using\x20two\x20complementary\x20approaches.\x20CHOOSE\x20THE\x20RIGHT\x20APPROACH:\x20(1)\x20\x27perm\x20by\x20index\x27\x20-\x20Use\x20when\x20granting\x20ONE\x20permission\x20to\x20MANY\x20users\x20(permission-centric).\x20Example:\x20Give\x20\x27create\x20service\x27\x20permission\x20to\x20Alice,\x20Bob,\x20and\x20Carol.\x20(2)\x20\x27perm\x20by\x20entity\x27\x20-\x20Use\x20when\x20granting\x20MANY\x20permissions\x20to\x20ONE\x20user\x20(entity-centric).\x20Example:\x20Give\x20Alice\x20all\x20Machine-related\x20permissions.\x20Both\x20approaches\x20support\x20add/set/remove\x20operations.\x20Requires\x20admin\x20permission.');export const EntitySwapReplaceCopySchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('swap'),'entity1':AccountOrMark_AddressSchema,'entity2':AccountOrMark_AddressSchema})['strict']()['describe']('Swap\x20all\x20permission\x20indexes\x20between\x20two\x20entities.'),z['object']({'op':z['literal']('replace'),'entity1':AccountOrMark_AddressSchema,'entity2':AccountOrMark_AddressSchema})['strict']()['describe']('Remove\x20all\x20permission\x20indexes\x20from\x20entity1\x20and\x20add\x20them\x20to\x20entity2\x27s\x20permission\x20indexes.'),z['object']({'op':z['literal']('copy'),'entity1':AccountOrMark_AddressSchema,'entity2':AccountOrMark_AddressSchema})['strict']()['describe']('Add\x20all\x20permission\x20indexes\x20from\x20entity1\x20to\x20entity2\x27s\x20permission\x20indexes.')]);export const EntityDelSchema=z['object']({'op':z['literal']('del'),'entity':AccountOrMark_AddressSchema})['strict']()['describe']('Delete\x20all\x20permission\x20indexes\x20from\x20an\x20entity.');export const EntitySchema=z['discriminatedUnion']('op',[...EntitySwapReplaceCopySchema['options'],EntityDelSchema]);export const AdminSchema=z['object']({'op':z['enum'](['add','remove','set'])['describe']('Admin\x20operations:\x20add,\x20remove,\x20set.'),'addresses':ManyAccountOrMark_AddressSchema['describe']('List\x20of\x20admin\x20addresses.')})['strict']();export const CallPermission_DataSchema=z['object']({'object':NormalObjectSchema['optional'](),'description':DescriptionSchema['optional'](),'remark':RemarkSchema['optional'](),'table':TableSchema['optional']()['describe']('Manage\x20permission\x20assignments\x20using\x20two\x20approaches:\x20(1)\x20By\x20Permission\x20Index\x20-\x20add/set/remove\x20entity\x20IDs\x20for\x20a\x20specific\x20permission;\x20(2)\x20By\x20Entity\x20-\x20add/set/remove\x20permission\x20indexes\x20for\x20a\x20specific\x20entity.\x20Requires\x20admin\x20permission.'),'entity':EntitySchema['optional']()['describe']('Advanced\x20entity\x20permission\x20operations:\x20swap\x20permissions\x20between\x20two\x20entities,\x20replace\x20one\x20entity\x27s\x20permissions\x20with\x20another\x27s,\x20copy\x20permissions\x20from\x20one\x20entity\x20to\x20another,\x20or\x20delete\x20all\x20permissions\x20of\x20an\x20entity.\x20Entity\x20can\x20be\x20a\x20user\x20ID\x20or\x20Guard\x20object\x20ID.\x20Requires\x20admin\x20permission.'),'admin':AdminSchema['optional']()['describe']('Manage\x20Permission\x20object\x20admins:\x20add\x20new\x20admins,\x20remove\x20existing\x20admins,\x20or\x20set\x20the\x20complete\x20admin\x20list.\x20Only\x20the\x20Permission\x20object\x20owner\x20(builder)\x20can\x20perform\x20this\x20operation.\x20The\x20creator\x20automatically\x20becomes\x20an\x20admin\x20with\x20full\x20permissions.'),'apply':z['array'](NameOrAddressSchema)['optional']()['describe']('Array\x20of\x20object\x20IDs\x20or\x20names\x20to\x20operate\x20on,\x20apply\x20the\x20Permission\x20object\x20to\x20these\x20objects\x27\x20permission\x20control.\x20Note:\x20The\x20signer\x20must\x20be\x20the\x20owner\x20of\x20the\x20existing\x20Permission\x20objects\x20for\x20these\x20objects'),'builder':AccountOrMark_AddressSchema['optional']()['describe']('Set\x20or\x20transfer\x20ownership\x20of\x20the\x20Permission\x20object\x20to\x20the\x20specified\x20user\x20ID.\x20The\x20creator\x20automatically\x20becomes\x20the\x20builder;\x20only\x20the\x20builder\x20can\x20transfer\x20ownership\x20to\x20other\x20users.'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20object\x20and\x20send\x20them\x20to\x20the\x20builder(owner).'),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object.')})['strict']()['describe']('On-chain\x20Permission\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20tags?,\x20...}\x20to\x20create\x20a\x20Permission.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.');export const CallPermission_InputSchema=z['object']({'data':CallPermission_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
@@ -1,81 +1 @@
1
- import { z } from "zod";
2
- import { AccountOrMark_AddressAISchema, AccountOrMark_AddressSchema, DescriptionSchema, ManyAccountOrMark_AddressAISchema, NameSchema } from "../common/index.js";
3
- import { RecordsInEntitySchema } from "../query/index.js";
4
- import { CallEnvSchema } from "./base.js";
5
- // 定义information的add操作 schema
6
- export const InformationAddSchema = z.object({
7
- op: z.literal("add"),
8
- data: z.array(RecordsInEntitySchema)
9
- }).strict().describe("PUBLIC: Add personal info on-chain. Safe: social handles, URLs, public email. NEVER: phone, address, private keys.");
10
- // 定义information的remove操作 schema
11
- export const InformationRemoveSchema = z.object({
12
- op: z.literal("remove"),
13
- name: z.array(NameSchema)
14
- }).strict().describe("PUBLIC: Remove specified personal info records from your public profile.");
15
- // 定义information的clear操作 schema
16
- export const InformationClearSchema = z.object({
17
- op: z.literal("clear")
18
- }).strict().describe("PUBLIC: Clear ALL personal info from your public profile.");
19
- // 定义information schema(联合类型)
20
- export const InformationSchema = z.discriminatedUnion("op", [
21
- InformationAddSchema,
22
- InformationRemoveSchema,
23
- InformationClearSchema
24
- ]);
25
- // 定义mark的add操作 schema
26
- export const MarkAddSchema = z.object({
27
- op: z.literal("add"),
28
- data: z.array(z.object({
29
- address: AccountOrMark_AddressAISchema,
30
- name: NameSchema.optional(),
31
- tags: z.array(NameSchema).optional()
32
- }).strict()),
33
- }).strict().describe("PUBLIC: Add ID name and tags on-chain for public identity. For private marks, use 'local' tool.");
34
- // 定义mark的remove操作 schema
35
- export const MarkRemoveSchema = z.object({
36
- op: z.literal("remove"),
37
- data: z.array(z.object({
38
- address: AccountOrMark_AddressAISchema,
39
- tags: z.array(NameSchema).optional()
40
- }).strict())
41
- }).strict().describe("PUBLIC: Remove specified tags from your on-chain identity mark.");
42
- // 定义mark的clear操作 schema
43
- export const MarkClearSchema = z.object({
44
- op: z.literal("clear"),
45
- address: ManyAccountOrMark_AddressAISchema
46
- }).strict().describe("PUBLIC: Clear ALL tags from specified on-chain identity marks.");
47
- // 定义mark的transfer操作 schema
48
- export const MarkTransferSchema = z.object({
49
- op: z.literal("transfer"),
50
- to: AccountOrMark_AddressAISchema
51
- }).strict().describe("PUBLIC: Transfer your on-chain identity mark to another address.");
52
- // 定义mark的replace操作 schema
53
- export const MarkReplaceSchema = z.object({
54
- op: z.literal("replace"),
55
- new_mark_object: z.string().describe("New personal ID tag object ID.")
56
- }).strict().describe("PUBLIC: Replace your on-chain identity mark with a new object.");
57
- // 定义mark的destroy操作 schema
58
- export const MarkDestroySchema = z.object({
59
- op: z.literal("destroy")
60
- }).strict().describe("PUBLIC: Destroy your on-chain identity mark permanently.");
61
- // 定义mark schema(联合类型)
62
- export const MarkSchema = z.discriminatedUnion("op", [
63
- MarkAddSchema,
64
- MarkRemoveSchema,
65
- MarkClearSchema,
66
- MarkTransferSchema,
67
- MarkReplaceSchema,
68
- MarkDestroySchema
69
- ]);
70
- // 定义CallPersonal_Data schema
71
- export const CallPersonal_DataSchema = z.object({
72
- description: DescriptionSchema.optional(),
73
- referrer: z.union([z.string(), AccountOrMark_AddressSchema, z.null()]).optional().describe("Referrer ID (name or address) for joining the on-chain network."),
74
- information: InformationSchema.optional().describe("PUBLIC: Personal info on-chain. Safe: social handles, URLs. NEVER: phone, address, private keys."),
75
- mark: MarkSchema.optional().describe("PUBLIC: On-chain identity mark. For PRIVATE marks, use 'local' tool.")
76
- }).strict();
77
- // 定义输入schema
78
- export const CallPersonal_InputSchema = z.object({
79
- data: CallPersonal_DataSchema,
80
- env: CallEnvSchema.optional(),
81
- }).strict();
1
+ 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:\x20Add\x20personal\x20info\x20on-chain.\x20Safe:\x20social\x20handles,\x20URLs,\x20public\x20email.\x20NEVER:\x20phone,\x20address,\x20private\x20keys.');export const InformationRemoveSchema=z['object']({'op':z['literal']('remove'),'name':z['array'](NameSchema)})['strict']()['describe']('PUBLIC:\x20Remove\x20specified\x20personal\x20info\x20records\x20from\x20your\x20public\x20profile.');export const InformationClearSchema=z['object']({'op':z['literal']('clear')})['strict']()['describe']('PUBLIC:\x20Clear\x20ALL\x20personal\x20info\x20from\x20your\x20public\x20profile.');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:\x20Add\x20ID\x20name\x20and\x20tags\x20on-chain\x20for\x20public\x20identity.\x20For\x20private\x20marks,\x20use\x20\x27local\x27\x20tool.');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:\x20Remove\x20specified\x20tags\x20from\x20your\x20on-chain\x20identity\x20mark.');export const MarkClearSchema=z['object']({'op':z['literal']('clear'),'address':ManyAccountOrMark_AddressAISchema})['strict']()['describe']('PUBLIC:\x20Clear\x20ALL\x20tags\x20from\x20specified\x20on-chain\x20identity\x20marks.');export const MarkTransferSchema=z['object']({'op':z['literal']('transfer'),'to':AccountOrMark_AddressAISchema})['strict']()['describe']('PUBLIC:\x20Transfer\x20your\x20on-chain\x20identity\x20mark\x20to\x20another\x20address.');export const MarkReplaceSchema=z['object']({'op':z['literal']('replace'),'new_mark_object':z['string']()['describe']('New\x20personal\x20ID\x20tag\x20object\x20ID.')})['strict']()['describe']('PUBLIC:\x20Replace\x20your\x20on-chain\x20identity\x20mark\x20with\x20a\x20new\x20object.');export const MarkDestroySchema=z['object']({'op':z['literal']('destroy')})['strict']()['describe']('PUBLIC:\x20Destroy\x20your\x20on-chain\x20identity\x20mark\x20permanently.');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\x20ID\x20(name\x20or\x20address)\x20for\x20joining\x20the\x20on-chain\x20network.'),'information':InformationSchema['optional']()['describe']('PUBLIC:\x20Personal\x20info\x20on-chain.\x20Safe:\x20social\x20handles,\x20URLs.\x20NEVER:\x20phone,\x20address,\x20private\x20keys.'),'mark':MarkSchema['optional']()['describe']('PUBLIC:\x20On-chain\x20identity\x20mark.\x20For\x20PRIVATE\x20marks,\x20use\x20\x27local\x27\x20tool.')})['strict']();export const CallPersonal_InputSchema=z['object']({'data':CallPersonal_DataSchema,'env':CallEnvSchema['optional']()})['strict']();
@@ -1,28 +1 @@
1
- import { z } from "zod";
2
- import { CallEnvSchema, SubmissionCallSchema, ObjectsSchema } from "./base.js";
3
- import { ProgressNamedOperatorSchema } from "./machine.js";
4
- import { NameOrAddressSchema, NameSchema } from "../common/index.js";
5
- // ProgressNext 类型定义
6
- export const ProgressNextSchema = z.object({
7
- next_node_name: NameSchema.describe("Next node name."),
8
- forward: NameSchema.describe("Next forward name."),
9
- }).strict().describe("Specify a specific operation between current node and next node.");
10
- // Operate 操作类型
11
- export const OperateSchema = z.object({
12
- operation: ProgressNextSchema,
13
- hold: z.boolean().optional().describe("Whether to lock operation permission. When true, locks the permission; when false or omitted, submits operation result directly."),
14
- adminUnhold: z.boolean().optional().describe("Whether to allow admin to force unlock. Only applicable when hold is true."),
15
- message: z.string().optional().describe("Operation result message."),
16
- }).strict().describe("Advance Progress object: lock operation permission (hold=true) or submit operation result (hold=false or omitted).");
17
- export const CallProgress_DataSchema = z.object({
18
- object: NameOrAddressSchema.describe("Progress object ID or name."),
19
- task: NameOrAddressSchema.optional().describe("Task ID. Cannot be changed after setting."),
20
- repository: ObjectsSchema.optional().describe("Consensus data Repository object list."),
21
- progress_namedOperator: ProgressNamedOperatorSchema.optional().describe("Manage operators for Progress permission namespace."),
22
- operate: OperateSchema.optional().describe("Advance Progress object. Can be locking operation permission (to avoid competition for the same permission) or submitting operation result."),
23
- }).strict().describe("On-chain, operate an existing Progress object.");
24
- export const CallProgress_InputSchema = z.object({
25
- data: CallProgress_DataSchema,
26
- env: CallEnvSchema.optional(),
27
- submission: SubmissionCallSchema.optional(),
28
- }).strict();
1
+ 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\x20node\x20name.'),'forward':NameSchema['describe']('Next\x20forward\x20name.')})['strict']()['describe']('Specify\x20a\x20specific\x20operation\x20between\x20current\x20node\x20and\x20next\x20node.');export const OperateSchema=z['object']({'operation':ProgressNextSchema,'hold':z['boolean']()['optional']()['describe']('Whether\x20to\x20lock\x20operation\x20permission.\x20When\x20true,\x20locks\x20the\x20permission;\x20when\x20false\x20or\x20omitted,\x20submits\x20operation\x20result\x20directly.'),'adminUnhold':z['boolean']()['optional']()['describe']('Whether\x20to\x20allow\x20admin\x20to\x20force\x20unlock.\x20Only\x20applicable\x20when\x20hold\x20is\x20true.'),'message':z['string']()['optional']()['describe']('Operation\x20result\x20message.')})['strict']()['describe']('Advance\x20Progress\x20object:\x20lock\x20operation\x20permission\x20(hold=true)\x20or\x20submit\x20operation\x20result\x20(hold=false\x20or\x20omitted).');export const CallProgress_DataSchema=z['object']({'object':NameOrAddressSchema['describe']('Progress\x20object\x20ID\x20or\x20name.'),'task':NameOrAddressSchema['optional']()['describe']('Task\x20ID.\x20Cannot\x20be\x20changed\x20after\x20setting.'),'repository':ObjectsSchema['optional']()['describe']('Consensus\x20data\x20Repository\x20object\x20list.'),'progress_namedOperator':ProgressNamedOperatorSchema['optional']()['describe']('Manage\x20operators\x20for\x20Progress\x20permission\x20namespace.'),'operate':OperateSchema['optional']()['describe']('Advance\x20Progress\x20object.\x20Can\x20be\x20locking\x20operation\x20permission\x20(to\x20avoid\x20competition\x20for\x20the\x20same\x20permission)\x20or\x20submitting\x20operation\x20result.')})['strict']()['describe']('On-chain,\x20operate\x20an\x20existing\x20Progress\x20object.');export const CallProgress_InputSchema=z['object']({'data':CallProgress_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
@@ -1,27 +1 @@
1
- import { z } from 'zod';
2
- import { CallEnvSchema, NamedObjectSchema } from './base.js';
3
- import { DescriptionSchema } from '../common/index.js';
4
- export const CallProof_DataSchema = z.object({
5
- namedNew: NamedObjectSchema.optional(),
6
- description: DescriptionSchema.optional(),
7
- proof: z.string().max(10240).describe("Proof content. e.g. merkle tree root"),
8
- server_pubkey: z.string().max(1024).describe("Server public key"),
9
- server_signature: z.string().max(40480).describe("Server signature"),
10
- proof_type: z.union([z.number().int().min(0), z.string()]).describe("Proof type. 1: WTS proof; 1-100 reserved."),
11
- item_count: z.union([z.number().int().min(0), z.string(), z.null()]).optional().describe("Item count. e.g. number of items in the merkle tree"),
12
- about_address: z.union([NamedObjectSchema, z.null()]).optional().describe("About address. e.g. address of the entity being proved"),
13
- }).strict().describe("On-chain Proof creation. USAGE: Set 'namedNew' field with {name, tag?} to create a named Proof. Proof is an immutable object - it can only be created, not modified. The 'namedNew' field is CRITICAL and REQUIRED.");
14
- export const CallProof_InputSchema = z.object({
15
- data: CallProof_DataSchema,
16
- env: CallEnvSchema.optional(),
17
- }).strict().describe("On-chain, create a new Proof object");
18
- export const CallGenProof_InputSchema = z.object({
19
- proof: z.string().max(10240).describe("Proof content. e.g. merkle tree root"),
20
- server_pubkey: z.string().max(1024).describe("Server public key"),
21
- server_signature: z.string().max(40480).describe("Server signature"),
22
- proof_type: z.union([z.number().int().min(0), z.string()]).describe("Proof type. 1: WTS proof; 1-100 reserved."),
23
- description: DescriptionSchema.optional(),
24
- item_count: z.union([z.number().int().min(0), z.string(), z.null()]).optional().describe("Item count. e.g. number of items in the merkle tree"),
25
- about_address: z.union([NamedObjectSchema, z.null()]).optional().describe("About address. e.g. address of the entity being proved"),
26
- env: CallEnvSchema.optional(),
27
- }).strict().describe("Generate a new Proof object on-chain");
1
+ import{z}from'zod';import{CallEnvSchema,NamedObjectSchema}from'./base.js';import{DescriptionSchema}from'../common/index.js';export const CallProof_DataSchema=z['object']({'namedNew':NamedObjectSchema['optional'](),'description':DescriptionSchema['optional'](),'proof':z['string']()['max'](0x2800)['describe']('Proof\x20content.\x20e.g.\x20merkle\x20tree\x20root'),'server_pubkey':z['string']()['max'](0x400)['describe']('Server\x20public\x20key'),'server_signature':z['string']()['max'](0x9e20)['describe']('Server\x20signature'),'proof_type':z['union']([z['number']()['int']()['min'](0x0),z['string']()])['describe']('Proof\x20type.\x201:\x20WTS\x20proof;\x201-100\x20reserved.'),'item_count':z['union']([z['number']()['int']()['min'](0x0),z['string'](),z['null']()])['optional']()['describe']('Item\x20count.\x20e.g.\x20number\x20of\x20items\x20in\x20the\x20merkle\x20tree'),'about_address':z['union']([NamedObjectSchema,z['null']()])['optional']()['describe']('About\x20address.\x20e.g.\x20address\x20of\x20the\x20entity\x20being\x20proved')})['strict']()['describe']('On-chain\x20Proof\x20creation.\x20USAGE:\x20Set\x20\x27namedNew\x27\x20field\x20with\x20{name,\x20tag?}\x20to\x20create\x20a\x20named\x20Proof.\x20Proof\x20is\x20an\x20immutable\x20object\x20-\x20it\x20can\x20only\x20be\x20created,\x20not\x20modified.\x20The\x20\x27namedNew\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED.');export const CallProof_InputSchema=z['object']({'data':CallProof_DataSchema,'env':CallEnvSchema['optional']()})['strict']()['describe']('On-chain,\x20create\x20a\x20new\x20Proof\x20object');export const CallGenProof_InputSchema=z['object']({'proof':z['string']()['max'](0x2800)['describe']('Proof\x20content.\x20e.g.\x20merkle\x20tree\x20root'),'server_pubkey':z['string']()['max'](0x400)['describe']('Server\x20public\x20key'),'server_signature':z['string']()['max'](0x9e20)['describe']('Server\x20signature'),'proof_type':z['union']([z['number']()['int']()['min'](0x0),z['string']()])['describe']('Proof\x20type.\x201:\x20WTS\x20proof;\x201-100\x20reserved.'),'description':DescriptionSchema['optional'](),'item_count':z['union']([z['number']()['int']()['min'](0x0),z['string'](),z['null']()])['optional']()['describe']('Item\x20count.\x20e.g.\x20number\x20of\x20items\x20in\x20the\x20merkle\x20tree'),'about_address':z['union']([NamedObjectSchema,z['null']()])['optional']()['describe']('About\x20address.\x20e.g.\x20address\x20of\x20the\x20entity\x20being\x20proved'),'env':CallEnvSchema['optional']()})['strict']()['describe']('Generate\x20a\x20new\x20Proof\x20object\x20on-chain');
@@ -1,85 +1 @@
1
- import { z } from "zod";
2
- import { WithPermissionObjectSchema, ObjectsSchema, CallEnvSchema, SubmissionCallSchema, } from "./base.js";
3
- import { AccountOrMark_AddressSchema, DescriptionSchema, NameOrAddressSchema, NameSchema, ReceivedObjectsOrRecentlySchema } from "../common/index.js";
4
- import { PolicyRuleSchema } from "../query/index.js";
5
- import { SupportedValueSchema } from "../common/index.js";
6
- // RepositoryId 类型定义
7
- export const RepositoryIdSchema = z.union([
8
- AccountOrMark_AddressSchema,
9
- z.number().int(),
10
- ]).describe("Data item ID. If a number (such as time) is specified, it will be automatically converted to an address or ID type.");
11
- // KeyData 类型定义
12
- export const KeyDataSchema = z.object({
13
- id: RepositoryIdSchema,
14
- data: SupportedValueSchema,
15
- }).strict().describe("Data ID and value.");
16
- // RepDataItem 类型定义
17
- export const RepDataItemSchema = z.object({
18
- data: z.array(KeyDataSchema).describe("Data item list."),
19
- write_guard: NameOrAddressSchema.optional().describe("Guard ID or name. Used to specify the policy write permissions and rules corresponding to this Guard."),
20
- }).strict().describe("List of data items to write.");
21
- // SignerOrClockBase 类型定义
22
- export const SignerOrClockBaseSchema = z.object({
23
- name: NameSchema.describe("Data item name."),
24
- write_guard: NameOrAddressSchema.optional().describe("Guard ID or name. Used to specify the policy write permissions and rules corresponding to this Guard."),
25
- }).strict().describe("Specify data items by name and ID. ID is the on-chain timestamp or signer ID (depending on how write_guard specifies the ID source).");
26
- // SignerOrClock 类型定义
27
- export const SignerOrClockSchema = z.object({
28
- name: NameSchema.describe("Data item name."),
29
- write_guard: NameOrAddressSchema.optional().describe("Guard ID or name. Used to specify the policy write permissions and rules corresponding to this Guard."),
30
- data: SupportedValueSchema,
31
- }).strict().describe("Specify data items by name and data. ID is the on-chain timestamp or signer ID (depending on how write_guard specifies the ID source).");
32
- // DataRemoveItem 类型定义
33
- export const DataRemoveItemSchema = z.object({
34
- id: z.array(RepositoryIdSchema).describe("Data item ID list."),
35
- write_guard: NameOrAddressSchema.optional().describe("Guard ID or name. Used to verify permission to delete data."),
36
- }).strict().describe("Delete data items by name and ID list.");
37
- // Policies 操作类型
38
- export const PoliciesAddSetSchema = z.object({
39
- op: z.enum(["add", "set"]),
40
- policy: z.array(PolicyRuleSchema).describe("Policy rule list."),
41
- }).strict().describe("Add or set policy rules.");
42
- export const PoliciesRemoveSchema = z.object({
43
- op: z.literal("remove"),
44
- policy: z.array(NameSchema).describe("Policy rule name list."),
45
- }).strict().describe("Remove policy rules.");
46
- export const PoliciesClearSchema = z.object({
47
- op: z.literal("clear"),
48
- }).strict().describe("Clear policy rules.");
49
- export const PoliciesSchema = z.discriminatedUnion("op", [
50
- PoliciesAddSetSchema,
51
- PoliciesRemoveSchema,
52
- PoliciesClearSchema,
53
- ]);
54
- // DataAdd 类型定义
55
- export const DataAddWithItemsSchema = z.object({
56
- name: NameSchema.describe("Data item name. Must match the name in PolicyRule."),
57
- items: z.array(RepDataItemSchema).describe("List of data items to add. Each data item contains name, ID, and data parts, where name and ID together form the unique key for the data."),
58
- }).strict().describe("Add data by name and data item list. Each data item contains name, ID, and data parts, where name and ID together form the unique key for the data.");
59
- export const DataAddSchema = z.union([
60
- SignerOrClockSchema,
61
- DataAddWithItemsSchema,
62
- ]);
63
- // DataRemove 类型定义
64
- export const DataRemoveSchema = z.union([
65
- SignerOrClockBaseSchema,
66
- z.object({
67
- name: NameSchema.describe("Data item name. Must match the name in PolicyRule."),
68
- items: z.array(DataRemoveItemSchema).describe("List of data items to delete."),
69
- }).strict(),
70
- ]);
71
- export const CallRepository_DataSchema = z.object({
72
- object: WithPermissionObjectSchema,
73
- description: DescriptionSchema.optional(),
74
- policies: PoliciesSchema.optional().describe("Policy list. Used to define data item write permissions and rules, as well as data item read permissions."),
75
- data_add: DataAddSchema.optional().describe("Add data items"),
76
- data_remove: DataRemoveSchema.optional().describe("Delete data items"),
77
- rewards: ObjectsSchema.optional().describe("Reward object list. Used for data contribution incentives."),
78
- owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this object and send them to the owner of its Permission object."),
79
- um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object."),
80
- }).strict().describe("On-chain Repository operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, permission, ...} to create a Repository. 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.");
81
- export const CallRepository_InputSchema = z.object({
82
- data: CallRepository_DataSchema,
83
- env: CallEnvSchema.optional(),
84
- submission: SubmissionCallSchema.optional(),
85
- }).strict();
1
+ import{z}from'zod';import{WithPermissionObjectSchema,ObjectsSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{AccountOrMark_AddressSchema,DescriptionSchema,NameOrAddressSchema,NameSchema,ReceivedObjectsOrRecentlySchema}from'../common/index.js';import{PolicyRuleSchema}from'../query/index.js';import{SupportedValueSchema}from'../common/index.js';export const RepositoryIdSchema=z['union']([AccountOrMark_AddressSchema,z['number']()['int']()])['describe']('Data\x20item\x20ID.\x20If\x20a\x20number\x20(such\x20as\x20time)\x20is\x20specified,\x20it\x20will\x20be\x20automatically\x20converted\x20to\x20an\x20address\x20or\x20ID\x20type.');export const KeyDataSchema=z['object']({'id':RepositoryIdSchema,'data':SupportedValueSchema})['strict']()['describe']('Data\x20ID\x20and\x20value.');export const RepDataItemSchema=z['object']({'data':z['array'](KeyDataSchema)['describe']('Data\x20item\x20list.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20Used\x20to\x20specify\x20the\x20policy\x20write\x20permissions\x20and\x20rules\x20corresponding\x20to\x20this\x20Guard.')})['strict']()['describe']('List\x20of\x20data\x20items\x20to\x20write.');export const SignerOrClockBaseSchema=z['object']({'name':NameSchema['describe']('Data\x20item\x20name.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20Used\x20to\x20specify\x20the\x20policy\x20write\x20permissions\x20and\x20rules\x20corresponding\x20to\x20this\x20Guard.')})['strict']()['describe']('Specify\x20data\x20items\x20by\x20name\x20and\x20ID.\x20ID\x20is\x20the\x20on-chain\x20timestamp\x20or\x20signer\x20ID\x20(depending\x20on\x20how\x20write_guard\x20specifies\x20the\x20ID\x20source).');export const SignerOrClockSchema=z['object']({'name':NameSchema['describe']('Data\x20item\x20name.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20Used\x20to\x20specify\x20the\x20policy\x20write\x20permissions\x20and\x20rules\x20corresponding\x20to\x20this\x20Guard.'),'data':SupportedValueSchema})['strict']()['describe']('Specify\x20data\x20items\x20by\x20name\x20and\x20data.\x20ID\x20is\x20the\x20on-chain\x20timestamp\x20or\x20signer\x20ID\x20(depending\x20on\x20how\x20write_guard\x20specifies\x20the\x20ID\x20source).');export const DataRemoveItemSchema=z['object']({'id':z['array'](RepositoryIdSchema)['describe']('Data\x20item\x20ID\x20list.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20Used\x20to\x20verify\x20permission\x20to\x20delete\x20data.')})['strict']()['describe']('Delete\x20data\x20items\x20by\x20name\x20and\x20ID\x20list.');export const PoliciesAddSetSchema=z['object']({'op':z['enum'](['add','set']),'policy':z['array'](PolicyRuleSchema)['describe']('Policy\x20rule\x20list.')})['strict']()['describe']('Add\x20or\x20set\x20policy\x20rules.');export const PoliciesRemoveSchema=z['object']({'op':z['literal']('remove'),'policy':z['array'](NameSchema)['describe']('Policy\x20rule\x20name\x20list.')})['strict']()['describe']('Remove\x20policy\x20rules.');export const PoliciesClearSchema=z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20policy\x20rules.');export const PoliciesSchema=z['discriminatedUnion']('op',[PoliciesAddSetSchema,PoliciesRemoveSchema,PoliciesClearSchema]);export const DataAddWithItemsSchema=z['object']({'name':NameSchema['describe']('Data\x20item\x20name.\x20Must\x20match\x20the\x20name\x20in\x20PolicyRule.'),'items':z['array'](RepDataItemSchema)['describe']('List\x20of\x20data\x20items\x20to\x20add.\x20Each\x20data\x20item\x20contains\x20name,\x20ID,\x20and\x20data\x20parts,\x20where\x20name\x20and\x20ID\x20together\x20form\x20the\x20unique\x20key\x20for\x20the\x20data.')})['strict']()['describe']('Add\x20data\x20by\x20name\x20and\x20data\x20item\x20list.\x20Each\x20data\x20item\x20contains\x20name,\x20ID,\x20and\x20data\x20parts,\x20where\x20name\x20and\x20ID\x20together\x20form\x20the\x20unique\x20key\x20for\x20the\x20data.');export const DataAddSchema=z['union']([SignerOrClockSchema,DataAddWithItemsSchema]);export const DataRemoveSchema=z['union']([SignerOrClockBaseSchema,z['object']({'name':NameSchema['describe']('Data\x20item\x20name.\x20Must\x20match\x20the\x20name\x20in\x20PolicyRule.'),'items':z['array'](DataRemoveItemSchema)['describe']('List\x20of\x20data\x20items\x20to\x20delete.')})['strict']()]);export const CallRepository_DataSchema=z['object']({'object':WithPermissionObjectSchema,'description':DescriptionSchema['optional'](),'policies':PoliciesSchema['optional']()['describe']('Policy\x20list.\x20Used\x20to\x20define\x20data\x20item\x20write\x20permissions\x20and\x20rules,\x20as\x20well\x20as\x20data\x20item\x20read\x20permissions.'),'data_add':DataAddSchema['optional']()['describe']('Add\x20data\x20items'),'data_remove':DataRemoveSchema['optional']()['describe']('Delete\x20data\x20items'),'rewards':ObjectsSchema['optional']()['describe']('Reward\x20object\x20list.\x20Used\x20for\x20data\x20contribution\x20incentives.'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object.')})['strict']()['describe']('On-chain\x20Repository\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Repository.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.');export const CallRepository_InputSchema=z['object']({'data':CallRepository_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
@@ -227,6 +227,7 @@ export declare const CallReward_DataSchema: z.ZodObject<{
227
227
  type: "Fixed";
228
228
  }>]>;
229
229
  expiration_time: z.ZodOptional<z.ZodNumber>;
230
+ store_from_id: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodNull]>>;
230
231
  }, "strip", z.ZodTypeAny, {
231
232
  amount: {
232
233
  value: number;
@@ -247,6 +248,7 @@ export declare const CallReward_DataSchema: z.ZodObject<{
247
248
  };
248
249
  guard: string;
249
250
  expiration_time?: number | undefined;
251
+ store_from_id?: number | null | undefined;
250
252
  }, {
251
253
  amount: {
252
254
  value: number;
@@ -267,6 +269,7 @@ export declare const CallReward_DataSchema: z.ZodObject<{
267
269
  };
268
270
  guard: string;
269
271
  expiration_time?: number | undefined;
272
+ store_from_id?: number | null | undefined;
270
273
  }>, "many">>;
271
274
  guard_remove_expired: z.ZodOptional<z.ZodBoolean>;
272
275
  guard_expiration_time: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodNull]>>;
@@ -377,6 +380,7 @@ export declare const CallReward_DataSchema: z.ZodObject<{
377
380
  };
378
381
  guard: string;
379
382
  expiration_time?: number | undefined;
383
+ store_from_id?: number | null | undefined;
380
384
  }[] | undefined;
381
385
  guard_remove_expired?: boolean | undefined;
382
386
  guard_expiration_time?: number | null | undefined;
@@ -444,6 +448,7 @@ export declare const CallReward_DataSchema: z.ZodObject<{
444
448
  };
445
449
  guard: string;
446
450
  expiration_time?: number | undefined;
451
+ store_from_id?: number | null | undefined;
447
452
  }[] | undefined;
448
453
  guard_remove_expired?: boolean | undefined;
449
454
  guard_expiration_time?: number | null | undefined;
@@ -609,6 +614,7 @@ export declare const CallReward_InputSchema: z.ZodObject<{
609
614
  type: "Fixed";
610
615
  }>]>;
611
616
  expiration_time: z.ZodOptional<z.ZodNumber>;
617
+ store_from_id: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodNull]>>;
612
618
  }, "strip", z.ZodTypeAny, {
613
619
  amount: {
614
620
  value: number;
@@ -629,6 +635,7 @@ export declare const CallReward_InputSchema: z.ZodObject<{
629
635
  };
630
636
  guard: string;
631
637
  expiration_time?: number | undefined;
638
+ store_from_id?: number | null | undefined;
632
639
  }, {
633
640
  amount: {
634
641
  value: number;
@@ -649,6 +656,7 @@ export declare const CallReward_InputSchema: z.ZodObject<{
649
656
  };
650
657
  guard: string;
651
658
  expiration_time?: number | undefined;
659
+ store_from_id?: number | null | undefined;
652
660
  }>, "many">>;
653
661
  guard_remove_expired: z.ZodOptional<z.ZodBoolean>;
654
662
  guard_expiration_time: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodNull]>>;
@@ -759,6 +767,7 @@ export declare const CallReward_InputSchema: z.ZodObject<{
759
767
  };
760
768
  guard: string;
761
769
  expiration_time?: number | undefined;
770
+ store_from_id?: number | null | undefined;
762
771
  }[] | undefined;
763
772
  guard_remove_expired?: boolean | undefined;
764
773
  guard_expiration_time?: number | null | undefined;
@@ -826,6 +835,7 @@ export declare const CallReward_InputSchema: z.ZodObject<{
826
835
  };
827
836
  guard: string;
828
837
  expiration_time?: number | undefined;
838
+ store_from_id?: number | null | undefined;
829
839
  }[] | undefined;
830
840
  guard_remove_expired?: boolean | undefined;
831
841
  guard_expiration_time?: number | null | undefined;
@@ -1094,6 +1104,7 @@ export declare const CallReward_InputSchema: z.ZodObject<{
1094
1104
  };
1095
1105
  guard: string;
1096
1106
  expiration_time?: number | undefined;
1107
+ store_from_id?: number | null | undefined;
1097
1108
  }[] | undefined;
1098
1109
  guard_remove_expired?: boolean | undefined;
1099
1110
  guard_expiration_time?: number | null | undefined;
@@ -1197,6 +1208,7 @@ export declare const CallReward_InputSchema: z.ZodObject<{
1197
1208
  };
1198
1209
  guard: string;
1199
1210
  expiration_time?: number | undefined;
1211
+ store_from_id?: number | null | undefined;
1200
1212
  }[] | undefined;
1201
1213
  guard_remove_expired?: boolean | undefined;
1202
1214
  guard_expiration_time?: number | null | undefined;