@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.
Files changed (125) hide show
  1. package/dist/customer/info-puzzle.d.ts +1 -1
  2. package/dist/customer/info-puzzle.js +4 -2
  3. package/dist/customer/risk-assessment.js +26 -4
  4. package/dist/customer/types.d.ts +2 -0
  5. package/dist/examples/guard-template-balance-check.json +38 -0
  6. package/dist/examples/guard-template-time-lock.json +39 -0
  7. package/dist/examples/machine-template-7node-rental.json +114 -0
  8. package/dist/examples/rental-ziroom-machine-create.json +137 -0
  9. package/dist/examples/rental-ziroom-permission-create.json +35 -0
  10. package/dist/examples/rental-ziroom-service-create.json +80 -0
  11. package/dist/examples/retail-myshop-service-create.json +88 -0
  12. package/dist/extensions/capability-manifest.js +24 -24
  13. package/dist/extensions/constraint-registry.js +18 -18
  14. package/dist/extensions/metric-registry.js +14 -14
  15. package/dist/extensions/mode-evaluator.js +16 -16
  16. package/dist/extensions/modes.js +131 -45
  17. package/dist/extensions/registry.d.ts +2 -0
  18. package/dist/extensions/registry.js +63 -30
  19. package/dist/extensions/types.d.ts +1 -0
  20. package/dist/index.js +50 -0
  21. package/dist/knowledge/deployment-scanner.js +1 -1
  22. package/dist/knowledge/fund-layer.d.ts +72 -0
  23. package/dist/knowledge/fund-layer.js +420 -0
  24. package/dist/knowledge/guard-render.d.ts +57 -0
  25. package/dist/knowledge/guard-render.js +700 -0
  26. package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
  27. package/dist/knowledge/guard-submission-prompt.js +171 -0
  28. package/dist/knowledge/machine-ledger.js +1 -1
  29. package/dist/knowledge/machine-render.d.ts +41 -0
  30. package/dist/knowledge/machine-render.js +565 -0
  31. package/dist/knowledge/machine-templates.js +4 -4
  32. package/dist/knowledge/reward-confirm.js +2 -2
  33. package/dist/knowledge/reward-puzzle.js +1 -1
  34. package/dist/knowledge/reward-risk.js +9 -9
  35. package/dist/knowledge/reward-templates.js +2 -2
  36. package/dist/knowledge/service-confirm.d.ts +1 -1
  37. package/dist/knowledge/service-confirm.js +3 -3
  38. package/dist/knowledge/service-context.js +1 -1
  39. package/dist/knowledge/service-ledger.js +1 -1
  40. package/dist/knowledge/service-risk.d.ts +1 -1
  41. package/dist/knowledge/service-risk.js +3 -3
  42. package/dist/knowledge/service-templates.js +2 -2
  43. package/dist/knowledge/service-translation.d.ts +1 -1
  44. package/dist/knowledge/service-translation.js +7 -7
  45. package/dist/project/deployment-bridge.js +6 -5
  46. package/dist/project/deployment-doc.js +5 -5
  47. package/dist/project/edit-planner.d.ts +123 -0
  48. package/dist/project/edit-planner.js +1371 -0
  49. package/dist/project/evaluation.js +314 -14
  50. package/dist/project/graph-builder.js +6 -1
  51. package/dist/project/handlers.d.ts +99 -2
  52. package/dist/project/handlers.js +358 -16
  53. package/dist/project/stage-gate.js +4 -4
  54. package/dist/schema/call/allocation.js +2 -2
  55. package/dist/schema/call/arbitration.js +19 -6
  56. package/dist/schema/call/contact.js +2 -2
  57. package/dist/schema/call/demand.js +2 -2
  58. package/dist/schema/call/guard.js +1 -1
  59. package/dist/schema/call/machine.d.ts +1975 -777
  60. package/dist/schema/call/machine.js +50 -4
  61. package/dist/schema/call/order.js +3 -6
  62. package/dist/schema/call/permission.js +2 -2
  63. package/dist/schema/call/repository.js +2 -2
  64. package/dist/schema/call/reward.js +3 -3
  65. package/dist/schema/call/semantic.js +7 -1
  66. package/dist/schema/call/service.d.ts +180 -8
  67. package/dist/schema/call/service.js +82 -27
  68. package/dist/schema/call/treasury.js +3 -3
  69. package/dist/schema/common/index.d.ts +2 -0
  70. package/dist/schema/common/index.js +46 -10
  71. package/dist/schema/local/index.js +5 -1
  72. package/dist/schema/operations.d.ts +755 -176
  73. package/dist/schema/operations.js +43 -7
  74. package/dist/schema/project/index.d.ts +969 -6
  75. package/dist/schema/project/index.js +268 -4
  76. package/dist/schema/query/index.d.ts +217 -0
  77. package/dist/schema/query/index.js +63 -33
  78. package/dist/schema/schema-query/index.d.ts +53 -3
  79. package/dist/schema/schema-query/index.js +17 -2
  80. package/dist/schema/utils/node-parser.js +13 -0
  81. package/dist/schema/utils/object-type-utils.d.ts +12 -0
  82. package/dist/schema/utils/object-type-utils.js +35 -0
  83. package/dist/schema/utils/permission-machine-check.d.ts +49 -0
  84. package/dist/schema/utils/permission-machine-check.js +121 -0
  85. package/dist/schema/utils/skills-recommendation.d.ts +2 -0
  86. package/dist/schema/utils/skills-recommendation.js +76 -0
  87. package/dist/schema-query/index.d.ts +14 -1
  88. package/dist/schema-query/index.js +104 -2
  89. package/dist/schemas/account_operation.schema.json +1 -1
  90. package/dist/schemas/index.json +1 -1
  91. package/dist/schemas/onchain_events.output.json +1 -1
  92. package/dist/schemas/onchain_operations.output.json +2820 -0
  93. package/dist/schemas/onchain_operations.schema.json +115 -53
  94. package/dist/schemas/onchain_operations_allocation.schema.json +5 -5
  95. package/dist/schemas/onchain_operations_arbitration.schema.json +9 -7
  96. package/dist/schemas/onchain_operations_contact.schema.json +3 -3
  97. package/dist/schemas/onchain_operations_demand.schema.json +3 -3
  98. package/dist/schemas/onchain_operations_gen_passport.schema.json +2 -2
  99. package/dist/schemas/onchain_operations_guard.schema.json +1 -1
  100. package/dist/schemas/onchain_operations_machine.schema.json +4 -4
  101. package/dist/schemas/onchain_operations_order.schema.json +3 -3
  102. package/dist/schemas/onchain_operations_payment.schema.json +1 -1
  103. package/dist/schemas/onchain_operations_permission.schema.json +2 -2
  104. package/dist/schemas/onchain_operations_progress.schema.json +1 -1
  105. package/dist/schemas/onchain_operations_proof.schema.json +1 -1
  106. package/dist/schemas/onchain_operations_repository.schema.json +3 -3
  107. package/dist/schemas/onchain_operations_reward.schema.json +6 -6
  108. package/dist/schemas/onchain_operations_service.schema.json +77 -17
  109. package/dist/schemas/onchain_operations_treasury.schema.json +4 -4
  110. package/dist/schemas/onchain_table_data.output.json +1 -1
  111. package/dist/schemas/onchain_table_data.schema.json +10 -9
  112. package/dist/schemas/project_operation.output.json +1026 -7
  113. package/dist/schemas/project_operation.schema.json +46 -4
  114. package/dist/schemas/query_toolkit.output.json +15 -15
  115. package/dist/schemas/query_toolkit.schema.json +3 -3
  116. package/dist/schemas/schema_query.output.json +64 -1
  117. package/dist/schemas/schema_query.schema.json +3 -2
  118. package/dist/schemas/wowok_buildin_info.output.json +81 -8
  119. package/dist/schemas/wowok_buildin_info.schema.json +46 -2
  120. package/dist/tools/handlers/onchain.js +571 -6
  121. package/dist/tools/handlers/project.js +25 -2
  122. package/dist/tools/handlers/schema-query.js +24 -1
  123. package/dist/tools/index.d.ts +8 -0
  124. package/dist/tools/index.js +177 -6
  125. package/package.json +2 -2
@@ -48149,16 +48149,19 @@ export declare const PermissionInfoTypeSchema: z.ZodObject<{
48149
48149
  name: z.ZodString;
48150
48150
  description: z.ZodString;
48151
48151
  object_type: z.ZodString;
48152
+ operation: z.ZodOptional<z.ZodString>;
48152
48153
  }, "strip", z.ZodTypeAny, {
48153
48154
  name: string;
48154
48155
  object_type: string;
48155
48156
  description: string;
48156
48157
  index: number;
48158
+ operation?: string | undefined;
48157
48159
  }, {
48158
48160
  name: string;
48159
48161
  object_type: string;
48160
48162
  description: string;
48161
48163
  index: number;
48164
+ operation?: string | undefined;
48162
48165
  }>;
48163
48166
  export declare const GuardInstructSchema: z.ZodObject<{
48164
48167
  name: z.ZodString;
@@ -48231,17 +48234,58 @@ export declare const PermissionFilterSchema: z.ZodObject<{
48231
48234
  name: z.ZodOptional<z.ZodString>;
48232
48235
  index: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
48233
48236
  description: z.ZodOptional<z.ZodString>;
48237
+ operation: z.ZodOptional<z.ZodString>;
48234
48238
  }, "strip", z.ZodTypeAny, {
48235
48239
  name?: string | undefined;
48236
48240
  description?: string | undefined;
48237
48241
  objectType?: import("@wowok/wowok").ObjectType | undefined;
48242
+ operation?: string | undefined;
48238
48243
  index?: number | undefined;
48239
48244
  }, {
48240
48245
  name?: string | undefined;
48241
48246
  description?: string | undefined;
48242
48247
  objectType?: import("@wowok/wowok").ObjectType | undefined;
48248
+ operation?: string | undefined;
48243
48249
  index?: number | undefined;
48244
48250
  }>;
48251
+ export declare const CommonMistakeInfoSchema: z.ZodObject<{
48252
+ object_type: z.ZodString;
48253
+ operation: z.ZodString;
48254
+ category: z.ZodEnum<["field_name", "unit", "value_range", "workflow", "timing"]>;
48255
+ mistake: z.ZodString;
48256
+ correct_usage: z.ZodString;
48257
+ wrong_example: z.ZodString;
48258
+ correct_example: z.ZodString;
48259
+ }, "strip", z.ZodTypeAny, {
48260
+ object_type: string;
48261
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
48262
+ operation: string;
48263
+ mistake: string;
48264
+ correct_usage: string;
48265
+ wrong_example: string;
48266
+ correct_example: string;
48267
+ }, {
48268
+ object_type: string;
48269
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
48270
+ operation: string;
48271
+ mistake: string;
48272
+ correct_usage: string;
48273
+ wrong_example: string;
48274
+ correct_example: string;
48275
+ }>;
48276
+ export declare const CommonMistakeFilterSchema: z.ZodObject<{
48277
+ object_type: z.ZodOptional<z.ZodString>;
48278
+ operation: z.ZodOptional<z.ZodString>;
48279
+ category: z.ZodOptional<z.ZodEnum<["field_name", "unit", "value_range", "workflow", "timing"]>>;
48280
+ }, "strip", z.ZodTypeAny, {
48281
+ object_type?: string | undefined;
48282
+ category?: "workflow" | "unit" | "field_name" | "value_range" | "timing" | undefined;
48283
+ operation?: string | undefined;
48284
+ }, {
48285
+ object_type?: string | undefined;
48286
+ category?: "workflow" | "unit" | "field_name" | "value_range" | "timing" | undefined;
48287
+ operation?: string | undefined;
48288
+ }>;
48245
48289
  export declare const BridgeTokenInfoSchema: z.ZodObject<{
48246
48290
  tokenId: z.ZodNumber;
48247
48291
  symbol: z.ZodString;
@@ -48283,15 +48327,18 @@ export declare const ProtocolInfoQuerySchema: z.ZodDiscriminatedUnion<"info", [z
48283
48327
  name: z.ZodOptional<z.ZodString>;
48284
48328
  index: z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>;
48285
48329
  description: z.ZodOptional<z.ZodString>;
48330
+ operation: z.ZodOptional<z.ZodString>;
48286
48331
  }, "strip", z.ZodTypeAny, {
48287
48332
  name?: string | undefined;
48288
48333
  description?: string | undefined;
48289
48334
  objectType?: import("@wowok/wowok").ObjectType | undefined;
48335
+ operation?: string | undefined;
48290
48336
  index?: number | undefined;
48291
48337
  }, {
48292
48338
  name?: string | undefined;
48293
48339
  description?: string | undefined;
48294
48340
  objectType?: import("@wowok/wowok").ObjectType | undefined;
48341
+ operation?: string | undefined;
48295
48342
  index?: number | undefined;
48296
48343
  }>>;
48297
48344
  }, "strict", z.ZodTypeAny, {
@@ -48300,6 +48347,7 @@ export declare const ProtocolInfoQuerySchema: z.ZodDiscriminatedUnion<"info", [z
48300
48347
  name?: string | undefined;
48301
48348
  description?: string | undefined;
48302
48349
  objectType?: import("@wowok/wowok").ObjectType | undefined;
48350
+ operation?: string | undefined;
48303
48351
  index?: number | undefined;
48304
48352
  } | undefined;
48305
48353
  }, {
@@ -48308,8 +48356,38 @@ export declare const ProtocolInfoQuerySchema: z.ZodDiscriminatedUnion<"info", [z
48308
48356
  name?: string | undefined;
48309
48357
  description?: string | undefined;
48310
48358
  objectType?: import("@wowok/wowok").ObjectType | undefined;
48359
+ operation?: string | undefined;
48311
48360
  index?: number | undefined;
48312
48361
  } | undefined;
48362
+ }>, z.ZodObject<{
48363
+ info: z.ZodLiteral<"common mistakes">;
48364
+ filter: z.ZodOptional<z.ZodObject<{
48365
+ object_type: z.ZodOptional<z.ZodString>;
48366
+ operation: z.ZodOptional<z.ZodString>;
48367
+ category: z.ZodOptional<z.ZodEnum<["field_name", "unit", "value_range", "workflow", "timing"]>>;
48368
+ }, "strip", z.ZodTypeAny, {
48369
+ object_type?: string | undefined;
48370
+ category?: "workflow" | "unit" | "field_name" | "value_range" | "timing" | undefined;
48371
+ operation?: string | undefined;
48372
+ }, {
48373
+ object_type?: string | undefined;
48374
+ category?: "workflow" | "unit" | "field_name" | "value_range" | "timing" | undefined;
48375
+ operation?: string | undefined;
48376
+ }>>;
48377
+ }, "strict", z.ZodTypeAny, {
48378
+ info: "common mistakes";
48379
+ filter?: {
48380
+ object_type?: string | undefined;
48381
+ category?: "workflow" | "unit" | "field_name" | "value_range" | "timing" | undefined;
48382
+ operation?: string | undefined;
48383
+ } | undefined;
48384
+ }, {
48385
+ info: "common mistakes";
48386
+ filter?: {
48387
+ object_type?: string | undefined;
48388
+ category?: "workflow" | "unit" | "field_name" | "value_range" | "timing" | undefined;
48389
+ operation?: string | undefined;
48390
+ } | undefined;
48313
48391
  }>, z.ZodObject<{
48314
48392
  info: z.ZodLiteral<"guard instructions">;
48315
48393
  filter: z.ZodOptional<z.ZodObject<{
@@ -48379,16 +48457,19 @@ export declare const BuiltinPermissionSchema: z.ZodObject<{
48379
48457
  name: z.ZodString;
48380
48458
  description: z.ZodString;
48381
48459
  object_type: z.ZodString;
48460
+ operation: z.ZodOptional<z.ZodString>;
48382
48461
  }, "strip", z.ZodTypeAny, {
48383
48462
  name: string;
48384
48463
  object_type: string;
48385
48464
  description: string;
48386
48465
  index: number;
48466
+ operation?: string | undefined;
48387
48467
  }, {
48388
48468
  name: string;
48389
48469
  object_type: string;
48390
48470
  description: string;
48391
48471
  index: number;
48472
+ operation?: string | undefined;
48392
48473
  }>, "many">;
48393
48474
  }, "strip", z.ZodTypeAny, {
48394
48475
  result: {
@@ -48396,6 +48477,7 @@ export declare const BuiltinPermissionSchema: z.ZodObject<{
48396
48477
  object_type: string;
48397
48478
  description: string;
48398
48479
  index: number;
48480
+ operation?: string | undefined;
48399
48481
  }[];
48400
48482
  }, {
48401
48483
  result: {
@@ -48403,6 +48485,7 @@ export declare const BuiltinPermissionSchema: z.ZodObject<{
48403
48485
  object_type: string;
48404
48486
  description: string;
48405
48487
  index: number;
48488
+ operation?: string | undefined;
48406
48489
  }[];
48407
48490
  }>;
48408
48491
  export declare const ProtocolInfoResultWrappedSchema: z.ZodDiscriminatedUnion<"info", [z.ZodObject<{
@@ -48441,16 +48524,19 @@ export declare const ProtocolInfoResultWrappedSchema: z.ZodDiscriminatedUnion<"i
48441
48524
  name: z.ZodString;
48442
48525
  description: z.ZodString;
48443
48526
  object_type: z.ZodString;
48527
+ operation: z.ZodOptional<z.ZodString>;
48444
48528
  }, "strip", z.ZodTypeAny, {
48445
48529
  name: string;
48446
48530
  object_type: string;
48447
48531
  description: string;
48448
48532
  index: number;
48533
+ operation?: string | undefined;
48449
48534
  }, {
48450
48535
  name: string;
48451
48536
  object_type: string;
48452
48537
  description: string;
48453
48538
  index: number;
48539
+ operation?: string | undefined;
48454
48540
  }>, "many">;
48455
48541
  }, "strip", z.ZodTypeAny, {
48456
48542
  result: {
@@ -48458,6 +48544,7 @@ export declare const ProtocolInfoResultWrappedSchema: z.ZodDiscriminatedUnion<"i
48458
48544
  object_type: string;
48459
48545
  description: string;
48460
48546
  index: number;
48547
+ operation?: string | undefined;
48461
48548
  }[];
48462
48549
  info: "built-in permissions";
48463
48550
  }, {
@@ -48466,8 +48553,58 @@ export declare const ProtocolInfoResultWrappedSchema: z.ZodDiscriminatedUnion<"i
48466
48553
  object_type: string;
48467
48554
  description: string;
48468
48555
  index: number;
48556
+ operation?: string | undefined;
48469
48557
  }[];
48470
48558
  info: "built-in permissions";
48559
+ }>, z.ZodObject<{
48560
+ info: z.ZodLiteral<"common mistakes">;
48561
+ result: z.ZodArray<z.ZodObject<{
48562
+ object_type: z.ZodString;
48563
+ operation: z.ZodString;
48564
+ category: z.ZodEnum<["field_name", "unit", "value_range", "workflow", "timing"]>;
48565
+ mistake: z.ZodString;
48566
+ correct_usage: z.ZodString;
48567
+ wrong_example: z.ZodString;
48568
+ correct_example: z.ZodString;
48569
+ }, "strip", z.ZodTypeAny, {
48570
+ object_type: string;
48571
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
48572
+ operation: string;
48573
+ mistake: string;
48574
+ correct_usage: string;
48575
+ wrong_example: string;
48576
+ correct_example: string;
48577
+ }, {
48578
+ object_type: string;
48579
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
48580
+ operation: string;
48581
+ mistake: string;
48582
+ correct_usage: string;
48583
+ wrong_example: string;
48584
+ correct_example: string;
48585
+ }>, "many">;
48586
+ }, "strip", z.ZodTypeAny, {
48587
+ result: {
48588
+ object_type: string;
48589
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
48590
+ operation: string;
48591
+ mistake: string;
48592
+ correct_usage: string;
48593
+ wrong_example: string;
48594
+ correct_example: string;
48595
+ }[];
48596
+ info: "common mistakes";
48597
+ }, {
48598
+ result: {
48599
+ object_type: string;
48600
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
48601
+ operation: string;
48602
+ mistake: string;
48603
+ correct_usage: string;
48604
+ wrong_example: string;
48605
+ correct_example: string;
48606
+ }[];
48607
+ info: "common mistakes";
48471
48608
  }>, z.ZodObject<{
48472
48609
  info: z.ZodLiteral<"guard instructions">;
48473
48610
  result: z.ZodArray<z.ZodObject<{
@@ -48652,16 +48789,19 @@ export declare const ProtocolInfoResultSchema: z.ZodObject<{
48652
48789
  name: z.ZodString;
48653
48790
  description: z.ZodString;
48654
48791
  object_type: z.ZodString;
48792
+ operation: z.ZodOptional<z.ZodString>;
48655
48793
  }, "strip", z.ZodTypeAny, {
48656
48794
  name: string;
48657
48795
  object_type: string;
48658
48796
  description: string;
48659
48797
  index: number;
48798
+ operation?: string | undefined;
48660
48799
  }, {
48661
48800
  name: string;
48662
48801
  object_type: string;
48663
48802
  description: string;
48664
48803
  index: number;
48804
+ operation?: string | undefined;
48665
48805
  }>, "many">;
48666
48806
  }, "strip", z.ZodTypeAny, {
48667
48807
  result: {
@@ -48669,6 +48809,7 @@ export declare const ProtocolInfoResultSchema: z.ZodObject<{
48669
48809
  object_type: string;
48670
48810
  description: string;
48671
48811
  index: number;
48812
+ operation?: string | undefined;
48672
48813
  }[];
48673
48814
  info: "built-in permissions";
48674
48815
  }, {
@@ -48677,8 +48818,58 @@ export declare const ProtocolInfoResultSchema: z.ZodObject<{
48677
48818
  object_type: string;
48678
48819
  description: string;
48679
48820
  index: number;
48821
+ operation?: string | undefined;
48680
48822
  }[];
48681
48823
  info: "built-in permissions";
48824
+ }>, z.ZodObject<{
48825
+ info: z.ZodLiteral<"common mistakes">;
48826
+ result: z.ZodArray<z.ZodObject<{
48827
+ object_type: z.ZodString;
48828
+ operation: z.ZodString;
48829
+ category: z.ZodEnum<["field_name", "unit", "value_range", "workflow", "timing"]>;
48830
+ mistake: z.ZodString;
48831
+ correct_usage: z.ZodString;
48832
+ wrong_example: z.ZodString;
48833
+ correct_example: z.ZodString;
48834
+ }, "strip", z.ZodTypeAny, {
48835
+ object_type: string;
48836
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
48837
+ operation: string;
48838
+ mistake: string;
48839
+ correct_usage: string;
48840
+ wrong_example: string;
48841
+ correct_example: string;
48842
+ }, {
48843
+ object_type: string;
48844
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
48845
+ operation: string;
48846
+ mistake: string;
48847
+ correct_usage: string;
48848
+ wrong_example: string;
48849
+ correct_example: string;
48850
+ }>, "many">;
48851
+ }, "strip", z.ZodTypeAny, {
48852
+ result: {
48853
+ object_type: string;
48854
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
48855
+ operation: string;
48856
+ mistake: string;
48857
+ correct_usage: string;
48858
+ wrong_example: string;
48859
+ correct_example: string;
48860
+ }[];
48861
+ info: "common mistakes";
48862
+ }, {
48863
+ result: {
48864
+ object_type: string;
48865
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
48866
+ operation: string;
48867
+ mistake: string;
48868
+ correct_usage: string;
48869
+ wrong_example: string;
48870
+ correct_example: string;
48871
+ }[];
48872
+ info: "common mistakes";
48682
48873
  }>, z.ZodObject<{
48683
48874
  info: z.ZodLiteral<"guard instructions">;
48684
48875
  result: z.ZodArray<z.ZodObject<{
@@ -48840,8 +49031,20 @@ export declare const ProtocolInfoResultSchema: z.ZodObject<{
48840
49031
  object_type: string;
48841
49032
  description: string;
48842
49033
  index: number;
49034
+ operation?: string | undefined;
48843
49035
  }[];
48844
49036
  info: "built-in permissions";
49037
+ } | {
49038
+ result: {
49039
+ object_type: string;
49040
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
49041
+ operation: string;
49042
+ mistake: string;
49043
+ correct_usage: string;
49044
+ wrong_example: string;
49045
+ correct_example: string;
49046
+ }[];
49047
+ info: "common mistakes";
48845
49048
  } | {
48846
49049
  result: {
48847
49050
  name: string;
@@ -48891,8 +49094,20 @@ export declare const ProtocolInfoResultSchema: z.ZodObject<{
48891
49094
  object_type: string;
48892
49095
  description: string;
48893
49096
  index: number;
49097
+ operation?: string | undefined;
48894
49098
  }[];
48895
49099
  info: "built-in permissions";
49100
+ } | {
49101
+ result: {
49102
+ object_type: string;
49103
+ category: "workflow" | "unit" | "field_name" | "value_range" | "timing";
49104
+ operation: string;
49105
+ mistake: string;
49106
+ correct_usage: string;
49107
+ wrong_example: string;
49108
+ correct_example: string;
49109
+ }[];
49110
+ info: "common mistakes";
48896
49111
  } | {
48897
49112
  result: {
48898
49113
  name: string;
@@ -75389,6 +75604,8 @@ export type ServiceSale = z.infer<typeof ServiceSaleSchema>;
75389
75604
  export type PurchasedItem = z.infer<typeof PurchasedItemSchema>;
75390
75605
  export type ConstantItem = z.infer<typeof ConstantItemSchema>;
75391
75606
  export type PermissionInfoType = z.infer<typeof PermissionInfoTypeSchema>;
75607
+ export type CommonMistakeInfo = z.infer<typeof CommonMistakeInfoSchema>;
75608
+ export type CommonMistakeFilter = z.infer<typeof CommonMistakeFilterSchema>;
75392
75609
  export type BridgeTokenInfo = z.infer<typeof BridgeTokenInfoSchema>;
75393
75610
  export type ProtocolInfoQuery = z.infer<typeof ProtocolInfoQuerySchema>;
75394
75611
  export type ProtocolInfoResult = z.infer<typeof ProtocolInfoResultSchema>;
@@ -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 ID"),
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 allocation time\n" +
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"),
@@ -227,15 +228,20 @@ export const AllocationModeSchema = z.union([
227
228
  "Use Surplus to capture remainder (e.g., platform fee + host gets rest). " +
228
229
  "Accepts string ('Amount'/'Rate'/'Surplus', recommended) or number (0/1/2).");
229
230
  export const AllocationSharingSchema = z.object({
230
- who: RecipientSchema.describe("Recipient of this allocation. Three forms:\n" +
231
- "• { GuardIdentifier: u8 } — resolved from Passport at allocation time. " +
231
+ who: RecipientSchema.describe("Recipient of this allocation. Three forms — each resolves the address at a DIFFERENT time:\n" +
232
+ "• { GuardIdentifier: u8 } — DYNAMIC address resolved from Passport at alloc() time (contract calls passport::submission_get). " +
232
233
  "Use 0 for Order owner in Service-integrated mode (Customer who created the Order). " +
233
234
  "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.\n" +
235
- "• { Entity: { name_or_address: '...' } } — static address resolved via LocalMark. " +
236
- "Use for known recipients (e.g., 'turo_host', or a Treasury object address).\n" +
237
- "• 'Signer' — the transaction sender (tx_context::sender). " +
238
- "Use when the recipient is the current signer (e.g., self-refund scenarios)."),
235
+ "If Passport has no matching submission, contract aborts with E_VERIFY_FAILED. " +
236
+ "Use when the recipient address is not known at config time and must be supplied via Guard submission data.\n" +
237
+ "• { Entity: { name_or_address: '...' } } — FIXED address resolved via LocalMark at SDK build time (passed to contract as a literal address). " +
238
+ "Use for known recipients (e.g., 'turo_host', or a Treasury object address). " +
239
+ "Use when the recipient is a stable, known address (e.g., operator receives rent, platform fee to treasury).\n" +
240
+ "• 'Signer' — the transaction sender at the time of the alloc() call (tx_context::sender). " +
241
+ "RESOLVED AT EXECUTION TIME, not at config time. " +
242
+ "For refunds: the customer (Order owner) must call alloc_by_guard THEMSELVES so that tx_context::sender resolves to THEIR address — " +
243
+ "if the operator calls alloc_by_guard, the operator becomes the recipient (Signer = operator), NOT the customer. " +
244
+ "Use when the recipient is whoever submits the allocation transaction (e.g., customer receives refund)."),
239
245
  sharing: BalanceTypeSchema.describe("Allocation value. SEMANTICS DEPEND ON `mode`:\n" +
240
246
  "• mode='Amount': absolute amount in smallest unit (e.g., '750000000' for 0.75 WOW, '250000000' for 0.25 WOW). " +
241
247
  "Allocated first; sum of Amount items cached as `fix`.\n" +
@@ -259,11 +265,14 @@ export const AllocatorSchema = z.object({
259
265
  fix: BalanceTypeSchema.optional().describe("OUTPUT-ONLY (query result). Cached sum of all Amount-mode `sharing` values in this Allocator. " +
260
266
  "Computed by the contract during `allocator_add` — DO NOT set this field at creation. " +
261
267
  "Used internally to compute `total_rates = balance - fix` for Rate allocation."),
262
- max: z.union([BalanceTypeSchema, z.null()]).optional().describe("Maximum allocation cap (optional). Has THREE effects:\n" +
268
+ 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). " +
269
+ "Passed through to the contract as Option<u64> via allocator_add(): when null/omitted the contract treats it as `none` (no cap); " +
270
+ "when set, the contract enforces it. Has THREE effects when set:\n" +
263
271
  "1. Construction: sum of Amount items must be <= max (EAMOUNT_EXCEEDS_MAX=13)\n" +
264
272
  "2. Rate execution: total_rates = max - fix (instead of balance - fix)\n" +
265
273
  "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)."),
274
+ "Use when you want to cap total allocation regardless of Order balance (e.g., cap payout to declared amount). " +
275
+ "SDK pre-validates Amount sum <= max at build time to give actionable error messages before on-chain abort."),
267
276
  }).describe("Fund allocator — a complete allocation strategy triggered by a Guard. " +
268
277
  "Contains a sharing[] array where items can mix Amount/Rate/Surplus modes. " +
269
278
  "When the Guard passes, the contract allocates funds in strict order: Amount → Rate → Surplus.");
@@ -519,7 +528,7 @@ export const GuardNodeSchema = z.lazy(() => z.discriminatedUnion('type', [
519
528
  identifier: GuardIdentifierSchema,
520
529
  convert_witness: WitnessTypeSchema.optional(),
521
530
  }).strict().describe("The object to query from the Guard table."),
522
- parameters: z.array(GuardNodeSchema).describe("Parameters required by the query (must match the query's expected parameters type)."),
531
+ 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
532
  }).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
533
  z.object({
525
534
  type: z.literal('logic_as_u256_greater_or_equal'),
@@ -551,18 +560,12 @@ export const GuardNodeSchema = z.lazy(() => z.discriminatedUnion('type', [
551
560
  }).strict().describe("Returns Bool. Computed by inverting the boolean value of the child node (true -> false, false -> true)."),
552
561
  z.object({
553
562
  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
- }),
563
+ 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.`),
564
+ }).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
565
  z.object({
560
566
  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
- }),
567
+ 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.`),
568
+ }).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
569
  z.object({
567
570
  type: z.literal('logic_string_contains'),
568
571
  nodes: z.array(GuardNodeSchema),
@@ -977,8 +980,11 @@ export const MachineNodePairSchema = z.object({
977
980
  prev_node: z.string().describe("Previous node name. Empty string '' means initial entry node (the first node in the workflow)."),
978
981
  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
982
  forwards: z.array(MachineForwardSchema).describe("Forward list — operations to ENTER THIS NODE from prev_node. " +
983
+ "SEMANTIC CLARIFICATION: forwards describe INCOMING transitions (how to ARRIVE at this node), " +
984
+ "NOT outgoing transitions. Think of each forward as an 'entry door' to this node. " +
980
985
  "Example: pair {prev_node:'A', forwards:[{name:'Go'}]} means 'use Go to advance FROM A TO THIS NODE'. " +
981
986
  "For initial node (prev_node=''), forwards are operations to enter this node from the start state. " +
987
+ "DIAGRAM: A --[Go]--> B means the pair belongs to node B (destination), with prev_node='A'. " +
982
988
  "WARNING: forwards belong to the DESTINATION node's pair, NOT the source node. " +
983
989
  "Placing a forward on the wrong pair will cause Progress to get stuck."),
984
990
  }).strict().describe("Node pair in Machine object")
@@ -1294,11 +1300,12 @@ export const ConstantItemSchema = z.object({
1294
1300
  description: z.string().describe('Description')
1295
1301
  }).describe('Constant item');
1296
1302
  export const PermissionInfoTypeSchema = z.object({
1297
- index: z.number().describe('Permission index'),
1298
- name: z.string().describe('Name'),
1299
- description: z.string().describe('Description'),
1300
- object_type: z.string().describe('Object type')
1301
- }).describe('Permission info type');
1303
+ index: z.number().describe('Permission index (e.g. 315 for service.compensation_fund_deposit)'),
1304
+ name: z.string().describe('Permission name (e.g. "service.compensation_fund_deposit")'),
1305
+ description: z.string().describe('Description of what this permission allows'),
1306
+ object_type: z.string().describe('Object type this permission belongs to (e.g. "Service", "Arbitration")'),
1307
+ 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"}.')
1308
+ }).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
1309
  export const GuardInstructSchema = z.object({
1303
1310
  name: z.string().describe('Name of the guard instruction'),
1304
1311
  id: z.number().int().describe('ID of the guard instruction (OperatorType or ContextType)'),
@@ -1327,8 +1334,23 @@ export const PermissionFilterSchema = z.object({
1327
1334
  objectType: z.optional(ObjectTypeSchema).describe('Object type filter'),
1328
1335
  name: z.optional(z.string()).describe('Name filter'),
1329
1336
  index: z.optional(PermissionIndexTypeSchema).describe('Index filter'),
1330
- description: z.optional(z.string()).describe('Description filter')
1337
+ description: z.optional(z.string()).describe('Description filter'),
1338
+ 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
1339
  }).describe('Permission filter');
1340
+ export const CommonMistakeInfoSchema = z.object({
1341
+ object_type: z.string().describe('The object type this mistake applies to (e.g. "Service", "Arbitration")'),
1342
+ operation: z.string().describe('The operation field name this mistake applies to (e.g. "compensation_fund_add", "voting_deadline")'),
1343
+ 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)'),
1344
+ mistake: z.string().describe('Short description of the mistake'),
1345
+ correct_usage: z.string().describe('The correct usage pattern'),
1346
+ wrong_example: z.string().describe('Example of the wrong usage'),
1347
+ correct_example: z.string().describe('Example of the correct usage')
1348
+ }).describe('A known common mistake for an on-chain operation. Use this to proactively warn users before they submit a transaction.');
1349
+ export const CommonMistakeFilterSchema = z.object({
1350
+ object_type: z.optional(z.string()).describe('Filter by object type (e.g. "Service")'),
1351
+ operation: z.optional(z.string()).describe('Filter by operation field name (e.g. "compensation_fund_add")'),
1352
+ 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)')
1353
+ }).describe('Filter for common mistakes. Use operation:"compensation_fund_add" to find mistakes for a specific operation.');
1332
1354
  export const BridgeTokenInfoSchema = z.object({
1333
1355
  tokenId: z.number().describe('On-chain token ID (mainnet: WBTC=1, ETH/WETH=2, USDC=3, USDT=4)'),
1334
1356
  symbol: z.string().describe('Token symbol/abbreviation (ETH, WETH, WBTC, USDC, USDT)'),
@@ -1345,8 +1367,12 @@ export const ProtocolInfoQuerySchema = z.discriminatedUnion('info', [
1345
1367
  }).strict().describe('Constants query'),
1346
1368
  z.object({
1347
1369
  info: z.literal('built-in permissions'),
1348
- filter: z.optional(PermissionFilterSchema).describe('Filter for built-in permissions')
1349
- }).strict().describe('Built-in permissions query'),
1370
+ filter: z.optional(PermissionFilterSchema).describe('Filter for built-in permissions. Use operation:"compensation_fund_add" to find which permission a specific operation requires.')
1371
+ }).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).'),
1372
+ z.object({
1373
+ info: z.literal('common mistakes'),
1374
+ 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.')
1375
+ }).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
1376
  z.object({
1351
1377
  info: z.literal('guard instructions'),
1352
1378
  filter: z.optional(GuardInstructFilterOptionsSchema).describe('Filter for guard instructions')
@@ -1371,7 +1397,11 @@ export const ProtocolInfoResultWrappedSchema = z.discriminatedUnion('info', [
1371
1397
  }),
1372
1398
  z.object({
1373
1399
  info: z.literal('built-in permissions'),
1374
- result: z.array(PermissionInfoTypeSchema).describe('Built-in permissions result')
1400
+ 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.')
1401
+ }),
1402
+ z.object({
1403
+ info: z.literal('common mistakes'),
1404
+ 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
1405
  }),
1376
1406
  z.object({
1377
1407
  info: z.literal('guard instructions'),