@wowok/agent-mcp 2.4.3 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/runtime.d.ts +4 -0
- package/dist/config/runtime.js +29 -5
- package/dist/harness/auto-escalation.d.ts +27 -0
- package/dist/harness/auto-escalation.js +68 -0
- package/dist/index.js +21 -0
- package/dist/knowledge/allocation-confirm.d.ts +115 -0
- package/dist/knowledge/allocation-confirm.js +534 -0
- package/dist/knowledge/allocation-context.d.ts +58 -0
- package/dist/knowledge/allocation-context.js +249 -0
- package/dist/knowledge/allocation-ledger.d.ts +67 -0
- package/dist/knowledge/allocation-ledger.js +463 -0
- package/dist/knowledge/allocation-puzzle.d.ts +135 -0
- package/dist/knowledge/allocation-puzzle.js +298 -0
- package/dist/knowledge/allocation-risk.d.ts +78 -0
- package/dist/knowledge/allocation-risk.js +568 -0
- package/dist/knowledge/allocation-templates.d.ts +38 -0
- package/dist/knowledge/allocation-templates.js +970 -0
- package/dist/knowledge/allocation-translation.d.ts +72 -0
- package/dist/knowledge/allocation-translation.js +585 -0
- package/dist/knowledge/arb-risk.d.ts +37 -0
- package/dist/knowledge/arb-risk.js +210 -0
- package/dist/knowledge/arbitration-confirm.d.ts +135 -0
- package/dist/knowledge/arbitration-confirm.js +559 -0
- package/dist/knowledge/arbitration-context.d.ts +81 -0
- package/dist/knowledge/arbitration-context.js +505 -0
- package/dist/knowledge/arbitration-ledger.d.ts +62 -0
- package/dist/knowledge/arbitration-ledger.js +521 -0
- package/dist/knowledge/arbitration-puzzle.d.ts +84 -0
- package/dist/knowledge/arbitration-puzzle.js +304 -0
- package/dist/knowledge/arbitration-risk.d.ts +112 -0
- package/dist/knowledge/arbitration-risk.js +433 -0
- package/dist/knowledge/arbitration-templates.d.ts +38 -0
- package/dist/knowledge/arbitration-templates.js +276 -0
- package/dist/knowledge/arbitration-translation.d.ts +91 -0
- package/dist/knowledge/arbitration-translation.js +487 -0
- package/dist/knowledge/bridge-risk.d.ts +36 -0
- package/dist/knowledge/bridge-risk.js +263 -0
- package/dist/knowledge/contact-risk.d.ts +32 -0
- package/dist/knowledge/contact-risk.js +200 -0
- package/dist/knowledge/demand-confirm.d.ts +32 -0
- package/dist/knowledge/demand-confirm.js +206 -0
- package/dist/knowledge/demand-risk.d.ts +30 -0
- package/dist/knowledge/demand-risk.js +240 -0
- package/dist/knowledge/demand-translation.d.ts +55 -0
- package/dist/knowledge/demand-translation.js +354 -0
- package/dist/knowledge/deployment-scanner.d.ts +63 -0
- package/dist/knowledge/deployment-scanner.js +762 -0
- package/dist/knowledge/examples-scanner-cli.d.ts +1 -0
- package/dist/knowledge/examples-scanner-cli.js +26 -0
- package/dist/knowledge/examples-scanner.d.ts +121 -0
- package/dist/knowledge/examples-scanner.js +825 -0
- package/dist/knowledge/flywheel-loop.d.ts +3 -0
- package/dist/knowledge/flywheel-loop.js +32 -3
- package/dist/knowledge/glossary.js +3 -1
- package/dist/knowledge/guard-confirm.d.ts +86 -0
- package/dist/knowledge/guard-confirm.js +406 -0
- package/dist/knowledge/guard-context.d.ts +56 -0
- package/dist/knowledge/guard-context.js +287 -0
- package/dist/knowledge/guard-design-patterns.d.ts +37 -0
- package/dist/knowledge/guard-design-patterns.js +257 -0
- package/dist/knowledge/guard-puzzle.js +3 -2
- package/dist/knowledge/guard-risk.d.ts +1 -1
- package/dist/knowledge/guard-risk.js +12 -14
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +6 -5
- package/dist/knowledge/index.d.ts +342 -0
- package/dist/knowledge/index.js +344 -0
- package/dist/knowledge/machine-confirm.d.ts +102 -0
- package/dist/knowledge/machine-confirm.js +559 -0
- package/dist/knowledge/machine-context.d.ts +160 -0
- package/dist/knowledge/machine-context.js +812 -0
- package/dist/knowledge/machine-ledger.d.ts +41 -0
- package/dist/knowledge/machine-ledger.js +315 -0
- package/dist/knowledge/machine-puzzle.d.ts +206 -0
- package/dist/knowledge/machine-puzzle.js +494 -0
- package/dist/knowledge/machine-risk.d.ts +75 -0
- package/dist/knowledge/machine-risk.js +644 -0
- package/dist/knowledge/machine-templates.d.ts +92 -0
- package/dist/knowledge/machine-templates.js +1592 -0
- package/dist/knowledge/machine-topology.d.ts +57 -0
- package/dist/knowledge/machine-topology.js +234 -0
- package/dist/knowledge/machine-translation.d.ts +96 -0
- package/dist/knowledge/machine-translation.js +513 -0
- package/dist/knowledge/mcp-schema-audit-cli.d.ts +1 -0
- package/dist/knowledge/mcp-schema-audit-cli.js +45 -0
- package/dist/knowledge/mcp-schema-audit.d.ts +90 -0
- package/dist/knowledge/mcp-schema-audit.js +772 -0
- package/dist/knowledge/onchain-constants.d.ts +4 -0
- package/dist/knowledge/onchain-constants.js +35 -0
- package/dist/knowledge/order-confirm.d.ts +115 -0
- package/dist/knowledge/order-confirm.js +573 -0
- package/dist/knowledge/order-context.d.ts +66 -0
- package/dist/knowledge/order-context.js +390 -0
- package/dist/knowledge/order-ledger.d.ts +69 -0
- package/dist/knowledge/order-ledger.js +341 -0
- package/dist/knowledge/order-puzzle.d.ts +159 -0
- package/dist/knowledge/order-puzzle.js +255 -0
- package/dist/knowledge/order-risk.d.ts +66 -0
- package/dist/knowledge/order-risk.js +653 -0
- package/dist/knowledge/order-templates.d.ts +50 -0
- package/dist/knowledge/order-templates.js +368 -0
- package/dist/knowledge/order-translation.d.ts +78 -0
- package/dist/knowledge/order-translation.js +550 -0
- package/dist/knowledge/passport-confirm.d.ts +130 -0
- package/dist/knowledge/passport-confirm.js +531 -0
- package/dist/knowledge/passport-context.d.ts +59 -0
- package/dist/knowledge/passport-context.js +306 -0
- package/dist/knowledge/passport-ledger.d.ts +48 -0
- package/dist/knowledge/passport-ledger.js +282 -0
- package/dist/knowledge/passport-puzzle.d.ts +108 -0
- package/dist/knowledge/passport-puzzle.js +333 -0
- package/dist/knowledge/passport-risk.d.ts +70 -0
- package/dist/knowledge/passport-risk.js +450 -0
- package/dist/knowledge/passport-templates.d.ts +40 -0
- package/dist/knowledge/passport-templates.js +568 -0
- package/dist/knowledge/passport-translation.d.ts +68 -0
- package/dist/knowledge/passport-translation.js +516 -0
- package/dist/knowledge/payment-risk.d.ts +33 -0
- package/dist/knowledge/payment-risk.js +182 -0
- package/dist/knowledge/permission-confirm.d.ts +110 -0
- package/dist/knowledge/permission-confirm.js +426 -0
- package/dist/knowledge/permission-context.d.ts +58 -0
- package/dist/knowledge/permission-context.js +224 -0
- package/dist/knowledge/permission-ledger.d.ts +38 -0
- package/dist/knowledge/permission-ledger.js +403 -0
- package/dist/knowledge/permission-puzzle.d.ts +122 -0
- package/dist/knowledge/permission-puzzle.js +173 -0
- package/dist/knowledge/permission-risk.d.ts +76 -0
- package/dist/knowledge/permission-risk.js +411 -0
- package/dist/knowledge/permission-templates.d.ts +38 -0
- package/dist/knowledge/permission-templates.js +234 -0
- package/dist/knowledge/permission-translation.d.ts +57 -0
- package/dist/knowledge/permission-translation.js +350 -0
- package/dist/knowledge/personal-risk.d.ts +36 -0
- package/dist/knowledge/personal-risk.js +212 -0
- package/dist/knowledge/progress-confirm.d.ts +108 -0
- package/dist/knowledge/progress-confirm.js +456 -0
- package/dist/knowledge/progress-context.d.ts +123 -0
- package/dist/knowledge/progress-context.js +452 -0
- package/dist/knowledge/progress-ledger.d.ts +63 -0
- package/dist/knowledge/progress-ledger.js +327 -0
- package/dist/knowledge/progress-puzzle.d.ts +82 -0
- package/dist/knowledge/progress-puzzle.js +219 -0
- package/dist/knowledge/progress-risk.d.ts +74 -0
- package/dist/knowledge/progress-risk.js +461 -0
- package/dist/knowledge/progress-templates.d.ts +38 -0
- package/dist/knowledge/progress-templates.js +228 -0
- package/dist/knowledge/progress-translation.d.ts +52 -0
- package/dist/knowledge/progress-translation.js +401 -0
- package/dist/knowledge/proof-confirm.d.ts +31 -0
- package/dist/knowledge/proof-confirm.js +187 -0
- package/dist/knowledge/proof-risk.d.ts +33 -0
- package/dist/knowledge/proof-risk.js +207 -0
- package/dist/knowledge/proof-translation.d.ts +52 -0
- package/dist/knowledge/proof-translation.js +283 -0
- package/dist/knowledge/registrar-risk.d.ts +34 -0
- package/dist/knowledge/registrar-risk.js +217 -0
- package/dist/knowledge/repository-confirm.d.ts +36 -0
- package/dist/knowledge/repository-confirm.js +242 -0
- package/dist/knowledge/repository-risk.d.ts +40 -0
- package/dist/knowledge/repository-risk.js +312 -0
- package/dist/knowledge/repository-translation.d.ts +58 -0
- package/dist/knowledge/repository-translation.js +422 -0
- package/dist/knowledge/resource-risk.d.ts +32 -0
- package/dist/knowledge/resource-risk.js +157 -0
- package/dist/knowledge/reward-confirm.d.ts +113 -0
- package/dist/knowledge/reward-confirm.js +496 -0
- package/dist/knowledge/reward-context.d.ts +127 -0
- package/dist/knowledge/reward-context.js +504 -0
- package/dist/knowledge/reward-ledger.d.ts +96 -0
- package/dist/knowledge/reward-ledger.js +502 -0
- package/dist/knowledge/reward-puzzle.d.ts +97 -0
- package/dist/knowledge/reward-puzzle.js +288 -0
- package/dist/knowledge/reward-risk.d.ts +84 -0
- package/dist/knowledge/reward-risk.js +545 -0
- package/dist/knowledge/reward-translation.d.ts +58 -0
- package/dist/knowledge/reward-translation.js +501 -0
- package/dist/knowledge/safety-rules.js +11 -3
- package/dist/knowledge/scenario-modes.d.ts +53 -0
- package/dist/knowledge/scenario-modes.js +302 -0
- package/dist/knowledge/service-confirm.d.ts +152 -0
- package/dist/knowledge/service-confirm.js +699 -0
- package/dist/knowledge/service-context.d.ts +66 -0
- package/dist/knowledge/service-context.js +403 -0
- package/dist/knowledge/service-ledger.d.ts +71 -0
- package/dist/knowledge/service-ledger.js +609 -0
- package/dist/knowledge/service-puzzle.d.ts +158 -0
- package/dist/knowledge/service-puzzle.js +236 -0
- package/dist/knowledge/service-risk.d.ts +108 -0
- package/dist/knowledge/service-risk.js +615 -0
- package/dist/knowledge/service-templates.d.ts +39 -0
- package/dist/knowledge/service-templates.js +418 -0
- package/dist/knowledge/service-translation.d.ts +103 -0
- package/dist/knowledge/service-translation.js +622 -0
- package/dist/knowledge/tools-reference.d.ts +17 -0
- package/dist/knowledge/tools-reference.js +151 -0
- package/dist/knowledge/treasury-confirm.d.ts +133 -0
- package/dist/knowledge/treasury-confirm.js +512 -0
- package/dist/knowledge/treasury-context.d.ts +64 -0
- package/dist/knowledge/treasury-context.js +363 -0
- package/dist/knowledge/treasury-ledger.d.ts +42 -0
- package/dist/knowledge/treasury-ledger.js +300 -0
- package/dist/knowledge/treasury-puzzle.d.ts +163 -0
- package/dist/knowledge/treasury-puzzle.js +216 -0
- package/dist/knowledge/treasury-risk.d.ts +86 -0
- package/dist/knowledge/treasury-risk.js +440 -0
- package/dist/knowledge/treasury-templates.d.ts +38 -0
- package/dist/knowledge/treasury-templates.js +316 -0
- package/dist/knowledge/treasury-translation.d.ts +78 -0
- package/dist/knowledge/treasury-translation.js +498 -0
- package/dist/knowledge/util-risk.d.ts +30 -0
- package/dist/knowledge/util-risk.js +135 -0
- package/dist/project/business-puzzle.d.ts +47 -0
- package/dist/project/business-puzzle.js +372 -0
- package/dist/project/deployment-doc.d.ts +61 -0
- package/dist/project/deployment-doc.js +432 -0
- package/dist/project/risk-aggregator.d.ts +50 -0
- package/dist/project/risk-aggregator.js +280 -0
- package/dist/project/substep-trace.d.ts +130 -0
- package/dist/project/substep-trace.js +332 -0
- package/dist/schema/call/allocation.d.ts +34 -34
- package/dist/schema/call/arbitration.d.ts +141 -141
- package/dist/schema/call/base.d.ts +386 -386
- package/dist/schema/call/base.js +3 -3
- package/dist/schema/call/bridge-handler.d.ts +5 -2
- package/dist/schema/call/bridge.d.ts +159 -159
- package/dist/schema/call/contact.d.ts +110 -110
- package/dist/schema/call/demand.d.ts +76 -76
- package/dist/schema/call/handler.d.ts +2 -3
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +58 -58
- package/dist/schema/call/order.d.ts +98 -110
- package/dist/schema/call/permission-handler.d.ts +5 -0
- package/dist/schema/call/permission-handler.js +54 -0
- package/dist/schema/call/permission.d.ts +108 -108
- package/dist/schema/call/personal.d.ts +14 -14
- package/dist/schema/call/progress.d.ts +57 -72
- package/dist/schema/call/progress.js +7 -4
- package/dist/schema/call/proof.d.ts +18 -18
- package/dist/schema/call/proof.js +12 -7
- package/dist/schema/call/repository.d.ts +154 -154
- package/dist/schema/call/reward.d.ts +55 -55
- package/dist/schema/call/service.d.ts +231 -231
- package/dist/schema/call/treasury.d.ts +93 -93
- package/dist/schema/config/index.d.ts +178 -5
- package/dist/schema/config/index.js +52 -1
- package/dist/schema/local/index.d.ts +3554 -836
- package/dist/schema/local/index.js +2 -1
- package/dist/schema/messenger/index.d.ts +162 -162
- package/dist/schema/operations.d.ts +1058 -1074
- package/dist/schema/operations.js +7 -1
- package/dist/schema/project/index.d.ts +1392 -6
- package/dist/schema/project/index.js +426 -2
- package/dist/schema/query/index.d.ts +672 -672
- package/dist/schema/schema-query/index.d.ts +23 -3
- package/dist/schema/schema-query/index.js +13 -2
- package/dist/schema/sync-layer4.d.ts +21 -0
- package/dist/schema/sync-layer4.js +261 -0
- package/dist/schema/trust/index.d.ts +26 -26
- package/dist/schemas/account_operation.output.json +718 -0
- package/dist/schemas/config_operation.output.json +173 -0
- package/dist/schemas/index.json +9 -1
- package/dist/schemas/local_info_operation.output.json +718 -0
- package/dist/schemas/local_mark_operation.output.json +718 -0
- package/dist/schemas/onchain_operations.output.json +3 -2
- package/dist/schemas/onchain_operations.schema.json +1802 -313
- package/dist/schemas/onchain_operations_allocation.schema.json +2 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +2 -1
- package/dist/schemas/onchain_operations_contact.schema.json +2 -1
- package/dist/schemas/onchain_operations_demand.schema.json +2 -1
- package/dist/schemas/onchain_operations_gen_passport.schema.json +878 -872
- package/dist/schemas/onchain_operations_gen_proof.schema.json +273 -0
- package/dist/schemas/onchain_operations_guard.schema.json +584 -70
- package/dist/schemas/onchain_operations_machine.schema.json +2 -1
- package/dist/schemas/onchain_operations_order.schema.json +13 -9
- package/dist/schemas/onchain_operations_payment.schema.json +2 -1
- package/dist/schemas/onchain_operations_permission.schema.json +2 -1
- package/dist/schemas/onchain_operations_personal.schema.json +2 -1
- package/dist/schemas/onchain_operations_progress.schema.json +14 -10
- package/dist/schemas/onchain_operations_proof.schema.json +699 -0
- package/dist/schemas/onchain_operations_repository.schema.json +2 -1
- package/dist/schemas/onchain_operations_reward.schema.json +2 -1
- package/dist/schemas/onchain_operations_service.schema.json +2 -1
- package/dist/schemas/onchain_operations_treasury.schema.json +2 -1
- package/dist/schemas/onchain_table_data.schema.json +32 -1
- package/dist/schemas/project_operation.output.json +879 -0
- package/dist/schemas/project_operation.schema.json +473 -2
- package/dist/schemas/query_toolkit.output.json +14906 -6
- package/dist/schemas/schema_query.output.json +38 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/tools/handlers/config.d.ts +1 -1
- package/dist/tools/handlers/config.js +21 -18
- package/dist/tools/handlers/file-export.d.ts +2 -2
- package/dist/tools/handlers/local.d.ts +3 -30
- package/dist/tools/handlers/local.js +14 -3
- package/dist/tools/handlers/messenger.d.ts +1 -1
- package/dist/tools/handlers/messenger.js +2 -1
- package/dist/tools/handlers/onchain.d.ts +1 -1
- package/dist/tools/handlers/onchain.js +24 -22
- package/dist/tools/handlers/project.d.ts +1 -1
- package/dist/tools/handlers/project.js +258 -18
- package/dist/tools/handlers/query.d.ts +4 -4
- package/dist/tools/handlers/schema-query.d.ts +1 -1
- package/dist/tools/handlers/schema-query.js +21 -20
- package/dist/tools/handlers/trust.d.ts +1 -1
- package/dist/tools/handlers/trust.js +2 -2
- package/dist/tools/handlers/wip.d.ts +1 -1
- package/dist/tools/handlers/wip.js +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +55 -8
- package/dist/tools/rules-hook.d.ts +1 -1
- package/dist/tools/rules-hook.js +3 -2
- package/dist/tools/shared.d.ts +13 -22
- package/dist/tools/types.d.ts +5 -5
- package/dist/tools/wrap.d.ts +10 -2
- package/dist/tools/wrap.js +212 -0
- package/package.json +3 -3
|
@@ -17,7 +17,43 @@
|
|
|
17
17
|
"description": "The action that was performed"
|
|
18
18
|
},
|
|
19
19
|
"data": {
|
|
20
|
-
"
|
|
20
|
+
"anyOf": [
|
|
21
|
+
{
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"properties": {
|
|
26
|
+
"name": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "Schema/tool identifier (e.g. 'onchain_operations')."
|
|
29
|
+
},
|
|
30
|
+
"title": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "Human-readable title, if known."
|
|
33
|
+
},
|
|
34
|
+
"description": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Short description, if known."
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"required": [
|
|
40
|
+
"name"
|
|
41
|
+
],
|
|
42
|
+
"additionalProperties": false
|
|
43
|
+
},
|
|
44
|
+
"description": "List of schema summaries (list/search/list_operations)."
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": {},
|
|
49
|
+
"description": "JSON Schema object (get/get_output)."
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "null",
|
|
53
|
+
"description": "No data — lookup failed or returned nothing."
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"description": "Response data — array of schema summaries for list-like actions, JSON Schema object for get/get_output, null on failure."
|
|
21
57
|
},
|
|
22
58
|
"message": {
|
|
23
59
|
"type": "string",
|
|
@@ -34,6 +70,7 @@
|
|
|
34
70
|
"required": [
|
|
35
71
|
"success",
|
|
36
72
|
"action",
|
|
73
|
+
"data",
|
|
37
74
|
"message"
|
|
38
75
|
],
|
|
39
76
|
"additionalProperties": false
|
|
@@ -15,5 +15,5 @@ export declare function isTelemetryEnabled(): boolean;
|
|
|
15
15
|
export declare function captureTelemetry(toolName: string, structuredContent: CallOutput | undefined, durationMs: number, operationTypeHint?: string): Promise<void>;
|
|
16
16
|
export declare function captureTelemetryError(toolName: string, error: any, durationMs: number, operationTypeHint?: string): Promise<void>;
|
|
17
17
|
export declare function withTelemetry<TArgs, TOutput extends {
|
|
18
|
-
structuredContent?:
|
|
18
|
+
structuredContent?: unknown;
|
|
19
19
|
}>(toolName: string, handler: (args: TArgs) => Promise<TOutput>): (args: TArgs) => Promise<TOutput>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ToolDispatchResult } from "../types.js";
|
|
2
|
-
export declare function handleConfigOperation(args:
|
|
2
|
+
export declare function handleConfigOperation(args: unknown): Promise<ToolDispatchResult>;
|
|
@@ -1,68 +1,71 @@
|
|
|
1
1
|
import { listServices, getServiceInfo, toggle as toggleService, setEnabled as setServiceEnabled, reset as resetService, } from "../../config/index.js";
|
|
2
|
+
import { strictParse } from "../../schema/index.js";
|
|
3
|
+
import { ConfigOperationInputSchema } from "../../schema/config/index.js";
|
|
2
4
|
export async function handleConfigOperation(args) {
|
|
3
|
-
const
|
|
5
|
+
const validated = strictParse(ConfigOperationInputSchema, args, "config_operation input");
|
|
6
|
+
const { action, service: serviceRaw } = validated;
|
|
4
7
|
let result;
|
|
5
8
|
switch (action) {
|
|
6
9
|
case "list":
|
|
7
|
-
result = { services: listServices() };
|
|
10
|
+
result = { action: "list", services: listServices() };
|
|
8
11
|
break;
|
|
9
12
|
case "toggle": {
|
|
10
|
-
|
|
11
|
-
if (!service)
|
|
13
|
+
if (!serviceRaw)
|
|
12
14
|
throw new Error("'service' param is required for toggle");
|
|
15
|
+
const service = serviceRaw;
|
|
13
16
|
const existing = getServiceInfo(service);
|
|
14
17
|
if (!existing) {
|
|
15
18
|
throw new Error(`Unknown service: ${service}. Use action='list' to see all valid services.`);
|
|
16
19
|
}
|
|
17
20
|
const newState = toggleService(service);
|
|
18
|
-
result = { service, enabled: newState, reminder: existing.reminder };
|
|
21
|
+
result = { action: "toggle", service, enabled: newState, reminder: existing.reminder };
|
|
19
22
|
break;
|
|
20
23
|
}
|
|
21
24
|
case "enable": {
|
|
22
|
-
|
|
23
|
-
if (!service)
|
|
25
|
+
if (!serviceRaw)
|
|
24
26
|
throw new Error("'service' param is required for enable");
|
|
27
|
+
const service = serviceRaw;
|
|
25
28
|
const existing = getServiceInfo(service);
|
|
26
29
|
if (!existing)
|
|
27
30
|
throw new Error(`Unknown service: ${service}. Use action='list' to see all valid services.`);
|
|
28
31
|
setServiceEnabled(service, true);
|
|
29
|
-
result = { service, enabled: true, reminder: existing.reminder };
|
|
32
|
+
result = { action: "enable", service, enabled: true, reminder: existing.reminder };
|
|
30
33
|
break;
|
|
31
34
|
}
|
|
32
35
|
case "disable": {
|
|
33
|
-
|
|
34
|
-
if (!service)
|
|
36
|
+
if (!serviceRaw)
|
|
35
37
|
throw new Error("'service' param is required for disable");
|
|
38
|
+
const service = serviceRaw;
|
|
36
39
|
const existing = getServiceInfo(service);
|
|
37
40
|
if (!existing)
|
|
38
41
|
throw new Error(`Unknown service: ${service}. Use action='list' to see all valid services.`);
|
|
39
42
|
setServiceEnabled(service, false);
|
|
40
|
-
result = { service, enabled: false, reminder: existing.reminder };
|
|
43
|
+
result = { action: "disable", service, enabled: false, reminder: existing.reminder };
|
|
41
44
|
break;
|
|
42
45
|
}
|
|
43
46
|
case "reset": {
|
|
44
|
-
|
|
45
|
-
if (!service)
|
|
47
|
+
if (!serviceRaw)
|
|
46
48
|
throw new Error("'service' param is required for reset");
|
|
49
|
+
const service = serviceRaw;
|
|
47
50
|
const existing = getServiceInfo(service);
|
|
48
51
|
if (!existing)
|
|
49
52
|
throw new Error(`Unknown service: ${service}. Use action='list' to see all valid services.`);
|
|
50
53
|
resetService(service);
|
|
51
|
-
result = { service, enabled: getServiceInfo(service)?.enabled, reminder: existing.reminder, reset: true };
|
|
54
|
+
result = { action: "reset", service, enabled: getServiceInfo(service)?.enabled, reminder: existing.reminder, reset: true };
|
|
52
55
|
break;
|
|
53
56
|
}
|
|
54
57
|
case "info": {
|
|
55
|
-
|
|
56
|
-
if (!service)
|
|
58
|
+
if (!serviceRaw)
|
|
57
59
|
throw new Error("'service' param is required for info");
|
|
60
|
+
const service = serviceRaw;
|
|
58
61
|
const info = getServiceInfo(service);
|
|
59
62
|
if (!info)
|
|
60
63
|
throw new Error(`Unknown service: ${service}. Use action='list' to see all valid services.`);
|
|
61
|
-
result = info;
|
|
64
|
+
result = { action: "info", ...info };
|
|
62
65
|
break;
|
|
63
66
|
}
|
|
64
67
|
default:
|
|
65
|
-
throw new Error(`Unknown config_operation action: ${action}`);
|
|
68
|
+
throw new Error(`Unknown config_operation action: ${String(action)}`);
|
|
66
69
|
}
|
|
67
70
|
return {
|
|
68
71
|
content: [{ type: "text", text: JSON.stringify({ result }) }],
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ToolDispatchResult } from "../types.js";
|
|
2
|
-
export declare function handleGuard2File(args:
|
|
3
|
-
export declare function handleMachineNode2File(args:
|
|
2
|
+
export declare function handleGuard2File(args: unknown): Promise<ToolDispatchResult>;
|
|
3
|
+
export declare function handleMachineNode2File(args: unknown): Promise<ToolDispatchResult>;
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
export declare const handleAccountOperation: (args:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
text: string;
|
|
5
|
-
}[];
|
|
6
|
-
structuredContent: {
|
|
7
|
-
result: any;
|
|
8
|
-
semantic: any;
|
|
9
|
-
};
|
|
10
|
-
}>;
|
|
11
|
-
export declare const handleMarkOperation: (args: any) => Promise<{
|
|
12
|
-
content: {
|
|
13
|
-
type: "text";
|
|
14
|
-
text: string;
|
|
15
|
-
}[];
|
|
16
|
-
structuredContent: {
|
|
17
|
-
result: any;
|
|
18
|
-
semantic: any;
|
|
19
|
-
};
|
|
20
|
-
}>;
|
|
21
|
-
export declare const handleInfoOperation: (args: any) => Promise<{
|
|
22
|
-
content: {
|
|
23
|
-
type: "text";
|
|
24
|
-
text: string;
|
|
25
|
-
}[];
|
|
26
|
-
structuredContent: {
|
|
27
|
-
result: any;
|
|
28
|
-
semantic: any;
|
|
29
|
-
};
|
|
30
|
-
}>;
|
|
1
|
+
export declare const handleAccountOperation: (args: unknown) => Promise<import("../types.js").ToolDispatchResult>;
|
|
2
|
+
export declare const handleMarkOperation: (args: unknown) => Promise<import("../types.js").ToolDispatchResult>;
|
|
3
|
+
export declare const handleInfoOperation: (args: unknown) => Promise<import("../types.js").ToolDispatchResult>;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { wrapLocalHandler } from "../shared.js";
|
|
2
2
|
import { AccountOperationSchema, LocalMarkOperationSchema, LocalInfoOperationSchema, } from "../../schema/index.js";
|
|
3
3
|
import { account_operation, local_mark_operation, local_info_operation, } from "@wowok/wowok";
|
|
4
|
+
function deriveOpType(prefix, validated) {
|
|
5
|
+
for (const key of Object.keys(validated)) {
|
|
6
|
+
if (validated[key] !== undefined) {
|
|
7
|
+
return `${prefix}_${String(key)}`;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return `${prefix}_unknown`;
|
|
11
|
+
}
|
|
4
12
|
export const handleAccountOperation = wrapLocalHandler({
|
|
5
13
|
schema: AccountOperationSchema,
|
|
6
14
|
operationFn: account_operation,
|
|
7
15
|
parseLabel: "account_operation input",
|
|
8
16
|
buildContext: (validated) => ({
|
|
9
|
-
operation_type: "
|
|
17
|
+
operation_type: deriveOpType("account", validated),
|
|
10
18
|
data: validated,
|
|
11
19
|
}),
|
|
12
20
|
});
|
|
@@ -15,7 +23,7 @@ export const handleMarkOperation = wrapLocalHandler({
|
|
|
15
23
|
operationFn: local_mark_operation,
|
|
16
24
|
parseLabel: "local_mark_operation input",
|
|
17
25
|
buildContext: (validated) => ({
|
|
18
|
-
operation_type: "
|
|
26
|
+
operation_type: deriveOpType("mark", validated),
|
|
19
27
|
data: validated,
|
|
20
28
|
}),
|
|
21
29
|
});
|
|
@@ -23,5 +31,8 @@ export const handleInfoOperation = wrapLocalHandler({
|
|
|
23
31
|
schema: LocalInfoOperationSchema,
|
|
24
32
|
operationFn: local_info_operation,
|
|
25
33
|
parseLabel: "local_info_operation input",
|
|
26
|
-
buildContext: (validated) => ({
|
|
34
|
+
buildContext: (validated) => ({
|
|
35
|
+
operation_type: deriveOpType("local_info", validated),
|
|
36
|
+
data: validated,
|
|
37
|
+
}),
|
|
27
38
|
});
|
|
@@ -13,4 +13,4 @@ export declare function normalizeManyAccountOrMark(input: string[] | {
|
|
|
13
13
|
entities: any[];
|
|
14
14
|
check_all_founded?: boolean;
|
|
15
15
|
};
|
|
16
|
-
export declare function handleMessengerOperation(args:
|
|
16
|
+
export declare function handleMessengerOperation(args: unknown): Promise<ToolDispatchResult>;
|
|
@@ -20,6 +20,7 @@ export async function handleMessengerOperation(args) {
|
|
|
20
20
|
let validated;
|
|
21
21
|
try {
|
|
22
22
|
validated = strictParse(MessengerOperationInputSchema, args, "messenger_operation input");
|
|
23
|
+
const opLiteral = validated.operation;
|
|
23
24
|
let result;
|
|
24
25
|
switch (validated.operation) {
|
|
25
26
|
case "watch_conversations": {
|
|
@@ -158,7 +159,7 @@ export async function handleMessengerOperation(args) {
|
|
|
158
159
|
break;
|
|
159
160
|
}
|
|
160
161
|
default:
|
|
161
|
-
throw new Error(`Unknown messenger operation: ${
|
|
162
|
+
throw new Error(`Unknown messenger operation: ${opLiteral}`);
|
|
162
163
|
}
|
|
163
164
|
return {
|
|
164
165
|
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ToolDispatchResult } from "../types.js";
|
|
2
|
-
export declare function handleOnchainOperations(args:
|
|
2
|
+
export declare function handleOnchainOperations(args: unknown): Promise<ToolDispatchResult>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { readFileSync } from "fs";
|
|
2
2
|
import { resolve } from "path";
|
|
3
|
-
import { CallService, CallMachine, CallProgress,
|
|
3
|
+
import { CallService, CallMachine, CallProgress, CallGuard, CallArbitration, CallRepository, CallContact, CallTreasury, CallReward, CallAllocation, CallPersonal, CallPayment, CallDemand, CallOrder, gen_passport, CallProof, gen_proof, parseGuardFile, formatGuardParseErrors, transformRewardInput, transformPersonalInput, } from "@wowok/wowok";
|
|
4
4
|
import { OnchainOperationsSchema, strictParse, getEnvConfig, handleCallResult, checkClientSchemaCompatibility, parseMachineNodesFromText, formatNodeErrors as formatMachineNodeErrors, transformSubmission, } from "../../schema/index.js";
|
|
5
|
+
import { handlePermissionOperations } from "../../schema/call/permission-handler.js";
|
|
5
6
|
import { isProjectServiceEnabled, normalize as projectNormalize, } from "../../project/index.js";
|
|
6
7
|
import { withHarness } from "../shared.js";
|
|
7
8
|
export async function handleOnchainOperations(args) {
|
|
@@ -9,9 +10,11 @@ export async function handleOnchainOperations(args) {
|
|
|
9
10
|
let constraintWarnings = [];
|
|
10
11
|
let projectWarnings = [];
|
|
11
12
|
try {
|
|
12
|
-
if (typeof args === 'object' && args !== null
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
if (typeof args === 'object' && args !== null
|
|
14
|
+
&& 'description' in args && !('operation_type' in args)) {
|
|
15
|
+
const desc = args.description;
|
|
16
|
+
const hasWrappedParams = typeof desc === 'string' &&
|
|
17
|
+
(desc.includes('operation_type') || desc.includes('data'));
|
|
15
18
|
if (hasWrappedParams) {
|
|
16
19
|
throw new Error("Invalid parameter structure. Parameters should NOT be wrapped in 'description' field.\n" +
|
|
17
20
|
"Correct format: { operation_type: '...', data: {...} }\n" +
|
|
@@ -20,8 +23,8 @@ export async function handleOnchainOperations(args) {
|
|
|
20
23
|
}
|
|
21
24
|
validated = strictParse(OnchainOperationsSchema, args, "onchain_operations input");
|
|
22
25
|
const env = getEnvConfig(validated.env);
|
|
23
|
-
const clientSchemaVersion = env
|
|
24
|
-
const schemaStrictMode = env
|
|
26
|
+
const clientSchemaVersion = env.client_schema_version;
|
|
27
|
+
const schemaStrictMode = env.schema_strict_mode;
|
|
25
28
|
const schemaCheck = clientSchemaVersion
|
|
26
29
|
? checkClientSchemaCompatibility(clientSchemaVersion, { mode: schemaStrictMode ? "strict" : "warn" })
|
|
27
30
|
: undefined;
|
|
@@ -33,8 +36,8 @@ export async function handleOnchainOperations(args) {
|
|
|
33
36
|
: undefined,
|
|
34
37
|
schema_check: schemaCheck,
|
|
35
38
|
});
|
|
36
|
-
const projectEnvPrefix = env
|
|
37
|
-
if (isProjectServiceEnabled()) {
|
|
39
|
+
const projectEnvPrefix = env.project;
|
|
40
|
+
if (isProjectServiceEnabled() && 'data' in validated && validated.data) {
|
|
38
41
|
const pn = projectNormalize({
|
|
39
42
|
operation_type: validated.operation_type,
|
|
40
43
|
data: validated.data,
|
|
@@ -43,13 +46,11 @@ export async function handleOnchainOperations(args) {
|
|
|
43
46
|
validated.data = pn.data;
|
|
44
47
|
projectWarnings = pn.warnings ?? [];
|
|
45
48
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
delete env.schema_strict_mode;
|
|
52
|
-
}
|
|
49
|
+
delete env.confirmed;
|
|
50
|
+
delete env.user_intent_phrases;
|
|
51
|
+
delete env.project;
|
|
52
|
+
delete env.client_schema_version;
|
|
53
|
+
delete env.schema_strict_mode;
|
|
53
54
|
switch (validated.operation_type) {
|
|
54
55
|
case "service": {
|
|
55
56
|
const callService = new CallService(validated.data);
|
|
@@ -142,9 +143,7 @@ export async function handleOnchainOperations(args) {
|
|
|
142
143
|
return handleCallResult(result, buildCtx(validated.data));
|
|
143
144
|
}
|
|
144
145
|
case "permission": {
|
|
145
|
-
|
|
146
|
-
const result = await callPermission.call(env);
|
|
147
|
-
return handleCallResult(result, buildCtx(validated.data));
|
|
146
|
+
return handlePermissionOperations(validated.data, env, buildCtx);
|
|
148
147
|
}
|
|
149
148
|
case "guard": {
|
|
150
149
|
const validatedData = validated.data;
|
|
@@ -234,13 +233,16 @@ export async function handleOnchainOperations(args) {
|
|
|
234
233
|
return handleCallResult(result, buildCtx(validated.data));
|
|
235
234
|
}
|
|
236
235
|
}
|
|
237
|
-
|
|
236
|
+
const exhaustiveOp = validated;
|
|
237
|
+
throw new Error(`Unknown on-chain operation type: ${String(exhaustiveOp.operation_type)}`);
|
|
238
238
|
}
|
|
239
239
|
catch (error) {
|
|
240
240
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
const opType = validated?.operation_type;
|
|
242
|
+
const ctxData = validated && 'data' in validated ? validated.data : undefined;
|
|
243
|
+
return handleCallResult({ error: errorMessage }, opType ? {
|
|
244
|
+
operation_type: opType,
|
|
245
|
+
data: ctxData,
|
|
244
246
|
} : undefined);
|
|
245
247
|
}
|
|
246
248
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ToolDispatchResult } from "../types.js";
|
|
2
|
-
export declare function handleProjectOperation(args:
|
|
2
|
+
export declare function handleProjectOperation(args: unknown): Promise<ToolDispatchResult>;
|