@wowok/agent-mcp 3.1.5 → 3.1.6

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 (145) hide show
  1. package/dist/evaluation/arbitration-game.js +1 -1
  2. package/dist/evaluation/builtins/graph-service.js +1 -1
  3. package/dist/graph/onchain/analyze.js +1 -1
  4. package/dist/graph/onchain/analyze.spec.js +1 -1
  5. package/dist/graph/onchain/extract.js +1 -1
  6. package/dist/graph/onchain/facts.d.ts +1 -0
  7. package/dist/graph/onchain/facts.js +1 -1
  8. package/dist/graph/onchain/fixtures.js +1 -1
  9. package/dist/graph/onchain/onchain.spec.js +1 -1
  10. package/dist/graph/onchain/strategy.js +1 -1
  11. package/dist/graph/onchain/strategy.spec.js +1 -1
  12. package/dist/harness/recover.js +1 -1
  13. package/dist/knowledge/alloc-audit-policy.spec.js +1 -1
  14. package/dist/knowledge/allocation-risk.js +1 -1
  15. package/dist/knowledge/arbitration-ledger.js +1 -1
  16. package/dist/knowledge/audit-rules.d.ts +1 -0
  17. package/dist/knowledge/audit-rules.js +1 -1
  18. package/dist/knowledge/baselines/rules/alloc_audit.json +20 -0
  19. package/dist/knowledge/baselines/rules/allocation.json +1 -19
  20. package/dist/knowledge/baselines/rules/arb.json +1 -1
  21. package/dist/knowledge/baselines/rules/guard.json +8 -8
  22. package/dist/knowledge/fund-layer.js +1 -1
  23. package/dist/knowledge/guard-design-patterns.d.ts +2 -1
  24. package/dist/knowledge/guard-design-patterns.js +1 -1
  25. package/dist/knowledge/guard-design-patterns.spec.d.ts +1 -0
  26. package/dist/knowledge/guard-design-patterns.spec.js +1 -0
  27. package/dist/knowledge/guard-lint.d.ts +1 -1
  28. package/dist/knowledge/guard-lint.js +1 -1
  29. package/dist/knowledge/guard-puzzle.js +1 -1
  30. package/dist/knowledge/guard-render.js +1 -1
  31. package/dist/knowledge/guard-risk.js +1 -1
  32. package/dist/knowledge/guard-translation.js +1 -1
  33. package/dist/knowledge/index.js +1 -1
  34. package/dist/knowledge/industry-registry.js +1 -1
  35. package/dist/knowledge/jsonrpc-enum.js +1 -1
  36. package/dist/knowledge/permission-ledger.js +1 -1
  37. package/dist/knowledge/recipient-constraint.js +1 -1
  38. package/dist/knowledge/safety-rules.extract-amount.spec.d.ts +1 -0
  39. package/dist/knowledge/safety-rules.extract-amount.spec.js +1 -0
  40. package/dist/knowledge/safety-rules.js +1 -1
  41. package/dist/knowledge/service-ledger.js +1 -1
  42. package/dist/knowledge/template-registry.js +1 -1
  43. package/dist/knowledge/template-scanner.js +1 -1
  44. package/dist/knowledge/tool-constraints.js +1 -1
  45. package/dist/knowledge/workflow-guidance.js +1 -1
  46. package/dist/monitor/MonitorLoop.js +1 -1
  47. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  48. package/dist/playbooks/service-build/pipeline-actions.d.ts +1 -1
  49. package/dist/playbooks/service-build/pipeline-actions.js +1 -1
  50. package/dist/playbooks/service-build/risk-aggregator.js +1 -1
  51. package/dist/role/derivation.d.ts +1 -1
  52. package/dist/role/derivation.js +1 -1
  53. package/dist/safety/confirm-gate.js +1 -1
  54. package/dist/schema/call/allocation.d.ts +7 -0
  55. package/dist/schema/call/allocation.js +1 -1
  56. package/dist/schema/call/arbitration.d.ts +4 -0
  57. package/dist/schema/call/arbitration.js +1 -1
  58. package/dist/schema/call/base.d.ts +48 -0
  59. package/dist/schema/call/base.js +1 -1
  60. package/dist/schema/call/bridge.d.ts +26 -0
  61. package/dist/schema/call/contact.d.ts +4 -0
  62. package/dist/schema/call/demand.d.ts +4 -0
  63. package/dist/schema/call/error-codes.d.ts +1 -1
  64. package/dist/schema/call/error-codes.js +1 -1
  65. package/dist/schema/call/guard.d.ts +12 -0
  66. package/dist/schema/call/handler.js +1 -1
  67. package/dist/schema/call/machine.d.ts +8 -0
  68. package/dist/schema/call/order.d.ts +4 -0
  69. package/dist/schema/call/order.js +1 -1
  70. package/dist/schema/call/payment.d.ts +4 -0
  71. package/dist/schema/call/permission.d.ts +4 -0
  72. package/dist/schema/call/personal.d.ts +4 -0
  73. package/dist/schema/call/progress.d.ts +4 -0
  74. package/dist/schema/call/proof.d.ts +8 -0
  75. package/dist/schema/call/repository.d.ts +4 -0
  76. package/dist/schema/call/repository.js +1 -1
  77. package/dist/schema/call/reward.d.ts +4 -0
  78. package/dist/schema/call/semantic-customer-advice.spec.js +1 -1
  79. package/dist/schema/call/semantic.d.ts +11 -0
  80. package/dist/schema/call/semantic.js +1 -1
  81. package/dist/schema/call/service.d.ts +14 -0
  82. package/dist/schema/call/service.js +1 -1
  83. package/dist/schema/call/treasury.d.ts +4 -0
  84. package/dist/schema/common/index.js +1 -1
  85. package/dist/schema/keeper/index.d.ts +5 -0
  86. package/dist/schema/local/index.d.ts +28 -0
  87. package/dist/schema/local/index.js +1 -1
  88. package/dist/schema/messenger/index.d.ts +5 -0
  89. package/dist/schema/messenger/index.js +1 -1
  90. package/dist/schema/operations.d.ts +83 -0
  91. package/dist/schema/query/bi.js +1 -1
  92. package/dist/schema/query/index.d.ts +16 -0
  93. package/dist/schema/query/index.js +1 -1
  94. package/dist/schema/schema-version.js +1 -1
  95. package/dist/schema/workflow/index.d.ts +2 -0
  96. package/dist/schema/workflow/index.js +1 -1
  97. package/dist/schema-query-impl/index.js +1 -1
  98. package/dist/schemas/account_operation.output.json +25 -1
  99. package/dist/schemas/bridge_operation.output.json +25 -1
  100. package/dist/schemas/bridge_operation.schema.json +40 -0
  101. package/dist/schemas/guard2file.schema.json +8 -0
  102. package/dist/schemas/index.json +1 -1
  103. package/dist/schemas/keeper_operation.output.json +24 -1
  104. package/dist/schemas/local_history_operation.output.json +25 -1
  105. package/dist/schemas/local_info_operation.output.json +25 -1
  106. package/dist/schemas/local_mark_operation.output.json +25 -1
  107. package/dist/schemas/machineNode2file.schema.json +8 -0
  108. package/dist/schemas/messenger_operation.output.json +24 -1
  109. package/dist/schemas/messenger_operation.schema.json +2 -2
  110. package/dist/schemas/monitor_events.output.json +24 -1
  111. package/dist/schemas/monitor_subscription.output.json +24 -1
  112. package/dist/schemas/onchain_events.output.json +24 -1
  113. package/dist/schemas/onchain_operations.output.json +73 -3
  114. package/dist/schemas/onchain_operations.schema.json +3286 -821
  115. package/dist/schemas/onchain_operations_allocation.schema.json +12 -0
  116. package/dist/schemas/onchain_operations_arbitration.schema.json +18 -10
  117. package/dist/schemas/onchain_operations_contact.schema.json +8 -0
  118. package/dist/schemas/onchain_operations_demand.schema.json +8 -0
  119. package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -0
  120. package/dist/schemas/onchain_operations_gen_proof.schema.json +8 -0
  121. package/dist/schemas/onchain_operations_guard.schema.json +2896 -596
  122. package/dist/schemas/onchain_operations_machine.schema.json +8 -0
  123. package/dist/schemas/onchain_operations_order.schema.json +10 -2
  124. package/dist/schemas/onchain_operations_payment.schema.json +8 -0
  125. package/dist/schemas/onchain_operations_permission.schema.json +8 -0
  126. package/dist/schemas/onchain_operations_personal.schema.json +8 -0
  127. package/dist/schemas/onchain_operations_progress.schema.json +8 -0
  128. package/dist/schemas/onchain_operations_proof.schema.json +8 -0
  129. package/dist/schemas/onchain_operations_repository.schema.json +14 -6
  130. package/dist/schemas/onchain_operations_reward.schema.json +8 -0
  131. package/dist/schemas/onchain_operations_service.schema.json +43 -10
  132. package/dist/schemas/onchain_operations_treasury.schema.json +8 -0
  133. package/dist/schemas/onchain_table_data.output.json +35 -12
  134. package/dist/schemas/query_toolkit.output.json +1179 -10
  135. package/dist/schemas/query_toolkit.schema.json +11 -11
  136. package/dist/schemas/workflow_operation.schema.json +8 -0
  137. package/dist/tools/handlers/config.js +1 -1
  138. package/dist/tools/handlers/dispatch-expectations.js +1 -1
  139. package/dist/tools/handlers/dispatch-expectations.spec.d.ts +1 -0
  140. package/dist/tools/handlers/dispatch-expectations.spec.js +1 -0
  141. package/dist/tools/handlers/onchain.js +1 -1
  142. package/dist/tools/handlers/workflow.js +1 -1
  143. package/dist/tools/index.js +1 -1
  144. package/dist/tools/move-fn-index.gen.js +1 -1
  145. package/package.json +2 -2
@@ -171,6 +171,10 @@ export declare const BridgeOperationsSchema: z.ZodPreprocess<z.ZodDiscriminatedU
171
171
  client_schema_version: z.ZodOptional<z.ZodString>;
172
172
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
173
173
  dry_run: z.ZodOptional<z.ZodBoolean>;
174
+ response_level: z.ZodOptional<z.ZodEnum<{
175
+ compact: "compact";
176
+ full: "full";
177
+ }>>;
174
178
  confirm_mode: z.ZodOptional<z.ZodEnum<{
175
179
  full: "full";
176
180
  streamlined: "streamlined";
@@ -209,6 +213,10 @@ export declare const BridgeOperationsSchema: z.ZodPreprocess<z.ZodDiscriminatedU
209
213
  client_schema_version: z.ZodOptional<z.ZodString>;
210
214
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
211
215
  dry_run: z.ZodOptional<z.ZodBoolean>;
216
+ response_level: z.ZodOptional<z.ZodEnum<{
217
+ compact: "compact";
218
+ full: "full";
219
+ }>>;
212
220
  confirm_mode: z.ZodOptional<z.ZodEnum<{
213
221
  full: "full";
214
222
  streamlined: "streamlined";
@@ -237,6 +245,10 @@ export declare const BridgeOperationsSchema: z.ZodPreprocess<z.ZodDiscriminatedU
237
245
  client_schema_version: z.ZodOptional<z.ZodString>;
238
246
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
239
247
  dry_run: z.ZodOptional<z.ZodBoolean>;
248
+ response_level: z.ZodOptional<z.ZodEnum<{
249
+ compact: "compact";
250
+ full: "full";
251
+ }>>;
240
252
  confirm_mode: z.ZodOptional<z.ZodEnum<{
241
253
  full: "full";
242
254
  streamlined: "streamlined";
@@ -265,6 +277,10 @@ export declare const BridgeOperationsSchema: z.ZodPreprocess<z.ZodDiscriminatedU
265
277
  client_schema_version: z.ZodOptional<z.ZodString>;
266
278
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
267
279
  dry_run: z.ZodOptional<z.ZodBoolean>;
280
+ response_level: z.ZodOptional<z.ZodEnum<{
281
+ compact: "compact";
282
+ full: "full";
283
+ }>>;
268
284
  confirm_mode: z.ZodOptional<z.ZodEnum<{
269
285
  full: "full";
270
286
  streamlined: "streamlined";
@@ -305,6 +321,10 @@ export declare const BridgeOperationsSchema: z.ZodPreprocess<z.ZodDiscriminatedU
305
321
  client_schema_version: z.ZodOptional<z.ZodString>;
306
322
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
307
323
  dry_run: z.ZodOptional<z.ZodBoolean>;
324
+ response_level: z.ZodOptional<z.ZodEnum<{
325
+ compact: "compact";
326
+ full: "full";
327
+ }>>;
308
328
  confirm_mode: z.ZodOptional<z.ZodEnum<{
309
329
  full: "full";
310
330
  streamlined: "streamlined";
@@ -1069,6 +1089,7 @@ export declare const BridgeCallOutputSchema: z.ZodObject<{
1069
1089
  guard_rejected: "guard_rejected";
1070
1090
  state_conflict: "state_conflict";
1071
1091
  insufficient_balance: "insufficient_balance";
1092
+ transaction_expired: "transaction_expired";
1072
1093
  stock_exhausted: "stock_exhausted";
1073
1094
  sale_suspended: "sale_suspended";
1074
1095
  discount_invalid: "discount_invalid";
@@ -1340,6 +1361,11 @@ export declare const BridgeCallOutputSchema: z.ZodObject<{
1340
1361
  }>;
1341
1362
  failure_node: z.ZodOptional<z.ZodString>;
1342
1363
  passport_id: z.ZodOptional<z.ZodString>;
1364
+ guard_results: z.ZodOptional<z.ZodArray<z.ZodObject<{
1365
+ guard: z.ZodString;
1366
+ result: z.ZodBoolean;
1367
+ impack: z.ZodOptional<z.ZodBoolean>;
1368
+ }, z.core.$strip>>>;
1343
1369
  }, z.core.$strip>>;
1344
1370
  risk_assessment: z.ZodOptional<z.ZodObject<{
1345
1371
  overall_risk: z.ZodEnum<{
@@ -147,6 +147,10 @@ export declare const CallContact_InputSchema: z.ZodObject<{
147
147
  client_schema_version: z.ZodOptional<z.ZodString>;
148
148
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
149
149
  dry_run: z.ZodOptional<z.ZodBoolean>;
150
+ response_level: z.ZodOptional<z.ZodEnum<{
151
+ compact: "compact";
152
+ full: "full";
153
+ }>>;
150
154
  confirm_mode: z.ZodOptional<z.ZodEnum<{
151
155
  full: "full";
152
156
  streamlined: "streamlined";
@@ -200,6 +200,10 @@ export declare const CallDemand_InputSchema: z.ZodObject<{
200
200
  client_schema_version: z.ZodOptional<z.ZodString>;
201
201
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
202
202
  dry_run: z.ZodOptional<z.ZodBoolean>;
203
+ response_level: z.ZodOptional<z.ZodEnum<{
204
+ compact: "compact";
205
+ full: "full";
206
+ }>>;
203
207
  confirm_mode: z.ZodOptional<z.ZodEnum<{
204
208
  full: "full";
205
209
  streamlined: "streamlined";
@@ -1,2 +1,2 @@
1
- export declare const ERROR_CODE_VALUES: readonly ["invalid_parameter", "guard_rejected", "state_conflict", "insufficient_balance", "stock_exhausted", "sale_suspended", "discount_invalid", "object_not_found", "permission_denied", "time_lock_not_elapsed", "immutable_violation", "network_error", "rate_limit", "gas_exceeded", "bcs_error", "signature_error", "config_error", "wip_verification_failed", "unknown"];
1
+ export declare const ERROR_CODE_VALUES: readonly ["invalid_parameter", "guard_rejected", "state_conflict", "insufficient_balance", "transaction_expired", "stock_exhausted", "sale_suspended", "discount_invalid", "object_not_found", "permission_denied", "time_lock_not_elapsed", "immutable_violation", "network_error", "rate_limit", "gas_exceeded", "bcs_error", "signature_error", "config_error", "wip_verification_failed", "unknown"];
2
2
  export type ErrorCodeValue = (typeof ERROR_CODE_VALUES)[number];
@@ -1 +1 @@
1
- export const ERROR_CODE_VALUES=['invalid_parameter','guard_rejected','state_conflict','insufficient_balance','stock_exhausted','sale_suspended','discount_invalid','object_not_found','permission_denied','time_lock_not_elapsed','immutable_violation','network_error','rate_limit','gas_exceeded','bcs_error','signature_error','config_error','wip_verification_failed','unknown'];
1
+ export const ERROR_CODE_VALUES=['invalid_parameter','guard_rejected','state_conflict','insufficient_balance','transaction_expired','stock_exhausted','sale_suspended','discount_invalid','object_not_found','permission_denied','time_lock_not_elapsed','immutable_violation','network_error','rate_limit','gas_exceeded','bcs_error','signature_error','config_error','wip_verification_failed','unknown'];
@@ -251,6 +251,10 @@ export declare const CallGuard_InputSchema: z.ZodObject<{
251
251
  client_schema_version: z.ZodOptional<z.ZodString>;
252
252
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
253
253
  dry_run: z.ZodOptional<z.ZodBoolean>;
254
+ response_level: z.ZodOptional<z.ZodEnum<{
255
+ compact: "compact";
256
+ full: "full";
257
+ }>>;
254
258
  confirm_mode: z.ZodOptional<z.ZodEnum<{
255
259
  full: "full";
256
260
  streamlined: "streamlined";
@@ -337,6 +341,10 @@ export declare const CallGenPassport_InputSchema: z.ZodObject<{
337
341
  client_schema_version: z.ZodOptional<z.ZodString>;
338
342
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
339
343
  dry_run: z.ZodOptional<z.ZodBoolean>;
344
+ response_level: z.ZodOptional<z.ZodEnum<{
345
+ compact: "compact";
346
+ full: "full";
347
+ }>>;
340
348
  confirm_mode: z.ZodOptional<z.ZodEnum<{
341
349
  full: "full";
342
350
  streamlined: "streamlined";
@@ -368,6 +376,10 @@ export declare const Guard2File_InputSchema: z.ZodObject<{
368
376
  client_schema_version: z.ZodOptional<z.ZodString>;
369
377
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
370
378
  dry_run: z.ZodOptional<z.ZodBoolean>;
379
+ response_level: z.ZodOptional<z.ZodEnum<{
380
+ compact: "compact";
381
+ full: "full";
382
+ }>>;
371
383
  confirm_mode: z.ZodOptional<z.ZodEnum<{
372
384
  full: "full";
373
385
  streamlined: "streamlined";
@@ -1 +1 @@
1
- import{ResponseData,LocalMark,enrichMoveError}from'@wowok/wowok';import{classifyError,normalizeErrorMessage,buildSemantic}from'./semantic.js';import{buildReceipt}from'./receipt.js';import{recover,resetAttempts}from'../../harness/recover.js';import{verify,recordCoverageGap}from'../../harness/verify.js';function applySchemaWarning(a,b){const c=b?.['schema_check'];if(!c||c['warnings']['length']===0x0&&c['errors']['length']===0x0)return a;const d=[...c['warnings'],...c['errors']];let e=a['semantic'];e&&d['length']>0x0&&(e={...e,'warnings':[...e['warnings']||[],...d]});const f={'compatible':c['compatible'],'warnings':d,'client_version':c['client_version'],'server_versions':c['versions']};return{...a,'semantic':e,'schema_warning':f};}function convertBigInts(a){if(typeof a==='bigint')return a['toString']();if(Array['isArray'](a))return a['map'](convertBigInts);if(a&&typeof a==='object'){const b={};for(const c of Object['keys'](a))b[c]=convertBigInts(a[c]);return b;}return a;}function recoveryOperationId(a){return a?.['operation_id']??a?.['operation_type']??'call';}function failureDiagnosis(a,b,c,d){return verify({'expected':a,'actual':{'result_type':b['kind'],'error_code':c,'error':d}});}function recordSuccessCoverageGap(a,b,c){const d=verify({'expected':a,'actual':{'result_type':'transaction','semantic':b}});recordCoverageGap(d,{'operation_type':c['operation_type']});}export function handleCallResult(a,b){const c=convertBigInts(a),d=buildReceipt(c);if(d['kind']==='error'){const g=enrichMoveError(normalizeErrorMessage(d['error'])),h=classifyError(g),i={'outcome':'failed','message':'Error:\x20'+g,'result':{'type':'error','error':g,'error_code':h['error_code'],'retryable':h['retryable'],'recovery_hint':h['recovery_hint']},'recovery':recover(h['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,h['error_code'],g):undefined},j=applySchemaWarning(i,b);return{'content':[{'type':'text','text':j['message']}],'structuredContent':j};}if(d['kind']==='transaction'){const k=ResponseData(c);if(!d['executed']){const n=enrichMoveError(normalizeErrorMessage(d['txError'])||d['txStatus']||'unknown\x20error'),o=classifyError(n),p={'outcome':'failed','message':'Transaction\x20failed:\x20'+n,'result':{'type':'error','error':n,'error_code':o['error_code'],'retryable':o['retryable'],'recovery_hint':o['recovery_hint']},'recovery':recover(o['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,o['error_code'],n):undefined},q=applySchemaWarning(p,b);return{'content':[{'type':'text','text':q['message']},{'type':'text','text':JSON['stringify'](k)}],'structuredContent':q};}resetAttempts(recoveryOperationId(b));const l={'outcome':'executed','message':'Transaction\x20completed\x20successfully','result':{'type':'transaction',...c},'semantic':buildSemantic(d,b)};b?.['expected']&&recordSuccessCoverageGap(b['expected'],l['semantic'],b);const m=applySchemaWarning(l,b);return{'content':[{'type':'text','text':m['message']},{'type':'text','text':JSON['stringify'](k)}],'structuredContent':m};}if(d['kind']==='submission'){const s={'outcome':'pending_input','message':'Submission\x20required\x20for\x20Guard\x20verification','result':{'type':'submission',...c},'semantic':b?{'intent':'guard_submission_required','status':'pending_input','summary':'Guard\x20verification\x20required\x20—\x20fill\x20the\x20submission\x20data\x20and\x20resubmit','next_actions':[{'action':'fill\x20guard\x20submission\x20data\x20and\x20resubmit\x20via\x20call_with_submission','reason':'Guard\x20rejected\x20the\x20call;\x20submission\x20must\x20satisfy\x20the\x20Guard\x20table\x20requirements','tool':'onchain_operations\x20(with\x20submission\x20field)','priority':'required'}]}:undefined},t=applySchemaWarning(s,b);return{'content':[{'type':'text','text':t['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':t};}if(Array['isArray'](c)){const u={'outcome':'executed','message':'Operation\x20completed','result':{'type':'data','data':c}},v=applySchemaWarning(u,b);return{'content':[{'type':'text','text':v['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':v};}if(c===undefined||c===null){const w={'outcome':'executed','message':'Operation\x20completed','result':{'type':'null'}},x=applySchemaWarning(w,b);return{'content':[{'type':'text','text':x['message']}],'structuredContent':x};}const e={'outcome':'executed','message':'Operation\x20completed','result':{'type':'transaction',...c},'semantic':buildSemantic(d,b)},f=applySchemaWarning(e,b);return{'content':[{'type':'text','text':f['message']}],'structuredContent':f};}export function createServerConfig(a,b){return{'name':a['name'],'version':a['version'],'description':b||a['description']};}export function createCapabilitiesConfig(){return{'capabilities':{'prompts':{},'resources':{},'tools':{'listChanged':!![]},'logging':{}}};}export function createToolMeta(a,b){return{'author':'WOWOK\x20Team','createdAt':'2026-02-01','lastUpdated':'2026-02-01','category':a,'tags':b,'requiresAuth':![]};}export function createToolAnnotations(a=![],b=![]){return{'readOnlyHint':a,'destructiveHint':b,'idempotentHint':!![],'openWorldHint':![]};}export async function transformSubmission(a){if(!a)return undefined;const b=(a['guard']||[])['map'](h=>h['object'])['filter'](Boolean),c=(a['submission']||[])['map'](h=>h['guard'])['filter'](Boolean),d=[...new Set([...b,...c])],e=d['length']>0x0?await LocalMark['Instance']()['get_many_address'](d):[],f=new Map();d['forEach']((h,i)=>{const j=e[i];j&&f['set'](h,j);});const g=h=>{if(f['has'](h))return f['get'](h);for(const [i,j]of f['entries']()){if(i===h)return j;}if(h['startsWith']('0x')&&h['length']===0x42)return h;throw new Error('Guard\x20name\x20or\x20address\x20not\x20found:\x20'+h);};return{'type':'submission','guard':(a['guard']||[])['map'](h=>({'object':g(h['object']),'impack':h['impack']||![]})),'submission':(a['submission']||[])['map'](h=>({'guard':g(h['guard']),'submission':h['submission']||[]}))};}export function validateInput(a,b){return b['parse'](a);}export function getEnvConfig(a){return a??{};}
1
+ import{ResponseData,LocalMark,enrichMoveError}from'@wowok/wowok';import{classifyError,normalizeErrorMessage,buildSemantic}from'./semantic.js';import{buildReceipt}from'./receipt.js';import{recover,resetAttempts}from'../../harness/recover.js';import{verify,recordCoverageGap}from'../../harness/verify.js';function applySchemaWarning(a,b){const c=b?.['schema_check'];if(!c||c['warnings']['length']===0x0&&c['errors']['length']===0x0)return a;const d=[...c['warnings'],...c['errors']];let e=a['semantic'];e&&d['length']>0x0&&(e={...e,'warnings':[...e['warnings']||[],...d]});const f={'compatible':c['compatible'],'warnings':d,'client_version':c['client_version'],'server_versions':c['versions']};return{...a,'semantic':e,'schema_warning':f};}function convertBigInts(a){if(typeof a==='bigint')return a['toString']();if(Array['isArray'](a))return a['map'](convertBigInts);if(a&&typeof a==='object'){const b={};for(const c of Object['keys'](a))b[c]=convertBigInts(a[c]);return b;}return a;}function recoveryOperationId(a){return a?.['operation_id']??a?.['operation_type']??'call';}function failureDiagnosis(a,b,c,d){return verify({'expected':a,'actual':{'result_type':b['kind'],'error_code':c,'error':d}});}function recordSuccessCoverageGap(a,b,c){const d=verify({'expected':a,'actual':{'result_type':'transaction','semantic':b}});recordCoverageGap(d,{'operation_type':c['operation_type']});}export function handleCallResult(a,b){const c=convertBigInts(a),d=buildReceipt(c);if(d['kind']==='error'){const g=enrichMoveError(normalizeErrorMessage(d['error'])),h=classifyError(g),i={'outcome':'failed','message':'Error:\x20'+g,'result':{'type':'error','error':g,'error_code':h['error_code'],'retryable':h['retryable'],'recovery_hint':h['recovery_hint']},'recovery':recover(h['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,h['error_code'],g):undefined},j=applySchemaWarning(i,b);return{'content':[{'type':'text','text':j['message']}],'structuredContent':j};}if(d['kind']==='transaction'){const k=ResponseData(c);if(!d['executed']){const q=enrichMoveError(normalizeErrorMessage(d['txError'])||d['txStatus']||'unknown\x20error'),s=classifyError(q),t={'outcome':'failed','message':'Transaction\x20failed:\x20'+q,'result':{'type':'error','error':q,'error_code':s['error_code'],'retryable':s['retryable'],'recovery_hint':s['recovery_hint']},'recovery':recover(s['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,s['error_code'],q):undefined},u=applySchemaWarning(t,b);return{'content':[{'type':'text','text':u['message']},{'type':'text','text':JSON['stringify'](k)}],'structuredContent':u};}resetAttempts(recoveryOperationId(b));const l=b?.['response_level']==='full',m=k['filter'](v=>v?.['change']==='created'),n={'outcome':'executed','message':'Transaction\x20completed\x20successfully','result':l?{'type':'transaction',...c}:{'type':'transaction','digest':c['digest'],'created':m},'semantic':buildSemantic(d,b)};b?.['expected']&&recordSuccessCoverageGap(b['expected'],n['semantic'],b);const o=applySchemaWarning(n,b),p=l?JSON['stringify'](k):'Transaction\x20executed\x20(compact\x20response):\x20digest\x20'+(d['digest']??'')+';\x20created\x20'+m['length']+'\x20object(s).\x20Call\x20again\x20with\x20response_level:\x27full\x27\x20to\x20include\x20the\x20complete\x20raw\x20result.';return{'content':[{'type':'text','text':o['message']},{'type':'text','text':p}],'structuredContent':o};}if(d['kind']==='submission'){const v={'outcome':'pending_input','message':'Submission\x20required\x20for\x20Guard\x20verification','result':{'type':'submission',...c},'semantic':b?{'intent':'guard_submission_required','status':'pending_input','summary':'Guard\x20verification\x20required\x20—\x20fill\x20the\x20submission\x20data\x20and\x20resubmit','next_actions':[{'action':'fill\x20guard\x20submission\x20data\x20and\x20resubmit\x20via\x20call_with_submission','reason':'Guard\x20rejected\x20the\x20call;\x20submission\x20must\x20satisfy\x20the\x20Guard\x20table\x20requirements','tool':'onchain_operations\x20(with\x20submission\x20field)','priority':'required'}]}:undefined},w=applySchemaWarning(v,b);return{'content':[{'type':'text','text':w['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':w};}if(Array['isArray'](c)){const x={'outcome':'executed','message':'Operation\x20completed','result':{'type':'data','data':c}},y=applySchemaWarning(x,b);return{'content':[{'type':'text','text':y['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':y};}if(c===undefined||c===null){const z={'outcome':'executed','message':'Operation\x20completed','result':{'type':'null'}},A=applySchemaWarning(z,b);return{'content':[{'type':'text','text':A['message']}],'structuredContent':A};}const e={'outcome':'executed','message':'Operation\x20completed','result':{'type':'transaction',...c},'semantic':buildSemantic(d,b)},f=applySchemaWarning(e,b);return{'content':[{'type':'text','text':f['message']}],'structuredContent':f};}export function createServerConfig(a,b){return{'name':a['name'],'version':a['version'],'description':b||a['description']};}export function createCapabilitiesConfig(){return{'capabilities':{'prompts':{},'resources':{},'tools':{'listChanged':!![]},'logging':{}}};}export function createToolMeta(a,b){return{'author':'WOWOK\x20Team','createdAt':'2026-02-01','lastUpdated':'2026-02-01','category':a,'tags':b,'requiresAuth':![]};}export function createToolAnnotations(a=![],b=![]){return{'readOnlyHint':a,'destructiveHint':b,'idempotentHint':!![],'openWorldHint':![]};}export async function transformSubmission(a){if(!a)return undefined;const b=(a['guard']||[])['map'](h=>h['object'])['filter'](Boolean),c=(a['submission']||[])['map'](h=>h['guard'])['filter'](Boolean),d=[...new Set([...b,...c])],e=d['length']>0x0?await LocalMark['Instance']()['get_many_address'](d):[],f=new Map();d['forEach']((h,i)=>{const j=e[i];j&&f['set'](h,j);});const g=h=>{if(f['has'](h))return f['get'](h);for(const [i,j]of f['entries']()){if(i===h)return j;}if(h['startsWith']('0x')&&h['length']===0x42)return h;throw new Error('Guard\x20name\x20or\x20address\x20not\x20found:\x20'+h);};return{'type':'submission','guard':(a['guard']||[])['map'](h=>({'object':g(h['object']),'impack':h['impack']||![]})),'submission':(a['submission']||[])['map'](h=>({'guard':g(h['guard']),'submission':h['submission']||[]}))};}export function validateInput(a,b){return b['parse'](a);}export function getEnvConfig(a){return a??{};}
@@ -576,6 +576,10 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
576
576
  client_schema_version: z.ZodOptional<z.ZodString>;
577
577
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
578
578
  dry_run: z.ZodOptional<z.ZodBoolean>;
579
+ response_level: z.ZodOptional<z.ZodEnum<{
580
+ compact: "compact";
581
+ full: "full";
582
+ }>>;
579
583
  confirm_mode: z.ZodOptional<z.ZodEnum<{
580
584
  full: "full";
581
585
  streamlined: "streamlined";
@@ -667,6 +671,10 @@ export declare const MachineNode2File_InputSchema: z.ZodObject<{
667
671
  client_schema_version: z.ZodOptional<z.ZodString>;
668
672
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
669
673
  dry_run: z.ZodOptional<z.ZodBoolean>;
674
+ response_level: z.ZodOptional<z.ZodEnum<{
675
+ compact: "compact";
676
+ full: "full";
677
+ }>>;
670
678
  confirm_mode: z.ZodOptional<z.ZodEnum<{
671
679
  full: "full";
672
680
  streamlined: "streamlined";
@@ -148,6 +148,10 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
148
148
  client_schema_version: z.ZodOptional<z.ZodString>;
149
149
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
150
150
  dry_run: z.ZodOptional<z.ZodBoolean>;
151
+ response_level: z.ZodOptional<z.ZodEnum<{
152
+ compact: "compact";
153
+ full: "full";
154
+ }>>;
151
155
  confirm_mode: z.ZodOptional<z.ZodEnum<{
152
156
  full: "full";
153
157
  streamlined: "streamlined";
@@ -1 +1 @@
1
- import{z}from'zod';import{CallEnvSchema,SubmissionCallSchema}from'./base.js';import{OperateSchema}from'./progress.js';import{AccountOrMark_AddressSchema,DescriptionSchema,LongNameSchema,ManyAccountOrMark_AddressSchema,NameOrAddressSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';export const ArbConfirmSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'confirm':z['boolean']()['describe']('Whether\x20to\x20confirm\x20that\x20the\x20submitted\x20arbitration\x20materials\x20are\x20valid\x20for\x20arbitration.'),'description':DescriptionSchema['optional']()['describe']('Message\x20description\x20for\x20compensation\x20application.'),'proposition':z['array'](LongNameSchema)['optional']()['describe']('Compensation\x20claims.')})['strict']();export const ArbObjectionSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'objection':DescriptionSchema['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration')})['strict']();export const ArbClaimCompensationSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.')})['strict']();export const CallOrder_DataSchema=z['object']({'object':NameOrAddressSchema['describe']('Order\x20object\x20ID\x20or\x20name.'),'agent':ManyAccountOrMark_AddressSchema['optional']()['describe']('Order\x20agent.\x20Agents\x20can\x20operate\x20the\x20order,\x20such\x20as\x20canceling\x20the\x20order,\x20modifying\x20the\x20order\x20status,\x20etc.;\x20but\x20cannot\x20receive\x20the\x20funds\x20received\x20by\x20the\x20order.'),'required_info':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20(recipient)\x20or\x20WTS\x20Proof\x20object\x20(delivery\x20proof)\x20that\x20information\x20has\x20been\x20delivered\x20via\x20Wowok\x20Messenger.'),'progress':OperateSchema['optional']()['describe']('Advance\x20order\x20process'),'arb_confirm':ArbConfirmSchema['optional']()['describe']('Submit\x20compensation\x20request\x20and\x20apply\x20for\x20arbitration'),'arb_objection':ArbObjectionSchema['optional']()['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration.'),'arb_claim_compensation':ArbClaimCompensationSchema['optional']()['describe']('Specify\x20the\x20adjudicated\x20Arb\x20object\x20to\x20obtain\x20order\x20compensation.'),'receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20or\x20other\x20objects\x20received\x20by\x20the\x20order\x20and\x20transfer\x20them\x20to\x20the\x20order\x20owner.\x20'+'Consistent\x20with\x20`owner_receive`\x20on\x20other\x20objects\x20(arbitration/contact/demand/machine/permission/repository/reward/service/treasury).'+RECEIVE_FORMAT_BLOCK_OBJECTS),'transfer_to':AccountOrMark_AddressSchema['optional']()['describe']('Set\x20new\x20owner\x20of\x20the\x20order.\x20Requires\x20order\x20owner\x20permission\x20to\x20set.')})['strict']()['describe']('On-chain,\x20operate\x20on\x20an\x20Order\x20object.');export const CallOrder_InputSchema=z['object']({'data':CallOrder_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
1
+ import{z}from'zod';import{CallEnvSchema,SubmissionCallSchema}from'./base.js';import{OperateSchema}from'./progress.js';import{AccountOrMark_AddressSchema,DescriptionSchema,LongNameSchema,ManyAccountOrMark_AddressSchema,NameOrAddressSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';export const ArbConfirmSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'confirm':z['boolean']()['describe']('Whether\x20to\x20confirm\x20that\x20the\x20submitted\x20arbitration\x20materials\x20are\x20valid\x20for\x20arbitration.'),'description':DescriptionSchema['optional']()['describe']('Message\x20description\x20for\x20compensation\x20application.'),'proposition':z['array'](LongNameSchema)['optional']()['describe']('Compensation\x20claims.')})['strict']();export const ArbObjectionSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'objection':DescriptionSchema['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration')})['strict']();export const ArbClaimCompensationSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.')})['strict']();export const CallOrder_DataSchema=z['object']({'object':NameOrAddressSchema['describe']('Order\x20object\x20ID\x20or\x20name.'),'agent':ManyAccountOrMark_AddressSchema['optional']()['describe']('Order\x20agent.\x20Agents\x20can\x20operate\x20the\x20order,\x20such\x20as\x20canceling\x20the\x20order,\x20modifying\x20the\x20order\x20status,\x20etc.;\x20but\x20cannot\x20receive\x20the\x20funds\x20received\x20by\x20the\x20order.'),'required_info':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20(recipient)\x20or\x20WTS\x20Proof\x20object\x20(delivery\x20proof)\x20that\x20information\x20has\x20been\x20delivered\x20via\x20Wowok\x20Messenger.'),'progress':OperateSchema['optional']()['describe']('Advance\x20order\x20process'),'arb_confirm':ArbConfirmSchema['optional']()['describe']('CUSTOMER-side\x20confirm\x20on\x20an\x20Arb\x20case\x20(the\x20order\x20owner;\x20the\x20arbitration\x20object\x27s\x20own\x20confirm\x20tool\x20is\x20the\x20arbitrator\x27s\x20and\x20rejects\x20customers).\x20'+'Moves\x20the\x20case\x20from\x20state\x200\x20to\x20state\x201.\x20REQUIRED\x20after\x20an\x20arbitrator\x20reset\x20—\x20a\x20reset\x20returns\x20the\x20case\x20to\x20state\x200\x20with\x20the\x20indemnity\x20cleared,\x20'+'and\x20only\x20the\x20customer\x20can\x20advance\x20it\x20again;\x20the\x20fee\x20stays\x20locked\x20until\x20this\x20is\x20called.\x20Not\x20the\x20filing\x20step:\x20filing\x20(dispute)\x20lands\x20the\x20case\x20directly\x20in\x20state\x201.'),'arb_objection':ArbObjectionSchema['optional']()['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration.'),'arb_claim_compensation':ArbClaimCompensationSchema['optional']()['describe']('Specify\x20the\x20adjudicated\x20Arb\x20object\x20to\x20obtain\x20order\x20compensation.\x20Succeeds\x20even\x20when\x20the\x20ruled\x20indemnity\x20is\x200\x20—\x20'+'the\x20claim\x20closes\x20the\x20case\x20(state\x205)\x20and\x20lets\x20the\x20arbitrator\x20withdraw\x20the\x20dispute\x20fee\x20immediately.'),'receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20or\x20other\x20objects\x20received\x20by\x20the\x20order\x20and\x20transfer\x20them\x20to\x20the\x20order\x20owner.\x20'+'Consistent\x20with\x20`owner_receive`\x20on\x20other\x20objects\x20(arbitration/contact/demand/machine/permission/repository/reward/service/treasury).'+RECEIVE_FORMAT_BLOCK_OBJECTS),'transfer_to':AccountOrMark_AddressSchema['optional']()['describe']('Set\x20new\x20owner\x20of\x20the\x20order.\x20Requires\x20order\x20owner\x20permission\x20to\x20set.')})['strict']()['describe']('On-chain,\x20operate\x20on\x20an\x20Order\x20object.');export const CallOrder_InputSchema=z['object']({'data':CallOrder_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
@@ -119,6 +119,10 @@ export declare const CallPayment_InputSchema: z.ZodObject<{
119
119
  client_schema_version: z.ZodOptional<z.ZodString>;
120
120
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
121
121
  dry_run: z.ZodOptional<z.ZodBoolean>;
122
+ response_level: z.ZodOptional<z.ZodEnum<{
123
+ compact: "compact";
124
+ full: "full";
125
+ }>>;
122
126
  confirm_mode: z.ZodOptional<z.ZodEnum<{
123
127
  full: "full";
124
128
  streamlined: "streamlined";
@@ -525,6 +525,10 @@ export declare const CallPermission_InputSchema: z.ZodObject<{
525
525
  client_schema_version: z.ZodOptional<z.ZodString>;
526
526
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
527
527
  dry_run: z.ZodOptional<z.ZodBoolean>;
528
+ response_level: z.ZodOptional<z.ZodEnum<{
529
+ compact: "compact";
530
+ full: "full";
531
+ }>>;
528
532
  confirm_mode: z.ZodOptional<z.ZodEnum<{
529
533
  full: "full";
530
534
  streamlined: "streamlined";
@@ -457,6 +457,10 @@ export declare const CallPersonal_InputSchema: z.ZodObject<{
457
457
  client_schema_version: z.ZodOptional<z.ZodString>;
458
458
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
459
459
  dry_run: z.ZodOptional<z.ZodBoolean>;
460
+ response_level: z.ZodOptional<z.ZodEnum<{
461
+ compact: "compact";
462
+ full: "full";
463
+ }>>;
460
464
  confirm_mode: z.ZodOptional<z.ZodEnum<{
461
465
  full: "full";
462
466
  streamlined: "streamlined";
@@ -144,6 +144,10 @@ export declare const CallProgress_InputSchema: z.ZodObject<{
144
144
  client_schema_version: z.ZodOptional<z.ZodString>;
145
145
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
146
146
  dry_run: z.ZodOptional<z.ZodBoolean>;
147
+ response_level: z.ZodOptional<z.ZodEnum<{
148
+ compact: "compact";
149
+ full: "full";
150
+ }>>;
147
151
  confirm_mode: z.ZodOptional<z.ZodEnum<{
148
152
  full: "full";
149
153
  streamlined: "streamlined";
@@ -47,6 +47,10 @@ export declare const CallProof_InputSchema: z.ZodObject<{
47
47
  client_schema_version: z.ZodOptional<z.ZodString>;
48
48
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
49
49
  dry_run: z.ZodOptional<z.ZodBoolean>;
50
+ response_level: z.ZodOptional<z.ZodEnum<{
51
+ compact: "compact";
52
+ full: "full";
53
+ }>>;
50
54
  confirm_mode: z.ZodOptional<z.ZodEnum<{
51
55
  full: "full";
52
56
  streamlined: "streamlined";
@@ -79,6 +83,10 @@ export declare const CallGenProof_InputSchema: z.ZodObject<{
79
83
  client_schema_version: z.ZodOptional<z.ZodString>;
80
84
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
81
85
  dry_run: z.ZodOptional<z.ZodBoolean>;
86
+ response_level: z.ZodOptional<z.ZodEnum<{
87
+ compact: "compact";
88
+ full: "full";
89
+ }>>;
82
90
  confirm_mode: z.ZodOptional<z.ZodEnum<{
83
91
  full: "full";
84
92
  streamlined: "streamlined";
@@ -429,6 +429,10 @@ export declare const CallRepository_InputSchema: z.ZodObject<{
429
429
  client_schema_version: z.ZodOptional<z.ZodString>;
430
430
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
431
431
  dry_run: z.ZodOptional<z.ZodBoolean>;
432
+ response_level: z.ZodOptional<z.ZodEnum<{
433
+ compact: "compact";
434
+ full: "full";
435
+ }>>;
432
436
  confirm_mode: z.ZodOptional<z.ZodEnum<{
433
437
  full: "full";
434
438
  streamlined: "streamlined";
@@ -1 +1 @@
1
- import{z}from'zod';import{WithPermissionObjectSchema,ObjectsSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{AccountOrMark_AddressSchema,DescriptionSchema,NameOrAddressSchema,NameSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';import{PolicyRuleSchema}from'../query/index.js';import{SupportedValueSchema}from'../common/index.js';export const RepositoryIdSchema=z['union']([z['string'](),z['number'](),AccountOrMark_AddressSchema])['describe']('Data\x20item\x20ID.\x20Supports:\x20plain\x20string(bigint),\x20number\x20(such\x20as\x20timestamp),\x20or\x20AccountOrMark_Address\x20format.');export const KeyDataSchema=z['object']({'id':RepositoryIdSchema,'data':SupportedValueSchema})['strict']()['describe']('Data\x20ID\x20and\x20value.');export const RepDataItemSchema=z['object']({'data':z['array'](KeyDataSchema)['describe']('Data\x20item\x20list.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20REQUIRED\x20for\x20data_add\x20items\x20when\x20the\x20matching\x20policy\x20uses\x20id_from=None(0):\x20it\x20must\x20reference\x20one\x20of\x20that\x20policy\x27s\x20write_guard\x20guards,\x20otherwise\x20the\x20chain\x20aborts\x20with\x2022\x20(E_POLICY_WRITE_GUARD_REQUIRED).\x20Optional\x20for\x20Clock/Signer\x20policies.')})['strict']()['describe']('List\x20of\x20data\x20items\x20to\x20write.');export const SignerOrClockBaseSchema=z['object']({'name':NameSchema['describe']('Data\x20item\x20name.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20Used\x20to\x20specify\x20the\x20policy\x20write\x20permissions\x20and\x20rules\x20corresponding\x20to\x20this\x20Guard.')})['strict']()['describe']('Specify\x20data\x20items\x20by\x20name\x20and\x20ID.\x20ID\x20is\x20the\x20on-chain\x20timestamp\x20or\x20signer\x20ID\x20(depending\x20on\x20how\x20write_guard\x20specifies\x20the\x20ID\x20source).');export const SignerOrClockSchema=z['object']({'name':NameSchema['describe']('Data\x20item\x20name.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20Used\x20to\x20specify\x20the\x20policy\x20write\x20permissions\x20and\x20rules\x20corresponding\x20to\x20this\x20Guard.'),'data':SupportedValueSchema})['strict']()['describe']('Specify\x20data\x20items\x20by\x20name\x20and\x20data.\x20ID\x20is\x20the\x20on-chain\x20timestamp\x20or\x20signer\x20ID\x20(depending\x20on\x20how\x20write_guard\x20specifies\x20the\x20ID\x20source).');export const DataRemoveItemSchema=z['object']({'id':z['array'](RepositoryIdSchema)['describe']('Data\x20item\x20ID\x20list.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20REQUIRED\x20for\x20data_remove\x20items\x20when\x20the\x20matching\x20policy\x20uses\x20id_from=None(0);\x20optional\x20for\x20Clock/Signer\x20policies.')})['strict']()['describe']('Delete\x20data\x20items\x20by\x20name\x20and\x20ID\x20list.');export const PoliciesAddSetSchema=z['object']({'op':z['enum'](['add','set']),'policy':z['array'](PolicyRuleSchema)['describe']('Policy\x20rule\x20list.')})['strict']()['describe']('Add\x20or\x20set\x20policy\x20rules.');export const PoliciesRemoveSchema=z['object']({'op':z['literal']('remove'),'policy':z['array'](NameSchema)['describe']('Policy\x20rule\x20name\x20list.')})['strict']()['describe']('Remove\x20policy\x20rules.');export const PoliciesClearSchema=z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20policy\x20rules.');export const PoliciesSchema=z['discriminatedUnion']('op',[PoliciesAddSetSchema,PoliciesRemoveSchema,PoliciesClearSchema]);export const DataAddWithItemsSchema=z['object']({'name':NameSchema['describe']('Data\x20item\x20name.\x20Must\x20match\x20the\x20name\x20in\x20PolicyRule.'),'items':z['array'](RepDataItemSchema)['describe']('List\x20of\x20data\x20items\x20to\x20add.\x20Each\x20data\x20item\x20contains\x20name,\x20ID,\x20and\x20data\x20parts,\x20where\x20name\x20and\x20ID\x20together\x20form\x20the\x20unique\x20key\x20for\x20the\x20data.')})['strict']()['describe']('Add\x20data\x20by\x20name\x20and\x20data\x20item\x20list.\x20Each\x20data\x20item\x20contains\x20name,\x20ID,\x20and\x20data\x20parts,\x20where\x20name\x20and\x20ID\x20together\x20form\x20the\x20unique\x20key\x20for\x20the\x20data.');export const DataAddSchema=z['union']([SignerOrClockSchema,DataAddWithItemsSchema]);export const DataRemoveSchema=z['union']([SignerOrClockBaseSchema,z['object']({'name':NameSchema['describe']('Data\x20item\x20name.\x20Must\x20match\x20the\x20name\x20in\x20PolicyRule.'),'items':z['array'](DataRemoveItemSchema)['describe']('List\x20of\x20data\x20items\x20to\x20delete.')})['strict']()]);export const CallRepository_DataSchema=z['object']({'object':WithPermissionObjectSchema,'description':DescriptionSchema['optional'](),'policies':PoliciesSchema['optional']()['describe']('Write\x20and\x20read\x20permission\x20rules\x20governing\x20the\x20data\x20records\x20of\x20this\x20Repository.'),'data_add':DataAddSchema['optional']()['describe']('Add\x20data\x20items\x20to\x20an\x20ALREADY-EXISTING\x20Repository.\x20TWO-PHASE:\x20if\x20\x27object\x27\x20creates\x20a\x20NEW\x20Repository\x20in\x20this\x20same\x20call,\x20data_add\x20FAILS\x20(\x27Repository\x20content\x20not\x20ready\x27)\x20—\x20first\x20create\x20the\x20Repository\x20(one\x20call),\x20then\x20add\x20data\x20in\x20a\x20follow-up\x20call.\x20The\x20data_add.name\x20must\x20match\x20a\x20policy\x20rule\x20name\x20defined\x20in\x20\x27policies\x27.'),'data_remove':DataRemoveSchema['optional']()['describe']('Delete\x20data\x20items'),'rewards':ObjectsSchema['optional']()['describe']('Reward\x20objects\x20bound\x20to\x20this\x20Repository\x20to\x20incentivize\x20data\x20contribution.'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Repository\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name.')})['strict']()['describe']('On-chain\x20Repository\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Repository.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.');export const CallRepository_InputSchema=z['object']({'data':CallRepository_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
1
+ import{z}from'zod';import{WithPermissionObjectSchema,ObjectsSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{AccountOrMark_AddressSchema,DescriptionSchema,NameOrAddressSchema,NameSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';import{PolicyRuleSchema}from'../query/index.js';import{SupportedValueSchema}from'../common/index.js';export const RepositoryIdSchema=z['union']([z['string'](),z['number'](),AccountOrMark_AddressSchema])['describe']('Data\x20item\x20ID.\x20Supports:\x20plain\x20string(bigint),\x20number\x20(such\x20as\x20timestamp),\x20or\x20AccountOrMark_Address\x20format.');export const KeyDataSchema=z['object']({'id':RepositoryIdSchema,'data':SupportedValueSchema})['strict']()['describe']('Data\x20ID\x20and\x20value.');export const RepDataItemSchema=z['object']({'data':z['array'](KeyDataSchema)['describe']('Data\x20item\x20list.\x20MUST\x20be\x20non-empty\x20unless\x20the\x20matching\x20policy\x20guard\x20sets\x20BOTH\x20id_from_submission\x20AND\x20data_from_submission\x20(then\x20pass\x20data:[]\x20—\x20the\x20id\x20AND\x20value\x20are\x20derived\x20from\x20the\x20passport\x20submission\x20table,\x20and\x20any\x20item-level\x20id/data\x20would\x20be\x20ignored).\x20With\x20only\x20ONE\x20of\x20the\x20two\x20submission\x20settings,\x20\x27data\x27\x20must\x20carry\x20the\x20missing\x20side;\x20with\x20none,\x20\x27data\x27\x20is\x20required.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20REQUIRED\x20for\x20data_add\x20items\x20when\x20the\x20matching\x20policy\x20uses\x20id_from=None(0):\x20it\x20must\x20reference\x20one\x20of\x20that\x20policy\x27s\x20write_guard\x20guards,\x20otherwise\x20the\x20chain\x20aborts\x20with\x2022\x20(E_POLICY_WRITE_GUARD_REQUIRED).\x20Optional\x20for\x20Clock/Signer\x20policies.')})['strict']()['describe']('List\x20of\x20data\x20items\x20to\x20write.');export const SignerOrClockBaseSchema=z['object']({'name':NameSchema['describe']('Data\x20item\x20name.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20Used\x20to\x20specify\x20the\x20policy\x20write\x20permissions\x20and\x20rules\x20corresponding\x20to\x20this\x20Guard.')})['strict']()['describe']('Specify\x20data\x20items\x20by\x20name\x20and\x20ID.\x20ID\x20is\x20the\x20on-chain\x20timestamp\x20or\x20signer\x20ID\x20(depending\x20on\x20how\x20write_guard\x20specifies\x20the\x20ID\x20source).');export const SignerOrClockSchema=z['object']({'name':NameSchema['describe']('Data\x20item\x20name.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20Used\x20to\x20specify\x20the\x20policy\x20write\x20permissions\x20and\x20rules\x20corresponding\x20to\x20this\x20Guard.'),'data':SupportedValueSchema})['strict']()['describe']('Specify\x20data\x20items\x20by\x20name\x20and\x20data.\x20ID\x20is\x20the\x20on-chain\x20timestamp\x20or\x20signer\x20ID\x20(depending\x20on\x20how\x20write_guard\x20specifies\x20the\x20ID\x20source).');export const DataRemoveItemSchema=z['object']({'id':z['array'](RepositoryIdSchema)['describe']('Data\x20item\x20ID\x20list.'),'write_guard':NameOrAddressSchema['optional']()['describe']('Guard\x20ID\x20or\x20name.\x20REQUIRED\x20for\x20data_remove\x20items\x20when\x20the\x20matching\x20policy\x20uses\x20id_from=None(0);\x20optional\x20for\x20Clock/Signer\x20policies.')})['strict']()['describe']('Delete\x20data\x20items\x20by\x20name\x20and\x20ID\x20list.');export const PoliciesAddSetSchema=z['object']({'op':z['enum'](['add','set']),'policy':z['array'](PolicyRuleSchema)['describe']('Policy\x20rule\x20list.')})['strict']()['describe']('op:\x27set\x27\x20REPLACES\x20THE\x20WHOLE\x20policy\x20list\x20(policies\x20not\x20included\x20are\x20deleted,\x20and\x20once\x20the\x20Permission\x20is\x20locked\x20they\x20cannot\x20be\x20restored)\x20—\x20use\x20op:\x27add\x27\x20to\x20append\x20or\x20update\x20individual\x20policies\x20without\x20touching\x20the\x20others.');export const PoliciesRemoveSchema=z['object']({'op':z['literal']('remove'),'policy':z['array'](NameSchema)['describe']('Policy\x20rule\x20name\x20list.')})['strict']()['describe']('Remove\x20policy\x20rules.');export const PoliciesClearSchema=z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20policy\x20rules.');export const PoliciesSchema=z['discriminatedUnion']('op',[PoliciesAddSetSchema,PoliciesRemoveSchema,PoliciesClearSchema]);export const DataAddWithItemsSchema=z['object']({'name':NameSchema['describe']('Data\x20item\x20name.\x20Must\x20match\x20the\x20name\x20in\x20PolicyRule.'),'items':z['array'](RepDataItemSchema)['describe']('List\x20of\x20data\x20items\x20to\x20add.\x20WORKED\x20EXAMPLES\x20by\x20policy\x20id_from\x20mode\x20—\x20(a)\x20id_from=None(0),\x20policy\x20has\x20NO\x20write\x20guards:\x20items:[{data:[{id:\x220x2::example::0x123...\x22,\x20data:\x22value\x22}]}]\x20(no\x20write_guard).\x20(b)\x20id_from=None(0),\x20policy\x20HAS\x20write\x20guards\x20without\x20submission\x20settings:\x20items:[{write_guard:\x22<policy\x20guard>\x22,\x20data:[{id:...,\x20data:...}]}].\x20(c)\x20id_from=None(0),\x20policy\x20guard\x20sets\x20BOTH\x20id_from_submission\x20AND\x20data_from_submission:\x20items:[{write_guard:\x22<policy\x20guard>\x22,\x20data:[]}]\x20—\x20the\x20id\x20AND\x20value\x20come\x20from\x20the\x20passport\x20submission\x20table\x20(send\x20\x27submission\x27\x20in\x20the\x20same\x20call);\x20item-level\x20id/data\x20are\x20IGNORED\x20for\x20such\x20guards\x20and\x20one\x20record\x20is\x20written\x20per\x20guard.\x20(d)\x20id_from=Clock(1)/Signer(2):\x20use\x20the\x20SignerOrClock\x20form\x20{name,\x20data,\x20write_guard?}\x20instead\x20—\x20the\x20id\x20is\x20derived\x20on-chain\x20from\x20the\x20transaction\x20clock\x20or\x20signer;\x20write_guard\x20is\x20required\x20when\x20the\x20policy\x20declares\x20guards.')})['strict']()['describe']('Add\x20data\x20by\x20name\x20and\x20data\x20item\x20list.\x20Each\x20data\x20item\x20contains\x20name,\x20ID,\x20and\x20data\x20parts,\x20where\x20name\x20and\x20ID\x20together\x20form\x20the\x20unique\x20key\x20for\x20the\x20data.\x20See\x20\x27items\x27\x20for\x20worked\x20examples\x20per\x20policy\x20id_from\x20mode.');export const DataAddSchema=z['union']([SignerOrClockSchema,DataAddWithItemsSchema]);export const DataRemoveSchema=z['union']([SignerOrClockBaseSchema,z['object']({'name':NameSchema['describe']('Data\x20item\x20name.\x20Must\x20match\x20the\x20name\x20in\x20PolicyRule.'),'items':z['array'](DataRemoveItemSchema)['describe']('List\x20of\x20data\x20items\x20to\x20delete.')})['strict']()]);export const CallRepository_DataSchema=z['object']({'object':WithPermissionObjectSchema,'description':DescriptionSchema['optional'](),'policies':PoliciesSchema['optional']()['describe']('Write\x20and\x20read\x20permission\x20rules\x20governing\x20the\x20data\x20records\x20of\x20this\x20Repository.'),'data_add':DataAddSchema['optional']()['describe']('Add\x20data\x20items\x20to\x20an\x20ALREADY-EXISTING\x20Repository.\x20TWO-PHASE:\x20if\x20\x27object\x27\x20creates\x20a\x20NEW\x20Repository\x20in\x20this\x20same\x20call,\x20data_add\x20FAILS\x20(\x27Repository\x20content\x20not\x20ready\x27)\x20—\x20first\x20create\x20the\x20Repository\x20(one\x20call),\x20then\x20add\x20data\x20in\x20a\x20follow-up\x20call.\x20The\x20data_add.name\x20must\x20match\x20a\x20policy\x20rule\x20name\x20defined\x20in\x20\x27policies\x27.\x20SUBMISSION\x20GUARDS:\x20when\x20the\x20matched\x20policy\x20guard\x20sets\x20both\x20id_from_submission\x20and\x20data_from_submission,\x20the\x20id\x20AND\x20value\x20are\x20read\x20from\x20the\x20passport\x20submission\x20table\x20—\x20pass\x20items:[{write_guard,\x20data:[]}]\x20with\x20a\x20\x27submission\x27\x20in\x20the\x20same\x20call;\x20empty\x20items\x20or\x20entries\x20that\x20would\x20write\x20nothing\x20are\x20rejected\x20instead\x20of\x20silently\x20succeeding.\x20See\x20DataAddWithItemsSchema.items\x20for\x20worked\x20examples\x20per\x20id_from\x20mode.'),'data_remove':DataRemoveSchema['optional']()['describe']('Delete\x20data\x20items'),'rewards':ObjectsSchema['optional']()['describe']('Reward\x20objects\x20bound\x20to\x20this\x20Repository\x20to\x20incentivize\x20data\x20contribution.'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Repository\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name.')})['strict']()['describe']('On-chain\x20Repository\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Repository.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.');export const CallRepository_InputSchema=z['object']({'data':CallRepository_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
@@ -173,6 +173,10 @@ export declare const CallReward_InputSchema: z.ZodObject<{
173
173
  client_schema_version: z.ZodOptional<z.ZodString>;
174
174
  schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
175
175
  dry_run: z.ZodOptional<z.ZodBoolean>;
176
+ response_level: z.ZodOptional<z.ZodEnum<{
177
+ compact: "compact";
178
+ full: "full";
179
+ }>>;
176
180
  confirm_mode: z.ZodOptional<z.ZodEnum<{
177
181
  full: "full";
178
182
  streamlined: "streamlined";
@@ -1 +1 @@
1
- import{afterEach,describe,expect,it}from'vitest';import{setEnabled,reset}from'../../config/runtime.js';import{buildDataSemantic}from'./semantic.js';function trustResult(){return{'evaluation_id':'graph_service_trust','total':0x2b,'level':'high','breakdown':[{'rule_id':'trust_arbitration','dimension':'trust','score':0x0,'weight':0x14,'reason':'No\x20arbitration\x20binding\x20configured\x20(verified\x20absence)\x20—\x20binding\x20table\x20empty','mismatched':['arbitration_binding']},{'rule_id':'trust_fund_safety','dimension':'trust','score':0x28,'weight':0xf,'reason':'Fund\x20safety\x206/15\x20—\x20Compensation\x20fund\x200\x20base\x20units','mismatched':['no\x20compensation\x20fund']},{'rule_id':'trust_reviews','dimension':'trust','score':0x32,'weight':0x23,'reason':'No\x20reputation\x20signal\x20(verified\x20empty\x20window)\x20—\x200\x20votes'}],'red_flags':['service\x20paused\x20by\x20merchant'],'blocked':!![],'trace':[],'summary':'Service\x20trust\x2043/100\x20(high)\x20—\x20weakest\x20trust_arbitration\x200/100\x20—\x20binding\x20table\x20empty','unverified':[]};}function riskResult(){return{'evaluation_id':'graph_service_risk','total':0x41,'level':'medium_high','breakdown':[{'rule_id':'risk_workflow','dimension':'workflow','score':0x4e,'weight':0x23,'reason':'1\x20structural\x20finding(s):\x20[high]\x20Forward\x20sink\x20—\x20analyzer\x20findings','mismatched':['wf_sink']}],'red_flags':[],'blocked':![],'trace':[],'summary':'Service\x20risk\x2065/100\x20(medium_high)\x20—\x20weakest\x20risk_workflow\x2078/100\x20—\x201\x20structural\x20finding(s)','unverified':[]};}function fixtureEvaluation(){return{'target':'0xsvc','trust':trustResult(),'risk':riskResult(),'completeness':0x56,'coverage':[{'slot':'service_snapshot','label':'Service\x20snapshot','gloss':'g','required':!![],'state':'present','facts':[]},{'slot':'reviews','label':'Review\x20votes','gloss':'g','required':![],'state':'empty','facts':[]},{'slot':'machine_workflow','label':'Workflow','gloss':'g','required':!![],'state':'gap','facts':[]}],'unverified':['trust_reviews'],'vocabulary':{'present':'p','empty':'e','gap':'g','unverified':'u','completeness':'c'}};}const BUY_DATA={'object':'0xsvc','order_new':{'buy':{'items':[],'total_pay':{'balance':'1'}}}};afterEach(()=>{reset('customer_intelligence');}),describe('Task\x2021\x20—\x20customer_advice\x20projects\x20the\x20graph\x20evaluation\x20(TR-21.1)',()=>{it('preorder\x20advice:\x20findings\x20text\x20cites\x20the\x20breakdown\x20evidence,\x20red\x20flag\x20at\x20required\x20priority',()=>{const a=buildDataSemantic({},{'operation_type':'service','data':BUY_DATA,'evaluation':fixtureEvaluation()}),b=a?.['customer_advice'];expect(b)['toBeDefined'](),expect(b['risk_score'])['toBe'](0x41),expect(b['risk_level'])['toBe']('medium_high');const c=b['reminders']['filter'](i=>i['priority']==='required');expect(c)['toHaveLength'](0x1),expect(c[0x0]['stage'])['toBe']('preorder'),expect(c[0x0]['message'])['toContain']('Blocked:\x20service\x20paused\x20by\x20merchant');const d=b['reminders']['filter'](i=>i['priority']==='recommended'),e=d['map'](i=>i['message'])['join']('\x20|\x20');expect(e)['toContain']('Arbitration\x200/100\x20—\x20No\x20arbitration\x20binding\x20configured\x20(verified\x20absence)'),expect(e)['toContain']('missing/unmet:\x20arbitration_binding'),expect(e)['toContain']('Fund\x20safety\x206/15\x20—\x20Compensation\x20fund\x200\x20base\x20units'),expect(e)['toContain']('1\x20structural\x20finding(s):\x20[high]\x20Forward\x20sink'),expect(d[0x0]['message'])['toContain']('Arbitration\x200/100');const f=b['reminders']['map'](i=>i['message'])['join']('\x20|\x20');expect(f)['toContain']('Unverifiable\x20dimensions\x20(excluded\x20from\x20the\x20score\x20due\x20to\x20fetch\x20gaps):\x20Reputation'),expect(f)['toContain']('treat\x20them\x20as\x20unknown,\x20not\x20as\x20passed'),expect(f)['toContain']('Coverage\x20gap:\x20required\x20material\x20\x22machine_workflow\x22'),expect(f)['not']['toContain']('\x22reviews\x22'),expect(b['recommendations'])['toContain']('Resolve\x20the\x20red\x20flags\x20with\x20the\x20merchant\x20or\x20pick\x20another\x20service\x20before\x20paying');const g=b['recommendations']['filter'](i=>i['includes']('below\x20your\x20risk\x20appetite'));expect(g)['toHaveLength'](0x1),expect(g[0x0])['toContain']('Trust\x2043/100\x20is\x20below\x20your\x20risk\x20appetite\x20(50)'),expect(g[0x0])['toContain']('Service\x20trust\x2043/100\x20(high)');const h=b['reminders']['map'](i=>i['priority']);expect(h['indexOf']('required'))['toBeLessThan'](h['indexOf']('recommended')),expect(h['lastIndexOf']('info'))['toBeGreaterThan'](h['lastIndexOf']('recommended'));}),it('browse\x20advice:\x20reuses\x20the\x20evaluation\x20embedded\x20in\x20the\x20response\x20envelope\x20(no\x20threading)',()=>{const a=buildDataSemantic({'evaluation':fixtureEvaluation()},{'operation_type':'query_toolkit','data':{}}),b=a?.['customer_advice'];expect(b)['toBeDefined'](),expect(b['reminders']['every'](c=>c['stage']==='browse'))['toBe'](!![]),expect(b['reminders']['map'](c=>c['message'])['join']('\x20'))['toContain']('Blocked:\x20service\x20paused\x20by\x20merchant');}),it('no\x20evaluation\x20→\x20no\x20advice\x20(order\x20ops,\x20bare\x20service\x20ops,\x20unevaluated\x20queries)',()=>{expect(buildDataSemantic({},{'operation_type':'order','data':{'object':'0xorder'}})?.['customer_advice'])['toBeUndefined'](),expect(buildDataSemantic({},{'operation_type':'service','data':{'object':'0xsvc'}})?.['customer_advice'])['toBeUndefined'](),expect(buildDataSemantic({},{'operation_type':'query_toolkit','data':{}})?.['customer_advice'])['toBeUndefined']();}),it('clean\x20evaluation:\x20a\x20single\x20info\x20reminder\x20cites\x20both\x20measured\x20summaries',()=>{const a={'target':'0xsvc','trust':{'evaluation_id':'graph_service_trust','total':0x5c,'level':'low','breakdown':[{'rule_id':'trust_arbitration','dimension':'trust','score':0x64,'weight':0x14,'reason':'Arbitration\x2020/20\x20—\x20binding\x20active'}],'red_flags':[],'blocked':![],'trace':[],'summary':'Service\x20trust\x2092/100\x20(low)','unverified':[]},'risk':{'evaluation_id':'graph_service_risk','total':0x64,'level':'low','breakdown':[{'rule_id':'risk_workflow','dimension':'workflow','score':0x64,'weight':0x23,'reason':'No\x20structural\x20risk\x20fired\x20—\x20clean\x20findings'}],'red_flags':[],'blocked':![],'trace':[],'summary':'Service\x20risk\x20100/100\x20(low)','unverified':[]},'completeness':0x64,'coverage':[{'slot':'service_snapshot','label':'Service\x20snapshot','gloss':'g','required':!![],'state':'present','facts':[]}],'unverified':[],'vocabulary':{'present':'p','empty':'e','gap':'g','unverified':'u','completeness':'c'}},b=buildDataSemantic({},{'operation_type':'service','data':BUY_DATA,'evaluation':a}),c=b?.['customer_advice'];expect(c)['toBeDefined'](),expect(c['reminders'])['toHaveLength'](0x1),expect(c['reminders'][0x0]['priority'])['toBe']('info'),expect(c['reminders'][0x0]['message'])['toContain']('No\x20adverse\x20findings\x20in\x20the\x20graph\x20evaluation\x20—\x20Service\x20trust\x2092/100\x20(low)\x20—\x20Service\x20risk\x20100/100\x20(low)');}),it('customer_intelligence\x20disabled\x20→\x20advice\x20never\x20populates',()=>{setEnabled('customer_intelligence',![]);const a=buildDataSemantic({},{'operation_type':'service','data':BUY_DATA,'evaluation':fixtureEvaluation()});expect(a?.['customer_advice'])['toBeUndefined']();}),it('no\x20heuristic\x20leakage:\x20reminder\x20text\x20never\x20falls\x20back\x20to\x20the\x20retired\x20reminder\x20table',()=>{const a=buildDataSemantic({},{'operation_type':'service','data':BUY_DATA,'evaluation':fixtureEvaluation()}),b=JSON['stringify'](a?.['customer_advice']);expect(b)['not']['toContain']('Require\x20the\x20merchant\x20to\x20configure\x20an\x20Arbitration\x20service\x20before\x20placing\x20the\x20order'),expect(b)['not']['toContain']('Require\x20the\x20merchant\x20to\x20set\x20a\x20compensation_fund\x20to\x20guarantee');});});
1
+ import{afterEach,describe,expect,it}from'vitest';import{setEnabled,reset}from'../../config/runtime.js';import{buildDataSemantic,buildSemantic}from'./semantic.js';function trustResult(){return{'evaluation_id':'graph_service_trust','total':0x2b,'level':'high','breakdown':[{'rule_id':'trust_arbitration','dimension':'trust','score':0x0,'weight':0x14,'reason':'No\x20arbitration\x20binding\x20configured\x20(verified\x20absence)\x20—\x20binding\x20table\x20empty','mismatched':['arbitration_binding']},{'rule_id':'trust_fund_safety','dimension':'trust','score':0x28,'weight':0xf,'reason':'Fund\x20safety\x206/15\x20—\x20Compensation\x20fund\x200\x20base\x20units','mismatched':['no\x20compensation\x20fund']},{'rule_id':'trust_reviews','dimension':'trust','score':0x32,'weight':0x23,'reason':'No\x20reputation\x20signal\x20(verified\x20empty\x20window)\x20—\x200\x20votes'}],'red_flags':['service\x20paused\x20by\x20merchant'],'blocked':!![],'trace':[],'summary':'Service\x20trust\x2043/100\x20(high)\x20—\x20weakest\x20trust_arbitration\x200/100\x20—\x20binding\x20table\x20empty','unverified':[]};}function riskResult(){return{'evaluation_id':'graph_service_risk','total':0x41,'level':'medium_high','breakdown':[{'rule_id':'risk_workflow','dimension':'workflow','score':0x4e,'weight':0x23,'reason':'1\x20structural\x20finding(s):\x20[high]\x20Forward\x20sink\x20—\x20analyzer\x20findings','mismatched':['wf_sink']}],'red_flags':[],'blocked':![],'trace':[],'summary':'Service\x20risk\x2065/100\x20(medium_high)\x20—\x20weakest\x20risk_workflow\x2078/100\x20—\x201\x20structural\x20finding(s)','unverified':[]};}function fixtureEvaluation(){return{'target':'0xsvc','trust':trustResult(),'risk':riskResult(),'completeness':0x56,'coverage':[{'slot':'service_snapshot','label':'Service\x20snapshot','gloss':'g','required':!![],'state':'present','facts':[]},{'slot':'reviews','label':'Review\x20votes','gloss':'g','required':![],'state':'empty','facts':[]},{'slot':'machine_workflow','label':'Workflow','gloss':'g','required':!![],'state':'gap','facts':[]}],'unverified':['trust_reviews'],'vocabulary':{'present':'p','empty':'e','gap':'g','unverified':'u','completeness':'c'}};}const BUY_DATA={'object':'0xsvc','order_new':{'buy':{'items':[],'total_pay':{'balance':'1'}}}};afterEach(()=>{reset('customer_intelligence');}),describe('Task\x2021\x20—\x20customer_advice\x20projects\x20the\x20graph\x20evaluation\x20(TR-21.1)',()=>{it('preorder\x20advice:\x20findings\x20text\x20cites\x20the\x20breakdown\x20evidence,\x20red\x20flag\x20at\x20required\x20priority',()=>{const a=buildDataSemantic({},{'operation_type':'service','data':BUY_DATA,'evaluation':fixtureEvaluation()}),b=a?.['customer_advice'];expect(b)['toBeDefined'](),expect(b['risk_score'])['toBe'](0x41),expect(b['risk_level'])['toBe']('medium_high');const c=b['reminders']['filter'](i=>i['priority']==='required');expect(c)['toHaveLength'](0x1),expect(c[0x0]['stage'])['toBe']('preorder'),expect(c[0x0]['message'])['toContain']('Pre-payment\x20advisory\x20(the\x20gate\x20does\x20not\x20stop\x20the\x20payment)'),expect(c[0x0]['message'])['toContain']('service\x20paused\x20by\x20merchant');const d=b['reminders']['filter'](i=>i['priority']==='recommended'),e=d['map'](i=>i['message'])['join']('\x20|\x20');expect(e)['toContain']('Arbitration\x200/100\x20—\x20No\x20arbitration\x20binding\x20configured\x20(verified\x20absence)'),expect(e)['toContain']('missing/unmet:\x20arbitration_binding'),expect(e)['toContain']('Fund\x20safety\x206/15\x20—\x20Compensation\x20fund\x200\x20base\x20units'),expect(e)['toContain']('1\x20structural\x20finding(s):\x20[high]\x20Forward\x20sink'),expect(d[0x0]['message'])['toContain']('Arbitration\x200/100');const f=b['reminders']['map'](i=>i['message'])['join']('\x20|\x20');expect(f)['toContain']('Unverifiable\x20dimensions\x20(excluded\x20from\x20the\x20score\x20due\x20to\x20fetch\x20gaps):\x20Reputation'),expect(f)['toContain']('treat\x20them\x20as\x20unknown,\x20not\x20as\x20passed'),expect(f)['toContain']('Coverage\x20gap:\x20required\x20material\x20\x22machine_workflow\x22'),expect(f)['not']['toContain']('\x22reviews\x22'),expect(b['recommendations'])['toContain']('Resolve\x20the\x20red\x20flags\x20with\x20the\x20merchant\x20or\x20pick\x20another\x20service\x20before\x20paying');const g=b['recommendations']['filter'](i=>i['includes']('below\x20your\x20risk\x20appetite'));expect(g)['toHaveLength'](0x1),expect(g[0x0])['toContain']('Trust\x2043/100\x20is\x20below\x20your\x20risk\x20appetite\x20(50)'),expect(g[0x0])['toContain']('Service\x20trust\x2043/100\x20(high)');const h=b['reminders']['map'](i=>i['priority']);expect(h['indexOf']('required'))['toBeLessThan'](h['indexOf']('recommended')),expect(h['lastIndexOf']('info'))['toBeGreaterThan'](h['lastIndexOf']('recommended'));}),it('browse\x20advice:\x20reuses\x20the\x20evaluation\x20embedded\x20in\x20the\x20response\x20envelope\x20(no\x20threading)',()=>{const a=buildDataSemantic({'evaluation':fixtureEvaluation()},{'operation_type':'query_toolkit','data':{}}),b=a?.['customer_advice'];expect(b)['toBeDefined'](),expect(b['reminders']['every'](c=>c['stage']==='browse'))['toBe'](!![]),expect(b['reminders']['map'](c=>c['message'])['join']('\x20'))['toContain']('service\x20paused\x20by\x20merchant'),expect(b['reminders']['map'](c=>c['message'])['join']('\x20'))['not']['toContain']('Blocked:');}),it('executed\x20order:\x20red\x20flags\x20become\x20a\x20post-hoc\x20advisory,\x20never\x20\x27Blocked\x27\x20(docs#45)',()=>{const a={'kind':'transaction','executed':!![],'digest':'0xdigest','objectChanges':[],'created':[],'modified':[],'events':[],'balanceChanges':[],'raw':{}},b=buildSemantic(a,{'operation_type':'service','data':BUY_DATA,'evaluation':fixtureEvaluation()}),c=b?.['customer_advice'];expect(c)['toBeDefined']();const d=c['reminders']['filter'](e=>e['priority']==='required');expect(d)['toHaveLength'](0x1),expect(d[0x0]['message'])['toContain']('the\x20order\x20already\x20executed'),expect(d[0x0]['message'])['toContain']('service\x20paused\x20by\x20merchant'),expect(c['reminders']['map'](e=>e['message'])['join']('\x20'))['not']['toContain']('Blocked:');}),it('no\x20evaluation\x20→\x20no\x20advice\x20(order\x20ops,\x20bare\x20service\x20ops,\x20unevaluated\x20queries)',()=>{expect(buildDataSemantic({},{'operation_type':'order','data':{'object':'0xorder'}})?.['customer_advice'])['toBeUndefined'](),expect(buildDataSemantic({},{'operation_type':'service','data':{'object':'0xsvc'}})?.['customer_advice'])['toBeUndefined'](),expect(buildDataSemantic({},{'operation_type':'query_toolkit','data':{}})?.['customer_advice'])['toBeUndefined']();}),it('clean\x20evaluation:\x20a\x20single\x20info\x20reminder\x20cites\x20both\x20measured\x20summaries',()=>{const a={'target':'0xsvc','trust':{'evaluation_id':'graph_service_trust','total':0x5c,'level':'low','breakdown':[{'rule_id':'trust_arbitration','dimension':'trust','score':0x64,'weight':0x14,'reason':'Arbitration\x2020/20\x20—\x20binding\x20active'}],'red_flags':[],'blocked':![],'trace':[],'summary':'Service\x20trust\x2092/100\x20(low)','unverified':[]},'risk':{'evaluation_id':'graph_service_risk','total':0x64,'level':'low','breakdown':[{'rule_id':'risk_workflow','dimension':'workflow','score':0x64,'weight':0x23,'reason':'No\x20structural\x20risk\x20fired\x20—\x20clean\x20findings'}],'red_flags':[],'blocked':![],'trace':[],'summary':'Service\x20risk\x20100/100\x20(low)','unverified':[]},'completeness':0x64,'coverage':[{'slot':'service_snapshot','label':'Service\x20snapshot','gloss':'g','required':!![],'state':'present','facts':[]}],'unverified':[],'vocabulary':{'present':'p','empty':'e','gap':'g','unverified':'u','completeness':'c'}},b=buildDataSemantic({},{'operation_type':'service','data':BUY_DATA,'evaluation':a}),c=b?.['customer_advice'];expect(c)['toBeDefined'](),expect(c['reminders'])['toHaveLength'](0x1),expect(c['reminders'][0x0]['priority'])['toBe']('info'),expect(c['reminders'][0x0]['message'])['toContain']('No\x20adverse\x20findings\x20in\x20the\x20graph\x20evaluation\x20—\x20Service\x20trust\x2092/100\x20(low)\x20—\x20Service\x20risk\x20100/100\x20(low)');}),it('customer_intelligence\x20disabled\x20→\x20advice\x20never\x20populates',()=>{setEnabled('customer_intelligence',![]);const a=buildDataSemantic({},{'operation_type':'service','data':BUY_DATA,'evaluation':fixtureEvaluation()});expect(a?.['customer_advice'])['toBeUndefined']();}),it('no\x20heuristic\x20leakage:\x20reminder\x20text\x20never\x20falls\x20back\x20to\x20the\x20retired\x20reminder\x20table',()=>{const a=buildDataSemantic({},{'operation_type':'service','data':BUY_DATA,'evaluation':fixtureEvaluation()}),b=JSON['stringify'](a?.['customer_advice']);expect(b)['not']['toContain']('Require\x20the\x20merchant\x20to\x20configure\x20an\x20Arbitration\x20service\x20before\x20placing\x20the\x20order'),expect(b)['not']['toContain']('Require\x20the\x20merchant\x20to\x20set\x20a\x20compensation_fund\x20to\x20guarantee');});});
@@ -9,7 +9,18 @@ export interface SemanticContext {
9
9
  operation_id?: string;
10
10
  pre_warnings?: string[];
11
11
  schema_check?: import("../schema-version.js").SchemaCheckResult;
12
+ response_level?: "compact" | "full";
12
13
  evaluation?: GraphServiceEvaluation;
14
+ passport_test?: {
15
+ passport_id?: string;
16
+ result?: boolean;
17
+ has_verified?: boolean;
18
+ info?: {
19
+ guard: string;
20
+ result: boolean;
21
+ impack?: boolean;
22
+ }[];
23
+ };
13
24
  }
14
25
  export type ErrorCode = ErrorCodeValue;
15
26
  export interface MoveAbortInfo {