wowok_agent 1.6.6 → 2.1.8
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.
Potentially problematic release.
This version of wowok_agent might be problematic. Click here for more details.
- package/README.md +20 -40
- package/dist/index.d.ts +13528 -27
- package/dist/index.js +1026 -27
- package/dist/schema/call/allocation.d.ts +1370 -0
- package/dist/schema/call/allocation.js +27 -0
- package/dist/schema/call/arbitration.d.ts +1902 -0
- package/dist/schema/call/arbitration.js +106 -0
- package/dist/schema/call/base.d.ts +6381 -0
- package/dist/schema/call/base.js +152 -0
- package/dist/schema/call/contact.d.ts +898 -0
- package/dist/schema/call/contact.js +41 -0
- package/dist/schema/call/demand.d.ts +1193 -0
- package/dist/schema/call/demand.js +51 -0
- package/dist/schema/call/guard.d.ts +819 -0
- package/dist/schema/call/guard.js +67 -0
- package/dist/schema/call/handler.d.ts +80 -0
- package/dist/schema/call/handler.js +177 -0
- package/dist/schema/call/index.d.ts +18 -0
- package/dist/schema/call/index.js +19 -0
- package/dist/schema/call/machine.d.ts +3906 -0
- package/dist/schema/call/machine.js +164 -0
- package/dist/schema/call/order.d.ts +994 -0
- package/dist/schema/call/order.js +39 -0
- package/dist/schema/call/payment.d.ts +408 -0
- package/dist/schema/call/payment.js +20 -0
- package/dist/schema/call/permission.d.ts +2945 -0
- package/dist/schema/call/permission.js +118 -0
- package/dist/schema/call/personal.d.ts +1498 -0
- package/dist/schema/call/personal.js +81 -0
- package/dist/schema/call/progress.d.ts +847 -0
- package/dist/schema/call/progress.js +37 -0
- package/dist/schema/call/proof.d.ts +328 -0
- package/dist/schema/call/proof.js +27 -0
- package/dist/schema/call/repository.d.ts +2220 -0
- package/dist/schema/call/repository.js +85 -0
- package/dist/schema/call/reward.d.ts +1178 -0
- package/dist/schema/call/reward.js +46 -0
- package/dist/schema/call/service.d.ts +3534 -0
- package/dist/schema/call/service.js +87 -0
- package/dist/schema/call/treasury.d.ts +2399 -0
- package/dist/schema/call/treasury.js +76 -0
- package/dist/schema/common/index.d.ts +623 -0
- package/dist/schema/common/index.js +331 -0
- package/dist/schema/index.d.ts +7 -0
- package/dist/schema/index.js +8 -0
- package/dist/schema/local/index.d.ts +7824 -0
- package/dist/schema/local/index.js +913 -0
- package/dist/schema/local/wip.d.ts +781 -0
- package/dist/schema/local/wip.js +229 -0
- package/dist/schema/messenger/index.d.ts +3624 -0
- package/dist/schema/messenger/index.js +407 -0
- package/dist/schema/query/index.d.ts +27176 -0
- package/dist/schema/query/index.js +1313 -0
- package/dist/schema/utils/guard-parser.d.ts +20 -0
- package/dist/schema/utils/guard-parser.js +410 -0
- package/dist/schema/utils/guard-query-utils.d.ts +5 -0
- package/dist/schema/utils/guard-query-utils.js +22 -0
- package/dist/schema/utils/node-parser.d.ts +59 -0
- package/dist/schema/utils/node-parser.js +382 -0
- package/dist/schema/utils/permission-index-utils.d.ts +2 -0
- package/dist/schema/utils/permission-index-utils.js +10 -0
- package/package.json +31 -49
- package/LICENSE +0 -201
- package/dist/call/arbitration.d.ts +0 -57
- package/dist/call/arbitration.d.ts.map +0 -1
- package/dist/call/arbitration.js +0 -245
- package/dist/call/arbitration.js.map +0 -1
- package/dist/call/base.d.ts +0 -85
- package/dist/call/base.d.ts.map +0 -1
- package/dist/call/base.js +0 -231
- package/dist/call/base.js.map +0 -1
- package/dist/call/call.d.ts +0 -95
- package/dist/call/call.d.ts.map +0 -1
- package/dist/call/call.js +0 -149
- package/dist/call/call.js.map +0 -1
- package/dist/call/demand.d.ts +0 -46
- package/dist/call/demand.d.ts.map +0 -1
- package/dist/call/demand.js +0 -201
- package/dist/call/demand.js.map +0 -1
- package/dist/call/guard.d.ts +0 -53
- package/dist/call/guard.d.ts.map +0 -1
- package/dist/call/guard.js +0 -386
- package/dist/call/guard.js.map +0 -1
- package/dist/call/machine.d.ts +0 -97
- package/dist/call/machine.d.ts.map +0 -1
- package/dist/call/machine.js +0 -342
- package/dist/call/machine.js.map +0 -1
- package/dist/call/object_permission.d.ts +0 -14
- package/dist/call/object_permission.d.ts.map +0 -1
- package/dist/call/object_permission.js +0 -59
- package/dist/call/object_permission.js.map +0 -1
- package/dist/call/permission.d.ts +0 -63
- package/dist/call/permission.d.ts.map +0 -1
- package/dist/call/permission.js +0 -137
- package/dist/call/permission.js.map +0 -1
- package/dist/call/personal.d.ts +0 -47
- package/dist/call/personal.d.ts.map +0 -1
- package/dist/call/personal.js +0 -119
- package/dist/call/personal.js.map +0 -1
- package/dist/call/repository.d.ts +0 -117
- package/dist/call/repository.d.ts.map +0 -1
- package/dist/call/repository.js +0 -408
- package/dist/call/repository.js.map +0 -1
- package/dist/call/service.d.ts +0 -115
- package/dist/call/service.d.ts.map +0 -1
- package/dist/call/service.js +0 -550
- package/dist/call/service.js.map +0 -1
- package/dist/call/treasury.d.ts +0 -46
- package/dist/call/treasury.d.ts.map +0 -1
- package/dist/call/treasury.js +0 -222
- package/dist/call/treasury.js.map +0 -1
- package/dist/common.d.ts +0 -12
- package/dist/common.d.ts.map +0 -1
- package/dist/common.js +0 -71
- package/dist/common.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/local/.d.ts +0 -20
- package/dist/local/.d.ts.map +0 -1
- package/dist/local/.js +0 -76
- package/dist/local/.js.map +0 -1
- package/dist/local/account.d.ts +0 -42
- package/dist/local/account.d.ts.map +0 -1
- package/dist/local/account.js +0 -335
- package/dist/local/account.js.map +0 -1
- package/dist/local/cache.d.ts +0 -32
- package/dist/local/cache.d.ts.map +0 -1
- package/dist/local/cache.js +0 -77
- package/dist/local/cache.js.map +0 -1
- package/dist/local/coin.d.ts +0 -22
- package/dist/local/coin.d.ts.map +0 -1
- package/dist/local/coin.js +0 -123
- package/dist/local/coin.js.map +0 -1
- package/dist/local/config.d.ts +0 -20
- package/dist/local/config.d.ts.map +0 -1
- package/dist/local/config.js +0 -75
- package/dist/local/config.js.map +0 -1
- package/dist/local/index.d.ts +0 -110
- package/dist/local/index.d.ts.map +0 -1
- package/dist/local/index.js +0 -122
- package/dist/local/index.js.map +0 -1
- package/dist/local/local.d.ts +0 -55
- package/dist/local/local.d.ts.map +0 -1
- package/dist/local/local.js +0 -248
- package/dist/local/local.js.map +0 -1
- package/dist/query/events.d.ts +0 -65
- package/dist/query/events.d.ts.map +0 -1
- package/dist/query/events.js +0 -75
- package/dist/query/events.js.map +0 -1
- package/dist/query/objects.d.ts +0 -346
- package/dist/query/objects.d.ts.map +0 -1
- package/dist/query/objects.js +0 -472
- package/dist/query/objects.js.map +0 -1
- package/dist/query/permission.d.ts +0 -15
- package/dist/query/permission.d.ts.map +0 -1
- package/dist/query/permission.js +0 -45
- package/dist/query/permission.js.map +0 -1
- package/dist/query/received.d.ts +0 -16
- package/dist/query/received.d.ts.map +0 -1
- package/dist/query/received.js +0 -16
- package/dist/query/received.js.map +0 -1
- package/dist/schema/call.d.ts +0 -13005
- package/dist/schema/call.d.ts.map +0 -1
- package/dist/schema/call.js +0 -997
- package/dist/schema/call.js.map +0 -1
- package/dist/schema/const.d.ts +0 -254
- package/dist/schema/const.d.ts.map +0 -1
- package/dist/schema/const.js +0 -305
- package/dist/schema/const.js.map +0 -1
- package/dist/schema/local.d.ts +0 -702
- package/dist/schema/local.d.ts.map +0 -1
- package/dist/schema/local.js +0 -150
- package/dist/schema/local.js.map +0 -1
- package/dist/schema/query.d.ts +0 -1465
- package/dist/schema/query.d.ts.map +0 -1
- package/dist/schema/query.js +0 -224
- package/dist/schema/query.js.map +0 -1
- package/dist/schema/util.d.ts +0 -71
- package/dist/schema/util.d.ts.map +0 -1
- package/dist/schema/util.js +0 -139
- package/dist/schema/util.js.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
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 {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 object ID or name. The 'object' field is CRITICAL and REQUIRED in both cases.");
|
|
81
|
+
export const CallRepository_InputSchema = z.object({
|
|
82
|
+
data: CallRepository_DataSchema,
|
|
83
|
+
env: CallEnvSchema.optional(),
|
|
84
|
+
submission: SubmissionCallSchema.optional(),
|
|
85
|
+
}).strict();
|