@wowok/agent-mcp 2.6.0 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/customer/info-puzzle.d.ts +1 -1
- package/dist/customer/info-puzzle.js +4 -2
- package/dist/customer/risk-assessment.js +26 -4
- package/dist/customer/types.d.ts +2 -0
- package/dist/examples/guard-template-balance-check.json +38 -0
- package/dist/examples/guard-template-time-lock.json +39 -0
- package/dist/examples/machine-template-7node-rental.json +114 -0
- package/dist/examples/rental-ziroom-machine-create.json +137 -0
- package/dist/examples/rental-ziroom-permission-create.json +35 -0
- package/dist/examples/rental-ziroom-service-create.json +80 -0
- package/dist/examples/retail-myshop-service-create.json +88 -0
- 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 +493 -0
- package/dist/extensions/registry.d.ts +50 -0
- package/dist/extensions/registry.js +662 -0
- package/dist/extensions/types.d.ts +219 -0
- package/dist/extensions/types.js +1 -0
- package/dist/index.js +50 -0
- package/dist/knowledge/deployment-scanner.d.ts +3 -0
- package/dist/knowledge/deployment-scanner.js +64 -3
- package/dist/knowledge/fund-layer.d.ts +72 -0
- package/dist/knowledge/fund-layer.js +420 -0
- package/dist/knowledge/guard-render.d.ts +57 -0
- package/dist/knowledge/guard-render.js +700 -0
- package/dist/knowledge/guard-risk.d.ts +13 -0
- package/dist/knowledge/guard-risk.js +57 -0
- package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
- package/dist/knowledge/guard-submission-prompt.js +171 -0
- package/dist/knowledge/guard-templates.js +278 -0
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-render.d.ts +41 -0
- package/dist/knowledge/machine-render.js +565 -0
- package/dist/knowledge/machine-templates.js +24 -5
- package/dist/knowledge/reward-confirm.js +2 -2
- package/dist/knowledge/reward-puzzle.js +1 -1
- package/dist/knowledge/reward-risk.js +9 -9
- package/dist/knowledge/reward-templates.js +2 -2
- package/dist/knowledge/service-confirm.d.ts +15 -6
- package/dist/knowledge/service-confirm.js +119 -11
- package/dist/knowledge/service-context.js +1 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/service-risk.d.ts +1 -1
- package/dist/knowledge/service-risk.js +3 -3
- package/dist/knowledge/service-templates.js +2 -2
- package/dist/knowledge/service-translation.d.ts +1 -1
- package/dist/knowledge/service-translation.js +7 -7
- package/dist/knowledge/tool-constraints.js +6 -2
- package/dist/project/deployment-bridge.d.ts +1 -1
- package/dist/project/deployment-bridge.js +31 -7
- package/dist/project/deployment-doc.d.ts +3 -0
- package/dist/project/deployment-doc.js +76 -14
- package/dist/project/edit-planner.d.ts +123 -0
- package/dist/project/edit-planner.js +1371 -0
- package/dist/project/evaluation.d.ts +2 -0
- package/dist/project/evaluation.js +873 -88
- package/dist/project/graph-builder.d.ts +4 -1
- package/dist/project/graph-builder.js +132 -62
- package/dist/project/graph.d.ts +1 -0
- package/dist/project/handlers.d.ts +317 -6
- package/dist/project/handlers.js +1171 -19
- 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/allocation.js +2 -2
- package/dist/schema/call/arbitration.js +19 -6
- 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/contact.js +2 -2
- package/dist/schema/call/demand.d.ts +23 -31
- package/dist/schema/call/demand.js +2 -2
- package/dist/schema/call/guard.js +2 -2
- package/dist/schema/call/machine.d.ts +1976 -752
- package/dist/schema/call/machine.js +50 -4
- package/dist/schema/call/order.d.ts +149 -228
- package/dist/schema/call/order.js +4 -3
- package/dist/schema/call/payment.d.ts +183 -3
- package/dist/schema/call/payment.js +21 -3
- package/dist/schema/call/permission.js +2 -2
- 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/repository.js +2 -2
- package/dist/schema/call/reward.js +3 -3
- package/dist/schema/call/semantic.d.ts +1 -1
- package/dist/schema/call/semantic.js +37 -2
- package/dist/schema/call/service.d.ts +275 -127
- package/dist/schema/call/service.js +89 -13
- package/dist/schema/call/treasury.js +3 -3
- package/dist/schema/common/index.d.ts +13 -2
- package/dist/schema/common/index.js +80 -15
- package/dist/schema/local/index.d.ts +32 -35
- package/dist/schema/local/index.js +28 -6
- package/dist/schema/messenger/index.d.ts +274 -46
- package/dist/schema/operations.d.ts +1264 -544
- package/dist/schema/operations.js +65 -7
- package/dist/schema/project/index.d.ts +2846 -167
- package/dist/schema/project/index.js +570 -16
- package/dist/schema/query/index.d.ts +922 -349
- package/dist/schema/query/index.js +205 -42
- package/dist/schema/schema-query/index.d.ts +65 -3
- package/dist/schema/schema-query/index.js +38 -5
- package/dist/schema/utils/node-parser.js +20 -4
- package/dist/schema/utils/object-type-utils.d.ts +12 -0
- package/dist/schema/utils/object-type-utils.js +35 -0
- package/dist/schema/utils/permission-machine-check.d.ts +49 -0
- package/dist/schema/utils/permission-machine-check.js +121 -0
- package/dist/schema/utils/skills-recommendation.d.ts +2 -0
- package/dist/schema/utils/skills-recommendation.js +76 -0
- package/dist/schema-query/index.d.ts +20 -1
- package/dist/schema-query/index.js +306 -4
- package/dist/schemas/account_operation.output.json +7 -1
- package/dist/schemas/account_operation.schema.json +3 -3
- 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.output.json +2820 -0
- package/dist/schemas/onchain_operations.schema.json +444 -330
- package/dist/schemas/onchain_operations_allocation.schema.json +37 -28
- package/dist/schemas/onchain_operations_arbitration.schema.json +16 -14
- package/dist/schemas/onchain_operations_contact.schema.json +10 -10
- package/dist/schemas/onchain_operations_demand.schema.json +10 -10
- package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -16
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -2
- package/dist/schemas/onchain_operations_guard.schema.json +2 -2
- package/dist/schemas/onchain_operations_machine.schema.json +43 -35
- package/dist/schemas/onchain_operations_order.schema.json +72 -78
- package/dist/schemas/onchain_operations_payment.schema.json +141 -111
- package/dist/schemas/onchain_operations_permission.schema.json +3 -3
- package/dist/schemas/onchain_operations_personal.schema.json +7 -7
- package/dist/schemas/onchain_operations_progress.schema.json +9 -9
- package/dist/schemas/onchain_operations_proof.schema.json +8 -8
- package/dist/schemas/onchain_operations_repository.schema.json +10 -10
- package/dist/schemas/onchain_operations_reward.schema.json +14 -14
- package/dist/schemas/onchain_operations_service.schema.json +119 -48
- package/dist/schemas/onchain_operations_treasury.schema.json +11 -11
- package/dist/schemas/onchain_table_data.output.json +33 -25
- package/dist/schemas/onchain_table_data.schema.json +22 -21
- package/dist/schemas/project_operation.output.json +2194 -23
- package/dist/schemas/project_operation.schema.json +84 -6
- package/dist/schemas/query_toolkit.output.json +108 -80
- package/dist/schemas/query_toolkit.schema.json +12 -12
- package/dist/schemas/schema_query.output.json +70 -3
- package/dist/schemas/schema_query.schema.json +18 -3
- package/dist/schemas/wowok_buildin_info.output.json +81 -8
- package/dist/schemas/wowok_buildin_info.schema.json +46 -2
- package/dist/tools/handlers/local.js +20 -5
- package/dist/tools/handlers/onchain.js +594 -6
- package/dist/tools/handlers/project.js +76 -4
- package/dist/tools/handlers/query.js +27 -0
- package/dist/tools/handlers/schema-query.js +43 -1
- 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.d.ts +8 -0
- package/dist/tools/index.js +387 -12
- 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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function shortTypeName(objectType: string | null | undefined): string;
|
|
2
|
+
export declare function normalizeObjectType(objectType: string | null | undefined): string;
|
|
3
|
+
export declare function isObjectOfType(objectType: string | null | undefined, expectedShortName: string): boolean;
|
|
4
|
+
export declare function groupObjectsByType<T extends {
|
|
5
|
+
objectType: string | null;
|
|
6
|
+
}>(objects: T[]): Map<string, T[]>;
|
|
7
|
+
export declare function findObjectByType<T extends {
|
|
8
|
+
objectType: string | null;
|
|
9
|
+
}>(objects: T[], expectedShortName: string): T | undefined;
|
|
10
|
+
export declare function countObjectsByType<T extends {
|
|
11
|
+
objectType: string | null;
|
|
12
|
+
}>(objects: T[], expectedShortName: string): number;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export function shortTypeName(objectType) {
|
|
2
|
+
if (!objectType)
|
|
3
|
+
return "unknown";
|
|
4
|
+
const base = objectType.replace(/<.*>/, "").trim();
|
|
5
|
+
const segments = base.split("::");
|
|
6
|
+
const shortName = segments[segments.length - 1] || "unknown";
|
|
7
|
+
if (shortName.length > 0 && shortName === shortName.toLowerCase()) {
|
|
8
|
+
return shortName.charAt(0).toUpperCase() + shortName.slice(1);
|
|
9
|
+
}
|
|
10
|
+
return shortName;
|
|
11
|
+
}
|
|
12
|
+
export function normalizeObjectType(objectType) {
|
|
13
|
+
return shortTypeName(objectType).toLowerCase();
|
|
14
|
+
}
|
|
15
|
+
export function isObjectOfType(objectType, expectedShortName) {
|
|
16
|
+
const normalized = normalizeObjectType(objectType);
|
|
17
|
+
const expected = expectedShortName.toLowerCase();
|
|
18
|
+
return normalized === expected;
|
|
19
|
+
}
|
|
20
|
+
export function groupObjectsByType(objects) {
|
|
21
|
+
const byType = new Map();
|
|
22
|
+
for (const obj of objects) {
|
|
23
|
+
const t = shortTypeName(obj.objectType);
|
|
24
|
+
if (!byType.has(t))
|
|
25
|
+
byType.set(t, []);
|
|
26
|
+
byType.get(t).push(obj);
|
|
27
|
+
}
|
|
28
|
+
return byType;
|
|
29
|
+
}
|
|
30
|
+
export function findObjectByType(objects, expectedShortName) {
|
|
31
|
+
return objects.find(o => isObjectOfType(o.objectType, expectedShortName));
|
|
32
|
+
}
|
|
33
|
+
export function countObjectsByType(objects, expectedShortName) {
|
|
34
|
+
return objects.filter(o => isObjectOfType(o.objectType, expectedShortName)).length;
|
|
35
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface ForwardPermissionRef {
|
|
2
|
+
nodeName: string;
|
|
3
|
+
prevNode: string;
|
|
4
|
+
forwardName: string;
|
|
5
|
+
permissionIndex: number | null;
|
|
6
|
+
namedOperator: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface PermissionRefCollection {
|
|
9
|
+
indexRefs: ForwardPermissionRef[];
|
|
10
|
+
namedRefs: ForwardPermissionRef[];
|
|
11
|
+
missingRefs: ForwardPermissionRef[];
|
|
12
|
+
requiredIndexes: number[];
|
|
13
|
+
}
|
|
14
|
+
export interface IndexAuthorizationStatus {
|
|
15
|
+
index: number;
|
|
16
|
+
authorized: boolean;
|
|
17
|
+
entityCount: number;
|
|
18
|
+
}
|
|
19
|
+
export interface PermissionAuthorizationReport {
|
|
20
|
+
statuses: IndexAuthorizationStatus[];
|
|
21
|
+
missingIndexes: number[];
|
|
22
|
+
authorizedIndexes: number[];
|
|
23
|
+
allAuthorized: boolean;
|
|
24
|
+
summary: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function collectPermissionIndexes(nodes: Array<{
|
|
27
|
+
name: string;
|
|
28
|
+
pairs?: Array<{
|
|
29
|
+
prev_node: string;
|
|
30
|
+
forwards?: Array<{
|
|
31
|
+
name: string;
|
|
32
|
+
permissionIndex?: number | null;
|
|
33
|
+
namedOperator?: string | null;
|
|
34
|
+
}>;
|
|
35
|
+
}>;
|
|
36
|
+
}>): PermissionRefCollection;
|
|
37
|
+
export interface PermissionObjectData {
|
|
38
|
+
address?: string;
|
|
39
|
+
entity_count?: number;
|
|
40
|
+
perm_remark?: Array<{
|
|
41
|
+
index: number;
|
|
42
|
+
remark: string;
|
|
43
|
+
}>;
|
|
44
|
+
entityPermissions?: Map<string, number[]>;
|
|
45
|
+
owner?: string;
|
|
46
|
+
admin?: string[];
|
|
47
|
+
}
|
|
48
|
+
export declare function checkPermissionAuthorization(requiredIndexes: number[], permission: PermissionObjectData | null | undefined): PermissionAuthorizationReport;
|
|
49
|
+
export declare function formatPermissionWarning(report: PermissionAuthorizationReport): string;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export function collectPermissionIndexes(nodes) {
|
|
2
|
+
const indexRefs = [];
|
|
3
|
+
const namedRefs = [];
|
|
4
|
+
const missingRefs = [];
|
|
5
|
+
const requiredIndexSet = new Set();
|
|
6
|
+
for (const node of nodes) {
|
|
7
|
+
if (!node.pairs)
|
|
8
|
+
continue;
|
|
9
|
+
for (const pair of node.pairs) {
|
|
10
|
+
if (!pair.forwards)
|
|
11
|
+
continue;
|
|
12
|
+
for (const forward of pair.forwards) {
|
|
13
|
+
const ref = {
|
|
14
|
+
nodeName: node.name,
|
|
15
|
+
prevNode: pair.prev_node,
|
|
16
|
+
forwardName: forward.name,
|
|
17
|
+
permissionIndex: forward.permissionIndex ?? null,
|
|
18
|
+
namedOperator: forward.namedOperator ?? null,
|
|
19
|
+
};
|
|
20
|
+
if (ref.permissionIndex != null) {
|
|
21
|
+
indexRefs.push(ref);
|
|
22
|
+
requiredIndexSet.add(ref.permissionIndex);
|
|
23
|
+
}
|
|
24
|
+
else if (ref.namedOperator != null && ref.namedOperator !== "") {
|
|
25
|
+
namedRefs.push(ref);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
missingRefs.push(ref);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
indexRefs,
|
|
35
|
+
namedRefs,
|
|
36
|
+
missingRefs,
|
|
37
|
+
requiredIndexes: Array.from(requiredIndexSet).sort((a, b) => a - b),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export function checkPermissionAuthorization(requiredIndexes, permission) {
|
|
41
|
+
const BUILTIN_THRESHOLD = 1000;
|
|
42
|
+
const statuses = [];
|
|
43
|
+
const missingIndexes = [];
|
|
44
|
+
const authorizedIndexes = [];
|
|
45
|
+
for (const index of requiredIndexes) {
|
|
46
|
+
if (index < BUILTIN_THRESHOLD) {
|
|
47
|
+
statuses.push({ index, authorized: true, entityCount: -1 });
|
|
48
|
+
authorizedIndexes.push(index);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
let authorized = false;
|
|
52
|
+
let entityCount = 0;
|
|
53
|
+
if (permission?.entityPermissions) {
|
|
54
|
+
for (const perms of permission.entityPermissions.values()) {
|
|
55
|
+
if (perms.includes(index)) {
|
|
56
|
+
entityCount++;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
authorized = entityCount > 0;
|
|
60
|
+
}
|
|
61
|
+
else if (permission?.perm_remark && permission.perm_remark.length > 0) {
|
|
62
|
+
authorized = permission.perm_remark.some(r => r.index === index);
|
|
63
|
+
entityCount = authorized ? -1 : 0;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
authorized = true;
|
|
67
|
+
entityCount = -1;
|
|
68
|
+
}
|
|
69
|
+
statuses.push({ index, authorized, entityCount });
|
|
70
|
+
if (authorized) {
|
|
71
|
+
authorizedIndexes.push(index);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
missingIndexes.push(index);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const allAuthorized = missingIndexes.length === 0;
|
|
78
|
+
const summary = allAuthorized
|
|
79
|
+
? `All ${requiredIndexes.length} required permission index(es) are authorized.`
|
|
80
|
+
: `${missingIndexes.length}/${requiredIndexes.length} required permission index(es) are NOT authorized: [${missingIndexes.join(", ")}]. ` +
|
|
81
|
+
`Forwards using these indexes will be un-executable — Progress will be stuck. ` +
|
|
82
|
+
`Grant entities for these indexes via permission.op="add perm by index" before publishing the Machine.`;
|
|
83
|
+
return {
|
|
84
|
+
statuses,
|
|
85
|
+
missingIndexes,
|
|
86
|
+
authorizedIndexes,
|
|
87
|
+
allAuthorized,
|
|
88
|
+
summary,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export function formatPermissionWarning(report) {
|
|
92
|
+
if (report.allAuthorized) {
|
|
93
|
+
return "";
|
|
94
|
+
}
|
|
95
|
+
const lines = [
|
|
96
|
+
"CRITICAL PRE-PUBLISH: Machine forwards reference permission indexes that are NOT authorized in the Permission object.",
|
|
97
|
+
"",
|
|
98
|
+
`Missing indexes (no entities granted): ${report.missingIndexes.join(", ")}`,
|
|
99
|
+
"",
|
|
100
|
+
"Impact: Forwards using these indexes can NEVER be executed — Progress will be permanently stuck at the source node.",
|
|
101
|
+
"Buyer funds may be trapped if the workflow cannot advance past the stuck node.",
|
|
102
|
+
"",
|
|
103
|
+
"To fix BEFORE publishing:",
|
|
104
|
+
' 1. Call onchain_operations with op="permission"',
|
|
105
|
+
' 2. Set object=<your_permission_name_or_address>',
|
|
106
|
+
' 3. Set permission.op="add perm by index"',
|
|
107
|
+
" 4. Set index=<missing_index> for each missing index",
|
|
108
|
+
' 5. Set entity=["<entity_address>"] — the address that should be authorized',
|
|
109
|
+
" 6. After granting all missing indexes, re-attempt the Machine publish.",
|
|
110
|
+
"",
|
|
111
|
+
"Required permission indexes for this Machine:",
|
|
112
|
+
];
|
|
113
|
+
for (const status of report.statuses) {
|
|
114
|
+
const state = status.authorized ? "AUTHORIZED" : "MISSING";
|
|
115
|
+
const count = status.entityCount === -1
|
|
116
|
+
? "(built-in or heuristic)"
|
|
117
|
+
: `(${status.entityCount} entity/entities)`;
|
|
118
|
+
lines.push(` - Index ${status.index}: ${state} ${count}`);
|
|
119
|
+
}
|
|
120
|
+
return lines.join("\n");
|
|
121
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const SKILLS_BY_OPERATION_TYPE = {
|
|
2
|
+
service: ["wowok-provider", "wowok-safety"],
|
|
3
|
+
machine: ["wowok-machine"],
|
|
4
|
+
guard: ["wowok-guard"],
|
|
5
|
+
arbitration: ["wowok-arbitrator"],
|
|
6
|
+
allocation: ["wowok-provider"],
|
|
7
|
+
permission: ["wowok-safety"],
|
|
8
|
+
treasury: ["wowok-provider", "wowok-safety"],
|
|
9
|
+
reward: ["wowok-provider"],
|
|
10
|
+
repository: ["wowok-provider"],
|
|
11
|
+
demand: ["wowok-provider"],
|
|
12
|
+
contact: ["wowok-messenger"],
|
|
13
|
+
order: ["wowok-order"],
|
|
14
|
+
progress: [],
|
|
15
|
+
personal: [],
|
|
16
|
+
payment: [],
|
|
17
|
+
proof: [],
|
|
18
|
+
};
|
|
19
|
+
const SKILLS_BY_PROJECT_ACTION = {
|
|
20
|
+
create_project: ["wowok-onboard", "wowok-planner"],
|
|
21
|
+
create_project_from_onchain: ["wowok-onboard"],
|
|
22
|
+
evaluate_project: ["wowok-auditor"],
|
|
23
|
+
pre_evaluate_check: ["wowok-auditor"],
|
|
24
|
+
verify_deployment: ["wowok-auditor"],
|
|
25
|
+
generate_deployment_doc: ["wowok-planner"],
|
|
26
|
+
migrate_to_mainnet: ["wowok-onboard", "wowok-safety"],
|
|
27
|
+
migrate_network: ["wowok-onboard"],
|
|
28
|
+
clone_project_to_network: ["wowok-onboard"],
|
|
29
|
+
build_graph: ["wowok-planner"],
|
|
30
|
+
list_projects: [],
|
|
31
|
+
get_project_detail: [],
|
|
32
|
+
update_project: [],
|
|
33
|
+
add_object: [],
|
|
34
|
+
remove_object: [],
|
|
35
|
+
update_object: [],
|
|
36
|
+
create_version: [],
|
|
37
|
+
get_graph: [],
|
|
38
|
+
save_evaluation: [],
|
|
39
|
+
compare_projects: [],
|
|
40
|
+
refresh_objects: [],
|
|
41
|
+
get_object_diff: [],
|
|
42
|
+
delete_project: [],
|
|
43
|
+
assemble_context: [],
|
|
44
|
+
get_machine_graph: ["wowok-machine"],
|
|
45
|
+
get_guard_graph: ["wowok-guard"],
|
|
46
|
+
plan_object_edit: ["wowok-machine", "wowok-guard", "wowok-auditor"],
|
|
47
|
+
apply_object_edit: ["wowok-safety"],
|
|
48
|
+
patch_machine_nodes: ["wowok-machine"],
|
|
49
|
+
patch_guard_tree: ["wowok-guard"],
|
|
50
|
+
};
|
|
51
|
+
export function getSkillsHintForOnchain(operationType, data) {
|
|
52
|
+
const skills = SKILLS_BY_OPERATION_TYPE[operationType];
|
|
53
|
+
if (!skills || skills.length === 0)
|
|
54
|
+
return undefined;
|
|
55
|
+
const isPublish = data?.publish === true;
|
|
56
|
+
const hasOrderAllocators = !!data?.order_allocators;
|
|
57
|
+
const isComplex = isPublish || hasOrderAllocators;
|
|
58
|
+
const prefix = isComplex
|
|
59
|
+
? "SKILLS RECOMMENDED (complex operation — skills provide business-semantic guidance):"
|
|
60
|
+
: "SKILLS RECOMMENDED (optional — skills provide deeper guidance):";
|
|
61
|
+
return `${prefix} ${skills.join(", ")}. ` +
|
|
62
|
+
`skills focus on business intent → object parameter translation; ` +
|
|
63
|
+
`MCP handles object structure and on-chain execution. ` +
|
|
64
|
+
`If skills are installed, consult them BEFORE this call for design rationale. ` +
|
|
65
|
+
`If not installed, MCP executes independently — this hint is informational only.`;
|
|
66
|
+
}
|
|
67
|
+
export function getSkillsHintForProject(action) {
|
|
68
|
+
const skills = SKILLS_BY_PROJECT_ACTION[action];
|
|
69
|
+
if (!skills || skills.length === 0)
|
|
70
|
+
return undefined;
|
|
71
|
+
return `SKILLS RECOMMENDED (optional — skills provide deeper guidance): ${skills.join(", ")}. ` +
|
|
72
|
+
`skills focus on business intent → object parameter translation; ` +
|
|
73
|
+
`MCP handles project structure and evaluation. ` +
|
|
74
|
+
`If skills are installed, consult them for design/planning rationale. ` +
|
|
75
|
+
`If not installed, MCP executes independently — this hint is informational only.`;
|
|
76
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const EXAMPLES_DIR: string;
|
|
1
2
|
export interface SchemaInfo {
|
|
2
3
|
name: string;
|
|
3
4
|
title: string;
|
|
@@ -6,9 +7,23 @@ export interface SchemaInfo {
|
|
|
6
7
|
outputPath?: string;
|
|
7
8
|
}
|
|
8
9
|
export interface SchemaQueryRequest {
|
|
9
|
-
action: "list" | "get" | "search" | "list_operations" | "get_output";
|
|
10
|
+
action: "list" | "get" | "search" | "list_operations" | "get_output" | "get_guard_templates" | "get_field" | "search_examples";
|
|
10
11
|
name?: string;
|
|
11
12
|
query?: string;
|
|
13
|
+
field_path?: string;
|
|
14
|
+
template?: string;
|
|
15
|
+
output_file?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ExampleSearchResult {
|
|
18
|
+
file: string;
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
tags: string[];
|
|
22
|
+
industry: string;
|
|
23
|
+
operation_type: string;
|
|
24
|
+
verified: boolean;
|
|
25
|
+
score: number;
|
|
26
|
+
matched_fields: string[];
|
|
12
27
|
}
|
|
13
28
|
export interface SchemaQueryResponse {
|
|
14
29
|
[key: string]: unknown;
|
|
@@ -17,6 +32,7 @@ export interface SchemaQueryResponse {
|
|
|
17
32
|
data: any;
|
|
18
33
|
message: string;
|
|
19
34
|
suggestions?: string[];
|
|
35
|
+
output_file_path?: string;
|
|
20
36
|
}
|
|
21
37
|
export declare function areSchemasAvailable(): boolean;
|
|
22
38
|
export declare function getSchemaIndex(): {
|
|
@@ -26,6 +42,9 @@ export declare function getSchemaIndex(): {
|
|
|
26
42
|
export declare function listSchemas(): SchemaInfo[];
|
|
27
43
|
export declare function getSchema(name: string): any | null;
|
|
28
44
|
export declare function getOutputSchema(name: string): any | null;
|
|
45
|
+
export declare function getGuardTemplates(templateName?: string): any | null;
|
|
46
|
+
export declare function searchExamples(query: string): ExampleSearchResult[];
|
|
47
|
+
export declare function getSchemaField(name: string, fieldPath: string): any | null;
|
|
29
48
|
export declare function searchSchemas(query: string): SchemaInfo[];
|
|
30
49
|
export declare function listOperations(): SchemaInfo[];
|
|
31
50
|
export declare function processSchemaQuery(request: SchemaQueryRequest): SchemaQueryResponse;
|