@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
|
@@ -1,4 +1,65 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
const IndustryEnum = z.enum([
|
|
3
|
+
"general",
|
|
4
|
+
"retail",
|
|
5
|
+
"service",
|
|
6
|
+
"rental",
|
|
7
|
+
"freelance",
|
|
8
|
+
"education",
|
|
9
|
+
"travel",
|
|
10
|
+
"subscription",
|
|
11
|
+
"custom",
|
|
12
|
+
]);
|
|
13
|
+
export const ProjectObjectTypeEnum = z.enum([
|
|
14
|
+
"service",
|
|
15
|
+
"machine",
|
|
16
|
+
"guard",
|
|
17
|
+
"permission",
|
|
18
|
+
"reward",
|
|
19
|
+
"arb",
|
|
20
|
+
"progress",
|
|
21
|
+
"treasury",
|
|
22
|
+
"demand",
|
|
23
|
+
"repository",
|
|
24
|
+
"contact",
|
|
25
|
+
"order",
|
|
26
|
+
"allocation",
|
|
27
|
+
"personal",
|
|
28
|
+
"payment",
|
|
29
|
+
"proof",
|
|
30
|
+
]);
|
|
31
|
+
export const EdgeKindEnum = z.enum([
|
|
32
|
+
"machine",
|
|
33
|
+
"order_allocators",
|
|
34
|
+
"arbitrations",
|
|
35
|
+
"compensation_fund",
|
|
36
|
+
"rewards",
|
|
37
|
+
"buy_guard",
|
|
38
|
+
"permission",
|
|
39
|
+
"guard",
|
|
40
|
+
"prev",
|
|
41
|
+
"next",
|
|
42
|
+
"forward",
|
|
43
|
+
"parent",
|
|
44
|
+
"service",
|
|
45
|
+
"progress",
|
|
46
|
+
"arbitration",
|
|
47
|
+
"sub_order",
|
|
48
|
+
"references",
|
|
49
|
+
]);
|
|
50
|
+
const PuzzleEntrySchema = z
|
|
51
|
+
.object({
|
|
52
|
+
puzzle: z
|
|
53
|
+
.record(z.unknown())
|
|
54
|
+
.describe("Per-object puzzle snapshot. Shape varies per object_type — see knowledge/<obj>-puzzle.ts."),
|
|
55
|
+
completeness: z
|
|
56
|
+
.record(z.unknown())
|
|
57
|
+
.describe("Completeness assessment from checkPuzzleCompleteness(). Shape varies per object."),
|
|
58
|
+
missing_dimensions: z
|
|
59
|
+
.array(z.string())
|
|
60
|
+
.describe("Dimensions still missing for this object (e.g. ['A','B'])."),
|
|
61
|
+
})
|
|
62
|
+
.strict();
|
|
2
63
|
export const ProjectOperationInputSchema = z
|
|
3
64
|
.object({
|
|
4
65
|
action: z
|
|
@@ -13,20 +74,383 @@ export const ProjectOperationInputSchema = z
|
|
|
13
74
|
"graph_stats",
|
|
14
75
|
"save_graph",
|
|
15
76
|
"load_graph",
|
|
77
|
+
"analyze_intent",
|
|
78
|
+
"aggregate_risks",
|
|
79
|
+
"generate_deployment_doc",
|
|
80
|
+
"trace_substeps",
|
|
16
81
|
])
|
|
17
82
|
.describe("Query/action to perform"),
|
|
18
83
|
project: z
|
|
19
84
|
.string()
|
|
20
85
|
.optional()
|
|
21
|
-
.describe("Project prefix (for list_objects)"),
|
|
86
|
+
.describe("Project prefix (for list_objects and C1-C4 actions)"),
|
|
87
|
+
version: z
|
|
88
|
+
.string()
|
|
89
|
+
.regex(/^v\d+$/)
|
|
90
|
+
.optional()
|
|
91
|
+
.describe("Project version (e.g. 'v1'). Required for C1-C4 actions."),
|
|
22
92
|
object: z
|
|
23
93
|
.string()
|
|
24
94
|
.optional()
|
|
25
95
|
.describe("Object name or address (for dependencies / referenced_by / pre_publish_check)"),
|
|
96
|
+
user_intent: z
|
|
97
|
+
.string()
|
|
98
|
+
.min(1)
|
|
99
|
+
.max(2000)
|
|
100
|
+
.optional()
|
|
101
|
+
.describe("Natural-language business intent for analyze_intent (stage 2). Required when action='analyze_intent'."),
|
|
102
|
+
industry: IndustryEnum.optional().describe("Industry hint — drives template defaults. Used by analyze_intent and aggregate_risks."),
|
|
103
|
+
target_objects: z
|
|
104
|
+
.array(z.string())
|
|
105
|
+
.optional()
|
|
106
|
+
.describe("Optional explicit target objects (entry_ids or object_type names) for analyze_intent."),
|
|
107
|
+
puzzles: z
|
|
108
|
+
.record(z.string(), PuzzleEntrySchema)
|
|
109
|
+
.optional()
|
|
110
|
+
.describe("Per-object puzzle snapshots keyed by object_type. Required for aggregate_risks and generate_deployment_doc."),
|
|
111
|
+
severity_threshold: z
|
|
112
|
+
.enum(["CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO"])
|
|
113
|
+
.optional()
|
|
114
|
+
.describe("Severity threshold for aggregate_risks. Risks at or above this level are flagged."),
|
|
115
|
+
user_confirmed_high_risks: z
|
|
116
|
+
.array(z.string())
|
|
117
|
+
.optional()
|
|
118
|
+
.describe("IDs of HIGH risks the user has already confirmed (suppressed in subsequent aggregate_risks)."),
|
|
119
|
+
business_intent: z
|
|
120
|
+
.string()
|
|
121
|
+
.min(1)
|
|
122
|
+
.max(500)
|
|
123
|
+
.optional()
|
|
124
|
+
.describe("One-line business intent description for the deployment doc. Required when action='generate_deployment_doc'."),
|
|
125
|
+
author: z
|
|
126
|
+
.string()
|
|
127
|
+
.optional()
|
|
128
|
+
.describe("Optional author name for the deployment doc meta section."),
|
|
129
|
+
objects: z
|
|
130
|
+
.array(z
|
|
131
|
+
.object({
|
|
132
|
+
entry_id: z.string().describe("Stable id '<object_type>:<name>'"),
|
|
133
|
+
object_type: ProjectObjectTypeEnum,
|
|
134
|
+
name: z.string(),
|
|
135
|
+
reused_from: z
|
|
136
|
+
.string()
|
|
137
|
+
.optional()
|
|
138
|
+
.describe("Existing on-chain address or local name if reused"),
|
|
139
|
+
publish_required: z
|
|
140
|
+
.boolean()
|
|
141
|
+
.describe("Whether publish is required (only Service/Machine)"),
|
|
142
|
+
description: z.string().optional(),
|
|
143
|
+
})
|
|
144
|
+
.strict())
|
|
145
|
+
.optional()
|
|
146
|
+
.describe("Deployment objects for generate_deployment_doc."),
|
|
147
|
+
edges: z
|
|
148
|
+
.array(z
|
|
149
|
+
.object({
|
|
150
|
+
from: z.string(),
|
|
151
|
+
to: z.string(),
|
|
152
|
+
edge_kind: EdgeKindEnum,
|
|
153
|
+
field_path: z.string(),
|
|
154
|
+
required_at_publish: z.boolean(),
|
|
155
|
+
})
|
|
156
|
+
.strict())
|
|
157
|
+
.optional()
|
|
158
|
+
.describe("Dependency graph edges for generate_deployment_doc."),
|
|
159
|
+
steps: z
|
|
160
|
+
.array(z
|
|
161
|
+
.object({
|
|
162
|
+
step: z.number().int().positive(),
|
|
163
|
+
object_type: ProjectObjectTypeEnum,
|
|
164
|
+
operation: z.string(),
|
|
165
|
+
substep_count: z.number().int().nonnegative(),
|
|
166
|
+
depends_on: z.array(z.number().int()),
|
|
167
|
+
entry_id: z.string(),
|
|
168
|
+
network_phase: z.enum(["testnet", "mainnet", "both"]),
|
|
169
|
+
})
|
|
170
|
+
.strict())
|
|
171
|
+
.optional()
|
|
172
|
+
.describe("Topological execution plan for generate_deployment_doc."),
|
|
173
|
+
scenarios: z
|
|
174
|
+
.array(z
|
|
175
|
+
.object({
|
|
176
|
+
scenario_id: z.string(),
|
|
177
|
+
description: z.string(),
|
|
178
|
+
primary_object: z.string(),
|
|
179
|
+
supporting_objects: z.array(z.string()),
|
|
180
|
+
test_step_refs: z.array(z.string()).optional(),
|
|
181
|
+
})
|
|
182
|
+
.strict())
|
|
183
|
+
.optional()
|
|
184
|
+
.describe("Business scenarios for generate_deployment_doc §7."),
|
|
185
|
+
risk_status: z
|
|
186
|
+
.enum(["RISK_PASSED", "RISK_BLOCKED", "RISK_PENDING_CONFIRM", "RISK_CANCELLED"])
|
|
187
|
+
.optional()
|
|
188
|
+
.describe("Risk status from aggregate_risks (for D-16 check)."),
|
|
189
|
+
risk_critical_count: z
|
|
190
|
+
.number()
|
|
191
|
+
.int()
|
|
192
|
+
.nonnegative()
|
|
193
|
+
.optional()
|
|
194
|
+
.describe("CRITICAL risk count from aggregate_risks."),
|
|
195
|
+
risk_high_count: z
|
|
196
|
+
.number()
|
|
197
|
+
.int()
|
|
198
|
+
.nonnegative()
|
|
199
|
+
.optional()
|
|
200
|
+
.describe("HIGH risk count from aggregate_risks."),
|
|
201
|
+
run_scanner: z
|
|
202
|
+
.boolean()
|
|
203
|
+
.optional()
|
|
204
|
+
.describe("Whether to run deployment-scanner validation after generating the doc. Defaults to true."),
|
|
205
|
+
network: z
|
|
206
|
+
.enum(["testnet", "mainnet"])
|
|
207
|
+
.optional()
|
|
208
|
+
.describe("Target network for trace_substeps."),
|
|
209
|
+
substeps: z
|
|
210
|
+
.array(z
|
|
211
|
+
.object({
|
|
212
|
+
step_id: z.string().regex(/^T\d+\.\d+$/),
|
|
213
|
+
parent_step: z.string().regex(/^T\d+$/),
|
|
214
|
+
object_type: ProjectObjectTypeEnum,
|
|
215
|
+
entry_id: z.string(),
|
|
216
|
+
operation_type: z.string(),
|
|
217
|
+
network: z.enum(["testnet", "mainnet"]),
|
|
218
|
+
input: z.object({
|
|
219
|
+
data: z.record(z.unknown()),
|
|
220
|
+
input_refs: z.array(z.string()),
|
|
221
|
+
}),
|
|
222
|
+
output: z
|
|
223
|
+
.object({
|
|
224
|
+
object_id: z.string().optional(),
|
|
225
|
+
tx_digest: z.string().optional(),
|
|
226
|
+
})
|
|
227
|
+
.partial()
|
|
228
|
+
.optional(),
|
|
229
|
+
timestamp: z.number().int(),
|
|
230
|
+
status: z.enum(["PENDING", "SUCCESS", "FAILED", "SKIPPED"]),
|
|
231
|
+
failure_reason: z.string().optional(),
|
|
232
|
+
dependencies: z.object({
|
|
233
|
+
input_refs: z.array(z.string()),
|
|
234
|
+
output_refs: z.array(z.object({
|
|
235
|
+
substep_id: z.string(),
|
|
236
|
+
field_path: z.string(),
|
|
237
|
+
})),
|
|
238
|
+
}),
|
|
239
|
+
retry_info: z
|
|
240
|
+
.object({
|
|
241
|
+
original_step_id: z.string(),
|
|
242
|
+
retry_count: z.number().int().nonnegative(),
|
|
243
|
+
retry_reason: z.string(),
|
|
244
|
+
})
|
|
245
|
+
.optional(),
|
|
246
|
+
})
|
|
247
|
+
.strict())
|
|
248
|
+
.optional()
|
|
249
|
+
.describe("Substep records for trace_substeps."),
|
|
250
|
+
})
|
|
251
|
+
.strict();
|
|
252
|
+
const ItemsResult = (action) => z.object({
|
|
253
|
+
action: z.literal(action),
|
|
254
|
+
items: z
|
|
255
|
+
.array(z.record(z.unknown()))
|
|
256
|
+
.describe("List of result items. Each item is an untyped record — shape varies per query."),
|
|
257
|
+
});
|
|
258
|
+
const AnalyzeIntentResultSchema = z
|
|
259
|
+
.object({
|
|
260
|
+
action: z.literal("analyze_intent"),
|
|
261
|
+
intent_parsed: z.object({
|
|
262
|
+
primary_object: z.string(),
|
|
263
|
+
secondary_objects: z.array(z.string()),
|
|
264
|
+
detected_scenes: z.array(z.object({
|
|
265
|
+
object: z.string(),
|
|
266
|
+
scene_id: z.string(),
|
|
267
|
+
})),
|
|
268
|
+
industry: z.string(),
|
|
269
|
+
keyword_matches: z.array(z.object({
|
|
270
|
+
keyword: z.string(),
|
|
271
|
+
category: z.string(),
|
|
272
|
+
matched_objects: z.array(z.string()),
|
|
273
|
+
required_level: z.enum(["R", "C", "OPTIONAL"]),
|
|
274
|
+
match_count: z.number().int(),
|
|
275
|
+
})),
|
|
276
|
+
}),
|
|
277
|
+
puzzles: z.record(z.string(), PuzzleEntrySchema),
|
|
278
|
+
overall_completeness: z.enum(["complete", "partial", "empty"]),
|
|
279
|
+
next_step: z.string(),
|
|
280
|
+
warnings: z.array(z.string()),
|
|
281
|
+
})
|
|
282
|
+
.strict();
|
|
283
|
+
const AggregateRisksResultSchema = z
|
|
284
|
+
.object({
|
|
285
|
+
action: z.literal("aggregate_risks"),
|
|
286
|
+
namespace: z.object({
|
|
287
|
+
prefix: z.string(),
|
|
288
|
+
version: z.string(),
|
|
289
|
+
industry: z.string().optional(),
|
|
290
|
+
}),
|
|
291
|
+
findings: z.array(z.object({
|
|
292
|
+
risk_rule_id: z.string(),
|
|
293
|
+
object_type: z.string(),
|
|
294
|
+
entry_id: z.string(),
|
|
295
|
+
severity: z.enum(["CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO"]),
|
|
296
|
+
message: z.string(),
|
|
297
|
+
fix_suggestion: z.string(),
|
|
298
|
+
details: z
|
|
299
|
+
.object({
|
|
300
|
+
field_path: z.string().optional(),
|
|
301
|
+
rule_source: z.string().optional(),
|
|
302
|
+
})
|
|
303
|
+
.partial()
|
|
304
|
+
.optional(),
|
|
305
|
+
})),
|
|
306
|
+
severity_summary: z.object({
|
|
307
|
+
CRITICAL: z.number().int(),
|
|
308
|
+
HIGH: z.number().int(),
|
|
309
|
+
MEDIUM: z.number().int(),
|
|
310
|
+
LOW: z.number().int(),
|
|
311
|
+
INFO: z.number().int(),
|
|
312
|
+
}),
|
|
313
|
+
status: z.enum([
|
|
314
|
+
"RISK_PASSED",
|
|
315
|
+
"RISK_BLOCKED",
|
|
316
|
+
"RISK_PENDING_CONFIRM",
|
|
317
|
+
"RISK_CANCELLED",
|
|
318
|
+
]),
|
|
319
|
+
pending_confirmations: z
|
|
320
|
+
.array(z.object({
|
|
321
|
+
risk_rule_id: z.string(),
|
|
322
|
+
description: z.string(),
|
|
323
|
+
fix_suggestion: z.string(),
|
|
324
|
+
object_type: z.string(),
|
|
325
|
+
entry_id: z.string(),
|
|
326
|
+
}))
|
|
327
|
+
.optional(),
|
|
328
|
+
calibrated_at: z.number().int(),
|
|
329
|
+
warnings: z.array(z.string()),
|
|
330
|
+
can_proceed: z
|
|
331
|
+
.boolean()
|
|
332
|
+
.describe("Whether the user can proceed to the next stage. False only when CRITICAL risks exist."),
|
|
333
|
+
user_action_required: z
|
|
334
|
+
.string()
|
|
335
|
+
.describe("Human-readable next-step guidance."),
|
|
336
|
+
})
|
|
337
|
+
.strict();
|
|
338
|
+
const GenerateDeploymentDocResultSchema = z
|
|
339
|
+
.object({
|
|
340
|
+
action: z.literal("generate_deployment_doc"),
|
|
341
|
+
markdown: z.string().describe("Complete deployment MD document (§0-§7)"),
|
|
342
|
+
meta: z.object({
|
|
343
|
+
project_prefix: z.string(),
|
|
344
|
+
version: z.string(),
|
|
345
|
+
generated_at: z.string().describe("ISO timestamp"),
|
|
346
|
+
object_count: z.number().int(),
|
|
347
|
+
step_count: z.number().int(),
|
|
348
|
+
}),
|
|
349
|
+
validation: z
|
|
350
|
+
.object({
|
|
351
|
+
valid: z.boolean(),
|
|
352
|
+
checks: z.array(z.object({
|
|
353
|
+
check_id: z.string(),
|
|
354
|
+
description: z.string(),
|
|
355
|
+
status: z.enum(["PASS", "FAIL", "WARN"]),
|
|
356
|
+
notes: z.string().optional(),
|
|
357
|
+
})),
|
|
358
|
+
errors: z.array(z.string()),
|
|
359
|
+
})
|
|
360
|
+
.optional()
|
|
361
|
+
.describe("Scanner validation result. Present when run_scanner=true."),
|
|
362
|
+
can_proceed: z
|
|
363
|
+
.boolean()
|
|
364
|
+
.describe("Whether the user can proceed to stage 5. False when D-errors exist."),
|
|
365
|
+
user_action_required: z.string(),
|
|
366
|
+
})
|
|
367
|
+
.strict();
|
|
368
|
+
const TraceSubstepsResultSchema = z
|
|
369
|
+
.object({
|
|
370
|
+
action: z.literal("trace_substeps"),
|
|
371
|
+
namespace: z.object({
|
|
372
|
+
prefix: z.string(),
|
|
373
|
+
version: z.string(),
|
|
374
|
+
}),
|
|
375
|
+
network: z.enum(["testnet", "mainnet"]),
|
|
376
|
+
coherent: z
|
|
377
|
+
.boolean()
|
|
378
|
+
.describe("True when no dangling/circular/missing/cross-step issues."),
|
|
379
|
+
dangling_inputs: z.array(z.object({
|
|
380
|
+
substep_id: z.string(),
|
|
381
|
+
missing_ref: z.string(),
|
|
382
|
+
field_path: z.string(),
|
|
383
|
+
})),
|
|
384
|
+
circular_refs: z.array(z.object({
|
|
385
|
+
cycle: z.array(z.string()),
|
|
386
|
+
})),
|
|
387
|
+
missing_outputs: z.array(z.object({
|
|
388
|
+
substep_id: z.string(),
|
|
389
|
+
expected_field: z.string(),
|
|
390
|
+
dependent_substeps: z.array(z.string()),
|
|
391
|
+
})),
|
|
392
|
+
cross_step_breaks: z.array(z.object({
|
|
393
|
+
source_step: z.string(),
|
|
394
|
+
target_step: z.string(),
|
|
395
|
+
missing_field: z.string(),
|
|
396
|
+
})),
|
|
397
|
+
step_details: z.array(z.object({
|
|
398
|
+
parent_step: z.string(),
|
|
399
|
+
total_substeps: z.number().int(),
|
|
400
|
+
successful: z.number().int(),
|
|
401
|
+
failed: z.number().int(),
|
|
402
|
+
pending: z.number().int(),
|
|
403
|
+
skipped: z.number().int(),
|
|
404
|
+
substep_ids: z.array(z.string()),
|
|
405
|
+
})),
|
|
406
|
+
topological_order: z.array(z.string()),
|
|
407
|
+
d10_check: z.object({
|
|
408
|
+
check_id: z.literal("D-10"),
|
|
409
|
+
description: z.string(),
|
|
410
|
+
status: z.enum(["PASS", "FAIL", "WARN"]),
|
|
411
|
+
}),
|
|
412
|
+
can_proceed: z
|
|
413
|
+
.boolean()
|
|
414
|
+
.describe("Whether deployment can complete. False when D-10 fails or substeps FAILED."),
|
|
415
|
+
user_action_required: z.string(),
|
|
26
416
|
})
|
|
27
417
|
.strict();
|
|
28
418
|
export const ProjectOperationOutputSchema = z
|
|
29
419
|
.object({
|
|
30
|
-
result: z.
|
|
420
|
+
result: z.discriminatedUnion("action", [
|
|
421
|
+
ItemsResult("list_projects"),
|
|
422
|
+
ItemsResult("list_objects"),
|
|
423
|
+
ItemsResult("shareable"),
|
|
424
|
+
ItemsResult("dependencies"),
|
|
425
|
+
ItemsResult("referenced_by"),
|
|
426
|
+
z.object({
|
|
427
|
+
action: z.literal("pre_publish_check"),
|
|
428
|
+
warnings: z
|
|
429
|
+
.array(z.string())
|
|
430
|
+
.describe("Pre-publish warnings. Empty array means no issues detected."),
|
|
431
|
+
}),
|
|
432
|
+
ItemsResult("cross_project_refs"),
|
|
433
|
+
z.object({
|
|
434
|
+
action: z.literal("graph_stats"),
|
|
435
|
+
stats: z
|
|
436
|
+
.record(z.unknown())
|
|
437
|
+
.describe("Object dependency graph statistics (counts, depth, etc.)."),
|
|
438
|
+
}),
|
|
439
|
+
z.object({
|
|
440
|
+
action: z.literal("save_graph"),
|
|
441
|
+
saved: z.literal(true).describe("Always true — confirms the graph was saved."),
|
|
442
|
+
path: z.string().describe("Filesystem path where the graph was saved."),
|
|
443
|
+
}),
|
|
444
|
+
z.object({
|
|
445
|
+
action: z.literal("load_graph"),
|
|
446
|
+
loaded: z
|
|
447
|
+
.boolean()
|
|
448
|
+
.describe("Whether the graph was successfully loaded from disk."),
|
|
449
|
+
}),
|
|
450
|
+
AnalyzeIntentResultSchema,
|
|
451
|
+
AggregateRisksResultSchema,
|
|
452
|
+
GenerateDeploymentDocResultSchema,
|
|
453
|
+
TraceSubstepsResultSchema,
|
|
454
|
+
]).describe("Query result — shape depends on action"),
|
|
31
455
|
})
|
|
32
456
|
.strict();
|