@wowok/agent-mcp 2.5.4 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -26
- package/dist/config/runtime.js +3 -6
- package/dist/harness/checkpoint.js +2 -2
- package/dist/knowledge/flywheel-loop.js +2 -5
- 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/reward-confirm.d.ts +3 -0
- package/dist/knowledge/reward-confirm.js +30 -0
- package/dist/knowledge/reward-puzzle.d.ts +1 -0
- package/dist/knowledge/reward-puzzle.js +12 -0
- package/dist/knowledge/reward-risk.d.ts +4 -1
- package/dist/knowledge/reward-risk.js +85 -3
- package/dist/knowledge/tools-reference.js +5 -4
- package/dist/loop-engineering/improve.js +2 -4
- package/dist/project/deployment-bridge.d.ts +5 -0
- package/dist/project/deployment-bridge.js +96 -0
- package/dist/project/evaluation.d.ts +53 -0
- package/dist/project/evaluation.js +860 -0
- package/dist/project/graph-builder.d.ts +43 -0
- package/dist/project/graph-builder.js +585 -0
- package/dist/project/handlers.d.ts +154 -0
- package/dist/project/handlers.js +567 -0
- package/dist/project/index.d.ts +1 -0
- package/dist/project/index.js +26 -7
- package/dist/project/project-store.js +2 -5
- package/dist/project/query.d.ts +1 -0
- package/dist/project/query.js +2 -0
- package/dist/project/semantic-assembler.d.ts +93 -0
- package/dist/project/semantic-assembler.js +345 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/config/index.d.ts +12 -12
- package/dist/schema/local/index.d.ts +108 -108
- package/dist/schema/local/index.js +21 -18
- package/dist/schema/messenger/index.d.ts +16 -16
- package/dist/schema/messenger/index.js +2 -2
- package/dist/schema/operations.d.ts +0 -6
- package/dist/schema/project/index.d.ts +1840 -3903
- package/dist/schema/project/index.js +403 -955
- package/dist/schema/query/index.d.ts +10 -5
- package/dist/schema/trust/index.d.ts +6 -6
- package/dist/schemas/account_operation.output.json +7 -21
- package/dist/schemas/account_operation.schema.json +9 -23
- package/dist/schemas/bridge_operation.schema.json +1 -1
- package/dist/schemas/guard2file.schema.json +1 -1
- package/dist/schemas/index.json +2 -2
- package/dist/schemas/machineNode2file.schema.json +1 -1
- package/dist/schemas/messenger_operation.schema.json +6 -6
- package/dist/schemas/onchain_operations.schema.json +5 -5
- package/dist/schemas/onchain_operations_allocation.schema.json +1 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +1 -1
- package/dist/schemas/onchain_operations_contact.schema.json +1 -1
- package/dist/schemas/onchain_operations_demand.schema.json +1 -1
- package/dist/schemas/onchain_operations_gen_passport.schema.json +2 -2
- 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 +1 -1
- package/dist/schemas/onchain_operations_order.schema.json +1 -1
- package/dist/schemas/onchain_operations_payment.schema.json +1 -1
- package/dist/schemas/onchain_operations_permission.schema.json +1 -1
- package/dist/schemas/onchain_operations_personal.schema.json +1 -1
- package/dist/schemas/onchain_operations_progress.schema.json +1 -1
- package/dist/schemas/onchain_operations_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_repository.schema.json +1 -1
- package/dist/schemas/onchain_operations_reward.schema.json +1 -1
- package/dist/schemas/onchain_operations_service.schema.json +1 -1
- package/dist/schemas/onchain_operations_treasury.schema.json +1 -1
- package/dist/schemas/project_operation.output.json +1178 -2494
- package/dist/schemas/project_operation.schema.json +216 -530
- package/dist/schemas/query_toolkit.output.json +7 -6
- package/dist/schemas/query_toolkit.schema.json +0 -4
- package/dist/telemetry/storage.js +2 -2
- package/dist/tools/handlers/onchain.js +110 -19
- package/dist/tools/handlers/project.js +56 -1046
- package/dist/tools/index.js +85 -56
- package/package.json +2 -2
|
@@ -572,12 +572,13 @@
|
|
|
572
572
|
"type": "number",
|
|
573
573
|
"description": "Timestamp when account was last updated"
|
|
574
574
|
},
|
|
575
|
-
"
|
|
576
|
-
"type":
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
"
|
|
575
|
+
"messenger": {
|
|
576
|
+
"type": "boolean",
|
|
577
|
+
"description": "Whether messenger is enabled for this account"
|
|
578
|
+
},
|
|
579
|
+
"suspendedName": {
|
|
580
|
+
"type": "string",
|
|
581
|
+
"description": "Name before suspension (set by suspend, cleared by resume)"
|
|
581
582
|
}
|
|
582
583
|
},
|
|
583
584
|
"required": [
|
|
@@ -99,10 +99,6 @@
|
|
|
99
99
|
"type": "boolean",
|
|
100
100
|
"description": "Filter accounts with messenger enabled"
|
|
101
101
|
},
|
|
102
|
-
"m": {
|
|
103
|
-
"$ref": "#/definitions/query_toolkit/anyOf/0/properties/filter/properties/name",
|
|
104
|
-
"description": "Filter by messenger name (supports fuzzy match)"
|
|
105
|
-
},
|
|
106
102
|
"createdAt": {
|
|
107
103
|
"type": "object",
|
|
108
104
|
"properties": {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { mkdir, appendFile, stat, rename } from "fs/promises";
|
|
2
2
|
import { dirname, join } from "path";
|
|
3
|
-
import {
|
|
3
|
+
import { getWowMcpDir } from "@wowok/wowok";
|
|
4
4
|
const MAX_SIZE_BYTES = 10 * 1024 * 1024;
|
|
5
|
-
const DATA_DIR = join(
|
|
5
|
+
const DATA_DIR = join(getWowMcpDir(), "data");
|
|
6
6
|
const TELEMETRY_FILE = join(DATA_DIR, "telemetry.jsonl");
|
|
7
7
|
const ROTATED_FILE = join(DATA_DIR, "telemetry.jsonl.1");
|
|
8
8
|
class JsonlStorage {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from "fs";
|
|
2
2
|
import { resolve } from "path";
|
|
3
|
-
import { CallService, CallMachine, CallProgress, CallGuard, CallArbitration, CallRepository, CallContact, CallTreasury, CallReward, CallAllocation, CallPersonal, CallPayment, CallDemand, CallOrder, gen_passport, CallProof, gen_proof, parseGuardFile, formatGuardParseErrors, transformRewardInput, transformPersonalInput, } from "@wowok/wowok";
|
|
3
|
+
import { CallService, CallMachine, CallProgress, CallGuard, CallArbitration, CallRepository, CallContact, CallTreasury, CallReward, CallAllocation, CallPersonal, CallPayment, CallDemand, CallOrder, gen_passport, CallProof, gen_proof, ResponseData, LocalProject, parseGuardFile, formatGuardParseErrors, transformRewardInput, transformPersonalInput, } from "@wowok/wowok";
|
|
4
4
|
import { OnchainOperationsSchema, strictParse, getEnvConfig, handleCallResult, checkClientSchemaCompatibility, parseMachineNodesFromText, formatNodeErrors as formatMachineNodeErrors, transformSubmission, } from "../../schema/index.js";
|
|
5
5
|
import { handlePermissionOperations } from "../../schema/call/permission-handler.js";
|
|
6
6
|
import { isProjectServiceEnabled, normalize as projectNormalize, } from "../../project/index.js";
|
|
@@ -9,6 +9,41 @@ export async function handleOnchainOperations(args) {
|
|
|
9
9
|
let validated;
|
|
10
10
|
let constraintWarnings = [];
|
|
11
11
|
let projectWarnings = [];
|
|
12
|
+
async function autoAddToProject(projectPrefix, operationType, result) {
|
|
13
|
+
if (!projectPrefix)
|
|
14
|
+
return;
|
|
15
|
+
const creationOps = new Set([
|
|
16
|
+
"service", "machine", "progress", "repository",
|
|
17
|
+
"arbitration", "contact", "treasury", "reward",
|
|
18
|
+
"allocation", "permission", "guard", "personal",
|
|
19
|
+
"demand", "order", "proof",
|
|
20
|
+
]);
|
|
21
|
+
if (!creationOps.has(operationType))
|
|
22
|
+
return;
|
|
23
|
+
if (!result || typeof result !== 'object' || 'error' in result)
|
|
24
|
+
return;
|
|
25
|
+
if (!result.digest)
|
|
26
|
+
return;
|
|
27
|
+
try {
|
|
28
|
+
const lp = LocalProject.Instance();
|
|
29
|
+
const project = await lp.getProjectByPrefix(projectPrefix);
|
|
30
|
+
if (!project) {
|
|
31
|
+
console.warn(`[autoAddToProject] Project with prefix '${projectPrefix}' not found — object not auto-associated. Create the project first via project_operation action='create_project'.`);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const rData = ResponseData(result);
|
|
35
|
+
const created = rData.filter((r) => r.change === "created" && r.object);
|
|
36
|
+
for (const obj of created) {
|
|
37
|
+
await lp.addObject(project.id, {
|
|
38
|
+
objectAddress: obj.object,
|
|
39
|
+
objectType: obj.type_raw,
|
|
40
|
+
role: "reference",
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
}
|
|
46
|
+
}
|
|
12
47
|
try {
|
|
13
48
|
if (typeof args === 'object' && args !== null
|
|
14
49
|
&& 'description' in args && !('operation_type' in args)) {
|
|
@@ -59,7 +94,9 @@ export async function handleOnchainOperations(args) {
|
|
|
59
94
|
: await callService.call(env);
|
|
60
95
|
const data = validated.data;
|
|
61
96
|
const intent = data?.publish ? "publish service" : data?.bPublished !== undefined ? "modify service" : "create service";
|
|
62
|
-
|
|
97
|
+
const output = handleCallResult(result, withHarness(buildCtx(data), "service", intent));
|
|
98
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
99
|
+
return output;
|
|
63
100
|
}
|
|
64
101
|
case "machine": {
|
|
65
102
|
if (validated.data.node && typeof validated.data.node === 'object' && 'json_or_markdown_file' in validated.data.node) {
|
|
@@ -90,42 +127,61 @@ export async function handleOnchainOperations(args) {
|
|
|
90
127
|
const result = validated.submission
|
|
91
128
|
? await callMachine.call_with_submission(env, await transformSubmission(validated.submission))
|
|
92
129
|
: await callMachine.call(env);
|
|
93
|
-
|
|
130
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
131
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
132
|
+
return output;
|
|
94
133
|
}
|
|
95
134
|
case "progress": {
|
|
135
|
+
if (validated.data?.operate) {
|
|
136
|
+
constraintWarnings.push("Progress routing hint: if this Progress is bound to an Order and the target " +
|
|
137
|
+
"Forward uses namedOperator=\"\" (empty string = OrderHolder), use " +
|
|
138
|
+
"order.progress (NOT progress.operate). Direct progress::next fails with " +
|
|
139
|
+
"Permission denied for OrderHolder forwards. Use progress.operate only for " +
|
|
140
|
+
"non-empty namedOperator or permissionIndex-only forwards.");
|
|
141
|
+
}
|
|
96
142
|
const callProgress = new CallProgress(validated.data);
|
|
97
143
|
const result = validated.submission
|
|
98
144
|
? await callProgress.call_with_submission(env, await transformSubmission(validated.submission))
|
|
99
145
|
: await callProgress.call(env);
|
|
100
|
-
|
|
146
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
147
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
148
|
+
return output;
|
|
101
149
|
}
|
|
102
150
|
case "repository": {
|
|
103
151
|
const callRepository = new CallRepository(validated.data);
|
|
104
152
|
const result = validated.submission
|
|
105
153
|
? await callRepository.call_with_submission(env, await transformSubmission(validated.submission))
|
|
106
154
|
: await callRepository.call(env);
|
|
107
|
-
|
|
155
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
156
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
157
|
+
return output;
|
|
108
158
|
}
|
|
109
159
|
case "arbitration": {
|
|
110
160
|
const callArbitration = new CallArbitration(validated.data);
|
|
111
161
|
const result = validated.submission
|
|
112
162
|
? await callArbitration.call_with_submission(env, await transformSubmission(validated.submission))
|
|
113
163
|
: await callArbitration.call(env);
|
|
114
|
-
|
|
164
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
165
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
166
|
+
return output;
|
|
115
167
|
}
|
|
116
168
|
case "contact": {
|
|
117
169
|
const callContact = new CallContact(validated.data);
|
|
118
170
|
const result = validated.submission
|
|
119
171
|
? await callContact.call_with_submission(env, await transformSubmission(validated.submission))
|
|
120
172
|
: await callContact.call(env);
|
|
121
|
-
|
|
173
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
174
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
175
|
+
return output;
|
|
122
176
|
}
|
|
123
177
|
case "treasury": {
|
|
124
178
|
const callTreasury = new CallTreasury(validated.data);
|
|
125
179
|
const result = validated.submission
|
|
126
180
|
? await callTreasury.call_with_submission(env, await transformSubmission(validated.submission))
|
|
127
181
|
: await callTreasury.call(env);
|
|
128
|
-
|
|
182
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
183
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
184
|
+
return output;
|
|
129
185
|
}
|
|
130
186
|
case "reward": {
|
|
131
187
|
const transformedData = transformRewardInput(validated.data);
|
|
@@ -133,17 +189,30 @@ export async function handleOnchainOperations(args) {
|
|
|
133
189
|
const result = validated.submission
|
|
134
190
|
? await callReward.call_with_submission(env, await transformSubmission(validated.submission))
|
|
135
191
|
: await callReward.call(env);
|
|
136
|
-
|
|
192
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
193
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
194
|
+
return output;
|
|
137
195
|
}
|
|
138
196
|
case "allocation": {
|
|
139
197
|
const callAllocation = new CallAllocation(validated.data);
|
|
140
198
|
const result = validated.submission
|
|
141
199
|
? await callAllocation.call_with_submission(env, await transformSubmission(validated.submission))
|
|
142
200
|
: await callAllocation.call(env);
|
|
143
|
-
|
|
201
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
202
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
203
|
+
return output;
|
|
144
204
|
}
|
|
145
205
|
case "permission": {
|
|
146
|
-
|
|
206
|
+
const opType = validated.operation_type;
|
|
207
|
+
const output = handlePermissionOperations(validated.data, env, buildCtx);
|
|
208
|
+
if (output && typeof output === 'object' && 'then' in output) {
|
|
209
|
+
output.then((resolved) => {
|
|
210
|
+
if (resolved?.structuredContent?.result) {
|
|
211
|
+
autoAddToProject(projectEnvPrefix, opType, resolved.structuredContent.result).catch(() => { });
|
|
212
|
+
}
|
|
213
|
+
}).catch(() => { });
|
|
214
|
+
}
|
|
215
|
+
return output;
|
|
147
216
|
}
|
|
148
217
|
case "guard": {
|
|
149
218
|
const validatedData = validated.data;
|
|
@@ -190,47 +259,69 @@ export async function handleOnchainOperations(args) {
|
|
|
190
259
|
}
|
|
191
260
|
const callGuard = new CallGuard(validatedData);
|
|
192
261
|
const result = await callGuard.call(env);
|
|
193
|
-
|
|
262
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
263
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
264
|
+
return output;
|
|
194
265
|
}
|
|
195
266
|
case "personal": {
|
|
196
267
|
const transformedData = transformPersonalInput(validated.data);
|
|
197
268
|
const callPersonal = new CallPersonal(transformedData);
|
|
198
269
|
const result = await callPersonal.call(env);
|
|
199
|
-
|
|
270
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
271
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
272
|
+
return output;
|
|
200
273
|
}
|
|
201
274
|
case "payment": {
|
|
202
275
|
const callPayment = new CallPayment(validated.data);
|
|
203
276
|
const result = await callPayment.call(env);
|
|
204
|
-
|
|
277
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
278
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
279
|
+
return output;
|
|
205
280
|
}
|
|
206
281
|
case "demand": {
|
|
207
282
|
const callDemand = new CallDemand(validated.data);
|
|
208
283
|
const result = validated.submission
|
|
209
284
|
? await callDemand.call_with_submission(env, await transformSubmission(validated.submission))
|
|
210
285
|
: await callDemand.call(env);
|
|
211
|
-
|
|
286
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
287
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
288
|
+
return output;
|
|
212
289
|
}
|
|
213
290
|
case "order": {
|
|
291
|
+
if (validated.data?.progress) {
|
|
292
|
+
constraintWarnings.push("Order routing hint: order.progress works only for Forwards with " +
|
|
293
|
+
"namedOperator=\"\" (OrderHolder). If the target Forward uses a " +
|
|
294
|
+
"non-empty namedOperator or permissionIndex-only, use progress.operate " +
|
|
295
|
+
"on the Progress object directly instead.");
|
|
296
|
+
}
|
|
214
297
|
const callOrder = new CallOrder(validated.data);
|
|
215
298
|
const result = validated.submission
|
|
216
299
|
? await callOrder.call_with_submission(env, await transformSubmission(validated.submission))
|
|
217
300
|
: await callOrder.call(env);
|
|
218
|
-
|
|
301
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
302
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
303
|
+
return output;
|
|
219
304
|
}
|
|
220
305
|
case "gen_passport": {
|
|
221
306
|
const result = await gen_passport(env, validated.guard, validated.info);
|
|
222
|
-
|
|
307
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
308
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
309
|
+
return output;
|
|
223
310
|
}
|
|
224
311
|
case "proof": {
|
|
225
312
|
const callProof = new CallProof(validated.data);
|
|
226
313
|
const result = validated.submission
|
|
227
314
|
? await callProof.call_with_submission(env, await transformSubmission(validated.submission))
|
|
228
315
|
: await callProof.call(env);
|
|
229
|
-
|
|
316
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
317
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
318
|
+
return output;
|
|
230
319
|
}
|
|
231
320
|
case "gen_proof": {
|
|
232
321
|
const result = await gen_proof(env, validated.proof, validated.server_pubkey, validated.server_signature, validated.proof_type, validated.description, validated.item_count, validated.about_address);
|
|
233
|
-
|
|
322
|
+
const output = handleCallResult(result, buildCtx(validated.data));
|
|
323
|
+
autoAddToProject(projectEnvPrefix, validated.operation_type, result).catch(() => { });
|
|
324
|
+
return output;
|
|
234
325
|
}
|
|
235
326
|
}
|
|
236
327
|
const exhaustiveOp = validated;
|