@wowok/agent-mcp 2.3.16 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/customer/index.d.ts +9 -0
- package/dist/customer/index.js +9 -0
- package/dist/customer/industry-risks.d.ts +4 -0
- package/dist/customer/industry-risks.js +45 -31
- package/dist/customer/order-monitor.js +57 -57
- package/dist/customer/order-strategy.js +89 -89
- package/dist/customer/post-purchase.js +97 -97
- package/dist/customer/reminder-system.js +26 -26
- package/dist/customer/risk-assessment.js +46 -46
- package/dist/customer/types.d.ts +4 -4
- package/dist/customer/types.js +4 -4
- package/dist/customer/user-preferences.d.ts +3 -0
- package/dist/customer/user-preferences.js +59 -50
- package/dist/experience/intent-distill.js +6 -6
- package/dist/experience/realtime-feedback.js +17 -0
- package/dist/index.js +360 -273
- package/dist/knowledge/acquisition-flywheel.d.ts +3 -0
- package/dist/knowledge/acquisition-flywheel.js +73 -64
- package/dist/knowledge/arbitration-trust.js +10 -10
- package/dist/knowledge/demand-matching.js +8 -8
- package/dist/knowledge/dynamic-pricing.js +18 -18
- package/dist/knowledge/flywheel-loop.js +11 -11
- package/dist/knowledge/glossary.js +22 -22
- package/dist/knowledge/guard-ledger.d.ts +19 -0
- package/dist/knowledge/guard-ledger.js +246 -0
- package/dist/knowledge/guard-lint.d.ts +76 -0
- package/dist/knowledge/guard-lint.js +590 -0
- package/dist/knowledge/guard-puzzle.d.ts +188 -0
- package/dist/knowledge/guard-puzzle.js +804 -0
- package/dist/knowledge/guard-risk.d.ts +67 -0
- package/dist/knowledge/guard-risk.js +1046 -0
- package/dist/knowledge/guard-templates.d.ts +37 -0
- package/dist/knowledge/guard-templates.js +329 -0
- package/dist/knowledge/guard-translation.d.ts +58 -0
- package/dist/knowledge/guard-translation.js +1118 -0
- package/dist/knowledge/index.d.ts +17 -0
- package/dist/knowledge/index.js +17 -0
- package/dist/knowledge/industry-evolution.js +29 -29
- package/dist/knowledge/industry-generalizer.js +52 -52
- package/dist/knowledge/industry-registry.d.ts +1 -2
- package/dist/knowledge/industry-registry.js +43 -36
- package/dist/knowledge/intent-metrics.js +67 -67
- package/dist/knowledge/process-model.js +80 -80
- package/dist/knowledge/reputation-rules.js +9 -9
- package/dist/knowledge/reward-templates.js +51 -51
- package/dist/knowledge/safety-rules.js +63 -2
- package/dist/knowledge/tool-constraints.js +17 -11
- package/dist/knowledge/trust-metrics.js +26 -26
- package/dist/safety/confirm-gate.d.ts +4 -2
- package/dist/safety/confirm-gate.js +48 -4
- package/dist/schema/call/allocation.d.ts +24 -14
- package/dist/schema/call/arbitration.d.ts +142 -132
- package/dist/schema/call/base.d.ts +901 -43
- package/dist/schema/call/base.js +77 -13
- package/dist/schema/call/bridge-handler.js +15 -2
- package/dist/schema/call/bridge.d.ts +795 -27
- package/dist/schema/call/bridge.js +37 -0
- package/dist/schema/call/contact.d.ts +10 -0
- package/dist/schema/call/demand.d.ts +94 -84
- package/dist/schema/call/guard.d.ts +229 -46
- package/dist/schema/call/guard.js +50 -0
- package/dist/schema/call/handler.js +46 -14
- package/dist/schema/call/machine.d.ts +158 -138
- package/dist/schema/call/order.d.ts +10 -0
- package/dist/schema/call/payment.d.ts +10 -0
- package/dist/schema/call/permission.d.ts +314 -304
- package/dist/schema/call/personal.d.ts +10 -0
- package/dist/schema/call/progress.d.ts +10 -0
- package/dist/schema/call/proof.d.ts +20 -0
- package/dist/schema/call/repository.d.ts +32 -22
- package/dist/schema/call/reward.d.ts +10 -0
- package/dist/schema/call/semantic.d.ts +9 -2
- package/dist/schema/call/semantic.js +617 -25
- package/dist/schema/call/service.d.ts +20 -10
- package/dist/schema/call/treasury.d.ts +10 -0
- package/dist/schema/config/index.d.ts +18 -0
- package/dist/schema/config/index.js +17 -0
- package/dist/schema/index.d.ts +6 -0
- package/dist/schema/index.js +5 -0
- package/dist/schema/local/index.d.ts +9 -9
- package/dist/schema/local/index.js +9 -0
- package/dist/schema/local/wip.d.ts +39 -19
- package/dist/schema/local/wip.js +5 -5
- package/dist/schema/messenger/index.d.ts +376 -55
- package/dist/schema/messenger/index.js +19 -19
- package/dist/schema/operations.d.ts +1881 -681
- package/dist/schema/operations.js +91 -96
- package/dist/schema/project/index.d.ts +21 -0
- package/dist/schema/project/index.js +32 -0
- package/dist/schema/query/index.d.ts +1074 -168
- package/dist/schema/query/index.js +8 -8
- package/dist/schema/schema-query/index.d.ts +33 -0
- package/dist/schema/schema-query/index.js +36 -0
- package/dist/schema/schema-version.d.ts +25 -0
- package/dist/schema/schema-version.js +76 -0
- package/dist/schema/trust/index.d.ts +407 -0
- package/dist/schema/trust/index.js +113 -0
- package/dist/schema/utils/guard-parser.js +4 -4
- package/dist/schema/utils/node-parser.js +14 -14
- package/dist/schemas/bridge_operation.output.json +233 -9
- package/dist/schemas/bridge_operation.schema.json +67 -8
- package/dist/schemas/config_operation.output.json +18 -0
- package/dist/schemas/config_operation.schema.json +34 -0
- package/dist/schemas/guard-node-schema.json +82 -0
- package/dist/schemas/guard2file.schema.json +8 -0
- package/dist/schemas/index.json +19 -1
- package/dist/schemas/machineNode2file.schema.json +8 -0
- package/dist/schemas/messenger_operation.output.json +236 -10
- package/dist/schemas/onchain_events.output.json +718 -0
- package/dist/schemas/onchain_operations.output.json +286 -11
- package/dist/schemas/onchain_operations.schema.json +19 -16
- package/dist/schemas/onchain_operations_allocation.schema.json +8 -0
- package/dist/schemas/onchain_operations_arbitration.schema.json +8 -0
- package/dist/schemas/onchain_operations_contact.schema.json +8 -0
- package/dist/schemas/onchain_operations_demand.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -0
- package/dist/schemas/onchain_operations_guard.schema.json +11 -16
- package/dist/schemas/onchain_operations_machine.schema.json +8 -0
- package/dist/schemas/onchain_operations_order.schema.json +8 -0
- package/dist/schemas/onchain_operations_payment.schema.json +8 -0
- package/dist/schemas/onchain_operations_permission.schema.json +8 -0
- package/dist/schemas/onchain_operations_personal.schema.json +8 -0
- package/dist/schemas/onchain_operations_progress.schema.json +8 -0
- package/dist/schemas/onchain_operations_repository.schema.json +8 -0
- package/dist/schemas/onchain_operations_reward.schema.json +8 -0
- package/dist/schemas/onchain_operations_service.schema.json +8 -0
- package/dist/schemas/onchain_operations_treasury.schema.json +8 -0
- package/dist/schemas/onchain_table_data.output.json +718 -0
- package/dist/schemas/project_operation.output.json +18 -0
- package/dist/schemas/project_operation.schema.json +42 -0
- package/dist/schemas/query_toolkit.schema.json +360 -368
- package/dist/schemas/schema_query.schema.json +6 -3
- package/dist/schemas/trust_score.output.json +327 -0
- package/dist/schemas/trust_score.schema.json +46 -0
- package/dist/schemas/wip_file.output.json +24 -1
- package/package.json +2 -2
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { NameOrAddressSchema } from "../common/index.js";
|
|
3
|
+
export const TrustScoreInputSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
service: NameOrAddressSchema.describe("Service object ID or local_mark name to evaluate. " +
|
|
6
|
+
"Must reference an existing Service object on-chain."),
|
|
7
|
+
order_amount: z
|
|
8
|
+
.union([z.string(), z.number()])
|
|
9
|
+
.optional()
|
|
10
|
+
.describe("Optional order amount (in smallest token unit, e.g. 2000000000 for 2 WOW). " +
|
|
11
|
+
"Used for fund-safety dimension risk assessment. " +
|
|
12
|
+
"If omitted, the first active sale price of the service is used."),
|
|
13
|
+
depth: z
|
|
14
|
+
.enum(["browse", "evaluate", "preorder"])
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("InfoPuzzle collection depth. " +
|
|
17
|
+
"browse: only Service basics + trust score; " +
|
|
18
|
+
"evaluate (default): + workflow/fund/trust dimensions risk assessment; " +
|
|
19
|
+
"preorder: + merchant behavior + market context (most thorough)."),
|
|
20
|
+
network: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Network override (e.g. 'mainnet', 'testnet'). If omitted, uses default."),
|
|
24
|
+
no_cache: z
|
|
25
|
+
.boolean()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Skip object cache and force a fresh on-chain query."),
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
export const TrustScoreOutputSchema = z
|
|
31
|
+
.object({
|
|
32
|
+
result: z
|
|
33
|
+
.object({
|
|
34
|
+
service_id: z.string().describe("The Service object ID or local_mark that was evaluated."),
|
|
35
|
+
service_name: z.string().describe("Service display name (falls back to service_id if unnamed)."),
|
|
36
|
+
service_basics: z
|
|
37
|
+
.object({
|
|
38
|
+
bPublished: z.boolean().describe("Whether the Service is published (open for orders)."),
|
|
39
|
+
bPaused: z.boolean().describe("Whether the Service is temporarily paused."),
|
|
40
|
+
sales_count: z.number().int().nonnegative().describe("Number of active (non-suspended) sale entries."),
|
|
41
|
+
has_machine: z.boolean().describe("Whether a Machine workflow is attached."),
|
|
42
|
+
has_buy_guard: z.boolean().describe("Whether a buy-side Guard is configured."),
|
|
43
|
+
has_um_contact: z.boolean().describe("Whether a Messenger (um) contact is configured."),
|
|
44
|
+
arbitrations_count: z.number().int().nonnegative().describe("Number of arbitration entries attached to the Service."),
|
|
45
|
+
})
|
|
46
|
+
.describe("Service snapshot — basic on-chain state."),
|
|
47
|
+
trust_score: z
|
|
48
|
+
.object({
|
|
49
|
+
score: z.number().min(0).max(100).describe("Overall trust score (0-100, higher = more trustworthy)."),
|
|
50
|
+
level: z
|
|
51
|
+
.enum(["high_risk", "caution", "moderate", "trusted"])
|
|
52
|
+
.describe("Trust level label derived from the score."),
|
|
53
|
+
summary: z.string().describe("One-line human-readable trust summary."),
|
|
54
|
+
warnings: z.array(z.string()).describe("Trust warnings (e.g. low arbitration dimension score)."),
|
|
55
|
+
breakdown: z
|
|
56
|
+
.array(z.object({
|
|
57
|
+
score: z.number().describe("Dimension score achieved."),
|
|
58
|
+
maxScore: z.number().describe("Dimension max possible score."),
|
|
59
|
+
description: z.string().describe("Dimension name / description."),
|
|
60
|
+
humanReadable: z.string().describe("Human-readable dimension explanation."),
|
|
61
|
+
}))
|
|
62
|
+
.describe("5-dimension breakdown: arbitration / reviews / fulfillment / fund_safety / transparency."),
|
|
63
|
+
})
|
|
64
|
+
.describe("ServiceTrustScore — 0-100 score across 5 trust dimensions."),
|
|
65
|
+
order_amount: z
|
|
66
|
+
.string()
|
|
67
|
+
.describe("Order amount used for fund-safety assessment, in smallest token unit (bigint as string)."),
|
|
68
|
+
depth: z
|
|
69
|
+
.enum(["browse", "evaluate", "preorder"])
|
|
70
|
+
.describe("Actual InfoPuzzle collection depth used (defaults to 'evaluate')."),
|
|
71
|
+
risk_score: z
|
|
72
|
+
.object({
|
|
73
|
+
total: z.number().min(0).max(100).describe("Overall risk score (0-100, higher = riskier)."),
|
|
74
|
+
level: z
|
|
75
|
+
.enum(["low", "medium_low", "medium_high", "high"])
|
|
76
|
+
.describe("Risk level label derived from the total score."),
|
|
77
|
+
red_flags: z.array(z.string()).describe("Critical risk red flags detected."),
|
|
78
|
+
advice: z.array(z.string()).describe("Risk mitigation advice."),
|
|
79
|
+
dimensions: z
|
|
80
|
+
.array(z.object({
|
|
81
|
+
name: z
|
|
82
|
+
.enum(["workflow", "fund", "trust", "behavior"])
|
|
83
|
+
.describe("Risk dimension name."),
|
|
84
|
+
score: z.number().describe("Dimension score achieved."),
|
|
85
|
+
max_score: z.number().describe("Dimension max possible score."),
|
|
86
|
+
checks: z.array(z.object({
|
|
87
|
+
id: z.string().describe("Check identifier."),
|
|
88
|
+
dimension: z
|
|
89
|
+
.enum(["workflow", "fund", "trust", "behavior"])
|
|
90
|
+
.describe("Dimension this check belongs to."),
|
|
91
|
+
description: z.string().describe("Check description."),
|
|
92
|
+
weight: z.number().describe("Check weight within its dimension (percentage)."),
|
|
93
|
+
passed: z.boolean().describe("Whether the check passed."),
|
|
94
|
+
advice: z.string().optional().describe("Advice when the check failed."),
|
|
95
|
+
})).describe("Individual risk checks within this dimension."),
|
|
96
|
+
}))
|
|
97
|
+
.describe("4-dimension breakdown: workflow / fund / trust / behavior."),
|
|
98
|
+
})
|
|
99
|
+
.optional()
|
|
100
|
+
.describe("RiskScore — present only when depth >= 'evaluate'."),
|
|
101
|
+
info_puzzle: z
|
|
102
|
+
.object({
|
|
103
|
+
completeness: z.number().min(0).max(1).describe("InfoPuzzle completeness ratio (0-1)."),
|
|
104
|
+
gaps: z.array(z.string()).describe("Missing key puzzle pieces."),
|
|
105
|
+
assembled_at: z.number().describe("Assembly timestamp (ms since epoch)."),
|
|
106
|
+
})
|
|
107
|
+
.optional()
|
|
108
|
+
.describe("InfoPuzzle summary — present only when depth >= 'evaluate'."),
|
|
109
|
+
})
|
|
110
|
+
.describe("Trust score result. Contains: trust_score (ServiceTrustScore), " +
|
|
111
|
+
"risk_score (RiskScore, when depth >= evaluate), info_puzzle summary, " +
|
|
112
|
+
"and service_basics snapshot."),
|
|
113
|
+
});
|
|
@@ -29,11 +29,11 @@ function parseMarkdownToGuardData(markdown) {
|
|
|
29
29
|
return { data: jsonMatch.json, errors: [] };
|
|
30
30
|
}
|
|
31
31
|
const result = {};
|
|
32
|
-
const descriptionMatch = markdown.match(/(?:^|\n)#+\s*
|
|
32
|
+
const descriptionMatch = markdown.match(/(?:^|\n)#+\s*Description[^\n]*\n+([^\n#]+)/i);
|
|
33
33
|
if (descriptionMatch) {
|
|
34
34
|
result.description = descriptionMatch[1].trim();
|
|
35
35
|
}
|
|
36
|
-
const tableMatch = markdown.match(/(?:^|\n)#+\s*
|
|
36
|
+
const tableMatch = markdown.match(/(?:^|\n)#+\s*Table[^\n]*\n+[\s\S]*?(?=(?:\n#+|$))/i);
|
|
37
37
|
if (tableMatch) {
|
|
38
38
|
const tableSection = tableMatch[0];
|
|
39
39
|
const tableRows = tableSection.match(/\|[^\n]+\|/g);
|
|
@@ -72,7 +72,7 @@ function parseMarkdownToGuardData(markdown) {
|
|
|
72
72
|
else {
|
|
73
73
|
result.table = [];
|
|
74
74
|
}
|
|
75
|
-
const rootMatch = markdown.match(/(?:^|\n)#+\s*
|
|
75
|
+
const rootMatch = markdown.match(/(?:^|\n)#+\s*Root[^\n]*\n+([\s\S]*?)(?=(?:\n#+|$))/i);
|
|
76
76
|
if (rootMatch) {
|
|
77
77
|
const rootSection = rootMatch[1];
|
|
78
78
|
const rootJsonMatch = rootSection.match(/```(?:json)?\s*\n([\s\S]*?)```/);
|
|
@@ -88,7 +88,7 @@ function parseMarkdownToGuardData(markdown) {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
const relyMatch = markdown.match(/(?:^|\n)#+\s*
|
|
91
|
+
const relyMatch = markdown.match(/(?:^|\n)#+\s*Rely[^\n]*\n+([\s\S]*?)(?=(?:\n#+|$))/i);
|
|
92
92
|
if (relyMatch) {
|
|
93
93
|
const relySection = relyMatch[1];
|
|
94
94
|
const logicMatch = relySection.match(/\*\*Logic:\*\*\s*(AND|OR)/i);
|
|
@@ -40,26 +40,26 @@ function parseMarkdownToNodeData(markdown) {
|
|
|
40
40
|
}
|
|
41
41
|
const result = { op: 'add' };
|
|
42
42
|
const nodes = [];
|
|
43
|
-
const opMatch = markdown.match(/(?:^|\n)#+\s*
|
|
43
|
+
const opMatch = markdown.match(/(?:^|\n)#+\s*Operation[^\n]*\n+[-*]\s*op\s*:\s*(\w+)/i);
|
|
44
44
|
if (opMatch) {
|
|
45
45
|
result.op = opMatch[1].toLowerCase();
|
|
46
46
|
}
|
|
47
|
-
const replaceMatch = markdown.match(/(?:^|\n)#+\s*
|
|
47
|
+
const replaceMatch = markdown.match(/(?:^|\n)#+\s*Options[^\n]*\n+[-*]\s*bReplace\s*:\s*(true|false)/i);
|
|
48
48
|
if (replaceMatch) {
|
|
49
49
|
result.bReplace = replaceMatch[1].toLowerCase() === 'true';
|
|
50
50
|
}
|
|
51
|
-
const nodeSections = markdown.split(/(?=^##\s*
|
|
51
|
+
const nodeSections = markdown.split(/(?=^##\s*Node[:\s])/m);
|
|
52
52
|
for (const section of nodeSections.slice(1)) {
|
|
53
|
-
const nodeNameMatch = section.match(/^##\s*
|
|
53
|
+
const nodeNameMatch = section.match(/^##\s*Node[:\s]+(.+?)(?:\n|$)/im);
|
|
54
54
|
if (!nodeNameMatch)
|
|
55
55
|
continue;
|
|
56
56
|
const nodeName = nodeNameMatch[1].trim();
|
|
57
57
|
const node = { name: nodeName, pairs: [] };
|
|
58
|
-
const pairSections = section.split(/(?=^###\s*(?:Pair
|
|
58
|
+
const pairSections = section.split(/(?=^###\s*(?:Pair|Previous Node)[:\s])/m);
|
|
59
59
|
for (const pairSection of pairSections.slice(1)) {
|
|
60
|
-
const prevNodeMatch = pairSection.match(/(?:^|\n)[-*]\s*prev_node\s*[
|
|
61
|
-
pairSection.match(/^###\s*(?:Pair
|
|
62
|
-
const thresholdMatch = pairSection.match(/(?:^|\n)[-*]\s*threshold\s*[
|
|
60
|
+
const prevNodeMatch = pairSection.match(/(?:^|\n)[-*]\s*prev_node\s*[:]\s*(.+?)(?:\n|$)/im) ||
|
|
61
|
+
pairSection.match(/^###\s*(?:Pair|Previous Node)[:\s]+(.+?)(?:\n|$)/im);
|
|
62
|
+
const thresholdMatch = pairSection.match(/(?:^|\n)[-*]\s*threshold\s*[:]\s*(\d+)/i);
|
|
63
63
|
if (!prevNodeMatch)
|
|
64
64
|
continue;
|
|
65
65
|
const pair = {
|
|
@@ -89,19 +89,19 @@ function parseMarkdownToNodeData(markdown) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
const forwardMatches = pairSection.matchAll(/(?:^|\n)[-*]\s*(?:forward)?\s*[
|
|
92
|
+
const forwardMatches = pairSection.matchAll(/(?:^|\n)[-*]\s*(?:forward)?\s*[:]?\s*\n?([\s\S]*?)(?=(?:\n[-*]\s*(?:forward|prev_node|threshold))|\n###|\n##|$)/gi);
|
|
93
93
|
for (const forwardMatch of forwardMatches) {
|
|
94
94
|
const forwardSection = forwardMatch[1];
|
|
95
|
-
const nameMatch = forwardSection.match(/\s*name\s*[
|
|
96
|
-
const weightMatch = forwardSection.match(/\s*weight\s*[
|
|
95
|
+
const nameMatch = forwardSection.match(/\s*name\s*[:]\s*(.+?)(?:\n|$)/im);
|
|
96
|
+
const weightMatch = forwardSection.match(/\s*weight\s*[:]\s*(\d+)/i);
|
|
97
97
|
if (nameMatch && weightMatch) {
|
|
98
98
|
const forward = {
|
|
99
99
|
name: nameMatch[1].trim(),
|
|
100
100
|
weight: parseInt(weightMatch[1], 10)
|
|
101
101
|
};
|
|
102
|
-
const namedOperatorMatch = forwardSection.match(/\s*namedOperator\s*[
|
|
103
|
-
const permissionIndexMatch = forwardSection.match(/\s*permissionIndex\s*[
|
|
104
|
-
const guardMatch = forwardSection.match(/\s*guard\s*[
|
|
102
|
+
const namedOperatorMatch = forwardSection.match(/\s*namedOperator\s*[:]\s*(.+?)(?:\n|$)/im);
|
|
103
|
+
const permissionIndexMatch = forwardSection.match(/\s*permissionIndex\s*[:]\s*(\d+)/i);
|
|
104
|
+
const guardMatch = forwardSection.match(/\s*guard\s*[:]\s*(.+?)(?:\n|$)/im);
|
|
105
105
|
if (namedOperatorMatch) {
|
|
106
106
|
forward.namedOperator = namedOperatorMatch[1].trim();
|
|
107
107
|
}
|
|
@@ -357,7 +357,7 @@
|
|
|
357
357
|
}
|
|
358
358
|
},
|
|
359
359
|
"additionalProperties": false,
|
|
360
|
-
"description": "Experience layer feedback from past operations (Phase 2
|
|
360
|
+
"description": "Experience layer feedback from past operations (Phase 2 Topic 2)"
|
|
361
361
|
},
|
|
362
362
|
"service_status": {
|
|
363
363
|
"type": "object",
|
|
@@ -407,7 +407,7 @@
|
|
|
407
407
|
"items": {
|
|
408
408
|
"type": "string"
|
|
409
409
|
},
|
|
410
|
-
"description": "Actionable recommendations for the buyer. Example: ['
|
|
410
|
+
"description": "Actionable recommendations for the buyer. Example: ['Require merchant to configure arbitration','Negotiate refund terms via Messenger']"
|
|
411
411
|
},
|
|
412
412
|
"reminders": {
|
|
413
413
|
"type": "array",
|
|
@@ -442,7 +442,7 @@
|
|
|
442
442
|
},
|
|
443
443
|
"message": {
|
|
444
444
|
"type": "string",
|
|
445
|
-
"description": "Human-readable reminder message. Example: '
|
|
445
|
+
"description": "Human-readable reminder message. Example: 'Composite risk score 25/100, strongly discourage purchase'"
|
|
446
446
|
},
|
|
447
447
|
"action": {
|
|
448
448
|
"type": "string",
|
|
@@ -458,7 +458,7 @@
|
|
|
458
458
|
"additionalProperties": false,
|
|
459
459
|
"description": "A buyer-side reminder triggered at a specific order lifecycle stage (Phase 3 C-3)."
|
|
460
460
|
},
|
|
461
|
-
"description": "Stage-specific reminders (deduped, sorted by priority, capped to 3 high-risk). Example: [{priority:'required', message:'
|
|
461
|
+
"description": "Stage-specific reminders (deduped, sorted by priority, capped to 3 high-risk). Example: [{priority:'required', message:'Ambiguous Guard must be human-reviewed'}]"
|
|
462
462
|
},
|
|
463
463
|
"preference_match": {
|
|
464
464
|
"type": "object",
|
|
@@ -474,14 +474,14 @@
|
|
|
474
474
|
"items": {
|
|
475
475
|
"type": "string"
|
|
476
476
|
},
|
|
477
|
-
"description": "Aspects that match user preferences. Example: ['
|
|
477
|
+
"description": "Aspects that match user preferences. Example: ['Price 10% below average','Has arbitration']"
|
|
478
478
|
},
|
|
479
479
|
"mismatches": {
|
|
480
480
|
"type": "array",
|
|
481
481
|
"items": {
|
|
482
482
|
"type": "string"
|
|
483
483
|
},
|
|
484
|
-
"description": "Aspects that mismatch user preferences. Example: ['
|
|
484
|
+
"description": "Aspects that mismatch user preferences. Example: ['Delivery cycle exceeds expectation']"
|
|
485
485
|
}
|
|
486
486
|
},
|
|
487
487
|
"required": [
|
|
@@ -505,11 +505,11 @@
|
|
|
505
505
|
"properties": {
|
|
506
506
|
"industry_signal": {
|
|
507
507
|
"type": "string",
|
|
508
|
-
"description": "Industry evolution signal summary. Example: '
|
|
508
|
+
"description": "Industry evolution signal summary. Example: 'Industry health 82/100 (healthy); 25 cumulative industry signals'"
|
|
509
509
|
},
|
|
510
510
|
"evolution_advice": {
|
|
511
511
|
"type": "string",
|
|
512
|
-
"description": "Evolution advice for the current operation. Example: '
|
|
512
|
+
"description": "Evolution advice for the current operation. Example: 'Recommend mandatory arbitration + compensation fund + delivery Guard'"
|
|
513
513
|
},
|
|
514
514
|
"confidence": {
|
|
515
515
|
"type": "number",
|
|
@@ -546,7 +546,7 @@
|
|
|
546
546
|
"items": {
|
|
547
547
|
"type": "string"
|
|
548
548
|
},
|
|
549
|
-
"description": "Phase 4 P4-6.C: Role-targeted advice strings (user/merchant/arbitrator). Example: ['
|
|
549
|
+
"description": "Phase 4 P4-6.C: Role-targeted advice strings (user/merchant/arbitrator). Example: ['Strengthen loyalty flywheel','Optimize first-order conversion']"
|
|
550
550
|
},
|
|
551
551
|
"role": {
|
|
552
552
|
"type": "string",
|
|
@@ -563,6 +563,230 @@
|
|
|
563
563
|
],
|
|
564
564
|
"additionalProperties": false,
|
|
565
565
|
"description": "Phase 4 industry evolution context (populated when industry_evolution service is enabled). Provides AI with industry health signals and evolution advice."
|
|
566
|
+
},
|
|
567
|
+
"guard_advice": {
|
|
568
|
+
"type": "object",
|
|
569
|
+
"properties": {
|
|
570
|
+
"current_round": {
|
|
571
|
+
"type": "string",
|
|
572
|
+
"enum": [
|
|
573
|
+
"R1",
|
|
574
|
+
"R2",
|
|
575
|
+
"R3",
|
|
576
|
+
"R4",
|
|
577
|
+
"R5",
|
|
578
|
+
"R6",
|
|
579
|
+
"R7",
|
|
580
|
+
"R8",
|
|
581
|
+
"R9",
|
|
582
|
+
"R10"
|
|
583
|
+
],
|
|
584
|
+
"description": "Current R1-R10 dialogue round. R1=intent, R2=table, R3=tree, R4=rely, R5=binding, R6=review, R7=CREATE, R8=test, R9=bind, R10=verify. Example: 'R3'"
|
|
585
|
+
},
|
|
586
|
+
"puzzle_status": {
|
|
587
|
+
"type": "object",
|
|
588
|
+
"properties": {
|
|
589
|
+
"intent": {
|
|
590
|
+
"type": "boolean",
|
|
591
|
+
"description": "Intent dimension complete (action + rule + failure conditions)"
|
|
592
|
+
},
|
|
593
|
+
"binding": {
|
|
594
|
+
"type": "boolean",
|
|
595
|
+
"description": "Binding dimension complete (host object + field + circular ref)"
|
|
596
|
+
},
|
|
597
|
+
"data": {
|
|
598
|
+
"type": "boolean",
|
|
599
|
+
"description": "Data dimension complete (table entries + witnesses)"
|
|
600
|
+
},
|
|
601
|
+
"query": {
|
|
602
|
+
"type": "boolean",
|
|
603
|
+
"description": "Query dimension complete (query instructions if needed)"
|
|
604
|
+
},
|
|
605
|
+
"logic": {
|
|
606
|
+
"type": "boolean",
|
|
607
|
+
"description": "Logic dimension complete (root node returns Bool)"
|
|
608
|
+
},
|
|
609
|
+
"constraints": {
|
|
610
|
+
"type": "boolean",
|
|
611
|
+
"description": "Constraints dimension complete (10 Pitfalls checked)"
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
"required": [
|
|
615
|
+
"intent",
|
|
616
|
+
"binding",
|
|
617
|
+
"data",
|
|
618
|
+
"query",
|
|
619
|
+
"logic",
|
|
620
|
+
"constraints"
|
|
621
|
+
],
|
|
622
|
+
"additionalProperties": false,
|
|
623
|
+
"description": "Information puzzle completeness (6 dimensions). Missing dimensions need user input before CREATE."
|
|
624
|
+
},
|
|
625
|
+
"matched_scene": {
|
|
626
|
+
"type": "string",
|
|
627
|
+
"description": "Matched Guard scene id from the 8 binding scenarios ledger. Example: 'machine_forward_guard'"
|
|
628
|
+
},
|
|
629
|
+
"scene_description": {
|
|
630
|
+
"type": "string",
|
|
631
|
+
"description": "Human-readable scene description. Example: 'Workflow node forward validation (Forward.guard)'"
|
|
632
|
+
},
|
|
633
|
+
"scene_constraints": {
|
|
634
|
+
"type": "array",
|
|
635
|
+
"items": {
|
|
636
|
+
"type": "string"
|
|
637
|
+
},
|
|
638
|
+
"description": "Special constraints for the matched scene. Example: ['Forward.guard cannot be modified after Machine is published']"
|
|
639
|
+
},
|
|
640
|
+
"suggested_patterns": {
|
|
641
|
+
"type": "array",
|
|
642
|
+
"items": {
|
|
643
|
+
"type": "string"
|
|
644
|
+
},
|
|
645
|
+
"description": "Suggested Guard patterns based on user intent. Example: ['time lock','progress status check']"
|
|
646
|
+
},
|
|
647
|
+
"available_queries": {
|
|
648
|
+
"type": "array",
|
|
649
|
+
"items": {
|
|
650
|
+
"type": "object",
|
|
651
|
+
"properties": {
|
|
652
|
+
"id": {
|
|
653
|
+
"type": "integer",
|
|
654
|
+
"description": "Query instruction ID. Example: 1253"
|
|
655
|
+
},
|
|
656
|
+
"name": {
|
|
657
|
+
"type": "string",
|
|
658
|
+
"description": "Query instruction name. Example: 'progress.current_node_name'"
|
|
659
|
+
},
|
|
660
|
+
"objectType": {
|
|
661
|
+
"type": "string",
|
|
662
|
+
"description": "Target object type. Example: 'Progress'"
|
|
663
|
+
},
|
|
664
|
+
"returnType": {
|
|
665
|
+
"type": "string",
|
|
666
|
+
"description": "Return value type. Example: 'String'"
|
|
667
|
+
},
|
|
668
|
+
"description": {
|
|
669
|
+
"type": "string",
|
|
670
|
+
"description": "Query description"
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
"required": [
|
|
674
|
+
"id",
|
|
675
|
+
"name",
|
|
676
|
+
"objectType",
|
|
677
|
+
"returnType"
|
|
678
|
+
],
|
|
679
|
+
"additionalProperties": false,
|
|
680
|
+
"description": "A Guard query instruction available for the current context (subset of GUARDQUERY 375 entries)."
|
|
681
|
+
},
|
|
682
|
+
"description": "Available query instructions for the current context (subset of 375 GUARDQUERY entries)"
|
|
683
|
+
},
|
|
684
|
+
"risk_warnings": {
|
|
685
|
+
"type": "array",
|
|
686
|
+
"items": {
|
|
687
|
+
"type": "string"
|
|
688
|
+
},
|
|
689
|
+
"description": "Risk warnings for the current Guard design. Example: ['Guard cannot be modified after creation','Time lock test uses 1000ms']"
|
|
690
|
+
},
|
|
691
|
+
"pending_questions": {
|
|
692
|
+
"type": "array",
|
|
693
|
+
"items": {
|
|
694
|
+
"type": "string"
|
|
695
|
+
},
|
|
696
|
+
"description": "Questions for the user to complete the puzzle. Example: ['Which Host Object will the Guard bind to?']"
|
|
697
|
+
},
|
|
698
|
+
"confirmation_text": {
|
|
699
|
+
"type": "string",
|
|
700
|
+
"description": "Structured semantic confirmation text for user review (generated when puzzle is complete). User must explicitly confirm before CREATE."
|
|
701
|
+
},
|
|
702
|
+
"test_result": {
|
|
703
|
+
"type": "object",
|
|
704
|
+
"properties": {
|
|
705
|
+
"status": {
|
|
706
|
+
"type": "string",
|
|
707
|
+
"enum": [
|
|
708
|
+
"pass",
|
|
709
|
+
"fail",
|
|
710
|
+
"not_tested"
|
|
711
|
+
]
|
|
712
|
+
},
|
|
713
|
+
"failure_node": {
|
|
714
|
+
"type": "string",
|
|
715
|
+
"description": "Node that caused failure (if fail)"
|
|
716
|
+
},
|
|
717
|
+
"passport_id": {
|
|
718
|
+
"type": "string",
|
|
719
|
+
"description": "Generated Passport ID (if pass)"
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
"required": [
|
|
723
|
+
"status"
|
|
724
|
+
],
|
|
725
|
+
"additionalProperties": false,
|
|
726
|
+
"description": "gen_passport static test result. Must pass before CREATE."
|
|
727
|
+
},
|
|
728
|
+
"risk_assessment": {
|
|
729
|
+
"type": "object",
|
|
730
|
+
"properties": {
|
|
731
|
+
"overall_risk": {
|
|
732
|
+
"type": "string",
|
|
733
|
+
"enum": [
|
|
734
|
+
"critical",
|
|
735
|
+
"high",
|
|
736
|
+
"medium",
|
|
737
|
+
"low",
|
|
738
|
+
"info"
|
|
739
|
+
],
|
|
740
|
+
"description": "Overall risk level (highest from all risks)"
|
|
741
|
+
},
|
|
742
|
+
"risk_count": {
|
|
743
|
+
"type": "integer",
|
|
744
|
+
"description": "Total number of detected risks"
|
|
745
|
+
},
|
|
746
|
+
"critical_count": {
|
|
747
|
+
"type": "integer",
|
|
748
|
+
"description": "Number of critical risks"
|
|
749
|
+
},
|
|
750
|
+
"high_count": {
|
|
751
|
+
"type": "integer",
|
|
752
|
+
"description": "Number of high risks"
|
|
753
|
+
},
|
|
754
|
+
"needs_human_review": {
|
|
755
|
+
"type": "boolean",
|
|
756
|
+
"description": "Whether human review is required (critical or 2+ high risks)"
|
|
757
|
+
},
|
|
758
|
+
"top_risks": {
|
|
759
|
+
"type": "array",
|
|
760
|
+
"items": {
|
|
761
|
+
"type": "string"
|
|
762
|
+
},
|
|
763
|
+
"description": "Top risk titles (critical and high, max 3)"
|
|
764
|
+
},
|
|
765
|
+
"stakeholder_advice": {
|
|
766
|
+
"type": "object",
|
|
767
|
+
"additionalProperties": {
|
|
768
|
+
"type": "array",
|
|
769
|
+
"items": {
|
|
770
|
+
"type": "string"
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
"description": "Per-stakeholder advice. Key=stakeholder (customer/provider/arbitrator/claimant), value=advice list"
|
|
774
|
+
}
|
|
775
|
+
},
|
|
776
|
+
"required": [
|
|
777
|
+
"overall_risk",
|
|
778
|
+
"risk_count",
|
|
779
|
+
"critical_count",
|
|
780
|
+
"high_count",
|
|
781
|
+
"needs_human_review",
|
|
782
|
+
"top_risks"
|
|
783
|
+
],
|
|
784
|
+
"additionalProperties": false,
|
|
785
|
+
"description": "Business-layer risk assessment (game theory, data source trust, logic gaps). Populated during Guard design to warn about business risks beyond syntax."
|
|
786
|
+
}
|
|
787
|
+
},
|
|
788
|
+
"additionalProperties": false,
|
|
789
|
+
"description": "Phase 5 Guard capability advice (populated when user intent involves Guard). Provides puzzle status, scene matching, suggested patterns, available queries, risk warnings, and confirmation text. AI uses this to guide Guard design dialogue (R1-R10)."
|
|
566
790
|
}
|
|
567
791
|
},
|
|
568
792
|
"required": [
|