@wowok/agent-mcp 2.4.1 → 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/index.d.ts +2 -2
- package/dist/index.js +11 -1624
- 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-risk.d.ts +2 -0
- package/dist/knowledge/guard-risk.js +827 -57
- package/dist/knowledge/guard-templates.d.ts +1 -0
- package/dist/knowledge/guard-templates.js +278 -2
- 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 +3 -3
- package/dist/schema/call/machine.d.ts +38 -38
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +7 -7
- package/dist/schema/operations.d.ts +48 -48
- package/dist/schema/query/index.d.ts +146 -146
- package/dist/schema/query/index.js +15 -9
- package/dist/schema/utils/guard-query-utils.d.ts +7 -0
- package/dist/schema/utils/guard-query-utils.js +14 -1
- package/dist/schemas/bridge_operation.output.json +1 -1
- package/dist/schemas/index.json +1 -1
- 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 +2 -2
- 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 +6 -12
- 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
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
|
+
import { readFileSync } from "fs";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import { dirname, join } from "path";
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
const SCHEMA_DIR_CANDIDATES = [
|
|
9
|
+
join(__dirname, "..", "schemas"),
|
|
10
|
+
join(__dirname, "..", "..", "dist", "schemas"),
|
|
11
|
+
];
|
|
12
|
+
const preGeneratedSchemaCache = new Map();
|
|
13
|
+
import { wrapHandlerWithErrorShape, statusErrorShape, operationErrorShape, strictStatusErrorShape, } from "./wrap.js";
|
|
14
|
+
import { withTelemetry } from "../telemetry/index.js";
|
|
15
|
+
import { handleOnchainOperations } from "./handlers/onchain.js";
|
|
16
|
+
import { handleAccountOperation, handleMarkOperation, handleInfoOperation } from "./handlers/local.js";
|
|
17
|
+
import { handleWipOperations } from "./handlers/wip.js";
|
|
18
|
+
import { handleMessengerOperation } from "./handlers/messenger.js";
|
|
19
|
+
import { handleGuard2File, handleMachineNode2File } from "./handlers/file-export.js";
|
|
20
|
+
import { handleWatchQueryOperations, handleOnchainTableData, handleOnchainEvents, handleWowokInfo, } from "./handlers/query.js";
|
|
21
|
+
import { handleSchemaQuery } from "./handlers/schema-query.js";
|
|
22
|
+
import { handleBridgeOperations } from "./handlers/bridge.js";
|
|
23
|
+
import { handleProjectOperation } from "./handlers/project.js";
|
|
24
|
+
import { handleConfigOperation } from "./handlers/config.js";
|
|
25
|
+
import { handleTrustScore } from "./handlers/trust.js";
|
|
26
|
+
import { applyOnchainRules } from "./rules-hook.js";
|
|
27
|
+
import { createToolMeta, OnchainOperationsSchema, AccountOperationSchema, LocalMarkOperationSchema, LocalInfoOperationSchema, WipOperationsSchema, MessengerOperationInputSchema, Guard2File_InputSchema, MachineNode2File_InputSchema, WatchQueryOperationsSchema, OnchainTableDataSchema, OnchainEventsInputSchema, ProtocolInfoQuerySchema, SchemaQueryInputSchema, BridgeOperationsSchema, ProjectOperationInputSchema, ConfigOperationInputSchema, TrustScoreInputSchema, CallOutputSchema, AccountOperationOutputWrappedSchema, LocalMarkOperationOutputWrappedSchema, LocalInfoOperationOutputWrappedSchema, WipOperationOutputSchema, MessengerOperationOutputSchema, Guard2File_OutputWrappedSchema, MachineNode2File_OutputWrappedSchema, OnchainTableDataResultSchema, OnchainEventsResultSchema, ProtocolInfoResultSchema, SchemaQueryOutputSchema, BridgeCallOutputSchema, ProjectOperationOutputSchema, ConfigOperationOutputSchema, TrustScoreOutputSchema, } from "../schema/index.js";
|
|
28
|
+
export const TOOL_REGISTRY = [
|
|
29
|
+
{
|
|
30
|
+
name: "onchain_operations",
|
|
31
|
+
handler: handleOnchainOperations,
|
|
32
|
+
config: {
|
|
33
|
+
title: "⛓️ On-chain Operations",
|
|
34
|
+
description: "On-chain operations for WoWok object: service (marketplace listings), machine (workflow templates), progress (order tracking), repository (on-chain database), arbitration (dispute resolution), contact (IM management), treasury (team funds), reward (incentive pools), allocation (auto-distribution), permission (access control), guard (programmable trust rules), personal (public profile), payment (direct coin transfers), demand (service requests), order (order management), gen_passport (verified credentials), proof (on-chain proof objects), gen_proof (generate proof shortcut).\n\n💡 Schema hint: Use schema_query with action='get' and name='onchain_operations' to retrieve the complete parameter schema. For individual operation schemas (e.g., 'onchain_operations_permission'), use schema_query with action='list_operations' to see all available operation schemas.",
|
|
35
|
+
inputSchema: OnchainOperationsSchema,
|
|
36
|
+
outputSchema: CallOutputSchema,
|
|
37
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
38
|
+
_meta: createToolMeta("operation", ["service", "machine", "progress", "repository", "arbitration", "contact", "treasury", "reward", "allocation", "permission", "guard", "personal", "payment", "demand", "order", "gen_passport", "proof", "gen_proof", "on-chain", "blockchain"]),
|
|
39
|
+
},
|
|
40
|
+
applyRules: applyOnchainRules,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "account_operation",
|
|
44
|
+
handler: handleAccountOperation,
|
|
45
|
+
config: {
|
|
46
|
+
title: "🔒 LOCAL ONLY: Account - Wallet Management",
|
|
47
|
+
description: "🔒 100% LOCAL, NEVER ON-CHAIN 🔒 Manage WoWok accounts locally on device: generate, suspend, resume, faucet-test, operate assets, sign data, etc.\n\n💡 Schema hint: Use schema_query with action='get' and name='account_operation' to retrieve the exact parameter schema before calling.",
|
|
48
|
+
inputSchema: AccountOperationSchema,
|
|
49
|
+
outputSchema: AccountOperationOutputWrappedSchema,
|
|
50
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
51
|
+
_meta: createToolMeta("operation", ["account", "local", "private", "wallet", "off-chain"]),
|
|
52
|
+
},
|
|
53
|
+
errorShapeBuilder: statusErrorShape,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "local_mark_operation",
|
|
57
|
+
handler: handleMarkOperation,
|
|
58
|
+
config: {
|
|
59
|
+
title: "🔒 LOCAL ONLY: LocalMark - Address Book Management",
|
|
60
|
+
description: "100% LOCAL, NEVER ON-CHAIN 🔒 Manage ID names and tags stored ONLY on your local device for easy identification of user address or object IDs by name.\n\n💡 Schema hint: Use schema_query with action='get' and name='local_mark_operation' to retrieve the exact parameter schema before calling.",
|
|
61
|
+
inputSchema: LocalMarkOperationSchema,
|
|
62
|
+
outputSchema: LocalMarkOperationOutputWrappedSchema,
|
|
63
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
64
|
+
_meta: createToolMeta("operation", ["mark", "local", "private", "address-book", "off-chain"]),
|
|
65
|
+
},
|
|
66
|
+
errorShapeBuilder: statusErrorShape,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "local_info_operation",
|
|
70
|
+
handler: handleInfoOperation,
|
|
71
|
+
config: {
|
|
72
|
+
title: "🔒 LOCAL ONLY: LocalInfo - Private Data Management",
|
|
73
|
+
description: "100% LOCAL, NEVER ON-CHAIN 🔒 Manage sensitive personal information stored ONLY on your device: delivery addresses, phone numbers, contacts.\n\n💡 Schema hint: Use schema_query with action='get' and name='local_info_operation' to retrieve the exact parameter schema before calling.",
|
|
74
|
+
inputSchema: LocalInfoOperationSchema,
|
|
75
|
+
outputSchema: LocalInfoOperationOutputWrappedSchema,
|
|
76
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
77
|
+
_meta: createToolMeta("operation", ["info", "local", "private", "data-management", "off-chain"]),
|
|
78
|
+
},
|
|
79
|
+
errorShapeBuilder: statusErrorShape,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "wip_file",
|
|
83
|
+
handler: handleWipOperations,
|
|
84
|
+
config: {
|
|
85
|
+
title: "🤝 Witness Immutable Promise File Operations",
|
|
86
|
+
description: "generate (create WIP files from markdown and images), verify (integrity check), sign (add signatures), or wip2html (convert to HTML).\n\n💡 Schema hint: Use schema_query with action='get' and name='wip_file' to retrieve the exact parameter schema before calling.",
|
|
87
|
+
inputSchema: WipOperationsSchema,
|
|
88
|
+
outputSchema: z.object({
|
|
89
|
+
result: WipOperationOutputSchema,
|
|
90
|
+
}),
|
|
91
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
92
|
+
_meta: createToolMeta("operation", ["wip", "promise", "file-generation", "verification", "signature", "local"]),
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "messenger_operation",
|
|
97
|
+
handler: handleMessengerOperation,
|
|
98
|
+
config: {
|
|
99
|
+
title: "💬 Messenger Operations",
|
|
100
|
+
description: "WoWok encrypted messenger operations: watch conversations (with unread filtering, preview messages), send message, send file, watch messages (with viewed status filtering), extract zip messages, generate WTS, verify WTS, sign WTS, WTS to HTML, proof message on-chain, manage blacklist, friendslist, guardlist, settings, mark messages as viewed, mark conversation as viewed, and pull messages from server.\n\n💡 Schema hint: Use schema_query with action='get' and name='messenger_operation' to retrieve the exact parameter schema before calling.",
|
|
101
|
+
inputSchema: MessengerOperationInputSchema,
|
|
102
|
+
outputSchema: MessengerOperationOutputSchema,
|
|
103
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
104
|
+
_meta: createToolMeta("operation", ["messenger", "message", "file", "wts", "blacklist", "friendslist", "guardlist", "settings", "proof", "communication"]),
|
|
105
|
+
},
|
|
106
|
+
errorShapeBuilder: operationErrorShape,
|
|
107
|
+
timeoutMs: 30000,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: "guard2file",
|
|
111
|
+
handler: handleGuard2File,
|
|
112
|
+
config: {
|
|
113
|
+
title: "📄 Guard to File - Export Guard Definition",
|
|
114
|
+
description: "Export a Guard object's definition from the blockchain to a local JSON or Markdown file for editing and creating new Guard objects. Note: To query on-chain object information, use the 'query_toolkit' tool instead.\n\n💡 Schema hint: Use schema_query with action='get' and name='guard2file' to retrieve the exact parameter schema before calling.",
|
|
115
|
+
inputSchema: Guard2File_InputSchema,
|
|
116
|
+
outputSchema: Guard2File_OutputWrappedSchema,
|
|
117
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
118
|
+
_meta: createToolMeta("generate file", ["guard", "export", "file", "json", "markdown", "on-chain"]),
|
|
119
|
+
},
|
|
120
|
+
errorShapeBuilder: strictStatusErrorShape,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "machineNode2file",
|
|
124
|
+
handler: handleMachineNode2File,
|
|
125
|
+
config: {
|
|
126
|
+
title: "⚙️ Machine Node to File - Export Machine Node Definition",
|
|
127
|
+
description: "Export a Machine object's node definition from the blockchain to a local JSON or Markdown file for editing and creating new Machine objects. Note: To query on-chain object information, use the 'query_toolkit' tool instead.\n\n💡 Schema hint: Use schema_query with action='get' and name='machineNode2file' to retrieve the exact parameter schema before calling.",
|
|
128
|
+
inputSchema: MachineNode2File_InputSchema,
|
|
129
|
+
outputSchema: MachineNode2File_OutputWrappedSchema,
|
|
130
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
131
|
+
_meta: createToolMeta("generate file", ["machine", "export", "file", "json", "markdown", "on-chain", "workflow"]),
|
|
132
|
+
},
|
|
133
|
+
errorShapeBuilder: strictStatusErrorShape,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "query_toolkit",
|
|
137
|
+
handler: handleWatchQueryOperations,
|
|
138
|
+
config: {
|
|
139
|
+
title: "🔍 Data Query Toolkit",
|
|
140
|
+
description: "WOWOK data query toolkit — 9 query types covering local device data and on-chain blockchain data:\n\n"
|
|
141
|
+
+ "LOCAL (device-only, never on-chain):\n"
|
|
142
|
+
+ "1. local_mark_list — Query your LOCAL address book: maps human-readable names to blockchain addresses with optional tags. Use to resolve names→addresses or find addresses by tag.\n"
|
|
143
|
+
+ "2. account_list — Query your LOCAL accounts (addresses, messenger status, suspension state). Use filter.includePubkey=true to also include public keys. Use to discover available accounts before operations.\n"
|
|
144
|
+
+ "3. local_info_list — Query your LOCAL private info: sensitive data like delivery addresses, phone numbers, contacts stored ONLY on this device.\n"
|
|
145
|
+
+ "4. token_list — Query cached token metadata: symbol, decimals, icon URL, description for tokens previously fetched from chain. Use to look up token precision/decimals before performing token operations. Returns: TokenTypeInfo[] (type, alias, name, symbol, decimals, iconUrl).\n"
|
|
146
|
+
+ "5. account_balance — Query an account's coin balance OR Paginated coin objects. Use balance=true for total amount, or coin={cursor,limit} to list individual coin objects. Supports multi-token via token_type parameter.\n"
|
|
147
|
+
+ "6. local_names — Query local names by a list of addresses. For each address, returns the resolved account name (if exists) and local mark name (if exists). Returns: { account?, local_mark?, address }[].\n\n"
|
|
148
|
+
+ "ONCHAIN (blockchain):\n"
|
|
149
|
+
+ "7. onchain_personal_profile — Query any user's PUBLIC on-chain profile: social links, reputation (likes/dislikes), personal info records, voting history, referrer.\n"
|
|
150
|
+
+ "8. onchain_objects — Batch query on-chain WOWOK objects by ID or name: supports Service, Machine, Order, Treasury, Reward, Arb, Personal, Contact, and more.\n"
|
|
151
|
+
+ "9. onchain_received — Query objects (Payments, Tokens, NFTs) received by a specific object. Supports pagination and type filter.\n\n"
|
|
152
|
+
+ "For dynamic table data queries (pagination, table items), use the 'onchain_table_data' tool.\n\n"
|
|
153
|
+
+ "💡 Schema hint: Use schema_query with action='get' and name='query_toolkit' to retrieve the exact parameter schema with all query types and field definitions.",
|
|
154
|
+
inputSchema: WatchQueryOperationsSchema,
|
|
155
|
+
outputSchema: z.object({
|
|
156
|
+
result: z.unknown().describe("Query result — type depends on query_type. Local queries return arrays (MarkData[], AccountData[], InfoData[], TokenTypeInfo[]). account_balance returns { address, balance? | coin? }. Onchain queries return typed objects or undefined. onchain_received returns ReceivedBalance | ReceivedNormal[]."),
|
|
157
|
+
semantic: z.unknown().optional().describe("Business semantic summary for the query operation"),
|
|
158
|
+
}),
|
|
159
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
160
|
+
_meta: createToolMeta("query", ["watch", "query", "on-chain", "local", "events", "objects", "tokens", "balance", "profile"]),
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: "onchain_table_data",
|
|
165
|
+
handler: handleOnchainTableData,
|
|
166
|
+
config: {
|
|
167
|
+
title: "📊 Watch WoWok On-chain Table Data Query",
|
|
168
|
+
description: "Query dynamic table data of on-chain objects — supports paginated table queries and specific table item lookups. Each table item belongs to a parent object type and has a specific meaning:\n\n"
|
|
169
|
+
+ "1. onchain_table — Paginated query of ANY object's dynamic fields table (Parent: any object). Returns all entries with keys, types, and object IDs. Use to explore all sub-items of an object.\n"
|
|
170
|
+
+ "2. onchain_table_item_repository_data — Query a record from a Repository's on-chain key-value database (Parent: Repository). Key: name + entity (address or number). Returns the stored data record with typed value.\n"
|
|
171
|
+
+ "3. onchain_table_item_permission_perm — Query a permission entry from a Permission object's access control table (Parent: Permission). Key: user address or Guard ID. Returns the permission list (perm[]) granted to that user/guard.\n"
|
|
172
|
+
+ "4. onchain_table_item_entity_registrar — Query an entity's registration record from the GLOBAL EntityRegistrar (Parent: system EntityRegistrar). Key: user address. Returns registration info: description, referrer, records, mark_object.\n"
|
|
173
|
+
+ "5. onchain_table_item_entity_linker — Query community votes/endorsements for an entity from the GLOBAL EntityLinker (Parent: system EntityLinker). Key: entity address. Returns vote records (likes/dislikes) showing community trust.\n"
|
|
174
|
+
+ "6. onchain_table_item_reward_record — Query a reward claim record from a Reward object's distribution table (Parent: Reward). Key: recipient address. Returns claim history: guard used, total claimed, per-claim details.\n"
|
|
175
|
+
+ "7. onchain_table_item_demand_presenter — Query a demand submission from a Demand object's presenter table (Parent: Demand). Key: presenter address. Returns submission details: recommendation, service, feedback, acceptance score.\n"
|
|
176
|
+
+ "8. onchain_table_item_treasury_history — Query a payment record from a Treasury's history table (Parent: Treasury). Key: payment ID (address). Returns payment details: operation type, signer, amount, external guard.\n"
|
|
177
|
+
+ "9. onchain_table_item_machine_node — Query a workflow node definition from a Machine object's node table (Parent: Machine). Key: node name (string). Returns node configuration: pairs, forwards, guards, thresholds.\n"
|
|
178
|
+
+ "10. onchain_table_item_progress_history — Query a progress step record from a Progress object's history table (Parent: Progress). Key: sequence number (u64). Returns step details: node, next_node, session state, time.\n"
|
|
179
|
+
+ "11. onchain_table_item_address_mark — Query a PUBLIC on-chain name/tag mark from an AddressMark object's table (Parent: AddressMark). Key: address. Returns public labels: entity, name, tags[]. Unlike local marks, these are published on-chain.\n"
|
|
180
|
+
+ "12. onchain_table_item_generic — Query a generic table item from ANY object's dynamic fields (Parent: any object). Supports arbitrary key types (address, u64, string, object ID, etc.). Use for custom objects and general-purpose table lookups. Returns: ObjectBase | undefined.\n\n"
|
|
181
|
+
+ "💡 Schema hint: Use schema_query with action='get' and name='onchain_table_data' to retrieve the exact parameter schema with all table item types and field definitions.",
|
|
182
|
+
inputSchema: OnchainTableDataSchema,
|
|
183
|
+
outputSchema: OnchainTableDataResultSchema,
|
|
184
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
185
|
+
_meta: createToolMeta("table query", ["on-chain", "table", "dynamic fields", "pagination", "repository", "permission", "reward", "demand", "treasury", "machine", "progress"]),
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "onchain_events",
|
|
190
|
+
handler: handleOnchainEvents,
|
|
191
|
+
config: {
|
|
192
|
+
title: "📅 Watch WoWok On-chain Events",
|
|
193
|
+
description: "Watch on-chain WoWok events by type. Supports arbitration events, new order events, progress events, demand presentation events, demand feedback events, and new entity registration events. Use pagination cursor for fetching large result sets.\n\n💡 Schema hint: Use schema_query with action='get' and name='onchain_events' to retrieve the exact parameter schema with all event types and field definitions.",
|
|
194
|
+
inputSchema: OnchainEventsInputSchema,
|
|
195
|
+
outputSchema: OnchainEventsResultSchema,
|
|
196
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
197
|
+
_meta: createToolMeta("watch wowook events", ["events", "on-chain", "arbitration", "order", "progress", "demand", "entity"]),
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "wowok_buildin_info",
|
|
202
|
+
handler: handleWowokInfo,
|
|
203
|
+
config: {
|
|
204
|
+
title: "ℹ️ WoWok Build-in Information",
|
|
205
|
+
description: "Query WoWok protocol information: 'constants', 'built-in permissions', 'guard instructions', 'current network', 'value types', or 'mainnet bridge tokens'. For 'mainnet bridge tokens': returns cross-chain bridge tokens (ETH, WETH, WBTC, USDC, USDT) with each token's symbol, WOW-side type tag (wowTypeTag), EVM address, decimals, and description. The wowTypeTag (format {address}::{module}::{struct}) can be used directly as the `type_parameter` of Service / Treasury / Reward / Allocation objects to set their payment token — e.g. use USDT's wowTypeTag to create a Service that accepts USDT payments.",
|
|
206
|
+
inputSchema: ProtocolInfoQuerySchema,
|
|
207
|
+
outputSchema: ProtocolInfoResultSchema,
|
|
208
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
209
|
+
_meta: createToolMeta("WoWok info", ["build-in", "constants", "permissions", "guard", "network", "value-types", "bridge-tokens"]),
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: "schema_query",
|
|
214
|
+
handler: handleSchemaQuery,
|
|
215
|
+
config: {
|
|
216
|
+
title: "📋 Schema Query",
|
|
217
|
+
description: "Look up JSON Schemas for WoWok MCP tools and on-chain operations. " +
|
|
218
|
+
"This is the authoritative reference for exact parameter structures, types, and required fields. " +
|
|
219
|
+
"Always check the schema before calling an unfamiliar tool.\n\n" +
|
|
220
|
+
"Actions:\n" +
|
|
221
|
+
" 'list' - Show all available schemas (tools + on-chain operations). Start here to discover what exists.\n" +
|
|
222
|
+
" 'get' - Fetch the full input JSON Schema by name (e.g. 'onchain_operations'). Use with the 'name' param.\n" +
|
|
223
|
+
" 'get_output' - Fetch the output JSON Schema of a tool by name (e.g. 'onchain_operations'). Use with the 'name' param. Use this to understand a tool's return value structure.\n" +
|
|
224
|
+
" 'search' - Find schemas by keyword, matching name/title/description. Use with the 'query' param.\n" +
|
|
225
|
+
" 'list_operations' - Show only on-chain operation schemas (prefixed 'onchain_operations_'). Narrower than 'list'.",
|
|
226
|
+
inputSchema: SchemaQueryInputSchema,
|
|
227
|
+
outputSchema: SchemaQueryOutputSchema,
|
|
228
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
229
|
+
_meta: createToolMeta("schema", ["schema", "json-schema", "types", "structure", "validation", "reference"]),
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: "bridge_operation",
|
|
234
|
+
handler: handleBridgeOperations,
|
|
235
|
+
config: {
|
|
236
|
+
title: "🌉 Bridge - Cross-Chain Operations",
|
|
237
|
+
description: "🌉 Simplified cross-chain bridge between WOW and EVM (Ethereum mainnet). Only WOW mainnet provides cross-chain functionality.\n\n" +
|
|
238
|
+
"Key concepts (transparent to user):\n" +
|
|
239
|
+
" • Global single activeEvmAccount - auto-generated on first use, holds cross-chain assets.\n" +
|
|
240
|
+
" • WOW→EVM: assets auto-claim to activeEvmAccount; optional withdrawTo transfers to a final EVM address.\n" +
|
|
241
|
+
" • EVM→WOW: deposit from activeEvmAccount (balance checked first), assets arrive at the WOW account.\n\n" +
|
|
242
|
+
"Operations (operation_type):\n" +
|
|
243
|
+
" • cross_chain_wow_to_evm - WOW→EVM cross-chain (asset to activeEvmAccount or withdrawTo). [Requires WOW mainnet env]\n" +
|
|
244
|
+
" • cross_chain_evm_to_wow - EVM→WOW cross-chain (from activeEvmAccount to WOW account). [Requires WOW mainnet env]\n" +
|
|
245
|
+
" • withdraw - Withdraw from activeEvmAccount to another EVM address (non-cross-chain). [No env needed]\n" +
|
|
246
|
+
" • query_active_evm_account - Query activeEvmAccount address + balances (per chain or all). [No env needed]\n" +
|
|
247
|
+
" • query_supported_evm_chains - List supported EVM chains (enum/description/chainId/RPC health). [No env needed]\n" +
|
|
248
|
+
" • query_supported_tokens - List supported Bridge tokens per chain (WOW/EVM contract addresses, decimals, description). [No env needed]\n" +
|
|
249
|
+
" • query_transfer_list - Query transfer history list with optional filters (status/direction/token/limit). [No env needed]\n" +
|
|
250
|
+
" • query_transfer_status - Query single transfer detail by transferId. [No env needed]\n" +
|
|
251
|
+
" • manage_evm_rpc - Manage EVM RPC endpoints (list/add/remove/set/ping) to handle 429 rate limits. [No env needed]\n\n" +
|
|
252
|
+
"Token support follows SDK config (ETH/WETH/WBTC/USDC/USDT). WOW account names are supported (resolved via LocalMark).\n" +
|
|
253
|
+
"NOTE: Use schema_query (name='bridge_operation') to retrieve the exact JSON Schema with all field definitions before calling.",
|
|
254
|
+
inputSchema: BridgeOperationsSchema,
|
|
255
|
+
outputSchema: BridgeCallOutputSchema,
|
|
256
|
+
annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
257
|
+
_meta: createToolMeta("operation", ["bridge", "cross-chain", "evm", "ethereum", "wow", "transfer", "rpc"]),
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: "project_operation",
|
|
262
|
+
handler: handleProjectOperation,
|
|
263
|
+
config: {
|
|
264
|
+
title: "🗂️ Project - Namespace & Object Graph",
|
|
265
|
+
description: "Phase 2 project namespace service — manage and query the local object dependency graph (DAG) " +
|
|
266
|
+
"built on top of local_mark tags. No on-chain writes; all data comes from local marks tagged " +
|
|
267
|
+
"`project:<prefix>` (auto-injected by the ProjectService when enabled, default ON).\n\n" +
|
|
268
|
+
"Actions:\n" +
|
|
269
|
+
" • list_projects — List all discovered projects (grouped by `project:<prefix>` tag) with object counts.\n" +
|
|
270
|
+
" • list_objects — List objects in a project (requires `project` param).\n" +
|
|
271
|
+
" • shareable — List objects tagged `shareable:true` (cross-project reusable: common Permission, 3rd-party Arb).\n" +
|
|
272
|
+
" • dependencies — Trace forward dependencies of an object (BFS transitive closure + dangling refs).\n" +
|
|
273
|
+
" • referenced_by — Reverse query: who references this object?\n" +
|
|
274
|
+
" • pre_publish_check — Pre-publish sanity check for a service (dangling deps + cycles).\n" +
|
|
275
|
+
" • cross_project_refs — Find edges that cross project boundaries.\n" +
|
|
276
|
+
" • graph_stats — Graph statistics (node/edge counts, cycles, dangling deps).\n" +
|
|
277
|
+
" • save_graph — Save the in-memory graph to ~/.wowok/project-graph.json (persist across sessions).\n" +
|
|
278
|
+
" • load_graph — Load the graph from file (restore after restart).\n\n" +
|
|
279
|
+
"NOTE: The graph is in-memory by default. Use save_graph/load_graph for cross-session persistence " +
|
|
280
|
+
"(or toggle graph_persist via config_operation for auto-save). " +
|
|
281
|
+
"list_projects/shareable always query local_mark (persistent).\n\n" +
|
|
282
|
+
"💡 Schema hint: Use schema_query with action='get' and name='project_operation' to retrieve the exact parameter schema with all actions and field definitions.",
|
|
283
|
+
inputSchema: ProjectOperationInputSchema,
|
|
284
|
+
outputSchema: ProjectOperationOutputSchema,
|
|
285
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
286
|
+
_meta: createToolMeta("project", ["project", "namespace", "graph", "dag", "dependency", "reference", "organization"]),
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: "config_operation",
|
|
291
|
+
handler: handleConfigOperation,
|
|
292
|
+
config: {
|
|
293
|
+
title: "⚙️ Config - Runtime Service Toggles",
|
|
294
|
+
description: "Phase 2 runtime configuration — toggle Phase 2 services on/off at runtime WITHOUT restarting the MCP server. " +
|
|
295
|
+
"This is the session-level switch mechanism: AI can toggle based on user conversation context, or users can " +
|
|
296
|
+
"directly control which Phase 2 features are active.\n\n" +
|
|
297
|
+
"Actions:\n" +
|
|
298
|
+
" • list — List all services with current state + reminders.\n" +
|
|
299
|
+
" • toggle — Toggle a service on/off (requires `service` param). Returns reminder text.\n" +
|
|
300
|
+
" • enable — Enable a service (requires `service` param).\n" +
|
|
301
|
+
" • disable — Disable a service (requires `service` param).\n" +
|
|
302
|
+
" • reset — Reset a service to its default (requires `service` param).\n" +
|
|
303
|
+
" • info — Get detailed info about a service (requires `service` param).\n\n" +
|
|
304
|
+
"Services:\n" +
|
|
305
|
+
" • confirm_gate — Safety Confirmation Gate (default ON)\n" +
|
|
306
|
+
" • project_service — Project Namespace + Dependency Graph (default ON)\n" +
|
|
307
|
+
" • harness — L4 Verify/Recover Loop (default OFF)\n" +
|
|
308
|
+
" • graph_persist — Graph Persistence to File (default OFF)\n" +
|
|
309
|
+
" • semantic_rich — Semantic Layer Enrichment Reminder (default ON)\n" +
|
|
310
|
+
" • experience_layer — Real-time Experience Layer (Phase 2 Topic 2, default ON)\n" +
|
|
311
|
+
" • customer_intelligence — Buyer Intelligence / Risk & Preference Alerts (Phase 3 C-3, default ON)\n" +
|
|
312
|
+
" • order_monitor — In-progress Order Monitoring (Phase 3 C-3.2, default OFF)\n" +
|
|
313
|
+
" • industry_evolution — Industry Specialization Evolution Flywheel (Phase 4, default ON)\n\n" +
|
|
314
|
+
"NOTE: Toggles persist for the MCP process lifetime. Set WOWOK_RUNTIME_CONFIG_PERSIST=1 " +
|
|
315
|
+
"to persist across sessions to ~/.wowok/runtime-config.json.\n\n" +
|
|
316
|
+
"💡 Schema hint: Use schema_query with action='get' and name='config_operation' to retrieve the exact parameter schema with all actions and field definitions.",
|
|
317
|
+
inputSchema: ConfigOperationInputSchema,
|
|
318
|
+
outputSchema: ConfigOperationOutputSchema,
|
|
319
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
320
|
+
_meta: createToolMeta("config", ["config", "toggle", "service", "runtime", "switch", "enable", "disable"]),
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
name: "trust_score",
|
|
325
|
+
handler: handleTrustScore,
|
|
326
|
+
config: {
|
|
327
|
+
title: "🛡️ Trust Score - Service Risk & Trust Assessment",
|
|
328
|
+
description: "Proactively query the trust score and risk assessment of a Service object. " +
|
|
329
|
+
"This is the standalone query form of the trust_score field that is otherwise only " +
|
|
330
|
+
"passively injected into onchain_operations semantic output.\n\n" +
|
|
331
|
+
"Returns:\n" +
|
|
332
|
+
" • trust_score (0-100, 5 dimensions: arbitration/reviews/fulfillment/fund_safety/transparency)\n" +
|
|
333
|
+
" • risk_score (4 dimensions: workflow/fund/trust/behavior, 100-point) when depth >= 'evaluate'\n" +
|
|
334
|
+
" • info_puzzle completeness + gaps summary\n" +
|
|
335
|
+
" • service_basics snapshot (published/paused/sales/guards/arbitrations)\n\n" +
|
|
336
|
+
"Use this tool when the user asks 'is this service trustworthy?', 'should I buy from this merchant?', " +
|
|
337
|
+
"'what's the risk of ordering this service?', or any explicit trust/risk inquiry about a Service.\n\n" +
|
|
338
|
+
"Parameters:\n" +
|
|
339
|
+
" • service (required) — Service object ID or local_mark name.\n" +
|
|
340
|
+
" • order_amount (optional) — Order amount in smallest token unit (e.g. 2000000000 for 2 WOW). " +
|
|
341
|
+
"Defaults to the service's first active sale price.\n" +
|
|
342
|
+
" • depth (optional, default 'evaluate') — 'browse' (trust score only), 'evaluate' (+ risk assessment), " +
|
|
343
|
+
"'preorder' (most thorough, includes market context dimension).\n\n" +
|
|
344
|
+
"💡 Schema hint: Use schema_query with action='get' and name='trust_score' to retrieve the exact parameter schema.",
|
|
345
|
+
inputSchema: TrustScoreInputSchema,
|
|
346
|
+
outputSchema: TrustScoreOutputSchema,
|
|
347
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
348
|
+
_meta: createToolMeta("trust", ["trust", "score", "risk", "service", "merchant", "reputation", "safety", "evaluate"]),
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
];
|
|
352
|
+
export const TOOL_REGISTRY_MAP = new Map(TOOL_REGISTRY.map(t => [t.name, t]));
|
|
353
|
+
export async function dispatchToolCall(name, args, options) {
|
|
354
|
+
const entry = TOOL_REGISTRY_MAP.get(name);
|
|
355
|
+
if (!entry) {
|
|
356
|
+
throw new Error(`Unknown tool: ${name}. Available: ${TOOL_REGISTRY.map(t => t.name).join(", ")}`);
|
|
357
|
+
}
|
|
358
|
+
if (entry.applyRules && !options?.skipRules) {
|
|
359
|
+
const ruleResult = entry.applyRules(args);
|
|
360
|
+
if (ruleResult)
|
|
361
|
+
return ruleResult;
|
|
362
|
+
}
|
|
363
|
+
const timeoutMs = entry.timeoutMs ?? 60000;
|
|
364
|
+
const wrapped = wrapHandlerWithErrorShape(entry.handler, timeoutMs, name, entry.errorShapeBuilder);
|
|
365
|
+
return wrapped(args);
|
|
366
|
+
}
|
|
367
|
+
function zodToJsonSchemaSafe(schema, name) {
|
|
368
|
+
try {
|
|
369
|
+
const jsonSchema = zodToJsonSchema(schema, {
|
|
370
|
+
name,
|
|
371
|
+
$refStrategy: "root",
|
|
372
|
+
basePath: ["#"],
|
|
373
|
+
effectStrategy: "input",
|
|
374
|
+
});
|
|
375
|
+
if (jsonSchema && typeof jsonSchema === "object" && !Array.isArray(jsonSchema)) {
|
|
376
|
+
const { $schema: _omit, ...rest } = jsonSchema;
|
|
377
|
+
return rest;
|
|
378
|
+
}
|
|
379
|
+
return { type: "object" };
|
|
380
|
+
}
|
|
381
|
+
catch {
|
|
382
|
+
return { type: "object", additionalProperties: true };
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
function resolveSchemaRefs(schema) {
|
|
386
|
+
const STRIP_KEYS = new Set(["definitions", "$schema", "$id"]);
|
|
387
|
+
function navigatePointer(path) {
|
|
388
|
+
if (!path.startsWith("#/"))
|
|
389
|
+
return null;
|
|
390
|
+
const parts = path.slice(2).split("/");
|
|
391
|
+
let target = schema;
|
|
392
|
+
for (const part of parts) {
|
|
393
|
+
if (target == null || typeof target !== "object" || Array.isArray(target)) {
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
target = target[part];
|
|
397
|
+
}
|
|
398
|
+
return target;
|
|
399
|
+
}
|
|
400
|
+
function resolveNode(node, visiting) {
|
|
401
|
+
if (!node || typeof node !== "object") {
|
|
402
|
+
return node;
|
|
403
|
+
}
|
|
404
|
+
if (Array.isArray(node)) {
|
|
405
|
+
return node.map((item) => resolveNode(item, visiting));
|
|
406
|
+
}
|
|
407
|
+
const obj = node;
|
|
408
|
+
if (typeof obj.$ref === "string") {
|
|
409
|
+
const ref = obj.$ref;
|
|
410
|
+
if (visiting.has(ref)) {
|
|
411
|
+
return { type: "object", additionalProperties: true };
|
|
412
|
+
}
|
|
413
|
+
const target = navigatePointer(ref);
|
|
414
|
+
if (target && typeof target === "object" && !Array.isArray(target)) {
|
|
415
|
+
const newVisiting = new Set(visiting);
|
|
416
|
+
newVisiting.add(ref);
|
|
417
|
+
const resolved = resolveNode(target, newVisiting);
|
|
418
|
+
const siblings = {};
|
|
419
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
420
|
+
if (k !== "$ref" && !STRIP_KEYS.has(k))
|
|
421
|
+
siblings[k] = v;
|
|
422
|
+
}
|
|
423
|
+
return {
|
|
424
|
+
...resolved,
|
|
425
|
+
...siblings,
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
return { type: "object", additionalProperties: true };
|
|
429
|
+
}
|
|
430
|
+
const result = {};
|
|
431
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
432
|
+
if (STRIP_KEYS.has(k))
|
|
433
|
+
continue;
|
|
434
|
+
result[k] = resolveNode(v, visiting);
|
|
435
|
+
}
|
|
436
|
+
return result;
|
|
437
|
+
}
|
|
438
|
+
return resolveNode(schema, new Set());
|
|
439
|
+
}
|
|
440
|
+
function loadPreGeneratedSchema(toolName) {
|
|
441
|
+
const cached = preGeneratedSchemaCache.get(toolName);
|
|
442
|
+
if (cached)
|
|
443
|
+
return cached;
|
|
444
|
+
for (const dir of SCHEMA_DIR_CANDIDATES) {
|
|
445
|
+
try {
|
|
446
|
+
const schemaPath = join(dir, `${toolName}.schema.json`);
|
|
447
|
+
const raw = readFileSync(schemaPath, "utf-8");
|
|
448
|
+
const schema = JSON.parse(raw);
|
|
449
|
+
const resolved = resolveSchemaRefs(schema);
|
|
450
|
+
preGeneratedSchemaCache.set(toolName, resolved);
|
|
451
|
+
return resolved;
|
|
452
|
+
}
|
|
453
|
+
catch {
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
return null;
|
|
457
|
+
}
|
|
458
|
+
export function listTools() {
|
|
459
|
+
return TOOL_REGISTRY.map(entry => {
|
|
460
|
+
const preGenerated = loadPreGeneratedSchema(entry.name);
|
|
461
|
+
const inputSchema = preGenerated ?? zodToJsonSchemaSafe(entry.config.inputSchema, entry.name);
|
|
462
|
+
return {
|
|
463
|
+
name: entry.name,
|
|
464
|
+
title: entry.config.title,
|
|
465
|
+
description: entry.config.description,
|
|
466
|
+
inputSchema,
|
|
467
|
+
};
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
export function registerAllTools(server) {
|
|
471
|
+
for (const entry of TOOL_REGISTRY) {
|
|
472
|
+
const timeoutMs = entry.timeoutMs ?? 60000;
|
|
473
|
+
const handlerWithRules = async (args) => {
|
|
474
|
+
return dispatchToolCall(entry.name, args);
|
|
475
|
+
};
|
|
476
|
+
const wrapped = wrapHandlerWithErrorShape(handlerWithRules, timeoutMs, entry.name, entry.errorShapeBuilder);
|
|
477
|
+
server.registerTool(entry.name, entry.config, withTelemetry(entry.name, wrapped));
|
|
478
|
+
}
|
|
479
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OnchainOperationsSchema, strictParse, getEnvConfig, } from "../schema/index.js";
|
|
2
|
+
import { buildPendingConfirmation, buildConstraintError } from "./shared.js";
|
|
3
|
+
import { validateOperation, hasBlockingViolations, } from "../knowledge/index.js";
|
|
4
|
+
export function applyOnchainRules(args) {
|
|
5
|
+
let validated;
|
|
6
|
+
try {
|
|
7
|
+
validated = strictParse(OnchainOperationsSchema, args, "onchain_operations input");
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const env = getEnvConfig(validated.env);
|
|
13
|
+
const gateResult = buildPendingConfirmation(validated.operation_type, validated.data, env);
|
|
14
|
+
if (gateResult.structuredContent) {
|
|
15
|
+
return gateResult;
|
|
16
|
+
}
|
|
17
|
+
const constraintViolations = validateOperation(validated.operation_type, validated.data);
|
|
18
|
+
if (hasBlockingViolations(constraintViolations)) {
|
|
19
|
+
return buildConstraintError(validated.operation_type, constraintViolations);
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { validateOperation, hasBlockingViolations, getWarningViolations, type ConstraintViolation } from "../knowledge/index.js";
|
|
2
|
+
import { classifyError, type SemanticContext } from "../schema/call/semantic.js";
|
|
3
|
+
export declare function withHarness(base: SemanticContext, operation: string, intent: string): SemanticContext;
|
|
4
|
+
export interface LocalHandlerConfig {
|
|
5
|
+
schema: import("zod").ZodTypeAny;
|
|
6
|
+
operationFn: (input: any) => Promise<any>;
|
|
7
|
+
parseLabel: string;
|
|
8
|
+
buildContext: (validated: any) => SemanticContext;
|
|
9
|
+
}
|
|
10
|
+
export declare function wrapLocalHandler(config: LocalHandlerConfig): (args: any) => Promise<{
|
|
11
|
+
content: {
|
|
12
|
+
type: "text";
|
|
13
|
+
text: string;
|
|
14
|
+
}[];
|
|
15
|
+
structuredContent: {
|
|
16
|
+
result: any;
|
|
17
|
+
semantic: any;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
export declare function buildPendingConfirmation(operation_type: string, data: any, env: any): {
|
|
21
|
+
content: any[];
|
|
22
|
+
structuredContent: any;
|
|
23
|
+
};
|
|
24
|
+
export declare function buildConstraintError(operation_type: string, violations: ConstraintViolation[]): {
|
|
25
|
+
content: any[];
|
|
26
|
+
structuredContent: any;
|
|
27
|
+
};
|
|
28
|
+
export declare function buildClassifiedErrorResult(base: Record<string, any>, error: string, classified: ReturnType<typeof classifyError>): Record<string, any>;
|
|
29
|
+
export { validateOperation, hasBlockingViolations, getWarningViolations, type ConstraintViolation, };
|