@wowok/agent-mcp 2.3.13 → 2.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/runtime.d.ts +26 -0
- package/dist/config/runtime.js +217 -0
- package/dist/customer/industry-risks.d.ts +36 -0
- package/dist/customer/industry-risks.js +424 -0
- package/dist/customer/info-puzzle.d.ts +102 -0
- package/dist/customer/info-puzzle.js +312 -0
- package/dist/customer/order-monitor.d.ts +75 -0
- package/dist/customer/order-monitor.js +327 -0
- package/dist/customer/order-strategy.d.ts +36 -0
- package/dist/customer/order-strategy.js +373 -0
- package/dist/customer/post-purchase.d.ts +42 -0
- package/dist/customer/post-purchase.js +350 -0
- package/dist/customer/reminder-system.d.ts +42 -0
- package/dist/customer/reminder-system.js +295 -0
- package/dist/customer/risk-assessment.d.ts +8 -0
- package/dist/customer/risk-assessment.js +337 -0
- package/dist/customer/types.d.ts +193 -0
- package/dist/customer/types.js +13 -0
- package/dist/customer/user-preferences.d.ts +67 -0
- package/dist/customer/user-preferences.js +451 -0
- package/dist/experience/experience-reuse.d.ts +10 -0
- package/dist/experience/experience-reuse.js +103 -0
- package/dist/experience/index.d.ts +6 -0
- package/dist/experience/index.js +5 -0
- package/dist/experience/intent-distill.d.ts +3 -0
- package/dist/experience/intent-distill.js +83 -0
- package/dist/experience/realtime-feedback.d.ts +5 -0
- package/dist/experience/realtime-feedback.js +77 -0
- package/dist/experience/types.d.ts +50 -0
- package/dist/experience/types.js +1 -0
- package/dist/experience/user-profile.d.ts +25 -0
- package/dist/experience/user-profile.js +171 -0
- package/dist/harness/checkpoint.d.ts +8 -0
- package/dist/harness/checkpoint.js +129 -0
- package/dist/harness/index.d.ts +33 -0
- package/dist/harness/index.js +75 -0
- package/dist/harness/plan.d.ts +18 -0
- package/dist/harness/plan.js +252 -0
- package/dist/harness/recover.d.ts +17 -0
- package/dist/harness/recover.js +139 -0
- package/dist/harness/types.d.ts +137 -0
- package/dist/harness/types.js +1 -0
- package/dist/harness/verify.d.ts +42 -0
- package/dist/harness/verify.js +237 -0
- package/dist/index.js +667 -201
- package/dist/knowledge/acquisition-flywheel.d.ts +50 -0
- package/dist/knowledge/acquisition-flywheel.js +183 -0
- package/dist/knowledge/arbitration-trust.d.ts +24 -0
- package/dist/knowledge/arbitration-trust.js +117 -0
- package/dist/knowledge/audit-rules.d.ts +28 -0
- package/dist/knowledge/audit-rules.js +141 -0
- package/dist/knowledge/demand-matching.d.ts +29 -0
- package/dist/knowledge/demand-matching.js +132 -0
- package/dist/knowledge/dynamic-pricing.d.ts +31 -0
- package/dist/knowledge/dynamic-pricing.js +87 -0
- package/dist/knowledge/flywheel-loop.d.ts +87 -0
- package/dist/knowledge/flywheel-loop.js +378 -0
- package/dist/knowledge/glossary.d.ts +18 -0
- package/dist/knowledge/glossary.js +209 -0
- package/dist/knowledge/index.d.ts +64 -0
- package/dist/knowledge/index.js +66 -0
- package/dist/knowledge/industry-evolution.d.ts +82 -0
- package/dist/knowledge/industry-evolution.js +323 -0
- package/dist/knowledge/industry-generalizer.d.ts +17 -0
- package/dist/knowledge/industry-generalizer.js +381 -0
- package/dist/knowledge/industry-registry.d.ts +49 -0
- package/dist/knowledge/industry-registry.js +167 -0
- package/dist/knowledge/intent-metrics.d.ts +42 -0
- package/dist/knowledge/intent-metrics.js +566 -0
- package/dist/knowledge/process-model.d.ts +24 -0
- package/dist/knowledge/process-model.js +160 -0
- package/dist/knowledge/reputation-rules.d.ts +42 -0
- package/dist/knowledge/reputation-rules.js +99 -0
- package/dist/knowledge/reward-templates.d.ts +25 -0
- package/dist/knowledge/reward-templates.js +125 -0
- package/dist/knowledge/safety-rules.d.ts +36 -0
- package/dist/knowledge/safety-rules.js +171 -0
- package/dist/knowledge/tool-constraints.d.ts +30 -0
- package/dist/knowledge/tool-constraints.js +185 -0
- package/dist/knowledge/trust-metrics.d.ts +37 -0
- package/dist/knowledge/trust-metrics.js +138 -0
- package/dist/loop-engineering/aggregate.d.ts +50 -0
- package/dist/loop-engineering/aggregate.js +132 -0
- package/dist/loop-engineering/diagnose.d.ts +22 -0
- package/dist/loop-engineering/diagnose.js +273 -0
- package/dist/loop-engineering/improve.d.ts +26 -0
- package/dist/loop-engineering/improve.js +229 -0
- package/dist/loop-engineering/index.d.ts +4 -0
- package/dist/loop-engineering/index.js +4 -0
- package/dist/loop-engineering/pipeline.d.ts +17 -0
- package/dist/loop-engineering/pipeline.js +56 -0
- package/dist/mode-market/index.d.ts +3 -0
- package/dist/mode-market/index.js +3 -0
- package/dist/mode-market/registry.d.ts +53 -0
- package/dist/mode-market/registry.js +124 -0
- package/dist/mode-market/review.d.ts +27 -0
- package/dist/mode-market/review.js +214 -0
- package/dist/mode-market/submission.d.ts +25 -0
- package/dist/mode-market/submission.js +85 -0
- package/dist/project/graph.d.ts +71 -0
- package/dist/project/graph.js +314 -0
- package/dist/project/index.d.ts +62 -0
- package/dist/project/index.js +167 -0
- package/dist/project/namespace.d.ts +62 -0
- package/dist/project/namespace.js +181 -0
- package/dist/project/query.d.ts +40 -0
- package/dist/project/query.js +110 -0
- package/dist/safety/confirm-gate.d.ts +15 -0
- package/dist/safety/confirm-gate.js +44 -0
- package/dist/safety/index.d.ts +3 -0
- package/dist/safety/index.js +3 -0
- package/dist/safety/preview.d.ts +2 -0
- package/dist/safety/preview.js +36 -0
- package/dist/schema/call/allocation.d.ts +55 -40
- package/dist/schema/call/arbitration.d.ts +201 -186
- package/dist/schema/call/base.d.ts +2104 -24
- package/dist/schema/call/base.js +168 -22
- package/dist/schema/call/bridge-handler.js +36 -18
- package/dist/schema/call/bridge.d.ts +777 -120
- package/dist/schema/call/bridge.js +13 -2
- package/dist/schema/call/contact.d.ts +15 -0
- package/dist/schema/call/demand.d.ts +69 -54
- package/dist/schema/call/guard.d.ts +125 -80
- package/dist/schema/call/handler.d.ts +5 -1
- package/dist/schema/call/handler.js +108 -3
- package/dist/schema/call/index.d.ts +1 -0
- package/dist/schema/call/index.js +1 -0
- package/dist/schema/call/machine.d.ts +830 -800
- package/dist/schema/call/order.d.ts +27 -12
- package/dist/schema/call/payment.d.ts +15 -0
- package/dist/schema/call/permission.d.ts +15 -0
- package/dist/schema/call/personal.d.ts +15 -0
- package/dist/schema/call/progress.d.ts +21 -6
- package/dist/schema/call/proof.d.ts +42 -12
- package/dist/schema/call/proof.js +3 -3
- package/dist/schema/call/repository.d.ts +91 -76
- package/dist/schema/call/reward.d.ts +51 -36
- package/dist/schema/call/semantic.d.ts +24 -0
- package/dist/schema/call/semantic.js +981 -0
- package/dist/schema/call/service.d.ts +444 -429
- package/dist/schema/call/treasury.d.ts +219 -204
- package/dist/schema/common/index.js +3 -3
- package/dist/schema/local/index.d.ts +341 -74
- package/dist/schema/local/index.js +44 -7
- package/dist/schema/messenger/index.d.ts +1034 -92
- package/dist/schema/messenger/index.js +18 -0
- package/dist/schema/operations.d.ts +2634 -1817
- package/dist/schema/operations.js +16 -5
- package/dist/schema/query/index.d.ts +2293 -2289
- package/dist/schema/query/index.js +34 -28
- package/dist/schemas/account_operation.output.json +28 -16
- package/dist/schemas/account_operation.schema.json +2 -2
- package/dist/schemas/bridge_operation.output.json +520 -0
- package/dist/schemas/bridge_operation.schema.json +15 -0
- package/dist/schemas/guard2file.schema.json +15 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/local_info_operation.output.json +26 -0
- package/dist/schemas/local_info_operation.schema.json +1 -1
- package/dist/schemas/local_mark_operation.output.json +27 -1
- package/dist/schemas/local_mark_operation.schema.json +4 -4
- package/dist/schemas/machineNode2file.schema.json +15 -0
- package/dist/schemas/messenger_operation.output.json +549 -0
- package/dist/schemas/messenger_operation.schema.json +21 -0
- package/dist/schemas/onchain_events.output.json +3 -0
- package/dist/schemas/onchain_operations.output.json +814 -37
- package/dist/schemas/onchain_operations.schema.json +117 -40
- package/dist/schemas/onchain_operations_allocation.schema.json +26 -9
- package/dist/schemas/onchain_operations_arbitration.schema.json +26 -9
- package/dist/schemas/onchain_operations_contact.schema.json +26 -9
- package/dist/schemas/onchain_operations_demand.schema.json +26 -9
- package/dist/schemas/onchain_operations_gen_passport.schema.json +51 -17
- package/dist/schemas/onchain_operations_guard.schema.json +26 -9
- package/dist/schemas/onchain_operations_machine.schema.json +92 -32
- package/dist/schemas/onchain_operations_order.schema.json +26 -9
- package/dist/schemas/onchain_operations_payment.schema.json +26 -9
- package/dist/schemas/onchain_operations_permission.schema.json +26 -9
- package/dist/schemas/onchain_operations_personal.schema.json +26 -9
- package/dist/schemas/onchain_operations_progress.schema.json +26 -9
- package/dist/schemas/onchain_operations_repository.schema.json +26 -9
- package/dist/schemas/onchain_operations_reward.schema.json +26 -9
- package/dist/schemas/onchain_operations_service.schema.json +26 -9
- package/dist/schemas/onchain_operations_treasury.schema.json +26 -9
- package/dist/schemas/onchain_table_data.output.json +224 -69
- package/dist/schemas/onchain_table_data.schema.json +2 -2
- package/dist/schemas/query_toolkit.schema.json +5 -1
- package/dist/telemetry/index.d.ts +19 -0
- package/dist/telemetry/index.js +112 -0
- package/dist/telemetry/redact.d.ts +2 -0
- package/dist/telemetry/redact.js +23 -0
- package/dist/telemetry/storage.d.ts +8 -0
- package/dist/telemetry/storage.js +80 -0
- package/package.json +6 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createHash } from "crypto";
|
|
2
|
+
const ADDRESS_PATTERN = /^0x[0-9a-fA-F]{40,}$/;
|
|
3
|
+
export function redactAddress(value) {
|
|
4
|
+
if (typeof value !== "string")
|
|
5
|
+
return value;
|
|
6
|
+
if (!ADDRESS_PATTERN.test(value))
|
|
7
|
+
return value;
|
|
8
|
+
const hash = createHash("sha256").update(value.toLowerCase()).digest("hex");
|
|
9
|
+
return "0x" + hash.slice(0, 16);
|
|
10
|
+
}
|
|
11
|
+
export function redactObject(obj) {
|
|
12
|
+
if (typeof obj === "string")
|
|
13
|
+
return redactAddress(obj);
|
|
14
|
+
if (Array.isArray(obj))
|
|
15
|
+
return obj.map(redactObject);
|
|
16
|
+
if (obj && typeof obj === "object" && obj.constructor === Object) {
|
|
17
|
+
const out = {};
|
|
18
|
+
for (const k of Object.keys(obj))
|
|
19
|
+
out[k] = redactObject(obj[k]);
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
return obj;
|
|
23
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TelemetryStorage {
|
|
2
|
+
append(event: Record<string, unknown>): Promise<void>;
|
|
3
|
+
query(filter: Partial<Record<string, unknown>>): Promise<Record<string, unknown>[]>;
|
|
4
|
+
rotate(): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export declare function getStorage(): TelemetryStorage;
|
|
7
|
+
export declare function setStorage(storage: TelemetryStorage): void;
|
|
8
|
+
export declare function getTelemetryFilePath(): string;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { mkdir, appendFile, stat, rename } from "fs/promises";
|
|
2
|
+
import { dirname, join } from "path";
|
|
3
|
+
import { homedir } from "os";
|
|
4
|
+
const MAX_SIZE_BYTES = 10 * 1024 * 1024;
|
|
5
|
+
const DATA_DIR = join(homedir(), ".wowok", "data");
|
|
6
|
+
const TELEMETRY_FILE = join(DATA_DIR, "telemetry.jsonl");
|
|
7
|
+
const ROTATED_FILE = join(DATA_DIR, "telemetry.jsonl.1");
|
|
8
|
+
class JsonlStorage {
|
|
9
|
+
filePath;
|
|
10
|
+
rotatedPath;
|
|
11
|
+
writeQueue = Promise.resolve();
|
|
12
|
+
constructor(filePath = TELEMETRY_FILE, rotatedPath = ROTATED_FILE) {
|
|
13
|
+
this.filePath = filePath;
|
|
14
|
+
this.rotatedPath = rotatedPath;
|
|
15
|
+
}
|
|
16
|
+
async append(event) {
|
|
17
|
+
this.writeQueue = this.writeQueue.then(async () => {
|
|
18
|
+
try {
|
|
19
|
+
await mkdir(dirname(this.filePath), { recursive: true });
|
|
20
|
+
const line = JSON.stringify(event) + "\n";
|
|
21
|
+
await appendFile(this.filePath, line, "utf8");
|
|
22
|
+
await this.maybeRotate();
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return this.writeQueue;
|
|
28
|
+
}
|
|
29
|
+
async query(filter) {
|
|
30
|
+
try {
|
|
31
|
+
const { readFile } = await import("fs/promises");
|
|
32
|
+
const content = await readFile(this.filePath, "utf8");
|
|
33
|
+
const lines = content.split("\n").filter((l) => l.trim());
|
|
34
|
+
const events = lines.map((l) => {
|
|
35
|
+
try {
|
|
36
|
+
return JSON.parse(l);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}).filter((e) => e !== null);
|
|
42
|
+
return events.filter((e) => {
|
|
43
|
+
return Object.entries(filter).every(([k, v]) => e[k] === v);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async rotate() {
|
|
51
|
+
try {
|
|
52
|
+
await rename(this.filePath, this.rotatedPath).catch(() => { });
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async maybeRotate() {
|
|
58
|
+
try {
|
|
59
|
+
const stats = await stat(this.filePath);
|
|
60
|
+
if (stats.size >= MAX_SIZE_BYTES) {
|
|
61
|
+
await this.rotate();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
let _storage = null;
|
|
69
|
+
export function getStorage() {
|
|
70
|
+
if (!_storage) {
|
|
71
|
+
_storage = new JsonlStorage();
|
|
72
|
+
}
|
|
73
|
+
return _storage;
|
|
74
|
+
}
|
|
75
|
+
export function setStorage(storage) {
|
|
76
|
+
_storage = storage;
|
|
77
|
+
}
|
|
78
|
+
export function getTelemetryFilePath() {
|
|
79
|
+
return TELEMETRY_FILE;
|
|
80
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wowok/agent-mcp",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.16",
|
|
4
4
|
"description": "Making It Easy for AI Agents to Communicate, Collaborate, Trade, and Trust.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
39
|
-
"@wowok/wowok": "2.3.
|
|
39
|
+
"@wowok/wowok": "2.3.16",
|
|
40
40
|
"lodash": "^4.18.1",
|
|
41
41
|
"zod": "^3.25.76"
|
|
42
42
|
},
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"@types/node": "^22.19.19",
|
|
45
45
|
"tsx": "^4.21.0",
|
|
46
46
|
"typescript": "^5.8.2",
|
|
47
|
+
"vitest": "^2.1.0",
|
|
47
48
|
"zod-to-json-schema": "^3.25.2"
|
|
48
49
|
},
|
|
49
50
|
"scripts": {
|
|
@@ -51,6 +52,8 @@
|
|
|
51
52
|
"build": "tsc && pnpm generate:schemas",
|
|
52
53
|
"watch": "tsc --watch",
|
|
53
54
|
"start": "tsx src/index.ts",
|
|
54
|
-
"generate:schemas": "tsx scripts/generate-json-schemas.ts"
|
|
55
|
+
"generate:schemas": "tsx scripts/generate-json-schemas.ts",
|
|
56
|
+
"test": "vitest run",
|
|
57
|
+
"test:watch": "vitest"
|
|
55
58
|
}
|
|
56
59
|
}
|