@wowok/agent-mcp 2.6.1 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/customer/customer-advice.d.ts +31 -0
- package/dist/customer/customer-advice.js +129 -0
- package/dist/customer/index.d.ts +2 -0
- package/dist/customer/index.js +2 -0
- package/dist/customer/info-puzzle.d.ts +9 -2
- package/dist/customer/info-puzzle.js +34 -7
- package/dist/customer/order-monitor.d.ts +2 -0
- package/dist/customer/order-monitor.js +3 -2
- package/dist/customer/post-purchase.d.ts +2 -0
- package/dist/customer/post-purchase.js +6 -5
- package/dist/customer/preorder-compare.d.ts +24 -0
- package/dist/customer/preorder-compare.js +34 -0
- package/dist/customer/reminder-system.d.ts +2 -0
- package/dist/customer/reminder-system.js +2 -1
- package/dist/customer/risk-assessment.js +30 -7
- package/dist/customer/types.d.ts +7 -0
- package/dist/examples/arbitration-dispute-create.json +41 -0
- package/dist/examples/arbitration-vote-weighted.json +35 -0
- package/dist/examples/arbitration-voting-guard-add.json +38 -0
- package/dist/examples/demand-present-service.json +33 -0
- package/dist/examples/gen-passport-verify-guard.json +48 -0
- package/dist/examples/guard-template-balance-check.json +59 -0
- package/dist/examples/guard-template-time-lock.json +60 -0
- package/dist/examples/insurance-guard-claim-timelock.json +75 -0
- package/dist/examples/insurance-guard-withdraw-allocation.json +96 -0
- package/dist/examples/insurance-machine-create-publish.json +75 -0
- package/dist/examples/insurance-service-allocators-publish.json +56 -0
- package/dist/examples/machine-multisig-threshold.json +86 -0
- package/dist/examples/machine-template-7node-rental.json +119 -0
- package/dist/examples/payment-scenario-bound.json +45 -0
- package/dist/examples/rental-ziroom-machine-create.json +149 -0
- package/dist/examples/rental-ziroom-permission-create.json +42 -0
- package/dist/examples/rental-ziroom-service-create.json +89 -0
- package/dist/examples/retail-adv-guard-customer-win-create.json +80 -0
- package/dist/examples/retail-adv-guard-messenger-proof-create.json +65 -0
- package/dist/examples/retail-adv-guard-reward-timeout-create.json +92 -0
- package/dist/examples/retail-adv-reward-guard-add.json +51 -0
- package/dist/examples/retail-myshop-allocation-activate.json +55 -0
- package/dist/examples/retail-myshop-arbitration-create.json +40 -0
- package/dist/examples/retail-myshop-contact-create.json +43 -0
- package/dist/examples/retail-myshop-order-create.json +56 -0
- package/dist/examples/retail-myshop-progress-operate.json +38 -0
- package/dist/examples/retail-myshop-reward-create.json +35 -0
- package/dist/examples/retail-myshop-service-create.json +88 -0
- package/dist/examples/service-discount-issue.json +46 -0
- package/dist/examples/threebody-guard-create.json +56 -0
- package/dist/examples/threebody-machine-create.json +72 -0
- package/dist/examples/threebody-permission-create.json +38 -0
- package/dist/examples/threebody-service-allocators.json +49 -0
- package/dist/examples/travel-guard-time-lock.json +69 -0
- package/dist/examples/travel-guard-weather-oracle.json +70 -0
- package/dist/examples/travel-machine-create.json +136 -0
- package/dist/examples/travel-repository-create.json +47 -0
- package/dist/examples/travel-service-create.json +102 -0
- package/dist/examples/travel-treasury-create.json +34 -0
- package/dist/examples/treasury-deposit.json +37 -0
- package/dist/examples/treasury-withdraw.json +38 -0
- package/dist/extensions/business-modules.d.ts +49 -0
- package/dist/extensions/business-modules.js +287 -0
- package/dist/extensions/capability-manifest.js +216 -29
- package/dist/extensions/constraint-registry.js +21 -19
- package/dist/extensions/metric-registry.js +14 -14
- package/dist/extensions/mode-evaluator.js +16 -16
- package/dist/extensions/modes.js +141 -49
- package/dist/extensions/registry.d.ts +16 -9
- package/dist/extensions/registry.js +132 -44
- package/dist/extensions/types.d.ts +2 -0
- package/dist/index.js +50 -0
- package/dist/knowledge/deployment-scanner.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +138 -0
- package/dist/knowledge/fund-layer.js +969 -0
- package/dist/knowledge/guard-render.d.ts +57 -0
- package/dist/knowledge/guard-render.js +700 -0
- package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
- package/dist/knowledge/guard-submission-prompt.js +171 -0
- package/dist/knowledge/guard-templates.d.ts +10 -0
- package/dist/knowledge/guard-templates.js +50 -0
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.js +2 -2
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-render.d.ts +41 -0
- package/dist/knowledge/machine-render.js +565 -0
- package/dist/knowledge/machine-risk.js +4 -1
- package/dist/knowledge/machine-templates.js +4 -4
- package/dist/knowledge/progress-context.js +1 -1
- package/dist/knowledge/progress-ledger.js +3 -3
- package/dist/knowledge/progress-templates.js +1 -1
- package/dist/knowledge/progress-translation.js +1 -1
- package/dist/knowledge/reward-confirm.js +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.js +9 -9
- package/dist/knowledge/reward-templates.js +2 -2
- package/dist/knowledge/safety-rules.d.ts +83 -1
- package/dist/knowledge/safety-rules.js +166 -2
- package/dist/knowledge/scenario-modes.d.ts +1 -1
- package/dist/knowledge/scenario-modes.js +13 -11
- package/dist/knowledge/service-confirm.d.ts +1 -1
- package/dist/knowledge/service-confirm.js +3 -3
- package/dist/knowledge/service-context.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-risk.d.ts +1 -1
- package/dist/knowledge/service-risk.js +3 -3
- package/dist/knowledge/service-templates.js +2 -2
- package/dist/knowledge/service-translation.d.ts +1 -1
- package/dist/knowledge/service-translation.js +7 -7
- package/dist/knowledge/template-registry.d.ts +48 -0
- package/dist/knowledge/template-registry.js +341 -0
- package/dist/knowledge/tool-constraints.js +6 -6
- package/dist/knowledge/tools-reference.js +11 -8
- package/dist/participation/merchant-interest.d.ts +32 -0
- package/dist/participation/merchant-interest.js +100 -0
- package/dist/participation/radar-core.d.ts +104 -0
- package/dist/participation/radar-core.js +269 -0
- package/dist/project/context-assembly.js +8 -0
- package/dist/project/deployment-bridge.js +6 -5
- package/dist/project/deployment-doc.js +5 -5
- package/dist/project/edit-planner.d.ts +123 -0
- package/dist/project/edit-planner.js +1342 -0
- package/dist/project/evaluation.d.ts +36 -0
- package/dist/project/evaluation.js +734 -68
- package/dist/project/game-theory.d.ts +43 -0
- package/dist/project/game-theory.js +177 -0
- package/dist/project/graph-builder.js +7 -1
- package/dist/project/handlers.d.ts +137 -2
- package/dist/project/handlers.js +423 -51
- package/dist/project/intent-analyzer.d.ts +71 -0
- package/dist/project/intent-analyzer.js +149 -0
- package/dist/project/machine-nodes.d.ts +2 -0
- package/dist/project/machine-nodes.js +36 -0
- package/dist/project/merchant-guide.d.ts +165 -0
- package/dist/project/merchant-guide.js +264 -0
- package/dist/project/mode-actions.d.ts +199 -0
- package/dist/project/mode-actions.js +309 -0
- package/dist/project/participation-radar.d.ts +18 -0
- package/dist/project/participation-radar.js +428 -0
- package/dist/project/pipeline-actions.d.ts +101 -0
- package/dist/project/pipeline-actions.js +109 -0
- package/dist/project/semantic-graph.d.ts +95 -0
- package/dist/project/semantic-graph.js +245 -0
- package/dist/project/stage-gate.js +4 -4
- package/dist/schema/call/allocation.d.ts +11 -11
- package/dist/schema/call/allocation.js +13 -3
- package/dist/schema/call/arbitration.d.ts +21 -21
- package/dist/schema/call/arbitration.js +30 -9
- package/dist/schema/call/base.d.ts +2 -2
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +127 -127
- package/dist/schema/call/bridge.js +12 -12
- package/dist/schema/call/contact.d.ts +3 -3
- package/dist/schema/call/contact.js +2 -2
- package/dist/schema/call/demand.d.ts +3 -3
- package/dist/schema/call/demand.js +2 -2
- package/dist/schema/call/guard.d.ts +11 -11
- package/dist/schema/call/guard.js +2 -2
- package/dist/schema/call/machine.d.ts +2072 -679
- package/dist/schema/call/machine.js +51 -5
- package/dist/schema/call/order.d.ts +7 -7
- package/dist/schema/call/order.js +3 -6
- package/dist/schema/call/payment.d.ts +3 -3
- package/dist/schema/call/permission.d.ts +3 -3
- package/dist/schema/call/permission.js +2 -2
- package/dist/schema/call/personal.d.ts +337 -3
- package/dist/schema/call/personal.js +10 -0
- package/dist/schema/call/progress.d.ts +177 -9
- package/dist/schema/call/progress.js +7 -3
- package/dist/schema/call/proof.d.ts +6 -6
- package/dist/schema/call/repository.d.ts +3 -3
- package/dist/schema/call/repository.js +2 -2
- package/dist/schema/call/reward.d.ts +57 -57
- package/dist/schema/call/reward.js +3 -3
- package/dist/schema/call/semantic.js +48 -2
- package/dist/schema/call/service.d.ts +285 -113
- package/dist/schema/call/service.js +92 -28
- package/dist/schema/call/treasury.d.ts +57 -57
- package/dist/schema/call/treasury.js +3 -3
- package/dist/schema/common/index.d.ts +2 -0
- package/dist/schema/common/index.js +46 -10
- package/dist/schema/local/index.js +5 -1
- package/dist/schema/messenger/index.js +4 -1
- package/dist/schema/operations.d.ts +1318 -317
- package/dist/schema/operations.js +76 -7
- package/dist/schema/project/index.d.ts +5662 -164
- package/dist/schema/project/index.js +1136 -5
- package/dist/schema/query/index.d.ts +580 -19
- package/dist/schema/query/index.js +88 -36
- package/dist/schema/schema-query/index.d.ts +59 -3
- package/dist/schema/schema-query/index.js +45 -6
- package/dist/schema/trust/index.d.ts +1012 -6
- package/dist/schema/trust/index.js +212 -11
- package/dist/schema/utils/node-parser.js +13 -0
- package/dist/schema/utils/object-type-utils.d.ts +12 -0
- package/dist/schema/utils/object-type-utils.js +35 -0
- package/dist/schema/utils/permission-machine-check.d.ts +49 -0
- package/dist/schema/utils/permission-machine-check.js +121 -0
- package/dist/schema/utils/skills-recommendation.d.ts +2 -0
- package/dist/schema/utils/skills-recommendation.js +77 -0
- package/dist/schema-query/index.d.ts +17 -1
- package/dist/schema-query/index.js +359 -3
- package/dist/schemas/account_operation.schema.json +1 -1
- package/dist/schemas/bridge_operation.schema.json +14 -7
- package/dist/schemas/guard2file.schema.json +2 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +2 -0
- package/dist/schemas/messenger_operation.schema.json +1 -1
- package/dist/schemas/onchain_events.output.json +1 -1
- package/dist/schemas/onchain_operations.output.json +2820 -0
- package/dist/schemas/onchain_operations.schema.json +255 -65
- package/dist/schemas/onchain_operations_allocation.schema.json +7 -6
- package/dist/schemas/onchain_operations_arbitration.schema.json +14 -10
- package/dist/schemas/onchain_operations_contact.schema.json +4 -3
- package/dist/schemas/onchain_operations_demand.schema.json +4 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +4 -2
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -0
- package/dist/schemas/onchain_operations_guard.schema.json +579 -1
- package/dist/schemas/onchain_operations_machine.schema.json +5 -4
- package/dist/schemas/onchain_operations_order.schema.json +7 -6
- package/dist/schemas/onchain_operations_payment.schema.json +2 -1
- package/dist/schemas/onchain_operations_permission.schema.json +3 -2
- package/dist/schemas/onchain_operations_personal.schema.json +37 -0
- package/dist/schemas/onchain_operations_progress.schema.json +91 -4
- package/dist/schemas/onchain_operations_proof.schema.json +2 -1
- package/dist/schemas/onchain_operations_repository.schema.json +4 -3
- package/dist/schemas/onchain_operations_reward.schema.json +7 -6
- package/dist/schemas/onchain_operations_service.schema.json +80 -19
- package/dist/schemas/onchain_operations_treasury.schema.json +5 -4
- package/dist/schemas/onchain_table_data.output.json +1 -1
- package/dist/schemas/onchain_table_data.schema.json +10 -9
- package/dist/schemas/project_operation.output.json +3318 -57
- package/dist/schemas/project_operation.schema.json +728 -4
- package/dist/schemas/query_toolkit.output.json +16 -16
- package/dist/schemas/query_toolkit.schema.json +40 -3
- package/dist/schemas/schema_query.output.json +65 -2
- package/dist/schemas/schema_query.schema.json +31 -5
- package/dist/schemas/trust_score.output.json +392 -1
- package/dist/schemas/trust_score.schema.json +275 -1
- package/dist/schemas/wowok_buildin_info.output.json +81 -8
- package/dist/schemas/wowok_buildin_info.schema.json +46 -2
- package/dist/tools/handlers/onchain.js +636 -6
- package/dist/tools/handlers/project.js +71 -2
- package/dist/tools/handlers/query.js +117 -2
- package/dist/tools/handlers/schema-query.js +65 -1
- package/dist/tools/handlers/trust.js +192 -6
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +229 -15
- package/dist/tools/wrap.js +194 -15
- package/package.json +2 -2
|
@@ -6,8 +6,8 @@ const LEVEL_WEIGHT = {
|
|
|
6
6
|
const BUILTIN_RISK_METRICS = [
|
|
7
7
|
{
|
|
8
8
|
metric_id: "funds_risk",
|
|
9
|
-
display_name: "
|
|
10
|
-
description: "
|
|
9
|
+
display_name: "Funds Risk",
|
|
10
|
+
description: "Directly operates funds / affects fund flow / no fund risk",
|
|
11
11
|
type: "risk",
|
|
12
12
|
scale: "level",
|
|
13
13
|
weight: 1.0,
|
|
@@ -15,8 +15,8 @@ const BUILTIN_RISK_METRICS = [
|
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
metric_id: "trust_risk",
|
|
18
|
-
display_name: "
|
|
19
|
-
description: "
|
|
18
|
+
display_name: "Trust Risk",
|
|
19
|
+
description: "Degree of impact on trust mechanism",
|
|
20
20
|
type: "risk",
|
|
21
21
|
scale: "level",
|
|
22
22
|
weight: 1.0,
|
|
@@ -24,8 +24,8 @@ const BUILTIN_RISK_METRICS = [
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
metric_id: "delivery_risk",
|
|
27
|
-
display_name: "
|
|
28
|
-
description: "
|
|
27
|
+
display_name: "Delivery Risk",
|
|
28
|
+
description: "Degree of impact on order fulfillment",
|
|
29
29
|
type: "risk",
|
|
30
30
|
scale: "level",
|
|
31
31
|
weight: 1.0,
|
|
@@ -33,8 +33,8 @@ const BUILTIN_RISK_METRICS = [
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
metric_id: "compliance_risk",
|
|
36
|
-
display_name: "
|
|
37
|
-
description: "
|
|
36
|
+
display_name: "Compliance Risk",
|
|
37
|
+
description: "Degree of regulatory involvement",
|
|
38
38
|
type: "risk",
|
|
39
39
|
scale: "level",
|
|
40
40
|
weight: 1.0,
|
|
@@ -44,8 +44,8 @@ const BUILTIN_RISK_METRICS = [
|
|
|
44
44
|
const BUILTIN_BENEFIT_METRICS = [
|
|
45
45
|
{
|
|
46
46
|
metric_id: "automation_level",
|
|
47
|
-
display_name: "
|
|
48
|
-
description: "
|
|
47
|
+
display_name: "Automation Level",
|
|
48
|
+
description: "Fully automated / semi-automated / manual",
|
|
49
49
|
type: "benefit",
|
|
50
50
|
scale: "level",
|
|
51
51
|
weight: 1.0,
|
|
@@ -53,8 +53,8 @@ const BUILTIN_BENEFIT_METRICS = [
|
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
metric_id: "trust_boost",
|
|
56
|
-
display_name: "
|
|
57
|
-
description: "
|
|
56
|
+
display_name: "Trust Boost",
|
|
57
|
+
description: "Degree of enhancement to trust mechanism",
|
|
58
58
|
type: "benefit",
|
|
59
59
|
scale: "level",
|
|
60
60
|
weight: 1.0,
|
|
@@ -62,8 +62,8 @@ const BUILTIN_BENEFIT_METRICS = [
|
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
metric_id: "efficiency_gain",
|
|
65
|
-
display_name: "
|
|
66
|
-
description: "
|
|
65
|
+
display_name: "Efficiency Gain",
|
|
66
|
+
description: "Degree of efficiency improvement",
|
|
67
67
|
type: "benefit",
|
|
68
68
|
scale: "level",
|
|
69
69
|
weight: 1.0,
|
|
@@ -70,34 +70,34 @@ export class ModeEvaluator {
|
|
|
70
70
|
feasibility_score = Math.max(0, Math.min(100, Math.round(feasibility_score)));
|
|
71
71
|
const recommendations = [];
|
|
72
72
|
if (benefit_delta > 0) {
|
|
73
|
-
recommendations.push(
|
|
73
|
+
recommendations.push(`Benefit increased by ${benefit_delta.toFixed(1)} points, migration has positive value`);
|
|
74
74
|
}
|
|
75
75
|
else if (benefit_delta < 0) {
|
|
76
|
-
recommendations.push(
|
|
76
|
+
recommendations.push(`Benefit decreased by ${Math.abs(benefit_delta).toFixed(1)} points, need to evaluate migration necessity`);
|
|
77
77
|
}
|
|
78
78
|
if (risk_delta > 10) {
|
|
79
|
-
recommendations.push(
|
|
79
|
+
recommendations.push(`Risk increased by ${risk_delta.toFixed(1)} points, recommend strengthening risk control measures`);
|
|
80
80
|
}
|
|
81
81
|
else if (risk_delta < -10) {
|
|
82
|
-
recommendations.push(
|
|
82
|
+
recommendations.push(`Risk decreased by ${Math.abs(risk_delta).toFixed(1)} points, migration helps risk management`);
|
|
83
83
|
}
|
|
84
84
|
if (added_capabilities.length > 0) {
|
|
85
|
-
recommendations.push(
|
|
85
|
+
recommendations.push(`Added ${added_capabilities.length} capabilities, need extra configuration: ${added_capabilities.slice(0, 3).join(", ")}`);
|
|
86
86
|
}
|
|
87
87
|
if (removed_capabilities.length > 0) {
|
|
88
|
-
recommendations.push(
|
|
88
|
+
recommendations.push(`Removed ${removed_capabilities.length} capabilities, related features will be unavailable`);
|
|
89
89
|
}
|
|
90
90
|
if (conflicting_capabilities.length > 0) {
|
|
91
|
-
recommendations.push(
|
|
91
|
+
recommendations.push(`Detected ${conflicting_capabilities.length} capability conflicts, must be resolved before migration`);
|
|
92
92
|
}
|
|
93
93
|
if (feasibility_score >= 70) {
|
|
94
|
-
recommendations.push("
|
|
94
|
+
recommendations.push("Migration feasibility is high, recommend executing");
|
|
95
95
|
}
|
|
96
96
|
else if (feasibility_score >= 40) {
|
|
97
|
-
recommendations.push("
|
|
97
|
+
recommendations.push("Migration feasibility is medium, need careful evaluation");
|
|
98
98
|
}
|
|
99
99
|
else {
|
|
100
|
-
recommendations.push("
|
|
100
|
+
recommendations.push("Migration feasibility is low, recommend keeping the current mode or finding an alternative");
|
|
101
101
|
}
|
|
102
102
|
return {
|
|
103
103
|
feasibility_score,
|
|
@@ -142,13 +142,13 @@ export class ModeEvaluator {
|
|
|
142
142
|
generateRecommendations(mode, risk_score, benefit_score, capability_conflicts, violated_constraints, unmet_conditions) {
|
|
143
143
|
const recs = [];
|
|
144
144
|
if (capability_conflicts.length > 0) {
|
|
145
|
-
recs.push(
|
|
145
|
+
recs.push(`Detected ${capability_conflicts.length} capability conflicts, must be resolved before applying the mode`);
|
|
146
146
|
}
|
|
147
147
|
if (violated_constraints.length > 0) {
|
|
148
|
-
recs.push(
|
|
148
|
+
recs.push(`Detected ${violated_constraints.length} hard constraint violations, need to supplement missing capabilities or adjust mode configuration`);
|
|
149
149
|
}
|
|
150
150
|
if (unmet_conditions.length > 0) {
|
|
151
|
-
recs.push(
|
|
151
|
+
recs.push(`Detected ${unmet_conditions.length} soft constraints not met, recommend adjusting to improve mode quality`);
|
|
152
152
|
}
|
|
153
153
|
const appetiteThresholds = {
|
|
154
154
|
conservative: { max_risk: 30, min_benefit: 50 },
|
|
@@ -157,13 +157,13 @@ export class ModeEvaluator {
|
|
|
157
157
|
};
|
|
158
158
|
const threshold = appetiteThresholds[mode.risk_appetite];
|
|
159
159
|
if (risk_score > threshold.max_risk) {
|
|
160
|
-
recs.push(
|
|
160
|
+
recs.push(`Risk score ${risk_score} exceeds ${mode.risk_appetite} mode threshold ${threshold.max_risk}, recommend reducing risk or adjusting risk appetite`);
|
|
161
161
|
}
|
|
162
162
|
if (benefit_score < threshold.min_benefit) {
|
|
163
|
-
recs.push(
|
|
163
|
+
recs.push(`Benefit score ${benefit_score} below ${mode.risk_appetite} mode threshold ${threshold.min_benefit}, recommend adding benefit capabilities or adjusting risk appetite`);
|
|
164
164
|
}
|
|
165
165
|
if (recs.length === 0) {
|
|
166
|
-
recs.push(
|
|
166
|
+
recs.push(`Mode evaluation passed: risk ${risk_score} / benefit ${benefit_score} / risk-benefit ratio ${(benefit_score / Math.max(risk_score, 1)).toFixed(2)}`);
|
|
167
167
|
}
|
|
168
168
|
return recs;
|
|
169
169
|
}
|
package/dist/extensions/modes.js
CHANGED
|
@@ -25,9 +25,9 @@ const GENERAL_FLYWHEEL = {
|
|
|
25
25
|
const GENERAL_MACHINE_SHAPE = [
|
|
26
26
|
{ name: "paid", role: "Entry: order created and paid" },
|
|
27
27
|
{ name: "delivering", role: "Service delivery in progress" },
|
|
28
|
+
{ name: "delivered", role: "Deliverable available for review" },
|
|
28
29
|
{ name: "completed", role: "Service completed, funds released" },
|
|
29
|
-
{ name: "
|
|
30
|
-
{ name: "cancelled", role: "Pre-delivery cancellation" },
|
|
30
|
+
{ name: "cancelled", role: "Pre-delivery cancellation — triggers refund Allocator" },
|
|
31
31
|
];
|
|
32
32
|
const GENERAL_ALLOCATOR = {
|
|
33
33
|
recipient: "signer",
|
|
@@ -41,8 +41,8 @@ const RETAIL_MACHINE_SHAPE = [
|
|
|
41
41
|
{ name: "delivered", role: "Goods delivered to buyer" },
|
|
42
42
|
{ name: "confirmed", role: "Buyer confirms receipt" },
|
|
43
43
|
{ name: "completed", role: "Funds released to merchant" },
|
|
44
|
-
{ name: "
|
|
45
|
-
{ name: "cancelled", role: "Pre-ship cancellation" },
|
|
44
|
+
{ name: "returned", role: "Buyer ships goods back — triggers refund Allocator (R-M1-11 compliant)" },
|
|
45
|
+
{ name: "cancelled", role: "Pre-ship cancellation — triggers refund Allocator" },
|
|
46
46
|
];
|
|
47
47
|
const RETAIL_GUARDS = [
|
|
48
48
|
{ template_id: "buy_guard_inventory", host: "service", purpose: "Verify inventory and buyer address on purchase" },
|
|
@@ -64,19 +64,47 @@ const RETAIL_BUILD_NOTES = [
|
|
|
64
64
|
"Refund path must support return-and-exchange flow",
|
|
65
65
|
"Compensation fund covers return/exchange disputes",
|
|
66
66
|
];
|
|
67
|
+
const RETAIL_D2C_MACHINE_SHAPE = [
|
|
68
|
+
{ name: "ordered", role: "Entry: order created (funds escrowed in Allocation)" },
|
|
69
|
+
{ name: "shipped", role: "Merchant ships goods" },
|
|
70
|
+
{ name: "delivered", role: "Goods delivered to buyer" },
|
|
71
|
+
{ name: "completed", role: "Buyer confirms receipt — withdraw_guard releases funds" },
|
|
72
|
+
{ name: "cancelled", role: "Pre-ship cancellation — refund_guard refunds buyer" },
|
|
73
|
+
];
|
|
74
|
+
const RETAIL_D2C_GUARDS = [
|
|
75
|
+
{ template_id: "withdraw_guard_delivery", host: "service", purpose: "Release funds to merchant + processor on order completion (delivery confirmation)" },
|
|
76
|
+
{ template_id: "refund_guard_cancellation", host: "service", purpose: "Refund 100% to buyer on order cancellation" },
|
|
77
|
+
];
|
|
78
|
+
const RETAIL_D2C_ALLOCATOR = {
|
|
79
|
+
recipient: "entity",
|
|
80
|
+
count: 2,
|
|
81
|
+
mode: "rate",
|
|
82
|
+
description: "Merchant 97% + Processor 3% (rate-based split, no platform commission)",
|
|
83
|
+
};
|
|
84
|
+
const RETAIL_D2C_KEY_RISK = "No platform arbitration — disputes rely on optional Arbitration or off-chain chargeback";
|
|
85
|
+
const RETAIL_D2C_BUILD_NOTES = [
|
|
86
|
+
"Allocation escrow replaces platform custody — funds locked in contract until Guard releases",
|
|
87
|
+
"withdraw_guard enforces delivery gate — merchant must reach 'completed' state to receive payment",
|
|
88
|
+
"refund_guard ensures 100% refund on cancellation — no merchant approval needed",
|
|
89
|
+
"No buy_guard needed — D2C doesn't gate purchases (open storefront)",
|
|
90
|
+
"Arbitration is optional — add when dispute volume justifies the cost",
|
|
91
|
+
"Service ↔ Guard circular dependency: create Service (unpublished) → create Guards → update Service (publish)",
|
|
92
|
+
];
|
|
67
93
|
const SUPPORTED_INDUSTRY_SET = new Set([
|
|
68
|
-
"freelance", "rental", "education", "travel", "subscription", "retail",
|
|
94
|
+
"freelance", "rental", "education", "travel", "subscription", "retail", "retail_d2c",
|
|
69
95
|
]);
|
|
70
96
|
function fetchTemplate(name) {
|
|
71
|
-
const
|
|
97
|
+
const traitsLookupName = name === "retail_d2c" ? "retail" : name;
|
|
98
|
+
const traits = getIndustryTraits(traitsLookupName) ?? GENERAL_TRAITS;
|
|
72
99
|
const isSupported = SUPPORTED_INDUSTRY_SET.has(name);
|
|
100
|
+
const industryLookupName = name === "retail_d2c" ? "retail" : name;
|
|
73
101
|
const risk_checks = isSupported
|
|
74
|
-
? getIndustryRiskChecks(
|
|
102
|
+
? getIndustryRiskChecks(industryLookupName)
|
|
75
103
|
: [];
|
|
76
104
|
const needs = isSupported
|
|
77
|
-
? getIndustryNeeds(
|
|
105
|
+
? getIndustryNeeds(industryLookupName)
|
|
78
106
|
: [];
|
|
79
|
-
const flywheel = getFlywheelForIndustry(
|
|
107
|
+
const flywheel = getFlywheelForIndustry(traitsLookupName) ?? GENERAL_FLYWHEEL;
|
|
80
108
|
let machine_shape;
|
|
81
109
|
let guards;
|
|
82
110
|
let allocator;
|
|
@@ -89,6 +117,13 @@ function fetchTemplate(name) {
|
|
|
89
117
|
key_risk = RETAIL_KEY_RISK;
|
|
90
118
|
build_notes = RETAIL_BUILD_NOTES;
|
|
91
119
|
}
|
|
120
|
+
else if (name === "retail_d2c") {
|
|
121
|
+
machine_shape = RETAIL_D2C_MACHINE_SHAPE;
|
|
122
|
+
guards = RETAIL_D2C_GUARDS;
|
|
123
|
+
allocator = RETAIL_D2C_ALLOCATOR;
|
|
124
|
+
key_risk = RETAIL_D2C_KEY_RISK;
|
|
125
|
+
build_notes = RETAIL_D2C_BUILD_NOTES;
|
|
126
|
+
}
|
|
92
127
|
else if (name === "general") {
|
|
93
128
|
const sm = getScenarioMode("general");
|
|
94
129
|
machine_shape = GENERAL_MACHINE_SHAPE;
|
|
@@ -113,7 +148,7 @@ function fetchTemplate(name) {
|
|
|
113
148
|
export const BUILTIN_MODES = [
|
|
114
149
|
{
|
|
115
150
|
name: "freelance",
|
|
116
|
-
display_name: "Freelance
|
|
151
|
+
display_name: "Freelance",
|
|
117
152
|
version: "v1",
|
|
118
153
|
source: "builtin",
|
|
119
154
|
...fetchTemplate("freelance"),
|
|
@@ -131,28 +166,32 @@ export const BUILTIN_MODES = [
|
|
|
131
166
|
machine: { wip_required: true, wip_hash_algorithm: "sha256", acceptance_gate: true },
|
|
132
167
|
},
|
|
133
168
|
expected_benefits: [
|
|
134
|
-
{ metric: "
|
|
135
|
-
{ metric: "
|
|
136
|
-
{ metric: "
|
|
169
|
+
{ metric: "Dispute rate reduction", expected_value: "40%", evidence: "WIP hash + milestone allocation enforces delivery evidence" },
|
|
170
|
+
{ metric: "Delivery confirmation efficiency", expected_value: "+50%", evidence: "acceptance gate automates acceptance workflow" },
|
|
171
|
+
{ metric: "Provider payment assurance", expected_value: "100%", evidence: "Funds auto-release to provider after accepted node" },
|
|
137
172
|
],
|
|
138
173
|
risk_appetite: "balanced",
|
|
139
174
|
risk_constraints: {
|
|
140
175
|
require_arbitration: true,
|
|
141
176
|
require_compensation_fund: false,
|
|
142
177
|
require_wip_evidence: true,
|
|
143
|
-
other_constraints: [
|
|
178
|
+
other_constraints: [
|
|
179
|
+
"setting_locked_time >= 7d to lock engagement-period rules",
|
|
180
|
+
"ISSUE-P1-4: 48h auto-accept requires off-chain keeper (WoWok Guard does not support time-based triggers). Deploy a keeper service that polls Progress objects in 'delivered' state and calls adminUnhold (permission 224) after 48h timeout. See keeper template in docs.",
|
|
181
|
+
],
|
|
144
182
|
},
|
|
145
183
|
applicable_conditions: {
|
|
146
184
|
business_scale: "small",
|
|
147
185
|
min_daily_orders: 1,
|
|
148
|
-
other_conditions: ["
|
|
186
|
+
other_conditions: ["Suitable for mid-to-long-term project delivery", "Requires milestone-based phased acceptance"],
|
|
149
187
|
},
|
|
150
188
|
similar_industries: ["rental", "education"],
|
|
151
189
|
novel_capabilities: ["allocation.distribute_milestone"],
|
|
190
|
+
disabled_builtin_constraints: ["require_compensation_fund"],
|
|
152
191
|
},
|
|
153
192
|
{
|
|
154
193
|
name: "rental",
|
|
155
|
-
display_name: "Rental
|
|
194
|
+
display_name: "Rental",
|
|
156
195
|
version: "v1",
|
|
157
196
|
source: "builtin",
|
|
158
197
|
...fetchTemplate("rental"),
|
|
@@ -170,9 +209,9 @@ export const BUILTIN_MODES = [
|
|
|
170
209
|
machine: { wip_required: true, wip_stages: ["handover_out", "returned"], inspection_gate: true },
|
|
171
210
|
},
|
|
172
211
|
expected_benefits: [
|
|
173
|
-
{ metric: "
|
|
174
|
-
{ metric: "
|
|
175
|
-
{ metric: "
|
|
212
|
+
{ metric: "Deposit dispute rate", expected_value: "-60%", evidence: "pre-rental WIP mandatorily records item's original state" },
|
|
213
|
+
{ metric: "Damage liability accuracy", expected_value: "+70%", evidence: "pre/post WIP hash comparison eliminates unfounded deductions" },
|
|
214
|
+
{ metric: "Trust score", expected_value: "+25%", evidence: "compensation_fund covers damage risk" },
|
|
176
215
|
],
|
|
177
216
|
risk_appetite: "conservative",
|
|
178
217
|
risk_constraints: {
|
|
@@ -180,19 +219,20 @@ export const BUILTIN_MODES = [
|
|
|
180
219
|
require_compensation_fund: true,
|
|
181
220
|
require_wip_evidence: true,
|
|
182
221
|
max_single_transaction: 10000,
|
|
183
|
-
|
|
222
|
+
compensation_fund_coverage_ratio: 10,
|
|
223
|
+
other_constraints: ["Deposit must be escrowed (no direct transfer)", "lock_duration >= 7d to prevent arbitrary merchant withdrawal"],
|
|
184
224
|
},
|
|
185
225
|
applicable_conditions: {
|
|
186
226
|
business_scale: "small",
|
|
187
227
|
min_daily_orders: 1,
|
|
188
|
-
other_conditions: ["
|
|
228
|
+
other_conditions: ["Requires physical item handover", "Has logistics or offline delivery leg"],
|
|
189
229
|
},
|
|
190
230
|
similar_industries: ["retail", "travel"],
|
|
191
231
|
novel_capabilities: [],
|
|
192
232
|
},
|
|
193
233
|
{
|
|
194
234
|
name: "education",
|
|
195
|
-
display_name: "Education
|
|
235
|
+
display_name: "Education",
|
|
196
236
|
version: "v1",
|
|
197
237
|
source: "builtin",
|
|
198
238
|
...fetchTemplate("education"),
|
|
@@ -218,28 +258,29 @@ export const BUILTIN_MODES = [
|
|
|
218
258
|
service: { setting_locked_time: "120d", anti_runaway: true },
|
|
219
259
|
},
|
|
220
260
|
expected_benefits: [
|
|
221
|
-
{ metric: "
|
|
222
|
-
{ metric: "
|
|
223
|
-
{ metric: "
|
|
261
|
+
{ metric: "Refund dispute rate", expected_value: "-50%", evidence: "per-session release distributes tuition by class" },
|
|
262
|
+
{ metric: "Institution runaway risk", expected_value: "eliminated", evidence: "Funds release per session; undelivered portion is refundable" },
|
|
263
|
+
{ metric: "Attendance traceability", expected_value: "100%", evidence: "attendance_guard signs each session" },
|
|
224
264
|
],
|
|
225
265
|
risk_appetite: "conservative",
|
|
226
266
|
risk_constraints: {
|
|
227
267
|
require_arbitration: true,
|
|
228
268
|
require_compensation_fund: true,
|
|
229
269
|
require_wip_evidence: false,
|
|
230
|
-
other_constraints: ["setting_locked_time
|
|
270
|
+
other_constraints: ["setting_locked_time covers the entire term (>=90d)", "Long-cycle projects must monitor >90d progress"],
|
|
231
271
|
},
|
|
232
272
|
applicable_conditions: {
|
|
233
273
|
business_scale: "medium",
|
|
234
274
|
min_daily_orders: 1,
|
|
235
|
-
other_conditions: ["
|
|
275
|
+
other_conditions: ["Long-cycle delivery", "Requires per-session acceptance", "Regulatory intensity: medium"],
|
|
236
276
|
},
|
|
237
277
|
similar_industries: ["freelance", "subscription"],
|
|
238
278
|
novel_capabilities: ["allocation.distribute_milestone"],
|
|
279
|
+
disabled_builtin_constraints: ["require_wip_evidence"],
|
|
239
280
|
},
|
|
240
281
|
{
|
|
241
282
|
name: "travel",
|
|
242
|
-
display_name: "Travel
|
|
283
|
+
display_name: "Travel",
|
|
243
284
|
version: "v1",
|
|
244
285
|
source: "builtin",
|
|
245
286
|
...fetchTemplate("travel"),
|
|
@@ -266,28 +307,28 @@ export const BUILTIN_MODES = [
|
|
|
266
307
|
service: { supply_chain_suborders: true, segment_guard_required: true },
|
|
267
308
|
},
|
|
268
309
|
expected_benefits: [
|
|
269
|
-
{ metric: "
|
|
270
|
-
{ metric: "
|
|
271
|
-
{ metric: "
|
|
310
|
+
{ metric: "Fund transparency", expected_value: "100%", evidence: "multi-tier allocation splits per segment to hotel/guide/driver" },
|
|
311
|
+
{ metric: "Itinerary change disputes", expected_value: "-45%", evidence: "segment WIP accepts each leg" },
|
|
312
|
+
{ metric: "Breach compensation assurance", expected_value: "+60%", evidence: "compensation_fund covers itinerary breach" },
|
|
272
313
|
],
|
|
273
314
|
risk_appetite: "balanced",
|
|
274
315
|
risk_constraints: {
|
|
275
316
|
require_arbitration: true,
|
|
276
317
|
require_compensation_fund: true,
|
|
277
318
|
require_wip_evidence: true,
|
|
278
|
-
other_constraints: ["
|
|
319
|
+
other_constraints: ["Multi-tier allocation requires guard chaining validation", "deposit 20% + final 80% two-stage payment"],
|
|
279
320
|
},
|
|
280
321
|
applicable_conditions: {
|
|
281
322
|
business_scale: "medium",
|
|
282
323
|
min_daily_orders: 1,
|
|
283
|
-
other_conditions: ["
|
|
324
|
+
other_conditions: ["Multi-segment itinerary combination", "Requires hotel/guide/driver multi-party allocation"],
|
|
284
325
|
},
|
|
285
326
|
similar_industries: ["rental", "education"],
|
|
286
327
|
novel_capabilities: [],
|
|
287
328
|
},
|
|
288
329
|
{
|
|
289
330
|
name: "subscription",
|
|
290
|
-
display_name: "Subscription
|
|
331
|
+
display_name: "Subscription",
|
|
291
332
|
version: "v1",
|
|
292
333
|
source: "builtin",
|
|
293
334
|
...fetchTemplate("subscription"),
|
|
@@ -310,28 +351,30 @@ export const BUILTIN_MODES = [
|
|
|
310
351
|
service: { creator_data_subscription: true, periodic_billing: true },
|
|
311
352
|
},
|
|
312
353
|
expected_benefits: [
|
|
313
|
-
{ metric: "
|
|
314
|
-
{ metric: "
|
|
315
|
-
{ metric: "
|
|
354
|
+
{ metric: "Renewal rate", expected_value: "+25%", evidence: "loyalty reward + transparent subscription mechanism" },
|
|
355
|
+
{ metric: "Cancellation disputes", expected_value: "eliminated", evidence: "cancel anytime + no auto-renew trap" },
|
|
356
|
+
{ metric: "Creator retention", expected_value: "+30%", evidence: "deliver_guard_wip prevents content dropout" },
|
|
316
357
|
],
|
|
317
358
|
risk_appetite: "aggressive",
|
|
318
359
|
risk_constraints: {
|
|
319
360
|
require_arbitration: false,
|
|
320
361
|
require_compensation_fund: false,
|
|
321
362
|
require_wip_evidence: false,
|
|
322
|
-
|
|
363
|
+
compensation_fund_coverage_ratio: 3,
|
|
364
|
+
other_constraints: ["Forbid dead-end nodes (prevent lock-in)", "charge_guard requires user confirmation each period"],
|
|
323
365
|
},
|
|
324
366
|
applicable_conditions: {
|
|
325
367
|
business_scale: "small",
|
|
326
368
|
min_daily_orders: 5,
|
|
327
|
-
other_conditions: ["
|
|
369
|
+
other_conditions: ["Pure-digital delivery", "Periodic content or SaaS service"],
|
|
328
370
|
},
|
|
329
371
|
similar_industries: ["freelance", "education"],
|
|
330
372
|
novel_capabilities: [],
|
|
373
|
+
disabled_builtin_constraints: ["require_arbitration", "require_compensation_fund", "require_wip_evidence"],
|
|
331
374
|
},
|
|
332
375
|
{
|
|
333
376
|
name: "retail",
|
|
334
|
-
display_name: "Retail
|
|
377
|
+
display_name: "Retail",
|
|
335
378
|
version: "v1",
|
|
336
379
|
source: "builtin",
|
|
337
380
|
...fetchTemplate("retail"),
|
|
@@ -354,28 +397,76 @@ export const BUILTIN_MODES = [
|
|
|
354
397
|
service: { logistics_mode: "standard", first_order_discount: true },
|
|
355
398
|
},
|
|
356
399
|
expected_benefits: [
|
|
357
|
-
{ metric: "
|
|
358
|
-
{ metric: "
|
|
359
|
-
{ metric: "
|
|
400
|
+
{ metric: "Return dispute rate", expected_value: "-35%", evidence: "logistics WIP + refund path assurance" },
|
|
401
|
+
{ metric: "Repurchase rate", expected_value: "+20%", evidence: "spend cashback reward" },
|
|
402
|
+
{ metric: "Product authenticity traceability", expected_value: "100%", evidence: "WIP verifies product/logistics info" },
|
|
360
403
|
],
|
|
361
404
|
risk_appetite: "conservative",
|
|
362
405
|
risk_constraints: {
|
|
363
406
|
require_arbitration: true,
|
|
364
407
|
require_compensation_fund: true,
|
|
365
408
|
require_wip_evidence: false,
|
|
366
|
-
|
|
409
|
+
compensation_fund_coverage_ratio: 5,
|
|
410
|
+
other_constraints: ["refund_window >= 7d", "confirm_gate: only buyer can confirm receipt"],
|
|
367
411
|
},
|
|
368
412
|
applicable_conditions: {
|
|
369
413
|
business_scale: "medium",
|
|
370
414
|
min_daily_orders: 10,
|
|
371
|
-
other_conditions: ["
|
|
415
|
+
other_conditions: ["Has logistics shipping leg", "High-frequency small-ticket transactions"],
|
|
372
416
|
},
|
|
373
417
|
similar_industries: ["rental", "subscription"],
|
|
374
418
|
novel_capabilities: [],
|
|
419
|
+
disabled_builtin_constraints: ["require_wip_evidence"],
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
name: "retail_d2c",
|
|
423
|
+
display_name: "Retail D2C (Direct-to-Consumer)",
|
|
424
|
+
version: "v1",
|
|
425
|
+
source: "builtin",
|
|
426
|
+
...fetchTemplate("retail_d2c"),
|
|
427
|
+
capabilities_used: [
|
|
428
|
+
"permission.index_create", "permission.role_assign",
|
|
429
|
+
"guard.validate_withdraw", "guard.validate_refund",
|
|
430
|
+
"machine.node_topology",
|
|
431
|
+
"allocation.distribute",
|
|
432
|
+
"service.publish", "progress.advance",
|
|
433
|
+
"contact.im_create",
|
|
434
|
+
],
|
|
435
|
+
config_overrides: {
|
|
436
|
+
machine: {
|
|
437
|
+
wip_required: false,
|
|
438
|
+
confirm_gate: true,
|
|
439
|
+
refund_requires_approval: false,
|
|
440
|
+
},
|
|
441
|
+
service: { logistics_mode: "merchant_managed", multi_recipient_allocation: true },
|
|
442
|
+
},
|
|
443
|
+
expected_benefits: [
|
|
444
|
+
{ metric: "Merchant revenue share", expected_value: "97%", evidence: "No platform commission — only 3% processing fee" },
|
|
445
|
+
{ metric: "Fund safety", expected_value: "contract-grade", evidence: "Allocation escrow + Guard verification replaces platform custody" },
|
|
446
|
+
{ metric: "Delivery reliability", expected_value: "high", evidence: "withdraw_guard enforces delivery confirmation before payment" },
|
|
447
|
+
],
|
|
448
|
+
risk_appetite: "balanced",
|
|
449
|
+
risk_constraints: {
|
|
450
|
+
require_arbitration: false,
|
|
451
|
+
require_compensation_fund: false,
|
|
452
|
+
require_wip_evidence: false,
|
|
453
|
+
other_constraints: [
|
|
454
|
+
"Allocation escrow required (withdraw_guard + refund_guard)",
|
|
455
|
+
"Service ↔ Guard circular dependency requires 3-step creation pattern",
|
|
456
|
+
],
|
|
457
|
+
},
|
|
458
|
+
applicable_conditions: {
|
|
459
|
+
business_scale: "small",
|
|
460
|
+
min_daily_orders: 1,
|
|
461
|
+
other_conditions: ["Independent storefront (no marketplace)", "Merchant-managed logistics", "Allocation escrow model"],
|
|
462
|
+
},
|
|
463
|
+
similar_industries: ["retail", "subscription"],
|
|
464
|
+
novel_capabilities: ["Allocation escrow as platform-custody alternative", "Multi-recipient allocation (merchant + processor)"],
|
|
465
|
+
disabled_builtin_constraints: ["require_arbitration", "require_compensation_fund", "require_wip_evidence"],
|
|
375
466
|
},
|
|
376
467
|
{
|
|
377
468
|
name: "general",
|
|
378
|
-
display_name: "General
|
|
469
|
+
display_name: "General",
|
|
379
470
|
version: "v1",
|
|
380
471
|
source: "builtin",
|
|
381
472
|
...fetchTemplate("general"),
|
|
@@ -388,8 +479,8 @@ export const BUILTIN_MODES = [
|
|
|
388
479
|
"progress.advance",
|
|
389
480
|
],
|
|
390
481
|
expected_benefits: [
|
|
391
|
-
{ metric: "
|
|
392
|
-
{ metric: "
|
|
482
|
+
{ metric: "Flexibility", expected_value: "100%", evidence: "User customizes all trust mechanism parameters" },
|
|
483
|
+
{ metric: "Degraded safety", expected_value: "usable", evidence: "Can fall back to general at any time" },
|
|
393
484
|
],
|
|
394
485
|
risk_appetite: "balanced",
|
|
395
486
|
risk_constraints: {
|
|
@@ -399,9 +490,10 @@ export const BUILTIN_MODES = [
|
|
|
399
490
|
},
|
|
400
491
|
applicable_conditions: {
|
|
401
492
|
business_scale: "small",
|
|
402
|
-
other_conditions: ["
|
|
493
|
+
other_conditions: ["Fallback degraded mode", "Hybrid scenarios not covered by other industries"],
|
|
403
494
|
},
|
|
404
495
|
similar_industries: [],
|
|
405
496
|
novel_capabilities: [],
|
|
497
|
+
disabled_builtin_constraints: ["require_arbitration", "require_compensation_fund", "require_wip_evidence"],
|
|
406
498
|
},
|
|
407
499
|
];
|
|
@@ -6,6 +6,8 @@ export declare class IndustryModeRegistry {
|
|
|
6
6
|
private aliases;
|
|
7
7
|
private evaluator;
|
|
8
8
|
private initialized;
|
|
9
|
+
private persistence;
|
|
10
|
+
private userModesLoaded;
|
|
9
11
|
static Instance(): IndustryModeRegistry;
|
|
10
12
|
private constructor();
|
|
11
13
|
registerMode(mode: IndustryMode, aliases?: string[]): boolean;
|
|
@@ -15,16 +17,19 @@ export declare class IndustryModeRegistry {
|
|
|
15
17
|
hasMode(name: string): boolean;
|
|
16
18
|
evaluateMode(name: string, intent: string, context: ProjectContext): ModeEvaluation;
|
|
17
19
|
evaluateMigration(sourceName: string, targetName: string): ModeMigrationEvaluation;
|
|
18
|
-
registerUserMode(mode: UserDefinedMode, userId: string): boolean
|
|
19
|
-
deriveMode(sourceMode: string, modifications: Partial<UserDefinedMode>, userId: string, newName: string, newDisplayName?: string): UserDefinedMode | undefined
|
|
20
|
-
evolveMode(modeName: string, updates: Partial<UserDefinedMode>, userId: string, changeDescription: string, bumpVersion?: boolean): UserDefinedMode | undefined
|
|
21
|
-
listUserModes(userId: string): UserDefinedMode[]
|
|
22
|
-
getUserMode(modeName: string, userId: string): UserDefinedMode | undefined
|
|
23
|
-
unregisterUserMode(modeName: string, userId: string): boolean
|
|
20
|
+
registerUserMode(mode: UserDefinedMode, userId: string): Promise<boolean>;
|
|
21
|
+
deriveMode(sourceMode: string, modifications: Partial<UserDefinedMode>, userId: string, newName: string, newDisplayName?: string): Promise<UserDefinedMode | undefined>;
|
|
22
|
+
evolveMode(modeName: string, updates: Partial<UserDefinedMode>, userId: string, changeDescription: string, bumpVersion?: boolean): Promise<UserDefinedMode | undefined>;
|
|
23
|
+
listUserModes(userId: string): Promise<UserDefinedMode[]>;
|
|
24
|
+
getUserMode(modeName: string, userId: string): Promise<UserDefinedMode | undefined>;
|
|
25
|
+
unregisterUserMode(modeName: string, userId: string): Promise<boolean>;
|
|
24
26
|
private userModeKey;
|
|
27
|
+
private ensureUserModesLoaded;
|
|
28
|
+
private persistUserMode;
|
|
29
|
+
private unpersistUserMode;
|
|
25
30
|
private bumpPatchVersion;
|
|
26
|
-
applyTemplate(name: string, intent: string, context: ProjectContext): Blueprint
|
|
27
|
-
applyUserMode(modeName: string, userId: string, intent: string, context: ProjectContext): Blueprint
|
|
31
|
+
applyTemplate(name: string, intent: string, context: ProjectContext): Promise<Blueprint>;
|
|
32
|
+
applyUserMode(modeName: string, userId: string, intent: string, context: ProjectContext): Promise<Blueprint>;
|
|
28
33
|
private doApplyTemplate;
|
|
29
34
|
validateBlueprint(objects: BlueprintObject[], edges: BlueprintEdge[], mode: IndustryMode): {
|
|
30
35
|
errors: string[];
|
|
@@ -41,8 +46,10 @@ export declare class IndustryModeRegistry {
|
|
|
41
46
|
private buildSteps;
|
|
42
47
|
private defaultScenarios;
|
|
43
48
|
private recordCapabilitiesUsed;
|
|
49
|
+
private deriveGuardShortName;
|
|
50
|
+
private getFirstServiceGuardName;
|
|
44
51
|
private makeObject;
|
|
45
52
|
private registerBuiltinModes;
|
|
46
53
|
}
|
|
47
54
|
export declare function getIndustryModeRegistry(): IndustryModeRegistry;
|
|
48
|
-
export declare const INDUSTRY_MODE_REGISTRY_VERSION = 2.
|
|
55
|
+
export declare const INDUSTRY_MODE_REGISTRY_VERSION = 2.2;
|