@wowok/agent-mcp 2.3.18 → 2.4.3
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/industry-risks.js +31 -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.js +50 -50
- package/dist/experience/intent-distill.js +6 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -1624
- package/dist/knowledge/acquisition-flywheel.js +64 -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 +1 -1
- package/dist/knowledge/guard-ledger.js +145 -104
- package/dist/knowledge/guard-lint.d.ts +77 -0
- package/dist/knowledge/guard-lint.js +670 -0
- package/dist/knowledge/guard-migration.d.ts +48 -0
- package/dist/knowledge/guard-migration.js +228 -0
- package/dist/knowledge/guard-puzzle.d.ts +109 -14
- package/dist/knowledge/guard-puzzle.js +627 -101
- package/dist/knowledge/guard-risk.d.ts +10 -1
- package/dist/knowledge/guard-risk.js +1634 -292
- package/dist/knowledge/guard-templates.d.ts +38 -0
- package/dist/knowledge/guard-templates.js +605 -0
- package/dist/knowledge/guard-translation.d.ts +14 -2
- package/dist/knowledge/guard-translation.js +825 -194
- package/dist/knowledge/index.d.ts +8 -4
- package/dist/knowledge/index.js +9 -5
- package/dist/knowledge/industry-evolution.js +29 -29
- package/dist/knowledge/industry-generalizer.js +52 -52
- package/dist/knowledge/industry-registry.js +20 -33
- 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 +3 -3
- package/dist/knowledge/tool-constraints.js +20 -4
- package/dist/knowledge/trust-metrics.js +26 -26
- 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/rules.d.ts +12 -0
- package/dist/rules.js +9 -0
- package/dist/schema/call/allocation.d.ts +10 -10
- package/dist/schema/call/base.js +19 -19
- package/dist/schema/call/bridge.d.ts +32 -32
- package/dist/schema/call/demand.d.ts +84 -84
- package/dist/schema/call/guard.d.ts +153 -0
- package/dist/schema/call/guard.js +50 -0
- package/dist/schema/call/machine.d.ts +38 -38
- package/dist/schema/call/permission.d.ts +78 -78
- package/dist/schema/call/repository.d.ts +22 -22
- package/dist/schema/call/semantic.js +229 -25
- package/dist/schema/call/service.d.ts +7 -7
- package/dist/schema/local/wip.d.ts +39 -19
- package/dist/schema/local/wip.js +5 -5
- package/dist/schema/messenger/index.d.ts +26 -26
- package/dist/schema/messenger/index.js +2 -2
- package/dist/schema/operations.d.ts +270 -192
- package/dist/schema/query/index.d.ts +184 -184
- package/dist/schema/query/index.js +15 -9
- package/dist/schema/trust/index.d.ts +4 -4
- package/dist/schema/utils/guard-parser.js +4 -4
- package/dist/schema/utils/guard-query-utils.d.ts +7 -0
- package/dist/schema/utils/guard-query-utils.js +14 -1
- package/dist/schema/utils/node-parser.js +14 -14
- package/dist/schemas/bridge_operation.output.json +15 -15
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/messenger_operation.output.json +18 -16
- package/dist/schemas/onchain_events.output.json +15 -15
- package/dist/schemas/onchain_operations.output.json +16 -16
- package/dist/schemas/onchain_operations.schema.json +11 -20
- package/dist/schemas/onchain_operations_allocation.schema.json +7 -10
- package/dist/schemas/onchain_operations_machine.schema.json +2 -5
- package/dist/schemas/onchain_operations_service.schema.json +2 -5
- package/dist/schemas/onchain_table_data.output.json +20 -26
- package/dist/schemas/wip_file.output.json +24 -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 +71 -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 +30 -0
- package/dist/tools/handlers/local.js +27 -0
- package/dist/tools/handlers/messenger.d.ts +16 -0
- package/dist/tools/handlers/messenger.js +187 -0
- package/dist/tools/handlers/onchain.d.ts +2 -0
- package/dist/tools/handlers/onchain.js +246 -0
- package/dist/tools/handlers/project.d.ts +2 -0
- package/dist/tools/handlers/project.js +53 -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 +92 -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 +479 -0
- package/dist/tools/rules-hook.d.ts +2 -0
- package/dist/tools/rules-hook.js +22 -0
- package/dist/tools/shared.d.ts +29 -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 +6 -0
- package/dist/tools/wrap.js +55 -0
- package/package.json +19 -5
|
@@ -3,7 +3,7 @@ import { TokenTypeInfoSchema, QueryLocalMarkListResultSchema, QueryAccountListRe
|
|
|
3
3
|
import { AccountOrMark_AddressSchema, BalanceTypeSchema, CacheExpireTypeSchema, EntrypointSchema, GuardIdentifierSchema, GuardTableItemSchema, NameOrAddressSchema, ObjectBaseSchema, ObjectTypeSchema, QueryIdSchema, SupportedValueSchema, ValueTypeSchema, QueryReceivedResultSchema, LongNameSchema, DescriptionSchema } from "../common/index.js";
|
|
4
4
|
import { SemanticSummarySchema } from "../call/index.js";
|
|
5
5
|
import { isValidPermissionIndex } from '../utils/permission-index-utils.js';
|
|
6
|
-
import { isValidGuardQueryId, isValidGuardQueryIdOrName } from '../utils/guard-query-utils.js';
|
|
6
|
+
import { isValidGuardQueryId, isValidGuardQueryIdOrName, isValidWitnessType } from '../utils/guard-query-utils.js';
|
|
7
7
|
import { ENTITY_LINKER_ADDRESS, ENTITY_REGISTRAR_ADDRESS, isWitnessType, } from "@wowok/wowok";
|
|
8
8
|
import { DiscountType as WDiscountType } from "@wowok/wowok";
|
|
9
9
|
import { QueryEnvSchema } from "../common/index.js";
|
|
@@ -144,7 +144,7 @@ export const ProgressSessionSchema = z.object({
|
|
|
144
144
|
next_node: z.string().describe("Next node ID"),
|
|
145
145
|
forwards: z.array(ProgressSessionHolderSchema).describe("Operation list in Progress session"),
|
|
146
146
|
weights: tolerantNumber.describe("Total operation weight"),
|
|
147
|
-
threshold: tolerantNumber.describe("Operation threshold. When total operation weight exceeds threshold, session is considered completed and Progress moves from current node to next node."),
|
|
147
|
+
threshold: tolerantNumber.default(0).describe("Operation threshold. When total operation weight exceeds threshold, session is considered completed and Progress moves from current node to next node."),
|
|
148
148
|
}).describe("Progress session");
|
|
149
149
|
export const ObjectProgressSchema = ObjectBaseSchema.extend({
|
|
150
150
|
machine: z.string().describe("Machine ID that Progress object belongs to"),
|
|
@@ -196,7 +196,7 @@ export const AllocatorSchema = z.object({
|
|
|
196
196
|
}).describe("Fund allocator");
|
|
197
197
|
export const AllocatorsSchema = z.object({
|
|
198
198
|
description: DescriptionSchema.describe("Description of fund allocator list"),
|
|
199
|
-
threshold: BalanceTypeSchema.describe("Threshold. If defined, fund allocation will be triggered when amount in Allocation object reaches this threshold."),
|
|
199
|
+
threshold: BalanceTypeSchema.default(0).describe("Threshold. If defined, fund allocation will be triggered when amount in Allocation object reaches this threshold."),
|
|
200
200
|
allocators: z.array(AllocatorSchema).describe("Fund allocator list. Each fund allocator represents a fund allocation strategy."),
|
|
201
201
|
}).describe("Fund allocator list");
|
|
202
202
|
export const ObjectServiceSchema = ObjectBaseSchema.extend({
|
|
@@ -402,11 +402,17 @@ export const ObjectPermissionSchema = ObjectBaseSchema.extend({
|
|
|
402
402
|
})).describe("Permission item remark list"),
|
|
403
403
|
um: z.union([z.string(), z.null()]).describe("Contact object"),
|
|
404
404
|
}).describe("Permission object");
|
|
405
|
-
export const WitnessTypeSchema = z.
|
|
406
|
-
.
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
405
|
+
export const WitnessTypeSchema = z.union([
|
|
406
|
+
z.number()
|
|
407
|
+
.int()
|
|
408
|
+
.refine(isWitnessType, {
|
|
409
|
+
message: 'Invalid WitnessType numeric value. Valid range: 100-108.',
|
|
410
|
+
}),
|
|
411
|
+
z.string()
|
|
412
|
+
.refine((name) => isValidWitnessType(name), {
|
|
413
|
+
message: 'Invalid WitnessType string name. Valid names: OrderProgress (100), OrderMachine (101), OrderService (102), ProgressMachine (103), ArbOrder (104), ArbArbitration (105), ArbProgress (106), ArbMachine (107), ArbService (108). Case-insensitive; "Type" prefix is optional.',
|
|
414
|
+
})
|
|
415
|
+
]).describe("When specified, the query retrieves data from the associated (witness) object instead of the queried object itself. This enables cross-object queries within Guard validation logic. Can be a numeric ID (100-108) or a string name (case-insensitive, with or without the 'Type' prefix). String format is recommended for readability.\n\nAvailable WitnessTypes:\n- OrderProgress / TypeOrderProgress (100): Query an Order's associated Progress object. Use case: Check if order has reached a specific workflow node (e.g., 'complete') before allowing reward claims.\n- OrderMachine / TypeOrderMachine (101): Query an Order's associated Machine (workflow definition). Use case: Verify the workflow structure or check node configurations.\n- OrderService / TypeOrderService (102): Query an Order's parent Service object. Use case: Validate the service offering details or check service-level configurations.\n- ProgressMachine / TypeProgressMachine (103): Query a Progress's associated Machine. Use case: Access workflow definition from a Progress context.\n- ArbOrder / TypeArbOrder (104): Query an Arb's associated Order. Use case: In arbitration voting guards, verify order details like payment amount or service ID.\n- ArbArbitration / TypeArbArbitration (105): Query an Arb's parent Arbitration service. Use case: Access arbitration configuration or fee settings from within an Arb case.\n- ArbProgress / TypeArbProgress (106): Query an Arb's associated Progress. Use case: Check order workflow state during arbitration validation.\n- ArbMachine / TypeArbMachine (107): Query an Arb's associated Machine. Use case: Access workflow definition for dispute context analysis.\n- ArbService / TypeArbService (108): Query an Arb's associated Service. Use case: Verify service terms or compensation fund status during arbitration.\n\nExample: To validate that an order has reached the 'complete' node, query the Order with convert_witness='OrderProgress' and check the Progress's current_node field.");
|
|
410
416
|
export const GuardQueryIdSchema = z.number().int().min(0).refine((id) => isValidGuardQueryId(id), { message: "Invalid guard query ID. ID not found in GUARDQUERY array." }).describe("ID of the data query instruction for the Object.");
|
|
411
417
|
export const GuardNodeSchema = z.lazy(() => z.discriminatedUnion('type', [
|
|
412
418
|
z.object({
|
|
@@ -848,7 +854,7 @@ export const MachineForwardSchema = z.object({
|
|
|
848
854
|
}).strict().describe("Forward in Machine object");
|
|
849
855
|
export const MachineNodePairSchema = z.object({
|
|
850
856
|
prev_node: z.string().describe("Previous node name"),
|
|
851
|
-
threshold: tolerantNumber.describe("Threshold to trigger node advancement. If total Forward weight is greater than or equal to threshold, node advancement is triggered."),
|
|
857
|
+
threshold: tolerantNumber.default(0).describe("Threshold to trigger node advancement. If total Forward weight is greater than or equal to threshold, node advancement is triggered."),
|
|
852
858
|
forwards: z.array(MachineForwardSchema).describe("Forward list"),
|
|
853
859
|
}).strict().describe("Node pair in Machine object");
|
|
854
860
|
export const MachineNodeSchema = z.object({
|
|
@@ -213,9 +213,9 @@ export declare const TrustScoreOutputSchema: z.ZodObject<{
|
|
|
213
213
|
}[];
|
|
214
214
|
};
|
|
215
215
|
service_id: string;
|
|
216
|
+
service_name: string;
|
|
216
217
|
order_amount: string;
|
|
217
218
|
depth: "browse" | "evaluate" | "preorder";
|
|
218
|
-
service_name: string;
|
|
219
219
|
service_basics: {
|
|
220
220
|
bPublished: boolean;
|
|
221
221
|
bPaused: boolean;
|
|
@@ -263,9 +263,9 @@ export declare const TrustScoreOutputSchema: z.ZodObject<{
|
|
|
263
263
|
}[];
|
|
264
264
|
};
|
|
265
265
|
service_id: string;
|
|
266
|
+
service_name: string;
|
|
266
267
|
order_amount: string;
|
|
267
268
|
depth: "browse" | "evaluate" | "preorder";
|
|
268
|
-
service_name: string;
|
|
269
269
|
service_basics: {
|
|
270
270
|
bPublished: boolean;
|
|
271
271
|
bPaused: boolean;
|
|
@@ -315,9 +315,9 @@ export declare const TrustScoreOutputSchema: z.ZodObject<{
|
|
|
315
315
|
}[];
|
|
316
316
|
};
|
|
317
317
|
service_id: string;
|
|
318
|
+
service_name: string;
|
|
318
319
|
order_amount: string;
|
|
319
320
|
depth: "browse" | "evaluate" | "preorder";
|
|
320
|
-
service_name: string;
|
|
321
321
|
service_basics: {
|
|
322
322
|
bPublished: boolean;
|
|
323
323
|
bPaused: boolean;
|
|
@@ -367,9 +367,9 @@ export declare const TrustScoreOutputSchema: z.ZodObject<{
|
|
|
367
367
|
}[];
|
|
368
368
|
};
|
|
369
369
|
service_id: string;
|
|
370
|
+
service_name: string;
|
|
370
371
|
order_amount: string;
|
|
371
372
|
depth: "browse" | "evaluate" | "preorder";
|
|
372
|
-
service_name: string;
|
|
373
373
|
service_basics: {
|
|
374
374
|
bPublished: boolean;
|
|
375
375
|
bPaused: boolean;
|
|
@@ -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);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WitnessType } from "@wowok/wowok";
|
|
1
2
|
export declare const isValidGuardQueryId: (id: number) => boolean;
|
|
2
3
|
export declare const isValidGuardQueryName: (name: string) => boolean;
|
|
3
4
|
export declare const isValidGuardQueryIdOrName: (input: number | string) => boolean;
|
|
@@ -9,3 +10,9 @@ export declare const BOOL_RETURNING_QUERIES: {
|
|
|
9
10
|
name: string;
|
|
10
11
|
description: string;
|
|
11
12
|
}[];
|
|
13
|
+
export declare const isValidWitnessType: (input: number | string) => boolean;
|
|
14
|
+
export declare const WITNESS_TYPE_ENTRIES: {
|
|
15
|
+
id: WitnessType;
|
|
16
|
+
name: string;
|
|
17
|
+
fullName: string;
|
|
18
|
+
}[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GUARDQUERY, ValueType } from "@wowok/wowok";
|
|
1
|
+
import { GUARDQUERY, ValueType, WitnessType, isValidWitnessTypeInput, witnessTypeToString } from "@wowok/wowok";
|
|
2
2
|
const validGuardQueryIds = new Set(GUARDQUERY.map(item => item.id));
|
|
3
3
|
const validGuardQueryNames = new Set(GUARDQUERY.map(item => item.name.toLowerCase()));
|
|
4
4
|
const boolReturningQueryIds = new Set(GUARDQUERY.filter(item => item.return === ValueType.Bool).map(item => item.id));
|
|
@@ -31,3 +31,16 @@ export const isBoolReturningQuery = (input) => {
|
|
|
31
31
|
export const BOOL_RETURNING_QUERIES = GUARDQUERY
|
|
32
32
|
.filter(item => item.return === ValueType.Bool)
|
|
33
33
|
.map(item => ({ id: item.id, name: item.name, description: item.description }));
|
|
34
|
+
export const isValidWitnessType = (input) => {
|
|
35
|
+
return isValidWitnessTypeInput(input);
|
|
36
|
+
};
|
|
37
|
+
export const WITNESS_TYPE_ENTRIES = Object.keys(WitnessType)
|
|
38
|
+
.filter(k => isNaN(Number(k)))
|
|
39
|
+
.map(k => {
|
|
40
|
+
const enumValue = WitnessType[k];
|
|
41
|
+
return {
|
|
42
|
+
id: enumValue,
|
|
43
|
+
name: witnessTypeToString(enumValue),
|
|
44
|
+
fullName: k,
|
|
45
|
+
};
|
|
46
|
+
});
|
|
@@ -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",
|
|
@@ -628,21 +628,21 @@
|
|
|
628
628
|
},
|
|
629
629
|
"scene_description": {
|
|
630
630
|
"type": "string",
|
|
631
|
-
"description": "Human-readable scene description. Example: '
|
|
631
|
+
"description": "Human-readable scene description. Example: 'Workflow node forward validation (Forward.guard)'"
|
|
632
632
|
},
|
|
633
633
|
"scene_constraints": {
|
|
634
634
|
"type": "array",
|
|
635
635
|
"items": {
|
|
636
636
|
"type": "string"
|
|
637
637
|
},
|
|
638
|
-
"description": "Special constraints for the matched scene. Example: ['
|
|
638
|
+
"description": "Special constraints for the matched scene. Example: ['Forward.guard cannot be modified after Machine is published']"
|
|
639
639
|
},
|
|
640
640
|
"suggested_patterns": {
|
|
641
641
|
"type": "array",
|
|
642
642
|
"items": {
|
|
643
643
|
"type": "string"
|
|
644
644
|
},
|
|
645
|
-
"description": "Suggested Guard patterns based on user intent. Example: ['
|
|
645
|
+
"description": "Suggested Guard patterns based on user intent. Example: ['time lock','progress status check']"
|
|
646
646
|
},
|
|
647
647
|
"available_queries": {
|
|
648
648
|
"type": "array",
|
|
@@ -655,7 +655,7 @@
|
|
|
655
655
|
},
|
|
656
656
|
"name": {
|
|
657
657
|
"type": "string",
|
|
658
|
-
"description": "Query instruction name. Example: 'progress.
|
|
658
|
+
"description": "Query instruction name. Example: 'progress.current'"
|
|
659
659
|
},
|
|
660
660
|
"objectType": {
|
|
661
661
|
"type": "string",
|
|
@@ -686,14 +686,14 @@
|
|
|
686
686
|
"items": {
|
|
687
687
|
"type": "string"
|
|
688
688
|
},
|
|
689
|
-
"description": "Risk warnings for the current Guard design. Example: ['Guard
|
|
689
|
+
"description": "Risk warnings for the current Guard design. Example: ['Guard cannot be modified after creation','Time lock test uses 1000ms']"
|
|
690
690
|
},
|
|
691
691
|
"pending_questions": {
|
|
692
692
|
"type": "array",
|
|
693
693
|
"items": {
|
|
694
694
|
"type": "string"
|
|
695
695
|
},
|
|
696
|
-
"description": "Questions for the user to complete the puzzle. Example: ['
|
|
696
|
+
"description": "Questions for the user to complete the puzzle. Example: ['Which Host Object will the Guard bind to?']"
|
|
697
697
|
},
|
|
698
698
|
"confirmation_text": {
|
|
699
699
|
"type": "string",
|
package/dist/schemas/index.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "WoWok MCP Schema Index",
|
|
4
4
|
"description": "Index of all available JSON schemas for WoWok MCP tools",
|
|
5
|
-
"generatedAt": "2026-07-
|
|
5
|
+
"generatedAt": "2026-07-18T11:29:05.935Z",
|
|
6
6
|
"tools": [
|
|
7
7
|
{
|
|
8
8
|
"name": "onchain_operations",
|
|
@@ -556,7 +556,9 @@
|
|
|
556
556
|
}
|
|
557
557
|
},
|
|
558
558
|
"required": [
|
|
559
|
-
"valid"
|
|
559
|
+
"valid",
|
|
560
|
+
"hashValid",
|
|
561
|
+
"hasSignature"
|
|
560
562
|
],
|
|
561
563
|
"additionalProperties": false,
|
|
562
564
|
"description": "WTS verification result"
|
|
@@ -1390,7 +1392,7 @@
|
|
|
1390
1392
|
}
|
|
1391
1393
|
},
|
|
1392
1394
|
"additionalProperties": false,
|
|
1393
|
-
"description": "Experience layer feedback from past operations (Phase 2
|
|
1395
|
+
"description": "Experience layer feedback from past operations (Phase 2 Topic 2)"
|
|
1394
1396
|
},
|
|
1395
1397
|
"service_status": {
|
|
1396
1398
|
"type": "object",
|
|
@@ -1440,7 +1442,7 @@
|
|
|
1440
1442
|
"items": {
|
|
1441
1443
|
"type": "string"
|
|
1442
1444
|
},
|
|
1443
|
-
"description": "Actionable recommendations for the buyer. Example: ['
|
|
1445
|
+
"description": "Actionable recommendations for the buyer. Example: ['Require merchant to configure arbitration','Negotiate refund terms via Messenger']"
|
|
1444
1446
|
},
|
|
1445
1447
|
"reminders": {
|
|
1446
1448
|
"type": "array",
|
|
@@ -1475,7 +1477,7 @@
|
|
|
1475
1477
|
},
|
|
1476
1478
|
"message": {
|
|
1477
1479
|
"type": "string",
|
|
1478
|
-
"description": "Human-readable reminder message. Example: '
|
|
1480
|
+
"description": "Human-readable reminder message. Example: 'Composite risk score 25/100, strongly discourage purchase'"
|
|
1479
1481
|
},
|
|
1480
1482
|
"action": {
|
|
1481
1483
|
"type": "string",
|
|
@@ -1491,7 +1493,7 @@
|
|
|
1491
1493
|
"additionalProperties": false,
|
|
1492
1494
|
"description": "A buyer-side reminder triggered at a specific order lifecycle stage (Phase 3 C-3)."
|
|
1493
1495
|
},
|
|
1494
|
-
"description": "Stage-specific reminders (deduped, sorted by priority, capped to 3 high-risk). Example: [{priority:'required', message:'
|
|
1496
|
+
"description": "Stage-specific reminders (deduped, sorted by priority, capped to 3 high-risk). Example: [{priority:'required', message:'Ambiguous Guard must be human-reviewed'}]"
|
|
1495
1497
|
},
|
|
1496
1498
|
"preference_match": {
|
|
1497
1499
|
"type": "object",
|
|
@@ -1507,14 +1509,14 @@
|
|
|
1507
1509
|
"items": {
|
|
1508
1510
|
"type": "string"
|
|
1509
1511
|
},
|
|
1510
|
-
"description": "Aspects that match user preferences. Example: ['
|
|
1512
|
+
"description": "Aspects that match user preferences. Example: ['Price 10% below average','Has arbitration']"
|
|
1511
1513
|
},
|
|
1512
1514
|
"mismatches": {
|
|
1513
1515
|
"type": "array",
|
|
1514
1516
|
"items": {
|
|
1515
1517
|
"type": "string"
|
|
1516
1518
|
},
|
|
1517
|
-
"description": "Aspects that mismatch user preferences. Example: ['
|
|
1519
|
+
"description": "Aspects that mismatch user preferences. Example: ['Delivery cycle exceeds expectation']"
|
|
1518
1520
|
}
|
|
1519
1521
|
},
|
|
1520
1522
|
"required": [
|
|
@@ -1538,11 +1540,11 @@
|
|
|
1538
1540
|
"properties": {
|
|
1539
1541
|
"industry_signal": {
|
|
1540
1542
|
"type": "string",
|
|
1541
|
-
"description": "Industry evolution signal summary. Example: '
|
|
1543
|
+
"description": "Industry evolution signal summary. Example: 'Industry health 82/100 (healthy); 25 cumulative industry signals'"
|
|
1542
1544
|
},
|
|
1543
1545
|
"evolution_advice": {
|
|
1544
1546
|
"type": "string",
|
|
1545
|
-
"description": "Evolution advice for the current operation. Example: '
|
|
1547
|
+
"description": "Evolution advice for the current operation. Example: 'Recommend mandatory arbitration + compensation fund + delivery Guard'"
|
|
1546
1548
|
},
|
|
1547
1549
|
"confidence": {
|
|
1548
1550
|
"type": "number",
|
|
@@ -1579,7 +1581,7 @@
|
|
|
1579
1581
|
"items": {
|
|
1580
1582
|
"type": "string"
|
|
1581
1583
|
},
|
|
1582
|
-
"description": "Phase 4 P4-6.C: Role-targeted advice strings (user/merchant/arbitrator). Example: ['
|
|
1584
|
+
"description": "Phase 4 P4-6.C: Role-targeted advice strings (user/merchant/arbitrator). Example: ['Strengthen loyalty flywheel','Optimize first-order conversion']"
|
|
1583
1585
|
},
|
|
1584
1586
|
"role": {
|
|
1585
1587
|
"type": "string",
|
|
@@ -1661,21 +1663,21 @@
|
|
|
1661
1663
|
},
|
|
1662
1664
|
"scene_description": {
|
|
1663
1665
|
"type": "string",
|
|
1664
|
-
"description": "Human-readable scene description. Example: '
|
|
1666
|
+
"description": "Human-readable scene description. Example: 'Workflow node forward validation (Forward.guard)'"
|
|
1665
1667
|
},
|
|
1666
1668
|
"scene_constraints": {
|
|
1667
1669
|
"type": "array",
|
|
1668
1670
|
"items": {
|
|
1669
1671
|
"type": "string"
|
|
1670
1672
|
},
|
|
1671
|
-
"description": "Special constraints for the matched scene. Example: ['
|
|
1673
|
+
"description": "Special constraints for the matched scene. Example: ['Forward.guard cannot be modified after Machine is published']"
|
|
1672
1674
|
},
|
|
1673
1675
|
"suggested_patterns": {
|
|
1674
1676
|
"type": "array",
|
|
1675
1677
|
"items": {
|
|
1676
1678
|
"type": "string"
|
|
1677
1679
|
},
|
|
1678
|
-
"description": "Suggested Guard patterns based on user intent. Example: ['
|
|
1680
|
+
"description": "Suggested Guard patterns based on user intent. Example: ['time lock','progress status check']"
|
|
1679
1681
|
},
|
|
1680
1682
|
"available_queries": {
|
|
1681
1683
|
"type": "array",
|
|
@@ -1688,7 +1690,7 @@
|
|
|
1688
1690
|
},
|
|
1689
1691
|
"name": {
|
|
1690
1692
|
"type": "string",
|
|
1691
|
-
"description": "Query instruction name. Example: 'progress.
|
|
1693
|
+
"description": "Query instruction name. Example: 'progress.current'"
|
|
1692
1694
|
},
|
|
1693
1695
|
"objectType": {
|
|
1694
1696
|
"type": "string",
|
|
@@ -1719,14 +1721,14 @@
|
|
|
1719
1721
|
"items": {
|
|
1720
1722
|
"type": "string"
|
|
1721
1723
|
},
|
|
1722
|
-
"description": "Risk warnings for the current Guard design. Example: ['Guard
|
|
1724
|
+
"description": "Risk warnings for the current Guard design. Example: ['Guard cannot be modified after creation','Time lock test uses 1000ms']"
|
|
1723
1725
|
},
|
|
1724
1726
|
"pending_questions": {
|
|
1725
1727
|
"type": "array",
|
|
1726
1728
|
"items": {
|
|
1727
1729
|
"type": "string"
|
|
1728
1730
|
},
|
|
1729
|
-
"description": "Questions for the user to complete the puzzle. Example: ['
|
|
1731
|
+
"description": "Questions for the user to complete the puzzle. Example: ['Which Host Object will the Guard bind to?']"
|
|
1730
1732
|
},
|
|
1731
1733
|
"confirmation_text": {
|
|
1732
1734
|
"type": "string",
|