@wowok/agent-mcp 3.2.3 → 3.2.4
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/chain-semantics/field-capability.js +1 -1
- package/dist/chain-semantics/freeze-map.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/guard-verbs.js +1 -1
- package/dist/communication/proof-reuse.d.ts +9 -0
- package/dist/communication/proof-reuse.js +1 -0
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/builtin-templates.d.ts +1 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-bindings.js +1 -1
- package/dist/knowledge/guard-design-patterns.d.ts +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-templates.js +1 -1
- package/dist/knowledge/progress-ledger.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +1 -0
- package/dist/knowledge/template-loader.d.ts +1 -0
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.d.ts +1 -0
- package/dist/playbooks/service-build/service-quote.spec.js +1 -0
- package/dist/review/index.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +4 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +1 -0
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/interaction/index.d.ts +1 -1
- package/dist/schema/local/index.d.ts +10 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/query/bi.d.ts +26 -0
- package/dist/schema/query/bi.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 +1 -0
- package/dist/schemas/bridge_operation.output.json +1 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/local_cache_operation.output.json +1 -0
- package/dist/schemas/local_history_operation.output.json +1 -0
- package/dist/schemas/local_info_operation.output.json +1 -0
- package/dist/schemas/local_mark_operation.output.json +1 -0
- package/dist/schemas/onchain_operations.output.json +1 -0
- package/dist/schemas/onchain_operations.schema.json +3 -3
- package/dist/schemas/onchain_operations_arbitration.schema.json +1 -1
- package/dist/schemas/onchain_operations_machine.schema.json +1 -1
- package/dist/schemas/onchain_operations_service.schema.json +1 -1
- package/dist/schemas/query_toolkit.output.json +91 -7
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/move-fn-index.gen.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
package/dist/schema/call/base.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from'zod';import{WowTransactionBlockResponseSchema}from'../local/index.js';import{BalanceTypeSchema,EntrypointSchema,ObjectBaseSchema,GuardTableItemSchema,NameSchema,NameOrAddressSchema,TokenTypeWithDefaultSchema}from'../common/index.js';import{ENTRYPOINT,MAX_GUARD_COUNT_PASSPORT}from'@wowok/wowok';import{ERROR_CODE_VALUES}from'./error-codes.js';import{PERSONA_ROLES}from'../../persona/types.js';const NETWORKS=Object['values'](ENTRYPOINT)['join']('\x20|\x20');function findDiscriminatedUnion(a,b,c=0x0){if(c>0x6||!a||typeof a!=='object')return null;const d=a['_def'];if(!d)return null;const e=d['type']??d['typeName'];if(e==='union'&&Array['isArray'](d['options'])){const g=[];for(const h of d['options']){const i=findDiscriminatedUnion(h,b,c+0x1);if(i)g['push'](i);}return g['length']===0x1?g[0x0]:null;}if(e==='object'&&d['shape']){const j=typeof d['shape']==='function'?d['shape']():d['shape'];if(!j||typeof j!=='object')return null;for(const k of Object['keys'](j)){const l=j[k],m=l?.['_def'];if(!m)continue;const n=m['type']??m['typeName'];if(n==='union'&&Array['isArray'](m['options'])&&m['discriminator']){const p=String(m['discriminator']),q=b;if(!q||typeof q!=='object')continue;const r=q[k],s=pickArmByDiscriminator(m['options'],p,r,b);if(s)return{'arm':s,'path':[k]};}const o=findDiscriminatedUnion(l,b,c+0x1);if(o)return{'arm':o['arm'],'path':[k,...o['path']]};}return null;}const f=d['typeName']==='ZodEffects'?d['schema']:d['out']??d['innerType'];if(f&&f!==a)return findDiscriminatedUnion(f,b,c+0x1);return null;}function pickArmByDiscriminator(a,b,c,d){if(c===undefined||c===null)return null;const e=[];for(const f of a){const g=f?.['_def'],h=g?.['shape'];if(!h)continue;const i=typeof h==='function'?h():h,j=i?.[b],k=j?.['_def'],l=k?.['values']?k['values']:k?.['innerType']?[k['innerType']?.['value']]:undefined;if(!l)continue;const m=k['values']instanceof Set?[...k['values']]:Array['isArray'](l)?l:[k['value']];if(m['some'](n=>n===c))e['push'](f);}return e['length']===0x1?e[0x0]:null;}const DISCRIMINATED_UNION_FIELD_HINTS={'stock_add':'use\x20{op:\x27stock_add\x27,\x20sale_name:\x27<product\x20name>\x27,\x20value:<units\x20to\x20ADD>}','stock_reduce':'use\x20{op:\x27stock_reduce\x27,\x20sale_name:\x27<product\x20name>\x27,\x20value:<units\x20to\x20REMOVE>}','price_add':'use\x20{op:\x27price_add\x27,\x20sale_name:\x27<product\x20name>\x27,\x20value:<amount\x20to\x20ADD>}','price_reduce':'use\x20{op:\x27price_reduce\x27,\x20sale_name:\x27<product\x20name>\x27,\x20value:<amount\x20to\x20REMOVE>}','sale_suspension':'use\x20{op:\x27sale_suspension\x27,\x20sale_name:\x27<product\x20name>\x27,\x20suspension:<boolean>}'};function discriminatedUnionHint(a){const b=['op','operation_type','type'],c=new Set(),d=(e,f)=>{if(!e||typeof e!=='object'||f>0x4||c['has'](e))return null;c['add'](e);if(Array['isArray'](e)){for(const h of e){const i=d(h,f+0x1);if(i)return i;}return null;}const g=e;for(const j of b){const k=DISCRIMINATED_UNION_FIELD_HINTS[String(g[j])];if(k)return k;}for(const l of Object['values'](g)){const m=d(l,f+0x1);if(m)return m;}return null;};return d(a,0x0);}export function strictParse(a,b,c='input'){let d=a;while(!![]){const k=d['_def'];if(!k)break;const l=k['typeName']==='ZodEffects'?k['schema']:k['out']??k['innerType'];if(!l||l===d)break;d=l;}const e=d['_def'],f=typeof e?.['shape']==='function'?e['shape']():e?.['shape'];if(!f){const m=a['safeParse'](b);if(m['success'])return m['data'];throw new Error(formatParseFailure(a,b,m['error'],c));}const g=Object['keys'](f),h=Object['keys'](b||{}),i=h['filter'](n=>!g['includes'](n));if(i['length']>0x0)throw new Error('Unknown\x20'+c+'\x20field(s):\x20'+i['join'](',\x20')+'.\x20'+('Allowed\x20fields:\x20'+g['join'](',\x20')+'.\x20')+'Remove\x20the\x20unknown\x20field(s)\x20or\x20check\x20the\x20schema\x20for\x20the\x20correct\x20field\x20name.');const j=a['safeParse'](b);if(!j['success'])throw new Error(formatParseFailure(a,b,j['error'],c));return j['data'];}function formatParseFailure(a,b,c,d){const e=(i,j)=>(i??[])['map'](k=>{const l=k,m=l['path']??[],n=m['length']>0x0?m['map'](q=>typeof q==='number'?'['+q+']':String(q))['join']('.')['replace']('.[','['):'(root)';let o='';k['code']==='invalid_type'&&typeof l['expected']==='string'&&typeof l['received']==='string'&&(o='\x20(expected:\x20'+l['expected']+';\x20received:\x20'+l['received']+')');if(k['code']==='invalid_union'&&Array['isArray'](l['errors'])){const p=new Set(),q=r=>{for(const s of r){if(Array['isArray'](s)){if(s['length']>0x0)q(s);continue;}const t=s?.['errors'];if(Array['isArray'](t)&&t['length']>0x0)q(t);else{if(typeof s?.['message']==='string')p['add'](s['message']);}}};q(l['errors']),p['size']>0x0&&(o+='\x20('+[...p]['slice'](0x0,0x3)['join']('\x20|\x20')+')');}return'\x20\x20-\x20'+d+'.'+j+n+'\x20['+k['code']+']:\x20'+k['message']+o;}),f=discriminatedUnionHint(b),g=f?'\x0a\x0aThis\x20operation\x20matched\x20one\x20variant\x20of\x20a\x20discriminated\x20union\x20—\x20its\x20fields\x20are:\x20'+f+'.':'',h=findDiscriminatedUnion(a,b);if(h){const i=h['path']['length']>0x0?b?.[h['path'][0x0]]:b,j=h['path']['length']?h['path']['join']('.')+'.':'',k=h['arm']['safeParse'](i??b);if(!k['success'])return d+'\x20validation\x20failed\x20with\x20'+k['error']['issues']['length']+'\x20error(s):\x0a'+(''+e(k['error']['issues'],j)['join']('\x0a')+g);}return d+'\x20validation\x20failed\x20with\x20'+c['issues']['length']+'\x20error(s):\x0a'+(''+e(c['issues'],'')['join']('\x0a')+g);}export const NamedObjectSchema=z['object']({'name':NameSchema['optional']()['describe']('The\x20name\x20of\x20the\x20object'),'tags':z['array'](z['string']())['optional']()['describe']('The\x20tags\x20of\x20the\x20object'),'onChain':z['boolean']()['optional']()['describe']('CRITICAL:\x20Whether\x20to\x20sync\x20the\x20name\x20to\x20the\x20blockchain.\x20DEFAULT\x20(undefined/false):\x20The\x20name\x20is\x20stored\x20LOCALLY\x20ONLY\x20on\x20your\x20device\x20(PRIVATE).\x20If\x20set\x20to\x20true:\x20The\x20name\x20is\x20published\x20ON-CHAIN\x20and\x20becomes\x20PUBLICLY\x20VISIBLE\x20to\x20everyone.\x20Only\x20set\x20to\x20true\x20for\x20displaying\x20the\x20relationships\x20you\x20are\x20willing\x20to\x20make\x20public\x20on\x20the\x20chain.'),'replaceExistName':z['boolean']()['optional']()['describe']('FORCE\x20CLAIM:\x20Set\x20to\x20true\x20ONLY\x20when\x20the\x20user\x20explicitly\x20expresses\x20a\x20STRONG\x20INTENTION\x20to\x20forcefully\x20take\x20over\x20an\x20existing\x20name\x20(e.g.,\x20\x27I\x20must\x20use\x20this\x20name\x27,\x20\x27force\x20rename\x27,\x20\x27replace\x20the\x20existing\x20one\x27).\x20'+'WARNING:\x20This\x20will\x20UNBIND\x20the\x20name\x20from\x20its\x20original\x20object\x20and\x20rebind\x20it\x20to\x20the\x20new\x20one,\x20potentially\x20breaking\x20existing\x20references.\x20'+'If\x20not\x20specified\x20or\x20false:\x20the\x20operation\x20will\x20FAIL\x20with\x20an\x20error\x20when\x20the\x20name\x20is\x20already\x20in\x20use\x20(safe\x20default\x20behavior).')})['strict']()['describe']('Assign\x20a\x20name\x20and\x20optional\x20tags\x20to\x20a\x20new\x20object.\x20By\x20default,\x20names\x20are\x20stored\x20LOCALLY\x20(private)\x20on\x20your\x20device.\x20'+'Set\x20\x27onChain:\x20true\x27\x20to\x20create\x20a\x20PUBLIC\x20on-chain\x20identity\x20visible\x20to\x20everyone.\x20'+'IMPORTANT:\x20If\x20the\x20requested\x20name\x20is\x20already\x20taken,\x20the\x20operation\x20will\x20FAIL\x20by\x20default.\x20'+'Only\x20set\x20\x27replaceExistName:\x20true\x27\x20when\x20the\x20user\x20EXPLICITLY\x20demands\x20to\x20forcefully\x20claim\x20the\x20name.');export const NormalObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Example:\x20\x27my-service\x27\x20or\x20\x270x1234...\x27'),NamedObjectSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20specified\x20properties.\x20See\x20NamedObjectSchema\x20for\x20details\x20including\x20\x27name\x27\x20(optional),\x20\x27tags\x27\x20(optional),\x20\x27onChain\x27\x20(whether\x20to\x20make\x20name\x20public),\x20and\x20\x27replaceExistName\x27\x20(force\x20claim\x20existing\x20name).')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20using\x20NamedObjectSchema\x20structure\x20with\x20optional\x20name,\x20tags,\x20and\x20visibility\x20settings.');export const NamedObjectWithDescriptionSchema=NamedObjectSchema['extend']({'description':z['string']()['optional']()['describe']('The\x20description\x20of\x20the\x20object')})['strict']()['describe']('Create\x20a\x20new\x20object\x20with\x20a\x20name\x20and\x20optional\x20description.\x20The\x20name\x20helps\x20identify\x20the\x20object,\x20while\x20the\x20description\x20provides\x20additional\x20details\x20about\x20its\x20purpose\x20or\x20functionality.');export const DescriptionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Example:\x20\x27my-object\x27\x20or\x20\x270x1234...\x27'),NamedObjectWithDescriptionSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20name,\x20optional\x20description,\x20and\x20visibility\x20settings.\x20Extends\x20NamedObjectSchema\x20with\x20an\x20additional\x20\x27description\x27\x20field\x20for\x20detailed\x20object\x20information.')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20full\x20configuration\x20including\x20optional\x20name,\x20tags,\x20description,\x20and\x20visibility\x20settings\x20(local\x20private\x20by\x20default,\x20or\x20public\x20on-chain\x20with\x20onChain:true).');export const TypeNamedObjectSchema=NamedObjectSchema['extend']({'type_parameter':TokenTypeWithDefaultSchema['describe']('Payment\x20token\x20type\x20for\x20this\x20object\x20(format:\x20{address}::{module}::{struct}).\x20e.g.\x20ALWAYS\x20the\x20FULL\x20type\x20string\x20`{address}::{module}::{struct}`\x20e.g.\x20\x270x2::wow::WOW\x27.\x20⚠️\x20The\x20bare\x20names\x20\x27WOW\x27\x20/\x20\x27USDT\x27\x20/\x20\x27ETH\x27\x20are\x20REJECTED\x20(the\x20validator\x20requires\x20all\x20three\x20parts)\x20—\x20write\x20\x270x2::wow::WOW\x27,\x20not\x20\x27WOW\x27.\x20The\x20field\x20may\x20be\x20OMITTED\x20entirely:\x20it\x20then\x20defaults\x20to\x20WOW\x20(\x270x2::wow::WOW\x27).\x20This\x20token\x20is\x20what\x20the\x20object\x20accepts\x20for\x20payments\x20and\x20is\x20fixed\x20at\x20creation.\x20To\x20discover\x20other\x20available\x20tokens,\x20call\x20wowok_buildin_info\x20with\x20info\x20\x27mainnet\x20bridge\x20tokens\x27\x20and\x20use\x20the\x20returned\x20`wowTypeTag`\x20value\x20here.\x20NOTE:\x20testnet/localnet\x20carry\x20WOW\x20only\x20—\x20USDT/ETH\x20are\x20a\x20mainnet\x20capability.')})['describe']('Create\x20a\x20new\x20named\x20object\x20(with\x20optional\x20tags)\x20and\x20specify\x20a\x20token\x20type\x20for\x20payments\x20(e.g.,\x20WOW,\x20USDT,\x20ETH).');export const NamedObjectWithPermissionSchema=NamedObjectSchema['extend']({'permission':DescriptionObjectSchema['optional']()})['strict']()['describe']('Use\x20a\x20Permission\x20object\x20to\x20manage\x20access\x20control:\x20(1)\x20Specify\x20an\x20existing\x20Permission\x20object\x27s\x20name\x20or\x20ID;\x20(2)\x20Create\x20a\x20new\x20Permission\x20object\x20(which\x20can\x20be\x20named\x20and\x20tagged);\x20or\x20(3)\x20Leave\x20empty\x20to\x20automatically\x20create\x20a\x20new\x20unnamed\x20Permission\x20object.');export const TypeNamedObjectWithPermissionSchema=NamedObjectWithPermissionSchema['extend']({'type_parameter':TokenTypeWithDefaultSchema['describe']('Payment\x20token\x20type\x20for\x20this\x20object\x20(format:\x20{address}::{module}::{struct}).\x20e.g.\x20ALWAYS\x20the\x20FULL\x20type\x20string\x20`{address}::{module}::{struct}`\x20e.g.\x20\x270x2::wow::WOW\x27.\x20⚠️\x20The\x20bare\x20names\x20\x27WOW\x27\x20/\x20\x27USDT\x27\x20/\x20\x27ETH\x27\x20are\x20REJECTED\x20(the\x20validator\x20requires\x20all\x20three\x20parts)\x20—\x20write\x20\x270x2::wow::WOW\x27,\x20not\x20\x27WOW\x27.\x20The\x20field\x20may\x20be\x20OMITTED\x20entirely:\x20it\x20then\x20defaults\x20to\x20WOW\x20(\x270x2::wow::WOW\x27).\x20This\x20token\x20is\x20what\x20the\x20object\x20accepts\x20for\x20payments\x20and\x20is\x20fixed\x20at\x20creation.\x20To\x20discover\x20other\x20available\x20tokens,\x20call\x20wowok_buildin_info\x20with\x20info\x20\x27mainnet\x20bridge\x20tokens\x27\x20and\x20use\x20the\x20returned\x20`wowTypeTag`\x20value\x20here.\x20NOTE:\x20testnet/localnet\x20carry\x20WOW\x20only\x20—\x20USDT/ETH\x20are\x20a\x20mainnet\x20capability.')})['strict']()['describe']('Create\x20a\x20new\x20named\x20on-chain\x20object\x20with\x20both\x20a\x20specific\x20token\x20type\x20(e.g.,\x20WOW,\x20USDT,\x20ETH)\x20AND\x20permission\x20control.\x20Use\x20this\x20when\x20you\x20need\x20to\x20specify\x20a\x20token\x20type\x20for\x20payment\x20operations\x20AND\x20require\x20permission\x20management\x20(who\x20can\x20manage/operate\x20this\x20object).\x20For\x20objects\x20without\x20permission\x20management,\x20use\x20TypeNamedObjectSchema\x20instead.');export const CoinParamSchema=z['union']([z['object']({'balance':BalanceTypeSchema})['describe']('Specify\x20an\x20amount\x20value.'),z['object']({'coin':z['string']()['describe']('Coin\x20object\x20ID\x20or\x20name(local\x20mark).\x20WHOLE-COIN\x20TRANSFER:\x20the\x20ENTIRE\x20Coin\x20object\x20is\x20moved\x20to\x20the\x20recipient\x20—\x20the\x20\x27amount\x27\x20is\x20NOT\x20taken\x20from\x20it\x20(testnet\x20lesson:\x20passing\x20your\x20main\x20gas\x20coin\x20transfers\x20its\x20full\x20balance,\x20leaving\x20you\x20unable\x20to\x20pay\x20for\x20anything).\x20Use\x20only\x20for\x20coins\x20whose\x20whole\x20balance\x20is\x20exactly\x20what\x20you\x20intend\x20to\x20send;\x20prefer\x20{balance:\x20<smallest-unit\x20number>}\x20for\x20partial\x20amounts.')})])['describe']('Specify\x20the\x20amount\x20to\x20pay\x20from\x20the\x20transaction\x20account,\x20or\x20the\x20Coin\x20ID\x20owned\x20by\x20the\x20transaction\x20account.\x20Used\x20for\x20payment.');export const CallEnvSchema=z['object']({'account':NameOrAddressSchema['optional']()['default'](''),'permission_guard':z['array'](z['string']())['optional']()['describe']('List\x20of\x20permission\x20guard\x20IDs.\x20Used\x20to\x20extend\x20additional\x20operation\x20permissions\x20(requires\x20verification\x20and\x20configuration\x20in\x20the\x20Permission\x20object).'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20caching.'),'network':EntrypointSchema['optional']()['describe']('Omit\x20in\x20client/chat\x20contexts\x20—\x20the\x20runtime\x20stamps\x20the\x20user\x27s\x20CURRENT\x20network\x20(the\x20client\x27s\x20UI\x20selection).\x20Standalone\x20MCP/CLI:\x20omit\x20to\x20use\x20the\x20current\x20network;\x20set\x20ONLY\x20when\x20the\x20user\x20explicitly\x20names\x20a\x20different\x20network\x20(a\x20mismatch\x20pauses\x20for\x20user\x20confirmation).\x20Never\x20guess\x20or\x20hardcode\x20a\x20network.'),'referrer':NameOrAddressSchema['optional']()['describe']('Referrer\x20ID.\x20If\x20the\x20user\x20is\x20using\x20the\x20network\x20for\x20the\x20first\x20time,\x20the\x20referrer\x20ID\x20will\x20be\x20recorded\x20(also\x20applied\x20when\x20the\x20SDK\x20auto-registers\x20the\x20sender\x20in\x20the\x20global\x20Entity\x20table).'),'no_auto_register':z['boolean']()['optional']()['describe']('Opt-out\x20of\x20SDK-level\x20Entity\x20auto-registration.\x20By\x20default,\x20a\x20business\x20transaction\x20whose\x20sender\x20has\x20no\x20entry\x20in\x20the\x20global\x20Entity\x20table\x20automatically\x20appends\x20an\x20entity\x20registration:\x20the\x20sender\x20gets\x20registered\x20and\x20receives\x20an\x20owned\x20Resource\x20object\x20(their\x20on-chain\x20mark\x20book)\x20in\x20the\x20wallet.\x20Set\x20true\x20ONLY\x20when\x20the\x20user\x20explicitly\x20cancelled\x20their\x20entity\x20registration\x20or\x20demands\x20that\x20the\x20transaction\x20not\x20touch\x20the\x20Entity\x20table.'),'confirmed':z['boolean']()['optional']()['describe']('Phase\x202\x20ConfirmGate:\x20set\x20to\x20true\x20to\x20proceed\x20after\x20a\x20\x27pending_confirmation\x27\x20result.\x20The\x20operation\x20is\x20NOT\x20executed\x20until\x20you\x20re-call\x20with\x20confirmed=true\x20after\x20user\x20consent.'),'user_intent_phrases':z['array'](z['string']())['optional']()['describe']('Phase\x202\x20ConfirmGate:\x20explicit\x20user\x20intent\x20phrases\x20collected\x20from\x20conversation\x20context\x20(e.g.\x20\x27use\x20default\x20account\x27,\x20\x27force\x20publish\x27).\x20Used\x20to\x20bypass\x20confirmation\x20rules\x20whose\x20bypass_on_explicit_intent\x20matches.'),'plan_approval':z['string']()['optional']()['describe']('K3\x2024\x20PlanApproval:\x20id\x20of\x20a\x20goal\x20whose\x20plan\x20was\x20approved\x20via\x20goal_operation\x20action=\x27approve\x27.\x20When\x20set:\x201)\x20the\x20ConfirmGate\x20treats\x20fail-open\x20rules\x20(standard/none\x20levels)\x20as\x20pre-approved\x20for\x20operations\x20under\x20this\x20goal\x27s\x20plan;\x202)\x20after\x20successful\x20CREATION\x20operations,\x20the\x20created\x20objects\x20are\x20auto-registered\x20into\x20the\x20goal\x20(GoalRecord.objects\x20+\x20its\x20TaskProcess\x20manifest\x20—\x20ACT\x20station\x20\x27execution\x20registers\x27).\x20Fail-closed\x20levels\x20(irreversible/publish/amount)\x20still\x20require\x20per-operation\x20confirmation\x20with\x20env.confirmed=true.'),'client_schema_version':z['string']()['optional']()['describe']('Client-side\x20schema\x20version\x20(semver,\x20e.g.\x20\x271.0.0\x27).\x20When\x20provided,\x20the\x20server\x20checks\x20compatibility\x20and\x20attaches\x20warnings\x20if\x20mismatched.'),'schema_strict_mode':z['boolean']()['optional']()['default'](![])['describe']('When\x20true,\x20schema\x20incompatibility\x20returns\x20an\x20error\x20instead\x20of\x20a\x20warning.\x20Default:\x20false\x20(warn\x20mode).'),'dry_run':z['boolean']()['optional']()['describe']('Phase\x201\x20dry_run:\x20when\x20true,\x20SIMULATE\x20the\x20transaction\x20without\x20signing\x20or\x20submitting.\x20Returns\x20effects\x20+\x20events\x20showing\x20what\x20WOULD\x20happen\x20—\x20no\x20on-chain\x20state\x20is\x20modified,\x20no\x20gas\x20is\x20charged.\x20Use\x20this\x20to\x20verify\x20that\x20an\x20operation\x20will\x20succeed\x20before\x20committing.\x20The\x20returned\x20digest\x20will\x20be\x20\x27dry_run:<timestamp>\x27\x20and\x20objectChanges\x20will\x20be\x20empty\x20(simulation\x20only).'),'response_level':z['enum'](['compact','full'])['optional']()['describe']('Write-success\x20response\x20size.\x20\x27compact\x27\x20(default)\x20trims\x20the\x20structured\x20result\x20to\x20key\x20fields\x20(digest\x20+\x20created\x20object\x20references);\x20\x27full\x27\x20includes\x20the\x20complete\x20raw\x20result.\x20Default:\x20compact.'),'confirm_mode':z['enum'](['full','streamlined','quiet'])['optional']()['describe']('Confirmation\x20frequency\x20for\x20this\x20call.\x20\x27full\x27:\x20confirm\x20every\x20matched\x20gate\x20rule.\x20\x27streamlined\x27\x20(client\x20default):\x20skip\x20fail-open\x20\x27standard\x27\x20level\x20prompts\x20—\x20fail-closed\x20levels\x20(irreversible/publish/amount)\x20ALWAYS\x20still\x20confirm.\x20\x27quiet\x27:\x20same\x20hard\x20floor\x20as\x20streamlined,\x20for\x20clients\x20that\x20batch/suppress\x20repeat\x20low-risk\x20prompts\x20in\x20their\x20own\x20UI.\x20This\x20field\x20NEVER\x20downgrades\x20fail-closed\x20levels.')})['strict']()['describe']('IMPORTANT:\x20Execution\x20environment\x20includes:\x20account\x20for\x20signing\x20operations,\x20network\x20selection\x20('+NETWORKS+'),\x20additional\x20Guard\x20permissions,\x20and\x20more.\x20Used\x20to\x20specify\x20context\x20information\x20during\x20the\x20call.\x20If\x20account\x20is\x20not\x20specified,\x20the\x20default\x20account\x20(\x22\x22)\x20will\x20be\x20used.\x20NOTE:\x20by\x20default\x20the\x20SDK\x20auto-registers\x20the\x20sender\x20in\x20the\x20global\x20Entity\x20table\x20when\x20absent\x20(first\x20business\x20transaction;\x20the\x20account\x20receives\x20an\x20owned\x20Resource\x20object).\x20Set\x20no_auto_register=true\x20only\x20on\x20explicit\x20user\x20request.');export const ObjectsOpSchema=z['union']([z['object']({'op':z['literal']('set')['or'](z['literal']('add'))['or'](z['literal']('remove')),'objects':z['array'](NameOrAddressSchema)})['describe']('Set,\x20add,\x20or\x20remove\x20object\x20ID\x20list.'),z['object']({'op':z['literal']('clear')})['describe']('Remove\x20all\x20objects.')])['describe']('Operate\x20object\x20list.\x20Used\x20to\x20set,\x20add,\x20or\x20remove\x20objects.');export const ResponseDataSchema=ObjectBaseSchema['extend']({'change':z['union']([z['literal']('created'),z['literal']('mutated'),z['string']()])['describe']('What\x20happened\x20to\x20this\x20object\x20in\x20the\x20operation.\x20Constraint:\x20\x27created\x27\x20|\x20\x27mutated\x27\x20|\x20custom\x20string.\x20Example:\x20\x27created\x27')})['describe']('One\x20object\x20record\x20in\x20a\x20query\x20result.\x20Contains\x20the\x20object\x27s\x20basic\x20info\x20plus\x20how\x20it\x20changed\x20in\x20this\x20operation.');export const ObjectRoleSchema=z['object']({'id':z['string']()['describe']('Object\x20ID\x20(64-hex\x20with\x200x\x20prefix).\x20Identifies\x20the\x20on-chain\x20object.\x20Example:\x20\x270xa1d4...\x27'),'name':z['union']([z['string'](),z['null']()])['optional']()['describe']('Local\x20mark\x20name\x20if\x20assigned,\x20else\x20null.\x20Relation:\x20resolved\x20via\x20local_mark_operation.\x20Example:\x20\x27my-shop\x27\x20or\x20null'),'role':z['enum'](['Permission','Guard','Machine','Progress','Service','Order','Allocation','Arbitration','ArbCase','Messenger','Contact','Demand','Reward','Personal','Repository','Treasury','Discount','Payment','Passport','Proof','Other'])['describe']('Business\x20role\x20of\x20the\x20object\x20in\x20the\x20dependency\x20graph.\x20Constraint:\x20enum\x20of\x2021\x20values.\x20Relation:\x20derived\x20from\x20objectType\x20last\x20segment;\x20drives\x20Plan/Verify\x20Loop\x20positioning.\x20Example:\x20\x27Service\x27'),'relation':z['object']({'parent':z['union']([z['string'](),z['null']()])['optional']()['describe']('Parent\x20object\x20ID,\x20if\x20this\x20object\x20belongs\x20to\x20another\x20(e.g.\x20Machine\x20belongs\x20to\x20Service).\x20Example:\x20\x270x123...\x27\x20or\x20null'),'relation_type':z['enum'](['machine_of','guard_of','allocator_of','permission_of','progress_of','allocation_of','arb_of','other'])['optional']()['describe']('How\x20this\x20object\x20relates\x20to\x20its\x20parent.\x20Example:\x20\x27machine_of\x27')})['optional']()['describe']('Relationship\x20to\x20another\x20object\x20in\x20the\x20dependency\x20graph'),'immutable':z['boolean']()['optional']()['describe']('Whether\x20the\x20object\x20has\x20entered\x20an\x20immutable\x20state\x20(e.g.\x20Service\x20published).\x20Constraint:\x20true\x20after\x20publish.\x20Example:\x20true')})['strict']()['describe']('An\x20object\x20tagged\x20with\x20its\x20business\x20role\x20and\x20relationship\x20within\x20the\x20object\x20dependency\x20graph');export const FundRoleSchema=z['object']({'amount':z['string']()['describe']('Amount\x20change\x20as\x20stringified\x20integer\x20(smallest\x20unit).\x20Negative=spend,\x20positive=receive.\x20Example:\x20\x27-10000000000\x27'),'coinType':z['string']()['describe']('Coin\x20type\x20tag\x20(format:\x20{address}::{module}::{struct}).\x20Example:\x20\x270x2::wow::WOW\x27'),'role':z['enum'](['payment','refund','change','compensation','reward','gas','deposit','release','other'])['describe']('Business\x20role\x20of\x20this\x20fund\x20movement.\x20Constraint:\x20enum\x20of\x209\x20values.\x20Relation:\x20derived\x20from\x20operation\x20context.\x20Example:\x20\x27payment\x27'),'from':z['string']()['nullable']()['optional']()['describe']('Sender\x20address\x20if\x20known.\x20Example:\x20\x270xabc...\x27\x20or\x20null'),'to':z['string']()['nullable']()['optional']()['describe']('Recipient\x20address\x20if\x20known.\x20Example:\x20\x270xdef...\x27\x20or\x20null')})['strict']()['describe']('A\x20fund\x20movement\x20tagged\x20with\x20its\x20business\x20role');export const NextActionSchema=z['object']({'action':z['string']()['describe']('Recommended\x20next\x20action.\x20Example:\x20\x27add\x20sales\x20products\x27'),'reason':z['string']()['describe']('Why\x20this\x20action\x20is\x20recommended.\x20Example:\x20\x27Service\x20has\x20no\x20products;\x20customers\x20cannot\x20order\x27'),'tool':z['string']()['optional']()['describe']('MCP\x20tool\x20to\x20use,\x20if\x20applicable.\x20Example:\x20\x27onchain_operations\x27'),'prerequisite':z['string']()['optional']()['describe']('Condition\x20that\x20must\x20hold\x20before\x20this\x20action.\x20Example:\x20\x27Service\x20must\x20be\x20created\x20first\x27'),'priority':z['enum'](['required','recommended','optional'])['describe']('Priority.\x20Constraint:\x20enum.\x20Example:\x20\x27required\x27')})['strict']()['describe']('A\x20recommended\x20next\x20action\x20with\x20priority\x20and\x20rationale');export const EventSemanticSchema=z['object']({'event_type':z['string']()['describe']('Raw\x20on-chain\x20event\x20type\x20tag.\x20Example:\x20\x270x2::service::ServicePublishedEvent\x27'),'business_meaning':z['string']()['describe']('Human-readable\x20business\x20meaning.\x20Example:\x20\x27Service\x20has\x20been\x20published\x20and\x20is\x20now\x20immutable\x27'),'category':z['enum'](['lifecycle','state_change','fund_flow','market_opportunity','reputation','permission','guard','other'])['describe']('Business\x20category.\x20Constraint:\x20enum\x20of\x208\x20values.\x20\x27market_opportunity\x27\x20=\x20supply/demand\x20discovery\x20signal\x20(ServiceEvent/DemandChangedEvent/DemandPresentEvent,\x20K3\x2013\x20§6.7);\x20\x27reputation\x27\x20=\x20trust-affecting\x20signal\x20(DemandFeedbackEvent).\x20Example:\x20\x27fund_flow\x27'),'related_object':z['string']()['optional']()['describe']('Object\x20ID\x20the\x20event\x20relates\x20to,\x20if\x20extractable.\x20Example:\x20\x270x123...\x27'),'side_effect':z['string']()['optional']()['describe']('Side\x20effect\x20description\x20for\x20AI.\x20Example:\x20\x27Customers\x20can\x20now\x20place\x20orders\x20against\x20this\x20Service\x27')})['strict']()['describe']('An\x20on-chain\x20event\x20annotated\x20with\x20business\x20semantics');export const ExperienceSchema=z['object']({'advice':z['string']()['optional']()['describe']('Advice\x20from\x20past\x20experience.\x20Example:\x20\x27Last\x20time\x20you\x20forgot\x20to\x20set\x20buy_guard;\x20add\x20it\x20before\x20publishing\x27'),'avoid':z['array'](z['string']())['optional']()['describe']('Pitfalls\x20to\x20avoid\x20based\x20on\x20history.\x20Example:\x20[\x27Guard\x20rejection\x20on\x20delivery_proof\x27]'),'relevance':z['number']()['min'](0x0)['max'](0x1)['optional']()['describe']('Relevance\x20score\x200-1\x20of\x20the\x20matched\x20experience.\x20Example:\x200.85'),'matched_scenario':z['string']()['optional']()['describe']('Matched\x20historical\x20scenario.\x20Example:\x20\x27publish_service_freelance\x27')})['strict']()['describe']('Experience\x20layer\x20feedback\x20from\x20past\x20operations\x20(Phase\x202\x20Topic\x202).\x20Provides\x20advice\x20and\x20pitfalls\x20based\x20on\x20historical\x20patterns.');export const ServiceStatusSchema=z['object']({'active':z['array'](z['string']())['describe']('Phase\x202\x20services\x20currently\x20active\x20(enabled).\x20Example:\x20[\x27confirm_gate\x27,\x27experience_layer\x27]'),'inactive':z['array'](z['string']())['optional']()['describe']('Phase\x202\x20services\x20currently\x20inactive\x20(can\x20be\x20toggled\x20via\x20config_operation).\x20Example:\x20[\x27harness\x27]')})['strict']()['describe']('Phase\x202\x20runtime\x20service\x20status\x20(populated\x20when\x20semantic_rich\x20is\x20enabled).\x20Lets\x20AI\x20see\x20which\x20services\x20are\x20active\x20in\x20each\x20response.');export const CustomerReminderSchema=z['object']({'id':z['string']()['describe']('Reminder\x20rule\x20id.\x20Example:\x20\x27high_risk_score\x27'),'stage':z['enum'](['browse','evaluate','preorder','in_progress','complete','after_sale'])['describe']('Order\x20lifecycle\x20stage\x20when\x20this\x20reminder\x20fires.\x20Example:\x20\x27evaluate\x27'),'priority':z['enum'](['required','recommended','info','reminder'])['describe']('Priority.\x20\x27required\x27\x20=\x20blocks\x20purchase;\x20\x27recommended\x27\x20=\x20strong\x20caution.\x20Example:\x20\x27required\x27'),'message':z['string']()['describe']('Human-readable\x20reminder\x20message.\x20Example:\x20\x27Composite\x20risk\x20score\x2025/100,\x20strongly\x20discourage\x20purchase\x27'),'action':z['string']()['optional']()['describe']('Suggested\x20next\x20action.\x20Example:\x20\x27require\x20merchant\x20to\x20bind\x20Arbitration\x20before\x20ordering\x27')})['strict']()['describe']('A\x20buyer-side\x20reminder\x20triggered\x20at\x20a\x20specific\x20order\x20lifecycle\x20stage\x20(Phase\x203\x20C-3).');export const PreferenceMatchSchema=z['object']({'score':z['number']()['min'](0x0)['max'](0x64)['describe']('Match\x20score\x200-100\x20(higher\x20=\x20better\x20fit).\x20Example:\x2075'),'matches':z['array'](z['string']())['describe']('Aspects\x20that\x20match\x20user\x20preferences.\x20Example:\x20[\x27Price\x2010%\x20below\x20average\x27,\x27Has\x20arbitration\x27]'),'mismatches':z['array'](z['string']())['describe']('Aspects\x20that\x20mismatch\x20user\x20preferences.\x20Example:\x20[\x27Delivery\x20cycle\x20exceeds\x20expectation\x27]')})['strict']()['describe']('Service-to-preference\x20match\x20result\x20(Phase\x203\x20C-2).\x207-dimension\x20scoring:\x20price/time/region/brand/bargain/emotion/risk.');export const CustomerAdviceSchema=z['object']({'risk_score':z['number']()['min'](0x0)['max'](0x64)['optional']()['describe']('Composite\x20risk\x20score\x200-100\x20(higher\x20=\x20safer).\x20Relation:\x20risk\x20dimension\x20of\x20the\x20onchain_topology\x20graph\x20evaluation.\x20Example:\x2075'),'risk_level':z['enum'](['low','medium_low','medium_high','high'])['optional']()['describe']('Risk\x20level\x20bucket.\x20\x27high\x27\x20=\x20strongly\x20discourage\x20purchase.\x20Example:\x20\x27medium_high\x27'),'recommendations':z['array'](z['string']())['describe']('Actionable\x20recommendations\x20for\x20the\x20buyer.\x20Example:\x20[\x27Require\x20merchant\x20to\x20configure\x20arbitration\x27,\x27Negotiate\x20refund\x20terms\x20via\x20Messenger\x27]'),'reminders':z['array'](CustomerReminderSchema)['describe']('Stage-specific\x20reminders\x20(deduped,\x20sorted\x20by\x20priority,\x20capped\x20to\x203\x20high-risk).\x20Example:\x20[{priority:\x27required\x27,\x20message:\x27Ambiguous\x20Guard\x20must\x20be\x20human-reviewed\x27}]'),'preference_match':PreferenceMatchSchema['optional']()['describe']('Service-to-preference\x20match\x20(populated\x20when\x20user\x20preferences\x20exist).\x20Example:\x20{score:75,\x20matches:[...],\x20mismatches:[...]}')})['strict']()['describe']('Buyer-side\x20advice\x20(Phase\x203\x20C-3.3).\x20Populated\x20in\x20semantic.customer_advice\x20for\x20order/query\x20operations\x20when\x20customer_intelligence\x20service\x20is\x20enabled.');export const EvolutionContextSchema=z['object']({'industry_signal':z['string']()['optional']()['describe']('Industry\x20evolution\x20signal\x20summary.\x20Example:\x20\x27Industry\x20health\x2082/100\x20(healthy);\x2025\x20cumulative\x20industry\x20signals\x27'),'evolution_advice':z['string']()['optional']()['describe']('Evolution\x20advice\x20for\x20the\x20current\x20operation.\x20Example:\x20\x27Recommend\x20mandatory\x20arbitration\x20+\x20compensation\x20fund\x20+\x20delivery\x20Guard\x27'),'confidence':z['number']()['min'](0x0)['max'](0x1)['describe']('Confidence\x20of\x20the\x20evolution\x20context\x200-1.\x20<0.5\x20means\x20no\x20data\x20yet.\x20Example:\x200.75'),'health_score':z['number']()['min'](0x0)['max'](0x64)['optional']()['describe']('Industry\x20health\x20score\x200-100\x20if\x20available.\x20Example:\x2082'),'pending_suggestions':z['number']()['int']()['min'](0x0)['optional']()['describe']('Count\x20of\x20pending\x20industry\x20update\x20suggestions\x20(filtered\x20by\x20role\x20if\x20role\x20is\x20set).\x20Example:\x203'),'intent':z['enum'](['default','growth','retention','compliance','efficiency','trust_building','custom'])['optional']()['describe']('Phase\x204\x20P4-6.C:\x20Current\x20business\x20intent\x20driving\x20the\x20scoring\x20model.\x20Absent\x20=\x20\x27default\x27.\x20Example:\x20\x27growth\x27'),'role_advice':z['array'](z['string']())['optional']()['describe']('Phase\x204\x20P4-6.C:\x20Role-targeted\x20advice\x20strings\x20(merchant/customer/demander/prospect/supplier/collaborator/arbitrator).\x20Example:\x20[\x27Strengthen\x20loyalty\x20flywheel\x27,\x27Optimize\x20first-order\x20conversion\x27]'),'role':z['enum'](PERSONA_ROLES)['optional']()['describe']('Phase\x204\x20P4-6.C:\x20Role\x20used\x20for\x20advice\x20routing.\x20Example:\x20\x27merchant\x27')})['strict']()['describe']('Phase\x204\x20industry\x20evolution\x20context\x20(populated\x20when\x20industry_evolution\x20service\x20is\x20enabled).\x20Provides\x20AI\x20with\x20industry-level\x20health\x20signals,\x20evolution\x20advice,\x20and\x20role-targeted\x20recommendations.');export const GuardPuzzleStatusSchema=z['object']({'intent':z['boolean']()['describe']('Intent\x20dimension\x20complete\x20(action\x20+\x20rule\x20+\x20failure\x20conditions)'),'binding':z['boolean']()['describe']('Binding\x20dimension\x20complete\x20(host\x20object\x20+\x20field\x20+\x20circular\x20ref)'),'data':z['boolean']()['describe']('Data\x20dimension\x20complete\x20(table\x20entries\x20+\x20witnesses)'),'query':z['boolean']()['describe']('Query\x20dimension\x20complete\x20(query\x20instructions\x20if\x20needed)'),'logic':z['boolean']()['describe']('Logic\x20dimension\x20complete\x20(root\x20node\x20returns\x20Bool)'),'constraints':z['boolean']()['describe']('Constraints\x20dimension\x20complete\x20(10\x20Pitfalls\x20checked)')})['strict']()['describe']('Guard\x20information\x20puzzle\x20completeness\x20status.\x206\x20dimensions\x20(A-F).\x20false\x20=\x20missing,\x20needs\x20user\x20input.');export const GuardAvailableQuerySchema=z['object']({'id':z['number']()['int']()['describe']('Query\x20instruction\x20ID.\x20Example:\x201253'),'name':z['string']()['describe']('Query\x20instruction\x20name.\x20Example:\x20\x27progress.current\x27'),'objectType':z['string']()['describe']('Target\x20object\x20type.\x20Example:\x20\x27Progress\x27'),'returnType':z['string']()['describe']('Return\x20value\x20type.\x20Example:\x20\x27String\x27'),'description':z['string']()['optional']()['describe']('Query\x20description')})['strict']()['describe']('A\x20Guard\x20query\x20instruction\x20available\x20for\x20the\x20current\x20context\x20(subset\x20of\x20GUARDQUERY\x20375\x20entries).');export const GuardAdviceSchema=z['object']({'current_round':z['enum'](['R1','R2','R3','R4','R5','R6','R7','R8','R9','R10'])['optional']()['describe']('Current\x20R1-R10\x20dialogue\x20round.\x20R1=intent,\x20R2=table,\x20R3=tree,\x20R4=rely,\x20R5=binding,\x20R6=review,\x20R7=CREATE,\x20R8=test,\x20R9=bind,\x20R10=verify.\x20Example:\x20\x27R3\x27'),'puzzle_status':GuardPuzzleStatusSchema['optional']()['describe']('Information\x20puzzle\x20completeness\x20(6\x20dimensions).\x20Missing\x20dimensions\x20need\x20user\x20input\x20before\x20CREATE.'),'matched_scene':z['string']()['optional']()['describe']('Matched\x20Guard\x20scene\x20id\x20from\x20the\x208\x20binding\x20scenarios\x20ledger.\x20Example:\x20\x27machine_forward_guard\x27'),'scene_description':z['string']()['optional']()['describe']('Human-readable\x20scene\x20description.\x20Example:\x20\x27Workflow\x20node\x20forward\x20validation\x20(Forward.guard)\x27'),'scene_constraints':z['array'](z['string']())['optional']()['describe']('Special\x20constraints\x20for\x20the\x20matched\x20scene.\x20Example:\x20[\x27Forward.guard\x20cannot\x20be\x20modified\x20after\x20Machine\x20is\x20published\x27]'),'suggested_patterns':z['array'](z['string']())['optional']()['describe']('Suggested\x20Guard\x20patterns\x20based\x20on\x20user\x20intent.\x20Example:\x20[\x27time\x20lock\x27,\x27progress\x20status\x20check\x27]'),'available_queries':z['array'](GuardAvailableQuerySchema)['optional']()['describe']('Available\x20query\x20instructions\x20for\x20the\x20current\x20context\x20(subset\x20of\x20375\x20GUARDQUERY\x20entries)'),'risk_warnings':z['array'](z['string']())['optional']()['describe']('Risk\x20warnings\x20for\x20the\x20current\x20Guard\x20design.\x20Example:\x20[\x27Guard\x20cannot\x20be\x20modified\x20after\x20creation\x27,\x27Time\x20lock\x20test\x20uses\x201000ms\x27]'),'pending_questions':z['array'](z['string']())['optional']()['describe']('Questions\x20for\x20the\x20user\x20to\x20complete\x20the\x20puzzle.\x20Example:\x20[\x27Which\x20Host\x20Object\x20will\x20the\x20Guard\x20bind\x20to?\x27]'),'confirmation_text':z['string']()['optional']()['describe']('Structured\x20semantic\x20confirmation\x20text\x20for\x20user\x20review\x20(generated\x20when\x20puzzle\x20is\x20complete).\x20User\x20must\x20explicitly\x20confirm\x20before\x20CREATE.'),'test_result':z['object']({'status':z['enum'](['pass','fail','not_tested']),'failure_node':z['string']()['optional']()['describe']('Node\x20that\x20caused\x20failure\x20(if\x20fail)'),'passport_id':z['string']()['optional']()['describe']('Generated\x20Passport\x20ID\x20(if\x20pass)'),'guard_results':z['array'](z['object']({'guard':z['string'](),'result':z['boolean'](),'impack':z['boolean']()['optional']()}))['optional']()['describe']('Per-Guard\x20evaluation\x20result\x20read\x20from\x20the\x20Passport\x20(docs#40:\x20the\x20pass/fail\x20status\x20comes\x20from\x20Passport.result,\x20not\x20transaction\x20success)')})['optional']()['describe']('gen_passport\x20static\x20test\x20result.\x20status\x20is\x20read\x20from\x20the\x20created\x20Passport\x27s\x20on-chain\x20result\x20field;\x20tx\x20success\x20alone\x20never\x20means\x20the\x20Guard\x20passed.'),'risk_assessment':z['object']({'overall_risk':z['enum'](['critical','high','medium','low','info'])['describe']('Overall\x20risk\x20level\x20(highest\x20from\x20all\x20risks)'),'risk_count':z['number']()['int']()['describe']('Total\x20number\x20of\x20detected\x20risks'),'critical_count':z['number']()['int']()['describe']('Number\x20of\x20critical\x20risks'),'high_count':z['number']()['int']()['describe']('Number\x20of\x20high\x20risks'),'needs_human_review':z['boolean']()['describe']('Whether\x20human\x20review\x20is\x20required\x20(critical\x20or\x202+\x20high\x20risks)'),'top_risks':z['array'](z['string']())['describe']('Top\x20risk\x20titles\x20(critical\x20and\x20high,\x20max\x203)'),'stakeholder_advice':z['record'](z['string'](),z['array'](z['string']()))['optional']()['describe']('Per-stakeholder\x20advice.\x20Key=stakeholder\x20(customer/provider/arbitrator/claimant),\x20value=advice\x20list')})['optional']()['describe']('Business-layer\x20risk\x20assessment\x20(game\x20theory,\x20data\x20source\x20trust,\x20logic\x20gaps).\x20Populated\x20during\x20Guard\x20design\x20to\x20warn\x20about\x20business\x20risks\x20beyond\x20syntax.')})['strict']()['describe']('Guard\x20advice\x20(Phase\x205\x20Guard\x20capability\x20system).\x20Injected\x20when\x20user\x20intent\x20involves\x20Guard.\x20Provides\x20context\x20for\x20Guard\x20design,\x20generation,\x20confirmation,\x20and\x20execution.');export const WorkflowOperatorSchema=z['object']({'kind':z['enum'](['order_holder','permission_index','named_operator'])['describe']('Who\x20can\x20execute\x20this\x20forward\x20(K3\x20feasibility).\x20\x27order_holder\x27\x20=\x20the\x20Order\x20owner\x20(customer;\x20forward\x20namedOperator=\x27\x27),\x20\x27permission_index\x27\x20=\x20a\x20permission\x20role,\x20\x27named_operator\x27\x20=\x20a\x20specific\x20Progress\x20namespace\x20operator.'),'permission_index':z['number']()['int']()['optional']()['describe']('Permission\x20index\x20when\x20kind=\x27permission_index\x27.\x20Example:\x201000'),'role_name':z['string']()['optional']()['describe']('Resolved\x20role\x20display\x20name.\x20Example:\x20\x27merchant\x20(permission\x201000)\x27\x20/\x20\x27order\x20holder\x20(customer)\x27'),'account_name':z['string']()['optional']()['describe']('Resolved\x20local\x20account/mark\x20name\x20when\x20the\x20operator\x20maps\x20to\x20a\x20concrete\x20account.\x20Example:\x20\x27london_guide\x27'),'named_operator':z['string']()['optional']()['describe']('NamedOperator\x20namespace\x20when\x20kind=\x27named_operator\x27.\x20Example:\x20\x27delivery_team\x27')})['strict']()['describe']('The\x20account/permission\x20that\x20can\x20execute\x20a\x20workflow\x20forward\x20(K3\x20Game\x20feasibility:\x20who\x20can\x20act).');export const WorkflowOptionSchema=z['object']({'next_node':z['string']()['describe']('Target\x20node\x20this\x20forward\x20advances\x20INTO.\x20Example:\x20\x27serving\x27'),'forward':z['string']()['describe']('Forward\x20(operation)\x20name.\x20Example:\x20\x27StartService\x27'),'weight':z['number']()['describe']('Forward\x20weight\x20contributed\x20toward\x20the\x20pair\x20threshold.\x20Example:\x201'),'operator':WorkflowOperatorSchema['describe']('Who\x20can\x20execute\x20this\x20forward\x20(which\x20account\x20+\x20which\x20permission).'),'guard':z['string']()['optional']()['describe']('Guard\x20bound\x20to\x20the\x20forward\x20—\x20acceptance\x20condition\x20verified\x20BEFORE\x20the\x20transition.\x20Example:\x20\x27guard_payout\x27'),'business_meaning':z['string']()['describe']('Business\x20meaning\x20of\x20advancing\x20to\x20this\x20node.\x20Example:\x20\x27Guide\x20starts\x20the\x20day\x20service\x27'),'gains':z['array'](z['string']())['optional']()['describe']('Gains\x20for\x20the\x20caller\x20if\x20this\x20option\x20is\x20chosen\x20(K3\x20Game\x20G1\x20gain\x20separation).\x20Example:\x20[\x27Settlement\x20unlocked\x20—\x20funds\x20releasable\x20to\x20provider\x20via\x20an\x20explicit\x20allocation\x20step\x27]'),'risks':z['array'](z['string']())['optional']()['describe']('Risks\x20for\x20the\x20caller\x20if\x20this\x20option\x20is\x20chosen\x20(K3\x20Game\x20G1\x20risk\x20separation).\x20Example:\x20[\x27Refund\x20leverage\x20lost\x20after\x20confirmation\x27]'),'consistency':z['number']()['min'](0x0)['max'](0x64)['optional']()['describe']('Consistency\x200-100\x20between\x20this\x20option\x27s\x20business\x20semantics\x20and\x20the\x20caller\x27s\x20interests\x20(K3\x20Game\x20optimality).\x20Higher\x20=\x20more\x20aligned.'),'recommended':z['boolean']()['optional']()['describe']('Whether\x20this\x20is\x20the\x20recommended\x20option\x20(highest\x20consistency).')})['strict']()['describe']('A\x20reachable\x20next-node\x20option\x20with\x20its\x20operator/permission,\x20guard,\x20business\x20meaning,\x20and\x20K3-style\x20gains/risks/consistency.');export const WorkflowRecommendationSchema=z['object']({'best':z['string']()['optional']()['describe']('Recommended\x20action\x20in\x20\x27<forward>\x20→\x20<next_node>\x27\x20form.\x20Example:\x20\x27StartService\x20→\x20serving\x27'),'rationale':z['string']()['optional']()['describe']('Why\x20this\x20option\x20is\x20recommended\x20(framed\x20at\x20the\x20caller\x27s\x20value:\x20gains/risks).\x20Example:\x20\x27For\x20the\x20guide,\x20advancing\x20to\x20serving\x20triggers\x20the\x20delivery\x20flow\x27'),'caveat':z['string']()['optional']()['describe']('Disclosed\x20trade-off\x20/\x20opportunity\x20cost\x20of\x20NOT\x20taking\x20another\x20path\x20(K3\x20Game\x20G3\x20opportunity\x20cost).\x20Example:\x20\x27Choosing\x20cancelled\x20forfeits\x20this\x20order\x27s\x20settlement\x27')})['strict']()['describe']('K3-based\x20recommendation\x20(AI\x20recommends,\x20human\x20decides\x20—\x20the\x20choice\x20always\x20remains\x20with\x20the\x20account).');export const WorkflowGuidanceSchema=z['object']({'current_node':z['string']()['describe']('Current\x20node\x20of\x20the\x20Progress.\x20Example:\x20\x27serving\x27'),'caller':z['string']()['optional']()['describe']('The\x20account\x20(name/address)\x20this\x20guidance\x20is\x20framed\x20for\x20(env.account).\x20Example:\x20\x27london_guide\x27'),'options':z['array'](WorkflowOptionSchema)['describe']('ALL\x20reachable\x20next-node\x20directions\x20(every\x20operator/permission/guard\x20disclosed).'),'recommendation':WorkflowRecommendationSchema['optional']()['describe']('Recommended\x20option\x20with\x20rationale\x20(K3\x20Game\x20intent/game/interests).'),'note':z['string']()['optional']()['describe']('Additional\x20note\x20(e.g.\x20wait\x20for\x20the\x20other\x20party,\x20entry/terminal\x20hint).')})['strict']()['describe']('Permission-aware\x20workflow\x20guidance:\x20current\x20node\x20+\x20every\x20reachable\x20next\x20node\x20with\x20its\x20operator/permission/guard\x20and\x20a\x20K3-framed\x20recommendation.');export const WorkflowWaitingSchema=z['object']({'forward':z['string']()['describe']('Forward\x20still\x20required\x20to\x20reach\x20the\x20threshold.\x20Example:\x20\x27GuideConfirm\x27'),'operator':WorkflowOperatorSchema['describe']('Who\x20must\x20execute\x20this\x20forward\x20next.')})['strict']()['describe']('A\x20forward\x20still\x20pending\x20—\x20who\x20must\x20act\x20next\x20(threshold\x20cooperation,\x20K3\x20Game\x20G4).');export const WorkflowReceiptSchema=z['object']({'account':z['string']()['describe']('The\x20account\x20that\x20executed\x20the\x20operation\x20(env.account).\x20Example:\x20\x27london_guide\x27'),'action':z['string']()['describe']('What\x20was\x20done.\x20Example:\x20\x27london_guide\x20executed\x20StartService\x20(paid\x20→\x20serving)\x27'),'forward':z['string']()['describe']('Forward\x20name\x20executed.\x20Example:\x20\x27StartService\x27'),'target_node':z['string']()['describe']('Target\x20node\x20of\x20the\x20executed\x20forward.\x20Example:\x20\x27serving\x27'),'op':z['enum'](['next','hold','unhold','adminUnhold'])['optional']()['describe']('Operation\x20type\x20executed.'),'migrated':z['boolean']()['describe']('Whether\x20the\x20Progress\x20migrated\x20to\x20the\x20target\x20node\x20(true)\x20or\x20stayed\x20(false\x20—\x20weights\x20still\x20accumulating\x20toward\x20threshold).'),'current_node':z['string']()['describe']('Progress.current\x20after\x20the\x20operation.'),'threshold':z['number']()['optional']()['describe']('Pair\x20threshold\x20when\x20NOT\x20migrated\x20(threshold\x20>\x200).'),'accumulated_weight':z['number']()['optional']()['describe']('Accumulated\x20forward\x20weight\x20in\x20the\x20current\x20session\x20when\x20NOT\x20migrated.'),'remaining':z['number']()['optional']()['describe']('threshold\x20-\x20accumulated_weight\x20when\x20NOT\x20migrated.'),'waiting_on':z['array'](WorkflowWaitingSchema)['optional']()['describe']('Pending\x20forwards\x20+\x20their\x20operators\x20when\x20NOT\x20migrated\x20(K3\x20Game\x20G4\x20—\x20who\x20must\x20cooperate\x20next).'),'next_guidance':WorkflowGuidanceSchema['optional']()['describe']('Next-node\x20guidance\x20from\x20the\x20resulting\x20current\x20node.'),'note':z['string']()['optional']()['describe']('Additional\x20note.')})['strict']()['describe']('Post-operation\x20receipt:\x20which\x20account\x20did\x20what,\x20whether\x20the\x20node\x20migrated,\x20and\x20threshold/weight\x20cooperation\x20status\x20when\x20it\x20did\x20not\x20(K3\x20Game\x20G4).');export const SemanticSummarySchema=z['object']({'intent':z['string']()['describe']('Inferred\x20user\x20intent\x20/\x20operation\x20goal.\x20Constraint:\x20snake_case\x20string.\x20Relation:\x20derived\x20from\x20operation_type\x20+\x20data\x20signals.\x20Example:\x20\x27publish_service\x27'),'status':z['enum'](['success','partial','failed','pending_input'])['describe']('Business-level\x20status\x20(not\x20raw\x20tx\x20status).\x20\x27pending_input\x27\x20=\x20needs\x20Guard\x20submission.\x20Example:\x20\x27success\x27'),'summary':z['string']()['describe']('One-sentence\x20human-readable\x20summary\x20of\x20what\x20happened.\x20AI\x20should\x20read\x20this\x20first.\x20Example:\x20\x27Successfully\x20published\x20Service\x20my-shop\x20with\x20Machine\x20bound\x27'),'created':z['array'](ObjectRoleSchema)['optional']()['describe']('Objects\x20newly\x20created\x20in\x20this\x20operation,\x20tagged\x20with\x20roles'),'modified':z['array'](ObjectRoleSchema)['optional']()['describe']('Objects\x20mutated\x20in\x20this\x20operation,\x20tagged\x20with\x20roles'),'released':z['array'](FundRoleSchema)['optional']()['describe']('Fund\x20movements\x20in\x20this\x20operation,\x20tagged\x20with\x20roles'),'events':z['array'](EventSemanticSchema)['optional']()['describe']('On-chain\x20events\x20annotated\x20with\x20business\x20semantics\x20(S-8)'),'next_actions':z['array'](NextActionSchema)['optional']()['describe']('Recommended\x20next\x20actions\x20to\x20drive\x20the\x20workflow\x20forward'),'warnings':z['array'](z['string']())['optional']()['describe']('Business-level\x20warnings.\x20Example:\x20\x27order_allocators\x20not\x20configured;\x20order\x20funds\x20cannot\x20be\x20distributed\x27'),'experience':ExperienceSchema['optional']()['describe']('Experience\x20layer\x20feedback\x20from\x20past\x20operations\x20(Phase\x202\x20Topic\x202)'),'service_status':ServiceStatusSchema['optional']()['describe']('Phase\x202\x20runtime\x20service\x20status\x20(populated\x20when\x20semantic_rich\x20is\x20enabled).\x20Lets\x20AI\x20see\x20active\x20services\x20in\x20each\x20response.'),'customer_advice':CustomerAdviceSchema['optional']()['describe']('Buyer-side\x20advice\x20(Phase\x203\x20C-3.3).\x20Populated\x20when\x20customer_intelligence\x20service\x20is\x20enabled\x20AND\x20operation\x20is\x20order/query\x20on\x20a\x20Service.\x20Contains\x20risk_score,\x20recommendations,\x20reminders,\x20and\x20preference_match.'),'evolution_context':EvolutionContextSchema['optional']()['describe']('Phase\x204\x20industry\x20evolution\x20context\x20(populated\x20when\x20industry_evolution\x20service\x20is\x20enabled).\x20Provides\x20AI\x20with\x20industry\x20health\x20signals\x20and\x20evolution\x20advice.'),'guard_advice':GuardAdviceSchema['optional']()['describe']('Phase\x205\x20Guard\x20capability\x20advice\x20(populated\x20when\x20user\x20intent\x20involves\x20Guard).\x20Provides\x20puzzle\x20status,\x20scene\x20matching,\x20suggested\x20patterns,\x20available\x20queries,\x20risk\x20warnings,\x20and\x20confirmation\x20text.\x20AI\x20uses\x20this\x20to\x20guide\x20Guard\x20design\x20dialogue\x20(R1-R10).'),'workflow_guidance':WorkflowGuidanceSchema['optional']()['describe']('K3\x20permission-aware\x20workflow\x20guidance:\x20current\x20node\x20+\x20ALL\x20reachable\x20next\x20nodes\x20with\x20their\x20operator/permission/guard\x20+\x20K3\x20recommendation.\x20Populated\x20when\x20a\x20Progress\x20(or\x20Order\x20with\x20Progress)\x20is\x20queried\x20and\x20after\x20progress\x20operate.\x20AI\x20must\x20read\x20this\x20BEFORE\x20proposing\x20the\x20next\x20workflow\x20operation.'),'workflow_receipt':WorkflowReceiptSchema['optional']()['describe']('K3\x20operate\x20receipt:\x20which\x20account\x20did\x20what,\x20whether\x20the\x20node\x20migrated,\x20and\x20threshold/weight\x20cooperation\x20status\x20when\x20it\x20did\x20not.\x20AI\x20must\x20relay\x20this\x20to\x20the\x20user\x20after\x20every\x20progress\x20operation.')})['strict']()['describe']('Business\x20semantic\x20summary:\x20translates\x20the\x20raw\x20transaction\x20response\x20into\x20AI-directly-understandable\x20business\x20meaning');export const CallResponseErrorSchema=z['object']({'type':z['literal']('error')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27error\x27.\x20Example:\x20\x27error\x27'),'error':z['string']()['describe']('Human-readable\x20error\x20message\x20from\x20the\x20chain\x20or\x20SDK.\x20Relation:\x20enriched\x20via\x20enrichMoveError\x20before\x20classification.\x20Example:\x20\x27Insufficient\x20balance\x20for\x20gas\x27'),'error_code':z['enum'](ERROR_CODE_VALUES)['optional']()['describe']('Error\x20classification\x20for\x20programmatic\x20recovery.\x20Constraint:\x20enum\x20values\x20single-sourced\x20from\x20error-codes.ts\x20(must\x20match\x20ErrorCode\x20in\x20semantic.ts).\x20Relation:\x20drives\x20Recover\x20Loop\x20strategy\x20selection.\x20Example:\x20\x27insufficient_balance\x27'),'retryable':z['boolean']()['optional']()['describe']('Whether\x20the\x20same\x20call\x20can\x20be\x20retried\x20as-is.\x20Constraint:\x20true\x20for\x20network_error,\x20rate_limit,\x20gas_exceeded,\x20and\x20insufficient_balance.\x20Example:\x20true'),'recovery_hint':z['string']()['optional']()['describe']('Recovery\x20suggestion\x20for\x20AI\x20or\x20user.\x20Relation:\x20paired\x20with\x20error_code\x20to\x20guide\x20Recover\x20Loop.\x20Example:\x20\x27Claim\x20faucet\x20tokens\x20then\x20retry\x27'),'related_object':z['string']()['optional']()['describe']('Object\x20ID\x20related\x20to\x20the\x20error,\x20if\x20any.\x20Example:\x20\x270x123...\x27')})['describe']('Error\x20result.\x20Contains\x20the\x20raw\x20error\x20message\x20plus\x20structured\x20classification\x20(error_code/retryable/recovery_hint)\x20so\x20AI\x20can\x20choose\x20a\x20recovery\x20strategy\x20without\x20parsing\x20the\x20error\x20string.');export const OperationPreviewSchema=z['object']({'level':z['enum'](['none','standard','amount','publish','irreversible'])['describe']('Confirmation\x20level.\x20\x27irreversible\x27\x20=\x20cannot\x20be\x20undone\x20(arb\x20verdict,\x20payment).\x20\x27publish\x27\x20=\x20locks\x20immutable\x20fields.\x20\x27amount\x27\x20=\x20amount-sensitive.\x20\x27standard\x27\x20=\x20default-value\x20warnings.'),'operation':z['string']()['describe']('operation_type\x20that\x20triggered\x20the\x20gate.\x20Example:\x20\x27payment\x27'),'object':z['union']([z['string'](),z['record'](z['string'](),z['unknown']()),z['null']()])['optional']()['describe']('Object\x20name/id\x20involved\x20(string\x20for\x20existing,\x20object\x20for\x20new\x20creation).\x20Example:\x20\x27myshop_service\x27\x20or\x20{name:\x20\x27myshop_service\x27}'),'network':z['string']()['optional']()['describe']('Network\x20in\x20use.\x20Example:\x20\x27mainnet\x27'),'account':z['string']()['optional']()['describe']('Signing\x20account\x20(\x27\x27\x20=\x20default).\x20Example:\x20\x27\x27\x20or\x20\x270xabc...\x27'),'amount':z['object']({'value':z['string']()['describe']('Smallest-unit\x20value\x20as\x20string.\x20Example:\x20\x272500000000\x27'),'token':z['string']()['describe']('Coin\x20type\x20tag.\x20Example:\x20\x270x2::wow::WOW\x27'),'human_readable':z['string']()['describe']('Human-readable\x20amount.\x20Example:\x20\x272.5\x20WOW\x27'),'recipient':z['string']()['optional']()['describe']('Recipient\x20address\x20if\x20known.\x20Example:\x20\x270xdef...\x27')})['optional']()['describe']('Amount\x20info\x20for\x20amount-level\x20confirmations.'),'immutable_after':z['array'](z['string']())['optional']()['describe']('Fields\x20that\x20become\x20immutable\x20after\x20this\x20op\x20(for\x20publish).\x20Example:\x20[\x27machine\x27,\x27order_allocators\x27]'),'warnings':z['array'](z['string']())['optional']()['describe']('Default-value\x20warnings.\x20Example:\x20[\x27Using\x20default\x20account\x20(env.account=\x22\x22)\x27]'),'irreversible':z['boolean']()['optional']()['describe']('True\x20when\x20the\x20operation\x20cannot\x20be\x20reverted.\x20Example:\x20true')})['strict']()['describe']('Preview\x20of\x20an\x20operation\x20awaiting\x20user\x20confirmation\x20(Phase\x202\x20Topic\x204\x20ConfirmGate).');export const CallPendingConfirmationSchema=z['object']({'type':z['literal']('pending_confirmation')['describe']('Discriminator.\x20The\x20operation\x20was\x20NOT\x20executed;\x20it\x20is\x20blocked\x20pending\x20user\x20confirmation.\x20Re-call\x20with\x20env.confirmed=true\x20to\x20proceed,\x20or\x20modify/cancel.'),'preview':OperationPreviewSchema['describe']('Preview\x20of\x20the\x20operation\x20awaiting\x20confirmation.'),'rule_id':z['string']()['optional']()['describe']('Id\x20of\x20the\x20confirmation\x20rule\x20that\x20matched.\x20Example:\x20\x27publish_immutable\x27')})['describe']('Pending\x20confirmation.\x20The\x20ConfirmGate\x20blocked\x20the\x20operation.\x20Read\x20preview\x20first;\x20if\x20user\x20consents,\x20re-invoke\x20the\x20SAME\x20call\x20with\x20env.confirmed=true.');export const GuardSubmissionToFillSchema=z['object']({'guard':NameOrAddressSchema['describe']('Guard\x20object\x20name\x20or\x20ID\x20that\x20requires\x20submission\x20data.\x20Example:\x20\x27my-delivery-guard\x27'),'submission':z['array'](GuardTableItemSchema)['describe']('User-submitted\x20data\x20matching\x20the\x20Guard\x27s\x20required\x20fields.\x20Relation:\x20structure\x20must\x20match\x20the\x20Guard\x20table\x27s\x20column\x20definitions.\x20Example:\x20[{field:\x27delivery_proof\x27,\x20value:\x27Qm...\x27}]')})['strict']()['describe']('One\x20Guard\x27s\x20submission\x20data:\x20the\x20Guard\x20to\x20verify\x20plus\x20the\x20user-provided\x20data\x20that\x20satisfies\x20its\x20requirements.');export const SubmissionCallSchema=z['object']({'type':z['literal']('submission')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27submission\x27.\x20Example:\x20\x27submission\x27'),'guard':z['array'](z['object']({'object':NameOrAddressSchema['describe']('Guard\x20object\x20name\x20or\x20ID\x20to\x20verify\x20against.\x20Example:\x20\x27my-delivery-guard\x27\x20or\x20\x270x123...\x27'),'impack':z['boolean']()['describe']('Whether\x20this\x20Guard\x27s\x20verification\x20result\x20participates\x20in\x20the\x20final\x20logic.\x20Constraint:\x20if\x20false,\x20the\x20Guard\x20is\x20checked\x20but\x20does\x20not\x20block\x20the\x20operation.\x20Example:\x20true')})['strict']())['max'](MAX_GUARD_COUNT_PASSPORT)['describe']('Array\x20of\x20Guard\x20objects\x20to\x20verify.\x20Constraint:\x20at\x20most\x20'+MAX_GUARD_COUNT_PASSPORT+'\x20entries\x20(MAX_GUARD_COUNT_PASSPORT).\x20Relation:\x20each\x20entry\x20corresponds\x20to\x20a\x20Guard\x20bound\x20to\x20the\x20operation.'),'submission':z['array'](GuardSubmissionToFillSchema)['describe']('User-submitted\x20data\x20for\x20each\x20Guard.\x20Relation:\x20one\x20entry\x20per\x20Guard\x20in\x20the\x20guard\x20array;\x20fill\x20submission\x20fields\x20and\x20resubmit\x20via\x20call_with_submission.\x20PLACEMENT:\x20this\x20`submission`\x20field\x20is\x20at\x20the\x20SAME\x20level\x20as\x20`data`\x20and\x20`env`\x20in\x20the\x20operation\x20input\x20—\x20NOT\x20inside\x20`data.data`.\x20Example\x20structure:\x20{tool:\x27onchain_operations\x27,\x20data:{operation_type:\x27order\x27,\x20data:{object:\x27my_order\x27,\x20progress:{...}}},\x20submission:{type:\x27submission\x27,\x20guard:[...],\x20submission:[...]}}')})['strict']()['describe']('Guard\x20verification\x20required.\x20The\x20operation\x20was\x20blocked\x20because\x20one\x20or\x20more\x20Guards\x20require\x20user-submitted\x20data.\x20Fill\x20the\x20submission\x20array\x20and\x20resubmit.\x20Semantic\x20status\x20is\x20\x27pending_input\x27.');export const TypedPermissionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Use\x20this\x20when\x20the\x20object\x20already\x20exists\x20and\x20you\x20want\x20to\x20reference\x20it.'),TypeNamedObjectWithPermissionSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20COMPLETE\x20configuration\x20including:\x20optional\x20name,\x20tags,\x20description,\x20token\x20type\x20for\x20payments\x20(e.g.,\x20\x270x2::wow::WOW\x27),\x20AND\x20Permission-based\x20access\x20control.\x20Use\x20this\x20for\x20creating\x20sophisticated\x20objects\x20with\x20both\x20payment\x20token\x20specification\x20and\x20permission\x20management.')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20full\x20configuration\x20including\x20name,\x20tags,\x20description,\x20token\x20type\x20for\x20payments,\x20and\x20Permission-based\x20access\x20control.\x20The\x20object\x20format\x20is\x20used\x20when\x20you\x20need\x20both\x20token\x20specification\x20AND\x20permission\x20management.');export const WithPermissionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Use\x20when\x20the\x20Permission\x20object\x20already\x20exists.'),NamedObjectWithPermissionSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20Permission-based\x20access\x20control.\x20Includes\x20optional\x20name,\x20tags,\x20visibility\x20settings,\x20AND\x20a\x20Permission\x20object\x20(which\x20itself\x20can\x20be\x20referenced\x20by\x20string\x20or\x20created\x20as\x20a\x20new\x20object).\x20Use\x20this\x20to\x20create\x20objects\x20with\x20managed\x20access\x20permissions.')])['describe']('Two\x20ways\x20to\x20specify\x20a\x20Permission-managed\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20Permission\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20Permission\x20access\x20control,\x20where\x20the\x20Permission\x20can\x20also\x20be\x20either\x20referenced\x20(string)\x20or\x20newly\x20created\x20(object).\x20This\x20is\x20used\x20when\x20you\x20need\x20permission\x20management\x20but\x20don\x27t\x20need\x20to\x20specify\x20a\x20token\x20type.');export const TypedDescriptionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Use\x20when\x20the\x20object\x20already\x20exists.'),TypeNamedObjectSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20token\x20type\x20specification\x20for\x20payments.\x20Includes\x20optional\x20name,\x20tags,\x20visibility\x20settings,\x20AND\x20a\x20specific\x20token\x20type\x20(e.g.,\x20\x270x2::wow::WOW\x27\x20or\x20\x270x2::usdt::USDT\x27).\x20Use\x20this\x20when\x20you\x20need\x20to\x20specify\x20what\x20token\x20the\x20object\x20will\x20use\x20for\x20payments\x20but\x20don\x27t\x20need\x20permission\x20management.')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20token\x20type\x20specification\x20for\x20payments.\x20The\x20object\x20format\x20includes\x20name,\x20tags,\x20visibility\x20settings,\x20and\x20a\x20required\x20token\x20type.\x20This\x20is\x20used\x20when\x20you\x20need\x20to\x20specify\x20the\x20payment\x20token\x20but\x20don\x27t\x20need\x20permission\x20management.');export const CallTransactionResultSchema=WowTransactionBlockResponseSchema['extend']({'type':z['literal']('transaction')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27transaction\x27.\x20Example:\x20\x27transaction\x27')});export const CallDataResultSchema=z['object']({'type':z['literal']('data')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27data\x27.\x20Example:\x20\x27data\x27'),'data':z['array'](ResponseDataSchema)['describe']('Array\x20of\x20object\x20records\x20returned\x20by\x20a\x20query\x20operation.\x20Example:\x20[{id:\x270x...\x27,\x20change:\x27created\x27}]')});export const CallNullResultSchema=z['object']({'type':z['literal']('null')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27null\x27.\x20Example:\x20\x27null\x27')});export const CallResultSchema=z['discriminatedUnion']('type',[SubmissionCallSchema,CallTransactionResultSchema,CallResponseErrorSchema,CallDataResultSchema,CallNullResultSchema,CallPendingConfirmationSchema])['describe']('Discriminated\x20union\x20of\x206\x20result\x20types:\x20\x27transaction\x27\x20(raw\x20Wow\x20response),\x20\x27submission\x27\x20(Guard\x20verification\x20needed),\x20\x27error\x27\x20(failed\x20with\x20error_code),\x20\x27data\x27\x20(query\x20result\x20array),\x20\x27null\x27\x20(no-op\x20completed),\x20\x27pending_confirmation\x27\x20(ConfirmGate\x20blocked\x20—\x20re-call\x20with\x20env.confirmed=true).\x20AI\x20should\x20check\x20result.type\x20first\x20to\x20determine\x20how\x20to\x20process\x20the\x20response.');export const ObjectsSchema=z['preprocess'](a=>Array['isArray'](a)?{'op':'add','objects':a}:a,z['union']([z['object']({'op':z['union']([z['literal']('add'),z['literal']('set')]),'objects':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20object\x20IDs\x20or\x20names\x20to\x20add\x20or\x20set')})['strict'](),z['object']({'op':z['literal']('remove'),'objects':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20object\x20IDs\x20or\x20names\x20to\x20remove')})['strict'](),z['object']({'op':z['literal']('clear')})['strict']()]));export const VerifyMismatchSchema=z['object']({'dimension':z['enum'](['created','modified','released','state','event'])['describe']('Verify\x20dimension\x20that\x20mismatched.\x20Example:\x20\x27created\x27'),'expected':z['string']()['describe']('What\x20the\x20Expect\x20Loop\x20declared.\x20Example:\x20\x27Service\x20object\x20created\x27'),'actual':z['string']()['describe']('What\x20actually\x20happened.\x20Example:\x20\x27No\x20object\x20created\x27'),'severity':z['enum'](['pass','warn','fail'])['describe']('Severity:\x20\x27fail\x27\x20blocks\x20progress,\x20\x27warn\x27\x20is\x20advisory,\x20\x27pass\x27\x20never\x20appears\x20here.\x20Example:\x20\x27fail\x27'),'detail':z['string']()['describe']('Human-readable\x20explanation\x20of\x20the\x20mismatch.\x20Example:\x20\x27Expected\x20Service\x20creation\x20but\x20transaction\x20succeeded\x20without\x20object\x20change\x27')})['describe']('One\x20mismatch\x20between\x20expected\x20and\x20actual\x20result.\x20AI\x20should\x20read\x20severity\x20first\x20to\x20decide\x20whether\x20to\x20halt.');export const VerifyReportSchema=z['object']({'status':z['enum'](['pass','warn','fail'])['describe']('Overall\x20verify\x20status.\x20Constraint:\x20\x27fail\x27\x20if\x20any\x20mismatch\x20has\x20severity\x20\x27fail\x27;\x20\x27warn\x27\x20if\x20only\x20warns;\x20\x27pass\x27\x20if\x20no\x20mismatches.\x20Example:\x20\x27fail\x27'),'mismatches':z['array'](VerifyMismatchSchema)['describe']('List\x20of\x20mismatches\x20found.\x20Empty\x20array\x20when\x20status\x20is\x20\x27pass\x27.\x20Example:\x20[{dimension:\x27created\x27,\x20expected:\x27...\x27,\x20actual:\x27...\x27,\x20severity:\x27fail\x27,\x20detail:\x27...\x27}]'),'summary':z['string']()['describe']('Human-readable\x20summary\x20of\x20the\x20verify\x20result.\x20Example:\x20\x272\x20mismatches\x20found:\x20created\x20dimension\x20failed,\x20event\x20dimension\x20warned\x27'),'timestamp':z['string']()['describe']('ISO\x208601\x20timestamp\x20when\x20verify\x20ran.\x20Example:\x20\x272026-07-14T10:30:00.000Z\x27')})['describe']('Verify\x20Loop\x20report.\x20Compares\x20expected\x20vs\x20actual\x20receipt\x20fields\x20across\x205\x20dimensions.\x20On\x20outcome=\x27failed\x27\x20outputs\x20this\x20is\x20the\x20failure\x20diagnosis.');export const RecoveryActionSchema=z['object']({'strategy':z['enum'](['retry','claim_faucet','fill_submission','recreate','switch_account','query_and_retry','adjust_params','escalate_human','stop','wait_and_retry'])['describe']('Recovery\x20strategy\x20chosen\x20by\x20the\x20Recover\x20Loop.\x20Constraint:\x2010\x20strategies\x20matching\x20error_code\x20table.\x20Example:\x20\x27claim_faucet\x27'),'should_retry':z['boolean']()['describe']('Whether\x20AI\x20should\x20retry\x20the\x20original\x20operation\x20after\x20applying\x20the\x20strategy.\x20Constraint:\x20false\x20for\x20\x27stop\x27\x20and\x20\x27escalate_human\x27.\x20Example:\x20true'),'adjusted_params':z['record'](z['string'](),z['unknown']())['optional']()['describe']('Suggested\x20parameter\x20adjustments\x20for\x20\x27adjust_params\x27\x20strategy.\x20Example:\x20{amount:\x20\x27100000000\x27}'),'user_prompt':z['string']()['optional']()['describe']('Prompt\x20to\x20show\x20the\x20user\x20when\x20recovery\x20is\x20semi-automatic\x20or\x20manual.\x20Example:\x20\x27Please\x20switch\x20to\x20an\x20account\x20with\x20provider\x20permission\x27'),'max_attempts':z['number']()['int']()['describe']('Maximum\x20attempts\x20for\x20this\x20error_code\x20type.\x20Example:\x203'),'current_attempt':z['number']()['int']()['describe']('Current\x20attempt\x20count\x20(1-indexed).\x20Example:\x201'),'detail':z['string']()['describe']('Human-readable\x20explanation\x20of\x20the\x20recovery\x20decision.\x20Example:\x20\x27Insufficient\x20balance\x20detected;\x20claim\x20faucet\x20tokens\x20then\x20retry\x27')})['describe']('Recover\x20Loop\x20action.\x20ALWAYS\x20present\x20on\x20outcome=\x27failed\x27\x20outputs.\x20AI\x20should\x20follow\x20the\x20strategy\x20and\x20respect\x20max_attempts.');export const SchemaWarningSchema=z['object']({'compatible':z['boolean']()['describe']('Whether\x20the\x20client\x20schema\x20version\x20is\x20compatible\x20with\x20the\x20server.'),'warnings':z['array'](z['string']())['describe']('Schema\x20compatibility\x20warnings\x20or\x20errors.'),'client_version':z['string']()['optional']()['describe']('The\x20client\x20schema\x20version\x20that\x20was\x20checked.'),'server_versions':z['object']({'sdk':z['string']()['describe']('Server-side\x20SDK\x20schema\x20version.'),'mcp':z['string']()['describe']('Server-side\x20MCP\x20tool\x20schema\x20version.')})['describe']('Server-side\x20schema\x20versions.')})['strict']()['describe']('Schema\x20compatibility\x20warning\x20attached\x20to\x20tool\x20output\x20when\x20client_schema_version\x20is\x20provided\x20and\x20a\x20mismatch\x20is\x20detected.');export const CallOutputExecutedSchema=z['object']({'outcome':z['literal']('executed')['describe']('Outcome\x20discriminator:\x20the\x20operation\x20completed.\x20For\x20transactions,\x20effects.status\x20was\x20\x27success\x27\x20—\x20check\x20semantic.created/modified/released\x20for\x20what\x20changed.\x20Never\x20carries\x20recovery\x20or\x20failure\x20directives.'),'result':z['discriminatedUnion']('type',[CallTransactionResultSchema,CallDataResultSchema,CallNullResultSchema])['describe']('Discriminated\x20result\x20payload.\x20\x27transaction\x27\x20(raw\x20Wow\x20response),\x20\x27data\x27\x20(query\x20result\x20array),\x20\x27null\x27\x20(no-op\x20completed).'),'message':z['string']()['optional']()['describe']('Human-readable\x20summary\x20or\x20hint.\x20Constraint:\x20always\x20present\x20for\x20transaction\x20results;\x20may\x20be\x20omitted\x20for\x20data/null.\x20Example:\x20\x27Transaction\x20completed\x20successfully\x27'),'semantic':SemanticSummarySchema['optional']()['describe']('Business\x20semantic\x20summary.\x20AI\x20should\x20read\x20semantic\x20first;\x20fall\x20back\x20to\x20parsing\x20result\x20only\x20when\x20semantic\x20is\x20absent.\x20Relation:\x20populated\x20by\x20MCP\x20server\x20from\x20operation\x20context;\x20undefined\x20when\x20intent\x20cannot\x20be\x20confidently\x20inferred.\x20Example:\x20{intent:\x27publish_service\x27,\x20status:\x27success\x27,\x20summary:\x27...\x27}'),'schema_warning':SchemaWarningSchema['optional']()['describe']('Schema\x20compatibility\x20warning.\x20Present\x20only\x20when\x20client_schema_version\x20is\x20provided\x20in\x20env\x20and\x20a\x20mismatch\x20is\x20detected.')})['strict']()['describe']('Executed\x20outcome:\x20the\x20operation\x20completed\x20successfully\x20(transaction\x20finalized,\x20or\x20completed\x20read/no-op).\x20Read\x20semantic.status\x20and\x20semantic.created/modified/released\x20for\x20the\x20business\x20effect.\x20NEVER\x20contains\x20recovery\x20—\x20a\x20mismatch\x20between\x20what\x20the\x20transaction\x20did\x20and\x20what\x20the\x20harness\x20expected\x20is\x20coverage-gap\x20telemetry,\x20not\x20a\x20user-facing\x20failure.');export const CallOutputPendingInputSchema=z['object']({'outcome':z['literal']('pending_input')['describe']('Outcome\x20discriminator:\x20the\x20operation\x20was\x20NOT\x20executed\x20—\x20required\x20input\x20is\x20missing.\x20Fill\x20the\x20requested\x20submission/confirmation\x20and\x20re-invoke.\x20Never\x20carries\x20recovery\x20or\x20failure\x20directives.'),'result':z['discriminatedUnion']('type',[SubmissionCallSchema,CallPendingConfirmationSchema])['describe']('Discriminated\x20result\x20payload.\x20\x27submission\x27\x20(Guard\x20verification\x20data\x20needed),\x20\x27pending_confirmation\x27\x20(ConfirmGate\x20blocked\x20—\x20re-call\x20with\x20env.confirmed=true).'),'message':z['string']()['optional']()['describe']('Human-readable\x20summary\x20or\x20hint.\x20Example:\x20\x27Submission\x20required\x20for\x20Guard\x20verification\x27'),'semantic':SemanticSummarySchema['optional']()['describe']('Business\x20semantic\x20summary\x20with\x20status\x20\x27pending_input\x27.\x20Example:\x20{intent:\x27guard_submission_required\x27,\x20status:\x27pending_input\x27,\x20summary:\x27...\x27}'),'schema_warning':SchemaWarningSchema['optional']()['describe']('Schema\x20compatibility\x20warning.\x20Present\x20only\x20when\x20client_schema_version\x20is\x20provided\x20in\x20env\x20and\x20a\x20mismatch\x20is\x20detected.')})['strict']()['describe']('Pending-input\x20outcome:\x20the\x20operation\x20did\x20NOT\x20execute.\x20Follow\x20semantic.next_actions\x20(or\x20result.type===\x27pending_confirmation\x27\x20preview\x20instructions)\x20to\x20supply\x20the\x20missing\x20input,\x20then\x20re-invoke\x20the\x20same\x20call.');export const CallOutputFailedSchema=z['object']({'outcome':z['literal']('failed')['describe']('Outcome\x20discriminator:\x20execution\x20failed\x20on-chain\x20or\x20before\x20submission.\x20The\x20operation\x20was\x20NOT\x20completed.\x20`recovery`\x20is\x20always\x20present\x20and\x20MUST\x20be\x20consulted\x20before\x20retrying.'),'result':CallResponseErrorSchema['describe']('Error\x20payload\x20with\x20structured\x20classification\x20(error_code/retryable/recovery_hint).'),'message':z['string']()['optional']()['describe']('Human-readable\x20error\x20summary.\x20Example:\x20\x27Transaction\x20failed:\x20Insufficient\x20balance\x20for\x20gas\x27'),'semantic':SemanticSummarySchema['optional']()['describe']('Business\x20semantic\x20summary\x20with\x20status\x20\x27failed\x27.\x20Example:\x20{intent:\x27create_service\x27,\x20status:\x27failed\x27,\x20summary:\x27Failed\x20to\x20create\x20service\x27}'),'recovery':RecoveryActionSchema['describe']('Recover\x20Loop\x20action\x20—\x20ALWAYS\x20present\x20when\x20outcome\x20is\x20\x27failed\x27.\x20Follow\x20strategy;\x20respect\x20max_attempts;\x20do\x20NOT\x20retry\x20blindly\x20when\x20should_retry\x20is\x20false.\x20Relation:\x20selected\x20from\x20RECOVERY_RULES\x20by\x20error_code.'),'diagnosis':VerifyReportSchema['optional']()['describe']('Failure-path\x20verify\x20report:\x20compares\x20the\x20dispatch-declared\x20expectation\x20against\x20what\x20actually\x20happened.\x20Present\x20when\x20an\x20expectation\x20was\x20declared\x20at\x20dispatch.\x20Read\x20diagnosis.mismatches\x20to\x20understand\x20WHY\x20the\x20operation\x20fell\x20short\x20of\x20its\x20intent\x20—\x20complementary\x20to\x20recovery,\x20which\x20says\x20WHAT\x20to\x20do\x20next.'),'schema_warning':SchemaWarningSchema['optional']()['describe']('Schema\x20compatibility\x20warning.\x20Present\x20only\x20when\x20client_schema_version\x20is\x20provided\x20in\x20env\x20and\x20a\x20mismatch\x20is\x20detected.')})['strict']()['describe']('Failed\x20outcome:\x20the\x20operation\x20did\x20NOT\x20complete.\x20recovery\x20is\x20guaranteed\x20—\x20check\x20recovery.strategy\x20first,\x20then\x20result.error_code/retryable\x20for\x20retry\x20guidance;\x20diagnosis\x20(when\x20present)\x20explains\x20the\x20gap\x20between\x20expectation\x20and\x20outcome.');export const CallOutputSchema=z['discriminatedUnion']('outcome',[CallOutputExecutedSchema,CallOutputPendingInputSchema,CallOutputFailedSchema])['describe']('Unified\x20MCP\x20tool\x20output\x20for\x20onchain/bridge\x20operations,\x20discriminated\x20by\x20`outcome`\x20(exactly\x20one\x20of\x20\x27executed\x27\x20|\x20\x27pending_input\x27\x20|\x20\x27failed\x27).\x20Check\x20outcome\x20FIRST:\x20\x27executed\x27\x20—\x20operation\x20completed,\x20read\x20semantic;\x20\x27pending_input\x27\x20—\x20not\x20executed,\x20supply\x20the\x20missing\x20submission/confirmation\x20and\x20re-invoke;\x20\x27failed\x27\x20—\x20not\x20completed,\x20follow\x20the\x20guaranteed\x20`recovery`\x20action\x20(optional\x20`diagnosis`\x20explains\x20the\x20expectation\x20gap).\x20Type-level\x20invariant:\x20only\x20\x27failed\x27\x20ever\x20carries\x20recovery,\x20diagnosis,\x20or\x20failure\x20directives.');
|
|
1
|
+
import{z}from'zod';import{WowTransactionBlockResponseSchema}from'../local/index.js';import{BalanceTypeSchema,EntrypointSchema,ObjectBaseSchema,GuardTableItemSchema,NameSchema,NameOrAddressSchema,TokenTypeWithDefaultSchema}from'../common/index.js';import{ENTRYPOINT,MAX_GUARD_COUNT_PASSPORT}from'@wowok/wowok';import{ERROR_CODE_VALUES}from'./error-codes.js';import{PERSONA_ROLES}from'../../persona/types.js';const NETWORKS=Object['values'](ENTRYPOINT)['join']('\x20|\x20');function findDiscriminatedUnion(a,b,c=0x0){if(c>0x6||!a||typeof a!=='object')return null;const d=a['_def'];if(!d)return null;const e=d['type']??d['typeName'];if(Array['isArray'](d['options'])&&typeof d['discriminator']==='string'&&(e==='union'||e==='ZodDiscriminatedUnion')){const g=pickArmByDiscriminator(d['options'],d['discriminator'],b?.[d['discriminator']],b);if(g)return{'arm':g,'path':[]};}if(e==='union'&&Array['isArray'](d['options'])){const h=[];for(const i of d['options']){const j=findDiscriminatedUnion(i,b,c+0x1);if(j)h['push'](j);}return h['length']===0x1?h[0x0]:null;}if(e==='object'&&d['shape']){const k=typeof d['shape']==='function'?d['shape']():d['shape'];if(!k||typeof k!=='object')return null;for(const l of Object['keys'](k)){const m=k[l],n=m?.['_def'];if(!n)continue;const o=n['type']??n['typeName'];if(o==='union'&&Array['isArray'](n['options'])&&n['discriminator']){const q=String(n['discriminator']),r=b;if(!r||typeof r!=='object')continue;const s=r[l],t=pickArmByDiscriminator(n['options'],q,s,b);if(t)return{'arm':t,'path':[l]};}const p=findDiscriminatedUnion(m,b,c+0x1);if(p)return{'arm':p['arm'],'path':[l,...p['path']]};}return null;}const f=d['typeName']==='ZodEffects'?d['schema']:d['out']??d['innerType'];if(f&&f!==a)return findDiscriminatedUnion(f,b,c+0x1);return null;}function pickArmByDiscriminator(a,b,c,d){if(c===undefined||c===null)return null;const e=[];for(const f of a){const g=f?.['_def'],h=g?.['shape'];if(!h)continue;const i=typeof h==='function'?h():h,j=i?.[b],k=j?.['_def'],l=k?.['values']?k['values']:k?.['innerType']?[k['innerType']?.['value']]:undefined;if(!l)continue;const m=k['values']instanceof Set?[...k['values']]:Array['isArray'](l)?l:[k['value']];if(m['some'](n=>n===c))e['push'](f);}return e['length']===0x1?e[0x0]:null;}const DISCRIMINATED_UNION_FIELD_HINTS={'stock_add':'use\x20{op:\x27stock_add\x27,\x20sale_name:\x27<product\x20name>\x27,\x20value:<units\x20to\x20ADD>}','stock_reduce':'use\x20{op:\x27stock_reduce\x27,\x20sale_name:\x27<product\x20name>\x27,\x20value:<units\x20to\x20REMOVE>}','price_add':'use\x20{op:\x27price_add\x27,\x20sale_name:\x27<product\x20name>\x27,\x20value:<amount\x20to\x20ADD>}','price_reduce':'use\x20{op:\x27price_reduce\x27,\x20sale_name:\x27<product\x20name>\x27,\x20value:<amount\x20to\x20REMOVE>}','sale_suspension':'use\x20{op:\x27sale_suspension\x27,\x20sale_name:\x27<product\x20name>\x27,\x20suspension:<boolean>}'};function discriminatedUnionHint(a){const b=['op','operation_type','type'],c=new Set(),d=(e,f)=>{if(!e||typeof e!=='object'||f>0x4||c['has'](e))return null;c['add'](e);if(Array['isArray'](e)){for(const h of e){const i=d(h,f+0x1);if(i)return i;}return null;}const g=e;for(const j of b){const k=DISCRIMINATED_UNION_FIELD_HINTS[String(g[j])];if(k)return k;}for(const l of Object['values'](g)){const m=d(l,f+0x1);if(m)return m;}return null;};return d(a,0x0);}export function strictParse(a,b,c='input'){let d=a;while(!![]){const k=d['_def'];if(!k)break;const l=k['typeName']==='ZodEffects'?k['schema']:k['out']??k['innerType'];if(!l||l===d)break;d=l;}const e=d['_def'],f=typeof e?.['shape']==='function'?e['shape']():e?.['shape'];if(!f){const m=a['safeParse'](b);if(m['success'])return m['data'];throw new Error(formatParseFailure(a,b,m['error'],c));}const g=Object['keys'](f),h=Object['keys'](b||{}),i=h['filter'](n=>!g['includes'](n));if(i['length']>0x0)throw new Error('Unknown\x20'+c+'\x20field(s):\x20'+i['join'](',\x20')+'.\x20'+('Allowed\x20fields:\x20'+g['join'](',\x20')+'.\x20')+'Remove\x20the\x20unknown\x20field(s)\x20or\x20check\x20the\x20schema\x20for\x20the\x20correct\x20field\x20name.');const j=a['safeParse'](b);if(!j['success'])throw new Error(formatParseFailure(a,b,j['error'],c));return j['data'];}function formatParseFailure(a,b,c,d){const e=(i,j)=>(i??[])['map'](k=>{const l=k,m=l['path']??[],n=m['length']>0x0?m['map'](q=>typeof q==='number'?'['+q+']':String(q))['join']('.')['replace']('.[','['):'(root)';let o='';k['code']==='invalid_type'&&typeof l['expected']==='string'&&typeof l['received']==='string'&&(o='\x20(expected:\x20'+l['expected']+';\x20received:\x20'+l['received']+')');if(k['code']==='invalid_union'&&Array['isArray'](l['errors'])){const p=new Set(),q=r=>{for(const s of r){if(Array['isArray'](s)){if(s['length']>0x0)q(s);continue;}const t=s?.['errors'];if(Array['isArray'](t)&&t['length']>0x0)q(t);else{if(typeof s?.['message']==='string')p['add'](s['message']);}}};q(l['errors']),p['size']>0x0&&(o+='\x20('+[...p]['slice'](0x0,0x3)['join']('\x20|\x20')+')');}return'\x20\x20-\x20'+d+'.'+j+n+'\x20['+k['code']+']:\x20'+k['message']+o;}),f=discriminatedUnionHint(b),g=f?'\x0a\x0aThis\x20operation\x20matched\x20one\x20variant\x20of\x20a\x20discriminated\x20union\x20—\x20its\x20fields\x20are:\x20'+f+'.':'',h=findDiscriminatedUnion(a,b);if(h){const i=h['path']['length']>0x0?b?.[h['path'][0x0]]:b,j=h['path']['length']?h['path']['join']('.')+'.':'',k=h['arm']['safeParse'](i??b);if(!k['success'])return d+'\x20validation\x20failed\x20with\x20'+k['error']['issues']['length']+'\x20error(s):\x0a'+(''+e(k['error']['issues'],j)['join']('\x0a')+g);}return d+'\x20validation\x20failed\x20with\x20'+c['issues']['length']+'\x20error(s):\x0a'+(''+e(c['issues'],'')['join']('\x0a')+g);}export const NamedObjectSchema=z['object']({'name':NameSchema['optional']()['describe']('The\x20name\x20of\x20the\x20object'),'tags':z['array'](z['string']())['optional']()['describe']('The\x20tags\x20of\x20the\x20object'),'onChain':z['boolean']()['optional']()['describe']('CRITICAL:\x20Whether\x20to\x20sync\x20the\x20name\x20to\x20the\x20blockchain.\x20DEFAULT\x20(undefined/false):\x20The\x20name\x20is\x20stored\x20LOCALLY\x20ONLY\x20on\x20your\x20device\x20(PRIVATE).\x20If\x20set\x20to\x20true:\x20The\x20name\x20is\x20published\x20ON-CHAIN\x20and\x20becomes\x20PUBLICLY\x20VISIBLE\x20to\x20everyone.\x20Only\x20set\x20to\x20true\x20for\x20displaying\x20the\x20relationships\x20you\x20are\x20willing\x20to\x20make\x20public\x20on\x20the\x20chain.'),'replaceExistName':z['boolean']()['optional']()['describe']('FORCE\x20CLAIM:\x20Set\x20to\x20true\x20ONLY\x20when\x20the\x20user\x20explicitly\x20expresses\x20a\x20STRONG\x20INTENTION\x20to\x20forcefully\x20take\x20over\x20an\x20existing\x20name\x20(e.g.,\x20\x27I\x20must\x20use\x20this\x20name\x27,\x20\x27force\x20rename\x27,\x20\x27replace\x20the\x20existing\x20one\x27).\x20'+'WARNING:\x20This\x20will\x20UNBIND\x20the\x20name\x20from\x20its\x20original\x20object\x20and\x20rebind\x20it\x20to\x20the\x20new\x20one,\x20potentially\x20breaking\x20existing\x20references.\x20'+'If\x20not\x20specified\x20or\x20false:\x20the\x20operation\x20will\x20FAIL\x20with\x20an\x20error\x20when\x20the\x20name\x20is\x20already\x20in\x20use\x20(safe\x20default\x20behavior).')})['strict']()['describe']('Assign\x20a\x20name\x20and\x20optional\x20tags\x20to\x20a\x20new\x20object.\x20By\x20default,\x20names\x20are\x20stored\x20LOCALLY\x20(private)\x20on\x20your\x20device.\x20'+'Set\x20\x27onChain:\x20true\x27\x20to\x20create\x20a\x20PUBLIC\x20on-chain\x20identity\x20visible\x20to\x20everyone.\x20'+'IMPORTANT:\x20If\x20the\x20requested\x20name\x20is\x20already\x20taken,\x20the\x20operation\x20will\x20FAIL\x20by\x20default.\x20'+'Only\x20set\x20\x27replaceExistName:\x20true\x27\x20when\x20the\x20user\x20EXPLICITLY\x20demands\x20to\x20forcefully\x20claim\x20the\x20name.');export const NormalObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Example:\x20\x27my-service\x27\x20or\x20\x270x1234...\x27'),NamedObjectSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20specified\x20properties.\x20See\x20NamedObjectSchema\x20for\x20details\x20including\x20\x27name\x27\x20(optional),\x20\x27tags\x27\x20(optional),\x20\x27onChain\x27\x20(whether\x20to\x20make\x20name\x20public),\x20and\x20\x27replaceExistName\x27\x20(force\x20claim\x20existing\x20name).')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20using\x20NamedObjectSchema\x20structure\x20with\x20optional\x20name,\x20tags,\x20and\x20visibility\x20settings.');export const NamedObjectWithDescriptionSchema=NamedObjectSchema['extend']({'description':z['string']()['optional']()['describe']('The\x20description\x20of\x20the\x20object')})['strict']()['describe']('Create\x20a\x20new\x20object\x20with\x20a\x20name\x20and\x20optional\x20description.\x20The\x20name\x20helps\x20identify\x20the\x20object,\x20while\x20the\x20description\x20provides\x20additional\x20details\x20about\x20its\x20purpose\x20or\x20functionality.');export const DescriptionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Example:\x20\x27my-object\x27\x20or\x20\x270x1234...\x27'),NamedObjectWithDescriptionSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20name,\x20optional\x20description,\x20and\x20visibility\x20settings.\x20Extends\x20NamedObjectSchema\x20with\x20an\x20additional\x20\x27description\x27\x20field\x20for\x20detailed\x20object\x20information.')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20full\x20configuration\x20including\x20optional\x20name,\x20tags,\x20description,\x20and\x20visibility\x20settings\x20(local\x20private\x20by\x20default,\x20or\x20public\x20on-chain\x20with\x20onChain:true).');export const TypeNamedObjectSchema=NamedObjectSchema['extend']({'type_parameter':TokenTypeWithDefaultSchema['describe']('Payment\x20token\x20type\x20for\x20this\x20object\x20(format:\x20{address}::{module}::{struct}).\x20e.g.\x20ALWAYS\x20the\x20FULL\x20type\x20string\x20`{address}::{module}::{struct}`\x20e.g.\x20\x270x2::wow::WOW\x27.\x20⚠️\x20The\x20bare\x20names\x20\x27WOW\x27\x20/\x20\x27USDT\x27\x20/\x20\x27ETH\x27\x20are\x20REJECTED\x20(the\x20validator\x20requires\x20all\x20three\x20parts)\x20—\x20write\x20\x270x2::wow::WOW\x27,\x20not\x20\x27WOW\x27.\x20The\x20field\x20may\x20be\x20OMITTED\x20entirely:\x20it\x20then\x20defaults\x20to\x20WOW\x20(\x270x2::wow::WOW\x27).\x20This\x20token\x20is\x20what\x20the\x20object\x20accepts\x20for\x20payments\x20and\x20is\x20fixed\x20at\x20creation.\x20To\x20discover\x20other\x20available\x20tokens,\x20call\x20wowok_buildin_info\x20with\x20info\x20\x27mainnet\x20bridge\x20tokens\x27\x20and\x20use\x20the\x20returned\x20`wowTypeTag`\x20value\x20here.\x20NOTE:\x20testnet/localnet\x20carry\x20WOW\x20only\x20—\x20USDT/ETH\x20are\x20a\x20mainnet\x20capability.')})['describe']('Create\x20a\x20new\x20named\x20object\x20(with\x20optional\x20tags)\x20and\x20specify\x20a\x20token\x20type\x20for\x20payments\x20(e.g.,\x20WOW,\x20USDT,\x20ETH).');export const NamedObjectWithPermissionSchema=NamedObjectSchema['extend']({'permission':DescriptionObjectSchema['optional']()})['strict']()['describe']('Use\x20a\x20Permission\x20object\x20to\x20manage\x20access\x20control:\x20(1)\x20Specify\x20an\x20existing\x20Permission\x20object\x27s\x20name\x20or\x20ID;\x20(2)\x20Create\x20a\x20new\x20Permission\x20object\x20(which\x20can\x20be\x20named\x20and\x20tagged);\x20or\x20(3)\x20Leave\x20empty\x20to\x20automatically\x20create\x20a\x20new\x20unnamed\x20Permission\x20object.');export const TypeNamedObjectWithPermissionSchema=NamedObjectWithPermissionSchema['extend']({'type_parameter':TokenTypeWithDefaultSchema['describe']('Payment\x20token\x20type\x20for\x20this\x20object\x20(format:\x20{address}::{module}::{struct}).\x20e.g.\x20ALWAYS\x20the\x20FULL\x20type\x20string\x20`{address}::{module}::{struct}`\x20e.g.\x20\x270x2::wow::WOW\x27.\x20⚠️\x20The\x20bare\x20names\x20\x27WOW\x27\x20/\x20\x27USDT\x27\x20/\x20\x27ETH\x27\x20are\x20REJECTED\x20(the\x20validator\x20requires\x20all\x20three\x20parts)\x20—\x20write\x20\x270x2::wow::WOW\x27,\x20not\x20\x27WOW\x27.\x20The\x20field\x20may\x20be\x20OMITTED\x20entirely:\x20it\x20then\x20defaults\x20to\x20WOW\x20(\x270x2::wow::WOW\x27).\x20This\x20token\x20is\x20what\x20the\x20object\x20accepts\x20for\x20payments\x20and\x20is\x20fixed\x20at\x20creation.\x20To\x20discover\x20other\x20available\x20tokens,\x20call\x20wowok_buildin_info\x20with\x20info\x20\x27mainnet\x20bridge\x20tokens\x27\x20and\x20use\x20the\x20returned\x20`wowTypeTag`\x20value\x20here.\x20NOTE:\x20testnet/localnet\x20carry\x20WOW\x20only\x20—\x20USDT/ETH\x20are\x20a\x20mainnet\x20capability.')})['strict']()['describe']('Create\x20a\x20new\x20named\x20on-chain\x20object\x20with\x20both\x20a\x20specific\x20token\x20type\x20(e.g.,\x20WOW,\x20USDT,\x20ETH)\x20AND\x20permission\x20control.\x20Use\x20this\x20when\x20you\x20need\x20to\x20specify\x20a\x20token\x20type\x20for\x20payment\x20operations\x20AND\x20require\x20permission\x20management\x20(who\x20can\x20manage/operate\x20this\x20object).\x20For\x20objects\x20without\x20permission\x20management,\x20use\x20TypeNamedObjectSchema\x20instead.');export const CoinParamSchema=z['union']([z['object']({'balance':BalanceTypeSchema})['describe']('Specify\x20an\x20amount\x20value.'),z['object']({'coin':z['string']()['describe']('Coin\x20object\x20ID\x20or\x20name(local\x20mark).\x20WHOLE-COIN\x20TRANSFER:\x20the\x20ENTIRE\x20Coin\x20object\x20is\x20moved\x20to\x20the\x20recipient\x20—\x20the\x20\x27amount\x27\x20is\x20NOT\x20taken\x20from\x20it\x20(testnet\x20lesson:\x20passing\x20your\x20main\x20gas\x20coin\x20transfers\x20its\x20full\x20balance,\x20leaving\x20you\x20unable\x20to\x20pay\x20for\x20anything).\x20Use\x20only\x20for\x20coins\x20whose\x20whole\x20balance\x20is\x20exactly\x20what\x20you\x20intend\x20to\x20send;\x20prefer\x20{balance:\x20<smallest-unit\x20number>}\x20for\x20partial\x20amounts.')})])['describe']('Specify\x20the\x20amount\x20to\x20pay\x20from\x20the\x20transaction\x20account,\x20or\x20the\x20Coin\x20ID\x20owned\x20by\x20the\x20transaction\x20account.\x20Used\x20for\x20payment.');export const CallEnvSchema=z['object']({'account':NameOrAddressSchema['optional']()['default'](''),'permission_guard':z['array'](z['string']())['optional']()['describe']('List\x20of\x20permission\x20guard\x20IDs.\x20Used\x20to\x20extend\x20additional\x20operation\x20permissions\x20(requires\x20verification\x20and\x20configuration\x20in\x20the\x20Permission\x20object).'),'no_cache':z['boolean']()['optional']()['describe']('Whether\x20to\x20disable\x20caching.'),'network':EntrypointSchema['optional']()['describe']('Omit\x20in\x20client/chat\x20contexts\x20—\x20the\x20runtime\x20stamps\x20the\x20user\x27s\x20CURRENT\x20network\x20(the\x20client\x27s\x20UI\x20selection).\x20Standalone\x20MCP/CLI:\x20omit\x20to\x20use\x20the\x20current\x20network;\x20set\x20ONLY\x20when\x20the\x20user\x20explicitly\x20names\x20a\x20different\x20network\x20(a\x20mismatch\x20pauses\x20for\x20user\x20confirmation).\x20Never\x20guess\x20or\x20hardcode\x20a\x20network.'),'referrer':NameOrAddressSchema['optional']()['describe']('Referrer\x20ID.\x20If\x20the\x20user\x20is\x20using\x20the\x20network\x20for\x20the\x20first\x20time,\x20the\x20referrer\x20ID\x20will\x20be\x20recorded\x20(also\x20applied\x20when\x20the\x20SDK\x20auto-registers\x20the\x20sender\x20in\x20the\x20global\x20Entity\x20table).'),'no_auto_register':z['boolean']()['optional']()['describe']('Opt-out\x20of\x20SDK-level\x20Entity\x20auto-registration.\x20By\x20default,\x20a\x20business\x20transaction\x20whose\x20sender\x20has\x20no\x20entry\x20in\x20the\x20global\x20Entity\x20table\x20automatically\x20appends\x20an\x20entity\x20registration:\x20the\x20sender\x20gets\x20registered\x20and\x20receives\x20an\x20owned\x20Resource\x20object\x20(their\x20on-chain\x20mark\x20book)\x20in\x20the\x20wallet.\x20Set\x20true\x20ONLY\x20when\x20the\x20user\x20explicitly\x20cancelled\x20their\x20entity\x20registration\x20or\x20demands\x20that\x20the\x20transaction\x20not\x20touch\x20the\x20Entity\x20table.'),'confirmed':z['boolean']()['optional']()['describe']('Phase\x202\x20ConfirmGate:\x20set\x20to\x20true\x20to\x20proceed\x20after\x20a\x20\x27pending_confirmation\x27\x20result.\x20The\x20operation\x20is\x20NOT\x20executed\x20until\x20you\x20re-call\x20with\x20confirmed=true\x20after\x20user\x20consent.'),'user_intent_phrases':z['array'](z['string']())['optional']()['describe']('Phase\x202\x20ConfirmGate:\x20explicit\x20user\x20intent\x20phrases\x20collected\x20from\x20conversation\x20context\x20(e.g.\x20\x27use\x20default\x20account\x27,\x20\x27force\x20publish\x27).\x20Used\x20to\x20bypass\x20confirmation\x20rules\x20whose\x20bypass_on_explicit_intent\x20matches.'),'plan_approval':z['string']()['optional']()['describe']('K3\x2024\x20PlanApproval:\x20id\x20of\x20a\x20goal\x20whose\x20plan\x20was\x20approved\x20via\x20goal_operation\x20action=\x27approve\x27.\x20When\x20set:\x201)\x20the\x20ConfirmGate\x20treats\x20fail-open\x20rules\x20(standard/none\x20levels)\x20as\x20pre-approved\x20for\x20operations\x20under\x20this\x20goal\x27s\x20plan;\x202)\x20after\x20successful\x20CREATION\x20operations,\x20the\x20created\x20objects\x20are\x20auto-registered\x20into\x20the\x20goal\x20(GoalRecord.objects\x20+\x20its\x20TaskProcess\x20manifest\x20—\x20ACT\x20station\x20\x27execution\x20registers\x27).\x20Fail-closed\x20levels\x20(irreversible/publish/amount)\x20still\x20require\x20per-operation\x20confirmation\x20with\x20env.confirmed=true.'),'client_schema_version':z['string']()['optional']()['describe']('Client-side\x20schema\x20version\x20(semver,\x20e.g.\x20\x271.0.0\x27).\x20When\x20provided,\x20the\x20server\x20checks\x20compatibility\x20and\x20attaches\x20warnings\x20if\x20mismatched.'),'schema_strict_mode':z['boolean']()['optional']()['default'](![])['describe']('When\x20true,\x20schema\x20incompatibility\x20returns\x20an\x20error\x20instead\x20of\x20a\x20warning.\x20Default:\x20false\x20(warn\x20mode).'),'dry_run':z['boolean']()['optional']()['describe']('Phase\x201\x20dry_run:\x20when\x20true,\x20SIMULATE\x20the\x20transaction\x20without\x20signing\x20or\x20submitting.\x20Returns\x20effects\x20+\x20events\x20showing\x20what\x20WOULD\x20happen\x20—\x20no\x20on-chain\x20state\x20is\x20modified,\x20no\x20gas\x20is\x20charged.\x20Use\x20this\x20to\x20verify\x20that\x20an\x20operation\x20will\x20succeed\x20before\x20committing.\x20The\x20returned\x20digest\x20will\x20be\x20\x27dry_run:<timestamp>\x27\x20and\x20objectChanges\x20will\x20be\x20empty\x20(simulation\x20only).'),'response_level':z['enum'](['compact','full'])['optional']()['describe']('Write-success\x20response\x20size.\x20\x27compact\x27\x20(default)\x20trims\x20the\x20structured\x20result\x20to\x20key\x20fields\x20(digest\x20+\x20created\x20object\x20references);\x20\x27full\x27\x20includes\x20the\x20complete\x20raw\x20result.\x20Default:\x20compact.'),'confirm_mode':z['enum'](['full','streamlined','quiet'])['optional']()['describe']('Confirmation\x20frequency\x20for\x20this\x20call.\x20\x27full\x27:\x20confirm\x20every\x20matched\x20gate\x20rule.\x20\x27streamlined\x27\x20(client\x20default):\x20skip\x20fail-open\x20\x27standard\x27\x20level\x20prompts\x20—\x20fail-closed\x20levels\x20(irreversible/publish/amount)\x20ALWAYS\x20still\x20confirm.\x20\x27quiet\x27:\x20same\x20hard\x20floor\x20as\x20streamlined,\x20for\x20clients\x20that\x20batch/suppress\x20repeat\x20low-risk\x20prompts\x20in\x20their\x20own\x20UI.\x20This\x20field\x20NEVER\x20downgrades\x20fail-closed\x20levels.')})['strict']()['describe']('IMPORTANT:\x20Execution\x20environment\x20includes:\x20account\x20for\x20signing\x20operations,\x20network\x20selection\x20('+NETWORKS+'),\x20additional\x20Guard\x20permissions,\x20and\x20more.\x20Used\x20to\x20specify\x20context\x20information\x20during\x20the\x20call.\x20If\x20account\x20is\x20not\x20specified,\x20the\x20default\x20account\x20(\x22\x22)\x20will\x20be\x20used.\x20NOTE:\x20by\x20default\x20the\x20SDK\x20auto-registers\x20the\x20sender\x20in\x20the\x20global\x20Entity\x20table\x20when\x20absent\x20(first\x20business\x20transaction;\x20the\x20account\x20receives\x20an\x20owned\x20Resource\x20object).\x20Set\x20no_auto_register=true\x20only\x20on\x20explicit\x20user\x20request.');export const ObjectsOpSchema=z['union']([z['object']({'op':z['literal']('set')['or'](z['literal']('add'))['or'](z['literal']('remove')),'objects':z['array'](NameOrAddressSchema)})['describe']('Set,\x20add,\x20or\x20remove\x20object\x20ID\x20list.'),z['object']({'op':z['literal']('clear')})['describe']('Remove\x20all\x20objects.')])['describe']('Operate\x20object\x20list.\x20Used\x20to\x20set,\x20add,\x20or\x20remove\x20objects.');export const ResponseDataSchema=ObjectBaseSchema['extend']({'change':z['union']([z['literal']('created'),z['literal']('mutated'),z['string']()])['describe']('What\x20happened\x20to\x20this\x20object\x20in\x20the\x20operation.\x20Constraint:\x20\x27created\x27\x20|\x20\x27mutated\x27\x20|\x20custom\x20string.\x20Example:\x20\x27created\x27')})['describe']('One\x20object\x20record\x20in\x20a\x20query\x20result.\x20Contains\x20the\x20object\x27s\x20basic\x20info\x20plus\x20how\x20it\x20changed\x20in\x20this\x20operation.');export const ObjectRoleSchema=z['object']({'id':z['string']()['describe']('Object\x20ID\x20(64-hex\x20with\x200x\x20prefix).\x20Identifies\x20the\x20on-chain\x20object.\x20Example:\x20\x270xa1d4...\x27'),'name':z['union']([z['string'](),z['null']()])['optional']()['describe']('Local\x20mark\x20name\x20if\x20assigned,\x20else\x20null.\x20Relation:\x20resolved\x20via\x20local_mark_operation.\x20Example:\x20\x27my-shop\x27\x20or\x20null'),'role':z['enum'](['Permission','Guard','Machine','Progress','Service','Order','Allocation','Arbitration','ArbCase','Messenger','Contact','Demand','Reward','Personal','Repository','Treasury','Discount','Payment','Passport','Proof','Other'])['describe']('Business\x20role\x20of\x20the\x20object\x20in\x20the\x20dependency\x20graph.\x20Constraint:\x20enum\x20of\x2021\x20values.\x20Relation:\x20derived\x20from\x20objectType\x20last\x20segment;\x20drives\x20Plan/Verify\x20Loop\x20positioning.\x20Example:\x20\x27Service\x27'),'relation':z['object']({'parent':z['union']([z['string'](),z['null']()])['optional']()['describe']('Parent\x20object\x20ID,\x20if\x20this\x20object\x20belongs\x20to\x20another\x20(e.g.\x20Machine\x20belongs\x20to\x20Service).\x20Example:\x20\x270x123...\x27\x20or\x20null'),'relation_type':z['enum'](['machine_of','guard_of','allocator_of','permission_of','progress_of','allocation_of','arb_of','other'])['optional']()['describe']('How\x20this\x20object\x20relates\x20to\x20its\x20parent.\x20Example:\x20\x27machine_of\x27')})['optional']()['describe']('Relationship\x20to\x20another\x20object\x20in\x20the\x20dependency\x20graph'),'immutable':z['boolean']()['optional']()['describe']('Whether\x20the\x20object\x20has\x20entered\x20an\x20immutable\x20state\x20(e.g.\x20Service\x20published).\x20Constraint:\x20true\x20after\x20publish.\x20Example:\x20true')})['strict']()['describe']('An\x20object\x20tagged\x20with\x20its\x20business\x20role\x20and\x20relationship\x20within\x20the\x20object\x20dependency\x20graph');export const FundRoleSchema=z['object']({'amount':z['string']()['describe']('Amount\x20change\x20as\x20stringified\x20integer\x20(smallest\x20unit).\x20Negative=spend,\x20positive=receive.\x20Example:\x20\x27-10000000000\x27'),'coinType':z['string']()['describe']('Coin\x20type\x20tag\x20(format:\x20{address}::{module}::{struct}).\x20Example:\x20\x270x2::wow::WOW\x27'),'role':z['enum'](['payment','refund','change','compensation','reward','gas','deposit','release','other'])['describe']('Business\x20role\x20of\x20this\x20fund\x20movement.\x20Constraint:\x20enum\x20of\x209\x20values.\x20Relation:\x20derived\x20from\x20operation\x20context.\x20Example:\x20\x27payment\x27'),'from':z['string']()['nullable']()['optional']()['describe']('Sender\x20address\x20if\x20known.\x20Example:\x20\x270xabc...\x27\x20or\x20null'),'to':z['string']()['nullable']()['optional']()['describe']('Recipient\x20address\x20if\x20known.\x20Example:\x20\x270xdef...\x27\x20or\x20null')})['strict']()['describe']('A\x20fund\x20movement\x20tagged\x20with\x20its\x20business\x20role');export const NextActionSchema=z['object']({'action':z['string']()['describe']('Recommended\x20next\x20action.\x20Example:\x20\x27add\x20sales\x20products\x27'),'reason':z['string']()['describe']('Why\x20this\x20action\x20is\x20recommended.\x20Example:\x20\x27Service\x20has\x20no\x20products;\x20customers\x20cannot\x20order\x27'),'tool':z['string']()['optional']()['describe']('MCP\x20tool\x20to\x20use,\x20if\x20applicable.\x20Example:\x20\x27onchain_operations\x27'),'prerequisite':z['string']()['optional']()['describe']('Condition\x20that\x20must\x20hold\x20before\x20this\x20action.\x20Example:\x20\x27Service\x20must\x20be\x20created\x20first\x27'),'priority':z['enum'](['required','recommended','optional'])['describe']('Priority.\x20Constraint:\x20enum.\x20Example:\x20\x27required\x27')})['strict']()['describe']('A\x20recommended\x20next\x20action\x20with\x20priority\x20and\x20rationale');export const EventSemanticSchema=z['object']({'event_type':z['string']()['describe']('Raw\x20on-chain\x20event\x20type\x20tag.\x20Example:\x20\x270x2::service::ServicePublishedEvent\x27'),'business_meaning':z['string']()['describe']('Human-readable\x20business\x20meaning.\x20Example:\x20\x27Service\x20has\x20been\x20published\x20and\x20is\x20now\x20immutable\x27'),'category':z['enum'](['lifecycle','state_change','fund_flow','market_opportunity','reputation','permission','guard','other'])['describe']('Business\x20category.\x20Constraint:\x20enum\x20of\x208\x20values.\x20\x27market_opportunity\x27\x20=\x20supply/demand\x20discovery\x20signal\x20(ServiceEvent/DemandChangedEvent/DemandPresentEvent,\x20K3\x2013\x20§6.7);\x20\x27reputation\x27\x20=\x20trust-affecting\x20signal\x20(DemandFeedbackEvent).\x20Example:\x20\x27fund_flow\x27'),'related_object':z['string']()['optional']()['describe']('Object\x20ID\x20the\x20event\x20relates\x20to,\x20if\x20extractable.\x20Example:\x20\x270x123...\x27'),'side_effect':z['string']()['optional']()['describe']('Side\x20effect\x20description\x20for\x20AI.\x20Example:\x20\x27Customers\x20can\x20now\x20place\x20orders\x20against\x20this\x20Service\x27')})['strict']()['describe']('An\x20on-chain\x20event\x20annotated\x20with\x20business\x20semantics');export const ExperienceSchema=z['object']({'advice':z['string']()['optional']()['describe']('Advice\x20from\x20past\x20experience.\x20Example:\x20\x27Last\x20time\x20you\x20forgot\x20to\x20set\x20buy_guard;\x20add\x20it\x20before\x20publishing\x27'),'avoid':z['array'](z['string']())['optional']()['describe']('Pitfalls\x20to\x20avoid\x20based\x20on\x20history.\x20Example:\x20[\x27Guard\x20rejection\x20on\x20delivery_proof\x27]'),'relevance':z['number']()['min'](0x0)['max'](0x1)['optional']()['describe']('Relevance\x20score\x200-1\x20of\x20the\x20matched\x20experience.\x20Example:\x200.85'),'matched_scenario':z['string']()['optional']()['describe']('Matched\x20historical\x20scenario.\x20Example:\x20\x27publish_service_freelance\x27')})['strict']()['describe']('Experience\x20layer\x20feedback\x20from\x20past\x20operations\x20(Phase\x202\x20Topic\x202).\x20Provides\x20advice\x20and\x20pitfalls\x20based\x20on\x20historical\x20patterns.');export const ServiceStatusSchema=z['object']({'active':z['array'](z['string']())['describe']('Phase\x202\x20services\x20currently\x20active\x20(enabled).\x20Example:\x20[\x27confirm_gate\x27,\x27experience_layer\x27]'),'inactive':z['array'](z['string']())['optional']()['describe']('Phase\x202\x20services\x20currently\x20inactive\x20(can\x20be\x20toggled\x20via\x20config_operation).\x20Example:\x20[\x27harness\x27]')})['strict']()['describe']('Phase\x202\x20runtime\x20service\x20status\x20(populated\x20when\x20semantic_rich\x20is\x20enabled).\x20Lets\x20AI\x20see\x20which\x20services\x20are\x20active\x20in\x20each\x20response.');export const CustomerReminderSchema=z['object']({'id':z['string']()['describe']('Reminder\x20rule\x20id.\x20Example:\x20\x27high_risk_score\x27'),'stage':z['enum'](['browse','evaluate','preorder','in_progress','complete','after_sale'])['describe']('Order\x20lifecycle\x20stage\x20when\x20this\x20reminder\x20fires.\x20Example:\x20\x27evaluate\x27'),'priority':z['enum'](['required','recommended','info','reminder'])['describe']('Priority.\x20\x27required\x27\x20=\x20blocks\x20purchase;\x20\x27recommended\x27\x20=\x20strong\x20caution.\x20Example:\x20\x27required\x27'),'message':z['string']()['describe']('Human-readable\x20reminder\x20message.\x20Example:\x20\x27Composite\x20risk\x20score\x2025/100,\x20strongly\x20discourage\x20purchase\x27'),'action':z['string']()['optional']()['describe']('Suggested\x20next\x20action.\x20Example:\x20\x27require\x20merchant\x20to\x20bind\x20Arbitration\x20before\x20ordering\x27')})['strict']()['describe']('A\x20buyer-side\x20reminder\x20triggered\x20at\x20a\x20specific\x20order\x20lifecycle\x20stage\x20(Phase\x203\x20C-3).');export const PreferenceMatchSchema=z['object']({'score':z['number']()['min'](0x0)['max'](0x64)['describe']('Match\x20score\x200-100\x20(higher\x20=\x20better\x20fit).\x20Example:\x2075'),'matches':z['array'](z['string']())['describe']('Aspects\x20that\x20match\x20user\x20preferences.\x20Example:\x20[\x27Price\x2010%\x20below\x20average\x27,\x27Has\x20arbitration\x27]'),'mismatches':z['array'](z['string']())['describe']('Aspects\x20that\x20mismatch\x20user\x20preferences.\x20Example:\x20[\x27Delivery\x20cycle\x20exceeds\x20expectation\x27]')})['strict']()['describe']('Service-to-preference\x20match\x20result\x20(Phase\x203\x20C-2).\x207-dimension\x20scoring:\x20price/time/region/brand/bargain/emotion/risk.');export const CustomerAdviceSchema=z['object']({'risk_score':z['number']()['min'](0x0)['max'](0x64)['optional']()['describe']('Composite\x20risk\x20score\x200-100\x20(higher\x20=\x20safer).\x20Relation:\x20risk\x20dimension\x20of\x20the\x20onchain_topology\x20graph\x20evaluation.\x20Example:\x2075'),'risk_level':z['enum'](['low','medium_low','medium_high','high'])['optional']()['describe']('Risk\x20level\x20bucket.\x20\x27high\x27\x20=\x20strongly\x20discourage\x20purchase.\x20Example:\x20\x27medium_high\x27'),'recommendations':z['array'](z['string']())['describe']('Actionable\x20recommendations\x20for\x20the\x20buyer.\x20Example:\x20[\x27Require\x20merchant\x20to\x20configure\x20arbitration\x27,\x27Negotiate\x20refund\x20terms\x20via\x20Messenger\x27]'),'reminders':z['array'](CustomerReminderSchema)['describe']('Stage-specific\x20reminders\x20(deduped,\x20sorted\x20by\x20priority,\x20capped\x20to\x203\x20high-risk).\x20Example:\x20[{priority:\x27required\x27,\x20message:\x27Ambiguous\x20Guard\x20must\x20be\x20human-reviewed\x27}]'),'preference_match':PreferenceMatchSchema['optional']()['describe']('Service-to-preference\x20match\x20(populated\x20when\x20user\x20preferences\x20exist).\x20Example:\x20{score:75,\x20matches:[...],\x20mismatches:[...]}')})['strict']()['describe']('Buyer-side\x20advice\x20(Phase\x203\x20C-3.3).\x20Populated\x20in\x20semantic.customer_advice\x20for\x20order/query\x20operations\x20when\x20customer_intelligence\x20service\x20is\x20enabled.');export const EvolutionContextSchema=z['object']({'industry_signal':z['string']()['optional']()['describe']('Industry\x20evolution\x20signal\x20summary.\x20Example:\x20\x27Industry\x20health\x2082/100\x20(healthy);\x2025\x20cumulative\x20industry\x20signals\x27'),'evolution_advice':z['string']()['optional']()['describe']('Evolution\x20advice\x20for\x20the\x20current\x20operation.\x20Example:\x20\x27Recommend\x20mandatory\x20arbitration\x20+\x20compensation\x20fund\x20+\x20delivery\x20Guard\x27'),'confidence':z['number']()['min'](0x0)['max'](0x1)['describe']('Confidence\x20of\x20the\x20evolution\x20context\x200-1.\x20<0.5\x20means\x20no\x20data\x20yet.\x20Example:\x200.75'),'health_score':z['number']()['min'](0x0)['max'](0x64)['optional']()['describe']('Industry\x20health\x20score\x200-100\x20if\x20available.\x20Example:\x2082'),'pending_suggestions':z['number']()['int']()['min'](0x0)['optional']()['describe']('Count\x20of\x20pending\x20industry\x20update\x20suggestions\x20(filtered\x20by\x20role\x20if\x20role\x20is\x20set).\x20Example:\x203'),'intent':z['enum'](['default','growth','retention','compliance','efficiency','trust_building','custom'])['optional']()['describe']('Phase\x204\x20P4-6.C:\x20Current\x20business\x20intent\x20driving\x20the\x20scoring\x20model.\x20Absent\x20=\x20\x27default\x27.\x20Example:\x20\x27growth\x27'),'role_advice':z['array'](z['string']())['optional']()['describe']('Phase\x204\x20P4-6.C:\x20Role-targeted\x20advice\x20strings\x20(merchant/customer/demander/prospect/supplier/collaborator/arbitrator).\x20Example:\x20[\x27Strengthen\x20loyalty\x20flywheel\x27,\x27Optimize\x20first-order\x20conversion\x27]'),'role':z['enum'](PERSONA_ROLES)['optional']()['describe']('Phase\x204\x20P4-6.C:\x20Role\x20used\x20for\x20advice\x20routing.\x20Example:\x20\x27merchant\x27')})['strict']()['describe']('Phase\x204\x20industry\x20evolution\x20context\x20(populated\x20when\x20industry_evolution\x20service\x20is\x20enabled).\x20Provides\x20AI\x20with\x20industry-level\x20health\x20signals,\x20evolution\x20advice,\x20and\x20role-targeted\x20recommendations.');export const GuardPuzzleStatusSchema=z['object']({'intent':z['boolean']()['describe']('Intent\x20dimension\x20complete\x20(action\x20+\x20rule\x20+\x20failure\x20conditions)'),'binding':z['boolean']()['describe']('Binding\x20dimension\x20complete\x20(host\x20object\x20+\x20field\x20+\x20circular\x20ref)'),'data':z['boolean']()['describe']('Data\x20dimension\x20complete\x20(table\x20entries\x20+\x20witnesses)'),'query':z['boolean']()['describe']('Query\x20dimension\x20complete\x20(query\x20instructions\x20if\x20needed)'),'logic':z['boolean']()['describe']('Logic\x20dimension\x20complete\x20(root\x20node\x20returns\x20Bool)'),'constraints':z['boolean']()['describe']('Constraints\x20dimension\x20complete\x20(10\x20Pitfalls\x20checked)')})['strict']()['describe']('Guard\x20information\x20puzzle\x20completeness\x20status.\x206\x20dimensions\x20(A-F).\x20false\x20=\x20missing,\x20needs\x20user\x20input.');export const GuardAvailableQuerySchema=z['object']({'id':z['number']()['int']()['describe']('Query\x20instruction\x20ID.\x20Example:\x201253'),'name':z['string']()['describe']('Query\x20instruction\x20name.\x20Example:\x20\x27progress.current\x27'),'objectType':z['string']()['describe']('Target\x20object\x20type.\x20Example:\x20\x27Progress\x27'),'returnType':z['string']()['describe']('Return\x20value\x20type.\x20Example:\x20\x27String\x27'),'description':z['string']()['optional']()['describe']('Query\x20description')})['strict']()['describe']('A\x20Guard\x20query\x20instruction\x20available\x20for\x20the\x20current\x20context\x20(subset\x20of\x20GUARDQUERY\x20375\x20entries).');export const GuardAdviceSchema=z['object']({'current_round':z['enum'](['R1','R2','R3','R4','R5','R6','R7','R8','R9','R10'])['optional']()['describe']('Current\x20R1-R10\x20dialogue\x20round.\x20R1=intent,\x20R2=table,\x20R3=tree,\x20R4=rely,\x20R5=binding,\x20R6=review,\x20R7=CREATE,\x20R8=test,\x20R9=bind,\x20R10=verify.\x20Example:\x20\x27R3\x27'),'puzzle_status':GuardPuzzleStatusSchema['optional']()['describe']('Information\x20puzzle\x20completeness\x20(6\x20dimensions).\x20Missing\x20dimensions\x20need\x20user\x20input\x20before\x20CREATE.'),'matched_scene':z['string']()['optional']()['describe']('Matched\x20Guard\x20scene\x20id\x20from\x20the\x208\x20binding\x20scenarios\x20ledger.\x20Example:\x20\x27machine_forward_guard\x27'),'scene_description':z['string']()['optional']()['describe']('Human-readable\x20scene\x20description.\x20Example:\x20\x27Workflow\x20node\x20forward\x20validation\x20(Forward.guard)\x27'),'scene_constraints':z['array'](z['string']())['optional']()['describe']('Special\x20constraints\x20for\x20the\x20matched\x20scene.\x20Example:\x20[\x27Forward.guard\x20cannot\x20be\x20modified\x20after\x20Machine\x20is\x20published\x27]'),'suggested_patterns':z['array'](z['string']())['optional']()['describe']('Suggested\x20Guard\x20patterns\x20based\x20on\x20user\x20intent.\x20Example:\x20[\x27time\x20lock\x27,\x27progress\x20status\x20check\x27]'),'available_queries':z['array'](GuardAvailableQuerySchema)['optional']()['describe']('Available\x20query\x20instructions\x20for\x20the\x20current\x20context\x20(subset\x20of\x20375\x20GUARDQUERY\x20entries)'),'risk_warnings':z['array'](z['string']())['optional']()['describe']('Risk\x20warnings\x20for\x20the\x20current\x20Guard\x20design.\x20Example:\x20[\x27Guard\x20cannot\x20be\x20modified\x20after\x20creation\x27,\x27Time\x20lock\x20test\x20uses\x201000ms\x27]'),'pending_questions':z['array'](z['string']())['optional']()['describe']('Questions\x20for\x20the\x20user\x20to\x20complete\x20the\x20puzzle.\x20Example:\x20[\x27Which\x20Host\x20Object\x20will\x20the\x20Guard\x20bind\x20to?\x27]'),'confirmation_text':z['string']()['optional']()['describe']('Structured\x20semantic\x20confirmation\x20text\x20for\x20user\x20review\x20(generated\x20when\x20puzzle\x20is\x20complete).\x20User\x20must\x20explicitly\x20confirm\x20before\x20CREATE.'),'test_result':z['object']({'status':z['enum'](['pass','fail','not_tested']),'failure_node':z['string']()['optional']()['describe']('Node\x20that\x20caused\x20failure\x20(if\x20fail)'),'passport_id':z['string']()['optional']()['describe']('Generated\x20Passport\x20ID\x20(if\x20pass)'),'guard_results':z['array'](z['object']({'guard':z['string'](),'result':z['boolean'](),'impack':z['boolean']()['optional']()}))['optional']()['describe']('Per-Guard\x20evaluation\x20result\x20read\x20from\x20the\x20Passport\x20(docs#40:\x20the\x20pass/fail\x20status\x20comes\x20from\x20Passport.result,\x20not\x20transaction\x20success)')})['optional']()['describe']('gen_passport\x20static\x20test\x20result.\x20status\x20is\x20read\x20from\x20the\x20created\x20Passport\x27s\x20on-chain\x20result\x20field;\x20tx\x20success\x20alone\x20never\x20means\x20the\x20Guard\x20passed.'),'risk_assessment':z['object']({'overall_risk':z['enum'](['critical','high','medium','low','info'])['describe']('Overall\x20risk\x20level\x20(highest\x20from\x20all\x20risks)'),'risk_count':z['number']()['int']()['describe']('Total\x20number\x20of\x20detected\x20risks'),'critical_count':z['number']()['int']()['describe']('Number\x20of\x20critical\x20risks'),'high_count':z['number']()['int']()['describe']('Number\x20of\x20high\x20risks'),'needs_human_review':z['boolean']()['describe']('Whether\x20human\x20review\x20is\x20required\x20(critical\x20or\x202+\x20high\x20risks)'),'top_risks':z['array'](z['string']())['describe']('Top\x20risk\x20titles\x20(critical\x20and\x20high,\x20max\x203)'),'stakeholder_advice':z['record'](z['string'](),z['array'](z['string']()))['optional']()['describe']('Per-stakeholder\x20advice.\x20Key=stakeholder\x20(customer/provider/arbitrator/claimant),\x20value=advice\x20list')})['optional']()['describe']('Business-layer\x20risk\x20assessment\x20(game\x20theory,\x20data\x20source\x20trust,\x20logic\x20gaps).\x20Populated\x20during\x20Guard\x20design\x20to\x20warn\x20about\x20business\x20risks\x20beyond\x20syntax.')})['strict']()['describe']('Guard\x20advice\x20(Phase\x205\x20Guard\x20capability\x20system).\x20Injected\x20when\x20user\x20intent\x20involves\x20Guard.\x20Provides\x20context\x20for\x20Guard\x20design,\x20generation,\x20confirmation,\x20and\x20execution.');export const WorkflowOperatorSchema=z['object']({'kind':z['enum'](['order_holder','permission_index','named_operator'])['describe']('Who\x20can\x20execute\x20this\x20forward\x20(K3\x20feasibility).\x20\x27order_holder\x27\x20=\x20the\x20Order\x20owner\x20(customer;\x20forward\x20namedOperator=\x27\x27),\x20\x27permission_index\x27\x20=\x20a\x20permission\x20role,\x20\x27named_operator\x27\x20=\x20a\x20specific\x20Progress\x20namespace\x20operator.'),'permission_index':z['number']()['int']()['optional']()['describe']('Permission\x20index\x20when\x20kind=\x27permission_index\x27.\x20Example:\x201000'),'role_name':z['string']()['optional']()['describe']('Resolved\x20role\x20display\x20name.\x20Example:\x20\x27merchant\x20(permission\x201000)\x27\x20/\x20\x27order\x20holder\x20(customer)\x27'),'account_name':z['string']()['optional']()['describe']('Resolved\x20local\x20account/mark\x20name\x20when\x20the\x20operator\x20maps\x20to\x20a\x20concrete\x20account.\x20Example:\x20\x27london_guide\x27'),'named_operator':z['string']()['optional']()['describe']('NamedOperator\x20namespace\x20when\x20kind=\x27named_operator\x27.\x20Example:\x20\x27delivery_team\x27')})['strict']()['describe']('The\x20account/permission\x20that\x20can\x20execute\x20a\x20workflow\x20forward\x20(K3\x20Game\x20feasibility:\x20who\x20can\x20act).');export const WorkflowOptionSchema=z['object']({'next_node':z['string']()['describe']('Target\x20node\x20this\x20forward\x20advances\x20INTO.\x20Example:\x20\x27serving\x27'),'forward':z['string']()['describe']('Forward\x20(operation)\x20name.\x20Example:\x20\x27StartService\x27'),'weight':z['number']()['describe']('Forward\x20weight\x20contributed\x20toward\x20the\x20pair\x20threshold.\x20Example:\x201'),'operator':WorkflowOperatorSchema['describe']('Who\x20can\x20execute\x20this\x20forward\x20(which\x20account\x20+\x20which\x20permission).'),'guard':z['string']()['optional']()['describe']('Guard\x20bound\x20to\x20the\x20forward\x20—\x20acceptance\x20condition\x20verified\x20BEFORE\x20the\x20transition.\x20Example:\x20\x27guard_payout\x27'),'business_meaning':z['string']()['describe']('Business\x20meaning\x20of\x20advancing\x20to\x20this\x20node.\x20Example:\x20\x27Guide\x20starts\x20the\x20day\x20service\x27'),'gains':z['array'](z['string']())['optional']()['describe']('Gains\x20for\x20the\x20caller\x20if\x20this\x20option\x20is\x20chosen\x20(K3\x20Game\x20G1\x20gain\x20separation).\x20Example:\x20[\x27Settlement\x20unlocked\x20—\x20funds\x20releasable\x20to\x20provider\x20via\x20an\x20explicit\x20allocation\x20step\x27]'),'risks':z['array'](z['string']())['optional']()['describe']('Risks\x20for\x20the\x20caller\x20if\x20this\x20option\x20is\x20chosen\x20(K3\x20Game\x20G1\x20risk\x20separation).\x20Example:\x20[\x27Refund\x20leverage\x20lost\x20after\x20confirmation\x27]'),'consistency':z['number']()['min'](0x0)['max'](0x64)['optional']()['describe']('Consistency\x200-100\x20between\x20this\x20option\x27s\x20business\x20semantics\x20and\x20the\x20caller\x27s\x20interests\x20(K3\x20Game\x20optimality).\x20Higher\x20=\x20more\x20aligned.'),'recommended':z['boolean']()['optional']()['describe']('Whether\x20this\x20is\x20the\x20recommended\x20option\x20(highest\x20consistency).')})['strict']()['describe']('A\x20reachable\x20next-node\x20option\x20with\x20its\x20operator/permission,\x20guard,\x20business\x20meaning,\x20and\x20K3-style\x20gains/risks/consistency.');export const WorkflowRecommendationSchema=z['object']({'best':z['string']()['optional']()['describe']('Recommended\x20action\x20in\x20\x27<forward>\x20→\x20<next_node>\x27\x20form.\x20Example:\x20\x27StartService\x20→\x20serving\x27'),'rationale':z['string']()['optional']()['describe']('Why\x20this\x20option\x20is\x20recommended\x20(framed\x20at\x20the\x20caller\x27s\x20value:\x20gains/risks).\x20Example:\x20\x27For\x20the\x20guide,\x20advancing\x20to\x20serving\x20triggers\x20the\x20delivery\x20flow\x27'),'caveat':z['string']()['optional']()['describe']('Disclosed\x20trade-off\x20/\x20opportunity\x20cost\x20of\x20NOT\x20taking\x20another\x20path\x20(K3\x20Game\x20G3\x20opportunity\x20cost).\x20Example:\x20\x27Choosing\x20cancelled\x20forfeits\x20this\x20order\x27s\x20settlement\x27')})['strict']()['describe']('K3-based\x20recommendation\x20(AI\x20recommends,\x20human\x20decides\x20—\x20the\x20choice\x20always\x20remains\x20with\x20the\x20account).');export const WorkflowGuidanceSchema=z['object']({'current_node':z['string']()['describe']('Current\x20node\x20of\x20the\x20Progress.\x20Example:\x20\x27serving\x27'),'caller':z['string']()['optional']()['describe']('The\x20account\x20(name/address)\x20this\x20guidance\x20is\x20framed\x20for\x20(env.account).\x20Example:\x20\x27london_guide\x27'),'options':z['array'](WorkflowOptionSchema)['describe']('ALL\x20reachable\x20next-node\x20directions\x20(every\x20operator/permission/guard\x20disclosed).'),'recommendation':WorkflowRecommendationSchema['optional']()['describe']('Recommended\x20option\x20with\x20rationale\x20(K3\x20Game\x20intent/game/interests).'),'note':z['string']()['optional']()['describe']('Additional\x20note\x20(e.g.\x20wait\x20for\x20the\x20other\x20party,\x20entry/terminal\x20hint).')})['strict']()['describe']('Permission-aware\x20workflow\x20guidance:\x20current\x20node\x20+\x20every\x20reachable\x20next\x20node\x20with\x20its\x20operator/permission/guard\x20and\x20a\x20K3-framed\x20recommendation.');export const WorkflowWaitingSchema=z['object']({'forward':z['string']()['describe']('Forward\x20still\x20required\x20to\x20reach\x20the\x20threshold.\x20Example:\x20\x27GuideConfirm\x27'),'operator':WorkflowOperatorSchema['describe']('Who\x20must\x20execute\x20this\x20forward\x20next.')})['strict']()['describe']('A\x20forward\x20still\x20pending\x20—\x20who\x20must\x20act\x20next\x20(threshold\x20cooperation,\x20K3\x20Game\x20G4).');export const WorkflowReceiptSchema=z['object']({'account':z['string']()['describe']('The\x20account\x20that\x20executed\x20the\x20operation\x20(env.account).\x20Example:\x20\x27london_guide\x27'),'action':z['string']()['describe']('What\x20was\x20done.\x20Example:\x20\x27london_guide\x20executed\x20StartService\x20(paid\x20→\x20serving)\x27'),'forward':z['string']()['describe']('Forward\x20name\x20executed.\x20Example:\x20\x27StartService\x27'),'target_node':z['string']()['describe']('Target\x20node\x20of\x20the\x20executed\x20forward.\x20Example:\x20\x27serving\x27'),'op':z['enum'](['next','hold','unhold','adminUnhold'])['optional']()['describe']('Operation\x20type\x20executed.'),'migrated':z['boolean']()['describe']('Whether\x20the\x20Progress\x20migrated\x20to\x20the\x20target\x20node\x20(true)\x20or\x20stayed\x20(false\x20—\x20weights\x20still\x20accumulating\x20toward\x20threshold).'),'current_node':z['string']()['describe']('Progress.current\x20after\x20the\x20operation.'),'threshold':z['number']()['optional']()['describe']('Pair\x20threshold\x20when\x20NOT\x20migrated\x20(threshold\x20>\x200).'),'accumulated_weight':z['number']()['optional']()['describe']('Accumulated\x20forward\x20weight\x20in\x20the\x20current\x20session\x20when\x20NOT\x20migrated.'),'remaining':z['number']()['optional']()['describe']('threshold\x20-\x20accumulated_weight\x20when\x20NOT\x20migrated.'),'waiting_on':z['array'](WorkflowWaitingSchema)['optional']()['describe']('Pending\x20forwards\x20+\x20their\x20operators\x20when\x20NOT\x20migrated\x20(K3\x20Game\x20G4\x20—\x20who\x20must\x20cooperate\x20next).'),'next_guidance':WorkflowGuidanceSchema['optional']()['describe']('Next-node\x20guidance\x20from\x20the\x20resulting\x20current\x20node.'),'note':z['string']()['optional']()['describe']('Additional\x20note.')})['strict']()['describe']('Post-operation\x20receipt:\x20which\x20account\x20did\x20what,\x20whether\x20the\x20node\x20migrated,\x20and\x20threshold/weight\x20cooperation\x20status\x20when\x20it\x20did\x20not\x20(K3\x20Game\x20G4).');export const SemanticSummarySchema=z['object']({'intent':z['string']()['describe']('Inferred\x20user\x20intent\x20/\x20operation\x20goal.\x20Constraint:\x20snake_case\x20string.\x20Relation:\x20derived\x20from\x20operation_type\x20+\x20data\x20signals.\x20Example:\x20\x27publish_service\x27'),'status':z['enum'](['success','partial','failed','pending_input'])['describe']('Business-level\x20status\x20(not\x20raw\x20tx\x20status).\x20\x27pending_input\x27\x20=\x20needs\x20Guard\x20submission.\x20Example:\x20\x27success\x27'),'summary':z['string']()['describe']('One-sentence\x20human-readable\x20summary\x20of\x20what\x20happened.\x20AI\x20should\x20read\x20this\x20first.\x20Example:\x20\x27Successfully\x20published\x20Service\x20my-shop\x20with\x20Machine\x20bound\x27'),'created':z['array'](ObjectRoleSchema)['optional']()['describe']('Objects\x20newly\x20created\x20in\x20this\x20operation,\x20tagged\x20with\x20roles'),'modified':z['array'](ObjectRoleSchema)['optional']()['describe']('Objects\x20mutated\x20in\x20this\x20operation,\x20tagged\x20with\x20roles'),'released':z['array'](FundRoleSchema)['optional']()['describe']('Fund\x20movements\x20in\x20this\x20operation,\x20tagged\x20with\x20roles'),'events':z['array'](EventSemanticSchema)['optional']()['describe']('On-chain\x20events\x20annotated\x20with\x20business\x20semantics\x20(S-8)'),'next_actions':z['array'](NextActionSchema)['optional']()['describe']('Recommended\x20next\x20actions\x20to\x20drive\x20the\x20workflow\x20forward'),'warnings':z['array'](z['string']())['optional']()['describe']('Business-level\x20warnings.\x20Example:\x20\x27order_allocators\x20not\x20configured;\x20order\x20funds\x20cannot\x20be\x20distributed\x27'),'experience':ExperienceSchema['optional']()['describe']('Experience\x20layer\x20feedback\x20from\x20past\x20operations\x20(Phase\x202\x20Topic\x202)'),'service_status':ServiceStatusSchema['optional']()['describe']('Phase\x202\x20runtime\x20service\x20status\x20(populated\x20when\x20semantic_rich\x20is\x20enabled).\x20Lets\x20AI\x20see\x20active\x20services\x20in\x20each\x20response.'),'customer_advice':CustomerAdviceSchema['optional']()['describe']('Buyer-side\x20advice\x20(Phase\x203\x20C-3.3).\x20Populated\x20when\x20customer_intelligence\x20service\x20is\x20enabled\x20AND\x20operation\x20is\x20order/query\x20on\x20a\x20Service.\x20Contains\x20risk_score,\x20recommendations,\x20reminders,\x20and\x20preference_match.'),'evolution_context':EvolutionContextSchema['optional']()['describe']('Phase\x204\x20industry\x20evolution\x20context\x20(populated\x20when\x20industry_evolution\x20service\x20is\x20enabled).\x20Provides\x20AI\x20with\x20industry\x20health\x20signals\x20and\x20evolution\x20advice.'),'guard_advice':GuardAdviceSchema['optional']()['describe']('Phase\x205\x20Guard\x20capability\x20advice\x20(populated\x20when\x20user\x20intent\x20involves\x20Guard).\x20Provides\x20puzzle\x20status,\x20scene\x20matching,\x20suggested\x20patterns,\x20available\x20queries,\x20risk\x20warnings,\x20and\x20confirmation\x20text.\x20AI\x20uses\x20this\x20to\x20guide\x20Guard\x20design\x20dialogue\x20(R1-R10).'),'workflow_guidance':WorkflowGuidanceSchema['optional']()['describe']('K3\x20permission-aware\x20workflow\x20guidance:\x20current\x20node\x20+\x20ALL\x20reachable\x20next\x20nodes\x20with\x20their\x20operator/permission/guard\x20+\x20K3\x20recommendation.\x20Populated\x20when\x20a\x20Progress\x20(or\x20Order\x20with\x20Progress)\x20is\x20queried\x20and\x20after\x20progress\x20operate.\x20AI\x20must\x20read\x20this\x20BEFORE\x20proposing\x20the\x20next\x20workflow\x20operation.'),'workflow_receipt':WorkflowReceiptSchema['optional']()['describe']('K3\x20operate\x20receipt:\x20which\x20account\x20did\x20what,\x20whether\x20the\x20node\x20migrated,\x20and\x20threshold/weight\x20cooperation\x20status\x20when\x20it\x20did\x20not.\x20AI\x20must\x20relay\x20this\x20to\x20the\x20user\x20after\x20every\x20progress\x20operation.')})['strict']()['describe']('Business\x20semantic\x20summary:\x20translates\x20the\x20raw\x20transaction\x20response\x20into\x20AI-directly-understandable\x20business\x20meaning');export const CallResponseErrorSchema=z['object']({'type':z['literal']('error')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27error\x27.\x20Example:\x20\x27error\x27'),'error':z['string']()['describe']('Human-readable\x20error\x20message\x20from\x20the\x20chain\x20or\x20SDK.\x20Relation:\x20enriched\x20via\x20enrichMoveError\x20before\x20classification.\x20Example:\x20\x27Insufficient\x20balance\x20for\x20gas\x27'),'error_code':z['enum'](ERROR_CODE_VALUES)['optional']()['describe']('Error\x20classification\x20for\x20programmatic\x20recovery.\x20Constraint:\x20enum\x20values\x20single-sourced\x20from\x20error-codes.ts\x20(must\x20match\x20ErrorCode\x20in\x20semantic.ts).\x20Relation:\x20drives\x20Recover\x20Loop\x20strategy\x20selection.\x20Example:\x20\x27insufficient_balance\x27'),'retryable':z['boolean']()['optional']()['describe']('Whether\x20the\x20same\x20call\x20can\x20be\x20retried\x20as-is.\x20Constraint:\x20true\x20for\x20network_error,\x20rate_limit,\x20gas_exceeded,\x20and\x20insufficient_balance.\x20Example:\x20true'),'recovery_hint':z['string']()['optional']()['describe']('Recovery\x20suggestion\x20for\x20AI\x20or\x20user.\x20Relation:\x20paired\x20with\x20error_code\x20to\x20guide\x20Recover\x20Loop.\x20Example:\x20\x27Claim\x20faucet\x20tokens\x20then\x20retry\x27'),'related_object':z['string']()['optional']()['describe']('Object\x20ID\x20related\x20to\x20the\x20error,\x20if\x20any.\x20Example:\x20\x270x123...\x27')})['describe']('Error\x20result.\x20Contains\x20the\x20raw\x20error\x20message\x20plus\x20structured\x20classification\x20(error_code/retryable/recovery_hint)\x20so\x20AI\x20can\x20choose\x20a\x20recovery\x20strategy\x20without\x20parsing\x20the\x20error\x20string.');export const OperationPreviewSchema=z['object']({'level':z['enum'](['none','standard','amount','publish','irreversible'])['describe']('Confirmation\x20level.\x20\x27irreversible\x27\x20=\x20cannot\x20be\x20undone\x20(arb\x20verdict,\x20payment).\x20\x27publish\x27\x20=\x20locks\x20immutable\x20fields.\x20\x27amount\x27\x20=\x20amount-sensitive.\x20\x27standard\x27\x20=\x20default-value\x20warnings.'),'operation':z['string']()['describe']('operation_type\x20that\x20triggered\x20the\x20gate.\x20Example:\x20\x27payment\x27'),'object':z['union']([z['string'](),z['record'](z['string'](),z['unknown']()),z['null']()])['optional']()['describe']('Object\x20name/id\x20involved\x20(string\x20for\x20existing,\x20object\x20for\x20new\x20creation).\x20Example:\x20\x27myshop_service\x27\x20or\x20{name:\x20\x27myshop_service\x27}'),'network':z['string']()['optional']()['describe']('Network\x20in\x20use.\x20Example:\x20\x27mainnet\x27'),'account':z['string']()['optional']()['describe']('Signing\x20account\x20(\x27\x27\x20=\x20default).\x20Example:\x20\x27\x27\x20or\x20\x270xabc...\x27'),'amount':z['object']({'value':z['string']()['describe']('Smallest-unit\x20value\x20as\x20string.\x20Example:\x20\x272500000000\x27'),'token':z['string']()['describe']('Coin\x20type\x20tag.\x20Example:\x20\x270x2::wow::WOW\x27'),'human_readable':z['string']()['describe']('Human-readable\x20amount.\x20Example:\x20\x272.5\x20WOW\x27'),'recipient':z['string']()['optional']()['describe']('Recipient\x20address\x20if\x20known.\x20Example:\x20\x270xdef...\x27')})['optional']()['describe']('Amount\x20info\x20for\x20amount-level\x20confirmations.'),'immutable_after':z['array'](z['string']())['optional']()['describe']('Fields\x20that\x20become\x20immutable\x20after\x20this\x20op\x20(for\x20publish).\x20Example:\x20[\x27machine\x27,\x27order_allocators\x27]'),'warnings':z['array'](z['string']())['optional']()['describe']('Default-value\x20warnings.\x20Example:\x20[\x27Using\x20default\x20account\x20(env.account=\x22\x22)\x27]'),'irreversible':z['boolean']()['optional']()['describe']('True\x20when\x20the\x20operation\x20cannot\x20be\x20reverted.\x20Example:\x20true')})['strict']()['describe']('Preview\x20of\x20an\x20operation\x20awaiting\x20user\x20confirmation\x20(Phase\x202\x20Topic\x204\x20ConfirmGate).');export const CallPendingConfirmationSchema=z['object']({'type':z['literal']('pending_confirmation')['describe']('Discriminator.\x20The\x20operation\x20was\x20NOT\x20executed;\x20it\x20is\x20blocked\x20pending\x20user\x20confirmation.\x20Re-call\x20with\x20env.confirmed=true\x20to\x20proceed,\x20or\x20modify/cancel.'),'preview':OperationPreviewSchema['describe']('Preview\x20of\x20the\x20operation\x20awaiting\x20confirmation.'),'rule_id':z['string']()['optional']()['describe']('Id\x20of\x20the\x20confirmation\x20rule\x20that\x20matched.\x20Example:\x20\x27publish_immutable\x27')})['describe']('Pending\x20confirmation.\x20The\x20ConfirmGate\x20blocked\x20the\x20operation.\x20Read\x20preview\x20first;\x20if\x20user\x20consents,\x20re-invoke\x20the\x20SAME\x20call\x20with\x20env.confirmed=true.');export const GuardSubmissionToFillSchema=z['object']({'guard':NameOrAddressSchema['describe']('Guard\x20object\x20name\x20or\x20ID\x20that\x20requires\x20submission\x20data.\x20Example:\x20\x27my-delivery-guard\x27'),'submission':z['array'](GuardTableItemSchema)['describe']('User-submitted\x20data\x20matching\x20the\x20Guard\x27s\x20required\x20fields.\x20Relation:\x20structure\x20must\x20match\x20the\x20Guard\x20table\x27s\x20column\x20definitions.\x20Example:\x20[{field:\x27delivery_proof\x27,\x20value:\x27Qm...\x27}]')})['strict']()['describe']('One\x20Guard\x27s\x20submission\x20data:\x20the\x20Guard\x20to\x20verify\x20plus\x20the\x20user-provided\x20data\x20that\x20satisfies\x20its\x20requirements.');export const SubmissionCallSchema=z['object']({'type':z['literal']('submission')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27submission\x27.\x20Example:\x20\x27submission\x27'),'guard':z['array'](z['object']({'object':NameOrAddressSchema['describe']('Guard\x20object\x20name\x20or\x20ID\x20to\x20verify\x20against.\x20Example:\x20\x27my-delivery-guard\x27\x20or\x20\x270x123...\x27'),'impack':z['boolean']()['describe']('Whether\x20this\x20Guard\x27s\x20verification\x20result\x20participates\x20in\x20the\x20final\x20logic.\x20Constraint:\x20if\x20false,\x20the\x20Guard\x20is\x20checked\x20but\x20does\x20not\x20block\x20the\x20operation.\x20Example:\x20true')})['strict']())['max'](MAX_GUARD_COUNT_PASSPORT)['describe']('Array\x20of\x20Guard\x20objects\x20to\x20verify.\x20Constraint:\x20at\x20most\x20'+MAX_GUARD_COUNT_PASSPORT+'\x20entries\x20(MAX_GUARD_COUNT_PASSPORT).\x20Relation:\x20each\x20entry\x20corresponds\x20to\x20a\x20Guard\x20bound\x20to\x20the\x20operation.'),'submission':z['array'](GuardSubmissionToFillSchema)['describe']('User-submitted\x20data\x20for\x20each\x20Guard.\x20Relation:\x20one\x20entry\x20per\x20Guard\x20in\x20the\x20guard\x20array;\x20fill\x20submission\x20fields\x20and\x20resubmit\x20via\x20call_with_submission.\x20PLACEMENT:\x20this\x20`submission`\x20field\x20is\x20at\x20the\x20SAME\x20level\x20as\x20`data`\x20and\x20`env`\x20in\x20the\x20operation\x20input\x20—\x20NOT\x20inside\x20`data.data`.\x20Example\x20structure:\x20{tool:\x27onchain_operations\x27,\x20data:{operation_type:\x27order\x27,\x20data:{object:\x27my_order\x27,\x20progress:{...}}},\x20submission:{type:\x27submission\x27,\x20guard:[...],\x20submission:[...]}}')})['strict']()['describe']('Guard\x20verification\x20required.\x20The\x20operation\x20was\x20blocked\x20because\x20one\x20or\x20more\x20Guards\x20require\x20user-submitted\x20data.\x20Fill\x20the\x20submission\x20array\x20and\x20resubmit.\x20Semantic\x20status\x20is\x20\x27pending_input\x27.');export const TypedPermissionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Use\x20this\x20when\x20the\x20object\x20already\x20exists\x20and\x20you\x20want\x20to\x20reference\x20it.'),TypeNamedObjectWithPermissionSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20COMPLETE\x20configuration\x20including:\x20optional\x20name,\x20tags,\x20description,\x20token\x20type\x20for\x20payments\x20(e.g.,\x20\x270x2::wow::WOW\x27),\x20AND\x20Permission-based\x20access\x20control.\x20Use\x20this\x20for\x20creating\x20sophisticated\x20objects\x20with\x20both\x20payment\x20token\x20specification\x20and\x20permission\x20management.')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20full\x20configuration\x20including\x20name,\x20tags,\x20description,\x20token\x20type\x20for\x20payments,\x20and\x20Permission-based\x20access\x20control.\x20The\x20object\x20format\x20is\x20used\x20when\x20you\x20need\x20both\x20token\x20specification\x20AND\x20permission\x20management.');export const WithPermissionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Use\x20when\x20the\x20Permission\x20object\x20already\x20exists.'),NamedObjectWithPermissionSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20Permission-based\x20access\x20control.\x20Includes\x20optional\x20name,\x20tags,\x20visibility\x20settings,\x20AND\x20a\x20Permission\x20object\x20(which\x20itself\x20can\x20be\x20referenced\x20by\x20string\x20or\x20created\x20as\x20a\x20new\x20object).\x20Use\x20this\x20to\x20create\x20objects\x20with\x20managed\x20access\x20permissions.')])['describe']('Two\x20ways\x20to\x20specify\x20a\x20Permission-managed\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20Permission\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20Permission\x20access\x20control,\x20where\x20the\x20Permission\x20can\x20also\x20be\x20either\x20referenced\x20(string)\x20or\x20newly\x20created\x20(object).\x20This\x20is\x20used\x20when\x20you\x20need\x20permission\x20management\x20but\x20don\x27t\x20need\x20to\x20specify\x20a\x20token\x20type.');export const TypedDescriptionObjectSchema=z['union']([NameOrAddressSchema['describe']('String\x20format:\x20Reference\x20an\x20EXISTING\x20object\x20by\x20its\x20name\x20(local\x20mark)\x20or\x20on-chain\x20object\x20ID.\x20Use\x20when\x20the\x20object\x20already\x20exists.'),TypeNamedObjectSchema['describe']('Object\x20format:\x20CREATE\x20a\x20NEW\x20object\x20with\x20token\x20type\x20specification\x20for\x20payments.\x20Includes\x20optional\x20name,\x20tags,\x20visibility\x20settings,\x20AND\x20a\x20specific\x20token\x20type\x20(e.g.,\x20\x270x2::wow::WOW\x27\x20or\x20\x270x2::usdt::USDT\x27).\x20Use\x20this\x20when\x20you\x20need\x20to\x20specify\x20what\x20token\x20the\x20object\x20will\x20use\x20for\x20payments\x20but\x20don\x27t\x20need\x20permission\x20management.')])['describe']('Two\x20ways\x20to\x20specify\x20an\x20object:\x20(1)\x20STRING\x20-\x20Reference\x20an\x20EXISTING\x20object\x20by\x20name\x20or\x20ID;\x20(2)\x20OBJECT\x20-\x20CREATE\x20a\x20NEW\x20object\x20with\x20token\x20type\x20specification\x20for\x20payments.\x20The\x20object\x20format\x20includes\x20name,\x20tags,\x20visibility\x20settings,\x20and\x20a\x20required\x20token\x20type.\x20This\x20is\x20used\x20when\x20you\x20need\x20to\x20specify\x20the\x20payment\x20token\x20but\x20don\x27t\x20need\x20permission\x20management.');export const CallTransactionResultSchema=WowTransactionBlockResponseSchema['extend']({'type':z['literal']('transaction')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27transaction\x27.\x20Example:\x20\x27transaction\x27')});export const CallDataResultSchema=z['object']({'type':z['literal']('data')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27data\x27.\x20Example:\x20\x27data\x27'),'data':z['array'](ResponseDataSchema)['describe']('Array\x20of\x20object\x20records\x20returned\x20by\x20a\x20query\x20operation.\x20Example:\x20[{id:\x270x...\x27,\x20change:\x27created\x27}]')});export const CallNullResultSchema=z['object']({'type':z['literal']('null')['describe']('Discriminator\x20for\x20this\x20result\x20variant.\x20Constraint:\x20always\x20\x27null\x27.\x20Example:\x20\x27null\x27')});export const CallResultSchema=z['discriminatedUnion']('type',[SubmissionCallSchema,CallTransactionResultSchema,CallResponseErrorSchema,CallDataResultSchema,CallNullResultSchema,CallPendingConfirmationSchema])['describe']('Discriminated\x20union\x20of\x206\x20result\x20types:\x20\x27transaction\x27\x20(raw\x20Wow\x20response),\x20\x27submission\x27\x20(Guard\x20verification\x20needed),\x20\x27error\x27\x20(failed\x20with\x20error_code),\x20\x27data\x27\x20(query\x20result\x20array),\x20\x27null\x27\x20(no-op\x20completed),\x20\x27pending_confirmation\x27\x20(ConfirmGate\x20blocked\x20—\x20re-call\x20with\x20env.confirmed=true).\x20AI\x20should\x20check\x20result.type\x20first\x20to\x20determine\x20how\x20to\x20process\x20the\x20response.');export const ObjectsSchema=z['preprocess'](a=>Array['isArray'](a)?{'op':'add','objects':a}:a,z['union']([z['object']({'op':z['union']([z['literal']('add'),z['literal']('set')]),'objects':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20object\x20IDs\x20or\x20names\x20to\x20add\x20or\x20set')})['strict'](),z['object']({'op':z['literal']('remove'),'objects':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20object\x20IDs\x20or\x20names\x20to\x20remove')})['strict'](),z['object']({'op':z['literal']('clear')})['strict']()]));export const VerifyMismatchSchema=z['object']({'dimension':z['enum'](['created','modified','released','state','event'])['describe']('Verify\x20dimension\x20that\x20mismatched.\x20Example:\x20\x27created\x27'),'expected':z['string']()['describe']('What\x20the\x20Expect\x20Loop\x20declared.\x20Example:\x20\x27Service\x20object\x20created\x27'),'actual':z['string']()['describe']('What\x20actually\x20happened.\x20Example:\x20\x27No\x20object\x20created\x27'),'severity':z['enum'](['pass','warn','fail'])['describe']('Severity:\x20\x27fail\x27\x20blocks\x20progress,\x20\x27warn\x27\x20is\x20advisory,\x20\x27pass\x27\x20never\x20appears\x20here.\x20Example:\x20\x27fail\x27'),'detail':z['string']()['describe']('Human-readable\x20explanation\x20of\x20the\x20mismatch.\x20Example:\x20\x27Expected\x20Service\x20creation\x20but\x20transaction\x20succeeded\x20without\x20object\x20change\x27')})['describe']('One\x20mismatch\x20between\x20expected\x20and\x20actual\x20result.\x20AI\x20should\x20read\x20severity\x20first\x20to\x20decide\x20whether\x20to\x20halt.');export const VerifyReportSchema=z['object']({'status':z['enum'](['pass','warn','fail'])['describe']('Overall\x20verify\x20status.\x20Constraint:\x20\x27fail\x27\x20if\x20any\x20mismatch\x20has\x20severity\x20\x27fail\x27;\x20\x27warn\x27\x20if\x20only\x20warns;\x20\x27pass\x27\x20if\x20no\x20mismatches.\x20Example:\x20\x27fail\x27'),'mismatches':z['array'](VerifyMismatchSchema)['describe']('List\x20of\x20mismatches\x20found.\x20Empty\x20array\x20when\x20status\x20is\x20\x27pass\x27.\x20Example:\x20[{dimension:\x27created\x27,\x20expected:\x27...\x27,\x20actual:\x27...\x27,\x20severity:\x27fail\x27,\x20detail:\x27...\x27}]'),'summary':z['string']()['describe']('Human-readable\x20summary\x20of\x20the\x20verify\x20result.\x20Example:\x20\x272\x20mismatches\x20found:\x20created\x20dimension\x20failed,\x20event\x20dimension\x20warned\x27'),'timestamp':z['string']()['describe']('ISO\x208601\x20timestamp\x20when\x20verify\x20ran.\x20Example:\x20\x272026-07-14T10:30:00.000Z\x27')})['describe']('Verify\x20Loop\x20report.\x20Compares\x20expected\x20vs\x20actual\x20receipt\x20fields\x20across\x205\x20dimensions.\x20On\x20outcome=\x27failed\x27\x20outputs\x20this\x20is\x20the\x20failure\x20diagnosis.');export const RecoveryActionSchema=z['object']({'strategy':z['enum'](['retry','claim_faucet','fill_submission','recreate','switch_account','query_and_retry','adjust_params','escalate_human','stop','wait_and_retry'])['describe']('Recovery\x20strategy\x20chosen\x20by\x20the\x20Recover\x20Loop.\x20Constraint:\x2010\x20strategies\x20matching\x20error_code\x20table.\x20Example:\x20\x27claim_faucet\x27'),'should_retry':z['boolean']()['describe']('Whether\x20AI\x20should\x20retry\x20the\x20original\x20operation\x20after\x20applying\x20the\x20strategy.\x20Constraint:\x20false\x20for\x20\x27stop\x27\x20and\x20\x27escalate_human\x27.\x20Example:\x20true'),'adjusted_params':z['record'](z['string'](),z['unknown']())['optional']()['describe']('Suggested\x20parameter\x20adjustments\x20for\x20\x27adjust_params\x27\x20strategy.\x20Example:\x20{amount:\x20\x27100000000\x27}'),'user_prompt':z['string']()['optional']()['describe']('Prompt\x20to\x20show\x20the\x20user\x20when\x20recovery\x20is\x20semi-automatic\x20or\x20manual.\x20Example:\x20\x27Please\x20switch\x20to\x20an\x20account\x20with\x20provider\x20permission\x27'),'max_attempts':z['number']()['int']()['describe']('Maximum\x20attempts\x20for\x20this\x20error_code\x20type.\x20Example:\x203'),'current_attempt':z['number']()['int']()['describe']('Current\x20attempt\x20count\x20(1-indexed).\x20Example:\x201'),'detail':z['string']()['describe']('Human-readable\x20explanation\x20of\x20the\x20recovery\x20decision.\x20Example:\x20\x27Insufficient\x20balance\x20detected;\x20claim\x20faucet\x20tokens\x20then\x20retry\x27')})['describe']('Recover\x20Loop\x20action.\x20ALWAYS\x20present\x20on\x20outcome=\x27failed\x27\x20outputs.\x20AI\x20should\x20follow\x20the\x20strategy\x20and\x20respect\x20max_attempts.');export const SchemaWarningSchema=z['object']({'compatible':z['boolean']()['describe']('Whether\x20the\x20client\x20schema\x20version\x20is\x20compatible\x20with\x20the\x20server.'),'warnings':z['array'](z['string']())['describe']('Schema\x20compatibility\x20warnings\x20or\x20errors.'),'client_version':z['string']()['optional']()['describe']('The\x20client\x20schema\x20version\x20that\x20was\x20checked.'),'server_versions':z['object']({'sdk':z['string']()['describe']('Server-side\x20SDK\x20schema\x20version.'),'mcp':z['string']()['describe']('Server-side\x20MCP\x20tool\x20schema\x20version.')})['describe']('Server-side\x20schema\x20versions.')})['strict']()['describe']('Schema\x20compatibility\x20warning\x20attached\x20to\x20tool\x20output\x20when\x20client_schema_version\x20is\x20provided\x20and\x20a\x20mismatch\x20is\x20detected.');export const CallOutputExecutedSchema=z['object']({'outcome':z['literal']('executed')['describe']('Outcome\x20discriminator:\x20the\x20operation\x20completed.\x20For\x20transactions,\x20effects.status\x20was\x20\x27success\x27\x20—\x20check\x20semantic.created/modified/released\x20for\x20what\x20changed.\x20Never\x20carries\x20recovery\x20or\x20failure\x20directives.'),'result':z['discriminatedUnion']('type',[CallTransactionResultSchema,CallDataResultSchema,CallNullResultSchema])['describe']('Discriminated\x20result\x20payload.\x20\x27transaction\x27\x20(raw\x20Wow\x20response),\x20\x27data\x27\x20(query\x20result\x20array),\x20\x27null\x27\x20(no-op\x20completed).'),'message':z['string']()['optional']()['describe']('Human-readable\x20summary\x20or\x20hint.\x20Constraint:\x20always\x20present\x20for\x20transaction\x20results;\x20may\x20be\x20omitted\x20for\x20data/null.\x20Example:\x20\x27Transaction\x20completed\x20successfully\x27'),'semantic':SemanticSummarySchema['optional']()['describe']('Business\x20semantic\x20summary.\x20AI\x20should\x20read\x20semantic\x20first;\x20fall\x20back\x20to\x20parsing\x20result\x20only\x20when\x20semantic\x20is\x20absent.\x20Relation:\x20populated\x20by\x20MCP\x20server\x20from\x20operation\x20context;\x20undefined\x20when\x20intent\x20cannot\x20be\x20confidently\x20inferred.\x20Example:\x20{intent:\x27publish_service\x27,\x20status:\x27success\x27,\x20summary:\x27...\x27}'),'schema_warning':SchemaWarningSchema['optional']()['describe']('Schema\x20compatibility\x20warning.\x20Present\x20only\x20when\x20client_schema_version\x20is\x20provided\x20in\x20env\x20and\x20a\x20mismatch\x20is\x20detected.')})['strict']()['describe']('Executed\x20outcome:\x20the\x20operation\x20completed\x20successfully\x20(transaction\x20finalized,\x20or\x20completed\x20read/no-op).\x20Read\x20semantic.status\x20and\x20semantic.created/modified/released\x20for\x20the\x20business\x20effect.\x20NEVER\x20contains\x20recovery\x20—\x20a\x20mismatch\x20between\x20what\x20the\x20transaction\x20did\x20and\x20what\x20the\x20harness\x20expected\x20is\x20coverage-gap\x20telemetry,\x20not\x20a\x20user-facing\x20failure.');export const CallOutputPendingInputSchema=z['object']({'outcome':z['literal']('pending_input')['describe']('Outcome\x20discriminator:\x20the\x20operation\x20was\x20NOT\x20executed\x20—\x20required\x20input\x20is\x20missing.\x20Fill\x20the\x20requested\x20submission/confirmation\x20and\x20re-invoke.\x20Never\x20carries\x20recovery\x20or\x20failure\x20directives.'),'result':z['discriminatedUnion']('type',[SubmissionCallSchema,CallPendingConfirmationSchema])['describe']('Discriminated\x20result\x20payload.\x20\x27submission\x27\x20(Guard\x20verification\x20data\x20needed),\x20\x27pending_confirmation\x27\x20(ConfirmGate\x20blocked\x20—\x20re-call\x20with\x20env.confirmed=true).'),'message':z['string']()['optional']()['describe']('Human-readable\x20summary\x20or\x20hint.\x20Example:\x20\x27Submission\x20required\x20for\x20Guard\x20verification\x27'),'semantic':SemanticSummarySchema['optional']()['describe']('Business\x20semantic\x20summary\x20with\x20status\x20\x27pending_input\x27.\x20Example:\x20{intent:\x27guard_submission_required\x27,\x20status:\x27pending_input\x27,\x20summary:\x27...\x27}'),'schema_warning':SchemaWarningSchema['optional']()['describe']('Schema\x20compatibility\x20warning.\x20Present\x20only\x20when\x20client_schema_version\x20is\x20provided\x20in\x20env\x20and\x20a\x20mismatch\x20is\x20detected.')})['strict']()['describe']('Pending-input\x20outcome:\x20the\x20operation\x20did\x20NOT\x20execute.\x20Follow\x20semantic.next_actions\x20(or\x20result.type===\x27pending_confirmation\x27\x20preview\x20instructions)\x20to\x20supply\x20the\x20missing\x20input,\x20then\x20re-invoke\x20the\x20same\x20call.');export const CallOutputFailedSchema=z['object']({'outcome':z['literal']('failed')['describe']('Outcome\x20discriminator:\x20execution\x20failed\x20on-chain\x20or\x20before\x20submission.\x20The\x20operation\x20was\x20NOT\x20completed.\x20`recovery`\x20is\x20always\x20present\x20and\x20MUST\x20be\x20consulted\x20before\x20retrying.'),'result':CallResponseErrorSchema['describe']('Error\x20payload\x20with\x20structured\x20classification\x20(error_code/retryable/recovery_hint).'),'message':z['string']()['optional']()['describe']('Human-readable\x20error\x20summary.\x20Example:\x20\x27Transaction\x20failed:\x20Insufficient\x20balance\x20for\x20gas\x27'),'semantic':SemanticSummarySchema['optional']()['describe']('Business\x20semantic\x20summary\x20with\x20status\x20\x27failed\x27.\x20Example:\x20{intent:\x27create_service\x27,\x20status:\x27failed\x27,\x20summary:\x27Failed\x20to\x20create\x20service\x27}'),'recovery':RecoveryActionSchema['describe']('Recover\x20Loop\x20action\x20—\x20ALWAYS\x20present\x20when\x20outcome\x20is\x20\x27failed\x27.\x20Follow\x20strategy;\x20respect\x20max_attempts;\x20do\x20NOT\x20retry\x20blindly\x20when\x20should_retry\x20is\x20false.\x20Relation:\x20selected\x20from\x20RECOVERY_RULES\x20by\x20error_code.'),'diagnosis':VerifyReportSchema['optional']()['describe']('Failure-path\x20verify\x20report:\x20compares\x20the\x20dispatch-declared\x20expectation\x20against\x20what\x20actually\x20happened.\x20Present\x20when\x20an\x20expectation\x20was\x20declared\x20at\x20dispatch.\x20Read\x20diagnosis.mismatches\x20to\x20understand\x20WHY\x20the\x20operation\x20fell\x20short\x20of\x20its\x20intent\x20—\x20complementary\x20to\x20recovery,\x20which\x20says\x20WHAT\x20to\x20do\x20next.'),'schema_warning':SchemaWarningSchema['optional']()['describe']('Schema\x20compatibility\x20warning.\x20Present\x20only\x20when\x20client_schema_version\x20is\x20provided\x20in\x20env\x20and\x20a\x20mismatch\x20is\x20detected.')})['strict']()['describe']('Failed\x20outcome:\x20the\x20operation\x20did\x20NOT\x20complete.\x20recovery\x20is\x20guaranteed\x20—\x20check\x20recovery.strategy\x20first,\x20then\x20result.error_code/retryable\x20for\x20retry\x20guidance;\x20diagnosis\x20(when\x20present)\x20explains\x20the\x20gap\x20between\x20expectation\x20and\x20outcome.');export const CallOutputSchema=z['discriminatedUnion']('outcome',[CallOutputExecutedSchema,CallOutputPendingInputSchema,CallOutputFailedSchema])['describe']('Unified\x20MCP\x20tool\x20output\x20for\x20onchain/bridge\x20operations,\x20discriminated\x20by\x20`outcome`\x20(exactly\x20one\x20of\x20\x27executed\x27\x20|\x20\x27pending_input\x27\x20|\x20\x27failed\x27).\x20Check\x20outcome\x20FIRST:\x20\x27executed\x27\x20—\x20operation\x20completed,\x20read\x20semantic;\x20\x27pending_input\x27\x20—\x20not\x20executed,\x20supply\x20the\x20missing\x20submission/confirmation\x20and\x20re-invoke;\x20\x27failed\x27\x20—\x20not\x20completed,\x20follow\x20the\x20guaranteed\x20`recovery`\x20action\x20(optional\x20`diagnosis`\x20explains\x20the\x20expectation\x20gap).\x20Type-level\x20invariant:\x20only\x20\x27failed\x27\x20ever\x20carries\x20recovery,\x20diagnosis,\x20or\x20failure\x20directives.');
|
|
@@ -1101,6 +1101,7 @@ export declare const BridgeCallOutputSchema: z.ZodObject<{
|
|
|
1101
1101
|
config_error: "config_error";
|
|
1102
1102
|
wip_verification_failed: "wip_verification_failed";
|
|
1103
1103
|
wip_storage_unavailable: "wip_storage_unavailable";
|
|
1104
|
+
submission_unknown: "submission_unknown";
|
|
1104
1105
|
}>>;
|
|
1105
1106
|
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
1106
1107
|
recovery_hint: z.ZodOptional<z.ZodString>;
|
|
@@ -1,2 +1,2 @@
|
|
|
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", "wip_storage_unavailable", "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", "wip_storage_unavailable", "submission_unknown", "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','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','wip_storage_unavailable','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','wip_storage_unavailable','submission_unknown','unknown'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from'zod';import{WithPermissionObjectSchema,NamedObjectSchema,ObjectsSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{MachineNodeSchema,MachineForwardSchema}from'../query/index.js';import{ManyAccountOrMark_AddressSchema,NameOrAddressSchema,NameSchema,NotEmptyNameSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS,DescriptionSchema}from'../common/index.js';function gateNumber(a){if(a===null||a===undefined||a==='')return 0x0;const b=Number(a);return Number['isFinite'](b)?b:null;}export function machinePublishGateViolation(a){if(!Array['isArray'](a)||a['length']===0x0)return'The\x20Machine\x20has\x20no\x20nodes,\x20so\x20it\x20cannot\x20be\x20published\x20(E_EMPTY_MACHINE).\x20'+'Publish\x20validates\x20the\x20whole\x20graph:\x20add\x20at\x20least\x20one\x20node,\x20including\x20the\x20first\x20node\x20carrying\x20the\x20'+'entry\x20pair\x20(prev_node:\x20\x22\x22)\x20that\x20Progress\x20starts\x20from\x20—\x20send\x20the\x20nodes\x20in\x20the\x20SAME\x20call\x20as\x20publish:true\x20'+'(bReplace:true,\x20or\x20op:\x22set\x22),\x20because\x20the\x20graph\x20is\x20frozen\x20the\x20moment\x20publish\x20succeeds.';const b=a,c=new Set(b['map'](e=>e?.['name'])['filter'](e=>typeof e==='string'));let d=![];for(const e of b){const f=Array['isArray'](e?.['pairs'])?e['pairs']:[],g=typeof e?.['name']==='string'?e['name']:'<unnamed\x20node>';for(const h of f){const i=typeof h?.['prev_node']==='string'?h['prev_node']:null,j=Array['isArray'](h?.['forwards'])?h['forwards']:[];if(i===''){if(j['length']===0x0)return'The\x20entry\x20pair\x20of\x20node\x20\x22'+g+'\x22\x20(prev_node:\x20\x22\x22)\x20carries\x20no\x20forward\x20(E_EMPTY_ENTRY_PAIR).\x20'+'Progress\x20starts\x20at\x20the\x20empty\x20initial\x20state\x20\x22\x22\x20and\x20can\x20only\x20leave\x20it\x20through\x20an\x20entry\x20forward,\x20so\x20'+'every\x20order\x20on\x20this\x20Machine\x20would\x20be\x20stuck\x20forever.\x20Add\x20at\x20least\x20one\x20forward\x20to\x20that\x20pair.\x20Do\x20NOT\x20'+'delete\x20the\x20entry\x20pair\x20to\x20silence\x20this\x20—\x20a\x20Machine\x20with\x20no\x20entry\x20edge\x20fails\x20the\x20sibling\x20check\x20instead\x20'+'(E_NO_ENTRY_EDGE).';d=!![];}else{if(i!==null&&!c['has'](i))return'The\x20pair\x20of\x20node\x20\x22'+g+'\x22\x20declares\x20prev_node\x20\x22'+i+'\x22,\x20which\x20is\x20not\x20a\x20node\x20of\x20this\x20Machine\x20'+'(E_EDGE_SOURCE_NOT_FOUND)\x20—\x20that\x20edge\x20is\x20unreachable\x20and\x20its\x20source\x20node\x20can\x20never\x20be\x20entered.\x20'+'Fix\x20the\x20name,\x20or\x20add\x20the\x20missing\x20source\x20node.\x20Mind\x20the\x20direction\x20convention:\x20the\x20pair\x20belongs\x20to\x20'+'the\x20node\x20being\x20advanced\x20INTO,\x20with\x20prev_node\x20naming\x20the\x20node\x20it\x20comes\x20from\x20(the\x20entry\x20edge\x20is\x20the\x20'+'one\x20with\x20the\x20EMPTY\x20prev_node).\x20Export\x20the\x20current\x20graph\x20with\x20machineNode2file\x20before\x20editing.';}let k=0x0;for(const m of j){const n=m?.['namedOperator']!==undefined&&m?.['namedOperator']!==null,o=m?.['permissionIndex']!==undefined&&m?.['permissionIndex']!==null;if(!n&&!o)return'Forward\x20\x22'+(m?.['name']??'<unnamed>')+'\x22\x20of\x20node\x20\x22'+g+'\x22\x20names\x20no\x20operator\x20'+'(E_FORWARD_NO_IDENTITY),\x20so\x20nobody\x20can\x20be\x20authorized\x20to\x20execute\x20it\x20and\x20the\x20Machine\x20cannot\x20be\x20'+'published.\x20Set\x20namedOperator\x20(use\x20\x22\x22\x20for\x20the\x20order\x20payer,\x20or\x20a\x20Progress\x20operator\x20namespace)\x20or\x20'+'permissionIndex\x20(a\x20USER_DEFINED\x20index\x20>=\x201000).\x20A\x20guard\x20does\x20NOT\x20satisfy\x20this:\x20it\x20is\x20a\x20'+'post-verification\x20check,\x20not\x20an\x20identity.';const p=gateNumber(m?.['weight']);if(p!==null)k+=p;}const l=gateNumber(h?.['threshold']);if(l!==null&&k<l){const q=i===''?'entry\x20->\x20'+g:i+'\x20->\x20'+g;return'Pair\x20('+q+')\x20can\x20never\x20migrate:\x20its\x20threshold\x20('+l+')\x20is\x20greater\x20than\x20the\x20sum\x20of\x20its\x20'+('forward\x20weights\x20('+k+')\x20(E_UNREACHABLE_THRESHOLD).\x20Each\x20forward\x20contributes\x20its\x20weight\x20AT\x20')+'MOST\x20ONCE\x20—\x20it\x20is\x20locked\x20by\x20the\x20first\x20operator\x20who\x20accomplishes\x20it,\x20and\x20a\x20second\x20operator\x20re-running\x20'+'it\x20aborts\x20E_NOT_THE_HOLDER\x20—\x20so\x20the\x20reachable\x20maximum\x20is\x20the\x20sum\x20of\x20the\x20DISTINCT\x20forward\x20weights.\x20'+'Lower\x20the\x20threshold,\x20or\x20add\x20one\x20distinct\x20forward\x20per\x20contributing\x20operator\x20(threshold\x202\x20->\x20begin_a\x20+\x20'+'begin_b,\x20each\x20weight\x201).\x20Never\x20try\x20to\x20reach\x20a\x20high\x20threshold\x20by\x20re-running\x20one\x20forward\x20repeatedly.';}}}if(!d)return'The\x20Machine\x20has\x20no\x20entry\x20edge\x20(E_NO_ENTRY_EDGE)\x20—\x20no\x20node\x20declares\x20a\x20pair\x20with\x20prev_node:\x20\x22\x22,\x20so\x20'+'Progress\x20starts\x20at\x20the\x20empty\x20initial\x20state\x20and\x20has\x20no\x20edge\x20to\x20advance\x20on.\x20Add\x20the\x20entry\x20pair\x20to\x20your\x20'+'first\x20node:\x20pairs:[{prev_node:\x22\x22,\x20forwards:[{name:\x22start\x22,\x20weight:1,\x20namedOperator:\x22\x22}]}].\x20The\x20fix\x20must\x20'+'land\x20BEFORE\x20publish\x20—\x20machineNode2file\x20exports\x20the\x20current\x20graph\x20so\x20you\x20can\x20diff\x20it\x20against\x20the\x20fixed\x20one.';return null;}function validateEntryForward(a){for(const b of a){if(!b['pairs'])continue;for(const c of b['pairs']){if(c['prev_node']==='')return!![];}}return![];}const ENTRY_FORWARD_ERROR_MESSAGE='Machine\x20has\x20no\x20entry\x20forward.\x20At\x20least\x20one\x20node\x20must\x20have\x20a\x20pair\x20with\x20prev_node=\x22\x22\x20(empty\x20string),\x20'+'which\x20defines\x20how\x20Progress\x20advances\x20from\x20the\x20initial\x20state\x20(current=\x22\x22)\x20to\x20the\x20first\x20node.\x20'+'Without\x20an\x20entry\x20forward,\x20the\x20workflow\x20will\x20be\x20permanently\x20stuck.\x20'+'Example:\x20{name:\x20\x27Subscribed\x27,\x20pairs:\x20[{prev_node:\x20\x27\x27,\x20forwards:\x20[{name:\x20\x27Subscribe\x27,\x20weight:\x201}]}]}';export const ProgressNamedOperatorSchema=z['object']({'op':z['union']([z['literal']('add'),z['literal']('set'),z['literal']('remove')]),'name':NotEmptyNameSchema,'operators':ManyAccountOrMark_AddressSchema})['strict']();export const ProgressNewSchema=z['object']({'task':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Task\x20bound\x20to\x20the\x20Progress\x20object.\x20It\x20is\x20an\x20object\x20ID\x20or\x20name'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20Progress\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'progress_namedOperator':ProgressNamedOperatorSchema['optional']()['describe']('Add,\x20set,\x20and\x20remove\x20operators\x20for\x20the\x20permission\x20namespace\x20of\x20the\x20Progress\x20object.'),'namedNew':NamedObjectSchema['optional']()})['strict']();export const NodeAddForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward':z['array'](MachineForwardSchema)['describe']('List\x20of\x20operations\x20between\x20the\x20previous\x20and\x20next\x20nodes.'),'threshold':z['union']([z['number']()['int']()['min'](0x0),z['null']()])['optional']()['describe']('Threshold\x20of\x20operations\x20that\x20need\x20to\x20be\x20completed\x20to\x20migrate\x20from\x20the\x20previous\x20node\x20to\x20the\x20next\x20node.')})['strict']();export const NodeRemoveForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward_name':z['array'](NameSchema)['describe']('List\x20of\x20operation\x20names\x20to\x20delete.')})['strict']();export const NodeRemovePriorNodeDataSchema=z['object']({'prior_node_name':z['array'](NameSchema)['describe']('List\x20of\x20previous\x20node\x20names\x20to\x20delete.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.')})['strict']();export const NodeSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Add\x20nodes.'),z['object']({'op':z['literal']('set'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Set\x20nodes.'),z['object']({'op':z['literal']('remove'),'nodes':z['array'](NameSchema)['describe']('List\x20of\x20node\x20names\x20to\x20delete.')})['strict']()['describe']('Delete\x20nodes.'),z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20all\x20nodes.'),z['object']({'op':z['literal']('exchange'),'node_one':NameSchema['describe']('Name\x20of\x20the\x20first\x20node.'),'node_other':NameSchema['describe']('Name\x20of\x20the\x20second\x20node.')})['strict']()['describe']('Exchange\x20the\x20positions\x20of\x20two\x20nodes.'),z['object']({'op':z['literal']('rename'),'node_name_old':NameSchema['describe']('Name\x20of\x20thenode.'),'node_name_new':NameSchema['describe']('New\x20name\x20of\x20the\x20node.')})['strict']()['describe']('Rename\x20node.'),z['object']({'op':z['literal']('remove\x20prior\x20node'),'pairs':z['array'](NodeRemovePriorNodeDataSchema)['describe']('List\x20of\x20previous-next\x20node\x20pairs\x20to\x20delete.')})['strict']()['describe']('Delete\x20previous-next\x20node\x20pairs.'),z['object']({'op':z['literal']('add\x20forward'),'data':z['array'](NodeAddForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20add.')})['strict']()['describe']('Add\x20operations.'),z['object']({'op':z['literal']('remove\x20forward'),'data':z['array'](NodeRemoveForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20delete.')})['strict']()['describe']('Delete\x20operations.')])['superRefine']((a,b)=>{(a['op']==='add'||a['op']==='set')&&a['bReplace']===!![]&&(!validateEntryForward(a['nodes'])&&b['addIssue']({'code':z['ZodIssueCode']['custom'],'message':ENTRY_FORWARD_ERROR_MESSAGE}));});export const NodeJsonOrMarkdownFileSchema=z['object']({'json_or_markdown_file':z['string']()['describe']('Path\x20to\x20a\x20JSON\x20or\x20Markdown\x20file\x20containing\x20node\x20array\x20for\x20COMPLETE\x20REPLACEMENT\x20of\x20all\x20nodes.\x0a\x0a**File\x20Format\x20Requirements:**\x0a-\x20Must\x20contain\x20a\x20JSON\x20ARRAY\x20of\x20node\x20objects:\x20[{\x22name\x22:\x20\x22...\x22,\x20\x22pairs\x22:\x20[...]},\x20{...}]\x0a-\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field\x20(use\x20NodeSchema\x20for\x20operations)\x0a-\x20Supports\x20JSON\x20or\x20Markdown\x20(with\x20```json\x20code\x20blocks)\x0a\x0a**Node\x20Structure:**\x0aEach\x20node\x20is\x20a\x20directed\x20graph\x20element\x20representing\x20a\x20workflow\x20STATE\x20that\x20an\x20order\x0acan\x20rest\x20in.\x20Its\x20Pairs\x20are\x20the\x20INCOMING\x20edges\x20—\x20this\x20is\x20the\x20one\x20convention\x20the\x0achain\x20enforces,\x20and\x20getting\x20it\x20backwards\x20silently\x20builds\x20a\x20wrong\x20graph:\x0a-\x20name:\x20Node\x20identifier\x20—\x20the\x20DESTINATION\x20of\x20every\x20pair\x20it\x20owns\x0a-\x20role:\x20(optional)\x20business\x20role\x20tag\x20for\x20display\x20layers\x20—\x20one\x20of\x20draft/active/delivered/final/cancelled.\x20SESSION\x20METADATA\x20ONLY\x20(not\x20stored\x20on-chain;\x20echoed\x20back\x20as\x20a\x20NODE\x20ROLES\x20warning)\x0a-\x20pairs:\x20Array\x20of\x20{prev_node,\x20forwards,\x20threshold}\x20—\x20edges\x20ENTERING\x20this\x20node.\x20The\x20key\x20is\x20`prev_node`;\x20`prior_node`\x20is\x20not\x20recognized\x20and\x20is\x20silently\x20dropped.\x0a-\x20forwards:\x20Operations\x20that\x20advance\x20INTO\x20this\x20node\x20FROM\x20its\x20prev_node\x20(NOT\x20operations\x20available\x20from\x20this\x20node)\x0a-\x20threshold:\x20Weight\x20required\x20to\x20migrate\x20into\x20this\x20node\x20along\x20that\x20pair\x0a\x0aDiagram\x20`A\x20--[Go]-->\x20B`\x20therefore\x20lives\x20in\x20node\x20**B**:\x20{name:\x22B\x22,\x20pairs:[{prev_node:\x22A\x22,\x20forwards:[{name:\x22Go\x22,\x20weight:1}]}]}.\x0a\x0a**Forward\x20names\x20must\x20determine\x20the\x20destination.**\x20`next_node`\x20is\x20a\x20CALLER\x20argument\x0a(progress.move:540)\x20and\x20the\x20chain\x20resolves\x20(current,\x20next_node,\x20forward)\x20inside\x20the\x0adestination\x20node\x20(machine.move:275),\x20so\x20one\x20forward\x20name\x20shared\x20by\x20two\x20destinations\x0afrom\x20the\x20same\x20prev_node\x20is\x20legal\x20and\x20lets\x20the\x20caller\x20pick\x20the\x20outcome\x20—\x20including\x0awhether\x20a\x20refund\x20Allocator\x20ever\x20fires.\x20Give\x20each\x20destination\x20its\x20own\x20forward\x20name.\x0a\x0a**Behavior:**\x0a-\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes\x20(equivalent\x20to\x20\x22set\x22\x20with\x20bReplace=true)\x0a-\x20Auto-detects\x20format\x20based\x20on\x20file\x20content\x0a-\x20If\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information')})['strict']();export const NodeFieldSchema=z['union']([NodeSchema,NodeJsonOrMarkdownFileSchema]);export const CallMachine_DataSchema=z['object']({'object':WithPermissionObjectSchema,'progress_new':ProgressNewSchema['optional']()['describe']('Generate\x20new\x20Progress\x20object.'),'description':DescriptionSchema['optional']()['describe']('Description\x20of\x20the\x20object.'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'node':NodeFieldSchema['optional']()['describe']('CRITICAL:\x20Choose\x20ONE\x20of\x20two\x20mutually\x20exclusive\x20modes:\x0a\x0a**Mode\x201:\x20NodeSchema\x20(incremental\x20operations)**\x0aUse\x20for\x20partial\x20modifications:\x20add,\x20set,\x20remove,\x20clear,\x20exchange,\x20rename,\x20remove\x20prior\x20node,\x20add\x20forward,\x20remove\x20forward.\x0aFormat:\x20{\x20\x22op\x22:\x20\x22add\x22,\x20\x22nodes\x22:\x20[...],\x20\x22bReplace\x22:\x20false\x20}\x0aThis\x20mode\x20modifies\x20existing\x20nodes\x20incrementally.\x0a\x0a**Mode\x202:\x20NodeJsonOrMarkdownFileSchema\x20(complete\x20replacement)**\x0aUse\x20for\x20complete\x20node\x20redefinition\x20from\x20file.\x0aFormat:\x20{\x20\x22json_or_markdown_file\x22:\x20\x22/path/to/nodes.json\x22\x20}\x0aIMPORTANT:\x20This\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes.\x20File\x20must\x20contain\x20node\x20array\x20[{...},\x20{...}],\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field.\x0aSupported\x20formats:\x20JSON\x20array\x20or\x20Markdown\x20with\x20code\x20blocks.\x0aIf\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information.'),'pause':z['boolean']()['optional']()['describe']('Whether\x20to\x20pause\x20generating\x20new\x20Progress\x20objects.'),'publish':z['boolean']()['optional']()['describe']('Whether\x20to\x20publish\x20the\x20object.\x20After\x20the\x20object\x20is\x20published,\x20new\x20Progress\x20objects\x20can\x20be\x20generated;\x20and\x20node\x20settings\x20will\x20no\x20longer\x20be\x20changeable.\x20⚠️\x20PUBLISH\x20IS\x20A\x20ONE-WAY\x20DOOR\x20AND\x20THE\x20CHAIN\x20VALIDATES\x20THE\x20WHOLE\x20GRAPH\x20AT\x20THAT\x20MOMENT:\x20machine::assert_publishable\x20rejects\x20a\x20Machine\x20that\x20is\x20empty,\x20has\x20no\x20entry\x20edge\x20(no\x20pair\x20with\x20prev_node:\x22\x22),\x20has\x20an\x20entry\x20pair\x20with\x20no\x20forward,\x20references\x20a\x20prev_node\x20that\x20is\x20not\x20a\x20node\x20of\x20this\x20Machine,\x20carries\x20a\x20forward\x20with\x20neither\x20namedOperator\x20nor\x20permissionIndex\x20(a\x20guard\x20is\x20NOT\x20an\x20identity),\x20or\x20has\x20a\x20pair\x20whose\x20threshold\x20exceeds\x20the\x20sum\x20of\x20its\x20forward\x20weights\x20(each\x20forward\x20counts\x20at\x20most\x20once).\x20These\x20aborts\x20(machine:17-22)\x20fire\x20BEFORE\x20the\x20publish\x20lands,\x20so\x20the\x20graph\x20is\x20still\x20editable\x20—\x20but\x20after\x20it\x20succeeds,\x20nodes/forwards,\x20Guard\x20bindings\x20and\x20Service.machine\x20are\x20frozen\x20forever,\x20and\x20a\x20broken\x20graph\x20would\x20only\x20surface\x20at\x20the\x20first\x20transition\x20with\x20no\x20repair\x20path.\x20Send\x20the\x20nodes\x20in\x20the\x20SAME\x20call\x20as\x20publish:true\x20(bReplace:true\x20or\x20op:\x22set\x22)\x20so\x20the\x20complete\x20graph\x20is\x20validated\x20together.\x20⚠️\x20Before\x20publishing,\x20enumerate\x20the\x20graph\x20STOP\x20NODES\x20(nodes\x20with\x20no\x20outgoing\x20Pair)\x20plus\x20every\x20waiting\x20state\x20(review\x20window,\x20handover,\x20open\x20dispute)\x20and\x20verify\x20each\x20has\x20a\x20defined\x20fund\x20exit\x20in\x20the\x20Service\x20order_allocators\x20—\x20withdrawal\x20(release)\x20AND\x20refund.\x20Machine\x20+\x20Allocator\x20are\x20immutable\x20after\x20publish\x20(IMMUT-001);\x20an\x20uncovered\x20stop\x20node\x20strands\x20funds\x20permanently\x20(rule\x20R-M5-03,\x20checklist\x20pattern.fund_flow_stop_node_coverage).'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Machine\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']()['superRefine']((a,b)=>{if(a['publish']!==!![])return;const c=a['node'];if(!c||'json_or_markdown_file'in c)return;if(c['op']!=='add'&&c['op']!=='set')return;const d=typeof a['object']==='object'&&a['object']!==null;if(!d&&c['bReplace']!==!![])return;if(!Array['isArray'](c['nodes'])||c['nodes']['length']===0x0||typeof c['nodes'][0x0]!=='object')return;const e=machinePublishGateViolation(c['nodes']);e&&b['addIssue']({'code':z['ZodIssueCode']['custom'],'message':e});})['describe']('On-chain\x20Machine\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Machine.\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 CallMachine_InputSchema=z['object']({'data':CallMachine_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();export const MachineNode2File_InputSchema=z['object']({'machine':NameOrAddressSchema['describe']('Machine\x20object\x20ID\x20or\x20name\x20to\x20export'),'file_path':z['string']()['optional']()['describe']('Output\x20file\x20path\x20(absolute\x20or\x20relative).\x20Defaults\x20to\x20the\x20workspace\x20directory\x20when\x20omitted.'),'format':z['enum'](['json','markdown'])['optional']()['default']('json')['describe']('Output\x20format:\x20\x27json\x27\x20(default)\x20or\x20\x27markdown\x27'),'env':CallEnvSchema['optional']()})['strict']()['describe']('Query\x20a\x20Machine\x20object\x20from\x20the\x20blockchain\x20and\x20export\x20its\x20node\x20definition\x20to\x20a\x20JSON\x20or\x20Markdown\x20file.\x20The\x20exported\x20file\x20can\x20be\x20edited\x20and\x20used\x20to\x20create\x20new\x20Machine\x20objects.');export const MachineNode2File_OutputSchema=z['discriminatedUnion']('status',[z['object']({'status':z['literal']('success'),'data':z['object']({'file_path':z['string']()['describe']('Absolute\x20path\x20of\x20the\x20exported\x20file'),'format':z['enum'](['json','markdown'])['describe']('Export\x20format'),'machine_object':NameOrAddressSchema['describe']('Machine\x20object\x20ID'),'node_count':z['number']()['describe']('Number\x20of\x20nodes\x20exported')})['strict']()['describe']('Success\x20result\x20data')})['strict'](),z['object']({'status':z['literal']('error'),'error':z['string']()['describe']('Error\x20message')})['strict']()])['describe']('MachineNode2File\x20operation\x20output');export const MachineNode2File_OutputWrappedSchema=z['object']({'result':MachineNode2File_OutputSchema})['strict']()['describe']('MachineNode2File\x20operation\x20output\x20wrapped\x20schema');
|
|
1
|
+
import{z}from'zod';import{WithPermissionObjectSchema,NamedObjectSchema,ObjectsSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{MachineNodeSchema,MachineForwardSchema}from'../query/index.js';import{ManyAccountOrMark_AddressSchema,NameOrAddressSchema,NameSchema,NotEmptyNameSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS,DescriptionSchema}from'../common/index.js';function gateNumber(a){if(a===null||a===undefined||a==='')return 0x0;const b=Number(a);return Number['isFinite'](b)?b:null;}export function machinePublishGateViolation(a){if(!Array['isArray'](a)||a['length']===0x0)return'The\x20Machine\x20has\x20no\x20nodes,\x20so\x20it\x20cannot\x20be\x20published\x20(E_EMPTY_MACHINE).\x20'+'Publish\x20validates\x20the\x20whole\x20graph:\x20add\x20at\x20least\x20one\x20node,\x20including\x20the\x20first\x20node\x20carrying\x20the\x20'+'entry\x20pair\x20(prev_node:\x20\x22\x22)\x20that\x20Progress\x20starts\x20from\x20—\x20send\x20the\x20nodes\x20in\x20the\x20SAME\x20call\x20as\x20publish:true\x20'+'(bReplace:true,\x20or\x20op:\x22set\x22),\x20because\x20the\x20graph\x20is\x20frozen\x20the\x20moment\x20publish\x20succeeds.';const b=a,c=new Set(b['map'](e=>e?.['name'])['filter'](e=>typeof e==='string'));let d=![];for(const e of b){const f=Array['isArray'](e?.['pairs'])?e['pairs']:[],g=typeof e?.['name']==='string'?e['name']:'<unnamed\x20node>';for(const h of f){const i=typeof h?.['prev_node']==='string'?h['prev_node']:null,j=Array['isArray'](h?.['forwards'])?h['forwards']:[];if(i===''){if(j['length']===0x0)return'The\x20entry\x20pair\x20of\x20node\x20\x22'+g+'\x22\x20(prev_node:\x20\x22\x22)\x20carries\x20no\x20forward\x20(E_EMPTY_ENTRY_PAIR).\x20'+'Progress\x20starts\x20at\x20the\x20empty\x20initial\x20state\x20\x22\x22\x20and\x20can\x20only\x20leave\x20it\x20through\x20an\x20entry\x20forward,\x20so\x20'+'every\x20order\x20on\x20this\x20Machine\x20would\x20be\x20stuck\x20forever.\x20Add\x20at\x20least\x20one\x20forward\x20to\x20that\x20pair.\x20Do\x20NOT\x20'+'delete\x20the\x20entry\x20pair\x20to\x20silence\x20this\x20—\x20a\x20Machine\x20with\x20no\x20entry\x20edge\x20fails\x20the\x20sibling\x20check\x20instead\x20'+'(E_NO_ENTRY_EDGE).';d=!![];}else{if(i!==null&&!c['has'](i))return'The\x20pair\x20of\x20node\x20\x22'+g+'\x22\x20declares\x20prev_node\x20\x22'+i+'\x22,\x20which\x20is\x20not\x20a\x20node\x20of\x20this\x20Machine\x20'+'(E_EDGE_SOURCE_NOT_FOUND)\x20—\x20that\x20edge\x20is\x20unreachable\x20and\x20its\x20source\x20node\x20can\x20never\x20be\x20entered.\x20'+'Fix\x20the\x20name,\x20or\x20add\x20the\x20missing\x20source\x20node.\x20Mind\x20the\x20direction\x20convention:\x20the\x20pair\x20belongs\x20to\x20'+'the\x20node\x20being\x20advanced\x20INTO,\x20with\x20prev_node\x20naming\x20the\x20node\x20it\x20comes\x20from\x20(the\x20entry\x20edge\x20is\x20the\x20'+'one\x20with\x20the\x20EMPTY\x20prev_node).\x20Export\x20the\x20current\x20graph\x20with\x20machineNode2file\x20before\x20editing.';}let k=0x0;for(const m of j){const n=m?.['namedOperator']!==undefined&&m?.['namedOperator']!==null,o=m?.['permissionIndex']!==undefined&&m?.['permissionIndex']!==null;if(!n&&!o)return'Forward\x20\x22'+(m?.['name']??'<unnamed>')+'\x22\x20of\x20node\x20\x22'+g+'\x22\x20names\x20no\x20operator\x20'+'(E_FORWARD_NO_IDENTITY),\x20so\x20nobody\x20can\x20be\x20authorized\x20to\x20execute\x20it\x20and\x20the\x20Machine\x20cannot\x20be\x20'+'published.\x20Set\x20namedOperator\x20(use\x20\x22\x22\x20for\x20the\x20order\x20payer,\x20or\x20a\x20Progress\x20operator\x20namespace)\x20or\x20'+'permissionIndex\x20(a\x20USER_DEFINED\x20index\x20>=\x201000).\x20A\x20guard\x20does\x20NOT\x20satisfy\x20this:\x20it\x20is\x20a\x20'+'post-verification\x20check,\x20not\x20an\x20identity.';const p=gateNumber(m?.['weight']);if(p!==null)k+=p;}const l=gateNumber(h?.['threshold']);if(l!==null&&k<l){const q=i===''?'entry\x20->\x20'+g:i+'\x20->\x20'+g;return'Pair\x20('+q+')\x20can\x20never\x20migrate:\x20its\x20threshold\x20('+l+')\x20is\x20greater\x20than\x20the\x20sum\x20of\x20its\x20'+('forward\x20weights\x20('+k+')\x20(E_UNREACHABLE_THRESHOLD).\x20Each\x20forward\x20contributes\x20its\x20weight\x20AT\x20')+'MOST\x20ONCE\x20—\x20it\x20is\x20locked\x20by\x20the\x20first\x20operator\x20who\x20accomplishes\x20it,\x20and\x20a\x20second\x20operator\x20re-running\x20'+'it\x20aborts\x20E_NOT_THE_HOLDER\x20—\x20so\x20the\x20reachable\x20maximum\x20is\x20the\x20sum\x20of\x20the\x20DISTINCT\x20forward\x20weights.\x20'+'Lower\x20the\x20threshold,\x20or\x20add\x20one\x20distinct\x20forward\x20per\x20contributing\x20operator\x20(threshold\x202\x20->\x20begin_a\x20+\x20'+'begin_b,\x20each\x20weight\x201).\x20Never\x20try\x20to\x20reach\x20a\x20high\x20threshold\x20by\x20re-running\x20one\x20forward\x20repeatedly.';}}}if(!d)return'The\x20Machine\x20has\x20no\x20entry\x20edge\x20(E_NO_ENTRY_EDGE)\x20—\x20no\x20node\x20declares\x20a\x20pair\x20with\x20prev_node:\x20\x22\x22,\x20so\x20'+'Progress\x20starts\x20at\x20the\x20empty\x20initial\x20state\x20and\x20has\x20no\x20edge\x20to\x20advance\x20on.\x20Add\x20the\x20entry\x20pair\x20to\x20your\x20'+'first\x20node:\x20pairs:[{prev_node:\x22\x22,\x20forwards:[{name:\x22start\x22,\x20weight:1,\x20namedOperator:\x22\x22}]}].\x20The\x20fix\x20must\x20'+'land\x20BEFORE\x20publish\x20—\x20machineNode2file\x20exports\x20the\x20current\x20graph\x20so\x20you\x20can\x20diff\x20it\x20against\x20the\x20fixed\x20one.';return null;}function validateEntryForward(a){for(const b of a){if(!b['pairs'])continue;for(const c of b['pairs']){if(c['prev_node']==='')return!![];}}return![];}const ENTRY_FORWARD_ERROR_MESSAGE='Machine\x20has\x20no\x20entry\x20forward.\x20At\x20least\x20one\x20node\x20must\x20have\x20a\x20pair\x20with\x20prev_node=\x22\x22\x20(empty\x20string),\x20'+'which\x20defines\x20how\x20Progress\x20advances\x20from\x20the\x20initial\x20state\x20(current=\x22\x22)\x20to\x20the\x20first\x20node.\x20'+'Without\x20an\x20entry\x20forward,\x20the\x20workflow\x20will\x20be\x20permanently\x20stuck.\x20'+'Example:\x20{name:\x20\x27Subscribed\x27,\x20pairs:\x20[{prev_node:\x20\x27\x27,\x20forwards:\x20[{name:\x20\x27Subscribe\x27,\x20weight:\x201}]}]}';export const ProgressNamedOperatorSchema=z['object']({'op':z['union']([z['literal']('add'),z['literal']('set'),z['literal']('remove')]),'name':NotEmptyNameSchema,'operators':ManyAccountOrMark_AddressSchema})['strict']();export const ProgressNewSchema=z['object']({'task':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Task\x20bound\x20to\x20the\x20Progress\x20object.\x20It\x20is\x20an\x20object\x20ID\x20or\x20name'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20Progress\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'progress_namedOperator':ProgressNamedOperatorSchema['optional']()['describe']('Add,\x20set,\x20and\x20remove\x20operators\x20for\x20the\x20permission\x20namespace\x20of\x20the\x20Progress\x20object.'),'namedNew':NamedObjectSchema['optional']()})['strict']();export const NodeAddForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward':z['array'](MachineForwardSchema)['describe']('List\x20of\x20operations\x20between\x20the\x20previous\x20and\x20next\x20nodes.'),'threshold':z['union']([z['number']()['int']()['min'](0x0),z['null']()])['optional']()['describe']('Threshold\x20of\x20operations\x20that\x20need\x20to\x20be\x20completed\x20to\x20migrate\x20from\x20the\x20previous\x20node\x20to\x20the\x20next\x20node.')})['strict']();export const NodeRemoveForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward_name':z['array'](NameSchema)['describe']('List\x20of\x20operation\x20names\x20to\x20delete.')})['strict']();export const NodeRemovePriorNodeDataSchema=z['object']({'prior_node_name':z['array'](NameSchema)['describe']('List\x20of\x20previous\x20node\x20names\x20to\x20delete.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.')})['strict']();export const NodeSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Add\x20nodes.'),z['object']({'op':z['literal']('set'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Set\x20nodes.'),z['object']({'op':z['literal']('remove'),'nodes':z['array'](NameSchema)['describe']('List\x20of\x20node\x20names\x20to\x20delete.')})['strict']()['describe']('Delete\x20nodes.'),z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20all\x20nodes.'),z['object']({'op':z['literal']('exchange'),'node_one':NameSchema['describe']('Name\x20of\x20the\x20first\x20node.'),'node_other':NameSchema['describe']('Name\x20of\x20the\x20second\x20node.')})['strict']()['describe']('Exchange\x20the\x20positions\x20of\x20two\x20nodes.'),z['object']({'op':z['literal']('rename'),'node_name_old':NameSchema['describe']('Name\x20of\x20thenode.'),'node_name_new':NameSchema['describe']('New\x20name\x20of\x20the\x20node.')})['strict']()['describe']('Rename\x20node.'),z['object']({'op':z['literal']('remove\x20prior\x20node'),'pairs':z['array'](NodeRemovePriorNodeDataSchema)['describe']('List\x20of\x20previous-next\x20node\x20pairs\x20to\x20delete.')})['strict']()['describe']('Delete\x20previous-next\x20node\x20pairs.'),z['object']({'op':z['literal']('add\x20forward'),'data':z['array'](NodeAddForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20add.')})['strict']()['describe']('Add\x20operations.'),z['object']({'op':z['literal']('remove\x20forward'),'data':z['array'](NodeRemoveForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20delete.')})['strict']()['describe']('Delete\x20operations.')])['superRefine']((a,b)=>{(a['op']==='add'||a['op']==='set')&&a['bReplace']===!![]&&(!validateEntryForward(a['nodes'])&&b['addIssue']({'code':z['ZodIssueCode']['custom'],'message':ENTRY_FORWARD_ERROR_MESSAGE}));});export const NodeJsonOrMarkdownFileSchema=z['object']({'json_or_markdown_file':z['string']()['describe']('Path\x20to\x20a\x20JSON\x20or\x20Markdown\x20file\x20containing\x20node\x20array\x20for\x20COMPLETE\x20REPLACEMENT\x20of\x20all\x20nodes.\x0a\x0a**File\x20Format\x20Requirements:**\x0a-\x20Must\x20contain\x20a\x20JSON\x20ARRAY\x20of\x20node\x20objects:\x20[{\x22name\x22:\x20\x22...\x22,\x20\x22pairs\x22:\x20[...]},\x20{...}]\x0a-\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field\x20(use\x20NodeSchema\x20for\x20operations)\x0a-\x20Supports\x20JSON\x20or\x20Markdown\x20(with\x20```json\x20code\x20blocks)\x0a\x0a**Node\x20Structure:**\x0aEach\x20node\x20is\x20a\x20directed\x20graph\x20element\x20representing\x20a\x20workflow\x20STATE\x20that\x20an\x20order\x0acan\x20rest\x20in.\x20Its\x20Pairs\x20are\x20the\x20INCOMING\x20edges\x20—\x20this\x20is\x20the\x20one\x20convention\x20the\x0achain\x20enforces,\x20and\x20getting\x20it\x20backwards\x20silently\x20builds\x20a\x20wrong\x20graph:\x0a-\x20name:\x20Node\x20identifier\x20—\x20the\x20DESTINATION\x20of\x20every\x20pair\x20it\x20owns\x0a-\x20role:\x20(optional)\x20business\x20role\x20tag\x20for\x20display\x20layers\x20—\x20one\x20of\x20draft/active/delivered/final/cancelled.\x20SESSION\x20METADATA\x20ONLY\x20(not\x20stored\x20on-chain;\x20echoed\x20back\x20as\x20a\x20NODE\x20ROLES\x20warning)\x0a-\x20pairs:\x20Array\x20of\x20{prev_node,\x20forwards,\x20threshold}\x20—\x20edges\x20ENTERING\x20this\x20node.\x20The\x20key\x20is\x20`prev_node`;\x20`prior_node`\x20is\x20not\x20recognized\x20and\x20is\x20silently\x20dropped.\x0a-\x20forwards:\x20Operations\x20that\x20advance\x20INTO\x20this\x20node\x20FROM\x20its\x20prev_node\x20(NOT\x20operations\x20available\x20from\x20this\x20node)\x0a-\x20threshold:\x20Weight\x20required\x20to\x20migrate\x20into\x20this\x20node\x20along\x20that\x20pair\x0a\x0aDiagram\x20`A\x20--[Go]-->\x20B`\x20therefore\x20lives\x20in\x20node\x20**B**:\x20{name:\x22B\x22,\x20pairs:[{prev_node:\x22A\x22,\x20forwards:[{name:\x22Go\x22,\x20weight:1}]}]}.\x0a\x0a**Forward\x20names\x20must\x20determine\x20the\x20destination.**\x20`next_node`\x20is\x20a\x20CALLER\x20argument\x0a(progress.move:540)\x20and\x20the\x20chain\x20resolves\x20(current,\x20next_node,\x20forward)\x20inside\x20the\x0adestination\x20node\x20(machine.move:275),\x20so\x20one\x20forward\x20name\x20shared\x20by\x20two\x20destinations\x0afrom\x20the\x20same\x20prev_node\x20is\x20legal\x20and\x20lets\x20the\x20caller\x20pick\x20the\x20outcome\x20—\x20including\x0awhether\x20a\x20refund\x20Allocator\x20ever\x20fires.\x20Give\x20each\x20destination\x20its\x20own\x20forward\x20name.\x0a\x0a**Behavior:**\x0a-\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes\x20(equivalent\x20to\x20\x22set\x22\x20with\x20bReplace=true)\x0a-\x20Auto-detects\x20format\x20based\x20on\x20file\x20content\x0a-\x20If\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information')})['strict']();export const NodeFieldSchema=z['union']([NodeSchema,NodeJsonOrMarkdownFileSchema]);export const CallMachine_DataSchema=z['object']({'object':WithPermissionObjectSchema,'progress_new':ProgressNewSchema['optional']()['describe']('Generate\x20new\x20Progress\x20object.'),'description':DescriptionSchema['optional']()['describe']('Description\x20of\x20the\x20object.'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'node':NodeFieldSchema['optional']()['describe']('CRITICAL:\x20Choose\x20ONE\x20of\x20two\x20mutually\x20exclusive\x20modes:\x0a\x0a**Mode\x201:\x20NodeSchema\x20(incremental\x20operations)**\x0aUse\x20for\x20partial\x20modifications:\x20add,\x20set,\x20remove,\x20clear,\x20exchange,\x20rename,\x20remove\x20prior\x20node,\x20add\x20forward,\x20remove\x20forward.\x0aFormat:\x20{\x20\x22op\x22:\x20\x22add\x22,\x20\x22nodes\x22:\x20[...],\x20\x22bReplace\x22:\x20false\x20}\x0aThis\x20mode\x20modifies\x20existing\x20nodes\x20incrementally.\x0a\x0a**Mode\x202:\x20NodeJsonOrMarkdownFileSchema\x20(complete\x20replacement)**\x0aUse\x20for\x20complete\x20node\x20redefinition\x20from\x20file.\x0aFormat:\x20{\x20\x22json_or_markdown_file\x22:\x20\x22/path/to/nodes.json\x22\x20}\x0aIMPORTANT:\x20This\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes.\x20File\x20must\x20contain\x20node\x20array\x20[{...},\x20{...}],\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field.\x0aSupported\x20formats:\x20JSON\x20array\x20or\x20Markdown\x20with\x20code\x20blocks.\x0aIf\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information.'),'pause':z['boolean']()['optional']()['describe']('Whether\x20to\x20pause\x20generating\x20new\x20Progress\x20objects.'),'publish':z['boolean']()['optional']()['describe']('Whether\x20to\x20publish\x20the\x20object.\x20After\x20the\x20object\x20is\x20published,\x20new\x20Progress\x20objects\x20can\x20be\x20generated;\x20and\x20node\x20settings\x20will\x20no\x20longer\x20be\x20changeable.\x20⚠️\x20PUBLISH\x20IS\x20A\x20ONE-WAY\x20DOOR\x20AND\x20THE\x20CHAIN\x20VALIDATES\x20THE\x20WHOLE\x20GRAPH\x20AT\x20THAT\x20MOMENT:\x20the\x20on-chain\x20publish\x20gate\x20rejects\x20a\x20Machine\x20that\x20is\x20empty,\x20has\x20no\x20entry\x20edge\x20(no\x20pair\x20with\x20prev_node:\x22\x22),\x20has\x20an\x20entry\x20pair\x20with\x20no\x20forward,\x20references\x20a\x20prev_node\x20that\x20is\x20not\x20a\x20node\x20of\x20this\x20Machine,\x20carries\x20a\x20forward\x20with\x20neither\x20namedOperator\x20nor\x20permissionIndex\x20(a\x20guard\x20is\x20NOT\x20an\x20identity),\x20or\x20has\x20a\x20pair\x20whose\x20threshold\x20exceeds\x20the\x20sum\x20of\x20its\x20forward\x20weights\x20(each\x20forward\x20counts\x20at\x20most\x20once).\x20These\x20aborts\x20(machine:17-22)\x20fire\x20BEFORE\x20the\x20publish\x20lands,\x20so\x20the\x20graph\x20is\x20still\x20editable\x20—\x20but\x20after\x20it\x20succeeds,\x20nodes/forwards,\x20Guard\x20bindings\x20and\x20Service.machine\x20are\x20frozen\x20forever,\x20and\x20a\x20broken\x20graph\x20would\x20only\x20surface\x20at\x20the\x20first\x20transition\x20with\x20no\x20repair\x20path.\x20Send\x20the\x20nodes\x20in\x20the\x20SAME\x20call\x20as\x20publish:true\x20(bReplace:true\x20or\x20op:\x22set\x22)\x20so\x20the\x20complete\x20graph\x20is\x20validated\x20together.\x20⚠️\x20Before\x20publishing,\x20enumerate\x20the\x20graph\x20STOP\x20NODES\x20(nodes\x20with\x20no\x20outgoing\x20Pair)\x20plus\x20every\x20waiting\x20state\x20(review\x20window,\x20handover,\x20open\x20dispute)\x20and\x20verify\x20each\x20has\x20a\x20defined\x20fund\x20exit\x20in\x20the\x20Service\x20order_allocators\x20—\x20withdrawal\x20(release)\x20AND\x20refund.\x20Machine\x20+\x20Allocator\x20are\x20immutable\x20after\x20publish\x20(IMMUT-001);\x20an\x20uncovered\x20stop\x20node\x20strands\x20funds\x20permanently\x20(rule\x20R-M5-03,\x20checklist\x20pattern.fund_flow_stop_node_coverage).'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Machine\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']()['superRefine']((a,b)=>{if(a['publish']!==!![])return;const c=a['node'];if(!c||'json_or_markdown_file'in c)return;if(c['op']!=='add'&&c['op']!=='set')return;const d=typeof a['object']==='object'&&a['object']!==null;if(!d&&c['bReplace']!==!![])return;if(!Array['isArray'](c['nodes'])||c['nodes']['length']===0x0||typeof c['nodes'][0x0]!=='object')return;const e=machinePublishGateViolation(c['nodes']);e&&b['addIssue']({'code':z['ZodIssueCode']['custom'],'message':e});})['describe']('On-chain\x20Machine\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Machine.\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 CallMachine_InputSchema=z['object']({'data':CallMachine_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();export const MachineNode2File_InputSchema=z['object']({'machine':NameOrAddressSchema['describe']('Machine\x20object\x20ID\x20or\x20name\x20to\x20export'),'file_path':z['string']()['optional']()['describe']('Output\x20file\x20path\x20(absolute\x20or\x20relative).\x20Defaults\x20to\x20the\x20workspace\x20directory\x20when\x20omitted.'),'format':z['enum'](['json','markdown'])['optional']()['default']('json')['describe']('Output\x20format:\x20\x27json\x27\x20(default)\x20or\x20\x27markdown\x27'),'env':CallEnvSchema['optional']()})['strict']()['describe']('Query\x20a\x20Machine\x20object\x20from\x20the\x20blockchain\x20and\x20export\x20its\x20node\x20definition\x20to\x20a\x20JSON\x20or\x20Markdown\x20file.\x20The\x20exported\x20file\x20can\x20be\x20edited\x20and\x20used\x20to\x20create\x20new\x20Machine\x20objects.');export const MachineNode2File_OutputSchema=z['discriminatedUnion']('status',[z['object']({'status':z['literal']('success'),'data':z['object']({'file_path':z['string']()['describe']('Absolute\x20path\x20of\x20the\x20exported\x20file'),'format':z['enum'](['json','markdown'])['describe']('Export\x20format'),'machine_object':NameOrAddressSchema['describe']('Machine\x20object\x20ID'),'node_count':z['number']()['describe']('Number\x20of\x20nodes\x20exported')})['strict']()['describe']('Success\x20result\x20data')})['strict'](),z['object']({'status':z['literal']('error'),'error':z['string']()['describe']('Error\x20message')})['strict']()])['describe']('MachineNode2File\x20operation\x20output');export const MachineNode2File_OutputWrappedSchema=z['object']({'result':MachineNode2File_OutputSchema})['strict']()['describe']('MachineNode2File\x20operation\x20output\x20wrapped\x20schema');
|