@wowok/agent-mcp 2.4.3 → 2.5.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/config/runtime.d.ts +4 -0
- package/dist/config/runtime.js +29 -5
- package/dist/harness/auto-escalation.d.ts +27 -0
- package/dist/harness/auto-escalation.js +68 -0
- package/dist/index.js +21 -0
- package/dist/knowledge/allocation-confirm.d.ts +115 -0
- package/dist/knowledge/allocation-confirm.js +534 -0
- package/dist/knowledge/allocation-context.d.ts +58 -0
- package/dist/knowledge/allocation-context.js +249 -0
- package/dist/knowledge/allocation-ledger.d.ts +67 -0
- package/dist/knowledge/allocation-ledger.js +463 -0
- package/dist/knowledge/allocation-puzzle.d.ts +135 -0
- package/dist/knowledge/allocation-puzzle.js +298 -0
- package/dist/knowledge/allocation-risk.d.ts +78 -0
- package/dist/knowledge/allocation-risk.js +568 -0
- package/dist/knowledge/allocation-templates.d.ts +38 -0
- package/dist/knowledge/allocation-templates.js +970 -0
- package/dist/knowledge/allocation-translation.d.ts +72 -0
- package/dist/knowledge/allocation-translation.js +585 -0
- package/dist/knowledge/arb-risk.d.ts +37 -0
- package/dist/knowledge/arb-risk.js +210 -0
- package/dist/knowledge/arbitration-confirm.d.ts +135 -0
- package/dist/knowledge/arbitration-confirm.js +559 -0
- package/dist/knowledge/arbitration-context.d.ts +81 -0
- package/dist/knowledge/arbitration-context.js +505 -0
- package/dist/knowledge/arbitration-ledger.d.ts +62 -0
- package/dist/knowledge/arbitration-ledger.js +521 -0
- package/dist/knowledge/arbitration-puzzle.d.ts +84 -0
- package/dist/knowledge/arbitration-puzzle.js +304 -0
- package/dist/knowledge/arbitration-risk.d.ts +112 -0
- package/dist/knowledge/arbitration-risk.js +433 -0
- package/dist/knowledge/arbitration-templates.d.ts +38 -0
- package/dist/knowledge/arbitration-templates.js +276 -0
- package/dist/knowledge/arbitration-translation.d.ts +91 -0
- package/dist/knowledge/arbitration-translation.js +487 -0
- package/dist/knowledge/bridge-risk.d.ts +36 -0
- package/dist/knowledge/bridge-risk.js +263 -0
- package/dist/knowledge/contact-risk.d.ts +32 -0
- package/dist/knowledge/contact-risk.js +200 -0
- package/dist/knowledge/demand-confirm.d.ts +32 -0
- package/dist/knowledge/demand-confirm.js +206 -0
- package/dist/knowledge/demand-risk.d.ts +30 -0
- package/dist/knowledge/demand-risk.js +240 -0
- package/dist/knowledge/demand-translation.d.ts +55 -0
- package/dist/knowledge/demand-translation.js +354 -0
- package/dist/knowledge/deployment-scanner.d.ts +63 -0
- package/dist/knowledge/deployment-scanner.js +762 -0
- package/dist/knowledge/examples-scanner-cli.d.ts +1 -0
- package/dist/knowledge/examples-scanner-cli.js +26 -0
- package/dist/knowledge/examples-scanner.d.ts +121 -0
- package/dist/knowledge/examples-scanner.js +825 -0
- package/dist/knowledge/flywheel-loop.d.ts +3 -0
- package/dist/knowledge/flywheel-loop.js +32 -3
- package/dist/knowledge/glossary.js +3 -1
- package/dist/knowledge/guard-confirm.d.ts +86 -0
- package/dist/knowledge/guard-confirm.js +406 -0
- package/dist/knowledge/guard-context.d.ts +56 -0
- package/dist/knowledge/guard-context.js +287 -0
- package/dist/knowledge/guard-design-patterns.d.ts +37 -0
- package/dist/knowledge/guard-design-patterns.js +257 -0
- package/dist/knowledge/guard-puzzle.js +3 -2
- package/dist/knowledge/guard-risk.d.ts +1 -1
- package/dist/knowledge/guard-risk.js +12 -14
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +6 -5
- package/dist/knowledge/index.d.ts +342 -0
- package/dist/knowledge/index.js +344 -0
- package/dist/knowledge/machine-confirm.d.ts +102 -0
- package/dist/knowledge/machine-confirm.js +559 -0
- package/dist/knowledge/machine-context.d.ts +160 -0
- package/dist/knowledge/machine-context.js +812 -0
- package/dist/knowledge/machine-ledger.d.ts +41 -0
- package/dist/knowledge/machine-ledger.js +315 -0
- package/dist/knowledge/machine-puzzle.d.ts +206 -0
- package/dist/knowledge/machine-puzzle.js +494 -0
- package/dist/knowledge/machine-risk.d.ts +75 -0
- package/dist/knowledge/machine-risk.js +644 -0
- package/dist/knowledge/machine-templates.d.ts +92 -0
- package/dist/knowledge/machine-templates.js +1592 -0
- package/dist/knowledge/machine-topology.d.ts +57 -0
- package/dist/knowledge/machine-topology.js +234 -0
- package/dist/knowledge/machine-translation.d.ts +96 -0
- package/dist/knowledge/machine-translation.js +513 -0
- package/dist/knowledge/mcp-schema-audit-cli.d.ts +1 -0
- package/dist/knowledge/mcp-schema-audit-cli.js +45 -0
- package/dist/knowledge/mcp-schema-audit.d.ts +90 -0
- package/dist/knowledge/mcp-schema-audit.js +772 -0
- package/dist/knowledge/onchain-constants.d.ts +4 -0
- package/dist/knowledge/onchain-constants.js +35 -0
- package/dist/knowledge/order-confirm.d.ts +115 -0
- package/dist/knowledge/order-confirm.js +573 -0
- package/dist/knowledge/order-context.d.ts +66 -0
- package/dist/knowledge/order-context.js +390 -0
- package/dist/knowledge/order-ledger.d.ts +69 -0
- package/dist/knowledge/order-ledger.js +341 -0
- package/dist/knowledge/order-puzzle.d.ts +159 -0
- package/dist/knowledge/order-puzzle.js +255 -0
- package/dist/knowledge/order-risk.d.ts +66 -0
- package/dist/knowledge/order-risk.js +653 -0
- package/dist/knowledge/order-templates.d.ts +50 -0
- package/dist/knowledge/order-templates.js +368 -0
- package/dist/knowledge/order-translation.d.ts +78 -0
- package/dist/knowledge/order-translation.js +550 -0
- package/dist/knowledge/passport-confirm.d.ts +130 -0
- package/dist/knowledge/passport-confirm.js +531 -0
- package/dist/knowledge/passport-context.d.ts +59 -0
- package/dist/knowledge/passport-context.js +306 -0
- package/dist/knowledge/passport-ledger.d.ts +48 -0
- package/dist/knowledge/passport-ledger.js +282 -0
- package/dist/knowledge/passport-puzzle.d.ts +108 -0
- package/dist/knowledge/passport-puzzle.js +333 -0
- package/dist/knowledge/passport-risk.d.ts +70 -0
- package/dist/knowledge/passport-risk.js +450 -0
- package/dist/knowledge/passport-templates.d.ts +40 -0
- package/dist/knowledge/passport-templates.js +568 -0
- package/dist/knowledge/passport-translation.d.ts +68 -0
- package/dist/knowledge/passport-translation.js +516 -0
- package/dist/knowledge/payment-risk.d.ts +33 -0
- package/dist/knowledge/payment-risk.js +182 -0
- package/dist/knowledge/permission-confirm.d.ts +110 -0
- package/dist/knowledge/permission-confirm.js +426 -0
- package/dist/knowledge/permission-context.d.ts +58 -0
- package/dist/knowledge/permission-context.js +224 -0
- package/dist/knowledge/permission-ledger.d.ts +38 -0
- package/dist/knowledge/permission-ledger.js +403 -0
- package/dist/knowledge/permission-puzzle.d.ts +122 -0
- package/dist/knowledge/permission-puzzle.js +173 -0
- package/dist/knowledge/permission-risk.d.ts +76 -0
- package/dist/knowledge/permission-risk.js +411 -0
- package/dist/knowledge/permission-templates.d.ts +38 -0
- package/dist/knowledge/permission-templates.js +234 -0
- package/dist/knowledge/permission-translation.d.ts +57 -0
- package/dist/knowledge/permission-translation.js +350 -0
- package/dist/knowledge/personal-risk.d.ts +36 -0
- package/dist/knowledge/personal-risk.js +212 -0
- package/dist/knowledge/progress-confirm.d.ts +108 -0
- package/dist/knowledge/progress-confirm.js +456 -0
- package/dist/knowledge/progress-context.d.ts +123 -0
- package/dist/knowledge/progress-context.js +452 -0
- package/dist/knowledge/progress-ledger.d.ts +63 -0
- package/dist/knowledge/progress-ledger.js +327 -0
- package/dist/knowledge/progress-puzzle.d.ts +82 -0
- package/dist/knowledge/progress-puzzle.js +219 -0
- package/dist/knowledge/progress-risk.d.ts +74 -0
- package/dist/knowledge/progress-risk.js +461 -0
- package/dist/knowledge/progress-templates.d.ts +38 -0
- package/dist/knowledge/progress-templates.js +228 -0
- package/dist/knowledge/progress-translation.d.ts +52 -0
- package/dist/knowledge/progress-translation.js +401 -0
- package/dist/knowledge/proof-confirm.d.ts +31 -0
- package/dist/knowledge/proof-confirm.js +187 -0
- package/dist/knowledge/proof-risk.d.ts +33 -0
- package/dist/knowledge/proof-risk.js +207 -0
- package/dist/knowledge/proof-translation.d.ts +52 -0
- package/dist/knowledge/proof-translation.js +283 -0
- package/dist/knowledge/registrar-risk.d.ts +34 -0
- package/dist/knowledge/registrar-risk.js +217 -0
- package/dist/knowledge/repository-confirm.d.ts +36 -0
- package/dist/knowledge/repository-confirm.js +242 -0
- package/dist/knowledge/repository-risk.d.ts +40 -0
- package/dist/knowledge/repository-risk.js +312 -0
- package/dist/knowledge/repository-translation.d.ts +58 -0
- package/dist/knowledge/repository-translation.js +422 -0
- package/dist/knowledge/resource-risk.d.ts +32 -0
- package/dist/knowledge/resource-risk.js +157 -0
- package/dist/knowledge/reward-confirm.d.ts +113 -0
- package/dist/knowledge/reward-confirm.js +496 -0
- package/dist/knowledge/reward-context.d.ts +127 -0
- package/dist/knowledge/reward-context.js +504 -0
- package/dist/knowledge/reward-ledger.d.ts +96 -0
- package/dist/knowledge/reward-ledger.js +502 -0
- package/dist/knowledge/reward-puzzle.d.ts +97 -0
- package/dist/knowledge/reward-puzzle.js +288 -0
- package/dist/knowledge/reward-risk.d.ts +84 -0
- package/dist/knowledge/reward-risk.js +545 -0
- package/dist/knowledge/reward-translation.d.ts +58 -0
- package/dist/knowledge/reward-translation.js +501 -0
- package/dist/knowledge/safety-rules.js +11 -3
- package/dist/knowledge/scenario-modes.d.ts +53 -0
- package/dist/knowledge/scenario-modes.js +302 -0
- package/dist/knowledge/service-confirm.d.ts +152 -0
- package/dist/knowledge/service-confirm.js +699 -0
- package/dist/knowledge/service-context.d.ts +66 -0
- package/dist/knowledge/service-context.js +403 -0
- package/dist/knowledge/service-ledger.d.ts +71 -0
- package/dist/knowledge/service-ledger.js +609 -0
- package/dist/knowledge/service-puzzle.d.ts +158 -0
- package/dist/knowledge/service-puzzle.js +236 -0
- package/dist/knowledge/service-risk.d.ts +108 -0
- package/dist/knowledge/service-risk.js +615 -0
- package/dist/knowledge/service-templates.d.ts +39 -0
- package/dist/knowledge/service-templates.js +418 -0
- package/dist/knowledge/service-translation.d.ts +103 -0
- package/dist/knowledge/service-translation.js +622 -0
- package/dist/knowledge/tools-reference.d.ts +17 -0
- package/dist/knowledge/tools-reference.js +151 -0
- package/dist/knowledge/treasury-confirm.d.ts +133 -0
- package/dist/knowledge/treasury-confirm.js +512 -0
- package/dist/knowledge/treasury-context.d.ts +64 -0
- package/dist/knowledge/treasury-context.js +363 -0
- package/dist/knowledge/treasury-ledger.d.ts +42 -0
- package/dist/knowledge/treasury-ledger.js +300 -0
- package/dist/knowledge/treasury-puzzle.d.ts +163 -0
- package/dist/knowledge/treasury-puzzle.js +216 -0
- package/dist/knowledge/treasury-risk.d.ts +86 -0
- package/dist/knowledge/treasury-risk.js +440 -0
- package/dist/knowledge/treasury-templates.d.ts +38 -0
- package/dist/knowledge/treasury-templates.js +316 -0
- package/dist/knowledge/treasury-translation.d.ts +78 -0
- package/dist/knowledge/treasury-translation.js +498 -0
- package/dist/knowledge/util-risk.d.ts +30 -0
- package/dist/knowledge/util-risk.js +135 -0
- package/dist/project/business-puzzle.d.ts +47 -0
- package/dist/project/business-puzzle.js +372 -0
- package/dist/project/deployment-doc.d.ts +61 -0
- package/dist/project/deployment-doc.js +432 -0
- package/dist/project/risk-aggregator.d.ts +50 -0
- package/dist/project/risk-aggregator.js +280 -0
- package/dist/project/substep-trace.d.ts +130 -0
- package/dist/project/substep-trace.js +332 -0
- package/dist/schema/call/allocation.d.ts +34 -34
- package/dist/schema/call/arbitration.d.ts +141 -141
- package/dist/schema/call/base.d.ts +386 -386
- package/dist/schema/call/base.js +3 -3
- package/dist/schema/call/bridge-handler.d.ts +5 -2
- package/dist/schema/call/bridge.d.ts +159 -159
- package/dist/schema/call/contact.d.ts +110 -110
- package/dist/schema/call/demand.d.ts +76 -76
- package/dist/schema/call/handler.d.ts +2 -3
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +58 -58
- package/dist/schema/call/order.d.ts +98 -110
- package/dist/schema/call/permission-handler.d.ts +5 -0
- package/dist/schema/call/permission-handler.js +54 -0
- package/dist/schema/call/permission.d.ts +108 -108
- package/dist/schema/call/personal.d.ts +14 -14
- package/dist/schema/call/progress.d.ts +57 -72
- package/dist/schema/call/progress.js +7 -4
- package/dist/schema/call/proof.d.ts +18 -18
- package/dist/schema/call/proof.js +12 -7
- package/dist/schema/call/repository.d.ts +154 -154
- package/dist/schema/call/reward.d.ts +55 -55
- package/dist/schema/call/service.d.ts +231 -231
- package/dist/schema/call/treasury.d.ts +93 -93
- package/dist/schema/config/index.d.ts +178 -5
- package/dist/schema/config/index.js +52 -1
- package/dist/schema/local/index.d.ts +3554 -836
- package/dist/schema/local/index.js +2 -1
- package/dist/schema/messenger/index.d.ts +162 -162
- package/dist/schema/operations.d.ts +1058 -1074
- package/dist/schema/operations.js +7 -1
- package/dist/schema/project/index.d.ts +1412 -6
- package/dist/schema/project/index.js +441 -3
- package/dist/schema/query/index.d.ts +672 -672
- package/dist/schema/schema-query/index.d.ts +23 -3
- package/dist/schema/schema-query/index.js +13 -2
- package/dist/schema/sync-layer4.d.ts +21 -0
- package/dist/schema/sync-layer4.js +261 -0
- package/dist/schema/trust/index.d.ts +26 -26
- package/dist/schemas/account_operation.output.json +718 -0
- package/dist/schemas/config_operation.output.json +173 -0
- package/dist/schemas/index.json +9 -1
- package/dist/schemas/local_info_operation.output.json +718 -0
- package/dist/schemas/local_mark_operation.output.json +718 -0
- package/dist/schemas/onchain_operations.output.json +3 -2
- package/dist/schemas/onchain_operations.schema.json +1809 -336
- package/dist/schemas/onchain_operations_allocation.schema.json +2 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +2 -1
- package/dist/schemas/onchain_operations_contact.schema.json +2 -1
- package/dist/schemas/onchain_operations_demand.schema.json +2 -1
- package/dist/schemas/onchain_operations_gen_passport.schema.json +878 -872
- package/dist/schemas/onchain_operations_gen_proof.schema.json +273 -0
- package/dist/schemas/onchain_operations_guard.schema.json +578 -579
- package/dist/schemas/onchain_operations_machine.schema.json +2 -1
- package/dist/schemas/onchain_operations_order.schema.json +13 -9
- package/dist/schemas/onchain_operations_payment.schema.json +0 -514
- package/dist/schemas/onchain_operations_permission.schema.json +0 -514
- package/dist/schemas/onchain_operations_personal.schema.json +0 -514
- package/dist/schemas/onchain_operations_progress.schema.json +14 -10
- package/dist/schemas/onchain_operations_proof.schema.json +699 -0
- package/dist/schemas/onchain_operations_repository.schema.json +2 -1
- package/dist/schemas/onchain_operations_reward.schema.json +2 -1
- package/dist/schemas/onchain_operations_service.schema.json +2 -1
- package/dist/schemas/onchain_operations_treasury.schema.json +2 -1
- package/dist/schemas/onchain_table_data.schema.json +32 -1
- package/dist/schemas/project_operation.output.json +918 -0
- package/dist/schemas/project_operation.schema.json +474 -3
- package/dist/schemas/query_toolkit.output.json +14906 -6
- package/dist/schemas/schema_query.output.json +38 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/tools/handlers/config.d.ts +1 -1
- package/dist/tools/handlers/config.js +21 -18
- package/dist/tools/handlers/file-export.d.ts +2 -2
- package/dist/tools/handlers/local.d.ts +3 -30
- package/dist/tools/handlers/local.js +14 -3
- package/dist/tools/handlers/messenger.d.ts +1 -1
- package/dist/tools/handlers/messenger.js +2 -1
- package/dist/tools/handlers/onchain.d.ts +1 -1
- package/dist/tools/handlers/onchain.js +24 -22
- package/dist/tools/handlers/project.d.ts +1 -1
- package/dist/tools/handlers/project.js +262 -18
- package/dist/tools/handlers/query.d.ts +4 -4
- package/dist/tools/handlers/schema-query.d.ts +1 -1
- package/dist/tools/handlers/schema-query.js +21 -20
- package/dist/tools/handlers/trust.d.ts +1 -1
- package/dist/tools/handlers/trust.js +2 -2
- package/dist/tools/handlers/wip.d.ts +1 -1
- package/dist/tools/handlers/wip.js +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +96 -25
- package/dist/tools/rules-hook.d.ts +1 -1
- package/dist/tools/rules-hook.js +3 -2
- package/dist/tools/shared.d.ts +13 -22
- package/dist/tools/types.d.ts +5 -5
- package/dist/tools/wrap.d.ts +10 -2
- package/dist/tools/wrap.js +212 -0
- package/package.json +3 -3
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
export const SERVICE_TEMPLATES = [
|
|
2
|
+
{
|
|
3
|
+
id: "T-S-01",
|
|
4
|
+
name: "Retail e-commerce Service",
|
|
5
|
+
description: "Standard retail shop with multiple SKUs, WIP-verified products, owner-only allocation",
|
|
6
|
+
applicable_scenes: ["service_retail", "service_buy_guard"],
|
|
7
|
+
industry_tags: ["retail", "ecommerce", "digital_goods"],
|
|
8
|
+
params: [
|
|
9
|
+
{ name: "owner_address", type: "address", description: "Service owner address (receives payments)", required: true },
|
|
10
|
+
{ name: "permission_address", type: "address", description: "Permission object address (must be owned by owner)", required: true },
|
|
11
|
+
{ name: "description", type: "string", description: "Shop description", required: true },
|
|
12
|
+
{ name: "location", type: "string", description: "Shop URL (HTTPS or IPFS)", required: false, default: "" },
|
|
13
|
+
{ name: "sales_items", type: "object", description: "Array of {name, price, stock, wip, wip_hash}", required: true },
|
|
14
|
+
{ name: "buy_guard_address", type: "address", description: "Buyer eligibility Guard (null for public sale)", required: false, default: "" },
|
|
15
|
+
],
|
|
16
|
+
body: (p) => {
|
|
17
|
+
const result = {
|
|
18
|
+
object: null,
|
|
19
|
+
description: p.description,
|
|
20
|
+
permission: p.permission_address,
|
|
21
|
+
location: p.location || undefined,
|
|
22
|
+
sales: { op: "add", sales: p.sales_items },
|
|
23
|
+
order_allocators: [
|
|
24
|
+
{
|
|
25
|
+
threshold: "0",
|
|
26
|
+
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
if (p.buy_guard_address)
|
|
31
|
+
result.buy_guard = p.buy_guard_address;
|
|
32
|
+
return result;
|
|
33
|
+
},
|
|
34
|
+
notes: [
|
|
35
|
+
"WIP hash is MANDATORY for tamper protection — never leave empty if wip URL is set",
|
|
36
|
+
"Use buy_guard for pre-sale whitelist phase, then clear for public sale",
|
|
37
|
+
"Single-recipient allocation (owner 100%) — use T-S-08 for multi-party split",
|
|
38
|
+
],
|
|
39
|
+
post_publish_considerations: [
|
|
40
|
+
"machine/arbitrations/order_allocators become immutable — verify before publish",
|
|
41
|
+
"Sales can still be added/removed/updated post-publish",
|
|
42
|
+
"buy_guard can be changed post-publish (unusual exception)",
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "T-S-02",
|
|
47
|
+
name: "Rental Service (deposit + use + return)",
|
|
48
|
+
description: "Equipment/asset rental with deposit guarantee, Machine workflow, and arbitration",
|
|
49
|
+
applicable_scenes: ["service_rental"],
|
|
50
|
+
industry_tags: ["rental", "equipment", "real_estate"],
|
|
51
|
+
params: [
|
|
52
|
+
{ name: "owner_address", type: "address", description: "Service owner (rental company)", required: true },
|
|
53
|
+
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
54
|
+
{ name: "description", type: "string", description: "Rental service description", required: true },
|
|
55
|
+
{ name: "machine_address", type: "address", description: "Published Machine with Reserve→Pay→Pickup→Return→Refund nodes", required: true },
|
|
56
|
+
{ name: "arbitration_address", type: "address", description: "Arbitration for deposit disputes", required: true },
|
|
57
|
+
{ name: "rental_items", type: "object", description: "Array of {name, price, stock=1, wip, wip_hash}", required: true },
|
|
58
|
+
{ name: "compensation_fund_balance", type: "string", description: "Initial deposit to compensation_fund (in base units)", required: false, default: "0" },
|
|
59
|
+
],
|
|
60
|
+
body: (p) => ({
|
|
61
|
+
object: null,
|
|
62
|
+
description: p.description,
|
|
63
|
+
permission: p.permission_address,
|
|
64
|
+
machine: p.machine_address,
|
|
65
|
+
arbitrations: { op: "add", objects: [p.arbitration_address] },
|
|
66
|
+
sales: { op: "add", sales: p.rental_items },
|
|
67
|
+
order_allocators: [
|
|
68
|
+
{
|
|
69
|
+
threshold: "0",
|
|
70
|
+
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
compensation_fund_add: p.compensation_fund_balance && p.compensation_fund_balance !== "0"
|
|
74
|
+
? { balance: p.compensation_fund_balance }
|
|
75
|
+
: undefined,
|
|
76
|
+
}),
|
|
77
|
+
notes: [
|
|
78
|
+
"stock=1 per rental item (unique items) — once rented, stock becomes 0",
|
|
79
|
+
"Machine must define deposit/return/refund nodes for proper rental flow",
|
|
80
|
+
"compensation_fund holds deposit guarantees — separate from rental fee",
|
|
81
|
+
"Arbitration required if compensation_fund > 0 (F-S-19)",
|
|
82
|
+
],
|
|
83
|
+
post_publish_considerations: [
|
|
84
|
+
"Machine binding is permanent — verify workflow before publish",
|
|
85
|
+
"Arbitration binding is permanent — choose reputable arbiters",
|
|
86
|
+
"Sales can be updated (add new rental items, remove deprecated ones)",
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "T-S-03",
|
|
91
|
+
name: "Subscription Service (tiered plans)",
|
|
92
|
+
description: "Recurring-access service with tiered plans (Free/Pro/Enterprise), discount coupons, loyalty rewards",
|
|
93
|
+
applicable_scenes: ["service_subscription"],
|
|
94
|
+
industry_tags: ["subscription", "saas", "membership"],
|
|
95
|
+
params: [
|
|
96
|
+
{ name: "owner_address", type: "address", description: "Service owner", required: true },
|
|
97
|
+
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
98
|
+
{ name: "description", type: "string", description: "Subscription service description", required: true },
|
|
99
|
+
{ name: "tier_plans", type: "object", description: "Array of {name, price, stock=999999, wip, wip_hash} for each tier", required: true },
|
|
100
|
+
{ name: "trial_discount_count", type: "number", description: "Number of trial discount coupons to issue", required: false, default: 0 },
|
|
101
|
+
{ name: "reward_address", type: "address", description: "Loyalty Reward object address (optional)", required: false, default: "" },
|
|
102
|
+
],
|
|
103
|
+
body: (p) => {
|
|
104
|
+
const result = {
|
|
105
|
+
object: null,
|
|
106
|
+
description: p.description,
|
|
107
|
+
permission: p.permission_address,
|
|
108
|
+
sales: { op: "add", sales: p.tier_plans },
|
|
109
|
+
order_allocators: [
|
|
110
|
+
{
|
|
111
|
+
threshold: "0",
|
|
112
|
+
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
if (p.reward_address) {
|
|
117
|
+
result.rewards = { op: "add", objects: [p.reward_address] };
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
},
|
|
121
|
+
notes: [
|
|
122
|
+
"Subscription renewals are handled by repeat orders (no native recurring billing)",
|
|
123
|
+
"Use large stock values (e.g. 999999) since subscriptions are not inventory-limited",
|
|
124
|
+
"Trial discounts: issue via service::discount (312) post-publish",
|
|
125
|
+
"Loyalty rewards: bind via service::reward_add (318) — locked by setting_lock_duration",
|
|
126
|
+
],
|
|
127
|
+
post_publish_considerations: [
|
|
128
|
+
"Tier prices can be updated via sales_set (existing subscribers unaffected)",
|
|
129
|
+
"Discount coupons can be issued/destroyed post-publish",
|
|
130
|
+
"Rewards can be added but removal locked by duration",
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: "T-S-04",
|
|
135
|
+
name: "Workflow-bound Service (machine-driven delivery)",
|
|
136
|
+
description: "Service with multi-step delivery workflow (e.g. freelance, custom manufacturing, course)",
|
|
137
|
+
applicable_scenes: ["service_workflow", "service_rental"],
|
|
138
|
+
industry_tags: ["workflow", "freelance", "manufacturing", "education"],
|
|
139
|
+
params: [
|
|
140
|
+
{ name: "owner_address", type: "address", description: "Service owner (provider)", required: true },
|
|
141
|
+
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
142
|
+
{ name: "description", type: "string", description: "Service description", required: true },
|
|
143
|
+
{ name: "machine_address", type: "address", description: "Published Machine with Pay→Confirm→Deliver→Sign-off nodes", required: true },
|
|
144
|
+
{ name: "service_items", type: "object", description: "Array of {name, price, stock, wip, wip_hash}", required: true },
|
|
145
|
+
{ name: "customer_required", type: "string[]", description: "Required info fields (e.g. ['name','project_brief'])", required: false, default: [] },
|
|
146
|
+
],
|
|
147
|
+
body: (p) => ({
|
|
148
|
+
object: null,
|
|
149
|
+
description: p.description,
|
|
150
|
+
permission: p.permission_address,
|
|
151
|
+
machine: p.machine_address,
|
|
152
|
+
sales: { op: "add", sales: p.service_items },
|
|
153
|
+
customer_required: p.customer_required,
|
|
154
|
+
order_allocators: [
|
|
155
|
+
{
|
|
156
|
+
threshold: "0",
|
|
157
|
+
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
}),
|
|
161
|
+
notes: [
|
|
162
|
+
"Machine MUST be published before binding (machine::publish)",
|
|
163
|
+
"Each order creates a Progress object tracking the workflow",
|
|
164
|
+
"Named operators can be assigned per Forward in the Machine",
|
|
165
|
+
"Service.bPaused does NOT affect already-created Progress (existing orders continue)",
|
|
166
|
+
],
|
|
167
|
+
post_publish_considerations: [
|
|
168
|
+
"Machine binding is PERMANENT — cannot upgrade workflow post-publish",
|
|
169
|
+
"To change workflow: clone Service with new Machine, migrate customers via discounts",
|
|
170
|
+
"customer_required fields can be updated post-publish",
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "T-S-05",
|
|
175
|
+
name: "Arbitration-bound Service (dispute-ready)",
|
|
176
|
+
description: "Service with multiple Arbitration objects for different dispute scopes + compensation_fund",
|
|
177
|
+
applicable_scenes: ["service_arbitration", "service_arbitration_binding"],
|
|
178
|
+
industry_tags: ["arbitration", "dispute_resolution", "high_value"],
|
|
179
|
+
params: [
|
|
180
|
+
{ name: "owner_address", type: "address", description: "Service owner", required: true },
|
|
181
|
+
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
182
|
+
{ name: "description", type: "string", description: "Service description", required: true },
|
|
183
|
+
{ name: "arbitration_addresses", type: "string[]", description: "1-3 Arbitration object addresses (different scopes)", required: true },
|
|
184
|
+
{ name: "compensation_fund_balance", type: "string", description: "Initial compensation_fund deposit (base units)", required: true },
|
|
185
|
+
{ name: "setting_lock_duration_ms", type: "number", description: "Initial setting_lock_duration in ms (default 30 days)", required: false, default: 2592000000 },
|
|
186
|
+
{ name: "service_items", type: "object", description: "Array of {name, price, stock, wip, wip_hash}", required: true },
|
|
187
|
+
],
|
|
188
|
+
body: (p) => ({
|
|
189
|
+
object: null,
|
|
190
|
+
description: p.description,
|
|
191
|
+
permission: p.permission_address,
|
|
192
|
+
arbitrations: { op: "add", objects: p.arbitration_addresses },
|
|
193
|
+
compensation_fund_add: { balance: p.compensation_fund_balance },
|
|
194
|
+
setting_locked_time_add: p.setting_lock_duration_ms,
|
|
195
|
+
sales: { op: "add", sales: p.service_items },
|
|
196
|
+
order_allocators: [
|
|
197
|
+
{
|
|
198
|
+
threshold: "0",
|
|
199
|
+
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
}),
|
|
203
|
+
notes: [
|
|
204
|
+
"Use 2-3 Arbitration objects: e.g. one for quality disputes, one for delivery disputes",
|
|
205
|
+
"compensation_fund > 0 REQUIRES arbitrations non-empty (F-S-19, E_ARBITRATION_NOT_SET_WITH_COMPENSATION_FUND)",
|
|
206
|
+
"compensation_fund coin type MUST match Service<T> type parameter",
|
|
207
|
+
"setting_lock_duration protects customers — only-increase mechanism",
|
|
208
|
+
],
|
|
209
|
+
post_publish_considerations: [
|
|
210
|
+
"Arbitration bindings are PERMANENT — verify arb reputation before publish",
|
|
211
|
+
"compensation_fund_add (deposit) is always mutable post-publish",
|
|
212
|
+
"compensation_fund_withdraw requires bPaused=true + lock_duration expired",
|
|
213
|
+
"Cannot add new Arbitration post-publish — only pre-publish",
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: "T-S-06",
|
|
218
|
+
name: "Compensation fund Service (embedded Balance<T>)",
|
|
219
|
+
description: "Service focused on compensation_fund management — emphasizes distinction from Treasury",
|
|
220
|
+
applicable_scenes: ["service_compensation_fund", "service_arbitration"],
|
|
221
|
+
industry_tags: ["finance", "escrow", "guarantee"],
|
|
222
|
+
params: [
|
|
223
|
+
{ name: "owner_address", type: "address", description: "Service owner", required: true },
|
|
224
|
+
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
225
|
+
{ name: "description", type: "string", description: "Service description", required: true },
|
|
226
|
+
{ name: "arbitration_addresses", type: "string[]", description: "Arbitration objects (required when fund > 0)", required: true },
|
|
227
|
+
{ name: "initial_deposit", type: "string", description: "Initial compensation_fund deposit (base units)", required: true },
|
|
228
|
+
{ name: "lock_duration_ms", type: "number", description: "setting_lock_duration (ms)", required: false, default: 2592000000 },
|
|
229
|
+
{ name: "service_items", type: "object", description: "Sales items", required: true },
|
|
230
|
+
],
|
|
231
|
+
body: (p) => ({
|
|
232
|
+
object: null,
|
|
233
|
+
description: p.description,
|
|
234
|
+
permission: p.permission_address,
|
|
235
|
+
arbitrations: { op: "add", objects: p.arbitration_addresses },
|
|
236
|
+
compensation_fund_add: { balance: p.initial_deposit },
|
|
237
|
+
setting_locked_time_add: p.lock_duration_ms,
|
|
238
|
+
sales: { op: "add", sales: p.service_items },
|
|
239
|
+
order_allocators: [
|
|
240
|
+
{
|
|
241
|
+
threshold: "0",
|
|
242
|
+
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
}),
|
|
246
|
+
notes: [
|
|
247
|
+
"⚠️ compensation_fund is INTERNAL Balance<T> — distinct from Treasury (external)",
|
|
248
|
+
"Treasury is referenced via order_allocators.sharing.who=Entity (Treasury address)",
|
|
249
|
+
"compensation_fund is consumed by arbitration::compensation_claim (driven by arb result)",
|
|
250
|
+
"Owner can only withdraw via compensation_fund_withdraw (requires paused + lock expired)",
|
|
251
|
+
],
|
|
252
|
+
post_publish_considerations: [
|
|
253
|
+
"Deposits (compensation_fund_add) always allowed",
|
|
254
|
+
"Withdrawals (compensation_fund_withdraw) require bPaused=true + lock_duration expired",
|
|
255
|
+
"Receive (compensation_fund_receive) locked by duration",
|
|
256
|
+
"setting_lock_duration only-increase — plan withdrawal timeline carefully",
|
|
257
|
+
],
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
id: "T-S-07",
|
|
261
|
+
name: "Dynamic pricing Service (discount-driven)",
|
|
262
|
+
description: "Service with promotional discount coupons — supports rates (basis points, per 10000) and minus (direct deduction) types",
|
|
263
|
+
applicable_scenes: ["service_dynamic_pricing"],
|
|
264
|
+
industry_tags: ["retail", "marketing", "promotion"],
|
|
265
|
+
params: [
|
|
266
|
+
{ name: "owner_address", type: "address", description: "Service owner", required: true },
|
|
267
|
+
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
268
|
+
{ name: "description", type: "string", description: "Service description", required: true },
|
|
269
|
+
{ name: "service_items", type: "object", description: "Array of {name, price, stock, wip, wip_hash}", required: true },
|
|
270
|
+
{ name: "discount_specs", type: "object", description: "Array of {name, type, data, count, expire_at} for initial discounts", required: false, default: [] },
|
|
271
|
+
],
|
|
272
|
+
body: (p) => ({
|
|
273
|
+
object: null,
|
|
274
|
+
description: p.description,
|
|
275
|
+
permission: p.permission_address,
|
|
276
|
+
sales: { op: "add", sales: p.service_items },
|
|
277
|
+
order_allocators: [
|
|
278
|
+
{
|
|
279
|
+
threshold: "0",
|
|
280
|
+
sharing: [{ who: { Object: p.owner_address }, weight: 100 }],
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
}),
|
|
284
|
+
notes: [
|
|
285
|
+
"Discounts are issued POST-PUBLISH via service::discount (312) — not in create body",
|
|
286
|
+
"discount_type=0 rates (basis points, e.g. 1000=10%); 1=minus (direct deduction, base units)",
|
|
287
|
+
"MAX_DISCOUNT_COUNT_ONCE = 1000 per issue call",
|
|
288
|
+
"MAX_DISCOUNT_RECEIVER_ONCE = 1000 receivers per call",
|
|
289
|
+
"MAX_DISCOUNT_TOTAL_COUNT = 20000 total coupons per Service",
|
|
290
|
+
"discount_destroy is holder-only (no SERVICE_DISCOUNT permission needed)",
|
|
291
|
+
],
|
|
292
|
+
post_publish_considerations: [
|
|
293
|
+
"Discount coupons can be issued/destroyed freely",
|
|
294
|
+
"Sales prices can be updated via sales_set (existing orders unaffected)",
|
|
295
|
+
"Track discount usage to avoid stockout of promotional items",
|
|
296
|
+
],
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
id: "T-S-08",
|
|
300
|
+
name: "Multi-allocator Service (tiered fund distribution)",
|
|
301
|
+
description: "Service with multiple allocator tiers — first-match-wins distribution based on order value",
|
|
302
|
+
applicable_scenes: ["service_multi_allocator", "service_order_allocator", "service_reward"],
|
|
303
|
+
industry_tags: ["marketplace", "platform", "logistics"],
|
|
304
|
+
params: [
|
|
305
|
+
{ name: "owner_address", type: "address", description: "Service owner (merchant)", required: true },
|
|
306
|
+
{ name: "permission_address", type: "address", description: "Permission object address", required: true },
|
|
307
|
+
{ name: "description", type: "string", description: "Service description", required: true },
|
|
308
|
+
{ name: "platform_address", type: "address", description: "Platform fee recipient", required: true },
|
|
309
|
+
{ name: "logistics_address", type: "address", description: "Logistics fee recipient (optional)", required: false, default: "" },
|
|
310
|
+
{ name: "service_items", type: "object", description: "Array of {name, price, stock, wip, wip_hash}", required: true },
|
|
311
|
+
{ name: "tier1_threshold", type: "string", description: "Small order threshold (base units, e.g. '0')", required: false, default: "0" },
|
|
312
|
+
{ name: "tier2_threshold", type: "string", description: "Medium order threshold (base units)", required: false, default: "10000000000" },
|
|
313
|
+
{ name: "tier3_threshold", type: "string", description: "Large order threshold (base units)", required: false, default: "100000000000" },
|
|
314
|
+
],
|
|
315
|
+
body: (p) => {
|
|
316
|
+
const allocators = [
|
|
317
|
+
{
|
|
318
|
+
threshold: p.tier1_threshold,
|
|
319
|
+
sharing: [
|
|
320
|
+
{ who: { Object: p.owner_address }, weight: 90 },
|
|
321
|
+
{ who: { Object: p.platform_address }, weight: 10 },
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
threshold: p.tier2_threshold,
|
|
326
|
+
sharing: p.logistics_address
|
|
327
|
+
? [
|
|
328
|
+
{ who: { Object: p.owner_address }, weight: 80 },
|
|
329
|
+
{ who: { Object: p.platform_address }, weight: 10 },
|
|
330
|
+
{ who: { Object: p.logistics_address }, weight: 10 },
|
|
331
|
+
]
|
|
332
|
+
: [
|
|
333
|
+
{ who: { Object: p.owner_address }, weight: 85 },
|
|
334
|
+
{ who: { Object: p.platform_address }, weight: 15 },
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
threshold: p.tier3_threshold,
|
|
339
|
+
sharing: p.logistics_address
|
|
340
|
+
? [
|
|
341
|
+
{ who: { Object: p.owner_address }, weight: 70 },
|
|
342
|
+
{ who: { Object: p.platform_address }, weight: 10 },
|
|
343
|
+
{ who: { Object: p.logistics_address }, weight: 20 },
|
|
344
|
+
]
|
|
345
|
+
: [
|
|
346
|
+
{ who: { Object: p.owner_address }, weight: 80 },
|
|
347
|
+
{ who: { Object: p.platform_address }, weight: 20 },
|
|
348
|
+
],
|
|
349
|
+
},
|
|
350
|
+
];
|
|
351
|
+
return {
|
|
352
|
+
object: null,
|
|
353
|
+
description: p.description,
|
|
354
|
+
permission: p.permission_address,
|
|
355
|
+
sales: { op: "add", sales: p.service_items },
|
|
356
|
+
order_allocators: allocators,
|
|
357
|
+
};
|
|
358
|
+
},
|
|
359
|
+
notes: [
|
|
360
|
+
"First-match-wins: first allocator whose threshold <= order value handles distribution",
|
|
361
|
+
"Each tier can have its own Guard for execution authorization (optional)",
|
|
362
|
+
"Thresholds must be ascending (tier1 < tier2 < tier3)",
|
|
363
|
+
"MAX_SHARING_COUNT = 100 per allocator (sum of sharing entries)",
|
|
364
|
+
"Treasury addresses can be referenced via sharing.who=Entity (Treasury object)",
|
|
365
|
+
],
|
|
366
|
+
post_publish_considerations: [
|
|
367
|
+
"⚠️ order_allocators is IMMUTABLE post-publish (F-S-22) — verify tiers before publish",
|
|
368
|
+
"To change fee split: clone Service with new allocators (cannot migrate existing Orders)",
|
|
369
|
+
"Sales can still be updated post-publish (only allocator is locked)",
|
|
370
|
+
],
|
|
371
|
+
},
|
|
372
|
+
];
|
|
373
|
+
export const SERVICE_TEMPLATES_VERSION = "1.0.0";
|
|
374
|
+
export function getAllServiceTemplates() {
|
|
375
|
+
return [...SERVICE_TEMPLATES];
|
|
376
|
+
}
|
|
377
|
+
export function getServiceTemplateById(id) {
|
|
378
|
+
return SERVICE_TEMPLATES.find(t => t.id === id);
|
|
379
|
+
}
|
|
380
|
+
export function getServiceTemplatesByScene(sceneId) {
|
|
381
|
+
return SERVICE_TEMPLATES.filter(t => t.applicable_scenes.includes(sceneId));
|
|
382
|
+
}
|
|
383
|
+
export function getServiceTemplatesByIndustry(industry) {
|
|
384
|
+
return SERVICE_TEMPLATES.filter(t => t.industry_tags.includes(industry) || t.industry_tags.includes("universal"));
|
|
385
|
+
}
|
|
386
|
+
export function suggestServiceTemplateForScene(sceneId) {
|
|
387
|
+
const matches = getServiceTemplatesByScene(sceneId);
|
|
388
|
+
return matches.length > 0 ? matches[0] : undefined;
|
|
389
|
+
}
|
|
390
|
+
export function listServiceTemplates() {
|
|
391
|
+
return SERVICE_TEMPLATES.map(t => ({
|
|
392
|
+
id: t.id,
|
|
393
|
+
name: t.name,
|
|
394
|
+
description: t.description,
|
|
395
|
+
scenes: t.applicable_scenes,
|
|
396
|
+
}));
|
|
397
|
+
}
|
|
398
|
+
export function fillServiceTemplate(templateId, params) {
|
|
399
|
+
const tpl = getServiceTemplateById(templateId);
|
|
400
|
+
if (!tpl)
|
|
401
|
+
return { ok: false, error: `Template ${templateId} not found` };
|
|
402
|
+
const missing = [];
|
|
403
|
+
for (const p of tpl.params) {
|
|
404
|
+
if (p.required && !(p.name in params)) {
|
|
405
|
+
missing.push(p.name);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
if (missing.length > 0) {
|
|
409
|
+
return { ok: false, error: `Missing required params: ${missing.join(", ")}`, missing_required: missing };
|
|
410
|
+
}
|
|
411
|
+
const filled = { ...params };
|
|
412
|
+
for (const p of tpl.params) {
|
|
413
|
+
if (!(p.name in filled) && p.default !== undefined) {
|
|
414
|
+
filled[p.name] = p.default;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return { ok: true, body: tpl.body(filled) };
|
|
418
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export interface SemanticToSchemaRule {
|
|
2
|
+
id: string;
|
|
3
|
+
pattern_name: string;
|
|
4
|
+
semantic_intent: string;
|
|
5
|
+
match_keywords: string[];
|
|
6
|
+
schema_fields: string[];
|
|
7
|
+
example_json: object;
|
|
8
|
+
reverse_explanation: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SchemaToSemanticRule {
|
|
11
|
+
element_type: "field" | "op" | "index";
|
|
12
|
+
type_name: string;
|
|
13
|
+
semantic_explanation: string;
|
|
14
|
+
constraints?: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface ServiceConstraintRule {
|
|
17
|
+
id: string;
|
|
18
|
+
category: "structural" | "semantic" | "authority" | "lifecycle" | "cross_object";
|
|
19
|
+
rule: string;
|
|
20
|
+
applies_to: string[];
|
|
21
|
+
}
|
|
22
|
+
export declare const SEMANTIC_TO_SCHEMA_RULES: SemanticToSchemaRule[];
|
|
23
|
+
export declare const SCHEMA_TO_SEMANTIC_RULES: SchemaToSemanticRule[];
|
|
24
|
+
export declare const SERVICE_CONSTRAINT_RULES: ServiceConstraintRule[];
|
|
25
|
+
export declare const SERVICE_TRANSLATION_VERSION = "1.0.0";
|
|
26
|
+
export declare function matchSemanticPattern(userIntent: string): SemanticToSchemaRule[];
|
|
27
|
+
export interface ServiceCallDataForExplain {
|
|
28
|
+
object?: string | null;
|
|
29
|
+
description?: string;
|
|
30
|
+
location?: string;
|
|
31
|
+
customer_required?: string[];
|
|
32
|
+
sales?: {
|
|
33
|
+
op: "add" | "set";
|
|
34
|
+
sales: Array<{
|
|
35
|
+
name: string;
|
|
36
|
+
price?: string;
|
|
37
|
+
stock?: number;
|
|
38
|
+
wip?: string;
|
|
39
|
+
wip_hash?: string;
|
|
40
|
+
}>;
|
|
41
|
+
} | {
|
|
42
|
+
op: "remove";
|
|
43
|
+
sales_name: string[];
|
|
44
|
+
} | {
|
|
45
|
+
op: "clear";
|
|
46
|
+
};
|
|
47
|
+
machine?: string | null;
|
|
48
|
+
buy_guard?: string | null;
|
|
49
|
+
arbitrations?: {
|
|
50
|
+
op: "add" | "set" | "remove";
|
|
51
|
+
objects: string[];
|
|
52
|
+
} | {
|
|
53
|
+
op: "clear";
|
|
54
|
+
};
|
|
55
|
+
repositories?: {
|
|
56
|
+
op: "add" | "set" | "remove";
|
|
57
|
+
objects: string[];
|
|
58
|
+
} | {
|
|
59
|
+
op: "clear";
|
|
60
|
+
};
|
|
61
|
+
rewards?: {
|
|
62
|
+
op: "add" | "set" | "remove";
|
|
63
|
+
objects: string[];
|
|
64
|
+
} | {
|
|
65
|
+
op: "clear";
|
|
66
|
+
};
|
|
67
|
+
order_allocators?: unknown;
|
|
68
|
+
discount?: {
|
|
69
|
+
name: string;
|
|
70
|
+
discount_type: number;
|
|
71
|
+
data: number;
|
|
72
|
+
count: number;
|
|
73
|
+
receivers?: string[];
|
|
74
|
+
expire_at?: number;
|
|
75
|
+
};
|
|
76
|
+
pause?: boolean;
|
|
77
|
+
publish?: boolean;
|
|
78
|
+
compensation_fund_add?: {
|
|
79
|
+
balance: string | number;
|
|
80
|
+
};
|
|
81
|
+
compensation_fund_withdraw?: unknown;
|
|
82
|
+
compensation_fund_receive?: unknown;
|
|
83
|
+
setting_locked_time_add?: number;
|
|
84
|
+
order_new?: {
|
|
85
|
+
buy: {
|
|
86
|
+
items: Array<{
|
|
87
|
+
name: string;
|
|
88
|
+
wip_hash: string;
|
|
89
|
+
count: number;
|
|
90
|
+
}>;
|
|
91
|
+
discount?: string;
|
|
92
|
+
total_pay: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
builder?: string;
|
|
96
|
+
um?: string | null;
|
|
97
|
+
owner_receive?: unknown;
|
|
98
|
+
}
|
|
99
|
+
export declare function explainServiceCallData(data: ServiceCallDataForExplain): string;
|
|
100
|
+
export declare function explainField(fieldName: string): SchemaToSemanticRule | undefined;
|
|
101
|
+
export declare function explainOp(opName: string): SchemaToSemanticRule | undefined;
|
|
102
|
+
export declare function getConstraintsByCategory(category: ServiceConstraintRule["category"]): ServiceConstraintRule[];
|
|
103
|
+
export declare function explainServicePermissionIndex(index: number): string;
|