@wowok/agent-mcp 2.3.16 → 2.4.1
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/index.d.ts +9 -0
- package/dist/customer/index.js +9 -0
- package/dist/customer/industry-risks.d.ts +4 -0
- package/dist/customer/industry-risks.js +45 -31
- package/dist/customer/order-monitor.js +57 -57
- package/dist/customer/order-strategy.js +89 -89
- package/dist/customer/post-purchase.js +97 -97
- package/dist/customer/reminder-system.js +26 -26
- package/dist/customer/risk-assessment.js +46 -46
- package/dist/customer/types.d.ts +4 -4
- package/dist/customer/types.js +4 -4
- package/dist/customer/user-preferences.d.ts +3 -0
- package/dist/customer/user-preferences.js +59 -50
- package/dist/experience/intent-distill.js +6 -6
- package/dist/experience/realtime-feedback.js +17 -0
- package/dist/index.js +360 -273
- package/dist/knowledge/acquisition-flywheel.d.ts +3 -0
- package/dist/knowledge/acquisition-flywheel.js +73 -64
- package/dist/knowledge/arbitration-trust.js +10 -10
- package/dist/knowledge/demand-matching.js +8 -8
- package/dist/knowledge/dynamic-pricing.js +18 -18
- package/dist/knowledge/flywheel-loop.js +11 -11
- package/dist/knowledge/glossary.js +22 -22
- package/dist/knowledge/guard-ledger.d.ts +19 -0
- package/dist/knowledge/guard-ledger.js +246 -0
- package/dist/knowledge/guard-lint.d.ts +76 -0
- package/dist/knowledge/guard-lint.js +590 -0
- package/dist/knowledge/guard-puzzle.d.ts +188 -0
- package/dist/knowledge/guard-puzzle.js +804 -0
- package/dist/knowledge/guard-risk.d.ts +67 -0
- package/dist/knowledge/guard-risk.js +1046 -0
- package/dist/knowledge/guard-templates.d.ts +37 -0
- package/dist/knowledge/guard-templates.js +329 -0
- package/dist/knowledge/guard-translation.d.ts +58 -0
- package/dist/knowledge/guard-translation.js +1118 -0
- package/dist/knowledge/index.d.ts +17 -0
- package/dist/knowledge/index.js +17 -0
- package/dist/knowledge/industry-evolution.js +29 -29
- package/dist/knowledge/industry-generalizer.js +52 -52
- package/dist/knowledge/industry-registry.d.ts +1 -2
- package/dist/knowledge/industry-registry.js +43 -36
- package/dist/knowledge/intent-metrics.js +67 -67
- package/dist/knowledge/process-model.js +80 -80
- package/dist/knowledge/reputation-rules.js +9 -9
- package/dist/knowledge/reward-templates.js +51 -51
- package/dist/knowledge/safety-rules.js +63 -2
- package/dist/knowledge/tool-constraints.js +17 -11
- package/dist/knowledge/trust-metrics.js +26 -26
- package/dist/safety/confirm-gate.d.ts +4 -2
- package/dist/safety/confirm-gate.js +48 -4
- package/dist/schema/call/allocation.d.ts +24 -14
- package/dist/schema/call/arbitration.d.ts +142 -132
- package/dist/schema/call/base.d.ts +901 -43
- package/dist/schema/call/base.js +77 -13
- package/dist/schema/call/bridge-handler.js +15 -2
- package/dist/schema/call/bridge.d.ts +795 -27
- package/dist/schema/call/bridge.js +37 -0
- package/dist/schema/call/contact.d.ts +10 -0
- package/dist/schema/call/demand.d.ts +94 -84
- package/dist/schema/call/guard.d.ts +229 -46
- package/dist/schema/call/guard.js +50 -0
- package/dist/schema/call/handler.js +46 -14
- package/dist/schema/call/machine.d.ts +158 -138
- package/dist/schema/call/order.d.ts +10 -0
- package/dist/schema/call/payment.d.ts +10 -0
- package/dist/schema/call/permission.d.ts +314 -304
- package/dist/schema/call/personal.d.ts +10 -0
- package/dist/schema/call/progress.d.ts +10 -0
- package/dist/schema/call/proof.d.ts +20 -0
- package/dist/schema/call/repository.d.ts +32 -22
- package/dist/schema/call/reward.d.ts +10 -0
- package/dist/schema/call/semantic.d.ts +9 -2
- package/dist/schema/call/semantic.js +617 -25
- package/dist/schema/call/service.d.ts +20 -10
- package/dist/schema/call/treasury.d.ts +10 -0
- package/dist/schema/config/index.d.ts +18 -0
- package/dist/schema/config/index.js +17 -0
- package/dist/schema/index.d.ts +6 -0
- package/dist/schema/index.js +5 -0
- package/dist/schema/local/index.d.ts +9 -9
- package/dist/schema/local/index.js +9 -0
- package/dist/schema/local/wip.d.ts +39 -19
- package/dist/schema/local/wip.js +5 -5
- package/dist/schema/messenger/index.d.ts +376 -55
- package/dist/schema/messenger/index.js +19 -19
- package/dist/schema/operations.d.ts +1881 -681
- package/dist/schema/operations.js +91 -96
- package/dist/schema/project/index.d.ts +21 -0
- package/dist/schema/project/index.js +32 -0
- package/dist/schema/query/index.d.ts +1074 -168
- package/dist/schema/query/index.js +8 -8
- package/dist/schema/schema-query/index.d.ts +33 -0
- package/dist/schema/schema-query/index.js +36 -0
- package/dist/schema/schema-version.d.ts +25 -0
- package/dist/schema/schema-version.js +76 -0
- package/dist/schema/trust/index.d.ts +407 -0
- package/dist/schema/trust/index.js +113 -0
- package/dist/schema/utils/guard-parser.js +4 -4
- package/dist/schema/utils/node-parser.js +14 -14
- package/dist/schemas/bridge_operation.output.json +233 -9
- package/dist/schemas/bridge_operation.schema.json +67 -8
- package/dist/schemas/config_operation.output.json +18 -0
- package/dist/schemas/config_operation.schema.json +34 -0
- package/dist/schemas/guard-node-schema.json +82 -0
- package/dist/schemas/guard2file.schema.json +8 -0
- package/dist/schemas/index.json +19 -1
- package/dist/schemas/machineNode2file.schema.json +8 -0
- package/dist/schemas/messenger_operation.output.json +236 -10
- package/dist/schemas/onchain_events.output.json +718 -0
- package/dist/schemas/onchain_operations.output.json +286 -11
- package/dist/schemas/onchain_operations.schema.json +19 -16
- package/dist/schemas/onchain_operations_allocation.schema.json +8 -0
- package/dist/schemas/onchain_operations_arbitration.schema.json +8 -0
- package/dist/schemas/onchain_operations_contact.schema.json +8 -0
- package/dist/schemas/onchain_operations_demand.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -0
- package/dist/schemas/onchain_operations_guard.schema.json +11 -16
- package/dist/schemas/onchain_operations_machine.schema.json +8 -0
- package/dist/schemas/onchain_operations_order.schema.json +8 -0
- package/dist/schemas/onchain_operations_payment.schema.json +8 -0
- package/dist/schemas/onchain_operations_permission.schema.json +8 -0
- package/dist/schemas/onchain_operations_personal.schema.json +8 -0
- package/dist/schemas/onchain_operations_progress.schema.json +8 -0
- package/dist/schemas/onchain_operations_repository.schema.json +8 -0
- package/dist/schemas/onchain_operations_reward.schema.json +8 -0
- package/dist/schemas/onchain_operations_service.schema.json +8 -0
- package/dist/schemas/onchain_operations_treasury.schema.json +8 -0
- package/dist/schemas/onchain_table_data.output.json +718 -0
- package/dist/schemas/project_operation.output.json +18 -0
- package/dist/schemas/project_operation.schema.json +42 -0
- package/dist/schemas/query_toolkit.schema.json +360 -368
- package/dist/schemas/schema_query.schema.json +6 -3
- package/dist/schemas/trust_score.output.json +327 -0
- package/dist/schemas/trust_score.schema.json +46 -0
- package/dist/schemas/wip_file.output.json +24 -1
- package/package.json +2 -2
|
@@ -24,6 +24,9 @@ export interface TrustDescriptionParams {
|
|
|
24
24
|
}
|
|
25
25
|
export declare const ACQUISITION_FLYWHEEL_VERSION = 1;
|
|
26
26
|
export declare const INDUSTRY_FLYWHEELS: AcquisitionFlywheel[];
|
|
27
|
+
export declare function _setRegistryLookup(fn: ((industry: string) => {
|
|
28
|
+
flywheel?: AcquisitionFlywheel;
|
|
29
|
+
} | undefined) | null): void;
|
|
27
30
|
export declare function getFlywheelForIndustry(industry: string): AcquisitionFlywheel | undefined;
|
|
28
31
|
export declare function listIndustries(): string[];
|
|
29
32
|
export declare function suggestAcquisitionActions(industry: string): FlywheelAction[];
|
|
@@ -3,95 +3,104 @@ export const INDUSTRY_FLYWHEELS = [
|
|
|
3
3
|
{
|
|
4
4
|
industry: "freelance",
|
|
5
5
|
trustSellingPoints: [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"compensation_fund
|
|
6
|
+
"Delivery acceptance + fund escrow + arbitration guarantee",
|
|
7
|
+
"Transparent process: Machine defines clear delivery nodes",
|
|
8
|
+
"compensation_fund secures customer rights",
|
|
9
9
|
],
|
|
10
10
|
keyActions: [
|
|
11
|
-
{ action: "
|
|
12
|
-
{ action: "
|
|
13
|
-
{ action: "
|
|
14
|
-
{ action: "
|
|
11
|
+
{ action: "Set Reward first-order bonus", purpose: "Attract new customers to place orders", mutableField: "rewards", metricToWatch: "New customer order rate" },
|
|
12
|
+
{ action: "Cumulative-spend tiered Reward", purpose: "Incentivize repurchase", mutableField: "rewards", metricToWatch: "Repurchase rate" },
|
|
13
|
+
{ action: "Adjust Machine nodes", purpose: "Optimize delivery process speed", mutableField: "description", metricToWatch: "Average completion time" },
|
|
14
|
+
{ action: "Increase compensation_fund", purpose: "Improve trust score", mutableField: "compensation_fund", metricToWatch: "Trust score" },
|
|
15
15
|
],
|
|
16
|
-
rewardStrategy: "
|
|
17
|
-
discountStrategy: "
|
|
18
|
-
trustDescription: "
|
|
16
|
+
rewardStrategy: "First-order reward + cumulative-spend tiered reward (e.g. discount after 5 orders)",
|
|
17
|
+
discountStrategy: "Monthly discount + long-term cooperation discount",
|
|
18
|
+
trustDescription: "Fund escrow + delivery acceptance + arbitration guarantee",
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
industry: "rental",
|
|
22
22
|
trustSellingPoints: [
|
|
23
|
-
"
|
|
24
|
-
"Guard
|
|
25
|
-
"compensation_fund
|
|
23
|
+
"Deposit escrow + damage Guard + return process",
|
|
24
|
+
"Guard verifies item condition to prevent disputes",
|
|
25
|
+
"compensation_fund covers damage risk",
|
|
26
26
|
],
|
|
27
27
|
keyActions: [
|
|
28
|
-
{ action: "
|
|
29
|
-
{ action: "
|
|
30
|
-
{ action: "
|
|
31
|
-
{ action: "
|
|
28
|
+
{ action: "Set Discount long-term rental bonus", purpose: "Incentivize long-term rental", mutableField: "discount", metricToWatch: "Long-term rental ratio" },
|
|
29
|
+
{ action: "Credit-accumulation Reward", purpose: "Multi-rental credit accumulation", mutableField: "rewards", metricToWatch: "Re-rental rate" },
|
|
30
|
+
{ action: "Configure damage Guard", purpose: "Reduce dispute rate", mutableField: "buy_guard", metricToWatch: "Dispute rate" },
|
|
31
|
+
{ action: "Increase compensation_fund", purpose: "Cover damage risk", mutableField: "compensation_fund", metricToWatch: "Trust score" },
|
|
32
32
|
],
|
|
33
|
-
rewardStrategy: "
|
|
34
|
-
discountStrategy: "
|
|
35
|
-
trustDescription: "
|
|
33
|
+
rewardStrategy: "Credit accumulation + long-term rental discount + referral cashback",
|
|
34
|
+
discountStrategy: "Monthly 10% off + quarterly 20% off + annual 30% off",
|
|
35
|
+
trustDescription: "Deposit escrow + Guard verification + return guarantee",
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
industry: "education",
|
|
39
39
|
trustSellingPoints: [
|
|
40
|
-
"
|
|
41
|
-
"Machine
|
|
40
|
+
"Transparent course progress + refund Guard",
|
|
41
|
+
"Machine defines learning stages and acceptance nodes",
|
|
42
42
|
],
|
|
43
43
|
keyActions: [
|
|
44
|
-
{ action: "
|
|
45
|
-
{ action: "
|
|
44
|
+
{ action: "Set milestone Reward", purpose: "Incentivize course completion", mutableField: "rewards", metricToWatch: "Course completion rate" },
|
|
45
|
+
{ action: "Referral cashback Reward", purpose: "Viral acquisition", mutableField: "rewards", metricToWatch: "Referral rate" },
|
|
46
46
|
],
|
|
47
|
-
rewardStrategy: "
|
|
48
|
-
discountStrategy: "
|
|
49
|
-
trustDescription: "
|
|
47
|
+
rewardStrategy: "Milestone reward + referral cashback + trial-class discount",
|
|
48
|
+
discountStrategy: "Early-bird price + group-buy price + student-aid discount",
|
|
49
|
+
trustDescription: "Transparent progress + refund guarantee + acceptance nodes",
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
industry: "travel",
|
|
53
53
|
trustSellingPoints: [
|
|
54
|
-
"
|
|
55
|
-
"Guard
|
|
54
|
+
"Itinerary escrow + cancellation Guard + arbitration guarantee",
|
|
55
|
+
"Guard verifies itinerary change conditions",
|
|
56
56
|
],
|
|
57
57
|
keyActions: [
|
|
58
|
-
{ action: "
|
|
59
|
-
{ action: "
|
|
58
|
+
{ action: "Limited-time flash-sale Reward", purpose: "Clearance promotion", mutableField: "rewards", metricToWatch: "Conversion rate" },
|
|
59
|
+
{ action: "Spend cashback Reward", purpose: "Improve repurchase", mutableField: "rewards", metricToWatch: "Repurchase rate" },
|
|
60
60
|
],
|
|
61
|
-
rewardStrategy: "
|
|
62
|
-
discountStrategy: "
|
|
63
|
-
trustDescription: "
|
|
61
|
+
rewardStrategy: "Limited-time flash sale + spend cashback + referral commission",
|
|
62
|
+
discountStrategy: "Early-bird price + group-buy price + member price",
|
|
63
|
+
trustDescription: "Itinerary escrow + cancellation guarantee + arbitration",
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
industry: "subscription",
|
|
67
67
|
trustSellingPoints: [
|
|
68
|
-
"
|
|
69
|
-
"Machine
|
|
68
|
+
"Transparent subscription + auto-renewal Guard + cancel anytime",
|
|
69
|
+
"Machine defines billing cycles and auto-debit",
|
|
70
70
|
],
|
|
71
71
|
keyActions: [
|
|
72
|
-
{ action: "
|
|
73
|
-
{ action: "
|
|
72
|
+
{ action: "Loyalty Reward", purpose: "Long-term retention", mutableField: "rewards", metricToWatch: "Renewal rate" },
|
|
73
|
+
{ action: "Referral cashback Reward", purpose: "Viral acquisition", mutableField: "rewards", metricToWatch: "Referral rate" },
|
|
74
74
|
],
|
|
75
|
-
rewardStrategy: "
|
|
76
|
-
discountStrategy: "
|
|
77
|
-
trustDescription: "
|
|
75
|
+
rewardStrategy: "Loyalty reward + referral cashback + first-month discount",
|
|
76
|
+
discountStrategy: "Annual discount + team discount + upgrade discount",
|
|
77
|
+
trustDescription: "Transparent subscription + renewal guarantee + cancel anytime",
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
industry: "retail",
|
|
81
81
|
trustSellingPoints: [
|
|
82
|
-
"
|
|
83
|
-
"Guard
|
|
82
|
+
"Transaction escrow + logistics Guard + refund guarantee",
|
|
83
|
+
"Guard verifies shipping and receipt",
|
|
84
84
|
],
|
|
85
85
|
keyActions: [
|
|
86
|
-
{ action: "
|
|
87
|
-
{ action: "
|
|
86
|
+
{ action: "First-order discount", purpose: "Attract new customers", mutableField: "discount", metricToWatch: "New customer order rate" },
|
|
87
|
+
{ action: "Spend cashback Reward", purpose: "Improve repurchase", mutableField: "rewards", metricToWatch: "Repurchase rate" },
|
|
88
88
|
],
|
|
89
|
-
rewardStrategy: "
|
|
90
|
-
discountStrategy: "
|
|
91
|
-
trustDescription: "
|
|
89
|
+
rewardStrategy: "First-order discount + spend cashback + spend-threshold discount",
|
|
90
|
+
discountStrategy: "Spend-threshold discount + limited-time discount + member price",
|
|
91
|
+
trustDescription: "Transaction escrow + logistics Guard + refund guarantee",
|
|
92
92
|
},
|
|
93
93
|
];
|
|
94
|
+
let _registryLookup = null;
|
|
95
|
+
export function _setRegistryLookup(fn) {
|
|
96
|
+
_registryLookup = fn;
|
|
97
|
+
}
|
|
94
98
|
export function getFlywheelForIndustry(industry) {
|
|
99
|
+
if (_registryLookup) {
|
|
100
|
+
const profile = _registryLookup(industry);
|
|
101
|
+
if (profile?.flywheel)
|
|
102
|
+
return profile.flywheel;
|
|
103
|
+
}
|
|
95
104
|
return INDUSTRY_FLYWHEELS.find((f) => f.industry === industry.toLowerCase());
|
|
96
105
|
}
|
|
97
106
|
export function listIndustries() {
|
|
@@ -110,29 +119,29 @@ export function generateTrustDescription(params) {
|
|
|
110
119
|
}
|
|
111
120
|
}
|
|
112
121
|
if (params.orderCount !== undefined && params.orderCount > 0) {
|
|
113
|
-
parts.push(
|
|
122
|
+
parts.push(`Completed ${params.orderCount} orders`);
|
|
114
123
|
}
|
|
115
124
|
if (params.completedRate !== undefined) {
|
|
116
|
-
parts.push(
|
|
125
|
+
parts.push(`Completion rate ${Math.round(params.completedRate * 100)}%`);
|
|
117
126
|
}
|
|
118
127
|
if (params.avgCompletionTime !== undefined) {
|
|
119
128
|
if (params.avgCompletionTime < 1) {
|
|
120
|
-
parts.push(
|
|
129
|
+
parts.push(`Average completion time ${Math.round(params.avgCompletionTime * 60)} minutes`);
|
|
121
130
|
}
|
|
122
131
|
else {
|
|
123
|
-
parts.push(
|
|
132
|
+
parts.push(`Average completion time ${Math.round(params.avgCompletionTime)} hours`);
|
|
124
133
|
}
|
|
125
134
|
}
|
|
126
135
|
if (params.hasCompensationFund) {
|
|
127
|
-
parts.push("
|
|
136
|
+
parts.push("Sufficient compensation fund");
|
|
128
137
|
}
|
|
129
138
|
if (params.hasArbitration) {
|
|
130
|
-
parts.push("
|
|
139
|
+
parts.push("Third-party arbitration guarantee");
|
|
131
140
|
}
|
|
132
141
|
if (params.reviewCount !== undefined && params.reviewCount > 0 && params.reviewLikeRate !== undefined) {
|
|
133
|
-
parts.push(
|
|
142
|
+
parts.push(`Like rate ${Math.round(params.reviewLikeRate * 100)}% (${params.reviewCount} reviews)`);
|
|
134
143
|
}
|
|
135
|
-
return parts.join("
|
|
144
|
+
return parts.join("; ") || "No trust data available";
|
|
136
145
|
}
|
|
137
146
|
export function buildAcquisitionDashboard(params) {
|
|
138
147
|
const { orderCount, completedRate, avgCompletionTime, repeatCustomerRate, reviewLikeRate, reviewCount } = params;
|
|
@@ -145,27 +154,27 @@ export function buildAcquisitionDashboard(params) {
|
|
|
145
154
|
stage = "growing";
|
|
146
155
|
const suggestions = [];
|
|
147
156
|
if (stage === "cold_start") {
|
|
148
|
-
suggestions.push("
|
|
149
|
-
suggestions.push("
|
|
157
|
+
suggestions.push("Cold-start stage: set first-order Reward to attract new customers");
|
|
158
|
+
suggestions.push("Increase compensation_fund to boost initial trust");
|
|
150
159
|
}
|
|
151
160
|
else if (stage === "growing") {
|
|
152
|
-
suggestions.push("
|
|
161
|
+
suggestions.push("Growing stage: set referral cashback Reward for viral acquisition");
|
|
153
162
|
if (repeatCustomerRate !== undefined && repeatCustomerRate < 0.2) {
|
|
154
|
-
suggestions.push("
|
|
163
|
+
suggestions.push("Repurchase rate is low; consider setting cumulative-spend tiered Reward");
|
|
155
164
|
}
|
|
156
165
|
}
|
|
157
166
|
else if (stage === "mature") {
|
|
158
167
|
if (reviewLikeRate !== undefined && reviewLikeRate > 0.8) {
|
|
159
|
-
suggestions.push("
|
|
168
|
+
suggestions.push("High like rate; you can highlight trust metrics in the description");
|
|
160
169
|
}
|
|
161
170
|
if (repeatCustomerRate !== undefined && repeatCustomerRate > 0.3) {
|
|
162
|
-
suggestions.push("
|
|
171
|
+
suggestions.push("High repurchase rate; consider setting loyalty Reward to incentivize long-term customers");
|
|
163
172
|
}
|
|
164
173
|
}
|
|
165
174
|
else {
|
|
166
|
-
suggestions.push("
|
|
175
|
+
suggestions.push("Optimization stage: fine-tune pricing and Reward strategies");
|
|
167
176
|
if (avgCompletionTime !== undefined && avgCompletionTime > 48) {
|
|
168
|
-
suggestions.push("
|
|
177
|
+
suggestions.push("Completion time is long; consider optimizing the Machine process");
|
|
169
178
|
}
|
|
170
179
|
}
|
|
171
180
|
return {
|
|
@@ -87,31 +87,31 @@ function scoreLevel(score) {
|
|
|
87
87
|
function buildWarnings(score, metrics, components) {
|
|
88
88
|
const warnings = [];
|
|
89
89
|
if (score < 50) {
|
|
90
|
-
warnings.push(
|
|
91
|
-
|
|
90
|
+
warnings.push(`Arbitrator trust score is low (${score}/100, ${scoreLevel(score)}). ` +
|
|
91
|
+
`Customers should choose this arbitrator with caution. The user retains data usage authority; the system does not block usage.`);
|
|
92
92
|
}
|
|
93
93
|
if (metrics.disputedVerdicts > 0 && metrics.totalCases > 0) {
|
|
94
94
|
const disputeRate = metrics.disputedVerdicts / metrics.totalCases;
|
|
95
95
|
if (disputeRate > 0.3) {
|
|
96
|
-
warnings.push(
|
|
97
|
-
`${metrics.disputedVerdicts}/${metrics.totalCases}
|
|
96
|
+
warnings.push(`High dispute rate (${(disputeRate * 100).toFixed(1)}%): ` +
|
|
97
|
+
`${metrics.disputedVerdicts}/${metrics.totalCases} cases had disputes.`);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
if (!metrics.hasVerifiedIdentity) {
|
|
101
|
-
warnings.push("
|
|
101
|
+
warnings.push("Arbitrator has not verified on-chain identity (no Personal object); recommend verifying authenticity.");
|
|
102
102
|
}
|
|
103
103
|
if (metrics.avgResponseHours > 72) {
|
|
104
|
-
warnings.push(
|
|
104
|
+
warnings.push(`Arbitrator average response time is long (${metrics.avgResponseHours}h), which may affect dispute resolution efficiency.`);
|
|
105
105
|
}
|
|
106
106
|
return warnings;
|
|
107
107
|
}
|
|
108
108
|
export function quickRiskAssessment(score) {
|
|
109
109
|
const level = scoreLevel(score);
|
|
110
110
|
switch (level) {
|
|
111
|
-
case "high_risk": return "
|
|
112
|
-
case "caution": return "
|
|
113
|
-
case "moderate": return "
|
|
114
|
-
case "trusted": return "
|
|
111
|
+
case "high_risk": return "High risk: recommend changing arbitrator or adding compensation fund protection";
|
|
112
|
+
case "caution": return "Caution: trust score is low, recommend careful evaluation";
|
|
113
|
+
case "moderate": return "Moderate trust: acceptable, recommend continued observation";
|
|
114
|
+
case "trusted": return "High trust: arbitrator performs well";
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
export const ARBITRATION_TRUST_VERSION = 1;
|
|
@@ -23,41 +23,41 @@ function computeMatchScore(demand, service) {
|
|
|
23
23
|
const tagScore = computeTagScore(demand.tags, service.tags);
|
|
24
24
|
score += tagScore;
|
|
25
25
|
if (tagScore >= WEIGHTS.tags * 0.8) {
|
|
26
|
-
reasons.push(`tags
|
|
26
|
+
reasons.push(`High tags match (${tagScore}/${WEIGHTS.tags})`);
|
|
27
27
|
}
|
|
28
28
|
const priceScore = computePriceScore(demand.maxPrice, service.price);
|
|
29
29
|
score += priceScore;
|
|
30
30
|
if (priceScore === WEIGHTS.price) {
|
|
31
|
-
reasons.push(
|
|
31
|
+
reasons.push(`Price within budget`);
|
|
32
32
|
}
|
|
33
33
|
else if (priceScore === 0 && demand.maxPrice && service.price) {
|
|
34
|
-
warnings.push(
|
|
34
|
+
warnings.push(`Price exceeds budget (${service.price} > ${demand.maxPrice})`);
|
|
35
35
|
}
|
|
36
36
|
const scenarioScore = computeScenarioScore(demand.scenario, service.scenario);
|
|
37
37
|
score += scenarioScore;
|
|
38
38
|
if (scenarioScore === WEIGHTS.scenario) {
|
|
39
|
-
reasons.push(
|
|
39
|
+
reasons.push(`Industry scenario matches (${service.scenario})`);
|
|
40
40
|
}
|
|
41
41
|
const trustScore = computeTrustScore(service.trustScore, demand.minTrustScore);
|
|
42
42
|
score += trustScore;
|
|
43
43
|
if (service.trustScore !== undefined) {
|
|
44
44
|
if (service.trustScore >= 75) {
|
|
45
|
-
reasons.push(
|
|
45
|
+
reasons.push(`High trust score (${service.trustScore}/100)`);
|
|
46
46
|
}
|
|
47
47
|
else if (service.trustScore < 50) {
|
|
48
|
-
warnings.push(
|
|
48
|
+
warnings.push(`Low trust score (${service.trustScore}/100)`);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
const locationScore = computeLocationScore(demand.location, service.location);
|
|
52
52
|
score += locationScore;
|
|
53
53
|
if (locationScore === WEIGHTS.location && demand.location) {
|
|
54
|
-
reasons.push(
|
|
54
|
+
reasons.push(`Geographic location matches (${service.location})`);
|
|
55
55
|
}
|
|
56
56
|
const keywordScore = computeKeywordScore(demand.keywords, service.description);
|
|
57
57
|
score += keywordScore;
|
|
58
58
|
if (demand.minTrustScore !== undefined && service.trustScore !== undefined) {
|
|
59
59
|
if (service.trustScore < demand.minTrustScore) {
|
|
60
|
-
warnings.push(
|
|
60
|
+
warnings.push(`Trust score below requirement (${service.trustScore} < ${demand.minTrustScore})`);
|
|
61
61
|
score -= 10;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export const DYNAMIC_PRICING_VERSION = 1;
|
|
2
2
|
export const MUTABLE_FIELDS = [
|
|
3
|
-
{ field: "sales", purpose: "
|
|
4
|
-
{ field: "discount", purpose: "
|
|
5
|
-
{ field: "description", purpose: "
|
|
6
|
-
{ field: "rewards", purpose: "Reward
|
|
7
|
-
{ field: "arbitrations", purpose: "
|
|
8
|
-
{ field: "compensation_fund", purpose: "
|
|
9
|
-
{ field: "buy_guard", purpose: "
|
|
10
|
-
{ field: "pause", purpose: "
|
|
11
|
-
{ field: "machine", purpose: "
|
|
12
|
-
{ field: "order_allocators", purpose: "
|
|
13
|
-
{ field: "type_parameter", purpose: "
|
|
3
|
+
{ field: "sales", purpose: "Adjust product/price", mutableAfterPublish: true, adjustmentMechanism: "Service.sales mutable", metricToWatch: "Order rate" },
|
|
4
|
+
{ field: "discount", purpose: "Marketing promotion", mutableAfterPublish: true, adjustmentMechanism: "add/set/destroy", metricToWatch: "Conversion rate" },
|
|
5
|
+
{ field: "description", purpose: "Trust description", mutableAfterPublish: true, adjustmentMechanism: "mutable", metricToWatch: "Browse duration" },
|
|
6
|
+
{ field: "rewards", purpose: "Reward marketing campaigns", mutableAfterPublish: true, adjustmentMechanism: "add/remove", metricToWatch: "Repeat rate" },
|
|
7
|
+
{ field: "arbitrations", purpose: "Arbitration upgrade", mutableAfterPublish: true, adjustmentMechanism: "mutable", metricToWatch: "Arbitration rate" },
|
|
8
|
+
{ field: "compensation_fund", purpose: "Trust enhancement", mutableAfterPublish: true, adjustmentMechanism: "add", metricToWatch: "Trust score" },
|
|
9
|
+
{ field: "buy_guard", purpose: "Purchase threshold", mutableAfterPublish: true, adjustmentMechanism: "mutable", metricToWatch: "Order rate" },
|
|
10
|
+
{ field: "pause", purpose: "Pause/resume", mutableAfterPublish: true, adjustmentMechanism: "mutable", metricToWatch: "Inventory status" },
|
|
11
|
+
{ field: "machine", purpose: "Workflow template", mutableAfterPublish: false, adjustmentMechanism: "Locked after publish, new Service required", metricToWatch: "Process speed" },
|
|
12
|
+
{ field: "order_allocators", purpose: "Fund allocation", mutableAfterPublish: false, adjustmentMechanism: "Locked after publish, new Service required", metricToWatch: "Allocation fairness" },
|
|
13
|
+
{ field: "type_parameter", purpose: "Payment token", mutableAfterPublish: false, adjustmentMechanism: "Immutable, can create new Service + Reward to guide migration", metricToWatch: "Token preference" },
|
|
14
14
|
];
|
|
15
15
|
export function suggestPricing(signals) {
|
|
16
16
|
const { supplyCount, demandCount, avgPrice, myPrice, competitorPrices, recentOrderCount, repeatCustomerRate } = signals;
|
|
@@ -20,7 +20,7 @@ export function suggestPricing(signals) {
|
|
|
20
20
|
return {
|
|
21
21
|
action: "increase",
|
|
22
22
|
adjustmentPercent: increasePercent,
|
|
23
|
-
reason:
|
|
23
|
+
reason: `Demand/supply ratio ${supplyDemandRatio.toFixed(1)}, market demand exceeds supply, suggest price increase of ${increasePercent}%`,
|
|
24
24
|
confidence: Math.min(0.9, 0.5 + supplyDemandRatio * 0.1),
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@ export function suggestPricing(signals) {
|
|
|
29
29
|
return {
|
|
30
30
|
action: "decrease",
|
|
31
31
|
adjustmentPercent: decreasePercent,
|
|
32
|
-
reason:
|
|
32
|
+
reason: `Demand/supply ratio ${supplyDemandRatio.toFixed(1)}, market supply exceeds demand, suggest price decrease of ${decreasePercent}% to improve competitiveness`,
|
|
33
33
|
confidence: Math.min(0.85, 0.5 + (1 - supplyDemandRatio) * 0.15),
|
|
34
34
|
};
|
|
35
35
|
}
|
|
@@ -42,7 +42,7 @@ export function suggestPricing(signals) {
|
|
|
42
42
|
return {
|
|
43
43
|
action: "decrease",
|
|
44
44
|
adjustmentPercent: 10,
|
|
45
|
-
reason:
|
|
45
|
+
reason: `Current price is 20%+ above market average, suggest price decrease to improve competitiveness`,
|
|
46
46
|
confidence: 0.7,
|
|
47
47
|
};
|
|
48
48
|
}
|
|
@@ -50,7 +50,7 @@ export function suggestPricing(signals) {
|
|
|
50
50
|
return {
|
|
51
51
|
action: "increase",
|
|
52
52
|
adjustmentPercent: 10,
|
|
53
|
-
reason:
|
|
53
|
+
reason: `Current price is 20%+ below market average, room for price increase`,
|
|
54
54
|
confidence: 0.65,
|
|
55
55
|
};
|
|
56
56
|
}
|
|
@@ -61,7 +61,7 @@ export function suggestPricing(signals) {
|
|
|
61
61
|
if (repeatCustomerRate !== undefined && repeatCustomerRate > 0.4) {
|
|
62
62
|
return {
|
|
63
63
|
action: "maintain",
|
|
64
|
-
reason:
|
|
64
|
+
reason: `Repeat customer rate ${Math.round(repeatCustomerRate * 100)}%, pricing strategy effective, suggest maintaining`,
|
|
65
65
|
confidence: 0.8,
|
|
66
66
|
};
|
|
67
67
|
}
|
|
@@ -69,13 +69,13 @@ export function suggestPricing(signals) {
|
|
|
69
69
|
return {
|
|
70
70
|
action: "decrease",
|
|
71
71
|
adjustmentPercent: 5,
|
|
72
|
-
reason:
|
|
72
|
+
reason: `Repeat customer rate only ${Math.round(repeatCustomerRate * 100)}%, suggest slight price decrease or add Reward to attract repeat purchases`,
|
|
73
73
|
confidence: 0.6,
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
return {
|
|
77
77
|
action: "maintain",
|
|
78
|
-
reason: "
|
|
78
|
+
reason: "Market supply and demand balanced, suggest maintaining current pricing",
|
|
79
79
|
confidence: 0.5,
|
|
80
80
|
};
|
|
81
81
|
}
|
|
@@ -204,7 +204,7 @@ export function injectEvolutionContext(_semantic, industry, role) {
|
|
|
204
204
|
if (!profile) {
|
|
205
205
|
return {
|
|
206
206
|
confidence: 0,
|
|
207
|
-
industry_signal:
|
|
207
|
+
industry_signal: `Industry ${resolved} is not yet registered; recommend synthesizing a profile via the generalizer engine`,
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
210
|
const health = latestHealth.get(resolved);
|
|
@@ -216,30 +216,30 @@ export function injectEvolutionContext(_semantic, industry, role) {
|
|
|
216
216
|
let advice;
|
|
217
217
|
let confidence = 0.5;
|
|
218
218
|
if (health) {
|
|
219
|
-
parts.push(
|
|
219
|
+
parts.push(`Industry health ${health.health_score}/100 (${health.level})`);
|
|
220
220
|
confidence = Math.max(confidence, 0.7);
|
|
221
221
|
if (health.weaknesses.length > 0) {
|
|
222
|
-
advice =
|
|
222
|
+
advice = `Weakness: ${health.weaknesses[0]}`;
|
|
223
223
|
}
|
|
224
224
|
if (health.recommendations.length > 0) {
|
|
225
225
|
advice = advice
|
|
226
|
-
? `${advice}
|
|
227
|
-
:
|
|
226
|
+
? `${advice}; recommendation: ${health.recommendations[0]}`
|
|
227
|
+
: `Recommendation: ${health.recommendations[0]}`;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
if (metrics && metrics.anomalies.length > 0) {
|
|
231
|
-
parts.push(
|
|
231
|
+
parts.push(`Anomaly: ${metrics.anomalies[0]}`);
|
|
232
232
|
confidence = Math.max(confidence, 0.8);
|
|
233
233
|
}
|
|
234
234
|
if (signalCount > 0) {
|
|
235
|
-
parts.push(
|
|
235
|
+
parts.push(`Accumulated ${signalCount} industry signals`);
|
|
236
236
|
}
|
|
237
237
|
if (intent !== "default") {
|
|
238
|
-
parts.push(
|
|
238
|
+
parts.push(`Current intent: ${intent}`);
|
|
239
239
|
}
|
|
240
240
|
if (!advice && suggestions.length > 0) {
|
|
241
241
|
const highPriority = suggestions.find((s) => s.priority === "high") ?? suggestions[0];
|
|
242
|
-
advice = `${highPriority.suggestion_type}
|
|
242
|
+
advice = `${highPriority.suggestion_type}: ${highPriority.evidence}`;
|
|
243
243
|
confidence = Math.max(confidence, highPriority.confidence);
|
|
244
244
|
}
|
|
245
245
|
let roleAdvice;
|
|
@@ -253,11 +253,11 @@ export function injectEvolutionContext(_semantic, industry, role) {
|
|
|
253
253
|
filteredSuggestions = filterSuggestionsByRole(suggestions, role, triggers);
|
|
254
254
|
if (filteredSuggestions.length > 0) {
|
|
255
255
|
const topRole = filteredSuggestions.find((s) => s.priority === "high") ?? filteredSuggestions[0];
|
|
256
|
-
advice = `${topRole.suggestion_type}
|
|
256
|
+
advice = `${topRole.suggestion_type} (${role}): ${topRole.evidence}`;
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
return {
|
|
260
|
-
industry_signal: parts.length > 0 ? parts.join("
|
|
260
|
+
industry_signal: parts.length > 0 ? parts.join("; ") : undefined,
|
|
261
261
|
evolution_advice: advice,
|
|
262
262
|
confidence,
|
|
263
263
|
health_score: health?.health_score,
|