@wowok/agent-mcp 2.6.8 → 2.7.0
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.
- package/README.md +0 -2
- package/dist/customer/customer-advice.js +1 -0
- package/dist/customer/info-puzzle.js +1 -0
- package/dist/customer/reminder-system.d.ts +1 -0
- package/dist/customer/reminder-system.js +20 -0
- package/dist/customer/types.d.ts +1 -0
- package/dist/examples/{insurance-machine-create-publish.json → insurance-machine-create.json} +9 -9
- package/dist/examples/insurance-service-allocators.json +55 -0
- package/dist/examples/machine-publish.json +30 -0
- package/dist/examples/rental-ziroom-service-create.json +12 -64
- package/dist/examples/retail-myshop-service-create.json +14 -64
- package/dist/examples/retail-myshop-service-customer-required.json +31 -0
- package/dist/examples/threebody-machine-create.json +9 -10
- package/dist/examples/threebody-service-allocators.json +3 -4
- package/dist/examples/travel-machine-create.json +9 -10
- package/dist/examples/travel-service-create.json +11 -79
- package/dist/harness/index.d.ts +6 -1
- package/dist/harness/index.js +4 -1
- package/dist/harness/plan.d.ts +13 -0
- package/dist/harness/plan.js +24 -0
- package/dist/harness/recover.js +2 -2
- package/dist/index.js +10 -0
- package/dist/knowledge/fund-layer.js +8 -4
- package/dist/project/context-assembly.d.ts +9 -0
- package/dist/project/context-assembly.js +122 -6
- package/dist/project/graph-builder.d.ts +6 -1
- package/dist/project/graph-builder.js +1 -1
- package/dist/project/handlers.d.ts +1 -0
- package/dist/project/handlers.js +22 -9
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/payment.d.ts +11 -11
- package/dist/schema/call/payment.js +5 -3
- package/dist/schema/call/semantic.js +10 -1
- package/dist/schema/call/service.d.ts +6 -6
- package/dist/schema/call/service.js +14 -3
- package/dist/schema/messenger/index.d.ts +171 -0
- package/dist/schema/messenger/index.js +5 -0
- package/dist/schema/operations.d.ts +11 -11
- package/dist/schema/project/index.d.ts +105 -0
- package/dist/schema/project/index.js +53 -0
- package/dist/schema/query/index.d.ts +571 -0
- package/dist/schema/query/index.js +42 -1
- package/dist/schema/sync-layer4.js +25 -4
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/messenger_operation.output.json +14 -0
- package/dist/schemas/messenger_operation.schema.json +18 -0
- package/dist/schemas/onchain_operations.schema.json +7 -8
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
- package/dist/schemas/onchain_operations_payment.schema.json +3 -4
- package/dist/schemas/onchain_operations_service.schema.json +3 -3
- package/dist/schemas/project_operation.output.json +79 -0
- package/dist/schemas/project_operation.schema.json +13 -0
- package/dist/schemas/query_toolkit.output.json +39 -1
- package/dist/schemas/wowok_buildin_info.output.json +132 -0
- package/dist/schemas/wowok_buildin_info.schema.json +14 -0
- package/dist/tools/handlers/onchain.js +94 -4
- package/dist/tools/index.js +3 -3
- package/package.json +2 -2
- package/dist/examples/insurance-service-allocators-publish.json +0 -56
|
@@ -180,15 +180,15 @@ export declare const CallPayment_CreateSchema: z.ZodObject<{
|
|
|
180
180
|
export declare const CallPayment_ReceiveSchema: z.ZodObject<{
|
|
181
181
|
object: z.ZodEffects<z.ZodString, string, string>;
|
|
182
182
|
receive: z.ZodLiteral<true>;
|
|
183
|
-
type_parameter: z.ZodString
|
|
183
|
+
type_parameter: z.ZodOptional<z.ZodString>;
|
|
184
184
|
}, "strict", z.ZodTypeAny, {
|
|
185
185
|
object: string;
|
|
186
|
-
type_parameter: string;
|
|
187
186
|
receive: true;
|
|
187
|
+
type_parameter?: string | undefined;
|
|
188
188
|
}, {
|
|
189
189
|
object: string;
|
|
190
|
-
type_parameter: string;
|
|
191
190
|
receive: true;
|
|
191
|
+
type_parameter?: string | undefined;
|
|
192
192
|
}>;
|
|
193
193
|
export declare const CallPayment_DataSchema: z.ZodUnion<[z.ZodObject<{
|
|
194
194
|
object: z.ZodObject<{
|
|
@@ -325,15 +325,15 @@ export declare const CallPayment_DataSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
325
325
|
}>, z.ZodObject<{
|
|
326
326
|
object: z.ZodEffects<z.ZodString, string, string>;
|
|
327
327
|
receive: z.ZodLiteral<true>;
|
|
328
|
-
type_parameter: z.ZodString
|
|
328
|
+
type_parameter: z.ZodOptional<z.ZodString>;
|
|
329
329
|
}, "strict", z.ZodTypeAny, {
|
|
330
330
|
object: string;
|
|
331
|
-
type_parameter: string;
|
|
332
331
|
receive: true;
|
|
332
|
+
type_parameter?: string | undefined;
|
|
333
333
|
}, {
|
|
334
334
|
object: string;
|
|
335
|
-
type_parameter: string;
|
|
336
335
|
receive: true;
|
|
336
|
+
type_parameter?: string | undefined;
|
|
337
337
|
}>]>;
|
|
338
338
|
export declare const CallPayment_InputSchema: z.ZodObject<{
|
|
339
339
|
data: z.ZodUnion<[z.ZodObject<{
|
|
@@ -471,15 +471,15 @@ export declare const CallPayment_InputSchema: z.ZodObject<{
|
|
|
471
471
|
}>, z.ZodObject<{
|
|
472
472
|
object: z.ZodEffects<z.ZodString, string, string>;
|
|
473
473
|
receive: z.ZodLiteral<true>;
|
|
474
|
-
type_parameter: z.ZodString
|
|
474
|
+
type_parameter: z.ZodOptional<z.ZodString>;
|
|
475
475
|
}, "strict", z.ZodTypeAny, {
|
|
476
476
|
object: string;
|
|
477
|
-
type_parameter: string;
|
|
478
477
|
receive: true;
|
|
478
|
+
type_parameter?: string | undefined;
|
|
479
479
|
}, {
|
|
480
480
|
object: string;
|
|
481
|
-
type_parameter: string;
|
|
482
481
|
receive: true;
|
|
482
|
+
type_parameter?: string | undefined;
|
|
483
483
|
}>]>;
|
|
484
484
|
env: z.ZodOptional<z.ZodObject<{
|
|
485
485
|
account: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
@@ -546,8 +546,8 @@ export declare const CallPayment_InputSchema: z.ZodObject<{
|
|
|
546
546
|
}[];
|
|
547
547
|
} | {
|
|
548
548
|
object: string;
|
|
549
|
-
type_parameter: string;
|
|
550
549
|
receive: true;
|
|
550
|
+
type_parameter?: string | undefined;
|
|
551
551
|
};
|
|
552
552
|
env?: {
|
|
553
553
|
account: string;
|
|
@@ -590,8 +590,8 @@ export declare const CallPayment_InputSchema: z.ZodObject<{
|
|
|
590
590
|
}[];
|
|
591
591
|
} | {
|
|
592
592
|
object: string;
|
|
593
|
-
type_parameter: string;
|
|
594
593
|
receive: true;
|
|
594
|
+
type_parameter?: string | undefined;
|
|
595
595
|
};
|
|
596
596
|
env?: {
|
|
597
597
|
no_cache?: boolean | undefined;
|
|
@@ -19,15 +19,17 @@ export const CallPayment_ReceiveSchema = z.object({
|
|
|
19
19
|
"but they are NOT spendable coins. This mode unwraps a CoinWrapper into actual coins in your wallet " +
|
|
20
20
|
"via payment::unwrap_to_myself. The caller must be the CoinWrapper's owner (the recipient " +
|
|
21
21
|
"specified in the Allocation's revenue split)."),
|
|
22
|
-
type_parameter: z.string().describe("Coin type of the CoinWrapper, e.g. '0x2::wow::WOW'. " +
|
|
23
|
-
"
|
|
22
|
+
type_parameter: z.string().optional().describe("Coin type of the CoinWrapper, e.g. '0x2::wow::WOW'. " +
|
|
23
|
+
"OPTIONAL: when omitted it is auto-derived from the CoinWrapper's own on-chain type " +
|
|
24
|
+
"(the inner T of `CoinWrapper<T>`), so {object, receive:true} alone unwraps to spendable coins. " +
|
|
25
|
+
"Only provide it explicitly when auto-derivation fails."),
|
|
24
26
|
}).strict().describe("Receive mode: unwrap a CoinWrapper to the caller's wallet. Use after Allocation's alloc_by_guard creates a Payment with your address as a revenue recipient. The CoinWrapper holds your share — call this to convert it to actual coins in your wallet.");
|
|
25
27
|
export const CallPayment_DataSchema = z.union([
|
|
26
28
|
CallPayment_CreateSchema,
|
|
27
29
|
CallPayment_ReceiveSchema,
|
|
28
30
|
]).describe("On-chain Payment operations. TWO modes:\n" +
|
|
29
31
|
"(1) CREATE: Set 'object' with {name, type_parameter, ...}, 'revenue', and 'info' to create a new Payment.\n" +
|
|
30
|
-
"(2) RECEIVE: Set {object: '<coinwrapper_id_or_name>', receive: true
|
|
32
|
+
"(2) RECEIVE: Set {object: '<coinwrapper_id_or_name>', receive: true} to unwrap a CoinWrapper to your wallet (type_parameter optional — auto-derived from the CoinWrapper's type).\n" +
|
|
31
33
|
"The 'object' field is CRITICAL and REQUIRED in both modes. STRING for receive (CoinWrapper ID/name), OBJECT for create.");
|
|
32
34
|
export const CallPayment_InputSchema = z.object({
|
|
33
35
|
data: CallPayment_DataSchema,
|
|
@@ -1133,7 +1133,15 @@ function buildCustomerAdvice(operation_type, data, safeResult) {
|
|
|
1133
1133
|
const hasArbitration = booleanFromSignals(data?.arb_name !== undefined || data?.arbitration !== undefined, data?.arb === false);
|
|
1134
1134
|
const hasCompensation = booleanFromSignals(data?.compensation_fund !== undefined || data?.compensation !== undefined, false);
|
|
1135
1135
|
const hasRefundPath = booleanFromSignals(data?.refund !== undefined, false);
|
|
1136
|
-
const hasMessenger = booleanFromSignals(data?.
|
|
1136
|
+
const hasMessenger = booleanFromSignals(data?.um !== undefined ||
|
|
1137
|
+
data?.um_name !== undefined ||
|
|
1138
|
+
data?.messenger !== undefined ||
|
|
1139
|
+
safeResult?.um !== undefined, data?.um === null || data?.um_name === null);
|
|
1140
|
+
const customerRequired = Array.isArray(data?.customer_required)
|
|
1141
|
+
? data.customer_required.filter((x) => typeof x === "string")
|
|
1142
|
+
: Array.isArray(safeResult?.customer_required)
|
|
1143
|
+
? safeResult.customer_required.filter((x) => typeof x === "string")
|
|
1144
|
+
: [];
|
|
1137
1145
|
const noArbitration = hasArbitration === false;
|
|
1138
1146
|
const noCompensation = hasCompensation === false;
|
|
1139
1147
|
const riskScore = typeof data?.risk_score === "number" ? data.risk_score
|
|
@@ -1166,6 +1174,7 @@ function buildCustomerAdvice(operation_type, data, safeResult) {
|
|
|
1166
1174
|
has_compensation: hasCompensation,
|
|
1167
1175
|
has_refund_path: hasRefundPath,
|
|
1168
1176
|
has_messenger: hasMessenger,
|
|
1177
|
+
customer_required: customerRequired,
|
|
1169
1178
|
risk_score: riskScore,
|
|
1170
1179
|
risk_level: riskLevel,
|
|
1171
1180
|
user_min_trust_score: userMinTrust,
|
|
@@ -1464,6 +1464,7 @@ export declare const CallService_DataSchema: z.ZodObject<{
|
|
|
1464
1464
|
} | {
|
|
1465
1465
|
coin: string;
|
|
1466
1466
|
} | undefined;
|
|
1467
|
+
customer_required?: string[] | undefined;
|
|
1467
1468
|
um?: string | null | undefined;
|
|
1468
1469
|
owner_receive?: {
|
|
1469
1470
|
received: {
|
|
@@ -1487,7 +1488,6 @@ export declare const CallService_DataSchema: z.ZodObject<{
|
|
|
1487
1488
|
} | {
|
|
1488
1489
|
op: "clear";
|
|
1489
1490
|
} | undefined;
|
|
1490
|
-
customer_required?: string[] | undefined;
|
|
1491
1491
|
location?: string | undefined;
|
|
1492
1492
|
compensation_fund_withdraw?: {
|
|
1493
1493
|
payment_info: {
|
|
@@ -1652,6 +1652,7 @@ export declare const CallService_DataSchema: z.ZodObject<{
|
|
|
1652
1652
|
} | {
|
|
1653
1653
|
coin: string;
|
|
1654
1654
|
} | undefined;
|
|
1655
|
+
customer_required?: string[] | undefined;
|
|
1655
1656
|
um?: string | null | undefined;
|
|
1656
1657
|
owner_receive?: {
|
|
1657
1658
|
received: {
|
|
@@ -1667,7 +1668,6 @@ export declare const CallService_DataSchema: z.ZodObject<{
|
|
|
1667
1668
|
content_raw?: any;
|
|
1668
1669
|
}[] | undefined;
|
|
1669
1670
|
repositories?: unknown;
|
|
1670
|
-
customer_required?: string[] | undefined;
|
|
1671
1671
|
location?: string | undefined;
|
|
1672
1672
|
compensation_fund_withdraw?: {
|
|
1673
1673
|
payment_info: {
|
|
@@ -2717,6 +2717,7 @@ export declare const CallService_InputSchema: z.ZodObject<{
|
|
|
2717
2717
|
} | {
|
|
2718
2718
|
coin: string;
|
|
2719
2719
|
} | undefined;
|
|
2720
|
+
customer_required?: string[] | undefined;
|
|
2720
2721
|
um?: string | null | undefined;
|
|
2721
2722
|
owner_receive?: {
|
|
2722
2723
|
received: {
|
|
@@ -2740,7 +2741,6 @@ export declare const CallService_InputSchema: z.ZodObject<{
|
|
|
2740
2741
|
} | {
|
|
2741
2742
|
op: "clear";
|
|
2742
2743
|
} | undefined;
|
|
2743
|
-
customer_required?: string[] | undefined;
|
|
2744
2744
|
location?: string | undefined;
|
|
2745
2745
|
compensation_fund_withdraw?: {
|
|
2746
2746
|
payment_info: {
|
|
@@ -2905,6 +2905,7 @@ export declare const CallService_InputSchema: z.ZodObject<{
|
|
|
2905
2905
|
} | {
|
|
2906
2906
|
coin: string;
|
|
2907
2907
|
} | undefined;
|
|
2908
|
+
customer_required?: string[] | undefined;
|
|
2908
2909
|
um?: string | null | undefined;
|
|
2909
2910
|
owner_receive?: {
|
|
2910
2911
|
received: {
|
|
@@ -2920,7 +2921,6 @@ export declare const CallService_InputSchema: z.ZodObject<{
|
|
|
2920
2921
|
content_raw?: any;
|
|
2921
2922
|
}[] | undefined;
|
|
2922
2923
|
repositories?: unknown;
|
|
2923
|
-
customer_required?: string[] | undefined;
|
|
2924
2924
|
location?: string | undefined;
|
|
2925
2925
|
compensation_fund_withdraw?: {
|
|
2926
2926
|
payment_info: {
|
|
@@ -3320,6 +3320,7 @@ export declare const CallService_InputSchema: z.ZodObject<{
|
|
|
3320
3320
|
} | {
|
|
3321
3321
|
coin: string;
|
|
3322
3322
|
} | undefined;
|
|
3323
|
+
customer_required?: string[] | undefined;
|
|
3323
3324
|
um?: string | null | undefined;
|
|
3324
3325
|
owner_receive?: {
|
|
3325
3326
|
received: {
|
|
@@ -3343,7 +3344,6 @@ export declare const CallService_InputSchema: z.ZodObject<{
|
|
|
3343
3344
|
} | {
|
|
3344
3345
|
op: "clear";
|
|
3345
3346
|
} | undefined;
|
|
3346
|
-
customer_required?: string[] | undefined;
|
|
3347
3347
|
location?: string | undefined;
|
|
3348
3348
|
compensation_fund_withdraw?: {
|
|
3349
3349
|
payment_info: {
|
|
@@ -3550,6 +3550,7 @@ export declare const CallService_InputSchema: z.ZodObject<{
|
|
|
3550
3550
|
} | {
|
|
3551
3551
|
coin: string;
|
|
3552
3552
|
} | undefined;
|
|
3553
|
+
customer_required?: string[] | undefined;
|
|
3553
3554
|
um?: string | null | undefined;
|
|
3554
3555
|
owner_receive?: {
|
|
3555
3556
|
received: {
|
|
@@ -3565,7 +3566,6 @@ export declare const CallService_InputSchema: z.ZodObject<{
|
|
|
3565
3566
|
content_raw?: any;
|
|
3566
3567
|
}[] | undefined;
|
|
3567
3568
|
repositories?: unknown;
|
|
3568
|
-
customer_required?: string[] | undefined;
|
|
3569
3569
|
location?: string | undefined;
|
|
3570
3570
|
compensation_fund_withdraw?: {
|
|
3571
3571
|
payment_info: {
|
|
@@ -31,7 +31,11 @@ export const DiscountSchema = z.object({
|
|
|
31
31
|
export const OrderNewSchema = z.object({
|
|
32
32
|
buy: BuySchema,
|
|
33
33
|
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."),
|
|
34
|
-
order_required_info: z.string().optional().describe("Contact object ID or WTS Proof object"
|
|
34
|
+
order_required_info: z.string().optional().describe("Contact object ID or WTS Proof object, recorded on the Order as proof that the order holder " +
|
|
35
|
+
"delivered the required private information (service.customer_required) to the merchant. " +
|
|
36
|
+
"FLOW: when a Service declares customer_required (e.g. phone/email/shipping_address), the order holder " +
|
|
37
|
+
"MUST send that private information to the Service's Contact (um) via end-to-end encrypted Messenger, " +
|
|
38
|
+
"then pass the Contact object ID or the generated WTS Proof here so the delivery is verifiable on-chain."),
|
|
35
39
|
transfer: AccountOrMark_AddressSchema.optional().describe("Set the new owner of the order. Requires order owner permission to set."),
|
|
36
40
|
namedNewOrder: NamedObjectSchema.optional().describe("RECOMMENDED: Set a local name for the newly created Order object. " +
|
|
37
41
|
"Without this, the Order is only referenceable by its on-chain address. " +
|
|
@@ -84,7 +88,10 @@ export const CallService_DataSchema = z.object({
|
|
|
84
88
|
machine: z.union([NameOrAddressSchema, z.null()]).optional().describe("Service Machine object ID or name. The Machine object must be in published state."),
|
|
85
89
|
discount: DiscountSchema.optional().describe("Issue discount."),
|
|
86
90
|
discount_destroy: z.array(NameOrAddressSchema).optional().describe("Destroy existing discount object ID list."),
|
|
87
|
-
customer_required: z.array(NotEmptyNameSchema).optional().describe("Customer required information. Such as phone, email, etc."
|
|
91
|
+
customer_required: z.array(NotEmptyNameSchema).optional().describe("Customer required information labels. Such as phone, email, shipping_address, etc. " +
|
|
92
|
+
"⚠️ HARD LINKAGE (SDK-enforced): if customer_required is set (non-empty), the Service MUST also bind a " +
|
|
93
|
+
"Contact via `um` — otherwise the customer's private information cannot be delivered through end-to-end " +
|
|
94
|
+
"encrypted Messenger (which routes to the Contact bound as um). Set `um` together with customer_required."),
|
|
88
95
|
order_allocators: z.union([AllocatorsSchema, z.null()]).optional().describe("Order fund allocator. Max 100 allocators (MAX_ALLOCATOR_COUNT). " +
|
|
89
96
|
"Each allocator has a guard (first matching guard wins) and a sharing list. " +
|
|
90
97
|
"Set to null to clear. " +
|
|
@@ -125,7 +132,11 @@ export const CallService_DataSchema = z.object({
|
|
|
125
132
|
"(all require pause + setting_lock_duration elapsed since pause)."),
|
|
126
133
|
compensation_fund_receive: ReceivedBalanceOrRecentlySchema.optional().describe("Receive order compensation funds from this Service object." + RECEIVE_FORMAT_BLOCK_BALANCE),
|
|
127
134
|
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this Service object and send them to the owner of its Permission object." + RECEIVE_FORMAT_BLOCK_OBJECTS),
|
|
128
|
-
um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object ID or name."
|
|
135
|
+
um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object ID or name — the Service's customer-service channel. " +
|
|
136
|
+
"This is the object that Messenger routes encrypted messages to for pre-order negotiation, " +
|
|
137
|
+
"private-info delivery (see customer_required), and post-sale support. " +
|
|
138
|
+
"⚠️ REQUIRED whenever customer_required is set: without um, the customer's private information " +
|
|
139
|
+
"has no channel to reach the merchant."),
|
|
129
140
|
pause: z.boolean().optional().describe("Whether to pause accepting new orders."),
|
|
130
141
|
publish: z.boolean().optional().describe("Whether to publish the Service. After publishing, customers can place orders. " +
|
|
131
142
|
"VERIFIED against Move source service.move + SDK service.ts (4-level immutability matrix):\n" +
|