@wowok/agent-mcp 2.6.1 → 2.6.4
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/customer-advice.d.ts +31 -0
- package/dist/customer/customer-advice.js +129 -0
- package/dist/customer/index.d.ts +2 -0
- package/dist/customer/index.js +2 -0
- package/dist/customer/info-puzzle.d.ts +9 -2
- package/dist/customer/info-puzzle.js +34 -7
- package/dist/customer/order-monitor.d.ts +2 -0
- package/dist/customer/order-monitor.js +3 -2
- package/dist/customer/post-purchase.d.ts +2 -0
- package/dist/customer/post-purchase.js +6 -5
- package/dist/customer/preorder-compare.d.ts +24 -0
- package/dist/customer/preorder-compare.js +34 -0
- package/dist/customer/reminder-system.d.ts +2 -0
- package/dist/customer/reminder-system.js +2 -1
- package/dist/customer/risk-assessment.js +30 -7
- package/dist/customer/types.d.ts +7 -0
- package/dist/examples/arbitration-dispute-create.json +41 -0
- package/dist/examples/arbitration-vote-weighted.json +35 -0
- package/dist/examples/arbitration-voting-guard-add.json +38 -0
- package/dist/examples/demand-present-service.json +33 -0
- package/dist/examples/gen-passport-verify-guard.json +48 -0
- package/dist/examples/guard-template-balance-check.json +59 -0
- package/dist/examples/guard-template-time-lock.json +60 -0
- package/dist/examples/insurance-guard-claim-timelock.json +75 -0
- package/dist/examples/insurance-guard-withdraw-allocation.json +96 -0
- package/dist/examples/insurance-machine-create-publish.json +75 -0
- package/dist/examples/insurance-service-allocators-publish.json +56 -0
- package/dist/examples/machine-multisig-threshold.json +86 -0
- package/dist/examples/machine-template-7node-rental.json +119 -0
- package/dist/examples/payment-scenario-bound.json +45 -0
- package/dist/examples/rental-ziroom-machine-create.json +149 -0
- package/dist/examples/rental-ziroom-permission-create.json +42 -0
- package/dist/examples/rental-ziroom-service-create.json +89 -0
- package/dist/examples/retail-adv-guard-customer-win-create.json +80 -0
- package/dist/examples/retail-adv-guard-messenger-proof-create.json +65 -0
- package/dist/examples/retail-adv-guard-reward-timeout-create.json +92 -0
- package/dist/examples/retail-adv-reward-guard-add.json +51 -0
- package/dist/examples/retail-myshop-allocation-activate.json +55 -0
- package/dist/examples/retail-myshop-arbitration-create.json +40 -0
- package/dist/examples/retail-myshop-contact-create.json +43 -0
- package/dist/examples/retail-myshop-order-create.json +56 -0
- package/dist/examples/retail-myshop-progress-operate.json +38 -0
- package/dist/examples/retail-myshop-reward-create.json +35 -0
- package/dist/examples/retail-myshop-service-create.json +88 -0
- package/dist/examples/service-discount-issue.json +46 -0
- package/dist/examples/threebody-guard-create.json +56 -0
- package/dist/examples/threebody-machine-create.json +72 -0
- package/dist/examples/threebody-permission-create.json +38 -0
- package/dist/examples/threebody-service-allocators.json +49 -0
- package/dist/examples/travel-guard-time-lock.json +69 -0
- package/dist/examples/travel-guard-weather-oracle.json +70 -0
- package/dist/examples/travel-machine-create.json +136 -0
- package/dist/examples/travel-repository-create.json +47 -0
- package/dist/examples/travel-service-create.json +102 -0
- package/dist/examples/travel-treasury-create.json +34 -0
- package/dist/examples/treasury-deposit.json +37 -0
- package/dist/examples/treasury-withdraw.json +38 -0
- package/dist/extensions/business-modules.d.ts +49 -0
- package/dist/extensions/business-modules.js +287 -0
- package/dist/extensions/capability-manifest.js +216 -29
- package/dist/extensions/constraint-registry.js +21 -19
- package/dist/extensions/metric-registry.js +14 -14
- package/dist/extensions/mode-evaluator.js +16 -16
- package/dist/extensions/modes.js +141 -49
- package/dist/extensions/registry.d.ts +16 -9
- package/dist/extensions/registry.js +132 -44
- package/dist/extensions/types.d.ts +2 -0
- package/dist/index.js +50 -0
- package/dist/knowledge/deployment-scanner.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +138 -0
- package/dist/knowledge/fund-layer.js +969 -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/guard-templates.d.ts +10 -0
- package/dist/knowledge/guard-templates.js +50 -0
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.js +2 -2
- 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-risk.js +4 -1
- package/dist/knowledge/machine-templates.js +4 -4
- package/dist/knowledge/progress-context.js +1 -1
- package/dist/knowledge/progress-ledger.js +3 -3
- package/dist/knowledge/progress-templates.js +1 -1
- package/dist/knowledge/progress-translation.js +1 -1
- 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/safety-rules.d.ts +83 -1
- package/dist/knowledge/safety-rules.js +166 -2
- package/dist/knowledge/scenario-modes.d.ts +1 -1
- package/dist/knowledge/scenario-modes.js +13 -11
- 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/knowledge/template-registry.d.ts +48 -0
- package/dist/knowledge/template-registry.js +341 -0
- package/dist/knowledge/tool-constraints.js +6 -6
- package/dist/knowledge/tools-reference.js +11 -8
- package/dist/participation/merchant-interest.d.ts +32 -0
- package/dist/participation/merchant-interest.js +100 -0
- package/dist/participation/radar-core.d.ts +104 -0
- package/dist/participation/radar-core.js +269 -0
- package/dist/project/context-assembly.js +8 -0
- 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 +1342 -0
- package/dist/project/evaluation.d.ts +36 -0
- package/dist/project/evaluation.js +734 -68
- package/dist/project/game-theory.d.ts +43 -0
- package/dist/project/game-theory.js +177 -0
- package/dist/project/graph-builder.js +7 -1
- package/dist/project/handlers.d.ts +137 -2
- package/dist/project/handlers.js +423 -51
- package/dist/project/intent-analyzer.d.ts +71 -0
- package/dist/project/intent-analyzer.js +149 -0
- package/dist/project/machine-nodes.d.ts +2 -0
- package/dist/project/machine-nodes.js +36 -0
- package/dist/project/merchant-guide.d.ts +165 -0
- package/dist/project/merchant-guide.js +264 -0
- package/dist/project/mode-actions.d.ts +199 -0
- package/dist/project/mode-actions.js +309 -0
- package/dist/project/participation-radar.d.ts +18 -0
- package/dist/project/participation-radar.js +428 -0
- package/dist/project/pipeline-actions.d.ts +101 -0
- package/dist/project/pipeline-actions.js +109 -0
- package/dist/project/semantic-graph.d.ts +95 -0
- package/dist/project/semantic-graph.js +245 -0
- package/dist/project/stage-gate.js +4 -4
- package/dist/schema/call/allocation.d.ts +11 -11
- package/dist/schema/call/allocation.js +13 -3
- package/dist/schema/call/arbitration.d.ts +21 -21
- package/dist/schema/call/arbitration.js +30 -9
- package/dist/schema/call/base.d.ts +2 -2
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +127 -127
- package/dist/schema/call/bridge.js +12 -12
- package/dist/schema/call/contact.d.ts +3 -3
- package/dist/schema/call/contact.js +2 -2
- package/dist/schema/call/demand.d.ts +3 -3
- package/dist/schema/call/demand.js +2 -2
- package/dist/schema/call/guard.d.ts +11 -11
- package/dist/schema/call/guard.js +2 -2
- package/dist/schema/call/machine.d.ts +2072 -679
- package/dist/schema/call/machine.js +51 -5
- package/dist/schema/call/order.d.ts +7 -7
- package/dist/schema/call/order.js +3 -6
- package/dist/schema/call/payment.d.ts +3 -3
- package/dist/schema/call/permission.d.ts +3 -3
- package/dist/schema/call/permission.js +2 -2
- package/dist/schema/call/personal.d.ts +337 -3
- package/dist/schema/call/personal.js +10 -0
- package/dist/schema/call/progress.d.ts +177 -9
- package/dist/schema/call/progress.js +7 -3
- package/dist/schema/call/proof.d.ts +6 -6
- package/dist/schema/call/repository.d.ts +3 -3
- package/dist/schema/call/repository.js +2 -2
- package/dist/schema/call/reward.d.ts +57 -57
- package/dist/schema/call/reward.js +3 -3
- package/dist/schema/call/semantic.js +48 -2
- package/dist/schema/call/service.d.ts +285 -113
- package/dist/schema/call/service.js +92 -28
- package/dist/schema/call/treasury.d.ts +57 -57
- 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/messenger/index.js +4 -1
- package/dist/schema/operations.d.ts +1318 -317
- package/dist/schema/operations.js +76 -7
- package/dist/schema/project/index.d.ts +5662 -164
- package/dist/schema/project/index.js +1136 -5
- package/dist/schema/query/index.d.ts +580 -19
- package/dist/schema/query/index.js +88 -36
- package/dist/schema/schema-query/index.d.ts +59 -3
- package/dist/schema/schema-query/index.js +45 -6
- package/dist/schema/trust/index.d.ts +1012 -6
- package/dist/schema/trust/index.js +212 -11
- 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 +77 -0
- package/dist/schema-query/index.d.ts +17 -1
- package/dist/schema-query/index.js +359 -3
- package/dist/schemas/account_operation.schema.json +1 -1
- package/dist/schemas/bridge_operation.schema.json +14 -7
- package/dist/schemas/guard2file.schema.json +2 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +2 -0
- package/dist/schemas/messenger_operation.schema.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 +255 -65
- package/dist/schemas/onchain_operations_allocation.schema.json +7 -6
- package/dist/schemas/onchain_operations_arbitration.schema.json +14 -10
- package/dist/schemas/onchain_operations_contact.schema.json +4 -3
- package/dist/schemas/onchain_operations_demand.schema.json +4 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +4 -2
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -0
- package/dist/schemas/onchain_operations_guard.schema.json +579 -1
- package/dist/schemas/onchain_operations_machine.schema.json +5 -4
- package/dist/schemas/onchain_operations_order.schema.json +7 -6
- package/dist/schemas/onchain_operations_payment.schema.json +2 -1
- package/dist/schemas/onchain_operations_permission.schema.json +3 -2
- package/dist/schemas/onchain_operations_personal.schema.json +37 -0
- package/dist/schemas/onchain_operations_progress.schema.json +91 -4
- package/dist/schemas/onchain_operations_proof.schema.json +2 -1
- package/dist/schemas/onchain_operations_repository.schema.json +4 -3
- package/dist/schemas/onchain_operations_reward.schema.json +7 -6
- package/dist/schemas/onchain_operations_service.schema.json +80 -19
- package/dist/schemas/onchain_operations_treasury.schema.json +5 -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 +3318 -57
- package/dist/schemas/project_operation.schema.json +728 -4
- package/dist/schemas/query_toolkit.output.json +16 -16
- package/dist/schemas/query_toolkit.schema.json +40 -3
- package/dist/schemas/schema_query.output.json +65 -2
- package/dist/schemas/schema_query.schema.json +31 -5
- package/dist/schemas/trust_score.output.json +392 -1
- package/dist/schemas/trust_score.schema.json +275 -1
- 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 +636 -6
- package/dist/tools/handlers/project.js +71 -2
- package/dist/tools/handlers/query.js +117 -2
- package/dist/tools/handlers/schema-query.js +65 -1
- package/dist/tools/handlers/trust.js +192 -6
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +229 -15
- package/dist/tools/wrap.js +194 -15
- package/package.json +2 -2
|
@@ -61,6 +61,29 @@ export const OnchainOperationsSchema = z.preprocess((input) => {
|
|
|
61
61
|
catch { }
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
+
if (obj.operation_type === 'guard' && obj.data && typeof obj.data === 'object'
|
|
65
|
+
&& !Array.isArray(obj.data)) {
|
|
66
|
+
const guardData = obj.data;
|
|
67
|
+
if (guardData.object && !guardData.namedNew) {
|
|
68
|
+
guardData.namedNew = guardData.object;
|
|
69
|
+
delete guardData.object;
|
|
70
|
+
}
|
|
71
|
+
if (Array.isArray(guardData.table)) {
|
|
72
|
+
for (const item of guardData.table) {
|
|
73
|
+
if (item && typeof item === 'object' && !Array.isArray(item)
|
|
74
|
+
&& 'object_type' in item) {
|
|
75
|
+
delete item.object_type;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (obj.data && typeof obj.data === 'object' && !Array.isArray(obj.data)) {
|
|
81
|
+
const d = obj.data;
|
|
82
|
+
if (d.submission !== undefined && obj.submission === undefined) {
|
|
83
|
+
obj.submission = d.submission;
|
|
84
|
+
delete d.submission;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
64
87
|
return obj;
|
|
65
88
|
}
|
|
66
89
|
return input;
|
|
@@ -128,7 +151,7 @@ export const OnchainOperationsSchema = z.preprocess((input) => {
|
|
|
128
151
|
operation_type: z.literal("guard"),
|
|
129
152
|
data: CallGuard_DataSchema,
|
|
130
153
|
env: CallEnvSchema.optional(),
|
|
131
|
-
}).strict().describe("🛡️ Guard Object: Create immutable programmable validation rules that return boolean results. Set 'namedNew' to name the new Guard. Use root.type='node' for direct node tree or root.type='file' to load from file. Use 'wowok_buildin_info' tool with query='guard instructions' for all available operations. NOTE for EntityLinker/EntityRegistrar queries: Add system addresses to the Guard table - ENTITY_LINKER_ADDRESS (0xaaa) for EntityLinker, ENTITY_REGISTRAR_ADDRESS (0xaab) for EntityRegistrar."),
|
|
154
|
+
}).strict().describe("🛡️ Guard Object: Create immutable programmable validation rules that return boolean results. Set 'namedNew' to name the new Guard (you may also use 'object' as an alias — both work). Use root.type='node' for direct node tree or root.type='file' to load from file. Use 'wowok_buildin_info' tool with query='guard instructions' for all available operations. NOTE for EntityLinker/EntityRegistrar queries: Add system addresses to the Guard table - ENTITY_LINKER_ADDRESS (0xaaa) for EntityLinker, ENTITY_REGISTRAR_ADDRESS (0xaab) for EntityRegistrar."),
|
|
132
155
|
z.object({
|
|
133
156
|
operation_type: z.literal("personal"),
|
|
134
157
|
data: CallPersonal_DataSchema,
|
|
@@ -252,19 +275,19 @@ export const OnchainTableDataSchema = z.preprocess((input) => {
|
|
|
252
275
|
z.object({
|
|
253
276
|
query_type: z.literal("onchain_table_item_permission_perm"),
|
|
254
277
|
parent: NameOrAddressSchema.describe("Parent Permission object ID"),
|
|
255
|
-
address:
|
|
278
|
+
address: AccountOrMark_AddressAISchema.describe("User address or Guard ID whose permissions to check. Supports string (name/address) or object form. LocalMark names are resolved automatically."),
|
|
256
279
|
no_cache: z.boolean().optional().describe("Set to true to bypass cache and fetch fresh on-chain data"),
|
|
257
280
|
network: EntrypointSchema.optional(),
|
|
258
281
|
}).strict().describe("Query a permission entry from a Permission object's perm table — checks what operations a user/guard is allowed to perform. Use to verify access rights. Returns: TableItem_PermissionPerm | undefined"),
|
|
259
282
|
z.object({
|
|
260
283
|
query_type: z.literal("onchain_table_item_entity_registrar"),
|
|
261
|
-
address:
|
|
284
|
+
address: AccountOrMark_AddressAISchema.describe("User address to look up in the global EntityRegistrar. Supports string (name/address) or object form. LocalMark names are resolved automatically."),
|
|
262
285
|
no_cache: z.boolean().optional().describe("Set to true to bypass cache and fetch fresh on-chain data"),
|
|
263
286
|
network: EntrypointSchema.optional(),
|
|
264
287
|
}).strict().describe("Query an entity's registration record from the global EntityRegistrar — verifies if an address is registered on the blockchain. Use to check registration status and details. Returns: TableItem_EntityRegistrar | undefined"),
|
|
265
288
|
z.object({
|
|
266
289
|
query_type: z.literal("onchain_table_item_entity_linker"),
|
|
267
|
-
address:
|
|
290
|
+
address: AccountOrMark_AddressAISchema.describe("Entity address whose community votes/endorsements to query. Supports string (name/address) or object form. LocalMark names are resolved automatically."),
|
|
268
291
|
no_cache: z.boolean().optional().describe("Set to true to bypass cache and fetch fresh on-chain data"),
|
|
269
292
|
network: EntrypointSchema.optional(),
|
|
270
293
|
}).strict().describe("Query community votes/endorsements for an entity from the global EntityLinker — shows how others have voted on this entity. Use to check reputation and community trust. Returns: TableItem_EntityLinker | undefined"),
|
|
@@ -348,6 +371,24 @@ export const WatchQueryOperationsSchema = z.preprocess((input) => {
|
|
|
348
371
|
catch { }
|
|
349
372
|
}
|
|
350
373
|
}
|
|
374
|
+
if (obj.query_type === 'account_balance' && obj.filter && typeof obj.filter === 'object') {
|
|
375
|
+
const f = obj.filter;
|
|
376
|
+
if (!obj.name_or_address) {
|
|
377
|
+
if (typeof f.name_or_address === 'string') {
|
|
378
|
+
obj.name_or_address = f.name_or_address;
|
|
379
|
+
}
|
|
380
|
+
else if (typeof f.name === 'string') {
|
|
381
|
+
obj.name_or_address = f.name;
|
|
382
|
+
}
|
|
383
|
+
else if (typeof f.address === 'string') {
|
|
384
|
+
obj.name_or_address = f.address;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
if (!obj.token_type && typeof f.token_type === 'string') {
|
|
388
|
+
obj.token_type = f.token_type;
|
|
389
|
+
}
|
|
390
|
+
delete obj.filter;
|
|
391
|
+
}
|
|
351
392
|
return obj;
|
|
352
393
|
}
|
|
353
394
|
return input;
|
|
@@ -370,15 +411,25 @@ export const WatchQueryOperationsSchema = z.preprocess((input) => {
|
|
|
370
411
|
}).strict().describe("Query cached token metadata — symbol, decimals, icon URL, description for tokens previously fetched from chain. Use to look up token info without an on-chain query. Returns: TokenTypeInfo[] (type, alias, name, symbol, decimals, iconUrl)"),
|
|
371
412
|
z.object({
|
|
372
413
|
query_type: z.literal("account_balance"),
|
|
373
|
-
name_or_address: NameOrAddressSchema.optional().describe("Account name or address
|
|
414
|
+
name_or_address: NameOrAddressSchema.optional().describe("Account name or address to query. " +
|
|
415
|
+
"Examples: \"my_account\", \"0xabc123...\", or \"\" for the default account. " +
|
|
416
|
+
"NOTE: This field is NOT named 'filter' — use 'name_or_address' directly. " +
|
|
417
|
+
"Defaults to '' (default account) if omitted."),
|
|
374
418
|
balance: z.boolean().optional().describe("Set to true to query total balance amount for the token type"),
|
|
375
419
|
coin: z.object({
|
|
376
420
|
cursor: z.union([z.string(), z.null()]).optional().describe("Pagination cursor for listing coin objects"),
|
|
377
421
|
limit: z.union([z.number(), z.null()]).optional().describe("Max coin objects per page"),
|
|
378
422
|
}).strict().optional().describe("Set to query paginated coin objects instead of balance. Use cursor/limit for pagination."),
|
|
379
|
-
token_type: TokenTypeSchema.optional().describe("Token type
|
|
423
|
+
token_type: TokenTypeSchema.optional().describe("Token type in Move format: 0x<package>::<module>::<struct>. " +
|
|
424
|
+
"Examples: \"0x2::wow::WOW\" (default, 9 decimals), \"0x2::sui::SUI\" (9 decimals). " +
|
|
425
|
+
"For custom tokens, use the full type string from the token's coin metadata. " +
|
|
426
|
+
"The Fund Processing Layer resolves precision from the official registry → cache → on-chain."),
|
|
380
427
|
network: EntrypointSchema.optional(),
|
|
381
|
-
}).strict().describe("Query an account's coin balance OR paginated coin objects.
|
|
428
|
+
}).strict().describe("Query an account's coin balance OR paginated coin objects. " +
|
|
429
|
+
"PARAMETERS: Use 'name_or_address' to specify the account (NOT 'filter'). " +
|
|
430
|
+
"Use balance=true for total amount, or coin={cursor,limit} to list individual coin objects. " +
|
|
431
|
+
"Use token_type to query non-default tokens (format: 0x<package>::<module>::<struct>). " +
|
|
432
|
+
"Returns: { address, balance? | coin? }"),
|
|
382
433
|
z.object({
|
|
383
434
|
query_type: z.literal("local_names"),
|
|
384
435
|
addresses: z.array(z.string()).describe("Array of addresses to look up local names for"),
|
|
@@ -431,6 +482,24 @@ export const WatchQueryOperationsSchema = z.preprocess((input) => {
|
|
|
431
482
|
no_cache: z.boolean().optional().describe("Set to true to bypass cache and fetch fresh on-chain data"),
|
|
432
483
|
network: EntrypointSchema.optional(),
|
|
433
484
|
}).strict().describe("FORENSICS TOOL — query all transactions sent by an address. WARNING: like onchain_object_history, this can lead to non-convergent queries. For AI context building, use assemble_context (extracts embedded history) or query_events (real-time transitions) instead. This tool is for auditing/user-activity profiling only. Returns: TransactionHistoryAnswer | undefined"),
|
|
485
|
+
z.object({
|
|
486
|
+
query_type: z.literal("token_value_convert"),
|
|
487
|
+
token_type: TokenTypeSchema.describe("Full token type in Move format: 0x<package>::<module>::<struct>. " +
|
|
488
|
+
"Examples: \"0x2::wow::WOW\" (9 decimals). The token's decimals drive the conversion — " +
|
|
489
|
+
"resolved from official registry → local cache → on-chain coin metadata."),
|
|
490
|
+
raw: z.union([z.string(), z.number()]).optional().describe("Raw smallest-unit value (u64, e.g. \"2200000000\") to convert TO a human unit value. " +
|
|
491
|
+
"Provide EXACTLY ONE of raw / unit."),
|
|
492
|
+
unit: z.union([z.string(), z.number()]).optional().describe("Human unit value (e.g. \"2.2\") to convert TO raw smallest units (u64). " +
|
|
493
|
+
"Provide EXACTLY ONE of raw / unit. Conversion is REFUSED when the token's " +
|
|
494
|
+
"decimals cannot be resolved (guessing would forge wrong on-chain values)."),
|
|
495
|
+
network: EntrypointSchema.optional(),
|
|
496
|
+
}).strict()
|
|
497
|
+
.describe("Convert between raw on-chain smallest units (u64) and human unit values, in EITHER direction. " +
|
|
498
|
+
"Provide EXACTLY ONE of raw / unit (handler-validated). " +
|
|
499
|
+
"raw → unit: \"2200000000\" → \"2.2\" (pass-through when precision unknown). " +
|
|
500
|
+
"unit → raw: \"2.2\" → \"2200000000\" (REFUSED when precision unknown — never guesses decimals). " +
|
|
501
|
+
"Use this before displaying chain values to users, and before entering amounts for on-chain operations. " +
|
|
502
|
+
"Returns: { token_type, symbol?, decimals?, precision_known, direction, input, output, error?, text }"),
|
|
434
503
|
]));
|
|
435
504
|
export const OnchainTableDataResultSchema = z.object({
|
|
436
505
|
result: z.union([
|