@wowok/agent-mcp 2.3.18 → 2.4.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.
Files changed (65) hide show
  1. package/dist/customer/industry-risks.js +31 -31
  2. package/dist/customer/order-monitor.js +57 -57
  3. package/dist/customer/order-strategy.js +89 -89
  4. package/dist/customer/post-purchase.js +97 -97
  5. package/dist/customer/reminder-system.js +26 -26
  6. package/dist/customer/risk-assessment.js +46 -46
  7. package/dist/customer/types.d.ts +4 -4
  8. package/dist/customer/types.js +4 -4
  9. package/dist/customer/user-preferences.js +50 -50
  10. package/dist/experience/intent-distill.js +6 -6
  11. package/dist/knowledge/acquisition-flywheel.js +64 -64
  12. package/dist/knowledge/arbitration-trust.js +10 -10
  13. package/dist/knowledge/demand-matching.js +8 -8
  14. package/dist/knowledge/dynamic-pricing.js +18 -18
  15. package/dist/knowledge/flywheel-loop.js +11 -11
  16. package/dist/knowledge/glossary.js +22 -22
  17. package/dist/knowledge/guard-ledger.d.ts +1 -1
  18. package/dist/knowledge/guard-ledger.js +131 -104
  19. package/dist/knowledge/guard-lint.d.ts +76 -0
  20. package/dist/knowledge/guard-lint.js +590 -0
  21. package/dist/knowledge/guard-puzzle.d.ts +109 -14
  22. package/dist/knowledge/guard-puzzle.js +627 -101
  23. package/dist/knowledge/guard-risk.d.ts +8 -1
  24. package/dist/knowledge/guard-risk.js +868 -296
  25. package/dist/knowledge/guard-templates.d.ts +37 -0
  26. package/dist/knowledge/guard-templates.js +329 -0
  27. package/dist/knowledge/guard-translation.d.ts +14 -2
  28. package/dist/knowledge/guard-translation.js +825 -194
  29. package/dist/knowledge/index.d.ts +8 -4
  30. package/dist/knowledge/index.js +9 -5
  31. package/dist/knowledge/industry-evolution.js +29 -29
  32. package/dist/knowledge/industry-generalizer.js +52 -52
  33. package/dist/knowledge/industry-registry.js +20 -33
  34. package/dist/knowledge/intent-metrics.js +67 -67
  35. package/dist/knowledge/process-model.js +80 -80
  36. package/dist/knowledge/reputation-rules.js +9 -9
  37. package/dist/knowledge/reward-templates.js +51 -51
  38. package/dist/knowledge/safety-rules.js +3 -3
  39. package/dist/knowledge/tool-constraints.js +20 -4
  40. package/dist/knowledge/trust-metrics.js +26 -26
  41. package/dist/schema/call/base.js +16 -16
  42. package/dist/schema/call/bridge.d.ts +32 -32
  43. package/dist/schema/call/demand.d.ts +84 -84
  44. package/dist/schema/call/guard.d.ts +153 -0
  45. package/dist/schema/call/guard.js +50 -0
  46. package/dist/schema/call/permission.d.ts +78 -78
  47. package/dist/schema/call/repository.d.ts +22 -22
  48. package/dist/schema/call/semantic.js +228 -24
  49. package/dist/schema/local/wip.d.ts +39 -19
  50. package/dist/schema/local/wip.js +5 -5
  51. package/dist/schema/messenger/index.d.ts +26 -26
  52. package/dist/schema/messenger/index.js +2 -2
  53. package/dist/schema/operations.d.ts +222 -144
  54. package/dist/schema/query/index.d.ts +38 -38
  55. package/dist/schema/trust/index.d.ts +4 -4
  56. package/dist/schema/utils/guard-parser.js +4 -4
  57. package/dist/schema/utils/node-parser.js +14 -14
  58. package/dist/schemas/bridge_operation.output.json +14 -14
  59. package/dist/schemas/index.json +1 -1
  60. package/dist/schemas/messenger_operation.output.json +17 -15
  61. package/dist/schemas/onchain_events.output.json +14 -14
  62. package/dist/schemas/onchain_operations.output.json +14 -14
  63. package/dist/schemas/onchain_table_data.output.json +14 -14
  64. package/dist/schemas/wip_file.output.json +24 -1
  65. package/package.json +2 -2
@@ -5,7 +5,11 @@ import { generateReminders } from "../../customer/index.js";
5
5
  import { getProfile } from "../../experience/user-profile.js";
6
6
  import { injectEvolutionContext, recordIndustrySignal } from "../../knowledge/flywheel-loop.js";
7
7
  import { WException, getMoveErrorDescription, WErrors } from "@wowok/wowok";
8
+ import { GUARDQUERY } from "@wowok/wowok";
8
9
  import { assessGuardRisksForOperation, getRiskSummary } from "../../knowledge/guard-risk.js";
10
+ import { derivePuzzleFromCallData, getPuzzleStatusBooleans, getPendingQuestions, generateConfirmationText, } from "../../knowledge/guard-puzzle.js";
11
+ import { inferSceneFromAction } from "../../knowledge/guard-ledger.js";
12
+ import { matchSemanticPattern } from "../../knowledge/guard-translation.js";
9
13
  function booleanFromSignals(positive, negative) {
10
14
  if (positive)
11
15
  return true;
@@ -1102,11 +1106,11 @@ function buildCustomerAdvice(operation_type, data, safeResult) {
1102
1106
  if (r.action)
1103
1107
  recommendations.push(r.action);
1104
1108
  }
1105
- if (noArbitration && !recommendations.some((r) => r.includes("仲裁"))) {
1106
- recommendations.push("要求商家配置 Arbitration 服务后再下单");
1109
+ if (noArbitration && !recommendations.some((r) => r.includes("arbitration"))) {
1110
+ recommendations.push("Require the merchant to configure an Arbitration service before placing the order");
1107
1111
  }
1108
- if (noCompensation && !recommendations.some((r) => r.includes("赔偿金"))) {
1109
- recommendations.push("要求商家设置 compensation_fund(赔偿金)以保障订单失败时自动赔付");
1112
+ if (noCompensation && !recommendations.some((r) => r.includes("compensation"))) {
1113
+ recommendations.push("Require the merchant to set a compensation_fund to guarantee automatic payout when the order fails");
1110
1114
  }
1111
1115
  const advice = {
1112
1116
  recommendations,
@@ -1127,24 +1131,7 @@ function buildCustomerAdvice(operation_type, data, safeResult) {
1127
1131
  function buildGuardAdvice(operation_type, data, safeResult) {
1128
1132
  try {
1129
1133
  if (operation_type === "guard") {
1130
- const assessment = assessGuardRisksForOperation(operation_type, data);
1131
- if (assessment) {
1132
- const summary = getRiskSummary(assessment);
1133
- const riskWarnings = assessment.risks.map((r) => `[${r.level.toUpperCase()}] ${r.title}: ${r.description}`);
1134
- return {
1135
- current_round: "R7",
1136
- risk_assessment: {
1137
- overall_risk: summary.risk_count > 0 ? assessment.overall_risk : "info",
1138
- risk_count: summary.risk_count,
1139
- critical_count: summary.critical_count,
1140
- high_count: summary.high_count,
1141
- needs_human_review: summary.needs_human_review,
1142
- top_risks: summary.top_risks,
1143
- stakeholder_advice: assessment.stakeholder_advice,
1144
- },
1145
- risk_warnings: riskWarnings.length > 0 ? riskWarnings : undefined,
1146
- };
1147
- }
1134
+ return buildGuardCreateAdvice(data);
1148
1135
  }
1149
1136
  if (operation_type === "gen_passport") {
1150
1137
  const status = safeResult?.error ? "fail" : "pass";
@@ -1163,8 +1150,8 @@ function buildGuardAdvice(operation_type, data, safeResult) {
1163
1150
  if (errorStr.includes("GUARD") || errorStr.includes("Guard") || errorStr.includes("guard")) {
1164
1151
  return {
1165
1152
  risk_warnings: [
1166
- `Guard 验证失败: ${errorStr.slice(0, 200)}`,
1167
- "建议: 检查提交数据是否符合 Guard table 声明,或查询 Guard 定义了解所需 submission",
1153
+ `Guard verification failed: ${errorStr.slice(0, 200)}`,
1154
+ "Suggestion: check whether the submission data matches the Guard table declaration, or query the Guard definition to learn the required submission",
1168
1155
  ],
1169
1156
  };
1170
1157
  }
@@ -1174,6 +1161,223 @@ function buildGuardAdvice(operation_type, data, safeResult) {
1174
1161
  return undefined;
1175
1162
  }
1176
1163
  }
1164
+ function buildGuardCreateAdvice(data) {
1165
+ if (!data)
1166
+ return undefined;
1167
+ const puzzleInput = convertCallDataToPuzzleInput(data);
1168
+ const puzzle = derivePuzzleFromCallData(puzzleInput);
1169
+ const puzzleStatusBooleans = getPuzzleStatusBooleans(puzzle);
1170
+ let matchedScene;
1171
+ let sceneDescription;
1172
+ let sceneConstraints;
1173
+ if (data.binding_hint?.action) {
1174
+ matchedScene = inferSceneFromAction(data.binding_hint.action);
1175
+ if (matchedScene) {
1176
+ sceneDescription = matchedScene.name;
1177
+ sceneConstraints = matchedScene.special_constraints;
1178
+ }
1179
+ }
1180
+ let suggestedPatterns;
1181
+ const intentText = data.binding_hint?.rule_sentence
1182
+ || data.binding_hint?.action
1183
+ || "";
1184
+ if (intentText) {
1185
+ const matched = matchSemanticPattern(intentText);
1186
+ if (matched.length > 0) {
1187
+ suggestedPatterns = matched.map((m) => `${m.id}: ${m.pattern_name}`);
1188
+ }
1189
+ }
1190
+ let confirmationText;
1191
+ try {
1192
+ const text = generateConfirmationText(puzzle);
1193
+ if (!text.startsWith("[Puzzle incomplete]")) {
1194
+ confirmationText = text;
1195
+ }
1196
+ }
1197
+ catch {
1198
+ }
1199
+ let pendingQuestions;
1200
+ const pendingQs = getPendingQuestions(puzzle);
1201
+ if (pendingQs.length > 0) {
1202
+ pendingQuestions = pendingQs;
1203
+ }
1204
+ let availableQueries;
1205
+ if (matchedScene) {
1206
+ const sceneObjectType = mapSceneToObjectType(matchedScene);
1207
+ if (sceneObjectType) {
1208
+ const filtered = GUARDQUERY
1209
+ .filter((q) => q.objectType === sceneObjectType)
1210
+ .slice(0, 10)
1211
+ .map((q) => ({
1212
+ id: q.id,
1213
+ name: q.name,
1214
+ objectType: String(q.objectType),
1215
+ returnType: String(q.return),
1216
+ description: q.description,
1217
+ }));
1218
+ if (filtered.length > 0) {
1219
+ availableQueries = filtered;
1220
+ }
1221
+ }
1222
+ }
1223
+ const assessment = assessGuardRisksForOperation("guard", data);
1224
+ let riskAssessment;
1225
+ let riskWarnings;
1226
+ if (assessment) {
1227
+ const summary = getRiskSummary(assessment);
1228
+ riskAssessment = {
1229
+ overall_risk: summary.risk_count > 0 ? assessment.overall_risk : "info",
1230
+ risk_count: summary.risk_count,
1231
+ critical_count: summary.critical_count,
1232
+ high_count: summary.high_count,
1233
+ needs_human_review: summary.needs_human_review,
1234
+ top_risks: summary.top_risks,
1235
+ stakeholder_advice: assessment.stakeholder_advice,
1236
+ };
1237
+ const warnings = assessment.risks.map((r) => `[${r.level.toUpperCase()}] ${r.title}: ${r.description}`);
1238
+ if (warnings.length > 0) {
1239
+ riskWarnings = warnings;
1240
+ }
1241
+ }
1242
+ const advice = {
1243
+ current_round: "R7",
1244
+ puzzle_status: puzzleStatusBooleans,
1245
+ };
1246
+ if (matchedScene)
1247
+ advice.matched_scene = matchedScene.id;
1248
+ if (sceneDescription)
1249
+ advice.scene_description = sceneDescription;
1250
+ if (sceneConstraints)
1251
+ advice.scene_constraints = sceneConstraints;
1252
+ if (suggestedPatterns)
1253
+ advice.suggested_patterns = suggestedPatterns;
1254
+ if (availableQueries)
1255
+ advice.available_queries = availableQueries;
1256
+ if (riskWarnings)
1257
+ advice.risk_warnings = riskWarnings;
1258
+ if (pendingQuestions)
1259
+ advice.pending_questions = pendingQuestions;
1260
+ if (confirmationText)
1261
+ advice.confirmation_text = confirmationText;
1262
+ if (riskAssessment)
1263
+ advice.risk_assessment = riskAssessment;
1264
+ return advice;
1265
+ }
1266
+ function convertCallDataToPuzzleInput(data) {
1267
+ const result = {};
1268
+ if (Array.isArray(data.table)) {
1269
+ result.table = data.table.map((item) => ({
1270
+ identifier: item.identifier,
1271
+ b_submission: item.b_submission,
1272
+ value_type: typeof item.value_type === "string" ? item.value_type : String(item.value_type),
1273
+ value: convertValueSnapshot(item.value),
1274
+ name: item.name ?? "",
1275
+ object_type: item.object_type,
1276
+ }));
1277
+ }
1278
+ if (data.root && typeof data.root === "object") {
1279
+ const rootObj = data.root;
1280
+ if (rootObj.type !== "file" && rootObj.type !== "node") {
1281
+ result.root = convertNodeToSnapshot(data.root);
1282
+ }
1283
+ else if (rootObj.type === "node" && data.root.node) {
1284
+ result.root = convertNodeToSnapshot(data.root.node);
1285
+ }
1286
+ }
1287
+ if (data.rely && Array.isArray(data.rely.guards)) {
1288
+ result.rely = {
1289
+ guards: data.rely.guards.map((g) => typeof g === "string" ? g : String(g)),
1290
+ logic_or: data.rely.logic_or,
1291
+ };
1292
+ }
1293
+ if (data.binding_hint) {
1294
+ const bh = data.binding_hint;
1295
+ const bindingHint = {
1296
+ action: bh.action,
1297
+ host_object: bh.host_object,
1298
+ binding_field: bh.binding_field,
1299
+ };
1300
+ if (bh.rule_sentence !== undefined)
1301
+ bindingHint.rule_sentence = bh.rule_sentence;
1302
+ if (bh.failure_conditions !== undefined)
1303
+ bindingHint.failure_conditions = bh.failure_conditions;
1304
+ if (bh.circular_reference !== undefined)
1305
+ bindingHint.circular_reference = bh.circular_reference;
1306
+ result.binding_hint = bindingHint;
1307
+ }
1308
+ return result;
1309
+ }
1310
+ function convertNodeToSnapshot(node) {
1311
+ if (!node || typeof node !== "object") {
1312
+ return { type: "unknown" };
1313
+ }
1314
+ const snapshot = {
1315
+ type: String(node.type ?? "unknown"),
1316
+ };
1317
+ if (typeof node.identifier === "number") {
1318
+ snapshot.identifier = node.identifier;
1319
+ }
1320
+ if (node.query !== undefined) {
1321
+ snapshot.query = typeof node.query === "number" ? node.query : String(node.query);
1322
+ }
1323
+ if (node.object && typeof node.object === "object") {
1324
+ const obj = {
1325
+ identifier: Number(node.object.identifier),
1326
+ };
1327
+ if (typeof node.object.convert_witness === "number") {
1328
+ obj.convert_witness = node.object.convert_witness;
1329
+ }
1330
+ snapshot.object = obj;
1331
+ }
1332
+ if (Array.isArray(node.parameters)) {
1333
+ snapshot.parameters = node.parameters.map((p) => convertNodeToSnapshot(p));
1334
+ }
1335
+ if (typeof node.context === "string") {
1336
+ const ctxValue = node.context;
1337
+ if (ctxValue === "Clock" || ctxValue === "Guard" || ctxValue === "Signer") {
1338
+ snapshot.context = ctxValue;
1339
+ }
1340
+ }
1341
+ if (Array.isArray(node.nodes)) {
1342
+ snapshot.nodes = node.nodes.map((n) => convertNodeToSnapshot(n));
1343
+ }
1344
+ if (node.node) {
1345
+ snapshot.node = convertNodeToSnapshot(node.node);
1346
+ }
1347
+ if (node.nodeLeft) {
1348
+ snapshot.nodeLeft = convertNodeToSnapshot(node.nodeLeft);
1349
+ }
1350
+ if (node.nodeRight) {
1351
+ snapshot.nodeRight = convertNodeToSnapshot(node.nodeRight);
1352
+ }
1353
+ return snapshot;
1354
+ }
1355
+ function convertValueSnapshot(value) {
1356
+ if (value === undefined || value === null)
1357
+ return undefined;
1358
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
1359
+ return value;
1360
+ }
1361
+ if (Array.isArray(value)) {
1362
+ const allString = value.every((v) => typeof v === "string");
1363
+ if (allString)
1364
+ return value;
1365
+ const allNumber = value.every((v) => typeof v === "number");
1366
+ if (allNumber)
1367
+ return value;
1368
+ const allBool = value.every((v) => typeof v === "boolean");
1369
+ if (allBool)
1370
+ return value;
1371
+ return JSON.stringify(value);
1372
+ }
1373
+ return JSON.stringify(value);
1374
+ }
1375
+ function mapSceneToObjectType(scene) {
1376
+ const hostObject = scene.host_object;
1377
+ if (hostObject === "Standalone")
1378
+ return undefined;
1379
+ return hostObject;
1380
+ }
1177
1381
  export function buildSemantic(safeResult, context) {
1178
1382
  if (!context)
1179
1383
  return undefined;
@@ -136,8 +136,8 @@ export declare const WipSignatureArraySchema: z.ZodUnion<[z.ZodObject<{
136
136
  }>, "many">]>;
137
137
  export declare const WipMetaSchema: z.ZodObject<{
138
138
  type: z.ZodLiteral<"wip">;
139
- version: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
140
- created: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
139
+ version: z.ZodString;
140
+ created: z.ZodString;
141
141
  hash: z.ZodString;
142
142
  algorithm: z.ZodLiteral<"sha256">;
143
143
  signature: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
@@ -173,9 +173,9 @@ export declare const WipMetaSchema: z.ZodObject<{
173
173
  }>, "many">]>>;
174
174
  }, "strip", z.ZodTypeAny, {
175
175
  type: "wip";
176
- version: string | number;
176
+ version: string;
177
177
  algorithm: "sha256";
178
- created: string | number;
178
+ created: string;
179
179
  hash: string;
180
180
  signature?: {
181
181
  value: string;
@@ -190,9 +190,9 @@ export declare const WipMetaSchema: z.ZodObject<{
190
190
  }[] | undefined;
191
191
  }, {
192
192
  type: "wip";
193
- version: string | number;
193
+ version: string;
194
194
  algorithm: "sha256";
195
- created: string | number;
195
+ created: string;
196
196
  hash: string;
197
197
  signature?: {
198
198
  value: string;
@@ -260,8 +260,8 @@ export declare const WipFileSchema: z.ZodObject<{
260
260
  }>;
261
261
  meta: z.ZodObject<{
262
262
  type: z.ZodLiteral<"wip">;
263
- version: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
264
- created: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
263
+ version: z.ZodString;
264
+ created: z.ZodString;
265
265
  hash: z.ZodString;
266
266
  algorithm: z.ZodLiteral<"sha256">;
267
267
  signature: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
@@ -297,9 +297,9 @@ export declare const WipFileSchema: z.ZodObject<{
297
297
  }>, "many">]>>;
298
298
  }, "strip", z.ZodTypeAny, {
299
299
  type: "wip";
300
- version: string | number;
300
+ version: string;
301
301
  algorithm: "sha256";
302
- created: string | number;
302
+ created: string;
303
303
  hash: string;
304
304
  signature?: {
305
305
  value: string;
@@ -314,9 +314,9 @@ export declare const WipFileSchema: z.ZodObject<{
314
314
  }[] | undefined;
315
315
  }, {
316
316
  type: "wip";
317
- version: string | number;
317
+ version: string;
318
318
  algorithm: "sha256";
319
- created: string | number;
319
+ created: string;
320
320
  hash: string;
321
321
  signature?: {
322
322
  value: string;
@@ -346,9 +346,9 @@ export declare const WipFileSchema: z.ZodObject<{
346
346
  };
347
347
  meta: {
348
348
  type: "wip";
349
- version: string | number;
349
+ version: string;
350
350
  algorithm: "sha256";
351
- created: string | number;
351
+ created: string;
352
352
  hash: string;
353
353
  signature?: {
354
354
  value: string;
@@ -378,9 +378,9 @@ export declare const WipFileSchema: z.ZodObject<{
378
378
  };
379
379
  meta: {
380
380
  type: "wip";
381
- version: string | number;
381
+ version: string;
382
382
  algorithm: "sha256";
383
- created: string | number;
383
+ created: string;
384
384
  hash: string;
385
385
  signature?: {
386
386
  value: string;
@@ -740,7 +740,19 @@ export declare const WipOperationOutputSchema: z.ZodDiscriminatedUnion<"type", [
740
740
  hashValid: z.ZodBoolean;
741
741
  signatureValid: z.ZodOptional<z.ZodBoolean>;
742
742
  hasSignature: z.ZodBoolean;
743
- signatures: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
743
+ signatures: z.ZodOptional<z.ZodArray<z.ZodObject<{
744
+ publicKey: z.ZodString;
745
+ address: z.ZodOptional<z.ZodString>;
746
+ valid: z.ZodBoolean;
747
+ }, "strip", z.ZodTypeAny, {
748
+ valid: boolean;
749
+ publicKey: string;
750
+ address?: string | undefined;
751
+ }, {
752
+ valid: boolean;
753
+ publicKey: string;
754
+ address?: string | undefined;
755
+ }>, "many">>;
744
756
  }, "strip", z.ZodTypeAny, {
745
757
  valid: boolean;
746
758
  type: "verify";
@@ -748,7 +760,11 @@ export declare const WipOperationOutputSchema: z.ZodDiscriminatedUnion<"type", [
748
760
  hasSignature: boolean;
749
761
  error?: string | undefined;
750
762
  signatureValid?: boolean | undefined;
751
- signatures?: any[] | undefined;
763
+ signatures?: {
764
+ valid: boolean;
765
+ publicKey: string;
766
+ address?: string | undefined;
767
+ }[] | undefined;
752
768
  }, {
753
769
  valid: boolean;
754
770
  type: "verify";
@@ -756,7 +772,11 @@ export declare const WipOperationOutputSchema: z.ZodDiscriminatedUnion<"type", [
756
772
  hasSignature: boolean;
757
773
  error?: string | undefined;
758
774
  signatureValid?: boolean | undefined;
759
- signatures?: any[] | undefined;
775
+ signatures?: {
776
+ valid: boolean;
777
+ publicKey: string;
778
+ address?: string | undefined;
779
+ }[] | undefined;
760
780
  }>, z.ZodObject<{
761
781
  type: z.ZodLiteral<"sign">;
762
782
  filePath: z.ZodString;
@@ -51,7 +51,7 @@ export const WipPayloadSchema = z
51
51
  export const WipSignatureSchema = z
52
52
  .object({
53
53
  value: z.string().describe("Base64 encoded signature value"),
54
- publicKey: z.string().describe("Verification public key (Base64 encoded 32 bytes) or DID"),
54
+ publicKey: z.string().describe("Verification public key (Base64 encoded, 897 bytes for Falcon-512)"),
55
55
  algorithm: SignatureAlgorithmSchema.describe("Signature algorithm"),
56
56
  address: z.string().optional().describe("Signer address"),
57
57
  })
@@ -62,9 +62,9 @@ export const WipSignatureArraySchema = z
62
62
  export const WipMetaSchema = z
63
63
  .object({
64
64
  type: z.literal("wip").describe("File type identifier, fixed as wip"),
65
- version: z.union([z.string(), z.number()]).describe("Format version number"),
66
- created: z.union([z.string(), z.number()]).describe("Creation time (ISO 8601 format)"),
67
- hash: z.string().describe("SHA-256 hash of payload, format: sha256:hexString"),
65
+ version: z.string().describe("Format version number"),
66
+ created: z.string().describe("Creation time in ISO 8601 format"),
67
+ hash: z.string().describe("SHA-256 hash of { wip, payload } as a lowercase hex string (no prefix)"),
68
68
  algorithm: HashAlgorithmSchema.describe("Hash algorithm identifier"),
69
69
  signature: WipSignatureArraySchema.optional().describe("Optional digital signature"),
70
70
  })
@@ -172,7 +172,7 @@ export const WipOperationOutputSchema = z.discriminatedUnion("type", [
172
172
  hashValid: z.boolean(),
173
173
  signatureValid: z.boolean().optional(),
174
174
  hasSignature: z.boolean(),
175
- signatures: z.array(z.any()).optional(),
175
+ signatures: z.array(WipSignatureVerificationSchema).optional(),
176
176
  }),
177
177
  z.object({
178
178
  type: z.literal("sign"),
@@ -527,7 +527,7 @@ export declare const MessageFilterSchema: z.ZodObject<{
527
527
  hasLastReceivedIndexOnly?: boolean | undefined;
528
528
  lastReceivedIndexMin?: number | undefined;
529
529
  lastReceivedIndexMax?: number | undefined;
530
- listFilterMode?: "guard" | "friends" | "stranger" | "any" | undefined;
530
+ listFilterMode?: "guard" | "any" | "friends" | "stranger" | undefined;
531
531
  customListFilter?: {
532
532
  relation?: "union" | "intersection" | undefined;
533
533
  includeAddresses?: string[] | undefined;
@@ -569,7 +569,7 @@ export declare const MessageFilterSchema: z.ZodObject<{
569
569
  hasLastReceivedIndexOnly?: boolean | undefined;
570
570
  lastReceivedIndexMin?: number | undefined;
571
571
  lastReceivedIndexMax?: number | undefined;
572
- listFilterMode?: "guard" | "friends" | "stranger" | "any" | undefined;
572
+ listFilterMode?: "guard" | "any" | "friends" | "stranger" | undefined;
573
573
  customListFilter?: {
574
574
  relation?: "union" | "intersection" | undefined;
575
575
  includeAddresses?: string[] | undefined;
@@ -891,8 +891,8 @@ export declare const WtsSignatureVerificationSchema: z.ZodObject<{
891
891
  export declare const WtsVerificationResultSchema: z.ZodObject<{
892
892
  valid: z.ZodBoolean;
893
893
  error: z.ZodOptional<z.ZodString>;
894
- hashValid: z.ZodOptional<z.ZodBoolean>;
895
- hasSignature: z.ZodOptional<z.ZodBoolean>;
894
+ hashValid: z.ZodBoolean;
895
+ hasSignature: z.ZodBoolean;
896
896
  signatureValid: z.ZodOptional<z.ZodBoolean>;
897
897
  signatures: z.ZodOptional<z.ZodArray<z.ZodObject<{
898
898
  publicKey: z.ZodString;
@@ -909,10 +909,10 @@ export declare const WtsVerificationResultSchema: z.ZodObject<{
909
909
  }>, "many">>;
910
910
  }, "strip", z.ZodTypeAny, {
911
911
  valid: boolean;
912
+ hashValid: boolean;
913
+ hasSignature: boolean;
912
914
  error?: string | undefined;
913
- hashValid?: boolean | undefined;
914
915
  signatureValid?: boolean | undefined;
915
- hasSignature?: boolean | undefined;
916
916
  signatures?: {
917
917
  valid: boolean;
918
918
  publicKey: string;
@@ -920,10 +920,10 @@ export declare const WtsVerificationResultSchema: z.ZodObject<{
920
920
  }[] | undefined;
921
921
  }, {
922
922
  valid: boolean;
923
+ hashValid: boolean;
924
+ hasSignature: boolean;
923
925
  error?: string | undefined;
924
- hashValid?: boolean | undefined;
925
926
  signatureValid?: boolean | undefined;
926
- hasSignature?: boolean | undefined;
927
927
  signatures?: {
928
928
  valid: boolean;
929
929
  publicKey: string;
@@ -1692,7 +1692,7 @@ export declare const MessengerOperationInputSchema: z.ZodDiscriminatedUnion<"ope
1692
1692
  hasLastReceivedIndexOnly?: boolean | undefined;
1693
1693
  lastReceivedIndexMin?: number | undefined;
1694
1694
  lastReceivedIndexMax?: number | undefined;
1695
- listFilterMode?: "guard" | "friends" | "stranger" | "any" | undefined;
1695
+ listFilterMode?: "guard" | "any" | "friends" | "stranger" | undefined;
1696
1696
  customListFilter?: {
1697
1697
  relation?: "union" | "intersection" | undefined;
1698
1698
  includeAddresses?: string[] | undefined;
@@ -1734,7 +1734,7 @@ export declare const MessengerOperationInputSchema: z.ZodDiscriminatedUnion<"ope
1734
1734
  hasLastReceivedIndexOnly?: boolean | undefined;
1735
1735
  lastReceivedIndexMin?: number | undefined;
1736
1736
  lastReceivedIndexMax?: number | undefined;
1737
- listFilterMode?: "guard" | "friends" | "stranger" | "any" | undefined;
1737
+ listFilterMode?: "guard" | "any" | "friends" | "stranger" | undefined;
1738
1738
  customListFilter?: {
1739
1739
  relation?: "union" | "intersection" | undefined;
1740
1740
  includeAddresses?: string[] | undefined;
@@ -1779,7 +1779,7 @@ export declare const MessengerOperationInputSchema: z.ZodDiscriminatedUnion<"ope
1779
1779
  hasLastReceivedIndexOnly?: boolean | undefined;
1780
1780
  lastReceivedIndexMin?: number | undefined;
1781
1781
  lastReceivedIndexMax?: number | undefined;
1782
- listFilterMode?: "guard" | "friends" | "stranger" | "any" | undefined;
1782
+ listFilterMode?: "guard" | "any" | "friends" | "stranger" | undefined;
1783
1783
  customListFilter?: {
1784
1784
  relation?: "union" | "intersection" | undefined;
1785
1785
  includeAddresses?: string[] | undefined;
@@ -1824,7 +1824,7 @@ export declare const MessengerOperationInputSchema: z.ZodDiscriminatedUnion<"ope
1824
1824
  hasLastReceivedIndexOnly?: boolean | undefined;
1825
1825
  lastReceivedIndexMin?: number | undefined;
1826
1826
  lastReceivedIndexMax?: number | undefined;
1827
- listFilterMode?: "guard" | "friends" | "stranger" | "any" | undefined;
1827
+ listFilterMode?: "guard" | "any" | "friends" | "stranger" | undefined;
1828
1828
  customListFilter?: {
1829
1829
  relation?: "union" | "intersection" | undefined;
1830
1830
  includeAddresses?: string[] | undefined;
@@ -3702,8 +3702,8 @@ export declare const MessengerOperationOutputSchema: z.ZodObject<{
3702
3702
  result: z.ZodObject<{
3703
3703
  valid: z.ZodBoolean;
3704
3704
  error: z.ZodOptional<z.ZodString>;
3705
- hashValid: z.ZodOptional<z.ZodBoolean>;
3706
- hasSignature: z.ZodOptional<z.ZodBoolean>;
3705
+ hashValid: z.ZodBoolean;
3706
+ hasSignature: z.ZodBoolean;
3707
3707
  signatureValid: z.ZodOptional<z.ZodBoolean>;
3708
3708
  signatures: z.ZodOptional<z.ZodArray<z.ZodObject<{
3709
3709
  publicKey: z.ZodString;
@@ -3720,10 +3720,10 @@ export declare const MessengerOperationOutputSchema: z.ZodObject<{
3720
3720
  }>, "many">>;
3721
3721
  }, "strip", z.ZodTypeAny, {
3722
3722
  valid: boolean;
3723
+ hashValid: boolean;
3724
+ hasSignature: boolean;
3723
3725
  error?: string | undefined;
3724
- hashValid?: boolean | undefined;
3725
3726
  signatureValid?: boolean | undefined;
3726
- hasSignature?: boolean | undefined;
3727
3727
  signatures?: {
3728
3728
  valid: boolean;
3729
3729
  publicKey: string;
@@ -3731,10 +3731,10 @@ export declare const MessengerOperationOutputSchema: z.ZodObject<{
3731
3731
  }[] | undefined;
3732
3732
  }, {
3733
3733
  valid: boolean;
3734
+ hashValid: boolean;
3735
+ hasSignature: boolean;
3734
3736
  error?: string | undefined;
3735
- hashValid?: boolean | undefined;
3736
3737
  signatureValid?: boolean | undefined;
3737
- hasSignature?: boolean | undefined;
3738
3738
  signatures?: {
3739
3739
  valid: boolean;
3740
3740
  publicKey: string;
@@ -3744,10 +3744,10 @@ export declare const MessengerOperationOutputSchema: z.ZodObject<{
3744
3744
  }, "strip", z.ZodTypeAny, {
3745
3745
  result: {
3746
3746
  valid: boolean;
3747
+ hashValid: boolean;
3748
+ hasSignature: boolean;
3747
3749
  error?: string | undefined;
3748
- hashValid?: boolean | undefined;
3749
3750
  signatureValid?: boolean | undefined;
3750
- hasSignature?: boolean | undefined;
3751
3751
  signatures?: {
3752
3752
  valid: boolean;
3753
3753
  publicKey: string;
@@ -3758,10 +3758,10 @@ export declare const MessengerOperationOutputSchema: z.ZodObject<{
3758
3758
  }, {
3759
3759
  result: {
3760
3760
  valid: boolean;
3761
+ hashValid: boolean;
3762
+ hasSignature: boolean;
3761
3763
  error?: string | undefined;
3762
- hashValid?: boolean | undefined;
3763
3764
  signatureValid?: boolean | undefined;
3764
- hasSignature?: boolean | undefined;
3765
3765
  signatures?: {
3766
3766
  valid: boolean;
3767
3767
  publicKey: string;
@@ -5243,10 +5243,10 @@ export declare const MessengerOperationOutputSchema: z.ZodObject<{
5243
5243
  } | {
5244
5244
  result: {
5245
5245
  valid: boolean;
5246
+ hashValid: boolean;
5247
+ hasSignature: boolean;
5246
5248
  error?: string | undefined;
5247
- hashValid?: boolean | undefined;
5248
5249
  signatureValid?: boolean | undefined;
5249
- hasSignature?: boolean | undefined;
5250
5250
  signatures?: {
5251
5251
  valid: boolean;
5252
5252
  publicKey: string;
@@ -5656,10 +5656,10 @@ export declare const MessengerOperationOutputSchema: z.ZodObject<{
5656
5656
  } | {
5657
5657
  result: {
5658
5658
  valid: boolean;
5659
+ hashValid: boolean;
5660
+ hasSignature: boolean;
5659
5661
  error?: string | undefined;
5660
- hashValid?: boolean | undefined;
5661
5662
  signatureValid?: boolean | undefined;
5662
- hasSignature?: boolean | undefined;
5663
5663
  signatures?: {
5664
5664
  valid: boolean;
5665
5665
  publicKey: string;
@@ -185,8 +185,8 @@ export const WtsSignatureVerificationSchema = z.object({
185
185
  export const WtsVerificationResultSchema = z.object({
186
186
  valid: z.boolean().describe("Whether verification succeeded"),
187
187
  error: z.string().optional().describe("Error message if verification failed"),
188
- hashValid: z.boolean().optional().describe("Whether hash validation passed"),
189
- hasSignature: z.boolean().optional().describe("Whether WTS has signatures"),
188
+ hashValid: z.boolean().describe("Whether hash validation passed"),
189
+ hasSignature: z.boolean().describe("Whether WTS has signatures"),
190
190
  signatureValid: z.boolean().optional().describe("Whether signature validation passed"),
191
191
  signatures: z.array(WtsSignatureVerificationSchema).optional().describe("Signature verification details"),
192
192
  }).describe("WTS verification result");