@wowok/agent-mcp 2.3.14 → 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.
Files changed (156) hide show
  1. package/dist/config/index.d.ts +1 -0
  2. package/dist/config/index.js +1 -0
  3. package/dist/config/runtime.d.ts +26 -0
  4. package/dist/config/runtime.js +217 -0
  5. package/dist/customer/industry-risks.d.ts +36 -0
  6. package/dist/customer/industry-risks.js +424 -0
  7. package/dist/customer/info-puzzle.d.ts +102 -0
  8. package/dist/customer/info-puzzle.js +312 -0
  9. package/dist/customer/order-monitor.d.ts +75 -0
  10. package/dist/customer/order-monitor.js +327 -0
  11. package/dist/customer/order-strategy.d.ts +36 -0
  12. package/dist/customer/order-strategy.js +373 -0
  13. package/dist/customer/post-purchase.d.ts +42 -0
  14. package/dist/customer/post-purchase.js +350 -0
  15. package/dist/customer/reminder-system.d.ts +42 -0
  16. package/dist/customer/reminder-system.js +295 -0
  17. package/dist/customer/risk-assessment.d.ts +8 -0
  18. package/dist/customer/risk-assessment.js +337 -0
  19. package/dist/customer/types.d.ts +193 -0
  20. package/dist/customer/types.js +13 -0
  21. package/dist/customer/user-preferences.d.ts +67 -0
  22. package/dist/customer/user-preferences.js +451 -0
  23. package/dist/experience/experience-reuse.d.ts +10 -0
  24. package/dist/experience/experience-reuse.js +103 -0
  25. package/dist/experience/index.d.ts +6 -0
  26. package/dist/experience/index.js +5 -0
  27. package/dist/experience/intent-distill.d.ts +3 -0
  28. package/dist/experience/intent-distill.js +83 -0
  29. package/dist/experience/realtime-feedback.d.ts +5 -0
  30. package/dist/experience/realtime-feedback.js +77 -0
  31. package/dist/experience/types.d.ts +50 -0
  32. package/dist/experience/types.js +1 -0
  33. package/dist/experience/user-profile.d.ts +25 -0
  34. package/dist/experience/user-profile.js +171 -0
  35. package/dist/index.js +570 -186
  36. package/dist/knowledge/acquisition-flywheel.d.ts +50 -0
  37. package/dist/knowledge/acquisition-flywheel.js +183 -0
  38. package/dist/knowledge/arbitration-trust.d.ts +24 -0
  39. package/dist/knowledge/arbitration-trust.js +117 -0
  40. package/dist/knowledge/audit-rules.d.ts +28 -0
  41. package/dist/knowledge/audit-rules.js +141 -0
  42. package/dist/knowledge/demand-matching.d.ts +29 -0
  43. package/dist/knowledge/demand-matching.js +132 -0
  44. package/dist/knowledge/dynamic-pricing.d.ts +31 -0
  45. package/dist/knowledge/dynamic-pricing.js +87 -0
  46. package/dist/knowledge/flywheel-loop.d.ts +87 -0
  47. package/dist/knowledge/flywheel-loop.js +378 -0
  48. package/dist/knowledge/glossary.d.ts +18 -0
  49. package/dist/knowledge/glossary.js +209 -0
  50. package/dist/knowledge/index.d.ts +64 -0
  51. package/dist/knowledge/index.js +66 -0
  52. package/dist/knowledge/industry-evolution.d.ts +82 -0
  53. package/dist/knowledge/industry-evolution.js +323 -0
  54. package/dist/knowledge/industry-generalizer.d.ts +17 -0
  55. package/dist/knowledge/industry-generalizer.js +381 -0
  56. package/dist/knowledge/industry-registry.d.ts +49 -0
  57. package/dist/knowledge/industry-registry.js +167 -0
  58. package/dist/knowledge/intent-metrics.d.ts +42 -0
  59. package/dist/knowledge/intent-metrics.js +566 -0
  60. package/dist/knowledge/process-model.d.ts +24 -0
  61. package/dist/knowledge/process-model.js +160 -0
  62. package/dist/knowledge/reputation-rules.d.ts +42 -0
  63. package/dist/knowledge/reputation-rules.js +99 -0
  64. package/dist/knowledge/reward-templates.d.ts +25 -0
  65. package/dist/knowledge/reward-templates.js +125 -0
  66. package/dist/knowledge/safety-rules.d.ts +36 -0
  67. package/dist/knowledge/safety-rules.js +171 -0
  68. package/dist/knowledge/tool-constraints.d.ts +30 -0
  69. package/dist/knowledge/tool-constraints.js +185 -0
  70. package/dist/knowledge/trust-metrics.d.ts +37 -0
  71. package/dist/knowledge/trust-metrics.js +138 -0
  72. package/dist/loop-engineering/diagnose.d.ts +3 -2
  73. package/dist/loop-engineering/diagnose.js +94 -0
  74. package/dist/loop-engineering/improve.d.ts +1 -1
  75. package/dist/loop-engineering/improve.js +52 -1
  76. package/dist/project/graph.d.ts +71 -0
  77. package/dist/project/graph.js +314 -0
  78. package/dist/project/index.d.ts +62 -0
  79. package/dist/project/index.js +167 -0
  80. package/dist/project/namespace.d.ts +62 -0
  81. package/dist/project/namespace.js +181 -0
  82. package/dist/project/query.d.ts +40 -0
  83. package/dist/project/query.js +110 -0
  84. package/dist/safety/confirm-gate.d.ts +15 -0
  85. package/dist/safety/confirm-gate.js +44 -0
  86. package/dist/safety/index.d.ts +3 -0
  87. package/dist/safety/index.js +3 -0
  88. package/dist/safety/preview.d.ts +2 -0
  89. package/dist/safety/preview.js +36 -0
  90. package/dist/schema/call/allocation.d.ts +15 -0
  91. package/dist/schema/call/arbitration.d.ts +111 -96
  92. package/dist/schema/call/base.d.ts +1070 -44
  93. package/dist/schema/call/base.js +69 -1
  94. package/dist/schema/call/bridge.d.ts +709 -52
  95. package/dist/schema/call/bridge.js +13 -2
  96. package/dist/schema/call/contact.d.ts +15 -0
  97. package/dist/schema/call/demand.d.ts +69 -54
  98. package/dist/schema/call/guard.d.ts +125 -80
  99. package/dist/schema/call/handler.d.ts +3 -0
  100. package/dist/schema/call/handler.js +14 -0
  101. package/dist/schema/call/machine.d.ts +830 -800
  102. package/dist/schema/call/order.d.ts +15 -0
  103. package/dist/schema/call/payment.d.ts +15 -0
  104. package/dist/schema/call/permission.d.ts +15 -0
  105. package/dist/schema/call/personal.d.ts +15 -0
  106. package/dist/schema/call/progress.d.ts +15 -0
  107. package/dist/schema/call/proof.d.ts +42 -12
  108. package/dist/schema/call/proof.js +3 -3
  109. package/dist/schema/call/repository.d.ts +91 -76
  110. package/dist/schema/call/reward.d.ts +45 -30
  111. package/dist/schema/call/semantic.d.ts +1 -0
  112. package/dist/schema/call/semantic.js +217 -0
  113. package/dist/schema/call/service.d.ts +407 -392
  114. package/dist/schema/call/treasury.d.ts +15 -0
  115. package/dist/schema/common/index.js +3 -3
  116. package/dist/schema/local/index.d.ts +228 -72
  117. package/dist/schema/local/index.js +33 -6
  118. package/dist/schema/messenger/index.d.ts +668 -50
  119. package/dist/schema/messenger/index.js +9 -0
  120. package/dist/schema/operations.d.ts +1693 -1369
  121. package/dist/schema/operations.js +2 -2
  122. package/dist/schema/query/index.d.ts +1614 -1614
  123. package/dist/schema/query/index.js +30 -27
  124. package/dist/schemas/account_operation.output.json +25 -16
  125. package/dist/schemas/account_operation.schema.json +1 -1
  126. package/dist/schemas/bridge_operation.output.json +520 -0
  127. package/dist/schemas/bridge_operation.schema.json +15 -0
  128. package/dist/schemas/guard2file.schema.json +15 -0
  129. package/dist/schemas/index.json +1 -1
  130. package/dist/schemas/local_info_operation.output.json +23 -0
  131. package/dist/schemas/local_info_operation.schema.json +1 -1
  132. package/dist/schemas/local_mark_operation.output.json +24 -1
  133. package/dist/schemas/local_mark_operation.schema.json +4 -4
  134. package/dist/schemas/machineNode2file.schema.json +15 -0
  135. package/dist/schemas/messenger_operation.output.json +528 -0
  136. package/dist/schemas/onchain_operations.output.json +350 -16
  137. package/dist/schemas/onchain_operations.schema.json +96 -23
  138. package/dist/schemas/onchain_operations_allocation.schema.json +15 -0
  139. package/dist/schemas/onchain_operations_arbitration.schema.json +15 -0
  140. package/dist/schemas/onchain_operations_contact.schema.json +15 -0
  141. package/dist/schemas/onchain_operations_demand.schema.json +15 -0
  142. package/dist/schemas/onchain_operations_gen_passport.schema.json +30 -0
  143. package/dist/schemas/onchain_operations_guard.schema.json +15 -0
  144. package/dist/schemas/onchain_operations_machine.schema.json +81 -23
  145. package/dist/schemas/onchain_operations_order.schema.json +15 -0
  146. package/dist/schemas/onchain_operations_payment.schema.json +15 -0
  147. package/dist/schemas/onchain_operations_permission.schema.json +15 -0
  148. package/dist/schemas/onchain_operations_personal.schema.json +15 -0
  149. package/dist/schemas/onchain_operations_progress.schema.json +15 -0
  150. package/dist/schemas/onchain_operations_repository.schema.json +15 -0
  151. package/dist/schemas/onchain_operations_reward.schema.json +15 -0
  152. package/dist/schemas/onchain_operations_service.schema.json +15 -0
  153. package/dist/schemas/onchain_operations_treasury.schema.json +15 -0
  154. package/dist/schemas/onchain_table_data.output.json +221 -69
  155. package/dist/schemas/onchain_table_data.schema.json +2 -2
  156. package/package.json +2 -2
@@ -64,6 +64,9 @@ export const CallEnvSchema = z.object({
64
64
  no_cache: z.boolean().optional().describe("Whether to disable caching."),
65
65
  network: EntrypointSchema.optional(),
66
66
  referrer: NameOrAddressSchema.optional().describe("Referrer ID. If the user is using the network for the first time, the referrer ID will be recorded."),
67
+ confirmed: z.boolean().optional().describe("Phase 2 ConfirmGate: set to true to proceed after a 'pending_confirmation' result. The operation is NOT executed until you re-call with confirmed=true after user consent."),
68
+ user_intent_phrases: z.array(z.string()).optional().describe("Phase 2 ConfirmGate: explicit user intent phrases collected from conversation context (e.g. 'use default account', 'force publish'). Used to bypass confirmation rules whose bypass_on_explicit_intent matches."),
69
+ project: z.string().optional().describe("Phase 2 ProjectService: explicit project prefix to assign this object to (e.g. 'myshop'). When set, the object is tagged with 'project:<prefix>' automatically. Overrides the prefix parsed from the object name."),
67
70
  }).strict().describe(`IMPORTANT: Execution environment includes: account for signing operations, network selection (${ENTRYPOINT}), additional Guard permissions, and more. Used to specify context information during the call. If account is not specified, the default account ("") will be used.`);
68
71
  export const ObjectsOpSchema = z.union([
69
72
  z.object({
@@ -112,6 +115,45 @@ export const EventSemanticSchema = z.object({
112
115
  related_object: z.string().optional().describe("Object ID the event relates to, if extractable. Example: '0x123...'"),
113
116
  side_effect: z.string().optional().describe("Side effect description for AI. Example: 'Customers can now place orders against this Service'"),
114
117
  }).strict().describe("An on-chain event annotated with business semantics");
118
+ export const ExperienceSchema = z.object({
119
+ advice: z.string().optional().describe("Advice from past experience. Example: 'Last time you forgot to set buy_guard; add it before publishing'"),
120
+ avoid: z.array(z.string()).optional().describe("Pitfalls to avoid based on history. Example: ['Guard rejection on delivery_proof']"),
121
+ relevance: z.number().min(0).max(1).optional().describe("Relevance score 0-1 of the matched experience. Example: 0.85"),
122
+ matched_scenario: z.string().optional().describe("Matched historical scenario. Example: 'publish_service_freelance'"),
123
+ }).strict().describe("Experience layer feedback from past operations (Phase 2 议题 2). Provides advice and pitfalls based on historical patterns.");
124
+ export const ServiceStatusSchema = z.object({
125
+ active: z.array(z.string()).describe("Phase 2 services currently active (enabled). Example: ['confirm_gate','project_service','experience_layer']"),
126
+ inactive: z.array(z.string()).optional().describe("Phase 2 services currently inactive (can be toggled via config_operation). Example: ['harness','graph_persist']"),
127
+ }).strict().describe("Phase 2 runtime service status (populated when semantic_rich is enabled). Lets AI see which services are active in each response.");
128
+ export const CustomerReminderSchema = z.object({
129
+ id: z.string().describe("Reminder rule id. Example: 'high_risk_score'"),
130
+ stage: z.enum(["browse", "evaluate", "preorder", "in_progress", "complete", "after_sale"]).describe("Order lifecycle stage when this reminder fires. Example: 'evaluate'"),
131
+ priority: z.enum(["required", "recommended", "info", "reminder"]).describe("Priority. 'required' = blocks purchase; 'recommended' = strong caution. Example: 'required'"),
132
+ message: z.string().describe("Human-readable reminder message. Example: '🔴 综合风险分 25/100,强烈建议不购买'"),
133
+ action: z.string().optional().describe("Suggested next action. Example: 'require merchant to bind Arbitration before ordering'"),
134
+ }).strict().describe("A buyer-side reminder triggered at a specific order lifecycle stage (Phase 3 C-3).");
135
+ export const PreferenceMatchSchema = z.object({
136
+ score: z.number().min(0).max(100).describe("Match score 0-100 (higher = better fit). Example: 75"),
137
+ matches: z.array(z.string()).describe("Aspects that match user preferences. Example: ['价格低于均价 10%','有仲裁']"),
138
+ mismatches: z.array(z.string()).describe("Aspects that mismatch user preferences. Example: ['交付周期超出期望']"),
139
+ }).strict().describe("Service-to-preference match result (Phase 3 C-2). 7-dimension scoring: price/time/region/brand/bargain/emotion/risk.");
140
+ export const CustomerAdviceSchema = z.object({
141
+ risk_score: z.number().min(0).max(100).optional().describe("Composite risk score 0-100 (higher = safer). Relation: from risk-assessment.ts 4-dimension scoring. Example: 75"),
142
+ risk_level: z.enum(["low", "medium_low", "medium_high", "high"]).optional().describe("Risk level bucket. 'high' = strongly discourage purchase. Example: 'medium_high'"),
143
+ recommendations: z.array(z.string()).describe("Actionable recommendations for the buyer. Example: ['要求商家配置仲裁','通过 Messenger 协商退款条款']"),
144
+ reminders: z.array(CustomerReminderSchema).describe("Stage-specific reminders (deduped, sorted by priority, capped to 3 high-risk). Example: [{priority:'required', message:'🔴 模糊 Guard 必须人工审查'}]"),
145
+ preference_match: PreferenceMatchSchema.optional().describe("Service-to-preference match (populated when user preferences exist). Example: {score:75, matches:[...], mismatches:[...]}"),
146
+ }).strict().describe("Buyer-side advice (Phase 3 C-3.3). Populated in semantic.customer_advice for order/query operations when customer_intelligence service is enabled.");
147
+ export const EvolutionContextSchema = z.object({
148
+ industry_signal: z.string().optional().describe("Industry evolution signal summary. Example: '行业健康度 82/100(healthy);累积 25 个行业信号'"),
149
+ evolution_advice: z.string().optional().describe("Evolution advice for the current operation. Example: '建议强制配置仲裁 + 赔偿金 + 交付 Guard'"),
150
+ confidence: z.number().min(0).max(1).describe("Confidence of the evolution context 0-1. <0.5 means no data yet. Example: 0.75"),
151
+ health_score: z.number().min(0).max(100).optional().describe("Industry health score 0-100 if available. Example: 82"),
152
+ pending_suggestions: z.number().int().min(0).optional().describe("Count of pending industry update suggestions (filtered by role if role is set). Example: 3"),
153
+ intent: z.enum(["default", "growth", "retention", "compliance", "efficiency", "trust_building", "custom"]).optional().describe("Phase 4 P4-6.C: Current business intent driving the scoring model. Absent = 'default'. Example: 'growth'"),
154
+ role_advice: z.array(z.string()).optional().describe("Phase 4 P4-6.C: Role-targeted advice strings (user/merchant/arbitrator). Example: ['强化忠诚度飞轮','优化首单转化']"),
155
+ role: z.enum(["user", "merchant", "arbitrator"]).optional().describe("Phase 4 P4-6.C: Role used for advice routing. Example: 'merchant'"),
156
+ }).strict().describe("Phase 4 industry evolution context (populated when industry_evolution service is enabled). Provides AI with industry-level health signals, evolution advice, and role-targeted recommendations.");
115
157
  export const SemanticSummarySchema = z.object({
116
158
  intent: z.string().describe("Inferred user intent / operation goal. Constraint: snake_case string. Relation: derived from operation_type + data signals. Example: 'publish_service'"),
117
159
  status: z.enum(["success", "partial", "failed", "pending_input"]).describe("Business-level status (not raw tx status). 'pending_input' = needs Guard submission. Example: 'success'"),
@@ -122,6 +164,10 @@ export const SemanticSummarySchema = z.object({
122
164
  events: z.array(EventSemanticSchema).optional().describe("On-chain events annotated with business semantics (S-8)"),
123
165
  next_actions: z.array(NextActionSchema).optional().describe("Recommended next actions to drive the workflow forward"),
124
166
  warnings: z.array(z.string()).optional().describe("Business-level warnings. Example: 'order_allocators not configured; order funds cannot be distributed'"),
167
+ experience: ExperienceSchema.optional().describe("Experience layer feedback from past operations (Phase 2 议题 2)"),
168
+ service_status: ServiceStatusSchema.optional().describe("Phase 2 runtime service status (populated when semantic_rich is enabled). Lets AI see active services in each response."),
169
+ customer_advice: CustomerAdviceSchema.optional().describe("Buyer-side advice (Phase 3 C-3.3). Populated when customer_intelligence service is enabled AND operation is order/query on a Service. Contains risk_score, recommendations, reminders, and preference_match."),
170
+ evolution_context: EvolutionContextSchema.optional().describe("Phase 4 industry evolution context (populated when industry_evolution service is enabled). Provides AI with industry health signals and evolution advice."),
125
171
  }).strict().describe("Business semantic summary: translates the raw transaction response into AI-directly-understandable business meaning");
126
172
  export const CallResponseErrorSchema = z.object({
127
173
  type: z.literal("error").describe("Discriminator for this result variant. Constraint: always 'error'. Example: 'error'"),
@@ -131,6 +177,27 @@ export const CallResponseErrorSchema = z.object({
131
177
  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'"),
132
178
  related_object: z.string().optional().describe("Object ID related to the error, if any. Example: '0x123...'"),
133
179
  }).describe("Error result. Contains the raw error message plus structured classification (error_code/retryable/recovery_hint) so AI can choose a recovery strategy without parsing the error string.");
180
+ export const OperationPreviewSchema = z.object({
181
+ level: z.enum(["none", "standard", "amount", "publish", "irreversible"]).describe("Confirmation level. 'irreversible' = cannot be undone (arb verdict, payment). 'publish' = locks immutable fields. 'amount' = amount-sensitive. 'standard' = default-value warnings."),
182
+ operation: z.string().describe("operation_type that triggered the gate. Example: 'payment'"),
183
+ object: z.union([z.string(), z.record(z.any()), z.null()]).optional().describe("Object name/id involved (string for existing, object for new creation). Example: 'myshop_service' or {name: 'myshop_service'}"),
184
+ network: z.string().optional().describe("Network in use. Example: 'mainnet'"),
185
+ account: z.string().optional().describe("Signing account ('' = default). Example: '' or '0xabc...'"),
186
+ amount: z.object({
187
+ value: z.string().describe("Smallest-unit value as string. Example: '2500000000'"),
188
+ token: z.string().describe("Coin type tag. Example: '0x2::wow::WOW'"),
189
+ human_readable: z.string().describe("Human-readable amount. Example: '2.5 WOW'"),
190
+ recipient: z.string().optional().describe("Recipient address if known. Example: '0xdef...'"),
191
+ }).optional().describe("Amount info for amount-level confirmations."),
192
+ immutable_after: z.array(z.string()).optional().describe("Fields that become immutable after this op (for publish). Example: ['machine','order_allocators']"),
193
+ warnings: z.array(z.string()).optional().describe("Default-value warnings. Example: ['Using default account (env.account=\"\")']"),
194
+ irreversible: z.boolean().optional().describe("True when the operation cannot be reverted. Example: true"),
195
+ }).strict().describe("Preview of an operation awaiting user confirmation (Phase 2 议题 4 ConfirmGate).");
196
+ export const CallPendingConfirmationSchema = z.object({
197
+ type: z.literal("pending_confirmation").describe("Discriminator. The operation was NOT executed; it is blocked pending user confirmation. Re-call with env.confirmed=true to proceed, or modify/cancel."),
198
+ preview: OperationPreviewSchema.describe("Preview of the operation awaiting confirmation."),
199
+ rule_id: z.string().optional().describe("Id of the confirmation rule that matched. Example: 'publish_immutable'"),
200
+ }).describe("Pending confirmation. The ConfirmGate blocked the operation. Read preview first; if user consents, re-invoke the SAME call with env.confirmed=true.");
134
201
  export const GuardSubmissionToFillSchema = z.object({
135
202
  guard: NameOrAddressSchema.describe("Guard object name or ID that requires submission data. Example: 'my-delivery-guard'"),
136
203
  submission: z.array(GuardTableItemSchema).describe("User-submitted data matching the Guard's required fields. Relation: structure must match the Guard table's column definitions. Example: [{field:'delivery_proof', value:'Qm...'}]"),
@@ -168,7 +235,8 @@ export const CallResultSchema = z.discriminatedUnion("type", [
168
235
  z.object({
169
236
  type: z.literal("null").describe("Discriminator for this result variant. Constraint: always 'null'. Example: 'null'"),
170
237
  }),
171
- ]).describe("Discriminated union of 5 result types: 'transaction' (raw Sui response with digest/effects/objectChanges), 'submission' (Guard verification needed), 'error' (failed with error_code), 'data' (query result array), 'null' (no-op completed). AI should check result.type first to determine how to process the response.");
238
+ CallPendingConfirmationSchema,
239
+ ]).describe("Discriminated union of 6 result types: 'transaction' (raw Sui 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.");
172
240
  export const ObjectsSchema = z.union([
173
241
  z.object({
174
242
  op: z.union([z.literal('add'), z.literal('set')]),