@wowok/agent-mcp 2.6.0 → 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/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/knowledge/deployment-scanner.d.ts +3 -0
- package/dist/knowledge/deployment-scanner.js +64 -3
- 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/service-confirm.d.ts +14 -5
- package/dist/knowledge/service-confirm.js +116 -8
- package/dist/knowledge/tool-constraints.js +6 -2
- package/dist/project/deployment-bridge.d.ts +1 -1
- package/dist/project/deployment-bridge.js +27 -4
- 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 +569 -84
- package/dist/project/graph-builder.d.ts +4 -1
- package/dist/project/graph-builder.js +126 -61
- package/dist/project/graph.d.ts +1 -0
- package/dist/project/handlers.d.ts +219 -5
- package/dist/project/handlers.js +819 -9
- 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/local/index.d.ts +32 -35
- package/dist/schema/local/index.js +23 -5
- package/dist/schema/messenger/index.d.ts +274 -46
- package/dist/schema/operations.d.ts +680 -539
- package/dist/schema/operations.js +22 -0
- package/dist/schema/project/index.d.ts +1796 -80
- package/dist/schema/project/index.js +304 -14
- package/dist/schema/query/index.d.ts +705 -349
- 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/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 +7 -1
- package/dist/schemas/account_operation.schema.json +2 -2
- 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 +4 -4
- 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 +1175 -23
- package/dist/schemas/project_operation.schema.json +40 -4
- package/dist/schemas/query_toolkit.output.json +104 -76
- package/dist/schemas/query_toolkit.schema.json +9 -9
- package/dist/schemas/schema_query.output.json +7 -3
- package/dist/schemas/schema_query.schema.json +17 -3
- package/dist/tools/handlers/local.js +20 -5
- package/dist/tools/handlers/onchain.js +23 -0
- package/dist/tools/handlers/project.js +52 -3
- 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 +211 -7
- 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
|
@@ -69,11 +69,17 @@ export const ProjectOperationInputSchema = z
|
|
|
69
69
|
"get_object_diff",
|
|
70
70
|
"delete_project",
|
|
71
71
|
"assemble_context",
|
|
72
|
+
"get_machine_graph",
|
|
72
73
|
"generate_deployment_doc",
|
|
74
|
+
"pre_evaluate_check",
|
|
75
|
+
"verify_deployment",
|
|
76
|
+
"clone_project_to_network",
|
|
77
|
+
"migrate_network",
|
|
73
78
|
])
|
|
74
79
|
.describe("Action to perform. Two categories:\n" +
|
|
75
80
|
"1. Project Entity + Evaluation (15, GLM6): list_projects, create_project, create_project_from_onchain, update_project, get_project_detail, add_object, remove_object, create_version, build_graph, get_graph, evaluate_project, save_evaluation, compare_projects, refresh_objects, get_object_diff. Projects are first-class entities with SQLite persistence, rigid project-object relationships, three-pathway graph construction, and a dual rule-based + LLM-assisted evaluation engine.\n" +
|
|
76
|
-
"2. Context Assembly (1): assemble_context (query on-chain object states + extract embedded history + optional events, and assemble a structured semantic context for LLM consumption). Required input: context_objects (array of object IDs/names). Optional: include_events (query recent state-transition events)
|
|
81
|
+
"2. Context Assembly (1): assemble_context (query on-chain object states + extract embedded history + optional events, and assemble a structured semantic context for LLM consumption). Required input: context_objects (array of object IDs/names). Optional: include_events (query recent state-transition events).\n" +
|
|
82
|
+
"3. Cross-Network Migration (FIX-012): clone_project_to_network (or its alias migrate_network) copies a source project's object metadata to a new project bound to target_network. The 5-step migration workflow: 1) call clone_project_to_network (or migrate_network) with target_network to copy metadata, 2) re-run onchain_operations with env.network=target_network to deploy objects on-chain, 3) re-register LocalMark names with the SAME names on the target network (FIX-011 cross-network consistency), 4) update_project to set service_address on the new project, 5) build_graph to construct the new project's relationship graph."),
|
|
77
83
|
project: z
|
|
78
84
|
.string()
|
|
79
85
|
.optional()
|
|
@@ -118,7 +124,17 @@ export const ProjectOperationInputSchema = z
|
|
|
118
124
|
.max(2000)
|
|
119
125
|
.optional()
|
|
120
126
|
.describe("Project description for create_project / update_project."),
|
|
121
|
-
project_industry: IndustryEnum.optional().describe("Industry tag for create_project. Drives template defaults
|
|
127
|
+
project_industry: IndustryEnum.optional().describe("Industry tag for create_project. Drives template defaults — when set " +
|
|
128
|
+
"(and not 'general'), the system auto-applies an industry blueprint " +
|
|
129
|
+
"with ~10 draft objects (Permission, Service, Machine, Guard, Treasury, " +
|
|
130
|
+
"Allocation, etc.) + graph edges, ready for deployment. " +
|
|
131
|
+
"Supported industries: 'general' (no template), 'retail', 'service', " +
|
|
132
|
+
"'rental', 'freelance', 'education', 'travel', 'subscription', 'custom'. " +
|
|
133
|
+
"Each industry preset embeds risk constraints (e.g., 'freelance' does " +
|
|
134
|
+
"NOT require compensation_fund, while 'rental'/'travel' do). " +
|
|
135
|
+
"Example: project_industry='freelance' creates a freelance-style " +
|
|
136
|
+
"blueprint with setting_locked_time ≥ 7d. " +
|
|
137
|
+
"Set skip_templates=true to bypass template application."),
|
|
122
138
|
project_perspective: z
|
|
123
139
|
.enum(["producer", "consumer", "both"])
|
|
124
140
|
.optional()
|
|
@@ -135,6 +151,13 @@ export const ProjectOperationInputSchema = z
|
|
|
135
151
|
.enum(["testnet", "mainnet"])
|
|
136
152
|
.optional()
|
|
137
153
|
.describe("Network the project is bound to. A Service deployed to different networks are different projects. Defaults to 'testnet'."),
|
|
154
|
+
skip_templates: z
|
|
155
|
+
.boolean()
|
|
156
|
+
.optional()
|
|
157
|
+
.describe("When true, create_project skips applying the industry template (no draft:* blueprint objects). " +
|
|
158
|
+
"Use this when you want a clean project with no pre-filled blueprint objects — useful for " +
|
|
159
|
+
"custom architectures that do not match any industry mode, or to avoid draft objects " +
|
|
160
|
+
"appearing in build_graph / evaluate_project before deployment. Defaults to false (templates applied)."),
|
|
138
161
|
project_id: z
|
|
139
162
|
.string()
|
|
140
163
|
.optional()
|
|
@@ -143,10 +166,20 @@ export const ProjectOperationInputSchema = z
|
|
|
143
166
|
.enum(["draft", "active", "inactive", "archived"])
|
|
144
167
|
.optional()
|
|
145
168
|
.describe("New status for update_project. 'active' projects are live, 'archived' are read-only."),
|
|
169
|
+
target_network: z
|
|
170
|
+
.enum(["testnet", "mainnet"])
|
|
171
|
+
.optional()
|
|
172
|
+
.describe("Target network for clone_project_to_network (or its alias migrate_network). " +
|
|
173
|
+
"The source project's objects are copied to a new project bound to this network. " +
|
|
174
|
+
"The new project's prefix is '<source_prefix>_<target_network>' to avoid collision. " +
|
|
175
|
+
"See the action description for the full 5-step migration workflow (FIX-012)."),
|
|
146
176
|
object_address: z
|
|
147
177
|
.string()
|
|
148
178
|
.optional()
|
|
149
|
-
.describe("On-chain object address (0x
|
|
179
|
+
.describe("On-chain object address (0x followed by 32-64 hex chars) for add_object / remove_object. " +
|
|
180
|
+
"Also accepts the internal 'draft:<name>' sentinel used by create_project for blueprint objects not yet on-chain. " +
|
|
181
|
+
"For add_object, alternatively use object_name_add to resolve via LocalMark. " +
|
|
182
|
+
"H-06 fix: invalid formats are rejected at the handler level with a descriptive error."),
|
|
150
183
|
object_name_add: z
|
|
151
184
|
.string()
|
|
152
185
|
.optional()
|
|
@@ -207,6 +240,13 @@ export const ProjectOperationInputSchema = z
|
|
|
207
240
|
.max(5)
|
|
208
241
|
.optional()
|
|
209
242
|
.describe("Max recursion depth for Pathway 1 (internal reference derivation) in build_graph. Default 3."),
|
|
243
|
+
depth: z
|
|
244
|
+
.number()
|
|
245
|
+
.int()
|
|
246
|
+
.min(1)
|
|
247
|
+
.max(5)
|
|
248
|
+
.optional()
|
|
249
|
+
.describe("Alias for max_depth (build_graph). When both are set, max_depth takes precedence. Default 3."),
|
|
210
250
|
enable_registrar: z
|
|
211
251
|
.boolean()
|
|
212
252
|
.optional()
|
|
@@ -215,6 +255,13 @@ export const ProjectOperationInputSchema = z
|
|
|
215
255
|
.boolean()
|
|
216
256
|
.optional()
|
|
217
257
|
.describe("Enable Pathway 3 (potential relationship detection) in build_graph. Default false."),
|
|
258
|
+
async_mode: z
|
|
259
|
+
.boolean()
|
|
260
|
+
.optional()
|
|
261
|
+
.describe("When true, build_graph / evaluate_project runs in the background and returns { task_id } immediately. " +
|
|
262
|
+
"Poll query_task_status(task_id) to check progress and retrieve the result. " +
|
|
263
|
+
"Default false (synchronous). Use async_mode=true for large projects with enable_potential=true " +
|
|
264
|
+
"where build may take >10s."),
|
|
218
265
|
evaluation_type: z
|
|
219
266
|
.enum(["risk", "trust", "completeness", "value", "worth_buying"])
|
|
220
267
|
.optional()
|
|
@@ -265,6 +312,14 @@ export const ProjectOperationInputSchema = z
|
|
|
265
312
|
.boolean()
|
|
266
313
|
.optional()
|
|
267
314
|
.describe("When true (default), persist the generated MD to SQLite project_documents table for generate_deployment_doc."),
|
|
315
|
+
detail_level: z
|
|
316
|
+
.enum(["summary", "detailed", "full"])
|
|
317
|
+
.optional()
|
|
318
|
+
.describe("P2-03: Deployment document detail level (only for generate_deployment_doc). " +
|
|
319
|
+
"'summary' (default): object name + type + key bindings (machine, permission, buy_guard, order_allocators). " +
|
|
320
|
+
"'detailed': adds sale list, arbitration list, reward list. " +
|
|
321
|
+
"'full': complete fields including stock, price, wip_hash, all config. " +
|
|
322
|
+
"Use 'summary' for quick review; request 'detailed' or 'full' only when deeper inspection is needed."),
|
|
268
323
|
})
|
|
269
324
|
.strict();
|
|
270
325
|
const AssembleContextResultSchema = z
|
|
@@ -314,10 +369,10 @@ const ProjectObjectSchema = z
|
|
|
314
369
|
.object({
|
|
315
370
|
id: z.string().describe("ProjectObject UUID (project_objects.id)."),
|
|
316
371
|
projectId: z.string().describe("Owning project UUID."),
|
|
317
|
-
objectAddress: z.string().describe("On-chain object address (0x...)."),
|
|
372
|
+
objectAddress: z.string().describe("On-chain object address (0x...) or 'draft:<name>' sentinel for blueprint objects."),
|
|
318
373
|
objectType: z.string().nullable().describe("Object type (Service, Machine, etc.) or null if unknown."),
|
|
319
374
|
objectName: z.string().nullable().describe("LocalMark name or null."),
|
|
320
|
-
role: z.
|
|
375
|
+
role: z.string().describe("Object role in project. Valid values: 'core' (the Service), 'dependency' (required binding), 'reference' (optional/auxiliary). Other values indicate data corruption — see objectGroups.other bucket."),
|
|
321
376
|
tags: z.array(z.string()).nullable().describe("Tags array or null."),
|
|
322
377
|
addedAt: z.number().describe("Timestamp (ms) when added to project."),
|
|
323
378
|
metadata: z.record(z.unknown()).nullable().describe("Arbitrary metadata key-value pairs or null."),
|
|
@@ -354,8 +409,31 @@ const ListProjectsResultSchema = z
|
|
|
354
409
|
total: z.number().describe("Total number of projects returned."),
|
|
355
410
|
})
|
|
356
411
|
.strict();
|
|
412
|
+
const RecommendedCreationOrderItemSchema = z.object({
|
|
413
|
+
step: z.number().describe("Step number (1-based)."),
|
|
414
|
+
object: z.string().describe("Object type to create (e.g. 'Permission', 'Service (unpublished)')."),
|
|
415
|
+
reason: z.string().describe("Why this step is here, including dependencies and irreversibility notes."),
|
|
416
|
+
required: z.boolean().describe("Whether this step is mandatory for a working deployment."),
|
|
417
|
+
}).strict();
|
|
357
418
|
const CreateProjectResultSchema = z
|
|
358
|
-
.object({
|
|
419
|
+
.object({
|
|
420
|
+
action: z.literal("create_project"),
|
|
421
|
+
project: ProjectSchema.describe("The created project."),
|
|
422
|
+
recommended_creation_order: z.array(RecommendedCreationOrderItemSchema).describe("Canonical deployment sequence satisfying dependency constraints. " +
|
|
423
|
+
"All industries share this base order; see IndustryMode.build_notes for industry-specific deviations."),
|
|
424
|
+
blueprint: z.object({
|
|
425
|
+
objects_count: z.number().describe("Number of draft objects created from the template."),
|
|
426
|
+
edges_count: z.number().describe("Number of graph edges from the template."),
|
|
427
|
+
industry_source: z.string().describe("Industry mode name that sourced the template."),
|
|
428
|
+
applied_template: z.string().describe("Template identifier applied."),
|
|
429
|
+
steps_count: z.number().describe("Number of deployment steps in the template."),
|
|
430
|
+
scenarios_count: z.number().describe("Number of scenarios in the template."),
|
|
431
|
+
key_risk: z.string().nullable().optional().describe("Industry-specific key risk note (or null)."),
|
|
432
|
+
}).strict().optional().describe("Blueprint summary — present when industry template applied successfully. Objects have status='draft' and address='draft:<name>'."),
|
|
433
|
+
blueprint_warning: z.string().optional().describe("Warning message — present when industry template application failed. Project is created without blueprint; use add_object to manually add objects."),
|
|
434
|
+
blueprint_skipped: z.boolean().optional().describe("True when skip_templates=true was passed — no industry blueprint objects were created."),
|
|
435
|
+
hint: z.string().optional().describe("User-facing hint — guides to next action (e.g. add_object, generate_deployment_doc)."),
|
|
436
|
+
})
|
|
359
437
|
.strict();
|
|
360
438
|
const CreateProjectFromOnchainResultSchema = z
|
|
361
439
|
.object({
|
|
@@ -395,8 +473,30 @@ const GetProjectDetailResultSchema = z
|
|
|
395
473
|
.object({
|
|
396
474
|
action: z.literal("get_project_detail"),
|
|
397
475
|
project: ProjectSchema,
|
|
398
|
-
objects: z.array(ProjectObjectSchema).describe("Project objects (rigid relationships)."),
|
|
476
|
+
objects: z.array(ProjectObjectSchema).describe("Project objects (rigid relationships). Flat list — use objectGroups for role-based navigation."),
|
|
477
|
+
objectGroups: z.object({
|
|
478
|
+
core: z.array(ProjectObjectSchema).describe("Core objects (the Service) — the primary deliverable of the project."),
|
|
479
|
+
dependency: z.array(ProjectObjectSchema).describe("Dependency objects (Permission, Machine, Guard, Allocation, Treasury, etc.) — required for the Service to function."),
|
|
480
|
+
reference: z.array(ProjectObjectSchema).describe("Reference objects (read-only or external) — tracked but not owned by this project."),
|
|
481
|
+
other: z.array(ProjectObjectSchema).describe("Objects with invalid or missing role (data corruption, legacy data). Grouped here for visibility — should normally be empty. Check server logs for warnings."),
|
|
482
|
+
stats: z.object({
|
|
483
|
+
total: z.number().describe("Total object count."),
|
|
484
|
+
core_count: z.number().describe("Number of core objects."),
|
|
485
|
+
dependency_count: z.number().describe("Number of dependency objects."),
|
|
486
|
+
reference_count: z.number().describe("Number of reference objects."),
|
|
487
|
+
other_count: z.number().describe("Number of objects with invalid/missing role (in 'other' bucket). Normally 0."),
|
|
488
|
+
by_type: z.record(z.string(), z.number()).describe("Object count grouped by objectType prefix (e.g. {'service': 1, 'permission': 1, 'guard': 5})."),
|
|
489
|
+
}).strict().describe("Aggregate counts for quick project sizing."),
|
|
490
|
+
}).strict().describe("Objects grouped by role (core/dependency/reference/other) for easier navigation. The 'other' bucket captures objects with invalid roles (H-05 fix). The flat `objects` array is preserved for backward compatibility."),
|
|
399
491
|
graphEdgeCount: z.number().describe("Number of persisted graph edges."),
|
|
492
|
+
serviceStatus: z
|
|
493
|
+
.object({
|
|
494
|
+
published: z.boolean().nullable().describe("Whether the on-chain Service is published (live). null = unknown / query failed."),
|
|
495
|
+
paused: z.boolean().nullable().describe("Whether the on-chain Service is paused (not accepting orders). null = unknown."),
|
|
496
|
+
})
|
|
497
|
+
.strict()
|
|
498
|
+
.nullable()
|
|
499
|
+
.describe("On-chain Service status (published / paused). Separate from the project's local lifecycle status. null if the project has no serviceAddress or the on-chain query failed."),
|
|
400
500
|
evaluations: z
|
|
401
501
|
.array(z.object({
|
|
402
502
|
id: z.string(),
|
|
@@ -441,11 +541,39 @@ const CreateVersionResultSchema = z
|
|
|
441
541
|
const BuildGraphResultSchema = z
|
|
442
542
|
.object({
|
|
443
543
|
action: z.literal("build_graph"),
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
544
|
+
async_mode: z.boolean().optional().describe("True when graph is building asynchronously (background task). When true, call query_task_status with task_id to retrieve the result."),
|
|
545
|
+
task_id: z.string().optional().describe("Async task id — present only when async_mode=true. Use with query_task_status."),
|
|
546
|
+
nodeCount: z.number().optional().describe("Total nodes in the constructed graph (sync mode only)."),
|
|
547
|
+
edgeCount: z.number().optional().describe("Total edges (after conflict resolution + dedup) (sync mode only)."),
|
|
548
|
+
edgesBySource: z.record(z.string(), z.number()).optional().describe("Edge counts by source: { internal: N, registrar: N, potential: N } (sync mode only)."),
|
|
549
|
+
reputationCount: z.number().optional().describe("Number of objects with Registrar reputation data (sync mode only)."),
|
|
550
|
+
builtAt: z.number().optional().describe("Build timestamp in ms (sync mode only)."),
|
|
551
|
+
binding_verification: z
|
|
552
|
+
.object({
|
|
553
|
+
service: z.string().describe("Service object address that was verified."),
|
|
554
|
+
bindings: z
|
|
555
|
+
.record(z.string(), z.object({
|
|
556
|
+
expected: z.string().describe("Expected target object type."),
|
|
557
|
+
actual: z.string().nullable().describe("Actual on-chain value (address or null)."),
|
|
558
|
+
count: z.number().optional().describe("Item count for array fields (order_allocators, arbitrations)."),
|
|
559
|
+
verified: z.boolean().describe("Whether the binding exists on-chain."),
|
|
560
|
+
}))
|
|
561
|
+
.describe("Per-field binding verification result."),
|
|
562
|
+
all_verified: z.boolean().describe("True when all critical bindings exist on-chain."),
|
|
563
|
+
})
|
|
564
|
+
.nullable()
|
|
565
|
+
.optional()
|
|
566
|
+
.describe("On-chain verification of Service bindings (F-15). Null when no Service address or query failed. Sync mode only."),
|
|
567
|
+
topEdges: z.array(z.object({
|
|
568
|
+
source: z.string().describe("Source object address."),
|
|
569
|
+
target: z.string().describe("Target object address."),
|
|
570
|
+
fieldName: z.string().nullable().describe("Field name on the source object (or null)."),
|
|
571
|
+
relationshipType: z.string().describe("Relationship type (bind, create, trigger, etc.)."),
|
|
572
|
+
weight: z.number().nullable().describe("Edge weight (0-1, higher = more important)."),
|
|
573
|
+
verified: z.boolean().describe("Whether the edge has been verified on-chain."),
|
|
574
|
+
}).strict()).optional().describe("Top 5 critical edges by weight (sync mode only). Preview of the most important relationships — call get_graph for the full list."),
|
|
575
|
+
visualization: z.string().optional().describe("Mermaid-style ASCII visualization of top edges (sync mode only). Compact format: 'source --field--> target'."),
|
|
576
|
+
hint: z.string().optional().describe("User-facing hint — guides to next action (e.g. call get_graph for full list, or query_task_status for async result)."),
|
|
449
577
|
})
|
|
450
578
|
.strict();
|
|
451
579
|
const GetGraphResultSchema = z
|
|
@@ -550,10 +678,167 @@ const GenerateDeploymentDocResultSchema = z
|
|
|
550
678
|
description: z.string(),
|
|
551
679
|
status: z.enum(["PASS", "FAIL", "WARN"]),
|
|
552
680
|
notes: z.string().optional(),
|
|
553
|
-
}).strict()).describe("D-01..D-
|
|
681
|
+
}).strict()).describe("D-01..D-20 check results (20 deployment checks including D-19 Machine entry-node forward and D-20 Service compensation_fund)."),
|
|
554
682
|
errors: z.array(z.string()).describe("List of FAIL error messages."),
|
|
555
|
-
}).strict().describe("Deployment doc validation result against D-01..D-
|
|
683
|
+
}).strict().describe("Deployment doc validation result against D-01..D-20."),
|
|
556
684
|
saved: z.boolean().describe("Whether the markdown was persisted to SQLite project_documents table."),
|
|
685
|
+
detail_level: z.enum(["summary", "detailed", "full"]).describe("Effective detail level used to render the deployment doc. " +
|
|
686
|
+
"'summary' (default) shows only key bindings; 'detailed' adds sale/arbitration lists; 'full' shows complete config."),
|
|
687
|
+
stage_gate: z.object({
|
|
688
|
+
stage: z.number().describe("The stage that was validated (4 = deployment doc generation gate)."),
|
|
689
|
+
passed: z.boolean().describe("True iff no FAIL checks exist — gate allows advancing to Stage 5."),
|
|
690
|
+
can_proceed: z.boolean().describe("Alias for `passed` — whether the stage gate allows advancement."),
|
|
691
|
+
blocking_issues: z.array(z.string()).describe("FAIL status messages — must be resolved before deploying."),
|
|
692
|
+
warnings: z.array(z.string()).describe("WARN status messages — non-blocking, user may proceed at own risk."),
|
|
693
|
+
checks: z.array(z.object({
|
|
694
|
+
dimension: z.enum(["semantic", "tools", "reversibility", "risk", "isolation", "gas_budget"]).describe("The validation dimension."),
|
|
695
|
+
status: z.enum(["PASS", "WARN", "FAIL"]).describe("Check result status."),
|
|
696
|
+
message: z.string().describe("Human-readable check result message."),
|
|
697
|
+
}).strict()).describe("Per-dimension check results."),
|
|
698
|
+
}).strict().describe("Stage gate validation (GLM6 5-stage lifecycle 衔接). Validates Stage 3 risk score threshold (>=80 PASS, >=50 WARN, <50 FAIL) and Stage 4 deployment doc generation prerequisite."),
|
|
699
|
+
deployment_scan: z.object({
|
|
700
|
+
overall_readiness: z.enum(["ready", "blocked", "warnings"]).describe("'ready' = all 20 checks pass; 'blocked' = any critical fail; 'warnings' = only warning fails."),
|
|
701
|
+
critical_count: z.number().describe("Number of critical findings (blocks deployment)."),
|
|
702
|
+
warning_count: z.number().describe("Number of warning findings (non-blocking)."),
|
|
703
|
+
findings: z.array(z.object({
|
|
704
|
+
check_id: z.string().describe("D-XX check id (e.g. 'D-19') or sub-id (e.g. 'D-10a')."),
|
|
705
|
+
severity: z.enum(["critical", "warning", "info"]).describe("Finding severity."),
|
|
706
|
+
message: z.string().describe("Human-readable finding message."),
|
|
707
|
+
location: z.string().optional().describe("Document location (section, line, or step id)."),
|
|
708
|
+
suggestion: z.string().optional().describe("Suggested fix."),
|
|
709
|
+
}).strict()).describe("All findings from the 20 D-XX deployment checks."),
|
|
710
|
+
checks: z.object({
|
|
711
|
+
D01_object_defined: z.enum(["pass", "fail"]),
|
|
712
|
+
D02_dependency_complete: z.enum(["pass", "fail"]),
|
|
713
|
+
D03_scenario_covered: z.enum(["pass", "fail"]),
|
|
714
|
+
D04_testnet_topo_order: z.enum(["pass", "fail"]),
|
|
715
|
+
D05_testnet_network: z.enum(["pass", "fail"]),
|
|
716
|
+
D06_testnet_replace: z.enum(["pass", "fail"]),
|
|
717
|
+
D07_permission_index: z.enum(["pass", "fail"]),
|
|
718
|
+
D08_guard_gen_passport: z.enum(["pass", "fail"]),
|
|
719
|
+
D09_machine_node_count: z.enum(["pass", "fail"]),
|
|
720
|
+
D10_substep_coherence: z.enum(["pass", "fail"]),
|
|
721
|
+
D11_mainnet_testnet_match: z.enum(["pass", "fail"]),
|
|
722
|
+
D12_mainnet_network: z.enum(["pass", "fail"]),
|
|
723
|
+
D13_mainnet_replace: z.enum(["pass", "fail"]),
|
|
724
|
+
D14_testnet_verification: z.enum(["pass", "fail"]),
|
|
725
|
+
D15_mainnet_verification: z.enum(["pass", "fail"]),
|
|
726
|
+
D16_no_critical_risk: z.enum(["pass", "fail"]),
|
|
727
|
+
D17_no_high_risk: z.enum(["pass", "fail"]),
|
|
728
|
+
D18_completeness_checklist: z.enum(["pass", "fail"]),
|
|
729
|
+
D19_machine_entry_forward: z.enum(["pass", "fail"]).describe("Machine entry node (prev_node='') forwards non-empty — avoids Progress stuck at current=''."),
|
|
730
|
+
D20_service_compensation_fund: z.enum(["pass", "fail"]).describe("Service compensation_fund (Balance<T>) present or industry-exempt — ensures arbitration refund capability."),
|
|
731
|
+
}).strict().describe("Per-check pass/fail status for all 20 D-XX checks."),
|
|
732
|
+
}).strict().describe("Deployment scanner result — 20 D-XX checks including D-19 (Machine entry forward) and D-20 (Service compensation_fund)."),
|
|
733
|
+
})
|
|
734
|
+
.strict();
|
|
735
|
+
const PreEvaluateCheckResultSchema = z
|
|
736
|
+
.object({
|
|
737
|
+
action: z.literal("pre_evaluate_check"),
|
|
738
|
+
ready: z.boolean().describe("True if evaluate_project will produce meaningful results (no hard blockers). " +
|
|
739
|
+
"If false, address the items in `missing` first."),
|
|
740
|
+
missing: z.array(z.object({
|
|
741
|
+
id: z.string().describe("Check ID (e.g. PE-01, PE-06)."),
|
|
742
|
+
description: z.string().describe("What is missing."),
|
|
743
|
+
impact: z.string().describe("How it affects the evaluation, and how to fix it."),
|
|
744
|
+
}).strict()).describe("Hard blockers — must be resolved before evaluation."),
|
|
745
|
+
warnings: z.array(z.object({
|
|
746
|
+
id: z.string().describe("Check ID (e.g. PE-02, PE-03)."),
|
|
747
|
+
description: z.string().describe("What is suboptimal."),
|
|
748
|
+
impact: z.string().describe("How it affects the evaluation, and how to improve it."),
|
|
749
|
+
}).strict()).describe("Soft issues — evaluation runs but quality may be reduced."),
|
|
750
|
+
summary: z.string().describe("One-line human-readable status."),
|
|
751
|
+
counts: z.object({
|
|
752
|
+
objects: z.number().describe("Total project_objects count."),
|
|
753
|
+
edges: z.number().describe("Total graph_edges count."),
|
|
754
|
+
uncached: z.number().describe("Objects with no cached on-chain data."),
|
|
755
|
+
stale: z.number().describe("Objects with cache older than 24 hours."),
|
|
756
|
+
dangling_edges: z.number().describe("Edges referencing objects not in project_objects."),
|
|
757
|
+
drafts: z.number().describe("Objects still in draft (not yet on-chain)."),
|
|
758
|
+
}).strict().describe("Quick-scan counts for triage."),
|
|
759
|
+
})
|
|
760
|
+
.strict();
|
|
761
|
+
const VerifyDeploymentResultSchema = z
|
|
762
|
+
.object({
|
|
763
|
+
action: z.literal("verify_deployment"),
|
|
764
|
+
verifiedCount: z.number().describe("Number of objects actually verified (excludes drafts and unreachable)."),
|
|
765
|
+
matched: z.number().describe("Objects whose on-chain state matches SQLite."),
|
|
766
|
+
mismatched: z.number().describe("Objects whose on-chain state differs from SQLite (see `results[].differences`)."),
|
|
767
|
+
missing: z.number().describe("Objects that no longer exist on-chain (deleted or never deployed)."),
|
|
768
|
+
unreachable: z.number().describe("Objects that could not be queried (network error)."),
|
|
769
|
+
results: z.array(z.object({
|
|
770
|
+
objectAddress: z.string(),
|
|
771
|
+
objectName: z.string().nullable(),
|
|
772
|
+
objectType: z.string().nullable(),
|
|
773
|
+
status: z.enum(["matched", "mismatched", "missing", "unreachable"]).describe("Verification status: 'matched' = on-chain matches SQLite; " +
|
|
774
|
+
"'mismatched' = on-chain differs (see differences); " +
|
|
775
|
+
"'missing' = object no longer exists on-chain; " +
|
|
776
|
+
"'unreachable' = query failed (network error or rate limit)."),
|
|
777
|
+
differences: z.array(z.object({
|
|
778
|
+
field: z.string().describe("Field path that differs."),
|
|
779
|
+
sqlite: z.unknown().describe("Value recorded in SQLite."),
|
|
780
|
+
onchain: z.unknown().describe("Value observed on-chain."),
|
|
781
|
+
}).strict()).optional().describe("Per-field differences (only for status='mismatched')."),
|
|
782
|
+
bindings: z.object({
|
|
783
|
+
machine: z.boolean(),
|
|
784
|
+
permission: z.boolean(),
|
|
785
|
+
buy_guard: z.boolean(),
|
|
786
|
+
order_allocators: z.boolean(),
|
|
787
|
+
}).strict().optional().describe("Critical binding status (only for Service objects). " +
|
|
788
|
+
"Each boolean indicates whether the binding is set to a non-null value on-chain."),
|
|
789
|
+
error: z.string().optional().describe("Error message (only for status='unreachable')."),
|
|
790
|
+
}).strict()).describe("Per-object verification results."),
|
|
791
|
+
summary: z.string().describe("One-line human-readable summary."),
|
|
792
|
+
})
|
|
793
|
+
.strict();
|
|
794
|
+
const MachineGraphForwardSchema = z.object({
|
|
795
|
+
name: z.string().describe("Forward name."),
|
|
796
|
+
weight: z.number().describe("Forward weight (for weighted threshold)."),
|
|
797
|
+
guard: z.string().nullable().describe("Guard object address if the forward is guard-gated, else null."),
|
|
798
|
+
named_operator: z.string().nullable().describe("Named operator if set, else null."),
|
|
799
|
+
permission_index: z.number().nullable().describe("Permission index if set, else null."),
|
|
800
|
+
}).strict();
|
|
801
|
+
const MachineGraphEdgeSchema = z.object({
|
|
802
|
+
from: z.string().describe("Source node name (prev_node)."),
|
|
803
|
+
to: z.string().describe("Target node name (next_node)."),
|
|
804
|
+
threshold: z.number().describe("Minimum weighted forward count required to advance."),
|
|
805
|
+
forwards: z.array(MachineGraphForwardSchema).describe("Forwards within this pair — each is an advance operation."),
|
|
806
|
+
}).strict();
|
|
807
|
+
const MachineGraphNodeSchema = z.object({
|
|
808
|
+
name: z.string().describe("Node name."),
|
|
809
|
+
description: z.string().nullable().describe("Node description if set, else null."),
|
|
810
|
+
}).strict();
|
|
811
|
+
const GetMachineGraphResultSchema = z
|
|
812
|
+
.object({
|
|
813
|
+
action: z.literal("get_machine_graph"),
|
|
814
|
+
machineAddress: z.string().describe("The Machine object address."),
|
|
815
|
+
machineName: z.string().nullable().describe("The Machine's local name (from LocalMark) if available."),
|
|
816
|
+
nodes: z.array(MachineGraphNodeSchema).describe("Workflow nodes (states)."),
|
|
817
|
+
edges: z.array(MachineGraphEdgeSchema).describe("Directed edges (pairs) connecting nodes. Each edge has a threshold and forwards."),
|
|
818
|
+
published: z.boolean().nullable().describe("Whether the Machine is published (locked for production). null = unknown."),
|
|
819
|
+
paused: z.boolean().nullable().describe("Whether the Machine is paused (not generating new Progress). null = unknown."),
|
|
820
|
+
})
|
|
821
|
+
.strict();
|
|
822
|
+
const CloneProjectToNetworkResultSchema = z
|
|
823
|
+
.object({
|
|
824
|
+
action: z.literal("clone_project_to_network"),
|
|
825
|
+
new_project_id: z.string().describe("The newly created project's UUID."),
|
|
826
|
+
new_prefix: z.string().describe("New project prefix ('<source_prefix>_<target_network>')."),
|
|
827
|
+
target_network: z.enum(["testnet", "mainnet"]).describe("The target network the new project is bound to."),
|
|
828
|
+
cloned_objects_count: z.number().describe("Number of object metadata entries copied (objectAddress is empty — await on-chain deployment)."),
|
|
829
|
+
message: z.string().describe("Human-readable summary of the clone operation."),
|
|
830
|
+
next_steps: z.string().describe("Instructions for deploying the cloned objects on the target network."),
|
|
831
|
+
})
|
|
832
|
+
.strict();
|
|
833
|
+
const MigrateNetworkResultSchema = z
|
|
834
|
+
.object({
|
|
835
|
+
action: z.literal("migrate_network"),
|
|
836
|
+
new_project_id: z.string().describe("The newly created project's UUID."),
|
|
837
|
+
new_prefix: z.string().describe("New project prefix ('<source_prefix>_<target_network>')."),
|
|
838
|
+
target_network: z.enum(["testnet", "mainnet"]).describe("The target network the new project is bound to."),
|
|
839
|
+
cloned_objects_count: z.number().describe("Number of object metadata entries copied (objectAddress is empty — await on-chain deployment)."),
|
|
840
|
+
message: z.string().describe("Human-readable summary of the migration operation."),
|
|
841
|
+
next_steps: z.string().describe("Instructions for deploying the migrated objects on the target network."),
|
|
557
842
|
})
|
|
558
843
|
.strict();
|
|
559
844
|
export const ProjectOperationOutputSchema = z
|
|
@@ -578,6 +863,11 @@ export const ProjectOperationOutputSchema = z
|
|
|
578
863
|
DeleteProjectResultSchema,
|
|
579
864
|
AssembleContextResultSchema,
|
|
580
865
|
GenerateDeploymentDocResultSchema,
|
|
866
|
+
PreEvaluateCheckResultSchema,
|
|
867
|
+
VerifyDeploymentResultSchema,
|
|
868
|
+
GetMachineGraphResultSchema,
|
|
869
|
+
CloneProjectToNetworkResultSchema,
|
|
870
|
+
MigrateNetworkResultSchema,
|
|
581
871
|
]).describe("Query result — shape depends on action"),
|
|
582
872
|
})
|
|
583
873
|
.strict();
|