@wowok/agent-mcp 2.4.1 → 2.5.0
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.d.ts +2 -2
- package/dist/index.js +29 -1621
- 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-ledger.js +14 -0
- package/dist/knowledge/guard-lint.d.ts +1 -0
- package/dist/knowledge/guard-lint.js +83 -3
- package/dist/knowledge/guard-migration.d.ts +48 -0
- package/dist/knowledge/guard-migration.js +228 -0
- package/dist/knowledge/guard-puzzle.js +3 -2
- package/dist/knowledge/guard-risk.d.ts +3 -1
- package/dist/knowledge/guard-risk.js +832 -64
- package/dist/knowledge/guard-templates.d.ts +1 -0
- package/dist/knowledge/guard-templates.js +278 -2
- 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/graph.d.ts +1 -0
- package/dist/project/graph.js +27 -1
- package/dist/project/index.d.ts +1 -0
- package/dist/project/index.js +39 -2
- package/dist/project/namespace.d.ts +11 -1
- package/dist/project/namespace.js +27 -2
- package/dist/project/query.d.ts +2 -0
- package/dist/project/query.js +56 -15
- 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/rules.d.ts +12 -0
- package/dist/rules.js +9 -0
- package/dist/schema/call/allocation.d.ts +44 -44
- package/dist/schema/call/arbitration.d.ts +141 -141
- package/dist/schema/call/base.d.ts +386 -386
- package/dist/schema/call/base.js +6 -6
- 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 +96 -96
- 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/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +238 -238
- 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 +1102 -1118
- package/dist/schema/operations.js +7 -1
- package/dist/schema/project/index.d.ts +1392 -6
- package/dist/schema/project/index.js +426 -2
- package/dist/schema/query/index.d.ts +818 -818
- package/dist/schema/query/index.js +15 -9
- 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/schema/utils/guard-query-utils.d.ts +7 -0
- package/dist/schema/utils/guard-query-utils.js +14 -1
- package/dist/schemas/account_operation.output.json +718 -0
- package/dist/schemas/bridge_operation.output.json +1 -1
- 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/messenger_operation.output.json +1 -1
- package/dist/schemas/onchain_events.output.json +1 -1
- package/dist/schemas/onchain_operations.output.json +5 -4
- package/dist/schemas/onchain_operations.schema.json +1813 -333
- package/dist/schemas/onchain_operations_allocation.schema.json +9 -11
- 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 +584 -70
- package/dist/schemas/onchain_operations_machine.schema.json +4 -6
- package/dist/schemas/onchain_operations_order.schema.json +13 -9
- package/dist/schemas/onchain_operations_payment.schema.json +2 -1
- package/dist/schemas/onchain_operations_permission.schema.json +2 -1
- package/dist/schemas/onchain_operations_personal.schema.json +2 -1
- 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 +4 -6
- package/dist/schemas/onchain_operations_treasury.schema.json +2 -1
- package/dist/schemas/onchain_table_data.output.json +6 -12
- package/dist/schemas/onchain_table_data.schema.json +32 -1
- package/dist/schemas/project_operation.output.json +879 -0
- package/dist/schemas/project_operation.schema.json +473 -2
- 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/bridge.d.ts +1 -0
- package/dist/tools/handlers/bridge.js +1 -0
- package/dist/tools/handlers/config.d.ts +2 -0
- package/dist/tools/handlers/config.js +74 -0
- package/dist/tools/handlers/file-export.d.ts +3 -0
- package/dist/tools/handlers/file-export.js +90 -0
- package/dist/tools/handlers/local.d.ts +3 -0
- package/dist/tools/handlers/local.js +38 -0
- package/dist/tools/handlers/messenger.d.ts +16 -0
- package/dist/tools/handlers/messenger.js +188 -0
- package/dist/tools/handlers/onchain.d.ts +2 -0
- package/dist/tools/handlers/onchain.js +248 -0
- package/dist/tools/handlers/project.d.ts +2 -0
- package/dist/tools/handlers/project.js +293 -0
- package/dist/tools/handlers/query.d.ts +5 -0
- package/dist/tools/handlers/query.js +256 -0
- package/dist/tools/handlers/schema-query.d.ts +2 -0
- package/dist/tools/handlers/schema-query.js +93 -0
- package/dist/tools/handlers/trust.d.ts +2 -0
- package/dist/tools/handlers/trust.js +194 -0
- package/dist/tools/handlers/wip.d.ts +2 -0
- package/dist/tools/handlers/wip.js +44 -0
- package/dist/tools/index.d.ts +13 -0
- package/dist/tools/index.js +526 -0
- package/dist/tools/rules-hook.d.ts +2 -0
- package/dist/tools/rules-hook.js +23 -0
- package/dist/tools/shared.d.ts +20 -0
- package/dist/tools/shared.js +130 -0
- package/dist/tools/types.d.ts +35 -0
- package/dist/tools/types.js +1 -0
- package/dist/tools/wrap.d.ts +14 -0
- package/dist/tools/wrap.js +267 -0
- package/package.json +20 -6
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type TemplateParamType = "address" | "string" | "number" | "string[]" | "object";
|
|
2
|
+
export interface OrderTemplateParam {
|
|
3
|
+
name: string;
|
|
4
|
+
type: TemplateParamType;
|
|
5
|
+
description: string;
|
|
6
|
+
required: boolean;
|
|
7
|
+
default?: string | number | string[] | object;
|
|
8
|
+
}
|
|
9
|
+
export interface OrderTemplate {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
applicable_scenes: string[];
|
|
14
|
+
industry_tags: string[];
|
|
15
|
+
params: OrderTemplateParam[];
|
|
16
|
+
body: (params: Record<string, string | number | string[] | object>) => object;
|
|
17
|
+
notes?: string[];
|
|
18
|
+
permission_layer: "L1_owner_only" | "L2_owner_or_agent" | "L3_package_only" | "via_service_buy";
|
|
19
|
+
irreversible: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const ORDER_TEMPLATES: OrderTemplate[];
|
|
22
|
+
export declare const ORDER_TEMPLATES_VERSION = "1.0.0";
|
|
23
|
+
export declare const ORDER_TEMPLATES_COUNT: number;
|
|
24
|
+
export declare function getAllOrderTemplates(): OrderTemplate[];
|
|
25
|
+
export declare function getTemplateById(id: string): OrderTemplate | undefined;
|
|
26
|
+
export declare function getTemplatesByScene(sceneId: string): OrderTemplate[];
|
|
27
|
+
export declare function getTemplatesByIndustry(industry: string): OrderTemplate[];
|
|
28
|
+
export declare function getTemplatesByPermissionLayer(layer: OrderTemplate["permission_layer"]): OrderTemplate[];
|
|
29
|
+
export declare function getIrreversibleTemplates(): OrderTemplate[];
|
|
30
|
+
export declare function suggestTemplateForScene(sceneId: string): OrderTemplate | undefined;
|
|
31
|
+
export declare function listOrderTemplates(): {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
description: string;
|
|
35
|
+
scenes: string[];
|
|
36
|
+
irreversible: boolean;
|
|
37
|
+
}[];
|
|
38
|
+
export type FillTemplateResult = {
|
|
39
|
+
ok: true;
|
|
40
|
+
body: object;
|
|
41
|
+
template: OrderTemplate;
|
|
42
|
+
} | {
|
|
43
|
+
ok: false;
|
|
44
|
+
error: string;
|
|
45
|
+
template?: OrderTemplate;
|
|
46
|
+
};
|
|
47
|
+
export declare function fillTemplate(templateId: string, params: Record<string, string | number | string[] | object>): FillTemplateResult;
|
|
48
|
+
export declare function suggestTemplateFromIntent(intent: string): OrderTemplate | undefined;
|
|
49
|
+
export declare function getTemplateParameters(templateId: string): OrderTemplateParam[] | undefined;
|
|
50
|
+
export declare function validateTemplateParams(templateId: string, params: Record<string, string | number | string[] | object>): string[];
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
export const ORDER_TEMPLATES = [
|
|
2
|
+
{
|
|
3
|
+
id: "T-O-01",
|
|
4
|
+
name: "Standard retail order (single item, no machine)",
|
|
5
|
+
description: "Template for buying a single retail item from a Service without a Machine workflow. Order created via service::buy.",
|
|
6
|
+
applicable_scenes: ["order_create", "order_required_info"],
|
|
7
|
+
industry_tags: ["retail", "universal"],
|
|
8
|
+
params: [
|
|
9
|
+
{ name: "service_address", type: "address", description: "Service object address (target of service::buy)", required: true },
|
|
10
|
+
{ name: "item_name", type: "string", description: "Item name (must match Service's sale item name)", required: true },
|
|
11
|
+
{ name: "item_price", type: "string", description: "Item price in MIST (string for u64 precision)", required: true },
|
|
12
|
+
{ name: "item_quantity", type: "number", description: "Quantity to purchase", required: true, default: 1 },
|
|
13
|
+
{ name: "wip_hash", type: "string", description: "WIP hash (NOT empty string — use '0x' + actual hash)", required: true },
|
|
14
|
+
{ name: "discount_address", type: "address", description: "Discount object address (optional)", required: false },
|
|
15
|
+
{ name: "named_order", type: "string", description: "Order alias name (optional, for SDK lookup)", required: false },
|
|
16
|
+
{ name: "contact_address", type: "address", description: "Contact object address for required_info (recipient)", required: false },
|
|
17
|
+
],
|
|
18
|
+
body: (p) => {
|
|
19
|
+
const result = {
|
|
20
|
+
_note: "Order creation goes via service::buy, not CallOrder_Data. Use this template to populate CallService_Data.buy.",
|
|
21
|
+
_call_target: "service",
|
|
22
|
+
object: p.service_address,
|
|
23
|
+
buy: {
|
|
24
|
+
items: [
|
|
25
|
+
{
|
|
26
|
+
name: p.item_name,
|
|
27
|
+
price: p.item_price,
|
|
28
|
+
quantity: p.item_quantity,
|
|
29
|
+
wip_hash: p.wip_hash,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
discount: p.discount_address ?? null,
|
|
33
|
+
named_order: p.named_order ?? null,
|
|
34
|
+
machine_forward: null,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
if (p.contact_address) {
|
|
38
|
+
result._post_buy_required_info = p.contact_address;
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
},
|
|
42
|
+
notes: [
|
|
43
|
+
"Order is NOT created directly — service::buy atomically builds Order + Allocation + Progress",
|
|
44
|
+
"wip_hash must NOT be empty string — use actual hash to avoid 'WIP hash not match' error",
|
|
45
|
+
"Item name + price must match a sale item configured on the Service",
|
|
46
|
+
],
|
|
47
|
+
permission_layer: "via_service_buy",
|
|
48
|
+
irreversible: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "T-O-02",
|
|
52
|
+
name: "Workflow order advance (machine + progress forward)",
|
|
53
|
+
description: "Template for advancing an Order's Progress via named forward. Both owner and agent can advance.",
|
|
54
|
+
applicable_scenes: ["order_advance"],
|
|
55
|
+
industry_tags: ["workflow", "logistics", "service"],
|
|
56
|
+
params: [
|
|
57
|
+
{ name: "order_address", type: "address", description: "Order object address", required: true },
|
|
58
|
+
{ name: "next_node_name", type: "string", description: "Target node name to advance to", required: true },
|
|
59
|
+
{ name: "forward_name", type: "string", description: "Forward name (must exist on current node)", required: true },
|
|
60
|
+
{ name: "operator", type: "address", description: "Named operator address (optional, null for anyone)", required: false },
|
|
61
|
+
{ name: "guard_submission", type: "object", description: "Guard submission object (optional, required if forward has guard)", required: false },
|
|
62
|
+
{ name: "message", type: "string", description: "Optional message attached to this advance", required: false },
|
|
63
|
+
],
|
|
64
|
+
body: (p) => {
|
|
65
|
+
const result = {
|
|
66
|
+
object: p.order_address,
|
|
67
|
+
progress: {
|
|
68
|
+
next_node_name: p.next_node_name,
|
|
69
|
+
forward: {
|
|
70
|
+
name: p.forward_name,
|
|
71
|
+
operator: p.operator ?? null,
|
|
72
|
+
guard: p.guard_submission ?? null,
|
|
73
|
+
},
|
|
74
|
+
op: "next",
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
if (p.message)
|
|
78
|
+
result.progress.message = p.message;
|
|
79
|
+
return result;
|
|
80
|
+
},
|
|
81
|
+
notes: [
|
|
82
|
+
"L2 operation — both owner and agent can advance",
|
|
83
|
+
"Node transition is IRREVERSIBLE (no backward movement)",
|
|
84
|
+
"If forward has a Guard, guard_submission is required",
|
|
85
|
+
"Service.machine is snapshotted at buy time — Order.machine will NOT update if Service.machine changes later",
|
|
86
|
+
],
|
|
87
|
+
permission_layer: "L2_owner_or_agent",
|
|
88
|
+
irreversible: true,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "T-O-03",
|
|
92
|
+
name: "Set agent list (multi-agent logistics delegation)",
|
|
93
|
+
description: "Template for setting up multiple agents to operate the Order (advance Progress, update required_info). Agents CANNOT receive payments.",
|
|
94
|
+
applicable_scenes: ["order_set_agent"],
|
|
95
|
+
industry_tags: ["logistics", "team", "service"],
|
|
96
|
+
params: [
|
|
97
|
+
{ name: "order_address", type: "address", description: "Order object address", required: true },
|
|
98
|
+
{ name: "agent_addresses", type: "string[]", description: "Agent addresses (overwrites entire list)", required: true },
|
|
99
|
+
],
|
|
100
|
+
body: (p) => ({
|
|
101
|
+
object: p.order_address,
|
|
102
|
+
agent: p.agent_addresses,
|
|
103
|
+
}),
|
|
104
|
+
notes: [
|
|
105
|
+
"L1 operation — OWNER-ONLY (assert_owner)",
|
|
106
|
+
"⚠️ Boundary bug: actual max 11 agents (not 10) due to <= in agent_set_imp",
|
|
107
|
+
"FROZEN after Progress binding — call BEFORE service::buy if machine is configured",
|
|
108
|
+
"Agents can advance Progress, update required_info, file arbitration — but CANNOT receive payments",
|
|
109
|
+
"Overwrites entire agent list (not additive)",
|
|
110
|
+
],
|
|
111
|
+
permission_layer: "L1_owner_only",
|
|
112
|
+
irreversible: false,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "T-O-04",
|
|
116
|
+
name: "File arbitration (arb_confirm with proposition)",
|
|
117
|
+
description: "Template for filing an arbitration case with description + proposition list. Triggers order::dispute(arb) appending Arb to dispute vector.",
|
|
118
|
+
applicable_scenes: ["order_arb_confirm"],
|
|
119
|
+
industry_tags: ["dispute", "arbitration", "universal"],
|
|
120
|
+
params: [
|
|
121
|
+
{ name: "order_address", type: "address", description: "Order object address", required: true },
|
|
122
|
+
{ name: "arb_address", type: "address", description: "Arbitration object address (must exist)", required: true },
|
|
123
|
+
{ name: "confirm", type: "string", description: "Confirm materials valid? 'true' or 'false'", required: true, default: "true" },
|
|
124
|
+
{ name: "description", type: "string", description: "Compensation application description (required for arb::description_change)", required: true },
|
|
125
|
+
{ name: "propositions", type: "string[]", description: "Compensation claims list (e.g. ['Refund full amount', 'Compensation for delay'])", required: true },
|
|
126
|
+
],
|
|
127
|
+
body: (p) => ({
|
|
128
|
+
object: p.order_address,
|
|
129
|
+
arb_confirm: {
|
|
130
|
+
arb: p.arb_address,
|
|
131
|
+
confirm: p.confirm === "true",
|
|
132
|
+
description: p.description,
|
|
133
|
+
proposition: p.propositions,
|
|
134
|
+
},
|
|
135
|
+
}),
|
|
136
|
+
notes: [
|
|
137
|
+
"L2 operation — both owner and agent can file",
|
|
138
|
+
"IRREVERSIBLE — once filed, Arb process cannot be cancelled",
|
|
139
|
+
"Triggers order::dispute(arb) — appends Arb to order.dispute vector (max 10)",
|
|
140
|
+
"If claimed_by is already set, aborts E_ORDER_ALREADY_CLAIMED",
|
|
141
|
+
"Use T-O-08 (arb_objection) to object to Arb ruling after this step",
|
|
142
|
+
],
|
|
143
|
+
permission_layer: "L2_owner_or_agent",
|
|
144
|
+
irreversible: true,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: "T-O-05",
|
|
148
|
+
name: "Receive payment (owner-only collect)",
|
|
149
|
+
description: "Template for collecting CoinWrapper or arbitrary Receiving<K> from Progress. Funds forwarded to owner. Owner-only.",
|
|
150
|
+
applicable_scenes: ["order_receive"],
|
|
151
|
+
industry_tags: ["finance", "universal"],
|
|
152
|
+
params: [
|
|
153
|
+
{ name: "order_address", type: "address", description: "Order object address", required: true },
|
|
154
|
+
{ name: "received_object_id", type: "string", description: "Receiving object ID (CoinWrapper or Receiving<K>)", required: true },
|
|
155
|
+
],
|
|
156
|
+
body: (p) => ({
|
|
157
|
+
object: p.order_address,
|
|
158
|
+
receive: {
|
|
159
|
+
received: p.received_object_id,
|
|
160
|
+
},
|
|
161
|
+
}),
|
|
162
|
+
notes: [
|
|
163
|
+
"L1 operation — OWNER-ONLY (assert_owner). Agent CANNOT receive.",
|
|
164
|
+
"Aborts E_ORDER_DELIVERING if Progress not at terminal node",
|
|
165
|
+
"Can be called multiple times (e.g. partial refunds)",
|
|
166
|
+
"Funds are unwrapped (CoinWrapper → Coin) and transferred to owner address",
|
|
167
|
+
"For ownership transfer, use T-O-06 variant (transfer_to) instead",
|
|
168
|
+
],
|
|
169
|
+
permission_layer: "L1_owner_only",
|
|
170
|
+
irreversible: false,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: "T-O-06",
|
|
174
|
+
name: "Claim compensation (arb_claim_compensation — IRREVERSIBLE)",
|
|
175
|
+
description: "Template for claiming compensation from a ruled Arb. Sets claimed_by — ONE-TIME, IRREVERSIBLE, blocks all future disputes.",
|
|
176
|
+
applicable_scenes: ["order_arb_claim_compensation"],
|
|
177
|
+
industry_tags: ["dispute", "arbitration"],
|
|
178
|
+
params: [
|
|
179
|
+
{ name: "order_address", type: "address", description: "Order object address", required: true },
|
|
180
|
+
{ name: "arb_address", type: "address", description: "RULED Arb object address (must be in Arbitrated state)", required: true },
|
|
181
|
+
],
|
|
182
|
+
body: (p) => ({
|
|
183
|
+
object: p.order_address,
|
|
184
|
+
arb_claim_compensation: {
|
|
185
|
+
arb: p.arb_address,
|
|
186
|
+
},
|
|
187
|
+
}),
|
|
188
|
+
notes: [
|
|
189
|
+
"⚠️⚠️ IRREVERSIBLE — claimed_by cannot be reset",
|
|
190
|
+
"After claim: NO new disputes can be filed (E_ORDER_ALREADY_CLAIMED)",
|
|
191
|
+
"Arb must be in Arbitrated state (ruled, not pending)",
|
|
192
|
+
"L2 operation — both owner and agent can claim",
|
|
193
|
+
"Triggers service::compensation_claim → order::compensate(arb)",
|
|
194
|
+
"Verify arb_address TWICE before submitting — there is no undo",
|
|
195
|
+
],
|
|
196
|
+
permission_layer: "L2_owner_or_agent",
|
|
197
|
+
irreversible: true,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: "T-O-07",
|
|
201
|
+
name: "Update required_info (Contact recipient or WTS Proof)",
|
|
202
|
+
description: "Template for setting required_info — either a Contact object (recipient info) or WTS Proof object (delivery proof). Both owner and agent can update.",
|
|
203
|
+
applicable_scenes: ["order_required_info"],
|
|
204
|
+
industry_tags: ["logistics", "universal"],
|
|
205
|
+
params: [
|
|
206
|
+
{ name: "order_address", type: "address", description: "Order object address", required: true },
|
|
207
|
+
{ name: "info_type", type: "string", description: "'contact' (recipient) or 'wts_proof' (delivery proof) or 'clear' (set to null)", required: true },
|
|
208
|
+
{ name: "info_address", type: "address", description: "Contact or WTS Proof object address (not needed if info_type='clear')", required: false },
|
|
209
|
+
],
|
|
210
|
+
body: (p) => {
|
|
211
|
+
if (p.info_type === "clear") {
|
|
212
|
+
return {
|
|
213
|
+
object: p.order_address,
|
|
214
|
+
required_info: null,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
if (!p.info_address) {
|
|
218
|
+
throw new Error(`info_address required when info_type='${p.info_type}'`);
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
object: p.order_address,
|
|
222
|
+
required_info: p.info_address,
|
|
223
|
+
};
|
|
224
|
+
},
|
|
225
|
+
notes: [
|
|
226
|
+
"L2 operation — both owner and agent can update",
|
|
227
|
+
"REVERSIBLE — can be called multiple times",
|
|
228
|
+
"Contact object = recipient info (shipping address, contact details)",
|
|
229
|
+
"WTS Proof object = delivery proof (generated via Wowok Messenger)",
|
|
230
|
+
"null clears the field",
|
|
231
|
+
],
|
|
232
|
+
permission_layer: "L2_owner_or_agent",
|
|
233
|
+
irreversible: false,
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
id: "T-O-08",
|
|
237
|
+
name: "Object to Arb ruling (arb_objection — request re-arbitration)",
|
|
238
|
+
description: "Template for objecting to an Arb ruling and requesting re-arbitration. Requires Arb status = Arbitrated.",
|
|
239
|
+
applicable_scenes: ["order_arb_objection"],
|
|
240
|
+
industry_tags: ["dispute", "arbitration"],
|
|
241
|
+
params: [
|
|
242
|
+
{ name: "order_address", type: "address", description: "Order object address", required: true },
|
|
243
|
+
{ name: "arb_address", type: "address", description: "RULED Arb object address (must be in Arbitrated state)", required: true },
|
|
244
|
+
{ name: "objection_reason", type: "string", description: "Reason for objection (required by arb::objection)", required: true },
|
|
245
|
+
],
|
|
246
|
+
body: (p) => ({
|
|
247
|
+
object: p.order_address,
|
|
248
|
+
arb_objection: {
|
|
249
|
+
arb: p.arb_address,
|
|
250
|
+
objection: p.objection_reason,
|
|
251
|
+
},
|
|
252
|
+
}),
|
|
253
|
+
notes: [
|
|
254
|
+
"L2 operation — both owner and agent can object",
|
|
255
|
+
"IRREVERSIBLE — triggers re-arbitration flow",
|
|
256
|
+
"Arb must be in Arbitrated state (after initial ruling)",
|
|
257
|
+
"Cannot object if claimed_by is already set (E_ORDER_ALREADY_CLAIMED)",
|
|
258
|
+
],
|
|
259
|
+
permission_layer: "L2_owner_or_agent",
|
|
260
|
+
irreversible: true,
|
|
261
|
+
},
|
|
262
|
+
];
|
|
263
|
+
export const ORDER_TEMPLATES_VERSION = "1.0.0";
|
|
264
|
+
export const ORDER_TEMPLATES_COUNT = ORDER_TEMPLATES.length;
|
|
265
|
+
export function getAllOrderTemplates() {
|
|
266
|
+
return [...ORDER_TEMPLATES];
|
|
267
|
+
}
|
|
268
|
+
export function getTemplateById(id) {
|
|
269
|
+
return ORDER_TEMPLATES.find(t => t.id === id);
|
|
270
|
+
}
|
|
271
|
+
export function getTemplatesByScene(sceneId) {
|
|
272
|
+
return ORDER_TEMPLATES.filter(t => t.applicable_scenes.includes(sceneId));
|
|
273
|
+
}
|
|
274
|
+
export function getTemplatesByIndustry(industry) {
|
|
275
|
+
return ORDER_TEMPLATES.filter(t => t.industry_tags.includes(industry) || t.industry_tags.includes("universal"));
|
|
276
|
+
}
|
|
277
|
+
export function getTemplatesByPermissionLayer(layer) {
|
|
278
|
+
return ORDER_TEMPLATES.filter(t => t.permission_layer === layer);
|
|
279
|
+
}
|
|
280
|
+
export function getIrreversibleTemplates() {
|
|
281
|
+
return ORDER_TEMPLATES.filter(t => t.irreversible);
|
|
282
|
+
}
|
|
283
|
+
export function suggestTemplateForScene(sceneId) {
|
|
284
|
+
const matches = getTemplatesByScene(sceneId);
|
|
285
|
+
return matches.length > 0 ? matches[0] : undefined;
|
|
286
|
+
}
|
|
287
|
+
export function listOrderTemplates() {
|
|
288
|
+
return ORDER_TEMPLATES.map(t => ({
|
|
289
|
+
id: t.id,
|
|
290
|
+
name: t.name,
|
|
291
|
+
description: t.description,
|
|
292
|
+
scenes: t.applicable_scenes,
|
|
293
|
+
irreversible: t.irreversible,
|
|
294
|
+
}));
|
|
295
|
+
}
|
|
296
|
+
export function fillTemplate(templateId, params) {
|
|
297
|
+
const tpl = getTemplateById(templateId);
|
|
298
|
+
if (!tpl)
|
|
299
|
+
return { ok: false, error: `Template ${templateId} not found` };
|
|
300
|
+
for (const p of tpl.params) {
|
|
301
|
+
if (p.required && !(p.name in params)) {
|
|
302
|
+
return { ok: false, error: `Missing required param: ${p.name}`, template: tpl };
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
try {
|
|
306
|
+
const body = tpl.body(params);
|
|
307
|
+
return { ok: true, body, template: tpl };
|
|
308
|
+
}
|
|
309
|
+
catch (e) {
|
|
310
|
+
return { ok: false, error: `Template body generation failed: ${e.message}`, template: tpl };
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
export function suggestTemplateFromIntent(intent) {
|
|
314
|
+
const lower = intent.toLowerCase();
|
|
315
|
+
const keywordMap = [
|
|
316
|
+
["buy", "T-O-01"], ["purchase", "T-O-01"],
|
|
317
|
+
["advance", "T-O-02"], ["forward", "T-O-02"],
|
|
318
|
+
["set agent", "T-O-03"], ["agent", "T-O-03"],
|
|
319
|
+
["arb_confirm", "T-O-04"], ["file dispute", "T-O-04"], ["apply arbitration", "T-O-04"],
|
|
320
|
+
["receive", "T-O-05"], ["collect", "T-O-05"],
|
|
321
|
+
["claim compensation", "T-O-06"],
|
|
322
|
+
["required_info", "T-O-07"], ["contact", "T-O-07"], ["recipient", "T-O-07"],
|
|
323
|
+
["arb_objection", "T-O-08"], ["objection", "T-O-08"],
|
|
324
|
+
];
|
|
325
|
+
for (const [kw, tplId] of keywordMap) {
|
|
326
|
+
if (lower.includes(kw.toLowerCase())) {
|
|
327
|
+
return getTemplateById(tplId);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return undefined;
|
|
331
|
+
}
|
|
332
|
+
export function getTemplateParameters(templateId) {
|
|
333
|
+
return getTemplateById(templateId)?.params;
|
|
334
|
+
}
|
|
335
|
+
export function validateTemplateParams(templateId, params) {
|
|
336
|
+
const tpl = getTemplateById(templateId);
|
|
337
|
+
if (!tpl)
|
|
338
|
+
return [`Template ${templateId} not found`];
|
|
339
|
+
const issues = [];
|
|
340
|
+
for (const p of tpl.params) {
|
|
341
|
+
if (p.required && !(p.name in params)) {
|
|
342
|
+
issues.push(`Missing required param: ${p.name}`);
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
if (!(p.name in params))
|
|
346
|
+
continue;
|
|
347
|
+
const val = params[p.name];
|
|
348
|
+
if (p.type === "address") {
|
|
349
|
+
if (typeof val !== "string" || !val.startsWith("0x") || val.length < 40) {
|
|
350
|
+
issues.push(`Param ${p.name} must be a valid Wow address (got: ${val})`);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
else if (p.type === "string") {
|
|
354
|
+
if (typeof val !== "string")
|
|
355
|
+
issues.push(`Param ${p.name} must be a string`);
|
|
356
|
+
}
|
|
357
|
+
else if (p.type === "number") {
|
|
358
|
+
if (typeof val !== "number" || !Number.isFinite(val))
|
|
359
|
+
issues.push(`Param ${p.name} must be a number`);
|
|
360
|
+
}
|
|
361
|
+
else if (p.type === "string[]") {
|
|
362
|
+
if (!Array.isArray(val) || !val.every(v => typeof v === "string")) {
|
|
363
|
+
issues.push(`Param ${p.name} must be a string[]`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return issues;
|
|
368
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type OrderScene, type OrderPermissionLayer } from "./order-ledger.js";
|
|
2
|
+
export interface SemanticToSchemaRule {
|
|
3
|
+
id: string;
|
|
4
|
+
pattern_name: string;
|
|
5
|
+
semantic_intent: string;
|
|
6
|
+
match_keywords: string[];
|
|
7
|
+
schema_fields: string[];
|
|
8
|
+
example_json: object;
|
|
9
|
+
reverse_explanation: string;
|
|
10
|
+
operation_field?: OrderScene["operation_field"];
|
|
11
|
+
permission_layer?: OrderPermissionLayer;
|
|
12
|
+
}
|
|
13
|
+
export interface SchemaToSemanticRule {
|
|
14
|
+
element_type: "field" | "op" | "index" | "error";
|
|
15
|
+
type_name: string;
|
|
16
|
+
semantic_explanation: string;
|
|
17
|
+
constraints?: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface OrderConstraintRule {
|
|
20
|
+
id: string;
|
|
21
|
+
category: "structural" | "semantic" | "authority" | "lifecycle" | "cross_object";
|
|
22
|
+
rule: string;
|
|
23
|
+
applies_to: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare const SEMANTIC_TO_SCHEMA_RULES: SemanticToSchemaRule[];
|
|
26
|
+
export declare const SCHEMA_TO_SEMANTIC_RULES: SchemaToSemanticRule[];
|
|
27
|
+
export declare const ORDER_CONSTRAINT_RULES: OrderConstraintRule[];
|
|
28
|
+
export declare const ORDER_TRANSLATION_VERSION = "1.0.0";
|
|
29
|
+
export declare function matchSemanticPattern(userIntent: string): SemanticToSchemaRule[];
|
|
30
|
+
export interface OrderCallData {
|
|
31
|
+
object?: string;
|
|
32
|
+
agent?: string[];
|
|
33
|
+
required_info?: string | null;
|
|
34
|
+
progress?: {
|
|
35
|
+
next_node_name?: string;
|
|
36
|
+
forward?: {
|
|
37
|
+
name: string;
|
|
38
|
+
operator?: string | null;
|
|
39
|
+
guard?: object | null;
|
|
40
|
+
};
|
|
41
|
+
op?: "next" | "hold" | "unhold" | "adminUnhold";
|
|
42
|
+
message?: string;
|
|
43
|
+
};
|
|
44
|
+
arb_confirm?: {
|
|
45
|
+
arb: string;
|
|
46
|
+
confirm: boolean;
|
|
47
|
+
description?: string;
|
|
48
|
+
proposition?: string[];
|
|
49
|
+
};
|
|
50
|
+
arb_objection?: {
|
|
51
|
+
arb: string;
|
|
52
|
+
objection: string;
|
|
53
|
+
};
|
|
54
|
+
arb_claim_compensation?: {
|
|
55
|
+
arb: string;
|
|
56
|
+
};
|
|
57
|
+
receive?: {
|
|
58
|
+
received: string;
|
|
59
|
+
};
|
|
60
|
+
transfer_to?: string;
|
|
61
|
+
}
|
|
62
|
+
export declare function explainOrderCallData(data: OrderCallData): string;
|
|
63
|
+
export declare function explainField(fieldName: string): SchemaToSemanticRule | undefined;
|
|
64
|
+
export declare function explainOp(opName: string): SchemaToSemanticRule | undefined;
|
|
65
|
+
export declare function explainOrderError(errorNameOrCode: string | number): SchemaToSemanticRule | undefined;
|
|
66
|
+
export declare function getConstraintsByCategory(category: OrderConstraintRule["category"]): OrderConstraintRule[];
|
|
67
|
+
export declare function explainPermissionLayer(layer: OrderPermissionLayer): string;
|
|
68
|
+
export declare function resolveFieldName(sdkOrMoveName: string): {
|
|
69
|
+
sdk_name: string;
|
|
70
|
+
move_name: string;
|
|
71
|
+
is_deviation: boolean;
|
|
72
|
+
};
|
|
73
|
+
export declare function matchSceneFromOperation(operationField: OrderScene["operation_field"]): OrderScene | undefined;
|
|
74
|
+
export declare function explainOrderIntent(intent: string): {
|
|
75
|
+
matched_scene?: OrderScene;
|
|
76
|
+
matched_patterns: SemanticToSchemaRule[];
|
|
77
|
+
relevant_constraints: OrderConstraintRule[];
|
|
78
|
+
};
|