@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.
Files changed (186) hide show
  1. package/README.md +5 -3
  2. package/dist/customer/info-puzzle.d.ts +1 -1
  3. package/dist/customer/info-puzzle.js +4 -2
  4. package/dist/customer/risk-assessment.js +26 -4
  5. package/dist/customer/types.d.ts +2 -0
  6. package/dist/examples/guard-template-balance-check.json +38 -0
  7. package/dist/examples/guard-template-time-lock.json +39 -0
  8. package/dist/examples/machine-template-7node-rental.json +114 -0
  9. package/dist/examples/rental-ziroom-machine-create.json +137 -0
  10. package/dist/examples/rental-ziroom-permission-create.json +35 -0
  11. package/dist/examples/rental-ziroom-service-create.json +80 -0
  12. package/dist/examples/retail-myshop-service-create.json +88 -0
  13. package/dist/extensions/capability-manifest.d.ts +125 -0
  14. package/dist/extensions/capability-manifest.js +594 -0
  15. package/dist/extensions/constraint-registry.d.ts +24 -0
  16. package/dist/extensions/constraint-registry.js +196 -0
  17. package/dist/extensions/index.d.ts +12 -0
  18. package/dist/extensions/index.js +6 -0
  19. package/dist/extensions/metric-registry.d.ts +26 -0
  20. package/dist/extensions/metric-registry.js +257 -0
  21. package/dist/extensions/mode-evaluator.d.ts +15 -0
  22. package/dist/extensions/mode-evaluator.js +170 -0
  23. package/dist/extensions/modes.d.ts +2 -0
  24. package/dist/extensions/modes.js +493 -0
  25. package/dist/extensions/registry.d.ts +50 -0
  26. package/dist/extensions/registry.js +662 -0
  27. package/dist/extensions/types.d.ts +219 -0
  28. package/dist/extensions/types.js +1 -0
  29. package/dist/index.js +50 -0
  30. package/dist/knowledge/deployment-scanner.d.ts +3 -0
  31. package/dist/knowledge/deployment-scanner.js +64 -3
  32. package/dist/knowledge/fund-layer.d.ts +72 -0
  33. package/dist/knowledge/fund-layer.js +420 -0
  34. package/dist/knowledge/guard-render.d.ts +57 -0
  35. package/dist/knowledge/guard-render.js +700 -0
  36. package/dist/knowledge/guard-risk.d.ts +13 -0
  37. package/dist/knowledge/guard-risk.js +57 -0
  38. package/dist/knowledge/guard-submission-prompt.d.ts +31 -0
  39. package/dist/knowledge/guard-submission-prompt.js +171 -0
  40. package/dist/knowledge/guard-templates.js +278 -0
  41. package/dist/knowledge/machine-ledger.js +1 -1
  42. package/dist/knowledge/machine-render.d.ts +41 -0
  43. package/dist/knowledge/machine-render.js +565 -0
  44. package/dist/knowledge/machine-templates.js +24 -5
  45. package/dist/knowledge/reward-confirm.js +2 -2
  46. package/dist/knowledge/reward-puzzle.js +1 -1
  47. package/dist/knowledge/reward-risk.js +9 -9
  48. package/dist/knowledge/reward-templates.js +2 -2
  49. package/dist/knowledge/service-confirm.d.ts +15 -6
  50. package/dist/knowledge/service-confirm.js +119 -11
  51. package/dist/knowledge/service-context.js +1 -1
  52. package/dist/knowledge/service-ledger.js +1 -1
  53. package/dist/knowledge/service-risk.d.ts +1 -1
  54. package/dist/knowledge/service-risk.js +3 -3
  55. package/dist/knowledge/service-templates.js +2 -2
  56. package/dist/knowledge/service-translation.d.ts +1 -1
  57. package/dist/knowledge/service-translation.js +7 -7
  58. package/dist/knowledge/tool-constraints.js +6 -2
  59. package/dist/project/deployment-bridge.d.ts +1 -1
  60. package/dist/project/deployment-bridge.js +31 -7
  61. package/dist/project/deployment-doc.d.ts +3 -0
  62. package/dist/project/deployment-doc.js +76 -14
  63. package/dist/project/edit-planner.d.ts +123 -0
  64. package/dist/project/edit-planner.js +1371 -0
  65. package/dist/project/evaluation.d.ts +2 -0
  66. package/dist/project/evaluation.js +873 -88
  67. package/dist/project/graph-builder.d.ts +4 -1
  68. package/dist/project/graph-builder.js +132 -62
  69. package/dist/project/graph.d.ts +1 -0
  70. package/dist/project/handlers.d.ts +317 -6
  71. package/dist/project/handlers.js +1171 -19
  72. package/dist/project/stage-gate.d.ts +4 -0
  73. package/dist/project/stage-gate.js +64 -5
  74. package/dist/project/task-tracker.d.ts +26 -0
  75. package/dist/project/task-tracker.js +78 -0
  76. package/dist/safety/preview.js +16 -0
  77. package/dist/schema/call/allocation.d.ts +16 -16
  78. package/dist/schema/call/allocation.js +2 -2
  79. package/dist/schema/call/arbitration.js +19 -6
  80. package/dist/schema/call/base.d.ts +21 -13
  81. package/dist/schema/call/base.js +27 -6
  82. package/dist/schema/call/bridge.d.ts +5 -5
  83. package/dist/schema/call/bridge.js +3 -1
  84. package/dist/schema/call/contact.js +2 -2
  85. package/dist/schema/call/demand.d.ts +23 -31
  86. package/dist/schema/call/demand.js +2 -2
  87. package/dist/schema/call/guard.js +2 -2
  88. package/dist/schema/call/machine.d.ts +1976 -752
  89. package/dist/schema/call/machine.js +50 -4
  90. package/dist/schema/call/order.d.ts +149 -228
  91. package/dist/schema/call/order.js +4 -3
  92. package/dist/schema/call/payment.d.ts +183 -3
  93. package/dist/schema/call/payment.js +21 -3
  94. package/dist/schema/call/permission.js +2 -2
  95. package/dist/schema/call/personal.d.ts +241 -52
  96. package/dist/schema/call/progress.d.ts +53 -61
  97. package/dist/schema/call/progress.js +18 -4
  98. package/dist/schema/call/repository.d.ts +23 -31
  99. package/dist/schema/call/repository.js +2 -2
  100. package/dist/schema/call/reward.js +3 -3
  101. package/dist/schema/call/semantic.d.ts +1 -1
  102. package/dist/schema/call/semantic.js +37 -2
  103. package/dist/schema/call/service.d.ts +275 -127
  104. package/dist/schema/call/service.js +89 -13
  105. package/dist/schema/call/treasury.js +3 -3
  106. package/dist/schema/common/index.d.ts +13 -2
  107. package/dist/schema/common/index.js +80 -15
  108. package/dist/schema/local/index.d.ts +32 -35
  109. package/dist/schema/local/index.js +28 -6
  110. package/dist/schema/messenger/index.d.ts +274 -46
  111. package/dist/schema/operations.d.ts +1264 -544
  112. package/dist/schema/operations.js +65 -7
  113. package/dist/schema/project/index.d.ts +2846 -167
  114. package/dist/schema/project/index.js +570 -16
  115. package/dist/schema/query/index.d.ts +922 -349
  116. package/dist/schema/query/index.js +205 -42
  117. package/dist/schema/schema-query/index.d.ts +65 -3
  118. package/dist/schema/schema-query/index.js +38 -5
  119. package/dist/schema/utils/node-parser.js +20 -4
  120. package/dist/schema/utils/object-type-utils.d.ts +12 -0
  121. package/dist/schema/utils/object-type-utils.js +35 -0
  122. package/dist/schema/utils/permission-machine-check.d.ts +49 -0
  123. package/dist/schema/utils/permission-machine-check.js +121 -0
  124. package/dist/schema/utils/skills-recommendation.d.ts +2 -0
  125. package/dist/schema/utils/skills-recommendation.js +76 -0
  126. package/dist/schema-query/index.d.ts +20 -1
  127. package/dist/schema-query/index.js +306 -4
  128. package/dist/schemas/account_operation.output.json +7 -1
  129. package/dist/schemas/account_operation.schema.json +3 -3
  130. package/dist/schemas/bridge_operation.output.json +6 -0
  131. package/dist/schemas/bridge_operation.schema.json +1 -1
  132. package/dist/schemas/guard-templates.json +379 -0
  133. package/dist/schemas/guard2file.schema.json +1 -1
  134. package/dist/schemas/index.json +1 -1
  135. package/dist/schemas/local_info_operation.output.json +6 -0
  136. package/dist/schemas/local_mark_operation.output.json +7 -1
  137. package/dist/schemas/local_mark_operation.schema.json +1 -1
  138. package/dist/schemas/machineNode2file.schema.json +1 -1
  139. package/dist/schemas/messenger_operation.schema.json +4 -4
  140. package/dist/schemas/onchain_events.output.json +1 -1
  141. package/dist/schemas/onchain_operations.output.json +2820 -0
  142. package/dist/schemas/onchain_operations.schema.json +444 -330
  143. package/dist/schemas/onchain_operations_allocation.schema.json +37 -28
  144. package/dist/schemas/onchain_operations_arbitration.schema.json +16 -14
  145. package/dist/schemas/onchain_operations_contact.schema.json +10 -10
  146. package/dist/schemas/onchain_operations_demand.schema.json +10 -10
  147. package/dist/schemas/onchain_operations_gen_passport.schema.json +16 -16
  148. package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -2
  149. package/dist/schemas/onchain_operations_guard.schema.json +2 -2
  150. package/dist/schemas/onchain_operations_machine.schema.json +43 -35
  151. package/dist/schemas/onchain_operations_order.schema.json +72 -78
  152. package/dist/schemas/onchain_operations_payment.schema.json +141 -111
  153. package/dist/schemas/onchain_operations_permission.schema.json +3 -3
  154. package/dist/schemas/onchain_operations_personal.schema.json +7 -7
  155. package/dist/schemas/onchain_operations_progress.schema.json +9 -9
  156. package/dist/schemas/onchain_operations_proof.schema.json +8 -8
  157. package/dist/schemas/onchain_operations_repository.schema.json +10 -10
  158. package/dist/schemas/onchain_operations_reward.schema.json +14 -14
  159. package/dist/schemas/onchain_operations_service.schema.json +119 -48
  160. package/dist/schemas/onchain_operations_treasury.schema.json +11 -11
  161. package/dist/schemas/onchain_table_data.output.json +33 -25
  162. package/dist/schemas/onchain_table_data.schema.json +22 -21
  163. package/dist/schemas/project_operation.output.json +2194 -23
  164. package/dist/schemas/project_operation.schema.json +84 -6
  165. package/dist/schemas/query_toolkit.output.json +108 -80
  166. package/dist/schemas/query_toolkit.schema.json +12 -12
  167. package/dist/schemas/schema_query.output.json +70 -3
  168. package/dist/schemas/schema_query.schema.json +18 -3
  169. package/dist/schemas/wowok_buildin_info.output.json +81 -8
  170. package/dist/schemas/wowok_buildin_info.schema.json +46 -2
  171. package/dist/tools/handlers/local.js +20 -5
  172. package/dist/tools/handlers/onchain.js +594 -6
  173. package/dist/tools/handlers/project.js +76 -4
  174. package/dist/tools/handlers/query.js +27 -0
  175. package/dist/tools/handlers/schema-query.js +43 -1
  176. package/dist/tools/handlers/task-status.d.ts +170 -0
  177. package/dist/tools/handlers/task-status.js +55 -0
  178. package/dist/tools/handlers/wip.js +47 -1
  179. package/dist/tools/index.d.ts +8 -0
  180. package/dist/tools/index.js +387 -12
  181. package/dist/tools/retry.d.ts +8 -0
  182. package/dist/tools/retry.js +85 -0
  183. package/dist/tools/wip-deploy-assist.d.ts +28 -0
  184. package/dist/tools/wip-deploy-assist.js +278 -0
  185. package/package.json +2 -2
  186. package/dist/schemas/guard-node-examples.md +0 -199
@@ -15,9 +15,30 @@ export function strictParse(schema, input, fieldName = "input") {
15
15
  const inputFields = Object.keys(input || {});
16
16
  const unknownFields = inputFields.filter(f => !allowedFields.includes(f));
17
17
  if (unknownFields.length > 0) {
18
- throw new Error(`Unknown ${fieldName} field(s): ${unknownFields.join(', ')}`);
18
+ throw new Error(`Unknown ${fieldName} field(s): ${unknownFields.join(', ')}. ` +
19
+ `Allowed fields: ${allowedFields.join(', ')}. ` +
20
+ `Remove the unknown field(s) or check the schema for the correct field name.`);
19
21
  }
20
- return schema.parse(input);
22
+ const result = schema.safeParse(input);
23
+ if (!result.success) {
24
+ const errorLines = result.error.issues.map(issue => {
25
+ const path = issue.path.length > 0
26
+ ? issue.path.map(p => typeof p === "number" ? `[${p}]` : p).join(".").replace(".[", "[")
27
+ : "(root)";
28
+ let extras = "";
29
+ const issueAny = issue;
30
+ if (issue.code === "invalid_type") {
31
+ const expected = issueAny.expected;
32
+ const received = issueAny.received;
33
+ if (typeof expected === "string" && typeof received === "string") {
34
+ extras = ` (expected: ${expected}; received: ${received})`;
35
+ }
36
+ }
37
+ return ` - ${fieldName}.${path} [${issue.code}]: ${issue.message}${extras}`;
38
+ });
39
+ throw new Error(`${fieldName} validation failed with ${result.error.issues.length} error(s):\n${errorLines.join("\n")}`);
40
+ }
41
+ return result.data;
21
42
  }
22
43
  export const NamedObjectSchema = z.object({
23
44
  name: NameSchema.optional().describe("The name of the object"),
@@ -227,7 +248,7 @@ export const SemanticSummarySchema = z.object({
227
248
  export const CallResponseErrorSchema = z.object({
228
249
  type: z.literal("error").describe("Discriminator for this result variant. Constraint: always 'error'. Example: 'error'"),
229
250
  error: z.string().describe("Human-readable error message from the chain or SDK. Relation: enriched via enrichMoveError before classification. Example: 'Insufficient balance for gas'"),
230
- error_code: z.enum(["invalid_parameter", "guard_rejected", "state_conflict", "insufficient_balance", "object_not_found", "permission_denied", "immutable_violation", "network_error", "rate_limit", "gas_exceeded", "bcs_error", "signature_error", "config_error", "unknown"]).optional().describe("Error classification for programmatic recovery. Constraint: enum of 14 values. Relation: drives Recover Loop strategy selection. Example: 'insufficient_balance'"),
251
+ error_code: z.enum(["invalid_parameter", "guard_rejected", "state_conflict", "insufficient_balance", "object_not_found", "permission_denied", "immutable_violation", "network_error", "rate_limit", "gas_exceeded", "bcs_error", "signature_error", "config_error", "wip_verification_failed", "unknown"]).optional().describe("Error classification for programmatic recovery. Constraint: enum of 15 values (must match ErrorCode in semantic.ts). Relation: drives Recover Loop strategy selection. Example: 'insufficient_balance'"),
231
252
  retryable: z.boolean().optional().describe("Whether the same call can be retried as-is. Constraint: true for network_error, rate_limit, gas_exceeded, and insufficient_balance. Example: true"),
232
253
  recovery_hint: z.string().optional().describe("Recovery suggestion for AI or user. Relation: paired with error_code to guide Recover Loop. Example: 'Claim faucet tokens then retry'"),
233
254
  related_object: z.string().optional().describe("Object ID related to the error, if any. Example: '0x123...'"),
@@ -263,7 +284,7 @@ export const SubmissionCallSchema = z.object({
263
284
  object: NameOrAddressSchema.describe("Guard object name or ID to verify against. Example: 'my-delivery-guard' or '0x123...'"),
264
285
  impack: z.boolean().describe("Whether this Guard's verification result participates in the final logic. Constraint: if false, the Guard is checked but does not block the operation. Example: true"),
265
286
  }).strict()).max(MAX_GUARD_COUNT_PASSPORT).describe(`Array of Guard objects to verify. Constraint: at most ${MAX_GUARD_COUNT_PASSPORT} entries (MAX_GUARD_COUNT_PASSPORT). Relation: each entry corresponds to a Guard bound to the operation.`),
266
- submission: z.array(GuardSubmissionToFillSchema).describe("User-submitted data for each Guard. Relation: one entry per Guard in the guard array; fill submission fields and resubmit via call_with_submission."),
287
+ submission: z.array(GuardSubmissionToFillSchema).describe("User-submitted data for each Guard. Relation: one entry per Guard in the guard array; fill submission fields and resubmit via call_with_submission. PLACEMENT: this `submission` field is at the SAME level as `data` and `env` in the operation input — NOT inside `data.data`. Example structure: {tool:'onchain_operations', data:{operation_type:'order', data:{object:'my_order', progress:{...}}}, submission:{type:'submission', guard:[...], submission:[...]}}"),
267
288
  }).strict().describe("Guard verification required. The operation was blocked because one or more Guards require user-submitted data. Fill the submission array and resubmit. Semantic status is 'pending_input'.");
268
289
  export const TypedPermissionObjectSchema = z.union([
269
290
  NameOrAddressSchema.describe("String format: Reference an EXISTING object by its name (local mark) or on-chain object ID. Use this when the object already exists and you want to reference it."),
@@ -292,7 +313,7 @@ export const CallResultSchema = z.discriminatedUnion("type", [
292
313
  }),
293
314
  CallPendingConfirmationSchema,
294
315
  ]).describe("Discriminated union of 6 result types: 'transaction' (raw Wow response), 'submission' (Guard verification needed), 'error' (failed with error_code), 'data' (query result array), 'null' (no-op completed), 'pending_confirmation' (ConfirmGate blocked — re-call with env.confirmed=true). AI should check result.type first to determine how to process the response.");
295
- export const ObjectsSchema = z.union([
316
+ export const ObjectsSchema = z.preprocess((val) => (Array.isArray(val) ? { op: 'add', objects: val } : val), z.union([
296
317
  z.object({
297
318
  op: z.union([z.literal('add'), z.literal('set')]),
298
319
  objects: z.array(NameOrAddressSchema).describe('List of object IDs or names to add or set'),
@@ -304,7 +325,7 @@ export const ObjectsSchema = z.union([
304
325
  z.object({
305
326
  op: z.literal('clear'),
306
327
  }).strict(),
307
- ]);
328
+ ]));
308
329
  export const VerifyMismatchSchema = z.object({
309
330
  dimension: z.enum(["created", "modified", "released", "state", "event"]).describe("Verify dimension that mismatched. Example: 'created'"),
310
331
  expected: z.string().describe("What the Expect Loop declared. Example: 'Service object created'"),
@@ -2707,19 +2707,19 @@ export declare const BridgeCallOutputSchema: z.ZodObject<{
2707
2707
  }>, z.ZodObject<{
2708
2708
  type: z.ZodLiteral<"error">;
2709
2709
  error: z.ZodString;
2710
- error_code: z.ZodOptional<z.ZodEnum<["invalid_parameter", "guard_rejected", "state_conflict", "insufficient_balance", "object_not_found", "permission_denied", "immutable_violation", "network_error", "unknown"]>>;
2710
+ error_code: z.ZodOptional<z.ZodEnum<["invalid_parameter", "guard_rejected", "state_conflict", "insufficient_balance", "object_not_found", "permission_denied", "immutable_violation", "network_error", "rate_limit", "gas_exceeded", "bcs_error", "signature_error", "config_error", "wip_verification_failed", "unknown"]>>;
2711
2711
  retryable: z.ZodOptional<z.ZodBoolean>;
2712
2712
  recovery_hint: z.ZodOptional<z.ZodString>;
2713
2713
  }, "strip", z.ZodTypeAny, {
2714
2714
  type: "error";
2715
2715
  error: string;
2716
- error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | undefined;
2716
+ error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | "rate_limit" | "gas_exceeded" | "bcs_error" | "signature_error" | "config_error" | "wip_verification_failed" | undefined;
2717
2717
  retryable?: boolean | undefined;
2718
2718
  recovery_hint?: string | undefined;
2719
2719
  }, {
2720
2720
  type: "error";
2721
2721
  error: string;
2722
- error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | undefined;
2722
+ error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | "rate_limit" | "gas_exceeded" | "bcs_error" | "signature_error" | "config_error" | "wip_verification_failed" | undefined;
2723
2723
  retryable?: boolean | undefined;
2724
2724
  recovery_hint?: string | undefined;
2725
2725
  }>]>;
@@ -3393,7 +3393,7 @@ export declare const BridgeCallOutputSchema: z.ZodObject<{
3393
3393
  } | {
3394
3394
  type: "error";
3395
3395
  error: string;
3396
- error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | undefined;
3396
+ error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | "rate_limit" | "gas_exceeded" | "bcs_error" | "signature_error" | "config_error" | "wip_verification_failed" | undefined;
3397
3397
  retryable?: boolean | undefined;
3398
3398
  recovery_hint?: string | undefined;
3399
3399
  };
@@ -3528,7 +3528,7 @@ export declare const BridgeCallOutputSchema: z.ZodObject<{
3528
3528
  } | {
3529
3529
  type: "error";
3530
3530
  error: string;
3531
- error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | undefined;
3531
+ error_code?: "unknown" | "invalid_parameter" | "guard_rejected" | "state_conflict" | "insufficient_balance" | "object_not_found" | "permission_denied" | "immutable_violation" | "network_error" | "rate_limit" | "gas_exceeded" | "bcs_error" | "signature_error" | "config_error" | "wip_verification_failed" | undefined;
3532
3532
  retryable?: boolean | undefined;
3533
3533
  recovery_hint?: string | undefined;
3534
3534
  };
@@ -444,7 +444,9 @@ export const BridgeCallOutputSchema = z.object({
444
444
  .enum([
445
445
  "invalid_parameter", "guard_rejected", "state_conflict",
446
446
  "insufficient_balance", "object_not_found", "permission_denied",
447
- "immutable_violation", "network_error", "unknown",
447
+ "immutable_violation", "network_error", "rate_limit",
448
+ "gas_exceeded", "bcs_error", "signature_error",
449
+ "config_error", "wip_verification_failed", "unknown",
448
450
  ])
449
451
  .optional()
450
452
  .describe("Error classification for programmatic recovery"),
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { WithPermissionObjectSchema, CallEnvSchema, SubmissionCallSchema } from "./base.js";
3
- import { NameOrAddressSchema, ReceivedObjectsOrRecentlySchema, DescriptionSchema, LongNameSchema, NameSchema } from "../common/index.js";
3
+ import { NameOrAddressSchema, ReceivedObjectsOrRecentlySchema, DescriptionSchema, LongNameSchema, NameSchema, RECEIVE_FORMAT_BLOCK_OBJECTS } from "../common/index.js";
4
4
  export const ImEntrySchema = z.object({
5
5
  at: NameOrAddressSchema.describe("Contact's account address or name for instant messaging"),
6
6
  description: LongNameSchema.optional().describe("Optional description or note about this contact"),
@@ -28,7 +28,7 @@ export const CallContact_DataSchema = z.object({
28
28
  description: DescriptionSchema.optional().describe("Contact object description or public information"),
29
29
  location: LongNameSchema.optional().describe("Physical or virtual location information for this contact"),
30
30
  ims: ImsOperationSchema.optional().describe("IM contact list operation: add, set, remove, or clear instant messaging contacts"),
31
- owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Receive objects sent to this contact object and unwrap them to the permission owner"),
31
+ owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Receive objects sent to this Contact object and unwrap them to the permission owner." + RECEIVE_FORMAT_BLOCK_OBJECTS),
32
32
  }).strict().describe("On-chain Contact operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, permission, ...} to create a Contact. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation.");
33
33
  export const CallContact_InputSchema = z.object({
34
34
  data: CallContact_DataSchema.describe("Contact operation data containing object reference and operations to perform"),
@@ -171,7 +171,7 @@ export declare const CallDemand_DataSchema: z.ZodObject<{
171
171
  }>>;
172
172
  description: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
173
173
  location: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
174
- rewards: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
174
+ rewards: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodObject<{
175
175
  op: z.ZodUnion<[z.ZodLiteral<"add">, z.ZodLiteral<"set">]>;
176
176
  objects: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
177
177
  }, "strict", z.ZodTypeAny, {
@@ -195,7 +195,15 @@ export declare const CallDemand_DataSchema: z.ZodObject<{
195
195
  op: "clear";
196
196
  }, {
197
197
  op: "clear";
198
- }>]>>;
198
+ }>]>, {
199
+ op: "set" | "add";
200
+ objects: string[];
201
+ } | {
202
+ op: "remove";
203
+ objects: string[];
204
+ } | {
205
+ op: "clear";
206
+ }, unknown>>;
199
207
  feedback: z.ZodOptional<z.ZodArray<z.ZodObject<{
200
208
  who: z.ZodObject<{
201
209
  name_or_address: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
@@ -427,15 +435,7 @@ export declare const CallDemand_DataSchema: z.ZodObject<{
427
435
  feedback?: string | undefined;
428
436
  acceptance_score?: number | undefined;
429
437
  }[] | undefined;
430
- rewards?: {
431
- op: "set" | "add";
432
- objects: string[];
433
- } | {
434
- op: "remove";
435
- objects: string[];
436
- } | {
437
- op: "clear";
438
- } | undefined;
438
+ rewards?: unknown;
439
439
  guards?: {
440
440
  guard: {
441
441
  guard: string;
@@ -543,7 +543,7 @@ export declare const CallDemand_InputSchema: z.ZodObject<{
543
543
  }>>;
544
544
  description: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
545
545
  location: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
546
- rewards: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
546
+ rewards: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodObject<{
547
547
  op: z.ZodUnion<[z.ZodLiteral<"add">, z.ZodLiteral<"set">]>;
548
548
  objects: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
549
549
  }, "strict", z.ZodTypeAny, {
@@ -567,7 +567,15 @@ export declare const CallDemand_InputSchema: z.ZodObject<{
567
567
  op: "clear";
568
568
  }, {
569
569
  op: "clear";
570
- }>]>>;
570
+ }>]>, {
571
+ op: "set" | "add";
572
+ objects: string[];
573
+ } | {
574
+ op: "remove";
575
+ objects: string[];
576
+ } | {
577
+ op: "clear";
578
+ }, unknown>>;
571
579
  feedback: z.ZodOptional<z.ZodArray<z.ZodObject<{
572
580
  who: z.ZodObject<{
573
581
  name_or_address: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
@@ -799,15 +807,7 @@ export declare const CallDemand_InputSchema: z.ZodObject<{
799
807
  feedback?: string | undefined;
800
808
  acceptance_score?: number | undefined;
801
809
  }[] | undefined;
802
- rewards?: {
803
- op: "set" | "add";
804
- objects: string[];
805
- } | {
806
- op: "remove";
807
- objects: string[];
808
- } | {
809
- op: "clear";
810
- } | undefined;
810
+ rewards?: unknown;
811
811
  guards?: {
812
812
  guard: {
813
813
  guard: string;
@@ -1200,15 +1200,7 @@ export declare const CallDemand_InputSchema: z.ZodObject<{
1200
1200
  feedback?: string | undefined;
1201
1201
  acceptance_score?: number | undefined;
1202
1202
  }[] | undefined;
1203
- rewards?: {
1204
- op: "set" | "add";
1205
- objects: string[];
1206
- } | {
1207
- op: "remove";
1208
- objects: string[];
1209
- } | {
1210
- op: "clear";
1211
- } | undefined;
1203
+ rewards?: unknown;
1212
1204
  guards?: {
1213
1205
  guard: {
1214
1206
  guard: string;
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { WithPermissionObjectSchema, ObjectsSchema, CallEnvSchema, SubmissionCallSchema, } from './base.js';
3
3
  import { ServiceGuardSchema } from '../query/index.js';
4
- import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, NameOrAddressSchema, ReceivedObjectsOrRecentlySchema } from '../common/index.js';
4
+ import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, NameOrAddressSchema, ReceivedObjectsOrRecentlySchema, RECEIVE_FORMAT_BLOCK_OBJECTS } from '../common/index.js';
5
5
  export const GuardsSchema = z.discriminatedUnion('op', [
6
6
  z.object({
7
7
  op: z.literal('add'),
@@ -37,7 +37,7 @@ export const CallDemand_DataSchema = z.object({
37
37
  rewards: ObjectsSchema.optional().describe('Reward information of the Demand object'),
38
38
  feedback: z.array(FeedbackInfoSchema).optional().describe('User feedback information for the Demand object'),
39
39
  guards: GuardsSchema.optional().describe('Validation Guard list for the Demand object. Used to verify whether the service recommended by the user meets the requirements'),
40
- owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe('Unwrap CoinWrapper objects and other objects received by this object and send them to the owner of its Permission object.'),
40
+ owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe('Unwrap CoinWrapper objects and other objects received by this Demand object and send them to the owner of its Permission object.' + RECEIVE_FORMAT_BLOCK_OBJECTS),
41
41
  um: z.union([NameOrAddressSchema, z.null()]).optional().describe('Contact object ID or name.'),
42
42
  }).strict().describe("On-chain Demand operations. USAGE: (1) CREATE NEW: Set 'object' field with OBJECT format {name, permission, ...} to create a Demand. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with STRING format (object ID or name). The 'object' field is CRITICAL and REQUIRED in both cases. STRING for existing, OBJECT for new creation.");
43
43
  export const CallDemand_InputSchema = z.object({
@@ -96,7 +96,7 @@ export const GuardBindingHintSchema = z.object({
96
96
  .describe("Whether the Guard references the Host Object itself (circular reference pattern). true=Guard queries the Host Object it binds to."),
97
97
  }).strict().describe("Optional semantic hint for Guard capability system. Provides intent + binding context so the MCP server can derive GuardPuzzle, run risk assessment, and generate confirmation text. Strongly recommended: fill this field to enable puzzle_status, matched_scene, suggested_patterns, confirmation_text, and pending_questions in the response guard_advice.");
98
98
  export const CallGuard_DataSchema = z.object({
99
- namedNew: NamedObjectSchema.optional().describe("Name and optional tags for the new Guard object. Set 'onChain: true' to create a public on-chain identity. When using root.type='file', this field OVERRIDES namedNew in the file."),
99
+ namedNew: NamedObjectSchema.optional().describe("Name and optional tags for the new Guard object. Set 'onChain: true' to create a public on-chain identity. When using root.type='file', this field OVERRIDES namedNew in the file. CIRCULAR DEPENDENCY (DOC-01): When a Guard queries a Service that hasn't been created yet, use a LocalMark NAME (not address) in the query table — the name is resolved to an address at transaction build time. Workflow: (1) Create Service (Phase 1, no publish) → (2) Create Guard referencing Service by name → (3) Update Service.buy_guard = Guard address → (4) Publish Service."),
100
100
  description: DescriptionSchema.optional().describe("Guard description. When using root.type='file', this field OVERRIDES description in the file."),
101
101
  table: z.array(GuardTableItemBaseSchema).optional().describe("Data table of the Guard object. When using root.type='file', this field OVERRIDES table in the file."),
102
102
  root: CallGuard_RootSchema.describe("Root definition: either a direct GuardNode (must be a logical operation returning Bool) or a file reference (type='file'). When type='file', the file can define all Guard fields (namedNew, description, table, root, rely), and schema fields override file content."),
@@ -126,7 +126,7 @@ export const CallGuard_DataSchema = z.object({
126
126
  return true;
127
127
  }, {
128
128
  message: "Invalid Guard root: When using 'identifier' as root, the referenced table item must exist and have value_type='Bool' (or 0)."
129
- }).describe("On-chain Guard creation. IMPORTANT: All defined data (include all submitted data) must be defined in the 'table' field. USAGE: Set 'namedNew' field with {name, tags?, onChain?} to name the new Guard. The Guard is immutable once created. Define the validation logic in 'root' field. When root.type='file', the file can contain all Guard fields, and any fields defined in the schema will OVERRIDE the file content.");
129
+ }).describe("On-chain Guard creation. IMPORTANT: All defined data (include all submitted data) must be defined in the 'table' field. USAGE: Set 'namedNew' field with {name, tags?, onChain?} to name the new Guard (you may also use 'object' as an alias for 'namedNew' — the MCP preprocess will convert it automatically). The Guard is immutable once created. Define the validation logic in 'root' field. When root.type='file', the file can contain all Guard fields, and any fields defined in the schema will OVERRIDE the file content.");
130
130
  export const CallGuard_InputSchema = z.object({
131
131
  data: CallGuard_DataSchema.describe("Guard data definition."),
132
132
  env: CallEnvSchema.optional(),