@wowok/agent-mcp 2.6.3 → 2.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -9
- 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 +8 -1
- package/dist/customer/info-puzzle.js +30 -5
- 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 +4 -3
- package/dist/customer/types.d.ts +5 -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 +36 -15
- package/dist/examples/guard-template-time-lock.json +33 -12
- 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 +99 -94
- package/dist/examples/payment-scenario-bound.json +45 -0
- package/dist/examples/rental-ziroom-machine-create.json +126 -114
- package/dist/examples/rental-ziroom-permission-create.json +10 -3
- package/dist/examples/rental-ziroom-service-create.json +27 -18
- 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/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 +192 -5
- package/dist/extensions/constraint-registry.js +3 -1
- package/dist/extensions/modes.js +10 -4
- package/dist/extensions/registry.d.ts +14 -9
- package/dist/extensions/registry.js +69 -14
- package/dist/extensions/types.d.ts +1 -0
- package/dist/knowledge/fund-layer.d.ts +67 -1
- package/dist/knowledge/fund-layer.js +561 -12
- 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-risk.js +4 -1
- 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/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/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/edit-planner.js +27 -56
- package/dist/project/evaluation.d.ts +36 -0
- package/dist/project/evaluation.js +422 -56
- package/dist/project/game-theory.d.ts +43 -0
- package/dist/project/game-theory.js +177 -0
- package/dist/project/graph-builder.js +1 -0
- package/dist/project/handlers.d.ts +38 -0
- package/dist/project/handlers.js +65 -35
- 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/schema/call/allocation.d.ts +11 -11
- package/dist/schema/call/allocation.js +11 -1
- package/dist/schema/call/arbitration.d.ts +21 -21
- package/dist/schema/call/arbitration.js +17 -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/demand.d.ts +3 -3
- package/dist/schema/call/guard.d.ts +11 -11
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/machine.d.ts +216 -21
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/order.d.ts +7 -7
- package/dist/schema/call/payment.d.ts +3 -3
- package/dist/schema/call/permission.d.ts +3 -3
- 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/reward.d.ts +57 -57
- package/dist/schema/call/semantic.js +41 -1
- package/dist/schema/call/service.d.ts +114 -114
- package/dist/schema/call/service.js +11 -2
- package/dist/schema/call/treasury.d.ts +57 -57
- package/dist/schema/messenger/index.js +4 -1
- package/dist/schema/operations.d.ts +713 -291
- package/dist/schema/operations.js +33 -0
- package/dist/schema/project/index.d.ts +4635 -100
- package/dist/schema/project/index.js +868 -1
- package/dist/schema/query/index.d.ts +363 -19
- package/dist/schema/query/index.js +25 -3
- package/dist/schema/schema-query/index.d.ts +13 -7
- package/dist/schema/schema-query/index.js +29 -5
- package/dist/schema/trust/index.d.ts +1012 -6
- package/dist/schema/trust/index.js +212 -11
- package/dist/schema/utils/skills-recommendation.js +1 -0
- package/dist/schema-query/index.d.ts +4 -1
- package/dist/schema-query/index.js +255 -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_operations.schema.json +143 -15
- package/dist/schemas/onchain_operations_allocation.schema.json +2 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +7 -5
- package/dist/schemas/onchain_operations_contact.schema.json +1 -0
- package/dist/schemas/onchain_operations_demand.schema.json +1 -0
- package/dist/schemas/onchain_operations_gen_passport.schema.json +2 -0
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -0
- package/dist/schemas/onchain_operations_guard.schema.json +578 -0
- package/dist/schemas/onchain_operations_machine.schema.json +1 -0
- package/dist/schemas/onchain_operations_order.schema.json +4 -3
- package/dist/schemas/onchain_operations_payment.schema.json +1 -0
- package/dist/schemas/onchain_operations_permission.schema.json +1 -0
- package/dist/schemas/onchain_operations_personal.schema.json +37 -0
- package/dist/schemas/onchain_operations_progress.schema.json +90 -3
- package/dist/schemas/onchain_operations_proof.schema.json +1 -0
- package/dist/schemas/onchain_operations_repository.schema.json +1 -0
- package/dist/schemas/onchain_operations_reward.schema.json +1 -0
- package/dist/schemas/onchain_operations_service.schema.json +4 -3
- package/dist/schemas/onchain_operations_treasury.schema.json +1 -0
- package/dist/schemas/project_operation.output.json +2243 -1
- package/dist/schemas/project_operation.schema.json +683 -1
- package/dist/schemas/query_toolkit.output.json +1 -1
- package/dist/schemas/query_toolkit.schema.json +37 -0
- package/dist/schemas/schema_query.output.json +1 -1
- package/dist/schemas/schema_query.schema.json +30 -5
- package/dist/schemas/trust_score.output.json +392 -1
- package/dist/schemas/trust_score.schema.json +275 -1
- package/dist/tools/handlers/onchain.js +73 -8
- package/dist/tools/handlers/project.js +46 -0
- package/dist/tools/handlers/query.js +117 -2
- package/dist/tools/handlers/schema-query.js +41 -0
- package/dist/tools/handlers/trust.js +192 -6
- package/dist/tools/index.js +52 -9
- package/dist/tools/wrap.js +194 -15
- package/package.json +2 -2
|
@@ -310,6 +310,15 @@ export declare const CallReward_DataSchema: z.ZodObject<{
|
|
|
310
310
|
} | {
|
|
311
311
|
coin: string;
|
|
312
312
|
} | undefined;
|
|
313
|
+
receive?: {
|
|
314
|
+
received: {
|
|
315
|
+
id: string;
|
|
316
|
+
balance: string | number;
|
|
317
|
+
payment: string;
|
|
318
|
+
}[];
|
|
319
|
+
balance: string | number;
|
|
320
|
+
token_type: string;
|
|
321
|
+
} | "recently" | undefined;
|
|
313
322
|
claim?: string | undefined;
|
|
314
323
|
um?: string | null | undefined;
|
|
315
324
|
owner_receive?: {
|
|
@@ -325,15 +334,6 @@ export declare const CallReward_DataSchema: z.ZodObject<{
|
|
|
325
334
|
id: string;
|
|
326
335
|
content_raw?: any;
|
|
327
336
|
}[] | undefined;
|
|
328
|
-
receive?: {
|
|
329
|
-
received: {
|
|
330
|
-
id: string;
|
|
331
|
-
balance: string | number;
|
|
332
|
-
payment: string;
|
|
333
|
-
}[];
|
|
334
|
-
balance: string | number;
|
|
335
|
-
token_type: string;
|
|
336
|
-
} | "recently" | undefined;
|
|
337
337
|
guard_add?: {
|
|
338
338
|
amount: {
|
|
339
339
|
value: number;
|
|
@@ -379,6 +379,15 @@ export declare const CallReward_DataSchema: z.ZodObject<{
|
|
|
379
379
|
} | {
|
|
380
380
|
coin: string;
|
|
381
381
|
} | undefined;
|
|
382
|
+
receive?: {
|
|
383
|
+
received: {
|
|
384
|
+
id: string;
|
|
385
|
+
balance: string | number;
|
|
386
|
+
payment: string;
|
|
387
|
+
}[];
|
|
388
|
+
balance: string | number;
|
|
389
|
+
token_type: string;
|
|
390
|
+
} | "recently" | undefined;
|
|
382
391
|
claim?: string | undefined;
|
|
383
392
|
um?: string | null | undefined;
|
|
384
393
|
owner_receive?: {
|
|
@@ -394,15 +403,6 @@ export declare const CallReward_DataSchema: z.ZodObject<{
|
|
|
394
403
|
id: string;
|
|
395
404
|
content_raw?: any;
|
|
396
405
|
}[] | undefined;
|
|
397
|
-
receive?: {
|
|
398
|
-
received: {
|
|
399
|
-
id: string;
|
|
400
|
-
balance: string | number;
|
|
401
|
-
payment: string;
|
|
402
|
-
}[];
|
|
403
|
-
balance: string | number;
|
|
404
|
-
token_type: string;
|
|
405
|
-
} | "recently" | undefined;
|
|
406
406
|
guard_add?: {
|
|
407
407
|
amount: {
|
|
408
408
|
value: number;
|
|
@@ -702,6 +702,15 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
702
702
|
} | {
|
|
703
703
|
coin: string;
|
|
704
704
|
} | undefined;
|
|
705
|
+
receive?: {
|
|
706
|
+
received: {
|
|
707
|
+
id: string;
|
|
708
|
+
balance: string | number;
|
|
709
|
+
payment: string;
|
|
710
|
+
}[];
|
|
711
|
+
balance: string | number;
|
|
712
|
+
token_type: string;
|
|
713
|
+
} | "recently" | undefined;
|
|
705
714
|
claim?: string | undefined;
|
|
706
715
|
um?: string | null | undefined;
|
|
707
716
|
owner_receive?: {
|
|
@@ -717,15 +726,6 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
717
726
|
id: string;
|
|
718
727
|
content_raw?: any;
|
|
719
728
|
}[] | undefined;
|
|
720
|
-
receive?: {
|
|
721
|
-
received: {
|
|
722
|
-
id: string;
|
|
723
|
-
balance: string | number;
|
|
724
|
-
payment: string;
|
|
725
|
-
}[];
|
|
726
|
-
balance: string | number;
|
|
727
|
-
token_type: string;
|
|
728
|
-
} | "recently" | undefined;
|
|
729
729
|
guard_add?: {
|
|
730
730
|
amount: {
|
|
731
731
|
value: number;
|
|
@@ -771,6 +771,15 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
771
771
|
} | {
|
|
772
772
|
coin: string;
|
|
773
773
|
} | undefined;
|
|
774
|
+
receive?: {
|
|
775
|
+
received: {
|
|
776
|
+
id: string;
|
|
777
|
+
balance: string | number;
|
|
778
|
+
payment: string;
|
|
779
|
+
}[];
|
|
780
|
+
balance: string | number;
|
|
781
|
+
token_type: string;
|
|
782
|
+
} | "recently" | undefined;
|
|
774
783
|
claim?: string | undefined;
|
|
775
784
|
um?: string | null | undefined;
|
|
776
785
|
owner_receive?: {
|
|
@@ -786,15 +795,6 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
786
795
|
id: string;
|
|
787
796
|
content_raw?: any;
|
|
788
797
|
}[] | undefined;
|
|
789
|
-
receive?: {
|
|
790
|
-
received: {
|
|
791
|
-
id: string;
|
|
792
|
-
balance: string | number;
|
|
793
|
-
payment: string;
|
|
794
|
-
}[];
|
|
795
|
-
balance: string | number;
|
|
796
|
-
token_type: string;
|
|
797
|
-
} | "recently" | undefined;
|
|
798
798
|
guard_add?: {
|
|
799
799
|
amount: {
|
|
800
800
|
value: number;
|
|
@@ -830,10 +830,11 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
830
830
|
user_intent_phrases: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
831
831
|
project: z.ZodOptional<z.ZodString>;
|
|
832
832
|
client_schema_version: z.ZodOptional<z.ZodString>;
|
|
833
|
-
schema_strict_mode: z.ZodOptional<z.ZodBoolean
|
|
833
|
+
schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
834
834
|
dry_run: z.ZodOptional<z.ZodBoolean>;
|
|
835
835
|
}, "strict", z.ZodTypeAny, {
|
|
836
836
|
account: string;
|
|
837
|
+
schema_strict_mode: boolean;
|
|
837
838
|
no_cache?: boolean | undefined;
|
|
838
839
|
network?: import("@wowok/wowok").ENTRYPOINT | undefined;
|
|
839
840
|
permission_guard?: string[] | undefined;
|
|
@@ -842,7 +843,6 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
842
843
|
user_intent_phrases?: string[] | undefined;
|
|
843
844
|
project?: string | undefined;
|
|
844
845
|
client_schema_version?: string | undefined;
|
|
845
|
-
schema_strict_mode?: boolean | undefined;
|
|
846
846
|
dry_run?: boolean | undefined;
|
|
847
847
|
}, {
|
|
848
848
|
no_cache?: boolean | undefined;
|
|
@@ -1059,6 +1059,15 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
1059
1059
|
} | {
|
|
1060
1060
|
coin: string;
|
|
1061
1061
|
} | undefined;
|
|
1062
|
+
receive?: {
|
|
1063
|
+
received: {
|
|
1064
|
+
id: string;
|
|
1065
|
+
balance: string | number;
|
|
1066
|
+
payment: string;
|
|
1067
|
+
}[];
|
|
1068
|
+
balance: string | number;
|
|
1069
|
+
token_type: string;
|
|
1070
|
+
} | "recently" | undefined;
|
|
1062
1071
|
claim?: string | undefined;
|
|
1063
1072
|
um?: string | null | undefined;
|
|
1064
1073
|
owner_receive?: {
|
|
@@ -1074,15 +1083,6 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
1074
1083
|
id: string;
|
|
1075
1084
|
content_raw?: any;
|
|
1076
1085
|
}[] | undefined;
|
|
1077
|
-
receive?: {
|
|
1078
|
-
received: {
|
|
1079
|
-
id: string;
|
|
1080
|
-
balance: string | number;
|
|
1081
|
-
payment: string;
|
|
1082
|
-
}[];
|
|
1083
|
-
balance: string | number;
|
|
1084
|
-
token_type: string;
|
|
1085
|
-
} | "recently" | undefined;
|
|
1086
1086
|
guard_add?: {
|
|
1087
1087
|
amount: {
|
|
1088
1088
|
value: number;
|
|
@@ -1137,6 +1137,7 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
1137
1137
|
} | undefined;
|
|
1138
1138
|
env?: {
|
|
1139
1139
|
account: string;
|
|
1140
|
+
schema_strict_mode: boolean;
|
|
1140
1141
|
no_cache?: boolean | undefined;
|
|
1141
1142
|
network?: import("@wowok/wowok").ENTRYPOINT | undefined;
|
|
1142
1143
|
permission_guard?: string[] | undefined;
|
|
@@ -1145,7 +1146,6 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
1145
1146
|
user_intent_phrases?: string[] | undefined;
|
|
1146
1147
|
project?: string | undefined;
|
|
1147
1148
|
client_schema_version?: string | undefined;
|
|
1148
|
-
schema_strict_mode?: boolean | undefined;
|
|
1149
1149
|
dry_run?: boolean | undefined;
|
|
1150
1150
|
} | undefined;
|
|
1151
1151
|
}, {
|
|
@@ -1170,6 +1170,15 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
1170
1170
|
} | {
|
|
1171
1171
|
coin: string;
|
|
1172
1172
|
} | undefined;
|
|
1173
|
+
receive?: {
|
|
1174
|
+
received: {
|
|
1175
|
+
id: string;
|
|
1176
|
+
balance: string | number;
|
|
1177
|
+
payment: string;
|
|
1178
|
+
}[];
|
|
1179
|
+
balance: string | number;
|
|
1180
|
+
token_type: string;
|
|
1181
|
+
} | "recently" | undefined;
|
|
1173
1182
|
claim?: string | undefined;
|
|
1174
1183
|
um?: string | null | undefined;
|
|
1175
1184
|
owner_receive?: {
|
|
@@ -1185,15 +1194,6 @@ export declare const CallReward_InputSchema: z.ZodObject<{
|
|
|
1185
1194
|
id: string;
|
|
1186
1195
|
content_raw?: any;
|
|
1187
1196
|
}[] | undefined;
|
|
1188
|
-
receive?: {
|
|
1189
|
-
received: {
|
|
1190
|
-
id: string;
|
|
1191
|
-
balance: string | number;
|
|
1192
|
-
payment: string;
|
|
1193
|
-
}[];
|
|
1194
|
-
balance: string | number;
|
|
1195
|
-
token_type: string;
|
|
1196
|
-
} | "recently" | undefined;
|
|
1197
1197
|
guard_add?: {
|
|
1198
1198
|
amount: {
|
|
1199
1199
|
value: number;
|
|
@@ -9,6 +9,7 @@ import { GUARDQUERY } from "@wowok/wowok";
|
|
|
9
9
|
import { assessGuardRisksForOperation, getRiskSummary } from "../../knowledge/guard-risk.js";
|
|
10
10
|
import { derivePuzzleFromCallData, getPuzzleStatusBooleans, getPendingQuestions, generateConfirmationText, } from "../../knowledge/guard-puzzle.js";
|
|
11
11
|
import { inferSceneFromAction } from "../../knowledge/guard-ledger.js";
|
|
12
|
+
import { extractGenericTokenType, registryDisplayHint, } from "../../knowledge/fund-layer.js";
|
|
12
13
|
import { matchSemanticPattern } from "../../knowledge/guard-translation.js";
|
|
13
14
|
function booleanFromSignals(positive, negative) {
|
|
14
15
|
if (positive)
|
|
@@ -17,6 +18,30 @@ function booleanFromSignals(positive, negative) {
|
|
|
17
18
|
return false;
|
|
18
19
|
return undefined;
|
|
19
20
|
}
|
|
21
|
+
function deriveAdviceRole(operationType, data) {
|
|
22
|
+
switch (operationType) {
|
|
23
|
+
case "order":
|
|
24
|
+
case "personal":
|
|
25
|
+
case "demand":
|
|
26
|
+
return "user";
|
|
27
|
+
case "service":
|
|
28
|
+
case "machine":
|
|
29
|
+
case "permission":
|
|
30
|
+
case "reward":
|
|
31
|
+
case "repository":
|
|
32
|
+
case "allocator":
|
|
33
|
+
case "treasury":
|
|
34
|
+
return "merchant";
|
|
35
|
+
case "arbitration":
|
|
36
|
+
if (data?.vote !== undefined)
|
|
37
|
+
return "arbitrator";
|
|
38
|
+
if (data?.dispute !== undefined)
|
|
39
|
+
return "user";
|
|
40
|
+
return undefined;
|
|
41
|
+
default:
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
20
45
|
const ERROR_RULES = [
|
|
21
46
|
{
|
|
22
47
|
patterns: [
|
|
@@ -1117,11 +1142,26 @@ function buildCustomerAdvice(operation_type, data, safeResult) {
|
|
|
1117
1142
|
const profile = getProfile();
|
|
1118
1143
|
const userMinTrust = profile.risk_appetite === "conservative" ? 70
|
|
1119
1144
|
: profile.risk_appetite === "aggressive" ? 30 : 50;
|
|
1145
|
+
let tokenHint;
|
|
1146
|
+
const moneyDisplay = safeResult?._money_display ??
|
|
1147
|
+
(Array.isArray(safeResult?.objects) ? safeResult.objects[0]?._money_display : undefined);
|
|
1148
|
+
const mdEntry = moneyDisplay ? Object.values(moneyDisplay)[0] : undefined;
|
|
1149
|
+
if (mdEntry?.precision_known === true) {
|
|
1150
|
+
tokenHint = { decimals: mdEntry.decimals, symbol: mdEntry.symbol };
|
|
1151
|
+
}
|
|
1152
|
+
else {
|
|
1153
|
+
const typeRaw = safeResult?.type_raw ??
|
|
1154
|
+
(Array.isArray(safeResult?.objects) ? safeResult.objects[0]?.type_raw : undefined);
|
|
1155
|
+
tokenHint =
|
|
1156
|
+
registryDisplayHint(extractGenericTokenType(typeRaw)) ??
|
|
1157
|
+
registryDisplayHint(typeof data?.type_parameter === "string" ? data.type_parameter : undefined);
|
|
1158
|
+
}
|
|
1120
1159
|
const ctx = {
|
|
1121
1160
|
stage,
|
|
1122
1161
|
service_id: serviceId,
|
|
1123
1162
|
order_id: orderId,
|
|
1124
1163
|
service_price: servicePrice,
|
|
1164
|
+
token: tokenHint,
|
|
1125
1165
|
has_arbitration: hasArbitration,
|
|
1126
1166
|
has_compensation: hasCompensation,
|
|
1127
1167
|
has_refund_path: hasRefundPath,
|
|
@@ -1463,7 +1503,7 @@ export function buildSemantic(safeResult, context) {
|
|
|
1463
1503
|
recordIndustrySignal(industryHint, { type: context.operation_type, data: context.data }, outcome);
|
|
1464
1504
|
}
|
|
1465
1505
|
if (industryHint) {
|
|
1466
|
-
const evoCtx = injectEvolutionContext(undefined, industryHint);
|
|
1506
|
+
const evoCtx = injectEvolutionContext(undefined, industryHint, deriveAdviceRole(context.operation_type, context.data));
|
|
1467
1507
|
if (evoCtx && (evoCtx.industry_signal || evoCtx.evolution_advice || evoCtx.confidence > 0)) {
|
|
1468
1508
|
evolution_context = evoCtx;
|
|
1469
1509
|
}
|