@wowok/agent-mcp 2.6.1 → 2.6.3
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/dist/customer/info-puzzle.d.ts +1 -1
- package/dist/customer/info-puzzle.js +4 -2
- package/dist/customer/risk-assessment.js +26 -4
- package/dist/customer/types.d.ts +2 -0
- package/dist/examples/guard-template-balance-check.json +38 -0
- package/dist/examples/guard-template-time-lock.json +39 -0
- package/dist/examples/machine-template-7node-rental.json +114 -0
- package/dist/examples/rental-ziroom-machine-create.json +137 -0
- package/dist/examples/rental-ziroom-permission-create.json +35 -0
- package/dist/examples/rental-ziroom-service-create.json +80 -0
- package/dist/examples/retail-myshop-service-create.json +88 -0
- package/dist/extensions/capability-manifest.js +24 -24
- package/dist/extensions/constraint-registry.js +18 -18
- package/dist/extensions/metric-registry.js +14 -14
- package/dist/extensions/mode-evaluator.js +16 -16
- package/dist/extensions/modes.js +131 -45
- package/dist/extensions/registry.d.ts +2 -0
- package/dist/extensions/registry.js +63 -30
- package/dist/extensions/types.d.ts +1 -0
- package/dist/index.js +50 -0
- package/dist/knowledge/deployment-scanner.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +72 -0
- package/dist/knowledge/fund-layer.js +420 -0
- package/dist/knowledge/guard-render.d.ts +57 -0
- package/dist/knowledge/guard-render.js +700 -0
- package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
- package/dist/knowledge/guard-submission-prompt.js +171 -0
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-render.d.ts +41 -0
- package/dist/knowledge/machine-render.js +565 -0
- package/dist/knowledge/machine-templates.js +4 -4
- package/dist/knowledge/reward-confirm.js +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.js +9 -9
- package/dist/knowledge/reward-templates.js +2 -2
- package/dist/knowledge/service-confirm.d.ts +1 -1
- package/dist/knowledge/service-confirm.js +3 -3
- package/dist/knowledge/service-context.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-risk.d.ts +1 -1
- package/dist/knowledge/service-risk.js +3 -3
- package/dist/knowledge/service-templates.js +2 -2
- package/dist/knowledge/service-translation.d.ts +1 -1
- package/dist/knowledge/service-translation.js +7 -7
- package/dist/project/deployment-bridge.js +6 -5
- package/dist/project/deployment-doc.js +5 -5
- package/dist/project/edit-planner.d.ts +123 -0
- package/dist/project/edit-planner.js +1371 -0
- package/dist/project/evaluation.js +314 -14
- package/dist/project/graph-builder.js +6 -1
- package/dist/project/handlers.d.ts +99 -2
- package/dist/project/handlers.js +358 -16
- package/dist/project/stage-gate.js +4 -4
- package/dist/schema/call/allocation.js +2 -2
- package/dist/schema/call/arbitration.js +19 -6
- package/dist/schema/call/contact.js +2 -2
- package/dist/schema/call/demand.js +2 -2
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/machine.d.ts +1975 -777
- package/dist/schema/call/machine.js +50 -4
- package/dist/schema/call/order.js +3 -6
- package/dist/schema/call/permission.js +2 -2
- package/dist/schema/call/repository.js +2 -2
- package/dist/schema/call/reward.js +3 -3
- package/dist/schema/call/semantic.js +7 -1
- package/dist/schema/call/service.d.ts +180 -8
- package/dist/schema/call/service.js +82 -27
- package/dist/schema/call/treasury.js +3 -3
- package/dist/schema/common/index.d.ts +2 -0
- package/dist/schema/common/index.js +46 -10
- package/dist/schema/local/index.js +5 -1
- package/dist/schema/operations.d.ts +755 -176
- package/dist/schema/operations.js +43 -7
- package/dist/schema/project/index.d.ts +969 -6
- package/dist/schema/project/index.js +268 -4
- package/dist/schema/query/index.d.ts +217 -0
- package/dist/schema/query/index.js +63 -33
- package/dist/schema/schema-query/index.d.ts +53 -3
- package/dist/schema/schema-query/index.js +17 -2
- package/dist/schema/utils/node-parser.js +13 -0
- package/dist/schema/utils/object-type-utils.d.ts +12 -0
- package/dist/schema/utils/object-type-utils.js +35 -0
- package/dist/schema/utils/permission-machine-check.d.ts +49 -0
- package/dist/schema/utils/permission-machine-check.js +121 -0
- package/dist/schema/utils/skills-recommendation.d.ts +2 -0
- package/dist/schema/utils/skills-recommendation.js +76 -0
- package/dist/schema-query/index.d.ts +14 -1
- package/dist/schema-query/index.js +104 -2
- package/dist/schemas/account_operation.schema.json +1 -1
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/onchain_events.output.json +1 -1
- package/dist/schemas/onchain_operations.output.json +2820 -0
- package/dist/schemas/onchain_operations.schema.json +115 -53
- package/dist/schemas/onchain_operations_allocation.schema.json +5 -5
- package/dist/schemas/onchain_operations_arbitration.schema.json +9 -7
- package/dist/schemas/onchain_operations_contact.schema.json +3 -3
- package/dist/schemas/onchain_operations_demand.schema.json +3 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +2 -2
- package/dist/schemas/onchain_operations_guard.schema.json +1 -1
- package/dist/schemas/onchain_operations_machine.schema.json +4 -4
- package/dist/schemas/onchain_operations_order.schema.json +3 -3
- package/dist/schemas/onchain_operations_payment.schema.json +1 -1
- package/dist/schemas/onchain_operations_permission.schema.json +2 -2
- package/dist/schemas/onchain_operations_progress.schema.json +1 -1
- package/dist/schemas/onchain_operations_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_repository.schema.json +3 -3
- package/dist/schemas/onchain_operations_reward.schema.json +6 -6
- package/dist/schemas/onchain_operations_service.schema.json +77 -17
- package/dist/schemas/onchain_operations_treasury.schema.json +4 -4
- package/dist/schemas/onchain_table_data.output.json +1 -1
- package/dist/schemas/onchain_table_data.schema.json +10 -9
- package/dist/schemas/project_operation.output.json +1026 -7
- package/dist/schemas/project_operation.schema.json +46 -4
- package/dist/schemas/query_toolkit.output.json +15 -15
- package/dist/schemas/query_toolkit.schema.json +3 -3
- package/dist/schemas/schema_query.output.json +64 -1
- package/dist/schemas/schema_query.schema.json +3 -2
- package/dist/schemas/wowok_buildin_info.output.json +81 -8
- package/dist/schemas/wowok_buildin_info.schema.json +46 -2
- package/dist/tools/handlers/onchain.js +571 -6
- package/dist/tools/handlers/project.js +25 -2
- package/dist/tools/handlers/schema-query.js +24 -1
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +177 -6
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { TypedPermissionObjectSchema, CoinParamSchema, NamedObjectSchema, SubmissionCallSchema, CallEnvSchema } from "./base.js";
|
|
3
3
|
import { AmountFromDepositGuardSchema, AmountFromWithdrawGuardSchema, PaymentInfoSchema } from "../query/index.js";
|
|
4
|
-
import { AccountOrMark_AddressSchema, DescriptionSchema, ReceivedBalanceOrRecentlySchema, ReceivedObjectsOrRecentlySchema, NameOrAddressSchema } from "../common/index.js";
|
|
4
|
+
import { AccountOrMark_AddressSchema, DescriptionSchema, ReceivedBalanceOrRecentlySchema, ReceivedObjectsOrRecentlySchema, NameOrAddressSchema, RECEIVE_FORMAT_BLOCK_OBJECTS, RECEIVE_FORMAT_BLOCK_BALANCE } from "../common/index.js";
|
|
5
5
|
import { BalanceTypeSchema } from "../common/index.js";
|
|
6
6
|
export const DepositSchema = z.object({
|
|
7
7
|
coin: CoinParamSchema.describe("Asset to deposit"),
|
|
@@ -56,12 +56,12 @@ export const ExternalWithdrawGuardSchema = z.discriminatedUnion("op", [
|
|
|
56
56
|
export const CallTreasury_DataSchema = z.object({
|
|
57
57
|
object: TypedPermissionObjectSchema,
|
|
58
58
|
description: DescriptionSchema.optional(),
|
|
59
|
-
receive: ReceivedBalanceOrRecentlySchema.optional().describe("Receive CoinWrapper objects received by
|
|
59
|
+
receive: ReceivedBalanceOrRecentlySchema.optional().describe("Receive CoinWrapper objects received by this Treasury object and deposit them into its balance." + RECEIVE_FORMAT_BLOCK_BALANCE),
|
|
60
60
|
deposit: DepositSchema.optional().describe("Deposit to Treasury object"),
|
|
61
61
|
withdraw: WithdrawSchema.optional().describe("Withdraw from Treasury object"),
|
|
62
62
|
external_deposit_guard: ExternalDepositGuardSchema.optional().describe("Set external deposit Guard for Treasury object"),
|
|
63
63
|
external_withdraw_guard: ExternalWithdrawGuardSchema.optional().describe("Set external withdrawal Guard for Treasury object"),
|
|
64
|
-
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."),
|
|
64
|
+
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this Treasury object and send them to the owner of its Permission object." + RECEIVE_FORMAT_BLOCK_OBJECTS),
|
|
65
65
|
um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object ID or name."),
|
|
66
66
|
}).strict().describe("On-chain Treasury operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, type_parameter, permission, ...} to create a Treasury. 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.");
|
|
67
67
|
export const CallTreasury_InputSchema = z.object({
|
|
@@ -715,6 +715,8 @@ export declare const ReceivedObjectsOrRecentlySchema: z.ZodUnion<[z.ZodArray<z.Z
|
|
|
715
715
|
balance: string | number;
|
|
716
716
|
token_type: string;
|
|
717
717
|
}>, z.ZodLiteral<"recently">]>;
|
|
718
|
+
export declare const RECEIVE_FORMAT_BLOCK_OBJECTS: string;
|
|
719
|
+
export declare const RECEIVE_FORMAT_BLOCK_BALANCE: string;
|
|
718
720
|
export declare const QueryReceivedResultSchema: z.ZodObject<{
|
|
719
721
|
result: z.ZodUnion<[z.ZodObject<{
|
|
720
722
|
balance: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
@@ -222,15 +222,18 @@ export const ObjectTypeSchema = z.enum([
|
|
|
222
222
|
WowObjectType.TableItem_AddressMark,
|
|
223
223
|
WowObjectType.TableItem_EntityRegistrar,
|
|
224
224
|
]).describe("Wowok object type");
|
|
225
|
-
export const BalanceTypeSchema = z.union([z.number(), z.string()]).describe("A coin/balance amount
|
|
226
|
-
"
|
|
227
|
-
"
|
|
228
|
-
"
|
|
229
|
-
"
|
|
230
|
-
"UNIT:
|
|
231
|
-
"
|
|
232
|
-
"
|
|
233
|
-
"
|
|
225
|
+
export const BalanceTypeSchema = z.union([z.number(), z.string()]).describe("A coin/balance amount. Accepts three formats: " +
|
|
226
|
+
"(1) DISPLAY FORMAT with token symbol: \"2.5WOW\", \"10USDC\", \"0.05SUI\" — " +
|
|
227
|
+
"auto-converted to smallest units via the Fund Processing Layer (token precision resolved " +
|
|
228
|
+
"from official registry → cache → on-chain). The symbol MUST match the token's type_parameter. " +
|
|
229
|
+
"(2) SMALLEST UNIT (numeric string): \"10000000000\" — used as-is, no conversion. " +
|
|
230
|
+
"(3) SMALLEST UNIT (number): 10000000000 — used as-is (loses precision above 2^53). " +
|
|
231
|
+
"PRECISION RULE: for values exceeding 2^53, ALWAYS use format (1) or (2) — JS numbers lose precision. " +
|
|
232
|
+
"Default token: WOW (9 decimals, 1 WOW = 10^9 MIST). " +
|
|
233
|
+
"For custom tokens: use display format with the token's symbol, or pass smallest units directly. " +
|
|
234
|
+
"MONEY CONFIRMATION: all monetary fields trigger user confirmation via the Fund Processing Layer. " +
|
|
235
|
+
"If multiple tokens share a symbol (ambiguity), specify the full type string in type_parameter. " +
|
|
236
|
+
"Examples: \"2.5WOW\" (display → 2500000000), 10000000000 (number, smallest unit), \"50000000000\" (string, smallest unit). " +
|
|
234
237
|
"Used for: Service.sale.price, Service.compensation_fund_add balance, Treasury.deposit, Arbitration.fee, Reward.amount, stock quantities.");
|
|
235
238
|
export const QueryIdSchema = z.number().int().min(0).describe("Query ID");
|
|
236
239
|
export const CacheExpireTypeSchema = z.union([z.number(), z.literal("INFINITE")]).describe("Cache expiration time type");
|
|
@@ -253,7 +256,18 @@ export const SupportedValueSchema = SupportedValueUserSchema.or(ValueContainerSc
|
|
|
253
256
|
export const GuardIdentifierSchema = z.number().int().min(0).max(255).describe("Identifier (0-255) for data lookup in Guard table.");
|
|
254
257
|
export const GuardTableItemBaseSchema = z.object({
|
|
255
258
|
identifier: GuardIdentifierSchema,
|
|
256
|
-
b_submission: z.boolean().describe("Whether
|
|
259
|
+
b_submission: z.boolean().describe("Whether this table item's value is submitted dynamically at Guard trigger time (alloc_by_guard call). " +
|
|
260
|
+
"\n\n" +
|
|
261
|
+
"true = value is submitted by the caller when triggering the Guard. " +
|
|
262
|
+
"Use for runtime-context-dependent values like order address, user address. " +
|
|
263
|
+
"The 'value' field is ignored when b_submission=true; the caller must provide it via submissions[]. " +
|
|
264
|
+
"\n\n" +
|
|
265
|
+
"false = value is static, set at Guard creation time. " +
|
|
266
|
+
"Use for values known when the Guard is created: expected node names, expected merchant address, expected service address. " +
|
|
267
|
+
"The 'value' field must be populated and will be stored on-chain permanently. " +
|
|
268
|
+
"\n\n" +
|
|
269
|
+
"Rule of thumb: if the value is the SAME for all future Guard triggers, use false. " +
|
|
270
|
+
"If the value DIFFERS per trigger (e.g., which order to release funds for), use true."),
|
|
257
271
|
value_type: ValueTypeUserSchema.describe("Type of the value stored in `value`. One of: Bool(0), Address(1), String(2), U8(3), U16(4), U32(5), U64(6), U128(7), U256(8), VecBool(9), VecAddress(10), VecString(11), VecU8(12), VecU16(13), VecU32(14), VecU64(15), VecU128(16), VecU256(17), VecVecU8(18). " +
|
|
258
272
|
"When value_type=Address (1), the `value` field accepts a hex address string, a LocalMark name, or an AccountOrMark_Address object — see `value` field description for details."),
|
|
259
273
|
value: SupportedValueUserSchema.optional().describe("The actual value data. Format depends on `value_type`:\n" +
|
|
@@ -363,6 +377,28 @@ export const ReceivedObjectsOrRecentlySchema = z.union([
|
|
|
363
377
|
ReceivedBalanceSchema,
|
|
364
378
|
z.literal("recently"),
|
|
365
379
|
]).describe("Specified received object records or all recently received object records");
|
|
380
|
+
export const RECEIVE_FORMAT_BLOCK_OBJECTS = "\n\nACCEPTED FORMATS (F-06 unified receive operation block):\n" +
|
|
381
|
+
"• 'recently' (string literal) — auto-query and receive ALL recently received objects.\n" +
|
|
382
|
+
" Use this for the common case: \"withdraw everything the object has received.\"\n" +
|
|
383
|
+
" Example: receive: 'recently'\n" +
|
|
384
|
+
"• ReceivedNormal[] (array) — explicit list of received objects to unwrap.\n" +
|
|
385
|
+
" Use this when you want to receive specific objects only (not all).\n" +
|
|
386
|
+
" Example: receive: [{id: '0xobj1', type: '0x2::coin::Coin<0x2::sui::SUI>'}]\n" +
|
|
387
|
+
"• ReceivedBalance ({token_type, balance, received: [{id, balance, payment}]}) —\n" +
|
|
388
|
+
" receive a balance record from a specific Payment/payer.\n" +
|
|
389
|
+
" Use this for precise balance targeting (advanced — usually after querying\n" +
|
|
390
|
+
" the object's received history via query_received).\n" +
|
|
391
|
+
" Example: receive: {token_type: '0x2::sui::SUI', balance: 1000000, received: [{id: '0xrec1', balance: 1000000, payment: '0xpay1'}]}\n" +
|
|
392
|
+
"ANTI-PATTERN: do NOT wrap in {result: ...} — pass the value directly.";
|
|
393
|
+
export const RECEIVE_FORMAT_BLOCK_BALANCE = "\n\nACCEPTED FORMATS (F-06 unified receive operation block):\n" +
|
|
394
|
+
"• 'recently' (string literal) — auto-query and receive ALL recently received balance.\n" +
|
|
395
|
+
" Use this for the common case: \"deposit all recently received coins into pending balance.\"\n" +
|
|
396
|
+
" Example: receive: 'recently'\n" +
|
|
397
|
+
"• ReceivedBalance ({token_type, balance, received: [{id, balance, payment}]}) —\n" +
|
|
398
|
+
" receive a specific balance record from a Payment/payer.\n" +
|
|
399
|
+
" Use this when targeting a specific received balance (advanced).\n" +
|
|
400
|
+
" Example: receive: {token_type: '0x2::sui::SUI', balance: 1000000, received: [{id: '0xrec1', balance: 1000000, payment: '0xpay1'}]}\n" +
|
|
401
|
+
"ANTI-PATTERN: do NOT wrap in {result: ...} — pass the value directly.";
|
|
366
402
|
export const QueryReceivedResultSchema = z.object({
|
|
367
403
|
result: z.union([
|
|
368
404
|
ReceivedBalanceSchema,
|
|
@@ -568,7 +568,11 @@ export const AccountOperationSchema = z
|
|
|
568
568
|
})
|
|
569
569
|
.strict()
|
|
570
570
|
.refine((data) => Object.keys(data).length > 0, "At least one operation (gen/faucet/suspend/resume/rename/swap_name/transfer/get/signData/messenger) must be specified")
|
|
571
|
-
.describe("Account operations
|
|
571
|
+
.describe("Account operations (mutations only: gen/faucet/suspend/resume/rename/swap_name/transfer/get/signData/messenger). " +
|
|
572
|
+
"Parameters MUST be wrapped in the operation type property (e.g. {transfer: {...}}, NOT {amount: ...}). Unwrapped parameters are rejected. " +
|
|
573
|
+
"TO LIST ALL ACCOUNTS: use the query_toolkit tool with query_type='account_list' (returns name, address, suspended status, messenger status for all local accounts). " +
|
|
574
|
+
"This separation follows CQRS: account_operation = mutations, query_toolkit = queries. " +
|
|
575
|
+
"Common workflow after MCP restart: (1) query_toolkit query_type='account_list' to see all accounts, (2) account_operation with the appropriate mutation.");
|
|
572
576
|
export const AccountOperationResultSchema = z
|
|
573
577
|
.object({
|
|
574
578
|
gen: z
|