@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
|
@@ -40,11 +40,12 @@ export const RecipientSchema = z.union([
|
|
|
40
40
|
z.object({ GuardIdentifier: GuardIdentifierSchema }).describe("Guard verified recipient ID. Get recipient ID from specified data index in Guard table. The ID must be of address type."),
|
|
41
41
|
z.object({ Entity: AccountOrMark_AddressSchema }).describe("Static address resolved via LocalMark. " +
|
|
42
42
|
"Format: {Entity: {name_or_address: 'mark_name'}} — NOTE: Entity is an OBJECT with name_or_address field, NOT a bare string."),
|
|
43
|
-
z.object({ Signer: z.literal("signer") }).describe("Current transaction signer
|
|
43
|
+
z.object({ Signer: z.literal("signer") }).describe("Current transaction signer (tx_context::sender) at the time of the alloc() call. " +
|
|
44
|
+
"For refunds, the Order owner must call alloc_by_guard themselves to receive the funds."),
|
|
44
45
|
]).describe("Recipient ID. Three forms:\n" +
|
|
45
|
-
" - {GuardIdentifier: u8} — resolved from Passport at
|
|
46
|
-
" - {Entity: {name_or_address: 'mark_name'}} — static address via LocalMark (recommended)\n" +
|
|
47
|
-
" - {Signer: 'signer'} — transaction sender (e.g. self-refund)");
|
|
46
|
+
" - {GuardIdentifier: u8} — DYNAMIC address resolved from Passport at alloc() time\n" +
|
|
47
|
+
" - {Entity: {name_or_address: 'mark_name'}} — FIXED static address via LocalMark (recommended)\n" +
|
|
48
|
+
" - {Signer: 'signer'} — transaction sender at alloc() time (e.g. self-refund; customer must call alloc_by_guard themselves)");
|
|
48
49
|
export const RecordsInEntitySchema = z.object({
|
|
49
50
|
name: z.string().describe("Record name"),
|
|
50
51
|
value_type: ValueTypeSchema.describe("Value type"),
|
|
@@ -120,8 +121,11 @@ export const ServiceSaleSchema = z.object({
|
|
|
120
121
|
wip: z.string().describe("WIP file URL. EMPTY string \"\" skips verification (TESTING ONLY). " +
|
|
121
122
|
"Production MUST use a real HTTP URL pointing to a .wip file generated by the wip_file tool. " +
|
|
122
123
|
"Example: \"https://cdn.example.com/products/phone_v1.wip\""),
|
|
123
|
-
wip_hash: z.string().describe("
|
|
124
|
-
"
|
|
124
|
+
wip_hash: z.string().describe("SHA-256 hash (hex string) of the sale's WIP file, committed on-chain by the merchant. " +
|
|
125
|
+
"BUY RULE: if this is NON-EMPTY, the buyer MUST pass this exact value as wip_hash when creating an order " +
|
|
126
|
+
"(ServiceBuyItem.wip_hash) — NEVER use \"\". Pinning the on-chain hash prevents the merchant from replacing " +
|
|
127
|
+
"the WIP file (a legitimate update) between the buyer's view and order placement, ensuring 'what you see is " +
|
|
128
|
+
"what you get'. EMPTY means no hash was committed (TESTING ONLY, no delivery-integrity guarantee)."),
|
|
125
129
|
}).describe("Service sale");
|
|
126
130
|
export const PurchasedItemSchema = z.object({
|
|
127
131
|
name: LongNameSchema.describe("Name of the product or service"),
|
|
@@ -227,15 +231,20 @@ export const AllocationModeSchema = z.union([
|
|
|
227
231
|
"Use Surplus to capture remainder (e.g., platform fee + host gets rest). " +
|
|
228
232
|
"Accepts string ('Amount'/'Rate'/'Surplus', recommended) or number (0/1/2).");
|
|
229
233
|
export const AllocationSharingSchema = z.object({
|
|
230
|
-
who: RecipientSchema.describe("Recipient of this allocation. Three forms:\n" +
|
|
231
|
-
"• { GuardIdentifier: u8 } — resolved from Passport at
|
|
234
|
+
who: RecipientSchema.describe("Recipient of this allocation. Three forms — each resolves the address at a DIFFERENT time:\n" +
|
|
235
|
+
"• { GuardIdentifier: u8 } — DYNAMIC address resolved from Passport at alloc() time (contract calls passport::submission_get). " +
|
|
232
236
|
"Use 0 for Order owner in Service-integrated mode (Customer who created the Order). " +
|
|
233
237
|
"The identifier must match a Guard table entry with b_submission=true. " +
|
|
234
|
-
"If Passport has no matching submission, contract aborts with E_VERIFY_FAILED
|
|
235
|
-
"
|
|
236
|
-
"
|
|
237
|
-
"
|
|
238
|
-
"Use when the recipient is
|
|
238
|
+
"If Passport has no matching submission, contract aborts with E_VERIFY_FAILED. " +
|
|
239
|
+
"Use when the recipient address is not known at config time and must be supplied via Guard submission data.\n" +
|
|
240
|
+
"• { Entity: { name_or_address: '...' } } — FIXED address resolved via LocalMark at SDK build time (passed to contract as a literal address). " +
|
|
241
|
+
"Use for known recipients (e.g., 'turo_host', or a Treasury object address). " +
|
|
242
|
+
"Use when the recipient is a stable, known address (e.g., operator receives rent, platform fee to treasury).\n" +
|
|
243
|
+
"• 'Signer' — the transaction sender at the time of the alloc() call (tx_context::sender). " +
|
|
244
|
+
"RESOLVED AT EXECUTION TIME, not at config time. " +
|
|
245
|
+
"For refunds: the customer (Order owner) must call alloc_by_guard THEMSELVES so that tx_context::sender resolves to THEIR address — " +
|
|
246
|
+
"if the operator calls alloc_by_guard, the operator becomes the recipient (Signer = operator), NOT the customer. " +
|
|
247
|
+
"Use when the recipient is whoever submits the allocation transaction (e.g., customer receives refund)."),
|
|
239
248
|
sharing: BalanceTypeSchema.describe("Allocation value. SEMANTICS DEPEND ON `mode`:\n" +
|
|
240
249
|
"• mode='Amount': absolute amount in smallest unit (e.g., '750000000' for 0.75 WOW, '250000000' for 0.25 WOW). " +
|
|
241
250
|
"Allocated first; sum of Amount items cached as `fix`.\n" +
|
|
@@ -259,11 +268,14 @@ export const AllocatorSchema = z.object({
|
|
|
259
268
|
fix: BalanceTypeSchema.optional().describe("OUTPUT-ONLY (query result). Cached sum of all Amount-mode `sharing` values in this Allocator. " +
|
|
260
269
|
"Computed by the contract during `allocator_add` — DO NOT set this field at creation. " +
|
|
261
270
|
"Used internally to compute `total_rates = balance - fix` for Rate allocation."),
|
|
262
|
-
max: z.union([BalanceTypeSchema, z.null()]).optional().describe("Maximum allocation cap (
|
|
271
|
+
max: z.union([BalanceTypeSchema, z.null()]).optional().describe("Maximum allocation cap (OPTIONAL — omit the field or set to null to disable the cap; do NOT set to 0 as that means a cap of zero). " +
|
|
272
|
+
"Passed through to the contract as Option<u64> via allocator_add(): when null/omitted the contract treats it as `none` (no cap); " +
|
|
273
|
+
"when set, the contract enforces it. Has THREE effects when set:\n" +
|
|
263
274
|
"1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n" +
|
|
264
275
|
"2. Rate execution: total_rates = max - fix (instead of balance - fix)\n" +
|
|
265
276
|
"3. Surplus execution: surplus_amount = max - alloced_amount (instead of balance - alloced_amount)\n" +
|
|
266
|
-
"Use when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount)."
|
|
277
|
+
"Use when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount). " +
|
|
278
|
+
"SDK pre-validates Amount sum <= max at build time to give actionable error messages before on-chain abort."),
|
|
267
279
|
}).describe("Fund allocator — a complete allocation strategy triggered by a Guard. " +
|
|
268
280
|
"Contains a sharing[] array where items can mix Amount/Rate/Surplus modes. " +
|
|
269
281
|
"When the Guard passes, the contract allocates funds in strict order: Amount → Rate → Surplus.");
|
|
@@ -519,7 +531,7 @@ export const GuardNodeSchema = z.lazy(() => z.discriminatedUnion('type', [
|
|
|
519
531
|
identifier: GuardIdentifierSchema,
|
|
520
532
|
convert_witness: WitnessTypeSchema.optional(),
|
|
521
533
|
}).strict().describe("The object to query from the Guard table."),
|
|
522
|
-
parameters: z.array(GuardNodeSchema).describe("Parameters required by the query (
|
|
534
|
+
parameters: z.array(GuardNodeSchema).optional().describe("Parameters required by the query. Optional — defaults to empty array []. Many queries (e.g. progress.current, order.service) take no parameters; for those, this field can be omitted."),
|
|
523
535
|
}).strict().describe(`Returns the result of executing a data query instruction on the specified object. The return type depends on the query being executed. SPECIAL NOTE for EntityLinker/EntityRegistrar queries: Use system addresses in the Guard table -${ENTITY_LINKER_ADDRESS} for EntityLinker queries, ${ENTITY_REGISTRAR_ADDRESS} for EntityRegistrar queries.`),
|
|
524
536
|
z.object({
|
|
525
537
|
type: z.literal('logic_as_u256_greater_or_equal'),
|
|
@@ -551,18 +563,12 @@ export const GuardNodeSchema = z.lazy(() => z.discriminatedUnion('type', [
|
|
|
551
563
|
}).strict().describe("Returns Bool. Computed by inverting the boolean value of the child node (true -> false, false -> true)."),
|
|
552
564
|
z.object({
|
|
553
565
|
type: z.literal('logic_and'),
|
|
554
|
-
nodes: z.array(GuardNodeSchema),
|
|
555
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} boolean nodes. Computed by performing logical AND on all child node values. Returns true if ALL are true, otherwise false.`)
|
|
556
|
-
.refine((v) => v.nodes.length >= 2 && v.nodes.length <= MAX_MULTI_OPERANDS, {
|
|
557
|
-
message: `logic_and requires 2-${MAX_MULTI_OPERANDS} child nodes. For a single condition, use the comparison node directly as root (e.g. logic_equal), do NOT wrap with logic_and.`,
|
|
558
|
-
}),
|
|
566
|
+
nodes: z.array(GuardNodeSchema).min(2, `logic_and requires at least 2 child nodes. For a single condition, use the comparison node directly as root (e.g. logic_equal), do NOT wrap with logic_and.`).max(MAX_MULTI_OPERANDS, `logic_and allows at most ${MAX_MULTI_OPERANDS} child nodes.`),
|
|
567
|
+
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} boolean nodes. Computed by performing logical AND on all child node values. Returns true if ALL are true, otherwise false.`),
|
|
559
568
|
z.object({
|
|
560
569
|
type: z.literal('logic_or'),
|
|
561
|
-
nodes: z.array(GuardNodeSchema),
|
|
562
|
-
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} boolean nodes. Computed by performing logical OR on all child node values. Returns true if ANY is true, otherwise false.`)
|
|
563
|
-
.refine((v) => v.nodes.length >= 2 && v.nodes.length <= MAX_MULTI_OPERANDS, {
|
|
564
|
-
message: `logic_or requires 2-${MAX_MULTI_OPERANDS} child nodes. For a single condition, use the comparison node directly as root (e.g. logic_equal), do NOT wrap with logic_or.`,
|
|
565
|
-
}),
|
|
570
|
+
nodes: z.array(GuardNodeSchema).min(2, `logic_or requires at least 2 child nodes. For a single condition, use the comparison node directly as root (e.g. logic_equal), do NOT wrap with logic_or.`).max(MAX_MULTI_OPERANDS, `logic_or allows at most ${MAX_MULTI_OPERANDS} child nodes.`),
|
|
571
|
+
}).strict().describe(`Returns Bool. Requires 2-${MAX_MULTI_OPERANDS} boolean nodes. Computed by performing logical OR on all child node values. Returns true if ANY is true, otherwise false.`),
|
|
566
572
|
z.object({
|
|
567
573
|
type: z.literal('logic_string_contains'),
|
|
568
574
|
nodes: z.array(GuardNodeSchema),
|
|
@@ -972,13 +978,21 @@ export const MachineForwardSchema = z.object({
|
|
|
972
978
|
"that progress is not modified by this forward. " +
|
|
973
979
|
"For target-node verification after transition, bind the Guard to the Allocator instead " +
|
|
974
980
|
"(allocation.alloc runs AFTER the state transition completes)."),
|
|
975
|
-
}).strict().
|
|
981
|
+
}).strict().refine((f) => (f.namedOperator !== null && f.namedOperator !== undefined) ||
|
|
982
|
+
(f.permissionIndex !== null && f.permissionIndex !== undefined), {
|
|
983
|
+
message: "One of 'namedOperator' or 'permissionIndex' must be provided for each forward. " +
|
|
984
|
+
"Use namedOperator:'' (empty string) when the ORDER OWNER operates this forward; " +
|
|
985
|
+
"use a permissionIndex (e.g. 1000) when the same operator acts for all orders.",
|
|
986
|
+
}).describe("Forward in Machine object");
|
|
976
987
|
export const MachineNodePairSchema = z.object({
|
|
977
988
|
prev_node: z.string().describe("Previous node name. Empty string '' means initial entry node (the first node in the workflow)."),
|
|
978
989
|
threshold: tolerantNumber.default(0).describe("Threshold to trigger node advancement. If total Forward weight is greater than or equal to threshold, node advancement is triggered."),
|
|
979
990
|
forwards: z.array(MachineForwardSchema).describe("Forward list — operations to ENTER THIS NODE from prev_node. " +
|
|
991
|
+
"SEMANTIC CLARIFICATION: forwards describe INCOMING transitions (how to ARRIVE at this node), " +
|
|
992
|
+
"NOT outgoing transitions. Think of each forward as an 'entry door' to this node. " +
|
|
980
993
|
"Example: pair {prev_node:'A', forwards:[{name:'Go'}]} means 'use Go to advance FROM A TO THIS NODE'. " +
|
|
981
994
|
"For initial node (prev_node=''), forwards are operations to enter this node from the start state. " +
|
|
995
|
+
"DIAGRAM: A --[Go]--> B means the pair belongs to node B (destination), with prev_node='A'. " +
|
|
982
996
|
"WARNING: forwards belong to the DESTINATION node's pair, NOT the source node. " +
|
|
983
997
|
"Placing a forward on the wrong pair will cause Progress to get stuck."),
|
|
984
998
|
}).strict().describe("Node pair in Machine object")
|
|
@@ -1294,11 +1308,12 @@ export const ConstantItemSchema = z.object({
|
|
|
1294
1308
|
description: z.string().describe('Description')
|
|
1295
1309
|
}).describe('Constant item');
|
|
1296
1310
|
export const PermissionInfoTypeSchema = z.object({
|
|
1297
|
-
index: z.number().describe('Permission index'),
|
|
1298
|
-
name: z.string().describe('
|
|
1299
|
-
description: z.string().describe('Description'),
|
|
1300
|
-
object_type: z.string().describe('Object type')
|
|
1301
|
-
|
|
1311
|
+
index: z.number().describe('Permission index (e.g. 315 for service.compensation_fund_deposit)'),
|
|
1312
|
+
name: z.string().describe('Permission name (e.g. "service.compensation_fund_deposit")'),
|
|
1313
|
+
description: z.string().describe('Description of what this permission allows'),
|
|
1314
|
+
object_type: z.string().describe('Object type this permission belongs to (e.g. "Service", "Arbitration")'),
|
|
1315
|
+
operation: z.optional(z.string()).describe('The SDK/MCP operation field name that triggers this permission check (e.g. "compensation_fund_add", "publish", "pause"). Undefined for permissions with no direct Call*_Data field (e.g. "*.new" permissions). Use this to answer: "What permission does operation X require?" by filtering with {operation: "compensation_fund_add"}.')
|
|
1316
|
+
}).describe('Permission info type — includes the operation field name that maps to this permission, so AI can look up required permissions by operation name.');
|
|
1302
1317
|
export const GuardInstructSchema = z.object({
|
|
1303
1318
|
name: z.string().describe('Name of the guard instruction'),
|
|
1304
1319
|
id: z.number().int().describe('ID of the guard instruction (OperatorType or ContextType)'),
|
|
@@ -1327,8 +1342,23 @@ export const PermissionFilterSchema = z.object({
|
|
|
1327
1342
|
objectType: z.optional(ObjectTypeSchema).describe('Object type filter'),
|
|
1328
1343
|
name: z.optional(z.string()).describe('Name filter'),
|
|
1329
1344
|
index: z.optional(PermissionIndexTypeSchema).describe('Index filter'),
|
|
1330
|
-
description: z.optional(z.string()).describe('Description filter')
|
|
1345
|
+
description: z.optional(z.string()).describe('Description filter'),
|
|
1346
|
+
operation: z.optional(z.string()).describe('Filter by SDK/MCP operation field name (e.g. "compensation_fund_add"). Returns only permissions triggered by this operation. Use this to answer: "What permission does operation X require?"')
|
|
1331
1347
|
}).describe('Permission filter');
|
|
1348
|
+
export const CommonMistakeInfoSchema = z.object({
|
|
1349
|
+
object_type: z.string().describe('The object type this mistake applies to (e.g. "Service", "Arbitration")'),
|
|
1350
|
+
operation: z.string().describe('The operation field name this mistake applies to (e.g. "compensation_fund_add", "voting_deadline")'),
|
|
1351
|
+
category: z.enum(['field_name', 'unit', 'value_range', 'workflow', 'timing']).describe('Category of the mistake: field_name (wrong field name), unit (wrong unit like seconds vs ms), value_range (wrong expected value), workflow (wrong operation order), timing (wrong time constraint)'),
|
|
1352
|
+
mistake: z.string().describe('Short description of the mistake'),
|
|
1353
|
+
correct_usage: z.string().describe('The correct usage pattern'),
|
|
1354
|
+
wrong_example: z.string().describe('Example of the wrong usage'),
|
|
1355
|
+
correct_example: z.string().describe('Example of the correct usage')
|
|
1356
|
+
}).describe('A known common mistake for an on-chain operation. Use this to proactively warn users before they submit a transaction.');
|
|
1357
|
+
export const CommonMistakeFilterSchema = z.object({
|
|
1358
|
+
object_type: z.optional(z.string()).describe('Filter by object type (e.g. "Service")'),
|
|
1359
|
+
operation: z.optional(z.string()).describe('Filter by operation field name (e.g. "compensation_fund_add")'),
|
|
1360
|
+
category: z.optional(z.enum(['field_name', 'unit', 'value_range', 'workflow', 'timing'])).describe('Filter by category (e.g. "field_name" for field-name mistakes, "unit" for unit mistakes)')
|
|
1361
|
+
}).describe('Filter for common mistakes. Use operation:"compensation_fund_add" to find mistakes for a specific operation.');
|
|
1332
1362
|
export const BridgeTokenInfoSchema = z.object({
|
|
1333
1363
|
tokenId: z.number().describe('On-chain token ID (mainnet: WBTC=1, ETH/WETH=2, USDC=3, USDT=4)'),
|
|
1334
1364
|
symbol: z.string().describe('Token symbol/abbreviation (ETH, WETH, WBTC, USDC, USDT)'),
|
|
@@ -1345,8 +1375,12 @@ export const ProtocolInfoQuerySchema = z.discriminatedUnion('info', [
|
|
|
1345
1375
|
}).strict().describe('Constants query'),
|
|
1346
1376
|
z.object({
|
|
1347
1377
|
info: z.literal('built-in permissions'),
|
|
1348
|
-
filter: z.optional(PermissionFilterSchema).describe('Filter for built-in permissions')
|
|
1349
|
-
}).strict().describe('Built-in permissions query'),
|
|
1378
|
+
filter: z.optional(PermissionFilterSchema).describe('Filter for built-in permissions. Use operation:"compensation_fund_add" to find which permission a specific operation requires.')
|
|
1379
|
+
}).strict().describe('Built-in permissions query. Each permission includes an optional "operation" field that maps to the SDK/MCP Call*_Data field name triggering it. Use this to answer: "What permission does operation X require?" — e.g. filter operation:"compensation_fund_add" returns permission index 315 (service.compensation_fund_deposit).'),
|
|
1380
|
+
z.object({
|
|
1381
|
+
info: z.literal('common mistakes'),
|
|
1382
|
+
filter: z.optional(CommonMistakeFilterSchema).describe('Filter for common mistakes. Use operation:"compensation_fund_add" to find mistakes for a specific operation, or category:"field_name" for all field-name mistakes.')
|
|
1383
|
+
}).strict().describe('Common mistakes query. Returns known field-name, unit, value-range, workflow, and timing pitfalls for on-chain operations. Use this to proactively warn users before submitting a transaction. Example: query operation:"compensation_fund_add" to learn about the {amount} vs {balance} field name mistake.'),
|
|
1350
1384
|
z.object({
|
|
1351
1385
|
info: z.literal('guard instructions'),
|
|
1352
1386
|
filter: z.optional(GuardInstructFilterOptionsSchema).describe('Filter for guard instructions')
|
|
@@ -1371,7 +1405,11 @@ export const ProtocolInfoResultWrappedSchema = z.discriminatedUnion('info', [
|
|
|
1371
1405
|
}),
|
|
1372
1406
|
z.object({
|
|
1373
1407
|
info: z.literal('built-in permissions'),
|
|
1374
|
-
result: z.array(PermissionInfoTypeSchema).describe('Built-in permissions result')
|
|
1408
|
+
result: z.array(PermissionInfoTypeSchema).describe('Built-in permissions result. Each item includes an optional "operation" field mapping to the SDK/MCP field name that triggers this permission.')
|
|
1409
|
+
}),
|
|
1410
|
+
z.object({
|
|
1411
|
+
info: z.literal('common mistakes'),
|
|
1412
|
+
result: z.array(CommonMistakeInfoSchema).describe('Common mistakes result. Each item documents a known pitfall (wrong field name, wrong unit, wrong workflow order, etc.) with wrong/correct examples.')
|
|
1375
1413
|
}),
|
|
1376
1414
|
z.object({
|
|
1377
1415
|
info: z.literal('guard instructions'),
|
|
@@ -1534,6 +1572,20 @@ export const OnchainQueryResultSchema_Part3 = z.union([
|
|
|
1534
1572
|
query_type: z.literal("onchain_address_activity"),
|
|
1535
1573
|
result: z.union([TransactionHistoryAnswerSchema, z.undefined()]),
|
|
1536
1574
|
}).strict(),
|
|
1575
|
+
z.object({
|
|
1576
|
+
query_type: z.literal("token_value_convert"),
|
|
1577
|
+
result: z.object({
|
|
1578
|
+
token_type: z.string().describe("Full token type used for conversion"),
|
|
1579
|
+
symbol: z.string().optional().describe("Resolved token symbol"),
|
|
1580
|
+
decimals: z.number().optional().describe("Resolved decimals N — the precision reminder"),
|
|
1581
|
+
precision_known: z.boolean().describe("false → precision unavailable; conversion may have been impossible"),
|
|
1582
|
+
direction: z.union([z.literal("raw_to_unit"), z.literal("unit_to_raw")]),
|
|
1583
|
+
input: z.string().describe("Input value as provided"),
|
|
1584
|
+
output: z.string().describe("Converted value (empty string when conversion was impossible)"),
|
|
1585
|
+
error: z.string().optional().describe("Hard failure reason (e.g. unit→raw without known precision)"),
|
|
1586
|
+
text: z.string().describe("One-line human text with the decimals reminder"),
|
|
1587
|
+
}).strict().describe("Bidirectional token value conversion result — see Fund Processing Layer"),
|
|
1588
|
+
}).strict(),
|
|
1537
1589
|
]);
|
|
1538
1590
|
export const AllQueryResultsSchema = z.union([
|
|
1539
1591
|
LocalQueryResultSchema,
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const SchemaQueryInputSchema: z.ZodObject<{
|
|
3
|
-
action: z.ZodEnum<["list", "get", "get_output", "search", "list_operations", "get_guard_templates", "get_field"]>;
|
|
3
|
+
action: z.ZodEnum<["list", "get", "get_output", "search", "list_operations", "get_guard_templates", "get_field", "search_examples", "get_tool_reference", "get_guard_design_patterns", "get_safety_rules", "get_templates"]>;
|
|
4
4
|
name: z.ZodOptional<z.ZodString>;
|
|
5
5
|
query: z.ZodOptional<z.ZodString>;
|
|
6
6
|
field_path: z.ZodOptional<z.ZodString>;
|
|
7
7
|
template: z.ZodOptional<z.ZodString>;
|
|
8
|
+
object_type: z.ZodOptional<z.ZodEnum<["guard", "machine", "service", "order", "progress", "arbitration", "treasury", "permission", "passport", "allocation", "reward"]>>;
|
|
9
|
+
params: z.ZodOptional<z.ZodString>;
|
|
8
10
|
output_file: z.ZodOptional<z.ZodString>;
|
|
9
11
|
}, "strict", z.ZodTypeAny, {
|
|
10
|
-
action: "get" | "search" | "list" | "get_output" | "list_operations" | "get_guard_templates" | "
|
|
12
|
+
action: "get" | "search" | "list" | "get_output" | "get_field" | "list_operations" | "get_guard_templates" | "search_examples" | "get_tool_reference" | "get_guard_design_patterns" | "get_safety_rules" | "get_templates";
|
|
13
|
+
params?: string | undefined;
|
|
11
14
|
name?: string | undefined;
|
|
15
|
+
object_type?: "reward" | "permission" | "guard" | "allocation" | "service" | "machine" | "arbitration" | "treasury" | "order" | "progress" | "passport" | undefined;
|
|
12
16
|
query?: string | undefined;
|
|
13
17
|
field_path?: string | undefined;
|
|
14
18
|
template?: string | undefined;
|
|
15
19
|
output_file?: string | undefined;
|
|
16
20
|
}, {
|
|
17
|
-
action: "get" | "search" | "list" | "get_output" | "list_operations" | "get_guard_templates" | "
|
|
21
|
+
action: "get" | "search" | "list" | "get_output" | "get_field" | "list_operations" | "get_guard_templates" | "search_examples" | "get_tool_reference" | "get_guard_design_patterns" | "get_safety_rules" | "get_templates";
|
|
22
|
+
params?: string | undefined;
|
|
18
23
|
name?: string | undefined;
|
|
24
|
+
object_type?: "reward" | "permission" | "guard" | "allocation" | "service" | "machine" | "arbitration" | "treasury" | "order" | "progress" | "passport" | undefined;
|
|
19
25
|
query?: string | undefined;
|
|
20
26
|
field_path?: string | undefined;
|
|
21
27
|
template?: string | undefined;
|
|
@@ -36,6 +42,36 @@ export declare const SchemaQueryOutputSchema: z.ZodObject<{
|
|
|
36
42
|
name: string;
|
|
37
43
|
description?: string | undefined;
|
|
38
44
|
title?: string | undefined;
|
|
45
|
+
}>, "many">, z.ZodArray<z.ZodObject<{
|
|
46
|
+
file: z.ZodString;
|
|
47
|
+
title: z.ZodString;
|
|
48
|
+
description: z.ZodString;
|
|
49
|
+
tags: z.ZodArray<z.ZodString, "many">;
|
|
50
|
+
industry: z.ZodString;
|
|
51
|
+
operation_type: z.ZodString;
|
|
52
|
+
verified: z.ZodBoolean;
|
|
53
|
+
score: z.ZodNumber;
|
|
54
|
+
matched_fields: z.ZodArray<z.ZodString, "many">;
|
|
55
|
+
}, "strict", z.ZodTypeAny, {
|
|
56
|
+
description: string;
|
|
57
|
+
title: string;
|
|
58
|
+
score: number;
|
|
59
|
+
tags: string[];
|
|
60
|
+
file: string;
|
|
61
|
+
verified: boolean;
|
|
62
|
+
industry: string;
|
|
63
|
+
operation_type: string;
|
|
64
|
+
matched_fields: string[];
|
|
65
|
+
}, {
|
|
66
|
+
description: string;
|
|
67
|
+
title: string;
|
|
68
|
+
score: number;
|
|
69
|
+
tags: string[];
|
|
70
|
+
file: string;
|
|
71
|
+
verified: boolean;
|
|
72
|
+
industry: string;
|
|
73
|
+
operation_type: string;
|
|
74
|
+
matched_fields: string[];
|
|
39
75
|
}>, "many">, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>;
|
|
40
76
|
message: z.ZodString;
|
|
41
77
|
suggestions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -46,6 +82,16 @@ export declare const SchemaQueryOutputSchema: z.ZodObject<{
|
|
|
46
82
|
name: string;
|
|
47
83
|
description?: string | undefined;
|
|
48
84
|
title?: string | undefined;
|
|
85
|
+
}[] | {
|
|
86
|
+
description: string;
|
|
87
|
+
title: string;
|
|
88
|
+
score: number;
|
|
89
|
+
tags: string[];
|
|
90
|
+
file: string;
|
|
91
|
+
verified: boolean;
|
|
92
|
+
industry: string;
|
|
93
|
+
operation_type: string;
|
|
94
|
+
matched_fields: string[];
|
|
49
95
|
}[] | null;
|
|
50
96
|
success: boolean;
|
|
51
97
|
action: string;
|
|
@@ -57,6 +103,16 @@ export declare const SchemaQueryOutputSchema: z.ZodObject<{
|
|
|
57
103
|
name: string;
|
|
58
104
|
description?: string | undefined;
|
|
59
105
|
title?: string | undefined;
|
|
106
|
+
}[] | {
|
|
107
|
+
description: string;
|
|
108
|
+
title: string;
|
|
109
|
+
score: number;
|
|
110
|
+
tags: string[];
|
|
111
|
+
file: string;
|
|
112
|
+
verified: boolean;
|
|
113
|
+
industry: string;
|
|
114
|
+
operation_type: string;
|
|
115
|
+
matched_fields: string[];
|
|
60
116
|
}[] | null;
|
|
61
117
|
success: boolean;
|
|
62
118
|
action: string;
|
|
@@ -10,16 +10,21 @@ export const SchemaQueryInputSchema = z
|
|
|
10
10
|
"list_operations",
|
|
11
11
|
"get_guard_templates",
|
|
12
12
|
"get_field",
|
|
13
|
+
"search_examples",
|
|
14
|
+
"get_tool_reference",
|
|
15
|
+
"get_guard_design_patterns",
|
|
16
|
+
"get_safety_rules",
|
|
17
|
+
"get_templates",
|
|
13
18
|
])
|
|
14
|
-
.describe("Action to perform: 'list' (all schemas), 'get' (specific input schema), 'get_output' (tool output schema), 'get_field' (field-path query e.g. field_path='data.node'), 'search' (by keyword), 'list_operations' (on-chain operations), 'get_guard_templates' (Guard creation templates + best practices)."),
|
|
19
|
+
.describe("Action to perform: 'list' (all schemas), 'get' (specific input schema), 'get_output' (tool output schema), 'get_field' (field-path query e.g. field_path='data.node'), 'search' (by keyword), 'list_operations' (on-chain operations), 'get_guard_templates' (Guard creation templates + best practices), 'search_examples' (search verified example files by keyword — matches title, description, tags, operation_type, industry), 'get_tool_reference' (MCP tool usage reference: summaries, actions, prerequisites, notes — sunk from wowok-tools skill), 'get_guard_design_patterns' (curated Guard design pattern catalog: business requirement → logic tree template — sunk from wowok-guard skill), 'get_safety_rules' (object reuse/immutability/operation-classification/naming rules — sunk from wowok-safety skill), 'get_templates' (unified template registry: ~90 parameterized templates across 11 object types — guard/machine/service/order/progress/arbitration/treasury/permission/passport/allocation/reward; omit 'template' to list metadata, provide 'template' for full detail, provide 'template' + 'params' to instantiate into executable JSON)."),
|
|
15
20
|
name: z
|
|
16
21
|
.string()
|
|
17
22
|
.optional()
|
|
18
|
-
.describe("Schema/tool name for 'get'/'get_output'/'get_field' action (e.g., 'onchain_operations', 'onchain_operations_machine')."),
|
|
23
|
+
.describe("Schema/tool name for 'get'/'get_output'/'get_field'/'get_tool_reference' action (e.g., 'onchain_operations', 'onchain_operations_machine'), or pattern id for 'get_guard_design_patterns' (e.g., 'pattern.identity_check_allowlist')."),
|
|
19
24
|
query: z
|
|
20
25
|
.string()
|
|
21
26
|
.optional()
|
|
22
|
-
.describe("Search query for 'search' action"),
|
|
27
|
+
.describe("Search query for 'search' action, keyword filter for 'get_tool_reference', or host filter for 'get_guard_design_patterns' (e.g. 'service_buy_guard', 'machine_forward', 'reward_claim')."),
|
|
23
28
|
field_path: z
|
|
24
29
|
.string()
|
|
25
30
|
.optional()
|
|
@@ -27,7 +32,27 @@ export const SchemaQueryInputSchema = z
|
|
|
27
32
|
template: z
|
|
28
33
|
.string()
|
|
29
34
|
.optional()
|
|
30
|
-
.describe("Guard template name for 'get_guard_templates' action. Omit to list all available templates. Available: signer_verification, progress_node_check, order_owner_verification, service_belonging_check, reward_not_claimed, combined_reward_guard."),
|
|
35
|
+
.describe("Guard template name for 'get_guard_templates' action. Omit to list all available templates. Available: signer_verification, progress_node_check, order_owner_verification, service_belonging_check, reward_not_claimed, combined_reward_guard. For 'get_templates': unified template id (e.g. 'tpl_buy_guard_whitelist', 'tpl_machine_ecommerce_standard', 'T-S-01', 'T-O-01', 'first_order')."),
|
|
36
|
+
object_type: z
|
|
37
|
+
.enum([
|
|
38
|
+
"guard",
|
|
39
|
+
"machine",
|
|
40
|
+
"service",
|
|
41
|
+
"order",
|
|
42
|
+
"progress",
|
|
43
|
+
"arbitration",
|
|
44
|
+
"treasury",
|
|
45
|
+
"permission",
|
|
46
|
+
"passport",
|
|
47
|
+
"allocation",
|
|
48
|
+
"reward",
|
|
49
|
+
])
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("Object-type filter for 'get_templates' list mode (e.g. 'guard' lists only Guard templates)."),
|
|
52
|
+
params: z
|
|
53
|
+
.string()
|
|
54
|
+
.optional()
|
|
55
|
+
.describe("JSON-encoded parameter object for 'get_templates' instantiation mode (e.g. '{\"whitelist\":[\"0xabc\"]}'). Required params are declared in each template's 'parameters' list (see detail mode)."),
|
|
31
56
|
output_file: z
|
|
32
57
|
.string()
|
|
33
58
|
.optional()
|
|
@@ -41,6 +66,19 @@ const SchemaListItemSchema = z
|
|
|
41
66
|
description: z.string().optional().describe("Short description, if known."),
|
|
42
67
|
})
|
|
43
68
|
.strict();
|
|
69
|
+
const ExampleSearchResultSchema = z
|
|
70
|
+
.object({
|
|
71
|
+
file: z.string().describe("Example file name (e.g. 'rental-ziroom-service-create.json')."),
|
|
72
|
+
title: z.string().describe("Human-readable title from the example metadata."),
|
|
73
|
+
description: z.string().describe("Longer description from the example metadata."),
|
|
74
|
+
tags: z.array(z.string()).describe("Tags from the example metadata."),
|
|
75
|
+
industry: z.string().describe("Industry category (e.g. 'rental', 'retail', 'general')."),
|
|
76
|
+
operation_type: z.string().describe("Operation type (e.g. 'service', 'machine', 'guard', 'permission')."),
|
|
77
|
+
verified: z.boolean().describe("Whether the example is marked as verified."),
|
|
78
|
+
score: z.number().describe("Relevance score — number of fields that matched the query (0-5)."),
|
|
79
|
+
matched_fields: z.array(z.string()).describe("List of fields that matched the query."),
|
|
80
|
+
})
|
|
81
|
+
.strict();
|
|
44
82
|
export const SchemaQueryOutputSchema = z
|
|
45
83
|
.object({
|
|
46
84
|
success: z.boolean().describe("Whether the request was successful"),
|
|
@@ -48,10 +86,11 @@ export const SchemaQueryOutputSchema = z
|
|
|
48
86
|
data: z
|
|
49
87
|
.union([
|
|
50
88
|
z.array(SchemaListItemSchema).describe("List of schema summaries (list/search/list_operations)."),
|
|
51
|
-
z.
|
|
89
|
+
z.array(ExampleSearchResultSchema).describe("List of matching examples (search_examples)."),
|
|
90
|
+
z.record(z.unknown()).describe("JSON Schema object (get/get_output/get_field), Guard template data, tool reference data (get_tool_reference), Guard design pattern catalog (get_guard_design_patterns), or safety rules tables (get_safety_rules)."),
|
|
52
91
|
z.null().describe("No data — lookup failed or returned nothing, or data was written to output_file."),
|
|
53
92
|
])
|
|
54
|
-
.describe("Response data — array of schema summaries for list-like actions, JSON Schema object for get/get_output/get_field, Guard template data for get_guard_templates, null on failure or when output_file is used."),
|
|
93
|
+
.describe("Response data — array of schema summaries for list-like actions, array of example results for search_examples, JSON Schema object for get/get_output/get_field, Guard template data for get_guard_templates, null on failure or when output_file is used."),
|
|
55
94
|
message: z.string().describe("Human-readable message describing the result"),
|
|
56
95
|
suggestions: z
|
|
57
96
|
.array(z.string())
|