@wowok/agent-mcp 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/evaluation/arbitration-game.js +1 -1
- package/dist/evaluation/location-match.js +1 -1
- package/dist/goal/GoalClassifier.js +1 -1
- package/dist/graph/onchain/analyze.d.ts +3 -3
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/analyze.spec.js +1 -1
- package/dist/graph/onchain/edge-schema.d.ts +1 -1
- package/dist/graph/onchain/edge-schema.js +1 -1
- package/dist/graph/onchain/interest.js +1 -1
- package/dist/graph/onchain/sdk-dataplane.js +1 -1
- package/dist/graph/onchain/types.d.ts +5 -5
- package/dist/harness/verify.js +1 -1
- package/dist/knowledge/allocation-ledger.d.ts +2 -0
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocation-puzzle.js +1 -1
- package/dist/knowledge/allocation-risk.d.ts +2 -1
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-field-cognition.d.ts +48 -0
- package/dist/knowledge/guard-field-cognition.js +1 -0
- package/dist/knowledge/index.d.ts +1 -0
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/recipient-constraint.d.ts +6 -1
- package/dist/knowledge/recipient-constraint.js +1 -1
- package/dist/knowledge/service-allocator-audit-node.d.ts +3 -0
- package/dist/knowledge/service-allocator-audit-node.js +1 -0
- package/dist/knowledge/service-risk-node.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +2 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/persona/strategy-intent.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/intent-analyzer.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/risk-aggregator.js +1 -1
- package/dist/playbooks/service-build/topology-query.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/safety/preview.js +1 -1
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/operations.d.ts +2 -0
- package/dist/schema/query/bi.d.ts +16 -14
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +9 -9
- package/dist/schemas/account_operation.schema.json +3 -3
- package/dist/schemas/bridge_operation.output.json +9 -9
- package/dist/schemas/evaluation_operation.output.json +6 -6
- package/dist/schemas/evaluation_operation.schema.json +5 -5
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/keeper_operation.output.json +9 -9
- package/dist/schemas/local_history_operation.output.json +9 -9
- package/dist/schemas/local_info_operation.output.json +9 -9
- package/dist/schemas/local_mark_operation.output.json +9 -9
- package/dist/schemas/messenger_operation.output.json +9 -9
- package/dist/schemas/monitor_events.output.json +9 -9
- package/dist/schemas/monitor_subscription.output.json +9 -9
- package/dist/schemas/onchain_events.output.json +10 -10
- package/dist/schemas/onchain_operations.output.json +9 -9
- package/dist/schemas/onchain_operations.schema.json +46 -46
- package/dist/schemas/onchain_operations_allocation.schema.json +5 -5
- package/dist/schemas/onchain_operations_arbitration.schema.json +3 -3
- package/dist/schemas/onchain_operations_contact.schema.json +2 -2
- package/dist/schemas/onchain_operations_demand.schema.json +2 -2
- package/dist/schemas/onchain_operations_machine.schema.json +2 -2
- package/dist/schemas/onchain_operations_order.schema.json +2 -2
- package/dist/schemas/onchain_operations_payment.schema.json +2 -2
- package/dist/schemas/onchain_operations_permission.schema.json +2 -2
- package/dist/schemas/onchain_operations_progress.schema.json +2 -2
- package/dist/schemas/onchain_operations_repository.schema.json +2 -2
- package/dist/schemas/onchain_operations_reward.schema.json +6 -6
- package/dist/schemas/onchain_operations_service.schema.json +8 -8
- package/dist/schemas/onchain_operations_treasury.schema.json +8 -8
- package/dist/schemas/onchain_table_data.output.json +17 -13
- package/dist/schemas/query_toolkit.output.json +47 -47
- package/dist/schemas/query_toolkit.schema.json +6 -2
- package/dist/strategy/collectors.js +1 -1
- package/dist/task/playbook.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/evaluation.spec.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/registry/monitor.js +1 -1
- package/dist/tools/shared.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as a334a from'@wowok/wowok';const SDK_SCHEMA_VERSION=a334a['SCHEMA_VERSION']??'1.0.0',checkSchemaCompatibility=a334a['checkSchemaCompatibility']??((a,b)=>({'compatible':!![]}));export const MCP_SCHEMA_VERSION='1.0.0';export function getSchemaVersions(){return{'sdk':SDK_SCHEMA_VERSION,'mcp':MCP_SCHEMA_VERSION};}export function checkClientSchemaCompatibility(a,b={}){const c=getSchemaVersions(),d={'compatible':!![],'warnings':[],'errors':[],'versions':c,'client_version':a};if(!a)return d;const e=checkSchemaCompatibility(a,c['sdk']);if(!e['compatible']){d['compatible']=![];const g='SDK\x20schema\x20incompatibility:\x20'+e['reason'];b['mode']==='strict'?d['errors']['push'](g):d['warnings']['push'](g);}const f=checkSchemaCompatibility(a,c['mcp']);if(!f['compatible']){d['compatible']=![];const h='MCP\x20schema\x20incompatibility:\x20'+f['reason'];b['mode']==='strict'?d['errors']['push'](h):d['warnings']['push'](h);}return d;}export function attachSchemaWarning(a,b){if(b['warnings']['length']===0x0&&b['errors']['length']===0x0)return a;const c=[];b['warnings']['length']>0x0&&c['push'](...b['warnings']);b['errors']['length']>0x0&&c['push'](...b['errors']);const d=a['semantic']?{...a['semantic'],'warnings':[...a['semantic']['warnings']||[],...c]}:undefined;return{...a,'semantic':d,'schema_warning':{'compatible':b['compatible'],'warnings':c,'client_version':b['client_version'],'server_versions':b['versions']}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFileSync,existsSync,writeFileSync,mkdirSync}from'fs';import{resolve,join,dirname}from'path';import{fileURLToPath}from'url';import{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence}from'../knowledge/tools-reference.js';import{GUARD_DESIGN_PATTERNS,getGuardDesignPattern,GUARD_DESIGN_PATTERNS_VERSION}from'../knowledge/guard-design-patterns.js';import{OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,NAMING_CONVENTIONS,SAFETY_RULES_VERSION}from'../knowledge/safety-rules.js';import{listTemplates as a344a,getTemplateDetail,instantiateTemplate,getTemplateCounts,TEMPLATE_OBJECT_TYPES}from'../knowledge/template-registry.js';import{lintGuard,formatLintResult}from'../knowledge/guard-lint.js';import{renderGuardTreeIndented,renderGuardMermaid,walkGuardTree}from'../knowledge/guard-render.js';const __filename=fileURLToPath(import.meta.url),__dirname=fileURLToPath(new URL('.',import.meta.url)),SCHEMAS_DIR=resolve(__dirname,'../../dist/schemas'),GUARD_TEMPLATES_PATH_SCRIPTS=resolve(__dirname,'../../scripts/guard-templates.json'),GUARD_TEMPLATES_PATH_DIST=resolve(__dirname,'../../dist/schemas/guard-templates.json'),GUARD_TEMPLATES_PATH=existsSync(GUARD_TEMPLATES_PATH_SCRIPTS)?GUARD_TEMPLATES_PATH_SCRIPTS:GUARD_TEMPLATES_PATH_DIST,WORKSPACE_TMP_DIR=resolve(process['cwd'](),'.trae','tmp');export function areSchemasAvailable(){return existsSync(SCHEMAS_DIR)&&existsSync(join(SCHEMAS_DIR,'index.json'));}export function getSchemaIndex(){try{const a=join(SCHEMAS_DIR,'index.json');if(!existsSync(a))return null;const b=readFileSync(a,'utf-8');return JSON['parse'](b);}catch{return null;}}export function listSchemas(){const a=getSchemaIndex();if(!a)return[];return[...a['tools']||[],...a['operations']||[]];}export function getSchema(a){try{let b=join(SCHEMAS_DIR,a+'.schema.json');!existsSync(b)&&(b=join(SCHEMAS_DIR,a+'.json'));if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}export function getOutputSchema(a){try{const b=join(SCHEMAS_DIR,a+'.output.json');if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}export function getGuardTemplates(a){try{if(!existsSync(GUARD_TEMPLATES_PATH))return null;const b=readFileSync(GUARD_TEMPLATES_PATH,'utf-8'),c=JSON['parse'](b);if(!a)return{'version':c['version'],'description':c['description'],'templates':(c['templates']||[])['map'](e=>({'name':e['name'],'title':e['title'],'description':e['description'],'use_case':e['use_case']})),'query_reference':c['query_reference'],'node_return_types':c['node_return_types']};const d=(c['templates']||[])['find'](e=>e['name']===a);if(!d)return null;return d;}catch{return null;}}export function getSchemaField(a,b){const c=getSchema(a);if(!c)return null;const d=b['split']('.')['filter'](Boolean);let e=c;for(const f of d){if(!e||typeof e!=='object')return null;if(e['properties']&&f in e['properties']){e=e['properties'][f];continue;}if(e['items']&&typeof e['items']==='object'){if(/^\d+$/['test'](f)){e=e['items'];continue;}if(e['items']['properties']&&f in e['items']['properties']){e=e['items']['properties'][f];continue;}}if(Array['isArray'](e['oneOf'])||Array['isArray'](e['anyOf'])){const g=e['oneOf']??e['anyOf'];for(const h of g){if(h&&typeof h==='object'&&h['properties']&&f in h['properties']){e=h['properties'][f];break;}}continue;}if(f in e){e=e[f];continue;}return null;}return e;}function resolveSchemaRefs(a,b=new Set()){if(!a||typeof a!=='object')return a;if(Array['isArray'](a))return a['map'](d=>resolveSchemaRefs(d,b));const c={};for(const [d,e]of Object['entries'](a)){if(d==='$ref'&&typeof e==='string'){if(e['startsWith']('#'))c[d]=e;else{const f=loadRefSchema(e,b);f&&Object['assign'](c,resolveSchemaRefs(f,b));}}else typeof e==='object'?c[d]=resolveSchemaRefs(e,b):c[d]=e;}return c;}function loadRefSchema(a,b){if(a['startsWith']('#'))return null;if(b['has'](a))return{'description':'Circular\x20reference\x20to\x20'+a};b['add'](a);try{const c=join(SCHEMAS_DIR,a);if(!existsSync(c))return null;const d=readFileSync(c,'utf-8');return JSON['parse'](d);}catch{return null;}}export function searchSchemas(a){const b=listSchemas(),c=a['toLowerCase']();return b['filter'](d=>{const e=d['name']['toLowerCase']()['includes'](c),f=d['title']?.['toLowerCase']()['includes'](c),g=d['description']?.['toLowerCase']()['includes'](c);return e||f||g;});}export function listOperations(){const a=getSchemaIndex();if(!a)return[];return(a['operations']||[])['filter'](b=>b['name']['startsWith']('onchain_operations_'));}function writeResponseToFile(a,b){try{let c;if(b)c=resolve(process['cwd'](),b);else{!existsSync(WORKSPACE_TMP_DIR)&&mkdirSync(WORKSPACE_TMP_DIR,{'recursive':!![]});const g=Date['now']();c=join(WORKSPACE_TMP_DIR,'schema-'+g+'.json');}const d=dirname(c);!existsSync(d)&&mkdirSync(d,{'recursive':!![]});const f=typeof a==='string'?a:JSON['stringify'](a,null,0x2);return writeFileSync(c,f,'utf-8'),c;}catch(h){return null;}}export function processSchemaQuery(a){const {action:b,name:c,query:d,field_path:f,template:g,output_file:h,object_type:i,params:j}=a;if(b==='get_guard_templates'){const k=getGuardTemplates(g);if(!k)return{'success':![],'action':b,'data':null,'message':g?'Guard\x20template\x20\x27'+g+'\x27\x20not\x20found.\x20Omit\x20\x27template\x27\x20to\x20list\x20all\x20available\x20templates.':'Guard\x20templates\x20file\x20not\x20found.\x20Ensure\x20scripts/guard-templates.json\x20exists.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20available\x20templates.','Available\x20template\x20names:\x20signer_verification,\x20progress_node_check,\x20order_owner_verification,\x20service_belonging_check,\x20reward_not_claimed,\x20combined_reward_guard']};if(h){const l=writeResponseToFile(k,h);if(l)return{'success':!![],'action':b,'data':null,'message':'Guard\x20template'+(g?'\x20\x27'+g+'\x27':'s')+'\x20written\x20to\x20file:\x20'+l,'output_file_path':l,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+l]};}return{'success':!![],'action':b,'data':k,'message':g?'Retrieved\x20Guard\x20template:\x20'+g:'Retrieved\x20'+(Array['isArray'](k['templates'])?k['templates']['length']:0x0)+'\x20Guard\x20templates'};}if(b==='get_templates'){if(!g){const p=a344a(i),q=getTemplateCounts(),r={'total':p['length'],'filter':i??null,'counts_by_object_type':q,'templates':p};if(h){const s=writeResponseToFile(r,h);if(s)return{'success':!![],'action':b,'data':null,'message':p['length']+'\x20templates\x20written\x20to\x20file:\x20'+s,'output_file_path':s,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+s]};}return{'success':!![],'action':b,'data':r,'message':p['length']+'\x20template(s)'+(i?'\x20for\x20object_type=\x27'+i+'\x27':'')+'\x20'+('(total\x20registry:\x20'+Object['values'](q)['reduce']((t,u)=>t+u,0x0)+'\x20across\x20'+TEMPLATE_OBJECT_TYPES['length']+'\x20object\x20types).\x20')+'Provide\x20\x27template\x27\x20(id)\x20for\x20full\x20detail;\x20add\x20\x27params\x27\x20(JSON\x20string)\x20to\x20instantiate.'};}if(!j){const t=getTemplateDetail(g);if(!t)return{'success':![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20not\x20found\x20in\x20the\x20unified\x20registry.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20template\x20metadata\x20(id\x20+\x20object_type\x20+\x20parameters).','Filter\x20by\x20object_type:\x20'+TEMPLATE_OBJECT_TYPES['join'](',\x20')]};if(h){const u=writeResponseToFile(t,h);if(u)return{'success':!![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20detail\x20written\x20to\x20file:\x20'+u,'output_file_path':u,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+u]};}return{'success':!![],'action':b,'data':t,'message':'Template\x20\x27'+g+'\x27\x20('+t['object_type']+',\x20'+(t['instantiable']?'instantiable':'guidance-only')+').\x20'+'To\x20instantiate,\x20call\x20again\x20with\x20\x27params\x27\x20=\x20JSON\x20object\x20of\x20the\x20declared\x20parameters.'};}let m;try{const v=JSON['parse'](j);if(!v||typeof v!=='object'||Array['isArray'](v))return{'success':![],'action':b,'data':null,'message':'\x27params\x27\x20must\x20be\x20a\x20JSON\x20object\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27),\x20got\x20'+(Array['isArray'](v)?'array':typeof v)+'.'};m=v;}catch(w){return{'success':![],'action':b,'data':null,'message':'Failed\x20to\x20parse\x20\x27params\x27\x20as\x20JSON:\x20'+(w instanceof Error?w['message']:String(w)),'suggestions':['Example:\x20params=\x27{\x22whitelist\x22:[\x220xabc...\x22]}\x27']};}const n=instantiateTemplate(g,m);if(!n['ok'])return{'success':![],'action':b,'data':n['guidance']!==undefined?{'guidance':n['guidance']}:null,'message':'Instantiation\x20failed\x20for\x20\x27'+g+'\x27:\x20'+n['error'],'suggestions':n['missing_params']?['Missing\x20required\x20params:\x20'+n['missing_params']['join'](',\x20'),'Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']:['Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']};const o={'object_type':n['object_type'],'template_id':n['template_id'],'body':n['body'],...n['notes']?{'notes':n['notes']}:{}};if(h){const x=writeResponseToFile(o,h);if(x)return{'success':!![],'action':b,'data':null,'message':'Instantiated\x20template\x20\x27'+g+'\x27\x20written\x20to\x20file:\x20'+x,'output_file_path':x,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+x]};}return{'success':!![],'action':b,'data':o,'message':'Instantiated\x20\x27'+g+'\x27\x20('+n['object_type']+').\x20'+'Review\x20the\x20body\x20against\x20the\x20onchain_operations\x20schema\x20before\x20submitting.'};}if(b==='get_tool_reference'){if(c){const z=getToolReference(c);if(!z)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found\x20in\x20the\x20tool\x20reference.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20all\x20tools.','Available\x20tools:\x20'+TOOLS_REFERENCE['map'](B=>B['name'])['join'](',\x20')]};const A=getToolSequence(c);return{'success':!![],'action':b,'data':{'tool':z,'call_sequence':A??null},'message':'Retrieved\x20tool\x20reference:\x20'+c};}if(d){const B=searchToolReference(d);return{'success':!![],'action':b,'data':{'tools':B,'count':B['length']},'message':'Found\x20'+B['length']+'\x20tool(s)\x20matching\x20\x27'+d+'\x27','suggestions':B['length']===0x0?['Try\x20a\x20broader\x20keyword\x20(e.g.\x20\x27onchain\x27,\x20\x27guard\x27,\x20\x27schema\x27),\x20or\x20omit\x20\x27query\x27\x20to\x20list\x20all\x20tools.']:undefined};}const y=TOOLS_REFERENCE['map'](C=>({'name':C['name'],'summary':C['summary'],'actions':C['actions']??[],'notes':C['notes']??[]}));return{'success':!![],'action':b,'data':{'tools':y,'count':y['length']},'message':'Retrieved\x20reference\x20for\x20'+y['length']+'\x20MCP\x20tools.\x20Pass\x20name=\x27<tool>\x27\x20for\x20full\x20detail\x20(params,\x20prerequisites,\x20follow-ups).'};}if(b==='get_guard_design_patterns'){if(c){const D=getGuardDesignPattern(c);if(!D)return{'success':![],'action':b,'data':null,'message':'Guard\x20design\x20pattern\x20\x27'+c+'\x27\x20not\x20found.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20the\x20full\x20catalog.','Available\x20pattern\x20ids:\x20'+GUARD_DESIGN_PATTERNS['map'](E=>E['id'])['join'](',\x20')]};return{'success':!![],'action':b,'data':{'pattern':D},'message':'Retrieved\x20Guard\x20design\x20pattern:\x20'+c};}if(d){const E=GUARD_DESIGN_PATTERNS['filter'](G=>G['host']===d),F=E['length']>0x0?E:GUARD_DESIGN_PATTERNS['filter'](G=>G['business_requirement']['toLowerCase']()['includes'](d['toLowerCase']())||G['logic_summary']['toLowerCase']()['includes'](d['toLowerCase']()));return{'success':!![],'action':b,'data':{'patterns':F,'count':F['length'],'filtered_by':E['length']>0x0?'host':'keyword'},'message':'Found\x20'+F['length']+'\x20Guard\x20design\x20pattern(s)\x20matching\x20\x27'+d+'\x27','suggestions':F['length']===0x0?['Filter\x20by\x20host:\x20service_buy_guard,\x20service_allocator_guard,\x20machine_forward,\x20progress_submission,\x20reward_claim,\x20repository_write,\x20arbitration_usage,\x20arbitration_voting,\x20gen_passport']:undefined};}const C=GUARD_DESIGN_PATTERNS['map'](G=>({'id':G['id'],'business_requirement':G['business_requirement'],'host':G['host'],'data_source':G['data_source'],'verifier_level':G['verifier_level'],'logic_summary':G['logic_summary'],'key_queries':G['key_queries'],'notes':G['notes']??[]}));return{'success':!![],'action':b,'data':{'patterns':C,'count':C['length'],'version':GUARD_DESIGN_PATTERNS_VERSION},'message':'Retrieved\x20'+C['length']+'\x20Guard\x20design\x20patterns.\x20Pass\x20name=\x27<pattern_id>\x27\x20for\x20full\x20detail\x20(witness\x20types,\x20mitigated\x20risks,\x20industries).'};}if(b==='get_safety_rules')return{'success':!![],'action':b,'data':{'version':SAFETY_RULES_VERSION,'object_reuse_rules':OBJECT_REUSE_RULES,'create_vs_modify_pattern':CREATE_VS_MODIFY_PATTERN,'immutability_rules':IMMUTABILITY_RULES,'operation_type_classification':OPERATION_TYPE_CLASSIFICATION,'operation_class_meta':OPERATION_CLASS_META,'naming_conventions':NAMING_CONVENTIONS},'message':'Retrieved\x20safety\x20rule\x20tables\x20(reuse\x20/\x20immutability\x20/\x20operation\x20classification\x20/\x20naming).\x20'+'Key\x20points:\x20prefer\x20REUSING\x20existing\x20objects\x20(string\x20reference\x20=\x20reuse,\x20object\x20shape\x20=\x20create);\x20'+'Machine\x20publish\x20locks\x20nodes/pairs/forwards,\x20Service\x20publish\x20locks\x20machine/order_allocators/arbitrations\x20(sales\x20stays\x20mutable);\x20'+'Guard\x20is\x20CREATE-only\x20immutable;\x20on-chain\x20writes\x20require\x20explicit\x20user\x20confirmation.'};if(!areSchemasAvailable())return{'success':![],'action':b,'data':null,'message':'Schema\x20files\x20are\x20not\x20available.\x20Please\x20run\x20\x27npm\x20run\x20generate:schemas\x27\x20first.','suggestions':['Run\x20\x27npm\x20run\x20generate:schemas\x27\x20to\x20generate\x20schema\x20files','Ensure\x20the\x20dist/schemas\x20directory\x20exists']};switch(b){case'list':{const G=listSchemas();return{'success':!![],'action':b,'data':G,'message':'Found\x20'+G['length']+'\x20available\x20schemas'};}case'get':{if(!c)return{'success':![],'action':b,'data':null,'message':'Schema\x20name\x20is\x20required\x20for\x20\x27get\x27\x20action','suggestions':['Provide\x20a\x20schema\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};const H=getSchema(c);if(!H){const I=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20not\x20found','suggestions':I['length']>0x0?I['map'](J=>'Did\x20you\x20mean:\x20'+J['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};}if(h){const J=writeResponseToFile(H,h);if(J)return{'success':!![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+J,'output_file_path':J,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+J]};}return{'success':!![],'action':b,'data':H,'message':'Retrieved\x20schema:\x20'+c};}case'get_field':{if(!c||!f)return{'success':![],'action':b,'data':null,'message':'Both\x20\x27name\x27\x20and\x20\x27field_path\x27\x20are\x20required\x20for\x20\x27get_field\x27\x20action','suggestions':['Example:\x20{action:\x20\x27get_field\x27,\x20name:\x20\x27onchain_operations_machine\x27,\x20field_path:\x20\x27data.node\x27}','Use\x20\x27get\x27\x20action\x20to\x20retrieve\x20the\x20full\x20schema']};const K=getSchemaField(c,f);if(!K)return{'success':![],'action':b,'data':null,'message':'Field\x20path\x20\x27'+f+'\x27\x20not\x20found\x20in\x20schema\x20\x27'+c+'\x27','suggestions':['Check\x20the\x20field\x20path\x20(dot-separated,\x20e.g.\x20\x27data.node\x27)','Use\x20\x27get\x27\x20action\x20to\x20see\x20the\x20full\x20schema\x20structure']};return{'success':!![],'action':b,'data':K,'message':'Retrieved\x20field\x20\x27'+f+'\x27\x20from\x20schema\x20\x27'+c+'\x27'};}case'search':{if(!d)return{'success':![],'action':b,'data':null,'message':'Search\x20query\x20is\x20required\x20for\x20\x27search\x27\x20action'};const L=searchSchemas(d);return{'success':!![],'action':b,'data':L,'message':'Found\x20'+L['length']+'\x20schemas\x20matching\x20\x27'+d+'\x27'};}case'list_operations':{const M=listOperations();return{'success':!![],'action':b,'data':M,'message':'Found\x20'+M['length']+'\x20on-chain\x20operations'};}case'get_output':{if(!c)return{'success':![],'action':b,'data':null,'message':'Tool\x20name\x20is\x20required\x20for\x20\x27get_output\x27\x20action','suggestions':['Provide\x20a\x20tool\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools\x20and\x20their\x20outputPath']};const N=getOutputSchema(c);if(!N){const O=listSchemas(),P=O['find'](R=>R['name']===c);if(P)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20exists\x20but\x20has\x20no\x20output\x20schema\x20file.\x20The\x20tool\x20may\x20not\x20declare\x20an\x20outputSchema,\x20or\x20the\x20schema\x20file\x20was\x20not\x20generated.','suggestions':['Use\x20\x27get\x27\x20action\x20with\x20name=\x27'+c+'\x27\x20to\x20retrieve\x20its\x20input\x20schema']};const Q=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found','suggestions':Q['length']>0x0?Q['map'](R=>'Did\x20you\x20mean:\x20'+R['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools']};}if(h){const R=writeResponseToFile(N,h);if(R)return{'success':!![],'action':b,'data':null,'message':'Output\x20schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+R,'output_file_path':R,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+R]};}return{'success':!![],'action':b,'data':N,'message':'Retrieved\x20output\x20schema:\x20'+c};}default:return{'success':![],'action':b,'data':null,'message':'Unknown\x20action:\x20'+b,'suggestions':['Use\x20\x27list\x27,\x20\x27get\x27,\x20\x27get_field\x27,\x20\x27get_output\x27,\x20\x27search\x27,\x20\x27list_operations\x27,\x20\x27get_guard_templates\x27,\x20\x27get_tool_reference\x27,\x20\x27get_guard_design_patterns\x27,\x20\x27get_safety_rules\x27,\x20\x27get_templates\x27,\x20or\x20\x27analyze_guard_semantics\x27']};}}const GUARD_SEMANTICS_READING_CHECKLIST=['WHO\x20can\x20satisfy\x20this\x20Guard\x20(identity:\x20Signer\x20bindings,\x20Entity\x20membership,\x20allowlists)?','WHEN\x20can\x20it\x20be\x20satisfied\x20(time:\x20Clock\x20comparisons,\x20deadlines,\x20windows)?','WHAT\x20evidence\x20must\x20the\x20caller\x20submit\x20(b_submission\x20table\x20entries\x20—\x20Payment/Order/Proof\x20objects)?','WHICH\x20on-chain\x20data\x20does\x20it\x20read,\x20and\x20can\x20that\x20data\x20change\x20(Repository\x20entries\x20are\x20MUTABLE\x20—\x20who\x20controls\x20the\x20writes)?','WHAT\x20does\x20the\x20counterparty\x20gain/lose\x20in\x20each\x20branch\x20of\x20the\x20logic\x20tree?','ARE\x20there\x20error-level\x20diagnostics\x20or\x20critical\x20risks\x20(they\x20block\x20or\x20endanger\x20execution)?'];export async function analyzeGuardSemantics(a){const b=await lintGuard(a,{'auto_fix':![]}),c={'root':a['root'],'table':(a['table']??[])['map'](j=>({'identifier':j['identifier'],'name':j['name'],'value_type':j['value_type']??'Address','b_submission':j['b_submission']??![],'value':j['value']})),'guardName':a['description']??null,'rely':a['rely']??null},d=renderGuardTreeIndented(c),e=renderGuardMermaid(a['root']),f=new Set();let g=![],h=![];walkGuardTree(a['root'],j=>{if(j['type']==='context'){if(j['context']==='Clock')g=!![];if(j['context']==='Signer')h=!![];}j['type']==='query'&&typeof j['query']==='number'&&f['add'](j['query']);});const i={'submission_requirements':(a['table']??[])['filter'](j=>j['b_submission']===!![])['map'](j=>({'identifier':j['identifier'],'value_type':j['value_type'],'object_type':j['object_type'],'name':j['name']})),'data_sources':(a['table']??[])['filter'](j=>j['b_submission']!==!![])['map'](j=>({'identifier':j['identifier'],'kind':j['is_system_address']?'system_address':j['object_type']?'object':'fixed_value','value_type':j['value_type'],'object_type':j['object_type'],'name':j['name'],'is_mutable_onchain':j['object_type']==='Repository'})),'query_dependencies':[...f]['sort']((j,k)=>j-k),'has_time_conditions':g,'has_signer_constraints':h,'has_rely_composition':Array['isArray'](a['rely']?.['guards'])&&a['rely']['guards']['length']>0x0,'reading_checklist':GUARD_SEMANTICS_READING_CHECKLIST};return{'render':{'tree_indented':d,'mermaid':e},'lint':b,'party_evaluation':i};}export{formatLintResult};
|
|
1
|
+
import{readFileSync,existsSync,writeFileSync,mkdirSync}from'fs';import{resolve,join,dirname}from'path';import{fileURLToPath}from'url';import{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence}from'../knowledge/tools-reference.js';import{GUARD_DESIGN_PATTERNS,getGuardDesignPattern,GUARD_DESIGN_PATTERNS_VERSION}from'../knowledge/guard-design-patterns.js';import{OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,NAMING_CONVENTIONS,SAFETY_RULES_VERSION}from'../knowledge/safety-rules.js';import{listTemplates as a346a,getTemplateDetail,instantiateTemplate,getTemplateCounts,TEMPLATE_OBJECT_TYPES}from'../knowledge/template-registry.js';import{lintGuard,formatLintResult}from'../knowledge/guard-lint.js';import{renderGuardTreeIndented,renderGuardMermaid,walkGuardTree}from'../knowledge/guard-render.js';const __filename=fileURLToPath(import.meta.url),__dirname=fileURLToPath(new URL('.',import.meta.url)),SCHEMAS_DIR=resolve(__dirname,'../../dist/schemas'),GUARD_TEMPLATES_PATH_SCRIPTS=resolve(__dirname,'../../scripts/guard-templates.json'),GUARD_TEMPLATES_PATH_DIST=resolve(__dirname,'../../dist/schemas/guard-templates.json'),GUARD_TEMPLATES_PATH=existsSync(GUARD_TEMPLATES_PATH_SCRIPTS)?GUARD_TEMPLATES_PATH_SCRIPTS:GUARD_TEMPLATES_PATH_DIST,WORKSPACE_TMP_DIR=resolve(process['cwd'](),'.trae','tmp');export function areSchemasAvailable(){return existsSync(SCHEMAS_DIR)&&existsSync(join(SCHEMAS_DIR,'index.json'));}export function getSchemaIndex(){try{const a=join(SCHEMAS_DIR,'index.json');if(!existsSync(a))return null;const b=readFileSync(a,'utf-8');return JSON['parse'](b);}catch{return null;}}export function listSchemas(){const a=getSchemaIndex();if(!a)return[];return[...a['tools']||[],...a['operations']||[]];}export function getSchema(a){try{let b=join(SCHEMAS_DIR,a+'.schema.json');!existsSync(b)&&(b=join(SCHEMAS_DIR,a+'.json'));if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}export function getOutputSchema(a){try{const b=join(SCHEMAS_DIR,a+'.output.json');if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}export function getGuardTemplates(a){try{if(!existsSync(GUARD_TEMPLATES_PATH))return null;const b=readFileSync(GUARD_TEMPLATES_PATH,'utf-8'),c=JSON['parse'](b);if(!a)return{'version':c['version'],'description':c['description'],'templates':(c['templates']||[])['map'](e=>({'name':e['name'],'title':e['title'],'description':e['description'],'use_case':e['use_case']})),'query_reference':c['query_reference'],'node_return_types':c['node_return_types']};const d=(c['templates']||[])['find'](e=>e['name']===a);if(!d)return null;return d;}catch{return null;}}export function getSchemaField(a,b){const c=getSchema(a);if(!c)return null;const d=b['split']('.')['filter'](Boolean);let e=c;for(const f of d){if(!e||typeof e!=='object')return null;if(e['properties']&&f in e['properties']){e=e['properties'][f];continue;}if(e['items']&&typeof e['items']==='object'){if(/^\d+$/['test'](f)){e=e['items'];continue;}if(e['items']['properties']&&f in e['items']['properties']){e=e['items']['properties'][f];continue;}}if(Array['isArray'](e['oneOf'])||Array['isArray'](e['anyOf'])){const g=e['oneOf']??e['anyOf'];for(const h of g){if(h&&typeof h==='object'&&h['properties']&&f in h['properties']){e=h['properties'][f];break;}}continue;}if(f in e){e=e[f];continue;}return null;}return e;}function resolveSchemaRefs(a,b=new Set()){if(!a||typeof a!=='object')return a;if(Array['isArray'](a))return a['map'](d=>resolveSchemaRefs(d,b));const c={};for(const [d,e]of Object['entries'](a)){if(d==='$ref'&&typeof e==='string'){if(e['startsWith']('#'))c[d]=e;else{const f=loadRefSchema(e,b);f&&Object['assign'](c,resolveSchemaRefs(f,b));}}else typeof e==='object'?c[d]=resolveSchemaRefs(e,b):c[d]=e;}return c;}function loadRefSchema(a,b){if(a['startsWith']('#'))return null;if(b['has'](a))return{'description':'Circular\x20reference\x20to\x20'+a};b['add'](a);try{const c=join(SCHEMAS_DIR,a);if(!existsSync(c))return null;const d=readFileSync(c,'utf-8');return JSON['parse'](d);}catch{return null;}}export function searchSchemas(a){const b=listSchemas(),c=a['toLowerCase']();return b['filter'](d=>{const e=d['name']['toLowerCase']()['includes'](c),f=d['title']?.['toLowerCase']()['includes'](c),g=d['description']?.['toLowerCase']()['includes'](c);return e||f||g;});}export function listOperations(){const a=getSchemaIndex();if(!a)return[];return(a['operations']||[])['filter'](b=>b['name']['startsWith']('onchain_operations_'));}function writeResponseToFile(a,b){try{let c;if(b)c=resolve(process['cwd'](),b);else{!existsSync(WORKSPACE_TMP_DIR)&&mkdirSync(WORKSPACE_TMP_DIR,{'recursive':!![]});const g=Date['now']();c=join(WORKSPACE_TMP_DIR,'schema-'+g+'.json');}const d=dirname(c);!existsSync(d)&&mkdirSync(d,{'recursive':!![]});const f=typeof a==='string'?a:JSON['stringify'](a,null,0x2);return writeFileSync(c,f,'utf-8'),c;}catch(h){return null;}}export function processSchemaQuery(a){const {action:b,name:c,query:d,field_path:f,template:g,output_file:h,object_type:i,params:j}=a;if(b==='get_guard_templates'){const k=getGuardTemplates(g);if(!k)return{'success':![],'action':b,'data':null,'message':g?'Guard\x20template\x20\x27'+g+'\x27\x20not\x20found.\x20Omit\x20\x27template\x27\x20to\x20list\x20all\x20available\x20templates.':'Guard\x20templates\x20file\x20not\x20found.\x20Ensure\x20scripts/guard-templates.json\x20exists.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20available\x20templates.','Available\x20template\x20names:\x20signer_verification,\x20progress_node_check,\x20order_owner_verification,\x20service_belonging_check,\x20reward_not_claimed,\x20combined_reward_guard']};if(h){const l=writeResponseToFile(k,h);if(l)return{'success':!![],'action':b,'data':null,'message':'Guard\x20template'+(g?'\x20\x27'+g+'\x27':'s')+'\x20written\x20to\x20file:\x20'+l,'output_file_path':l,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+l]};}return{'success':!![],'action':b,'data':k,'message':g?'Retrieved\x20Guard\x20template:\x20'+g:'Retrieved\x20'+(Array['isArray'](k['templates'])?k['templates']['length']:0x0)+'\x20Guard\x20templates'};}if(b==='get_templates'){if(!g){const p=a346a(i),q=getTemplateCounts(),r={'total':p['length'],'filter':i??null,'counts_by_object_type':q,'templates':p};if(h){const s=writeResponseToFile(r,h);if(s)return{'success':!![],'action':b,'data':null,'message':p['length']+'\x20templates\x20written\x20to\x20file:\x20'+s,'output_file_path':s,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+s]};}return{'success':!![],'action':b,'data':r,'message':p['length']+'\x20template(s)'+(i?'\x20for\x20object_type=\x27'+i+'\x27':'')+'\x20'+('(total\x20registry:\x20'+Object['values'](q)['reduce']((t,u)=>t+u,0x0)+'\x20across\x20'+TEMPLATE_OBJECT_TYPES['length']+'\x20object\x20types).\x20')+'Provide\x20\x27template\x27\x20(id)\x20for\x20full\x20detail;\x20add\x20\x27params\x27\x20(JSON\x20string)\x20to\x20instantiate.'};}if(!j){const t=getTemplateDetail(g);if(!t)return{'success':![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20not\x20found\x20in\x20the\x20unified\x20registry.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20template\x20metadata\x20(id\x20+\x20object_type\x20+\x20parameters).','Filter\x20by\x20object_type:\x20'+TEMPLATE_OBJECT_TYPES['join'](',\x20')]};if(h){const u=writeResponseToFile(t,h);if(u)return{'success':!![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20detail\x20written\x20to\x20file:\x20'+u,'output_file_path':u,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+u]};}return{'success':!![],'action':b,'data':t,'message':'Template\x20\x27'+g+'\x27\x20('+t['object_type']+',\x20'+(t['instantiable']?'instantiable':'guidance-only')+').\x20'+'To\x20instantiate,\x20call\x20again\x20with\x20\x27params\x27\x20=\x20JSON\x20object\x20of\x20the\x20declared\x20parameters.'};}let m;try{const v=JSON['parse'](j);if(!v||typeof v!=='object'||Array['isArray'](v))return{'success':![],'action':b,'data':null,'message':'\x27params\x27\x20must\x20be\x20a\x20JSON\x20object\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27),\x20got\x20'+(Array['isArray'](v)?'array':typeof v)+'.'};m=v;}catch(w){return{'success':![],'action':b,'data':null,'message':'Failed\x20to\x20parse\x20\x27params\x27\x20as\x20JSON:\x20'+(w instanceof Error?w['message']:String(w)),'suggestions':['Example:\x20params=\x27{\x22whitelist\x22:[\x220xabc...\x22]}\x27']};}const n=instantiateTemplate(g,m);if(!n['ok'])return{'success':![],'action':b,'data':n['guidance']!==undefined?{'guidance':n['guidance']}:null,'message':'Instantiation\x20failed\x20for\x20\x27'+g+'\x27:\x20'+n['error'],'suggestions':n['missing_params']?['Missing\x20required\x20params:\x20'+n['missing_params']['join'](',\x20'),'Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']:['Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']};const o={'object_type':n['object_type'],'template_id':n['template_id'],'body':n['body'],...n['notes']?{'notes':n['notes']}:{}};if(h){const x=writeResponseToFile(o,h);if(x)return{'success':!![],'action':b,'data':null,'message':'Instantiated\x20template\x20\x27'+g+'\x27\x20written\x20to\x20file:\x20'+x,'output_file_path':x,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+x]};}return{'success':!![],'action':b,'data':o,'message':'Instantiated\x20\x27'+g+'\x27\x20('+n['object_type']+').\x20'+'Review\x20the\x20body\x20against\x20the\x20onchain_operations\x20schema\x20before\x20submitting.'};}if(b==='get_tool_reference'){if(c){const z=getToolReference(c);if(!z)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found\x20in\x20the\x20tool\x20reference.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20all\x20tools.','Available\x20tools:\x20'+TOOLS_REFERENCE['map'](B=>B['name'])['join'](',\x20')]};const A=getToolSequence(c);return{'success':!![],'action':b,'data':{'tool':z,'call_sequence':A??null},'message':'Retrieved\x20tool\x20reference:\x20'+c};}if(d){const B=searchToolReference(d);return{'success':!![],'action':b,'data':{'tools':B,'count':B['length']},'message':'Found\x20'+B['length']+'\x20tool(s)\x20matching\x20\x27'+d+'\x27','suggestions':B['length']===0x0?['Try\x20a\x20broader\x20keyword\x20(e.g.\x20\x27onchain\x27,\x20\x27guard\x27,\x20\x27schema\x27),\x20or\x20omit\x20\x27query\x27\x20to\x20list\x20all\x20tools.']:undefined};}const y=TOOLS_REFERENCE['map'](C=>({'name':C['name'],'summary':C['summary'],'actions':C['actions']??[],'notes':C['notes']??[]}));return{'success':!![],'action':b,'data':{'tools':y,'count':y['length']},'message':'Retrieved\x20reference\x20for\x20'+y['length']+'\x20MCP\x20tools.\x20Pass\x20name=\x27<tool>\x27\x20for\x20full\x20detail\x20(params,\x20prerequisites,\x20follow-ups).'};}if(b==='get_guard_design_patterns'){if(c){const D=getGuardDesignPattern(c);if(!D)return{'success':![],'action':b,'data':null,'message':'Guard\x20design\x20pattern\x20\x27'+c+'\x27\x20not\x20found.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20the\x20full\x20catalog.','Available\x20pattern\x20ids:\x20'+GUARD_DESIGN_PATTERNS['map'](E=>E['id'])['join'](',\x20')]};return{'success':!![],'action':b,'data':{'pattern':D},'message':'Retrieved\x20Guard\x20design\x20pattern:\x20'+c};}if(d){const E=GUARD_DESIGN_PATTERNS['filter'](G=>G['host']===d),F=E['length']>0x0?E:GUARD_DESIGN_PATTERNS['filter'](G=>G['business_requirement']['toLowerCase']()['includes'](d['toLowerCase']())||G['logic_summary']['toLowerCase']()['includes'](d['toLowerCase']()));return{'success':!![],'action':b,'data':{'patterns':F,'count':F['length'],'filtered_by':E['length']>0x0?'host':'keyword'},'message':'Found\x20'+F['length']+'\x20Guard\x20design\x20pattern(s)\x20matching\x20\x27'+d+'\x27','suggestions':F['length']===0x0?['Filter\x20by\x20host:\x20service_buy_guard,\x20service_allocator_guard,\x20machine_forward,\x20progress_submission,\x20reward_claim,\x20repository_write,\x20arbitration_usage,\x20arbitration_voting,\x20gen_passport']:undefined};}const C=GUARD_DESIGN_PATTERNS['map'](G=>({'id':G['id'],'business_requirement':G['business_requirement'],'host':G['host'],'data_source':G['data_source'],'verifier_level':G['verifier_level'],'logic_summary':G['logic_summary'],'key_queries':G['key_queries'],'notes':G['notes']??[]}));return{'success':!![],'action':b,'data':{'patterns':C,'count':C['length'],'version':GUARD_DESIGN_PATTERNS_VERSION},'message':'Retrieved\x20'+C['length']+'\x20Guard\x20design\x20patterns.\x20Pass\x20name=\x27<pattern_id>\x27\x20for\x20full\x20detail\x20(witness\x20types,\x20mitigated\x20risks,\x20industries).'};}if(b==='get_safety_rules')return{'success':!![],'action':b,'data':{'version':SAFETY_RULES_VERSION,'object_reuse_rules':OBJECT_REUSE_RULES,'create_vs_modify_pattern':CREATE_VS_MODIFY_PATTERN,'immutability_rules':IMMUTABILITY_RULES,'operation_type_classification':OPERATION_TYPE_CLASSIFICATION,'operation_class_meta':OPERATION_CLASS_META,'naming_conventions':NAMING_CONVENTIONS},'message':'Retrieved\x20safety\x20rule\x20tables\x20(reuse\x20/\x20immutability\x20/\x20operation\x20classification\x20/\x20naming).\x20'+'Key\x20points:\x20prefer\x20REUSING\x20existing\x20objects\x20(string\x20reference\x20=\x20reuse,\x20object\x20shape\x20=\x20create);\x20'+'Machine\x20publish\x20locks\x20nodes/pairs/forwards,\x20Service\x20publish\x20locks\x20machine/order_allocators/arbitrations\x20(sales\x20stays\x20mutable);\x20'+'Guard\x20is\x20CREATE-only\x20immutable;\x20on-chain\x20writes\x20require\x20explicit\x20user\x20confirmation.'};if(!areSchemasAvailable())return{'success':![],'action':b,'data':null,'message':'Schema\x20files\x20are\x20not\x20available.\x20Please\x20run\x20\x27npm\x20run\x20generate:schemas\x27\x20first.','suggestions':['Run\x20\x27npm\x20run\x20generate:schemas\x27\x20to\x20generate\x20schema\x20files','Ensure\x20the\x20dist/schemas\x20directory\x20exists']};switch(b){case'list':{const G=listSchemas();return{'success':!![],'action':b,'data':G,'message':'Found\x20'+G['length']+'\x20available\x20schemas'};}case'get':{if(!c)return{'success':![],'action':b,'data':null,'message':'Schema\x20name\x20is\x20required\x20for\x20\x27get\x27\x20action','suggestions':['Provide\x20a\x20schema\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};const H=getSchema(c);if(!H){const I=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20not\x20found','suggestions':I['length']>0x0?I['map'](J=>'Did\x20you\x20mean:\x20'+J['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};}if(h){const J=writeResponseToFile(H,h);if(J)return{'success':!![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+J,'output_file_path':J,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+J]};}return{'success':!![],'action':b,'data':H,'message':'Retrieved\x20schema:\x20'+c};}case'get_field':{if(!c||!f)return{'success':![],'action':b,'data':null,'message':'Both\x20\x27name\x27\x20and\x20\x27field_path\x27\x20are\x20required\x20for\x20\x27get_field\x27\x20action','suggestions':['Example:\x20{action:\x20\x27get_field\x27,\x20name:\x20\x27onchain_operations_machine\x27,\x20field_path:\x20\x27data.node\x27}','Use\x20\x27get\x27\x20action\x20to\x20retrieve\x20the\x20full\x20schema']};const K=getSchemaField(c,f);if(!K)return{'success':![],'action':b,'data':null,'message':'Field\x20path\x20\x27'+f+'\x27\x20not\x20found\x20in\x20schema\x20\x27'+c+'\x27','suggestions':['Check\x20the\x20field\x20path\x20(dot-separated,\x20e.g.\x20\x27data.node\x27)','Use\x20\x27get\x27\x20action\x20to\x20see\x20the\x20full\x20schema\x20structure']};return{'success':!![],'action':b,'data':K,'message':'Retrieved\x20field\x20\x27'+f+'\x27\x20from\x20schema\x20\x27'+c+'\x27'};}case'search':{if(!d)return{'success':![],'action':b,'data':null,'message':'Search\x20query\x20is\x20required\x20for\x20\x27search\x27\x20action'};const L=searchSchemas(d);return{'success':!![],'action':b,'data':L,'message':'Found\x20'+L['length']+'\x20schemas\x20matching\x20\x27'+d+'\x27'};}case'list_operations':{const M=listOperations();return{'success':!![],'action':b,'data':M,'message':'Found\x20'+M['length']+'\x20on-chain\x20operations'};}case'get_output':{if(!c)return{'success':![],'action':b,'data':null,'message':'Tool\x20name\x20is\x20required\x20for\x20\x27get_output\x27\x20action','suggestions':['Provide\x20a\x20tool\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools\x20and\x20their\x20outputPath']};const N=getOutputSchema(c);if(!N){const O=listSchemas(),P=O['find'](R=>R['name']===c);if(P)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20exists\x20but\x20has\x20no\x20output\x20schema\x20file.\x20The\x20tool\x20may\x20not\x20declare\x20an\x20outputSchema,\x20or\x20the\x20schema\x20file\x20was\x20not\x20generated.','suggestions':['Use\x20\x27get\x27\x20action\x20with\x20name=\x27'+c+'\x27\x20to\x20retrieve\x20its\x20input\x20schema']};const Q=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found','suggestions':Q['length']>0x0?Q['map'](R=>'Did\x20you\x20mean:\x20'+R['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools']};}if(h){const R=writeResponseToFile(N,h);if(R)return{'success':!![],'action':b,'data':null,'message':'Output\x20schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+R,'output_file_path':R,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+R]};}return{'success':!![],'action':b,'data':N,'message':'Retrieved\x20output\x20schema:\x20'+c};}default:return{'success':![],'action':b,'data':null,'message':'Unknown\x20action:\x20'+b,'suggestions':['Use\x20\x27list\x27,\x20\x27get\x27,\x20\x27get_field\x27,\x20\x27get_output\x27,\x20\x27search\x27,\x20\x27list_operations\x27,\x20\x27get_guard_templates\x27,\x20\x27get_tool_reference\x27,\x20\x27get_guard_design_patterns\x27,\x20\x27get_safety_rules\x27,\x20\x27get_templates\x27,\x20or\x20\x27analyze_guard_semantics\x27']};}}const GUARD_SEMANTICS_READING_CHECKLIST=['WHO\x20can\x20satisfy\x20this\x20Guard\x20(identity:\x20Signer\x20bindings,\x20Entity\x20membership,\x20allowlists)?','WHEN\x20can\x20it\x20be\x20satisfied\x20(time:\x20Clock\x20comparisons,\x20deadlines,\x20windows)?','WHAT\x20evidence\x20must\x20the\x20caller\x20submit\x20(b_submission\x20table\x20entries\x20—\x20Payment/Order/Proof\x20objects)?','WHICH\x20on-chain\x20data\x20does\x20it\x20read,\x20and\x20can\x20that\x20data\x20change\x20(Repository\x20entries\x20are\x20MUTABLE\x20—\x20who\x20controls\x20the\x20writes)?','WHAT\x20does\x20the\x20counterparty\x20gain/lose\x20in\x20each\x20branch\x20of\x20the\x20logic\x20tree?','ARE\x20there\x20error-level\x20diagnostics\x20or\x20critical\x20risks\x20(they\x20block\x20or\x20endanger\x20execution)?'];export async function analyzeGuardSemantics(a){const b=await lintGuard(a,{'auto_fix':![]}),c={'root':a['root'],'table':(a['table']??[])['map'](j=>({'identifier':j['identifier'],'name':j['name'],'value_type':j['value_type']??'Address','b_submission':j['b_submission']??![],'value':j['value']})),'guardName':a['description']??null,'rely':a['rely']??null},d=renderGuardTreeIndented(c),e=renderGuardMermaid(a['root']),f=new Set();let g=![],h=![];walkGuardTree(a['root'],j=>{if(j['type']==='context'){if(j['context']==='Clock')g=!![];if(j['context']==='Signer')h=!![];}j['type']==='query'&&typeof j['query']==='number'&&f['add'](j['query']);});const i={'submission_requirements':(a['table']??[])['filter'](j=>j['b_submission']===!![])['map'](j=>({'identifier':j['identifier'],'value_type':j['value_type'],'object_type':j['object_type'],'name':j['name']})),'data_sources':(a['table']??[])['filter'](j=>j['b_submission']!==!![])['map'](j=>({'identifier':j['identifier'],'kind':j['is_system_address']?'system_address':j['object_type']?'object':'fixed_value','value_type':j['value_type'],'object_type':j['object_type'],'name':j['name'],'is_mutable_onchain':j['object_type']==='Repository'})),'query_dependencies':[...f]['sort']((j,k)=>j-k),'has_time_conditions':g,'has_signer_constraints':h,'has_rely_composition':Array['isArray'](a['rely']?.['guards'])&&a['rely']['guards']['length']>0x0,'reading_checklist':GUARD_SEMANTICS_READING_CHECKLIST};return{'render':{'tree_indented':d,'mermaid':e},'lint':b,'party_evaluation':i};}export{formatLintResult};
|
|
@@ -3310,14 +3310,14 @@
|
|
|
3310
3310
|
"description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
|
|
3311
3311
|
},
|
|
3312
3312
|
"gains": {
|
|
3313
|
-
"description": "Gains for the caller if this option is chosen (K3 Game G1
|
|
3313
|
+
"description": "Gains for the caller if this option is chosen (K3 Game G1 gain separation). Example: ['Settlement triggered — funds released to provider']",
|
|
3314
3314
|
"type": "array",
|
|
3315
3315
|
"items": {
|
|
3316
3316
|
"type": "string"
|
|
3317
3317
|
}
|
|
3318
3318
|
},
|
|
3319
3319
|
"risks": {
|
|
3320
|
-
"description": "Risks for the caller if this option is chosen (K3 Game G1
|
|
3320
|
+
"description": "Risks for the caller if this option is chosen (K3 Game G1 risk separation). Example: ['Refund leverage lost after confirmation']",
|
|
3321
3321
|
"type": "array",
|
|
3322
3322
|
"items": {
|
|
3323
3323
|
"type": "string"
|
|
@@ -3347,7 +3347,7 @@
|
|
|
3347
3347
|
"description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
|
|
3348
3348
|
},
|
|
3349
3349
|
"recommendation": {
|
|
3350
|
-
"description": "Recommended option with rationale (K3 Game
|
|
3350
|
+
"description": "Recommended option with rationale (K3 Game intent/game/interests).",
|
|
3351
3351
|
"type": "object",
|
|
3352
3352
|
"properties": {
|
|
3353
3353
|
"best": {
|
|
@@ -3359,7 +3359,7 @@
|
|
|
3359
3359
|
"type": "string"
|
|
3360
3360
|
},
|
|
3361
3361
|
"caveat": {
|
|
3362
|
-
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3
|
|
3362
|
+
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 opportunity cost). Example: 'Choosing cancelled forfeits this order's settlement'",
|
|
3363
3363
|
"type": "string"
|
|
3364
3364
|
}
|
|
3365
3365
|
},
|
|
@@ -3479,7 +3479,7 @@
|
|
|
3479
3479
|
"operator"
|
|
3480
3480
|
],
|
|
3481
3481
|
"additionalProperties": false,
|
|
3482
|
-
"description": "A forward still pending — who must act next (threshold cooperation, K3 Game G4
|
|
3482
|
+
"description": "A forward still pending — who must act next (threshold cooperation, K3 Game G4)."
|
|
3483
3483
|
}
|
|
3484
3484
|
},
|
|
3485
3485
|
"next_guidance": {
|
|
@@ -3557,14 +3557,14 @@
|
|
|
3557
3557
|
"description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
|
|
3558
3558
|
},
|
|
3559
3559
|
"gains": {
|
|
3560
|
-
"description": "Gains for the caller if this option is chosen (K3 Game G1
|
|
3560
|
+
"description": "Gains for the caller if this option is chosen (K3 Game G1 gain separation). Example: ['Settlement triggered — funds released to provider']",
|
|
3561
3561
|
"type": "array",
|
|
3562
3562
|
"items": {
|
|
3563
3563
|
"type": "string"
|
|
3564
3564
|
}
|
|
3565
3565
|
},
|
|
3566
3566
|
"risks": {
|
|
3567
|
-
"description": "Risks for the caller if this option is chosen (K3 Game G1
|
|
3567
|
+
"description": "Risks for the caller if this option is chosen (K3 Game G1 risk separation). Example: ['Refund leverage lost after confirmation']",
|
|
3568
3568
|
"type": "array",
|
|
3569
3569
|
"items": {
|
|
3570
3570
|
"type": "string"
|
|
@@ -3594,7 +3594,7 @@
|
|
|
3594
3594
|
"description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
|
|
3595
3595
|
},
|
|
3596
3596
|
"recommendation": {
|
|
3597
|
-
"description": "Recommended option with rationale (K3 Game
|
|
3597
|
+
"description": "Recommended option with rationale (K3 Game intent/game/interests).",
|
|
3598
3598
|
"type": "object",
|
|
3599
3599
|
"properties": {
|
|
3600
3600
|
"best": {
|
|
@@ -3606,7 +3606,7 @@
|
|
|
3606
3606
|
"type": "string"
|
|
3607
3607
|
},
|
|
3608
3608
|
"caveat": {
|
|
3609
|
-
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3
|
|
3609
|
+
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 opportunity cost). Example: 'Choosing cancelled forfeits this order's settlement'",
|
|
3610
3610
|
"type": "string"
|
|
3611
3611
|
}
|
|
3612
3612
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "https://wowok.net/schemas/account_operation.json",
|
|
4
4
|
"title": "Account Operations",
|
|
5
|
-
"description": "Account operations (mutations only: gen/faucet/suspend/resume/rename/swap_name/transfer/get/signData/messenger). Parameters MUST be wrapped in the operation type property (e.g. {transfer: {...}}, NOT {amount: ...}). Unwrapped parameters are rejected. TO LIST ALL ACCOUNTS: use the query_toolkit tool with query_type='account_list' (returns name, address, suspended status, messenger status for all local accounts). This separation follows CQRS: account_operation = mutations, query_toolkit = queries. Common workflow after MCP restart: (1) query_toolkit query_type='account_list' to see all accounts, (2) account_operation with the appropriate mutation.",
|
|
5
|
+
"description": "Account operations (mutations only: gen/faucet/suspend/resume/rename/swap_name/transfer/get/signData/messenger). Parameters MUST be wrapped in the operation type property (e.g. {transfer: {...}}, NOT {amount: ...}). Unwrapped parameters are rejected. DEFAULT ACCOUNT: every name/address field (name_or_address, name_or_address_from, name_or_address_to, name1, name2, name_or_account) accepts the EMPTY STRING '' to mean the default account — the literal 'DEFAULT' is NOT a valid name and is rejected. TO LIST ALL ACCOUNTS: use the query_toolkit tool with query_type='account_list' (returns name, address, suspended status, messenger status for all local accounts). This separation follows CQRS: account_operation = mutations, query_toolkit = queries. Common workflow after MCP restart: (1) query_toolkit query_type='account_list' to see all accounts, (2) account_operation with the appropriate mutation.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"gen": {
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"additionalProperties": false
|
|
110
110
|
},
|
|
111
111
|
"transfer": {
|
|
112
|
-
"description": "💰 FUND MOVEMENT (on-chain, irreversible): transfer tokens from one account to another. Amount parsing: display strings like \"2.5WOW\" are converted to raw smallest units with the token's decimals; bare decimal numbers are rejected. Requires confirmation — first call previews, re-call with confirmed=true.",
|
|
112
|
+
"description": "💰 FUND MOVEMENT (on-chain, irreversible): transfer tokens from one account to another. Amount parsing: display strings like \"2.5WOW\" are converted to raw smallest units with the token's decimals; bare decimal numbers are rejected. Use the EMPTY STRING '' in name_or_address_from/to for the default account — the literal 'DEFAULT' is rejected. Requires confirmation — first call previews, re-call with confirmed=true.",
|
|
113
113
|
"type": "object",
|
|
114
114
|
"properties": {
|
|
115
115
|
"name_or_address_from": {
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"additionalProperties": false
|
|
156
156
|
},
|
|
157
157
|
"get": {
|
|
158
|
-
"description": "💰 FUND MOVEMENT (on-chain, irreversible, spends gas): split/merge the account's coins to produce a coin object carrying AT LEAST the required balance, then self-deliver it to the same account. The account's total balance does not leave the account (minus gas), but a real on-chain transaction IS executed and its digest is returned. Amount parsing: display strings like \"2.5WOW\" are converted to raw smallest units with the token's decimals; bare decimal numbers are rejected. Requires confirmation — first call previews, re-call with confirmed=true.",
|
|
158
|
+
"description": "💰 FUND MOVEMENT (on-chain, irreversible, spends gas): split/merge the account's coins to produce a coin object carrying AT LEAST the required balance, then self-deliver it to the same account. The account's total balance does not leave the account (minus gas), but a real on-chain transaction IS executed and its digest is returned. IMPORTANT: balance_required is an AMOUNT string (e.g. \"1WOW\" or raw smallest-unit integer like \"1000000000\"). Amount parsing: display strings like \"2.5WOW\" are converted to raw smallest units with the token's decimals; bare decimal numbers are rejected. Requires confirmation — first call previews, re-call with confirmed=true.",
|
|
159
159
|
"type": "object",
|
|
160
160
|
"properties": {
|
|
161
161
|
"name_or_address": {
|
|
@@ -1018,14 +1018,14 @@
|
|
|
1018
1018
|
"description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
|
|
1019
1019
|
},
|
|
1020
1020
|
"gains": {
|
|
1021
|
-
"description": "Gains for the caller if this option is chosen (K3 Game G1
|
|
1021
|
+
"description": "Gains for the caller if this option is chosen (K3 Game G1 gain separation). Example: ['Settlement triggered — funds released to provider']",
|
|
1022
1022
|
"type": "array",
|
|
1023
1023
|
"items": {
|
|
1024
1024
|
"type": "string"
|
|
1025
1025
|
}
|
|
1026
1026
|
},
|
|
1027
1027
|
"risks": {
|
|
1028
|
-
"description": "Risks for the caller if this option is chosen (K3 Game G1
|
|
1028
|
+
"description": "Risks for the caller if this option is chosen (K3 Game G1 risk separation). Example: ['Refund leverage lost after confirmation']",
|
|
1029
1029
|
"type": "array",
|
|
1030
1030
|
"items": {
|
|
1031
1031
|
"type": "string"
|
|
@@ -1055,7 +1055,7 @@
|
|
|
1055
1055
|
"description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
|
|
1056
1056
|
},
|
|
1057
1057
|
"recommendation": {
|
|
1058
|
-
"description": "Recommended option with rationale (K3 Game
|
|
1058
|
+
"description": "Recommended option with rationale (K3 Game intent/game/interests).",
|
|
1059
1059
|
"type": "object",
|
|
1060
1060
|
"properties": {
|
|
1061
1061
|
"best": {
|
|
@@ -1067,7 +1067,7 @@
|
|
|
1067
1067
|
"type": "string"
|
|
1068
1068
|
},
|
|
1069
1069
|
"caveat": {
|
|
1070
|
-
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3
|
|
1070
|
+
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 opportunity cost). Example: 'Choosing cancelled forfeits this order's settlement'",
|
|
1071
1071
|
"type": "string"
|
|
1072
1072
|
}
|
|
1073
1073
|
},
|
|
@@ -1187,7 +1187,7 @@
|
|
|
1187
1187
|
"operator"
|
|
1188
1188
|
],
|
|
1189
1189
|
"additionalProperties": false,
|
|
1190
|
-
"description": "A forward still pending — who must act next (threshold cooperation, K3 Game G4
|
|
1190
|
+
"description": "A forward still pending — who must act next (threshold cooperation, K3 Game G4)."
|
|
1191
1191
|
}
|
|
1192
1192
|
},
|
|
1193
1193
|
"next_guidance": {
|
|
@@ -1265,14 +1265,14 @@
|
|
|
1265
1265
|
"description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
|
|
1266
1266
|
},
|
|
1267
1267
|
"gains": {
|
|
1268
|
-
"description": "Gains for the caller if this option is chosen (K3 Game G1
|
|
1268
|
+
"description": "Gains for the caller if this option is chosen (K3 Game G1 gain separation). Example: ['Settlement triggered — funds released to provider']",
|
|
1269
1269
|
"type": "array",
|
|
1270
1270
|
"items": {
|
|
1271
1271
|
"type": "string"
|
|
1272
1272
|
}
|
|
1273
1273
|
},
|
|
1274
1274
|
"risks": {
|
|
1275
|
-
"description": "Risks for the caller if this option is chosen (K3 Game G1
|
|
1275
|
+
"description": "Risks for the caller if this option is chosen (K3 Game G1 risk separation). Example: ['Refund leverage lost after confirmation']",
|
|
1276
1276
|
"type": "array",
|
|
1277
1277
|
"items": {
|
|
1278
1278
|
"type": "string"
|
|
@@ -1302,7 +1302,7 @@
|
|
|
1302
1302
|
"description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
|
|
1303
1303
|
},
|
|
1304
1304
|
"recommendation": {
|
|
1305
|
-
"description": "Recommended option with rationale (K3 Game
|
|
1305
|
+
"description": "Recommended option with rationale (K3 Game intent/game/interests).",
|
|
1306
1306
|
"type": "object",
|
|
1307
1307
|
"properties": {
|
|
1308
1308
|
"best": {
|
|
@@ -1314,7 +1314,7 @@
|
|
|
1314
1314
|
"type": "string"
|
|
1315
1315
|
},
|
|
1316
1316
|
"caveat": {
|
|
1317
|
-
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3
|
|
1317
|
+
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 opportunity cost). Example: 'Choosing cancelled forfeits this order's settlement'",
|
|
1318
1318
|
"type": "string"
|
|
1319
1319
|
}
|
|
1320
1320
|
},
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"type": "integer",
|
|
54
54
|
"minimum": 0,
|
|
55
55
|
"maximum": 9007199254740991,
|
|
56
|
-
"description": "Gain points
|
|
56
|
+
"description": "Gain points."
|
|
57
57
|
},
|
|
58
58
|
"risk_score": {
|
|
59
59
|
"type": "integer",
|
|
60
60
|
"minimum": 0,
|
|
61
61
|
"maximum": 9007199254740991,
|
|
62
|
-
"description": "Risk points (
|
|
62
|
+
"description": "Risk points (appetite-adjusted)."
|
|
63
63
|
},
|
|
64
64
|
"is_optimal": {
|
|
65
65
|
"type": "boolean",
|
|
@@ -162,13 +162,13 @@
|
|
|
162
162
|
"type": "integer",
|
|
163
163
|
"minimum": 0,
|
|
164
164
|
"maximum": 9007199254740991,
|
|
165
|
-
"description": "Gain points
|
|
165
|
+
"description": "Gain points."
|
|
166
166
|
},
|
|
167
167
|
"risk_score": {
|
|
168
168
|
"type": "integer",
|
|
169
169
|
"minimum": 0,
|
|
170
170
|
"maximum": 9007199254740991,
|
|
171
|
-
"description": "Risk points (
|
|
171
|
+
"description": "Risk points (appetite-adjusted)."
|
|
172
172
|
},
|
|
173
173
|
"is_optimal": {
|
|
174
174
|
"type": "boolean",
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
"description": "Roles that must cooperate to reach the threshold."
|
|
232
232
|
},
|
|
233
233
|
"allocation": {
|
|
234
|
-
"description": "Allocation waterfall — how funds split once the node advances
|
|
234
|
+
"description": "Allocation waterfall — how funds split once the node advances.",
|
|
235
235
|
"type": "object",
|
|
236
236
|
"properties": {
|
|
237
237
|
"recipient_slots": {
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
"additionalProperties": false
|
|
269
269
|
},
|
|
270
270
|
"allocation_note": {
|
|
271
|
-
"description": "Human-readable
|
|
271
|
+
"description": "Human-readable allocation note.",
|
|
272
272
|
"type": "string"
|
|
273
273
|
}
|
|
274
274
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"type": "string"
|
|
46
46
|
},
|
|
47
47
|
"requirements": {
|
|
48
|
-
"description": "Persona red lines that re-anchor the role's prefer/avoid (
|
|
48
|
+
"description": "Persona red lines that re-anchor the role's prefer/avoid (persona drivers).",
|
|
49
49
|
"type": "array",
|
|
50
50
|
"items": {
|
|
51
51
|
"type": "string"
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"maximum": 9007199254740991
|
|
101
101
|
},
|
|
102
102
|
"allocation": {
|
|
103
|
-
"description": "Allocation waterfall — how funds split after the node advances
|
|
103
|
+
"description": "Allocation waterfall — how funds split after the node advances.",
|
|
104
104
|
"type": "object",
|
|
105
105
|
"properties": {
|
|
106
106
|
"recipient_slots": {
|
|
@@ -137,14 +137,14 @@
|
|
|
137
137
|
"additionalProperties": false
|
|
138
138
|
},
|
|
139
139
|
"requirements": {
|
|
140
|
-
"description": "Persona red lines that re-anchor the role's prefer/avoid (
|
|
140
|
+
"description": "Persona red lines that re-anchor the role's prefer/avoid (persona drivers).",
|
|
141
141
|
"type": "array",
|
|
142
142
|
"items": {
|
|
143
143
|
"type": "string"
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
"order_amount": {
|
|
147
|
-
"description": "Escrowed order amount (smallest-unit string) — the monetary stake at this node (
|
|
147
|
+
"description": "Escrowed order amount (smallest-unit string) — the monetary stake at this node (quantified).",
|
|
148
148
|
"type": "string"
|
|
149
149
|
},
|
|
150
150
|
"compensation_fund": {
|
|
@@ -3389,7 +3389,7 @@
|
|
|
3389
3389
|
"maximum": 1
|
|
3390
3390
|
},
|
|
3391
3391
|
"favor": {
|
|
3392
|
-
"description": "Whether peers favorited this entity
|
|
3392
|
+
"description": "Whether peers favorited this entity.",
|
|
3393
3393
|
"type": "boolean"
|
|
3394
3394
|
}
|
|
3395
3395
|
},
|
package/dist/schemas/index.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "WoWok MCP Schema Index",
|
|
4
4
|
"description": "Index of all available JSON schemas for WoWok MCP tools",
|
|
5
|
-
"generatedAt": "2026-09-
|
|
5
|
+
"generatedAt": "2026-09-21T15:29:29.843Z",
|
|
6
6
|
"tools": [
|
|
7
7
|
{
|
|
8
8
|
"name": "onchain_operations",
|
|
@@ -930,14 +930,14 @@
|
|
|
930
930
|
"description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
|
|
931
931
|
},
|
|
932
932
|
"gains": {
|
|
933
|
-
"description": "Gains for the caller if this option is chosen (K3 Game G1
|
|
933
|
+
"description": "Gains for the caller if this option is chosen (K3 Game G1 gain separation). Example: ['Settlement triggered — funds released to provider']",
|
|
934
934
|
"type": "array",
|
|
935
935
|
"items": {
|
|
936
936
|
"type": "string"
|
|
937
937
|
}
|
|
938
938
|
},
|
|
939
939
|
"risks": {
|
|
940
|
-
"description": "Risks for the caller if this option is chosen (K3 Game G1
|
|
940
|
+
"description": "Risks for the caller if this option is chosen (K3 Game G1 risk separation). Example: ['Refund leverage lost after confirmation']",
|
|
941
941
|
"type": "array",
|
|
942
942
|
"items": {
|
|
943
943
|
"type": "string"
|
|
@@ -967,7 +967,7 @@
|
|
|
967
967
|
"description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
|
|
968
968
|
},
|
|
969
969
|
"recommendation": {
|
|
970
|
-
"description": "Recommended option with rationale (K3 Game
|
|
970
|
+
"description": "Recommended option with rationale (K3 Game intent/game/interests).",
|
|
971
971
|
"type": "object",
|
|
972
972
|
"properties": {
|
|
973
973
|
"best": {
|
|
@@ -979,7 +979,7 @@
|
|
|
979
979
|
"type": "string"
|
|
980
980
|
},
|
|
981
981
|
"caveat": {
|
|
982
|
-
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3
|
|
982
|
+
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 opportunity cost). Example: 'Choosing cancelled forfeits this order's settlement'",
|
|
983
983
|
"type": "string"
|
|
984
984
|
}
|
|
985
985
|
},
|
|
@@ -1099,7 +1099,7 @@
|
|
|
1099
1099
|
"operator"
|
|
1100
1100
|
],
|
|
1101
1101
|
"additionalProperties": false,
|
|
1102
|
-
"description": "A forward still pending — who must act next (threshold cooperation, K3 Game G4
|
|
1102
|
+
"description": "A forward still pending — who must act next (threshold cooperation, K3 Game G4)."
|
|
1103
1103
|
}
|
|
1104
1104
|
},
|
|
1105
1105
|
"next_guidance": {
|
|
@@ -1177,14 +1177,14 @@
|
|
|
1177
1177
|
"description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
|
|
1178
1178
|
},
|
|
1179
1179
|
"gains": {
|
|
1180
|
-
"description": "Gains for the caller if this option is chosen (K3 Game G1
|
|
1180
|
+
"description": "Gains for the caller if this option is chosen (K3 Game G1 gain separation). Example: ['Settlement triggered — funds released to provider']",
|
|
1181
1181
|
"type": "array",
|
|
1182
1182
|
"items": {
|
|
1183
1183
|
"type": "string"
|
|
1184
1184
|
}
|
|
1185
1185
|
},
|
|
1186
1186
|
"risks": {
|
|
1187
|
-
"description": "Risks for the caller if this option is chosen (K3 Game G1
|
|
1187
|
+
"description": "Risks for the caller if this option is chosen (K3 Game G1 risk separation). Example: ['Refund leverage lost after confirmation']",
|
|
1188
1188
|
"type": "array",
|
|
1189
1189
|
"items": {
|
|
1190
1190
|
"type": "string"
|
|
@@ -1214,7 +1214,7 @@
|
|
|
1214
1214
|
"description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
|
|
1215
1215
|
},
|
|
1216
1216
|
"recommendation": {
|
|
1217
|
-
"description": "Recommended option with rationale (K3 Game
|
|
1217
|
+
"description": "Recommended option with rationale (K3 Game intent/game/interests).",
|
|
1218
1218
|
"type": "object",
|
|
1219
1219
|
"properties": {
|
|
1220
1220
|
"best": {
|
|
@@ -1226,7 +1226,7 @@
|
|
|
1226
1226
|
"type": "string"
|
|
1227
1227
|
},
|
|
1228
1228
|
"caveat": {
|
|
1229
|
-
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3
|
|
1229
|
+
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 opportunity cost). Example: 'Choosing cancelled forfeits this order's settlement'",
|
|
1230
1230
|
"type": "string"
|
|
1231
1231
|
}
|
|
1232
1232
|
},
|
|
@@ -1114,14 +1114,14 @@
|
|
|
1114
1114
|
"description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
|
|
1115
1115
|
},
|
|
1116
1116
|
"gains": {
|
|
1117
|
-
"description": "Gains for the caller if this option is chosen (K3 Game G1
|
|
1117
|
+
"description": "Gains for the caller if this option is chosen (K3 Game G1 gain separation). Example: ['Settlement triggered — funds released to provider']",
|
|
1118
1118
|
"type": "array",
|
|
1119
1119
|
"items": {
|
|
1120
1120
|
"type": "string"
|
|
1121
1121
|
}
|
|
1122
1122
|
},
|
|
1123
1123
|
"risks": {
|
|
1124
|
-
"description": "Risks for the caller if this option is chosen (K3 Game G1
|
|
1124
|
+
"description": "Risks for the caller if this option is chosen (K3 Game G1 risk separation). Example: ['Refund leverage lost after confirmation']",
|
|
1125
1125
|
"type": "array",
|
|
1126
1126
|
"items": {
|
|
1127
1127
|
"type": "string"
|
|
@@ -1151,7 +1151,7 @@
|
|
|
1151
1151
|
"description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
|
|
1152
1152
|
},
|
|
1153
1153
|
"recommendation": {
|
|
1154
|
-
"description": "Recommended option with rationale (K3 Game
|
|
1154
|
+
"description": "Recommended option with rationale (K3 Game intent/game/interests).",
|
|
1155
1155
|
"type": "object",
|
|
1156
1156
|
"properties": {
|
|
1157
1157
|
"best": {
|
|
@@ -1163,7 +1163,7 @@
|
|
|
1163
1163
|
"type": "string"
|
|
1164
1164
|
},
|
|
1165
1165
|
"caveat": {
|
|
1166
|
-
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3
|
|
1166
|
+
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 opportunity cost). Example: 'Choosing cancelled forfeits this order's settlement'",
|
|
1167
1167
|
"type": "string"
|
|
1168
1168
|
}
|
|
1169
1169
|
},
|
|
@@ -1283,7 +1283,7 @@
|
|
|
1283
1283
|
"operator"
|
|
1284
1284
|
],
|
|
1285
1285
|
"additionalProperties": false,
|
|
1286
|
-
"description": "A forward still pending — who must act next (threshold cooperation, K3 Game G4
|
|
1286
|
+
"description": "A forward still pending — who must act next (threshold cooperation, K3 Game G4)."
|
|
1287
1287
|
}
|
|
1288
1288
|
},
|
|
1289
1289
|
"next_guidance": {
|
|
@@ -1361,14 +1361,14 @@
|
|
|
1361
1361
|
"description": "Business meaning of advancing to this node. Example: 'Guide starts the day service'"
|
|
1362
1362
|
},
|
|
1363
1363
|
"gains": {
|
|
1364
|
-
"description": "Gains for the caller if this option is chosen (K3 Game G1
|
|
1364
|
+
"description": "Gains for the caller if this option is chosen (K3 Game G1 gain separation). Example: ['Settlement triggered — funds released to provider']",
|
|
1365
1365
|
"type": "array",
|
|
1366
1366
|
"items": {
|
|
1367
1367
|
"type": "string"
|
|
1368
1368
|
}
|
|
1369
1369
|
},
|
|
1370
1370
|
"risks": {
|
|
1371
|
-
"description": "Risks for the caller if this option is chosen (K3 Game G1
|
|
1371
|
+
"description": "Risks for the caller if this option is chosen (K3 Game G1 risk separation). Example: ['Refund leverage lost after confirmation']",
|
|
1372
1372
|
"type": "array",
|
|
1373
1373
|
"items": {
|
|
1374
1374
|
"type": "string"
|
|
@@ -1398,7 +1398,7 @@
|
|
|
1398
1398
|
"description": "ALL reachable next-node directions (every operator/permission/guard disclosed)."
|
|
1399
1399
|
},
|
|
1400
1400
|
"recommendation": {
|
|
1401
|
-
"description": "Recommended option with rationale (K3 Game
|
|
1401
|
+
"description": "Recommended option with rationale (K3 Game intent/game/interests).",
|
|
1402
1402
|
"type": "object",
|
|
1403
1403
|
"properties": {
|
|
1404
1404
|
"best": {
|
|
@@ -1410,7 +1410,7 @@
|
|
|
1410
1410
|
"type": "string"
|
|
1411
1411
|
},
|
|
1412
1412
|
"caveat": {
|
|
1413
|
-
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3
|
|
1413
|
+
"description": "Disclosed trade-off / opportunity cost of NOT taking another path (K3 Game G3 opportunity cost). Example: 'Choosing cancelled forfeits this order's settlement'",
|
|
1414
1414
|
"type": "string"
|
|
1415
1415
|
}
|
|
1416
1416
|
},
|