@wowok/agent-mcp 2.5.5 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/config/runtime.js +3 -6
- package/dist/extensions/capability-manifest.d.ts +125 -0
- package/dist/extensions/capability-manifest.js +594 -0
- package/dist/extensions/constraint-registry.d.ts +24 -0
- package/dist/extensions/constraint-registry.js +196 -0
- package/dist/extensions/index.d.ts +12 -0
- package/dist/extensions/index.js +6 -0
- package/dist/extensions/metric-registry.d.ts +26 -0
- package/dist/extensions/metric-registry.js +257 -0
- package/dist/extensions/mode-evaluator.d.ts +15 -0
- package/dist/extensions/mode-evaluator.js +170 -0
- package/dist/extensions/modes.d.ts +2 -0
- package/dist/extensions/modes.js +407 -0
- package/dist/extensions/registry.d.ts +48 -0
- package/dist/extensions/registry.js +629 -0
- package/dist/extensions/types.d.ts +218 -0
- package/dist/extensions/types.js +1 -0
- package/dist/harness/checkpoint.js +2 -2
- package/dist/knowledge/deployment-scanner.d.ts +3 -0
- package/dist/knowledge/deployment-scanner.js +64 -3
- package/dist/knowledge/flywheel-loop.js +2 -5
- package/dist/knowledge/guard-risk.d.ts +13 -0
- package/dist/knowledge/guard-risk.js +57 -0
- package/dist/knowledge/guard-templates.js +278 -0
- package/dist/knowledge/machine-templates.js +20 -1
- package/dist/knowledge/overrides-loader.js +2 -4
- package/dist/knowledge/progress-ledger.js +3 -0
- package/dist/knowledge/progress-translation.js +5 -1
- package/dist/knowledge/service-confirm.d.ts +14 -5
- package/dist/knowledge/service-confirm.js +116 -8
- package/dist/knowledge/tool-constraints.js +6 -2
- package/dist/loop-engineering/improve.js +2 -4
- package/dist/project/deployment-bridge.d.ts +5 -0
- package/dist/project/deployment-bridge.js +119 -0
- package/dist/project/deployment-doc.d.ts +3 -0
- package/dist/project/deployment-doc.js +72 -10
- package/dist/project/evaluation.d.ts +2 -0
- package/dist/project/evaluation.js +578 -86
- package/dist/project/graph-builder.d.ts +4 -1
- package/dist/project/graph-builder.js +141 -63
- package/dist/project/graph.d.ts +1 -0
- package/dist/project/handlers.d.ts +221 -5
- package/dist/project/handlers.js +933 -14
- package/dist/project/index.js +2 -6
- package/dist/project/project-store.js +2 -5
- package/dist/project/stage-gate.d.ts +4 -0
- package/dist/project/stage-gate.js +64 -5
- package/dist/project/task-tracker.d.ts +26 -0
- package/dist/project/task-tracker.js +78 -0
- package/dist/safety/preview.js +16 -0
- package/dist/schema/call/allocation.d.ts +16 -16
- package/dist/schema/call/base.d.ts +21 -13
- package/dist/schema/call/base.js +27 -6
- package/dist/schema/call/bridge.d.ts +5 -5
- package/dist/schema/call/bridge.js +3 -1
- package/dist/schema/call/demand.d.ts +23 -31
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/machine.d.ts +402 -376
- package/dist/schema/call/order.d.ts +149 -228
- package/dist/schema/call/order.js +7 -3
- package/dist/schema/call/payment.d.ts +183 -3
- package/dist/schema/call/payment.js +21 -3
- package/dist/schema/call/personal.d.ts +241 -52
- package/dist/schema/call/progress.d.ts +53 -61
- package/dist/schema/call/progress.js +18 -4
- package/dist/schema/call/repository.d.ts +23 -31
- package/dist/schema/call/semantic.d.ts +1 -1
- package/dist/schema/call/semantic.js +30 -1
- package/dist/schema/call/service.d.ts +95 -119
- package/dist/schema/call/service.js +22 -1
- package/dist/schema/common/index.d.ts +11 -2
- package/dist/schema/common/index.js +43 -14
- package/dist/schema/config/index.d.ts +12 -12
- package/dist/schema/local/index.d.ts +140 -143
- package/dist/schema/local/index.js +44 -23
- package/dist/schema/messenger/index.d.ts +290 -62
- package/dist/schema/messenger/index.js +2 -2
- package/dist/schema/operations.d.ts +680 -545
- package/dist/schema/operations.js +22 -0
- package/dist/schema/project/index.d.ts +2064 -84
- package/dist/schema/project/index.js +354 -12
- package/dist/schema/query/index.d.ts +715 -354
- package/dist/schema/query/index.js +164 -31
- package/dist/schema/schema-query/index.d.ts +15 -3
- package/dist/schema/schema-query/index.js +23 -5
- package/dist/schema/trust/index.d.ts +8 -8
- package/dist/schema/utils/node-parser.js +7 -4
- package/dist/schema-query/index.d.ts +7 -1
- package/dist/schema-query/index.js +204 -4
- package/dist/schemas/account_operation.output.json +14 -22
- package/dist/schemas/account_operation.schema.json +11 -25
- package/dist/schemas/bridge_operation.output.json +6 -0
- package/dist/schemas/bridge_operation.schema.json +1 -1
- package/dist/schemas/guard-templates.json +379 -0
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/local_info_operation.output.json +6 -0
- package/dist/schemas/local_mark_operation.output.json +7 -1
- package/dist/schemas/local_mark_operation.schema.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/messenger_operation.schema.json +10 -10
- package/dist/schemas/onchain_events.output.json +1 -1
- package/dist/schemas/onchain_operations.schema.json +348 -296
- package/dist/schemas/onchain_operations_allocation.schema.json +34 -25
- package/dist/schemas/onchain_operations_arbitration.schema.json +8 -8
- package/dist/schemas/onchain_operations_contact.schema.json +8 -8
- package/dist/schemas/onchain_operations_demand.schema.json +8 -8
- package/dist/schemas/onchain_operations_gen_passport.schema.json +14 -14
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -2
- package/dist/schemas/onchain_operations_guard.schema.json +1 -1
- package/dist/schemas/onchain_operations_machine.schema.json +41 -33
- package/dist/schemas/onchain_operations_order.schema.json +71 -77
- package/dist/schemas/onchain_operations_payment.schema.json +141 -111
- package/dist/schemas/onchain_operations_permission.schema.json +2 -2
- package/dist/schemas/onchain_operations_personal.schema.json +7 -7
- package/dist/schemas/onchain_operations_progress.schema.json +8 -8
- package/dist/schemas/onchain_operations_proof.schema.json +7 -7
- package/dist/schemas/onchain_operations_repository.schema.json +8 -8
- package/dist/schemas/onchain_operations_reward.schema.json +10 -10
- package/dist/schemas/onchain_operations_service.schema.json +46 -35
- package/dist/schemas/onchain_operations_treasury.schema.json +8 -8
- package/dist/schemas/onchain_table_data.output.json +33 -25
- package/dist/schemas/onchain_table_data.schema.json +12 -12
- package/dist/schemas/project_operation.output.json +1352 -20
- package/dist/schemas/project_operation.schema.json +53 -4
- package/dist/schemas/query_toolkit.output.json +111 -82
- package/dist/schemas/query_toolkit.schema.json +9 -13
- package/dist/schemas/schema_query.output.json +7 -3
- package/dist/schemas/schema_query.schema.json +17 -3
- package/dist/telemetry/storage.js +2 -2
- package/dist/tools/handlers/local.js +20 -5
- package/dist/tools/handlers/onchain.js +36 -0
- package/dist/tools/handlers/project.js +72 -1
- package/dist/tools/handlers/query.js +27 -0
- package/dist/tools/handlers/schema-query.js +19 -0
- package/dist/tools/handlers/task-status.d.ts +170 -0
- package/dist/tools/handlers/task-status.js +55 -0
- package/dist/tools/handlers/wip.js +47 -1
- package/dist/tools/index.js +212 -8
- package/dist/tools/retry.d.ts +8 -0
- package/dist/tools/retry.js +85 -0
- package/dist/tools/wip-deploy-assist.d.ts +28 -0
- package/dist/tools/wip-deploy-assist.js +278 -0
- package/package.json +2 -2
- package/dist/schemas/guard-node-examples.md +0 -199
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { type GraphData } from "@wowok/wowok";
|
|
1
|
+
import { type GraphData, type GraphNode } from "@wowok/wowok";
|
|
2
|
+
export type GraphNodeWithTemplate = GraphNode & {
|
|
3
|
+
isTemplate?: boolean;
|
|
4
|
+
};
|
|
2
5
|
export interface GraphBuildOptions {
|
|
3
6
|
maxDepth?: number;
|
|
4
7
|
maxConcurrency?: number;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { query_objects, queryTableItem_EntityLinker, LocalProject, } from "@wowok/wowok";
|
|
2
2
|
const MAX_OBJECTS_PER_QUERY = 50;
|
|
3
|
+
function shortTypeName(objectType) {
|
|
4
|
+
if (!objectType)
|
|
5
|
+
return "unknown";
|
|
6
|
+
const base = objectType.replace(/<.*>/, "").trim();
|
|
7
|
+
const segments = base.split("::");
|
|
8
|
+
return segments[segments.length - 1] || "unknown";
|
|
9
|
+
}
|
|
3
10
|
function extractAddressFields(obj) {
|
|
4
11
|
const refs = [];
|
|
5
12
|
const objType = obj.type;
|
|
@@ -35,47 +42,89 @@ function extractAddressFields(obj) {
|
|
|
35
42
|
for (const alloc of data.order_allocators.allocators) {
|
|
36
43
|
addRef(alloc.guard, "allocator_guard", "validate");
|
|
37
44
|
}
|
|
45
|
+
const firstGuard = data.order_allocators.allocators[0]?.guard;
|
|
46
|
+
addRef(firstGuard, "order_allocators", "create");
|
|
38
47
|
}
|
|
39
|
-
addRefOption(data.compensation_fund, "compensation_fund", "bind");
|
|
40
48
|
break;
|
|
41
49
|
}
|
|
42
50
|
case "Machine": {
|
|
43
51
|
addRef(data.permission, "permission", "validate");
|
|
44
|
-
addRefArray(data.
|
|
45
|
-
if (data.nodes) {
|
|
46
|
-
for (const node of data.nodes) {
|
|
47
|
-
if (node.forward?.guard) {
|
|
48
|
-
addRef(node.forward.guard, "node_guard", "validate");
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
+
addRefArray(data.consensus_repositories, "consensus_repositories", "consume");
|
|
52
53
|
break;
|
|
53
54
|
}
|
|
54
55
|
case "Order": {
|
|
55
56
|
addRef(data.service, "service", "consume");
|
|
56
57
|
addRefOption(data.machine, "machine", "consume");
|
|
57
58
|
addRefOption(data.progress, "progress", "trigger");
|
|
58
|
-
|
|
59
|
+
addRefArray(data.dispute, "dispute", "trigger");
|
|
60
|
+
addRefOption(data.allocation, "allocation", "bind");
|
|
59
61
|
break;
|
|
60
62
|
}
|
|
61
63
|
case "Progress": {
|
|
62
64
|
addRef(data.machine, "machine", "bind");
|
|
63
|
-
|
|
64
|
-
addRefOption(data.order, "order", "bind");
|
|
65
|
+
addRefArray(data.context_repositories, "context_repositories", "consume");
|
|
65
66
|
break;
|
|
66
67
|
}
|
|
67
68
|
case "Treasury": {
|
|
68
69
|
addRef(data.permission, "permission", "validate");
|
|
69
|
-
|
|
70
|
+
if (Array.isArray(data.external_deposit_guard)) {
|
|
71
|
+
for (const g of data.external_deposit_guard)
|
|
72
|
+
addRef(g?.guard, "external_deposit_guard", "validate");
|
|
73
|
+
}
|
|
74
|
+
if (Array.isArray(data.external_withdraw_guard)) {
|
|
75
|
+
for (const g of data.external_withdraw_guard)
|
|
76
|
+
addRef(g?.guard, "external_withdraw_guard", "validate");
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
case "Allocation": {
|
|
81
|
+
if (Array.isArray(data.allocators)) {
|
|
82
|
+
for (const alloc of data.allocators)
|
|
83
|
+
addRef(alloc?.guard, "allocator_guard", "validate");
|
|
84
|
+
}
|
|
85
|
+
addRefOption(data.payment_info?.for_object, "for_object", "bind");
|
|
86
|
+
addRefOption(data.payment_info?.for_guard, "for_guard", "validate");
|
|
87
|
+
addRefArray(data.payment, "payment", "trigger");
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
case "Arbitration": {
|
|
91
|
+
addRef(data.permission, "permission", "validate");
|
|
92
|
+
if (Array.isArray(data.voting_guard)) {
|
|
93
|
+
for (const vg of data.voting_guard)
|
|
94
|
+
addRef(vg?.guard, "voting_guard", "validate");
|
|
95
|
+
}
|
|
96
|
+
addRefOption(data.usage_guard, "usage_guard", "validate");
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
case "Reward": {
|
|
100
|
+
addRef(data.permission, "permission", "validate");
|
|
101
|
+
if (Array.isArray(data.guards)) {
|
|
102
|
+
for (const rg of data.guards)
|
|
103
|
+
addRef(rg?.guard, "guard", "validate");
|
|
104
|
+
}
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case "Repository": {
|
|
108
|
+
addRef(data.permission, "permission", "validate");
|
|
109
|
+
addRefArray(data.rewards, "rewards", "trigger");
|
|
110
|
+
if (Array.isArray(data.policies)) {
|
|
111
|
+
for (const policy of data.policies) {
|
|
112
|
+
if (Array.isArray(policy?.write_guard)) {
|
|
113
|
+
for (const wg of policy.write_guard)
|
|
114
|
+
addRef(wg?.guard, "write_guard", "validate");
|
|
115
|
+
}
|
|
116
|
+
addRefOption(policy?.quote_guard, "quote_guard", "validate");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
70
119
|
break;
|
|
71
120
|
}
|
|
72
|
-
case "Allocation":
|
|
73
|
-
case "Arbitration":
|
|
74
|
-
case "Reward":
|
|
75
|
-
case "Repository":
|
|
76
121
|
case "Demand": {
|
|
77
122
|
addRef(data.permission, "permission", "validate");
|
|
78
|
-
|
|
123
|
+
if (Array.isArray(data.guards)) {
|
|
124
|
+
for (const dg of data.guards)
|
|
125
|
+
addRef(dg?.guard, "guard", "validate");
|
|
126
|
+
}
|
|
127
|
+
addRefArray(data.rewards, "rewards", "trigger");
|
|
79
128
|
break;
|
|
80
129
|
}
|
|
81
130
|
case "Contact": {
|
|
@@ -86,9 +135,16 @@ function extractAddressFields(obj) {
|
|
|
86
135
|
break;
|
|
87
136
|
}
|
|
88
137
|
case "Payment": {
|
|
89
|
-
addRefOption(data.for_object, "for_object", "bind");
|
|
90
|
-
addRefOption(data.for_guard, "for_guard", "validate");
|
|
91
|
-
|
|
138
|
+
addRefOption(data.info?.for_object, "for_object", "bind");
|
|
139
|
+
addRefOption(data.info?.for_guard, "for_guard", "validate");
|
|
140
|
+
if (Array.isArray(data.record)) {
|
|
141
|
+
for (const r of data.record) {
|
|
142
|
+
const rec = r?.recipient;
|
|
143
|
+
if (rec && typeof rec === "object" && typeof rec.Entity === "string") {
|
|
144
|
+
addRef(rec.Entity, "recipient_entity", "consume");
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
92
148
|
break;
|
|
93
149
|
}
|
|
94
150
|
case "Guard": {
|
|
@@ -156,53 +212,71 @@ const EXPECTED_RELATIONSHIPS = new Map([
|
|
|
156
212
|
{ targetType: "Machine", fieldName: "machine", relationshipType: "bind", single: true },
|
|
157
213
|
{ targetType: "Guard", fieldName: "buy_guard", relationshipType: "validate", single: true },
|
|
158
214
|
{ targetType: "Permission", fieldName: "permission", relationshipType: "validate", single: true },
|
|
159
|
-
{ targetType: "
|
|
160
|
-
{ targetType: "
|
|
215
|
+
{ targetType: "Guard", fieldName: "allocator_guard", relationshipType: "validate" },
|
|
216
|
+
{ targetType: "Contact", fieldName: "um", relationshipType: "bind", single: true },
|
|
161
217
|
{ targetType: "Arbitration", fieldName: "arbitrations", relationshipType: "trigger" },
|
|
162
218
|
{ targetType: "Reward", fieldName: "rewards", relationshipType: "trigger" },
|
|
163
219
|
{ targetType: "Repository", fieldName: "repositories", relationshipType: "consume" },
|
|
164
220
|
]],
|
|
165
221
|
["Machine", [
|
|
166
|
-
{ targetType: "Guard", fieldName: "nodes.guard", relationshipType: "validate" },
|
|
167
222
|
{ targetType: "Permission", fieldName: "permission", relationshipType: "validate", single: true },
|
|
168
|
-
{ targetType: "Repository", fieldName: "
|
|
223
|
+
{ targetType: "Repository", fieldName: "consensus_repositories", relationshipType: "consume" },
|
|
224
|
+
{ targetType: "Contact", fieldName: "um", relationshipType: "bind", single: true },
|
|
169
225
|
]],
|
|
170
226
|
["Order", [
|
|
171
227
|
{ targetType: "Service", fieldName: "service", relationshipType: "consume", single: true },
|
|
228
|
+
{ targetType: "Machine", fieldName: "machine", relationshipType: "consume", single: true },
|
|
172
229
|
{ targetType: "Progress", fieldName: "progress", relationshipType: "trigger", single: true },
|
|
230
|
+
{ targetType: "Arb", fieldName: "dispute", relationshipType: "trigger" },
|
|
231
|
+
{ targetType: "Allocation", fieldName: "allocation", relationshipType: "bind", single: true },
|
|
173
232
|
]],
|
|
174
233
|
["Progress", [
|
|
175
|
-
{ targetType: "Machine", fieldName: "parent", relationshipType: "bind", single: true },
|
|
176
234
|
{ targetType: "Machine", fieldName: "machine", relationshipType: "bind", single: true },
|
|
235
|
+
{ targetType: "Repository", fieldName: "context_repositories", relationshipType: "consume" },
|
|
177
236
|
]],
|
|
178
237
|
["Allocation", [
|
|
179
|
-
{ targetType: "
|
|
180
|
-
{ targetType: "Guard", fieldName: "
|
|
238
|
+
{ targetType: "Guard", fieldName: "allocator_guard", relationshipType: "validate" },
|
|
239
|
+
{ targetType: "Guard", fieldName: "for_guard", relationshipType: "validate", single: true },
|
|
240
|
+
{ targetType: "Payment", fieldName: "payment", relationshipType: "trigger" },
|
|
181
241
|
]],
|
|
182
242
|
["Reward", [
|
|
183
|
-
{ targetType: "Guard", fieldName: "guard", relationshipType: "validate"
|
|
243
|
+
{ targetType: "Guard", fieldName: "guard", relationshipType: "validate" },
|
|
184
244
|
{ targetType: "Permission", fieldName: "permission", relationshipType: "validate", single: true },
|
|
245
|
+
{ targetType: "Contact", fieldName: "um", relationshipType: "bind", single: true },
|
|
185
246
|
]],
|
|
186
247
|
["Repository", [
|
|
187
|
-
{ targetType: "Guard", fieldName: "
|
|
248
|
+
{ targetType: "Guard", fieldName: "write_guard", relationshipType: "validate" },
|
|
249
|
+
{ targetType: "Guard", fieldName: "quote_guard", relationshipType: "validate", single: true },
|
|
188
250
|
{ targetType: "Permission", fieldName: "permission", relationshipType: "validate", single: true },
|
|
251
|
+
{ targetType: "Reward", fieldName: "rewards", relationshipType: "trigger" },
|
|
252
|
+
{ targetType: "Contact", fieldName: "um", relationshipType: "bind", single: true },
|
|
189
253
|
]],
|
|
190
254
|
["Demand", [
|
|
191
|
-
{ targetType: "
|
|
192
|
-
{ targetType: "Guard", fieldName: "guards", relationshipType: "validate" },
|
|
255
|
+
{ targetType: "Guard", fieldName: "guard", relationshipType: "validate" },
|
|
193
256
|
{ targetType: "Reward", fieldName: "rewards", relationshipType: "trigger" },
|
|
257
|
+
{ targetType: "Contact", fieldName: "um", relationshipType: "bind", single: true },
|
|
194
258
|
]],
|
|
195
259
|
["Treasury", [
|
|
196
260
|
{ targetType: "Permission", fieldName: "permission", relationshipType: "validate", single: true },
|
|
197
|
-
{ targetType: "Guard", fieldName: "
|
|
261
|
+
{ targetType: "Guard", fieldName: "external_deposit_guard", relationshipType: "validate" },
|
|
262
|
+
{ targetType: "Guard", fieldName: "external_withdraw_guard", relationshipType: "validate" },
|
|
263
|
+
{ targetType: "Contact", fieldName: "um", relationshipType: "bind", single: true },
|
|
198
264
|
]],
|
|
199
265
|
["Arbitration", [
|
|
200
266
|
{ targetType: "Permission", fieldName: "permission", relationshipType: "validate", single: true },
|
|
201
|
-
{ targetType: "Guard", fieldName: "
|
|
267
|
+
{ targetType: "Guard", fieldName: "voting_guard", relationshipType: "validate" },
|
|
268
|
+
{ targetType: "Guard", fieldName: "usage_guard", relationshipType: "validate", single: true },
|
|
269
|
+
{ targetType: "Contact", fieldName: "um", relationshipType: "bind", single: true },
|
|
202
270
|
]],
|
|
203
271
|
["Payment", [
|
|
204
272
|
{ targetType: "Guard", fieldName: "for_guard", relationshipType: "validate", single: true },
|
|
205
273
|
]],
|
|
274
|
+
["Contact", [
|
|
275
|
+
{ targetType: "Permission", fieldName: "permission", relationshipType: "validate", single: true },
|
|
276
|
+
]],
|
|
277
|
+
["Permission", [
|
|
278
|
+
{ targetType: "Contact", fieldName: "um", relationshipType: "bind", single: true },
|
|
279
|
+
]],
|
|
206
280
|
]);
|
|
207
281
|
export class GraphBuilder {
|
|
208
282
|
localProject;
|
|
@@ -449,7 +523,7 @@ export class GraphBuilder {
|
|
|
449
523
|
}
|
|
450
524
|
const byType = new Map();
|
|
451
525
|
for (const obj of projectObjects) {
|
|
452
|
-
const type = obj.objectType
|
|
526
|
+
const type = shortTypeName(obj.objectType);
|
|
453
527
|
if (!byType.has(type))
|
|
454
528
|
byType.set(type, []);
|
|
455
529
|
byType.get(type).push({
|
|
@@ -469,33 +543,31 @@ export class GraphBuilder {
|
|
|
469
543
|
const fieldKey = `${source.address}#${expected.fieldName}`;
|
|
470
544
|
const existingBindings = sourceFieldBindings.get(fieldKey);
|
|
471
545
|
const hasOtherBinding = existingBindings !== undefined && existingBindings.size > 0;
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
});
|
|
498
|
-
}
|
|
546
|
+
if (hasOtherBinding)
|
|
547
|
+
continue;
|
|
548
|
+
const representativeTarget = targets.find((t) => t.address !== source.address &&
|
|
549
|
+
!existingPairs.has(`${source.address}→${t.address}`) &&
|
|
550
|
+
!existingBindings?.has(t.address));
|
|
551
|
+
if (!representativeTarget)
|
|
552
|
+
continue;
|
|
553
|
+
potentialEdges.push({
|
|
554
|
+
sourceObject: source.address,
|
|
555
|
+
targetObject: representativeTarget.address,
|
|
556
|
+
edgeSource: "potential",
|
|
557
|
+
relationshipType: expected.relationshipType,
|
|
558
|
+
fieldName: expected.fieldName,
|
|
559
|
+
depth: 0,
|
|
560
|
+
verified: false,
|
|
561
|
+
weight: 0.6,
|
|
562
|
+
direction: "outbound",
|
|
563
|
+
metadata: {
|
|
564
|
+
reason: "expected_relationship_missing",
|
|
565
|
+
expected_target_type: expected.targetType,
|
|
566
|
+
source_object_name: source.name,
|
|
567
|
+
representative: true,
|
|
568
|
+
alternative_target_count: targets.length - 1,
|
|
569
|
+
},
|
|
570
|
+
});
|
|
499
571
|
}
|
|
500
572
|
}
|
|
501
573
|
}
|
|
@@ -504,6 +576,8 @@ export class GraphBuilder {
|
|
|
504
576
|
resolveConflicts(edges) {
|
|
505
577
|
const edgeMap = new Map();
|
|
506
578
|
for (const edge of edges) {
|
|
579
|
+
if (!edge.sourceObject || !edge.targetObject)
|
|
580
|
+
continue;
|
|
507
581
|
const key = `${edge.sourceObject}→${edge.targetObject}:${edge.relationshipType}`;
|
|
508
582
|
const list = edgeMap.get(key) ?? [];
|
|
509
583
|
list.push(edge);
|
|
@@ -541,12 +615,16 @@ export class GraphBuilder {
|
|
|
541
615
|
const ensureNode = (addr) => {
|
|
542
616
|
if (!nodeMap.has(addr)) {
|
|
543
617
|
const obj = objectCache.get(addr);
|
|
618
|
+
const queryName = obj?.query_name;
|
|
619
|
+
const objectName = queryName && queryName !== addr ? queryName : null;
|
|
620
|
+
const isTemplate = addr.startsWith("draft:");
|
|
544
621
|
nodeMap.set(addr, {
|
|
545
622
|
address: addr,
|
|
546
623
|
objectType: obj?.type ?? null,
|
|
547
|
-
objectName
|
|
624
|
+
objectName,
|
|
548
625
|
role: null,
|
|
549
626
|
isCore: addr === rootAddress,
|
|
627
|
+
isTemplate,
|
|
550
628
|
});
|
|
551
629
|
}
|
|
552
630
|
return nodeMap.get(addr);
|
package/dist/project/graph.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
|
-
import { type
|
|
2
|
+
import { type ProjectObject, type EvaluationType } from "@wowok/wowok";
|
|
3
3
|
import type { ProjectOperationInputSchema } from "../schema/project/index.js";
|
|
4
4
|
type ProjectInput = z.infer<typeof ProjectOperationInputSchema>;
|
|
5
5
|
export declare function handleListProjects(v: ProjectInput): Promise<{
|
|
6
6
|
action: "list_projects";
|
|
7
7
|
items: {
|
|
8
8
|
objectCount: number;
|
|
9
|
+
evaluationCount: number;
|
|
9
10
|
objectTypes: string[];
|
|
10
11
|
id: string;
|
|
11
12
|
prefix: string;
|
|
@@ -27,28 +28,104 @@ export declare function handleListProjects(v: ProjectInput): Promise<{
|
|
|
27
28
|
}>;
|
|
28
29
|
export declare function handleCreateProject(v: ProjectInput): Promise<{
|
|
29
30
|
action: "create_project";
|
|
30
|
-
project: Project;
|
|
31
|
+
project: import("@wowok/wowok").Project;
|
|
32
|
+
blueprint: {
|
|
33
|
+
objects_count: number;
|
|
34
|
+
edges_count: number;
|
|
35
|
+
industry_source: string;
|
|
36
|
+
applied_template: string;
|
|
37
|
+
steps_count: number;
|
|
38
|
+
scenarios_count: number;
|
|
39
|
+
key_risk: string | undefined;
|
|
40
|
+
};
|
|
41
|
+
recommended_creation_order: {
|
|
42
|
+
step: number;
|
|
43
|
+
object: string;
|
|
44
|
+
reason: string;
|
|
45
|
+
required: boolean;
|
|
46
|
+
}[];
|
|
47
|
+
blueprint_warning?: undefined;
|
|
48
|
+
blueprint_skipped?: undefined;
|
|
49
|
+
hint?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
action: "create_project";
|
|
52
|
+
project: import("@wowok/wowok").Project;
|
|
53
|
+
blueprint_warning: string;
|
|
54
|
+
recommended_creation_order: {
|
|
55
|
+
step: number;
|
|
56
|
+
object: string;
|
|
57
|
+
reason: string;
|
|
58
|
+
required: boolean;
|
|
59
|
+
}[];
|
|
60
|
+
blueprint?: undefined;
|
|
61
|
+
blueprint_skipped?: undefined;
|
|
62
|
+
hint?: undefined;
|
|
63
|
+
} | {
|
|
64
|
+
action: "create_project";
|
|
65
|
+
project: import("@wowok/wowok").Project;
|
|
66
|
+
blueprint_skipped: boolean;
|
|
67
|
+
hint: string;
|
|
68
|
+
recommended_creation_order: {
|
|
69
|
+
step: number;
|
|
70
|
+
object: string;
|
|
71
|
+
reason: string;
|
|
72
|
+
required: boolean;
|
|
73
|
+
}[];
|
|
74
|
+
blueprint?: undefined;
|
|
75
|
+
blueprint_warning?: undefined;
|
|
76
|
+
} | {
|
|
77
|
+
action: "create_project";
|
|
78
|
+
project: import("@wowok/wowok").Project;
|
|
79
|
+
recommended_creation_order: {
|
|
80
|
+
step: number;
|
|
81
|
+
object: string;
|
|
82
|
+
reason: string;
|
|
83
|
+
required: boolean;
|
|
84
|
+
}[];
|
|
85
|
+
blueprint?: undefined;
|
|
86
|
+
blueprint_warning?: undefined;
|
|
87
|
+
blueprint_skipped?: undefined;
|
|
88
|
+
hint?: undefined;
|
|
31
89
|
}>;
|
|
32
90
|
export declare function handleCreateProjectFromOnchain(v: ProjectInput): Promise<{
|
|
33
91
|
action: "create_project_from_onchain";
|
|
34
|
-
project: Project;
|
|
92
|
+
project: import("@wowok/wowok").Project;
|
|
35
93
|
objects: ProjectObject[];
|
|
36
94
|
graphEdgeCount: number;
|
|
37
95
|
}>;
|
|
38
96
|
export declare function handleUpdateProject(v: ProjectInput): Promise<{
|
|
39
97
|
action: "update_project";
|
|
40
|
-
project: Project;
|
|
98
|
+
project: import("@wowok/wowok").Project;
|
|
41
99
|
}>;
|
|
42
100
|
export declare function handleGetProjectDetail(v: ProjectInput): Promise<{
|
|
43
101
|
action: "get_project_detail";
|
|
44
|
-
project: Project;
|
|
102
|
+
project: import("@wowok/wowok").Project;
|
|
45
103
|
objects: ProjectObject[];
|
|
104
|
+
objectGroups: {
|
|
105
|
+
core: ProjectObject[];
|
|
106
|
+
dependency: ProjectObject[];
|
|
107
|
+
reference: ProjectObject[];
|
|
108
|
+
other: ProjectObject[];
|
|
109
|
+
stats: {
|
|
110
|
+
total: number;
|
|
111
|
+
core_count: number;
|
|
112
|
+
dependency_count: number;
|
|
113
|
+
reference_count: number;
|
|
114
|
+
other_count: number;
|
|
115
|
+
by_type: Record<string, number>;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
46
118
|
graphEdgeCount: number;
|
|
119
|
+
serviceStatus: {
|
|
120
|
+
published: boolean | null;
|
|
121
|
+
paused: boolean | null;
|
|
122
|
+
} | null;
|
|
47
123
|
evaluations: {
|
|
48
124
|
id: string;
|
|
49
125
|
evalType: EvaluationType;
|
|
50
126
|
score: number | null;
|
|
51
127
|
summary: string | null;
|
|
128
|
+
details: Record<string, unknown> | null;
|
|
52
129
|
evaluatedAt: number;
|
|
53
130
|
}[];
|
|
54
131
|
versions: {
|
|
@@ -84,6 +161,31 @@ export declare function handleBuildGraph(v: ProjectInput): Promise<{
|
|
|
84
161
|
edgesBySource: Record<string, number>;
|
|
85
162
|
reputationCount: number;
|
|
86
163
|
builtAt: number;
|
|
164
|
+
topEdges: {
|
|
165
|
+
source: string;
|
|
166
|
+
target: string;
|
|
167
|
+
fieldName: string | null;
|
|
168
|
+
relationshipType: import("@wowok/wowok").RelationshipType;
|
|
169
|
+
weight: number;
|
|
170
|
+
verified: boolean;
|
|
171
|
+
}[];
|
|
172
|
+
visualization: string;
|
|
173
|
+
hint: string;
|
|
174
|
+
binding_verification: {
|
|
175
|
+
service: string;
|
|
176
|
+
bindings: Record<string, {
|
|
177
|
+
expected: string;
|
|
178
|
+
actual: string | null;
|
|
179
|
+
count?: number;
|
|
180
|
+
verified: boolean;
|
|
181
|
+
}>;
|
|
182
|
+
all_verified: boolean;
|
|
183
|
+
} | null;
|
|
184
|
+
} | {
|
|
185
|
+
action: "build_graph";
|
|
186
|
+
async_mode: true;
|
|
187
|
+
task_id: string;
|
|
188
|
+
hint: string;
|
|
87
189
|
}>;
|
|
88
190
|
export declare function handleGetGraph(v: ProjectInput): Promise<{
|
|
89
191
|
action: "get_graph";
|
|
@@ -137,6 +239,15 @@ export declare function handleDeleteProject(v: ProjectInput): Promise<{
|
|
|
137
239
|
action: "delete_project";
|
|
138
240
|
deleted: true;
|
|
139
241
|
}>;
|
|
242
|
+
export declare function handleCloneProjectToNetwork(v: ProjectInput): Promise<{
|
|
243
|
+
action: "clone_project_to_network" | "migrate_network";
|
|
244
|
+
new_project_id: string;
|
|
245
|
+
new_prefix: string;
|
|
246
|
+
target_network: "testnet" | "mainnet";
|
|
247
|
+
cloned_objects_count: number;
|
|
248
|
+
message: string;
|
|
249
|
+
next_steps: string;
|
|
250
|
+
}>;
|
|
140
251
|
export declare function handleGetObjectDiff(v: ProjectInput): Promise<{
|
|
141
252
|
action: "get_object_diff";
|
|
142
253
|
address: string;
|
|
@@ -149,4 +260,109 @@ export declare function handleGetObjectDiff(v: ProjectInput): Promise<{
|
|
|
149
260
|
changeType: "modified" | "removed" | "added";
|
|
150
261
|
}[];
|
|
151
262
|
}>;
|
|
263
|
+
declare function normalizeForwards(raw: unknown): {
|
|
264
|
+
name: string;
|
|
265
|
+
weight: number;
|
|
266
|
+
guard: string | null;
|
|
267
|
+
retained_submission: number[] | null;
|
|
268
|
+
named_operator: string | null;
|
|
269
|
+
permission_index: number | null;
|
|
270
|
+
}[];
|
|
271
|
+
export declare function handleGetMachineGraph(v: ProjectInput): Promise<{
|
|
272
|
+
action: "get_machine_graph";
|
|
273
|
+
machineAddress: string;
|
|
274
|
+
machineName: string | null;
|
|
275
|
+
nodes: {
|
|
276
|
+
name: string;
|
|
277
|
+
description: string | null;
|
|
278
|
+
}[];
|
|
279
|
+
edges: {
|
|
280
|
+
from: string;
|
|
281
|
+
to: string;
|
|
282
|
+
threshold: number;
|
|
283
|
+
forwards: ReturnType<typeof normalizeForwards>;
|
|
284
|
+
}[];
|
|
285
|
+
published: boolean | null;
|
|
286
|
+
paused: boolean | null;
|
|
287
|
+
}>;
|
|
288
|
+
export declare function handlePreEvaluateCheck(v: ProjectInput): Promise<{
|
|
289
|
+
action: "pre_evaluate_check";
|
|
290
|
+
ready: boolean;
|
|
291
|
+
missing: {
|
|
292
|
+
id: string;
|
|
293
|
+
description: string;
|
|
294
|
+
impact: string;
|
|
295
|
+
}[];
|
|
296
|
+
warnings: {
|
|
297
|
+
id: string;
|
|
298
|
+
description: string;
|
|
299
|
+
impact: string;
|
|
300
|
+
}[];
|
|
301
|
+
summary: string;
|
|
302
|
+
counts?: undefined;
|
|
303
|
+
} | {
|
|
304
|
+
action: "pre_evaluate_check";
|
|
305
|
+
ready: boolean;
|
|
306
|
+
missing: {
|
|
307
|
+
id: string;
|
|
308
|
+
description: string;
|
|
309
|
+
impact: string;
|
|
310
|
+
}[];
|
|
311
|
+
warnings: {
|
|
312
|
+
id: string;
|
|
313
|
+
description: string;
|
|
314
|
+
impact: string;
|
|
315
|
+
}[];
|
|
316
|
+
summary: string;
|
|
317
|
+
counts: {
|
|
318
|
+
objects: number;
|
|
319
|
+
edges: number;
|
|
320
|
+
uncached: number;
|
|
321
|
+
stale: number;
|
|
322
|
+
dangling_edges: number;
|
|
323
|
+
drafts: number;
|
|
324
|
+
};
|
|
325
|
+
}>;
|
|
326
|
+
export declare function handleVerifyDeployment(v: ProjectInput): Promise<{
|
|
327
|
+
action: "verify_deployment";
|
|
328
|
+
verifiedCount: number;
|
|
329
|
+
matched: number;
|
|
330
|
+
mismatched: number;
|
|
331
|
+
missing: number;
|
|
332
|
+
unreachable: number;
|
|
333
|
+
results: {
|
|
334
|
+
objectAddress: string;
|
|
335
|
+
objectName: string | null;
|
|
336
|
+
objectType: string | null;
|
|
337
|
+
status: "unreachable";
|
|
338
|
+
error: string;
|
|
339
|
+
}[];
|
|
340
|
+
summary: string;
|
|
341
|
+
} | {
|
|
342
|
+
action: "verify_deployment";
|
|
343
|
+
verifiedCount: number;
|
|
344
|
+
matched: number;
|
|
345
|
+
mismatched: number;
|
|
346
|
+
missing: number;
|
|
347
|
+
unreachable: number;
|
|
348
|
+
results: {
|
|
349
|
+
objectAddress: string;
|
|
350
|
+
objectName: string | null;
|
|
351
|
+
objectType: string | null;
|
|
352
|
+
status: "matched" | "mismatched" | "missing" | "unreachable";
|
|
353
|
+
error?: string;
|
|
354
|
+
differences?: Array<{
|
|
355
|
+
field: string;
|
|
356
|
+
sqlite: unknown;
|
|
357
|
+
onchain: unknown;
|
|
358
|
+
}>;
|
|
359
|
+
bindings?: {
|
|
360
|
+
machine: boolean;
|
|
361
|
+
permission: boolean;
|
|
362
|
+
buy_guard: boolean;
|
|
363
|
+
order_allocators: boolean;
|
|
364
|
+
};
|
|
365
|
+
}[];
|
|
366
|
+
summary: string;
|
|
367
|
+
}>;
|
|
152
368
|
export {};
|