@wowok/agent-mcp 3.3.0 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/chain-semantics/object-graph.js +1 -1
- package/dist/composition/audit.d.ts +5 -0
- package/dist/composition/audit.js +1 -1
- package/dist/composition/blueprint-view.d.ts +0 -1
- package/dist/composition/blueprint-view.js +1 -1
- package/dist/composition/compile.d.ts +4 -2
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.d.ts +8 -4
- package/dist/composition/inflight.js +1 -1
- package/dist/customer/industry-risks.js +1 -1
- package/dist/customer/user-preferences.js +1 -1
- package/dist/extensions/business-modules.d.ts +7 -2
- package/dist/extensions/business-modules.js +1 -1
- package/dist/extensions/industry-audit.spec.js +1 -1
- package/dist/extensions/industry-pack.d.ts +3 -2
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/graph/onchain/project-relationship.js +1 -1
- package/dist/knowledge/acquisition-flywheel.js +1 -1
- package/dist/knowledge/allocation-ledger.d.ts +4 -1
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocation-puzzle.d.ts +1 -0
- package/dist/knowledge/allocation-puzzle.js +1 -1
- package/dist/knowledge/allocation-risk.d.ts +1 -1
- package/dist/knowledge/allocation-risk.js +1 -1
- package/dist/knowledge/arb-fund-facts.d.ts +5 -0
- package/dist/knowledge/arb-fund-facts.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +4 -3
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/plan.json +48 -2
- package/dist/knowledge/baselines/rules/reward.json +1 -1
- package/dist/knowledge/builtin-templates.d.ts +9 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/discount-threshold.js +1 -1
- package/dist/knowledge/guard-bindings.js +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-field-cognition.js +1 -1
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-submission-brief.d.ts +5 -0
- package/dist/knowledge/guard-submission-brief.js +1 -1
- package/dist/knowledge/guard-submission-prompt.d.ts +2 -1
- package/dist/knowledge/guard-submission-prompt.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/industry-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/reward-ledger.js +1 -1
- package/dist/knowledge/reward-puzzle.d.ts +1 -1
- package/dist/knowledge/reward-risk.d.ts +1 -1
- package/dist/knowledge/scenario-modes.d.ts +2 -2
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/scenario-topology.js +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-index.d.ts +19 -0
- package/dist/knowledge/template-index.js +1 -0
- package/dist/knowledge/template-loader.d.ts +36 -0
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +7 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/tool-constraints.js +1 -1
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/participation/radar-core.d.ts +1 -0
- package/dist/participation/radar-core.js +1 -1
- package/dist/persona/defaults.js +1 -1
- package/dist/persona/topology-focus.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/game-theory.d.ts +4 -1
- package/dist/playbooks/service-build/game-theory.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +25 -1
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.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/pipeline-actions.d.ts +4 -1
- package/dist/playbooks/service-build/pipeline-actions.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.d.ts +4 -0
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/relationship/derivation.d.ts +1 -1
- package/dist/review/index.js +1 -1
- package/dist/rules.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +35 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +46 -3
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/contact.js +1 -1
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/progress.d.ts +6 -3
- package/dist/schema/call/progress.js +1 -1
- package/dist/schema/call/repository.js +1 -1
- package/dist/schema/call/reward.d.ts +2 -2
- package/dist/schema/call/reward.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +8 -4
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/goal/index.d.ts +54 -0
- package/dist/schema/goal/planning.d.ts +86 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/local/index.d.ts +39 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/operations.d.ts +20 -5
- package/dist/schema/operations.js +1 -1
- package/dist/schema/query/bi.d.ts +2 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +24 -12
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.d.ts +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workspace/index.d.ts +9 -0
- package/dist/schema/workspace/index.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +28 -3
- package/dist/schemas/benchmark_migration_operation.schema.json +87 -0
- package/dist/schemas/goal_operation.schema.json +94 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/onchain_operations.output.json +1 -1
- package/dist/schemas/onchain_operations.schema.json +409 -119
- package/dist/schemas/onchain_operations_allocation.schema.json +290 -6
- package/dist/schemas/onchain_operations_arbitration.schema.json +2 -2
- package/dist/schemas/onchain_operations_contact.schema.json +2 -2
- package/dist/schemas/onchain_operations_demand.schema.json +3 -3
- package/dist/schemas/onchain_operations_gen_passport.schema.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +63 -63
- package/dist/schemas/onchain_operations_machine.schema.json +1 -1
- package/dist/schemas/onchain_operations_order.schema.json +2 -2
- package/dist/schemas/onchain_operations_progress.schema.json +7 -3
- package/dist/schemas/onchain_operations_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_repository.schema.json +2 -2
- package/dist/schemas/onchain_operations_reward.schema.json +8 -8
- package/dist/schemas/onchain_operations_service.schema.json +20 -18
- package/dist/schemas/onchain_operations_treasury.schema.json +7 -7
- package/dist/schemas/query_toolkit.output.json +67 -53
- package/dist/schemas/workflow_operation.schema.json +1 -1
- package/dist/schemas/workspace_operation.output.json +23 -3
- package/dist/schemas/workspace_operation.schema.json +3 -3
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/file-export.js +1 -1
- package/dist/tools/handlers/industry-pack.d.ts +1 -0
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +24 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/review-chain.d.ts +1 -1
- package/dist/tools/handlers/review-chain.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/handlers/workflow.js +1 -1
- package/dist/tools/handlers/workspace.js +1 -1
- package/dist/tools/registry/agent.js +1 -1
- package/dist/tools/registry/local.js +1 -1
- package/dist/tools/wip-deploy-assist.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
package/dist/rules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{validateOperation,hasBlockingViolations,getWarningViolations}from'./knowledge/tool-constraints.js';export{AUDIT_RULES,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings}from'./knowledge/audit-rules.js';export{confirmGate,isConfirmGateEnabled,isExplicitlyConfirmed,getFailMode}from'./safety/confirm-gate.js';export{renderPreview,renderPreviewHuman}from'./safety/preview.js';export{CONFIRMATION_RULES,SAFETY_RULES_VERSION,DEFAULT_AMOUNT_THRESHOLD,getAmountThreshold,formatAmount,collectDefaultWarnings}from'./knowledge/safety-rules.js';export{distillIntent,extractSignals}from'./experience/intent-distill.js';export{Harness,getHarness,setHarness}from'./harness/index.js';export{getDefaultPreferences,getIndustryTemplate,mergePreferences,validatePreferences,SUPPORTED_INDUSTRIES}from'./customer/user-preferences.js';import{CONFIRMATION_RULES,DEFAULT_AMOUNT_THRESHOLD,formatAmount,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_CLASS_META,NAMING_CONVENTIONS}from'./knowledge/safety-rules.js';const PERMISSION_INDEX_RANGE='1000-65535\x20(0-999\x20reserved)';export function buildSoftRulesPrompt(){const a=[];a['push']('##\x20Token\x20amounts'),a['push']('-\x20Token\x20amounts\x20are\x20U64\x20integers\x20in\x20the\x20smallest\x20unit.\x201\x20WOW\x20=\x201_000_000_000\x20(9\x20decimals).'),a['push']('-\x20Amount\x20input\x20accepts\x20\x272WOW\x27\x20/\x20\x2710.5WOW\x27\x20(auto-converted)\x20or\x20a\x20raw\x20integer\x20\x272000000000\x27.'),a['push']('-\x20Always\x20query\x20token\x20precision\x20via\x20query_toolkit\x20before\x20using\x20a\x20non-WOW\x20token.'),a['push'](''),a['push']('##\x20Operation\x20classes');for(const [c,d]of Object['entries'](OPERATION_CLASS_META)){a['push']('-\x20'+c+':\x20'+d['note']);}a['push'](''),a['push']('##\x20Object\x20reuse\x20vs\x20create'),a['push']('-\x20'+CREATE_VS_MODIFY_PATTERN['note']);for(const e of OBJECT_REUSE_RULES){a['push']('\x20\x20-\x20'+e['object_type']+':\x20'+e['recommendation']['replace'](/_/g,'\x20')+'\x20—\x20'+e['reason']);}a['push'](''),a['push']('##\x20Immutability');for(const f of IMMUTABILITY_RULES){const g=f['mutable_after']?.['length']?'\x20(still\x20mutable:\x20'+f['mutable_after']['join'](',\x20')+')':'';a['push']('-\x20'+f['object_type']+'\x20'+f['trigger']+':\x20'+f['message']+g);}a['push'](''),a['push']('##\x20Confirmation\x20levels');const b=[...new Set(CONFIRMATION_RULES['map'](h=>h['level']))];a['push']('-\x20Amount\x20threshold\x20for\x20extra\x20scrutiny:\x20'+formatAmount(DEFAULT_AMOUNT_THRESHOLD)+'\x20WOW.'),a['push']('-\x20Confirm-gate\x20levels:\x20'+b['join'](',\x20')+'.'),a['push'](''),a['push']('##\x20Naming\x20conventions'),a['push']('-\x20Scheme:\x20'+NAMING_CONVENTIONS['scheme']);for(const h of NAMING_CONVENTIONS['recommendations']){a['push']('-\x20'+h);}return a['push']('-\x20Custom\x20permission\x20indices:\x20'+PERMISSION_INDEX_RANGE+'.'),a['push'](''),a['join']('\x0a');}export{OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,NAMING_CONVENTIONS,classifyTool,checkObjectReuseRules,checkImmutabilityRules}from'./knowledge/safety-rules.js';
|
|
1
|
+
export{validateOperation,hasBlockingViolations,getWarningViolations}from'./knowledge/tool-constraints.js';export{AUDIT_RULES,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings}from'./knowledge/audit-rules.js';export{confirmGate,isConfirmGateEnabled,isExplicitlyConfirmed,getFailMode}from'./safety/confirm-gate.js';export{renderPreview,renderPreviewHuman}from'./safety/preview.js';export{CONFIRMATION_RULES,SAFETY_RULES_VERSION,DEFAULT_AMOUNT_THRESHOLD,getAmountThreshold,formatAmount,collectDefaultWarnings}from'./knowledge/safety-rules.js';export{distillIntent,extractSignals}from'./experience/intent-distill.js';export{Harness,getHarness,setHarness}from'./harness/index.js';export{getDefaultPreferences,getIndustryTemplate,mergePreferences,validatePreferences,SUPPORTED_INDUSTRIES}from'./customer/user-preferences.js';import{CONFIRMATION_RULES,DEFAULT_AMOUNT_THRESHOLD,formatAmount,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_CLASS_META,NAMING_CONVENTIONS}from'./knowledge/safety-rules.js';const PERMISSION_INDEX_RANGE='1000-65535\x20(0-999\x20reserved)';export function buildSoftRulesPrompt(){const a=[];a['push']('##\x20Token\x20amounts'),a['push']('-\x20Token\x20amounts\x20are\x20U64\x20integers\x20in\x20the\x20smallest\x20unit.\x201\x20WOW\x20=\x201_000_000_000\x20(9\x20decimals).'),a['push']('-\x20Amount\x20input\x20accepts\x20\x272WOW\x27\x20/\x20\x2710.5WOW\x27\x20(auto-converted)\x20or\x20a\x20raw\x20integer\x20\x272000000000\x27.'),a['push']('-\x20Always\x20query\x20token\x20precision\x20via\x20query_toolkit\x20before\x20using\x20a\x20non-WOW\x20token.'),a['push'](''),a['push']('##\x20Network\x20discipline'),a['push']('-\x20Omitting\x20the\x20network\x20field\x20means\x20\x22run\x20on\x20the\x20CURRENT\x20operating\x20network\x22\x20(the\x20app\x27s\x20active\x20selection,\x20echoed\x20in\x20your\x20system\x20prompt).\x20NEVER\x20guess\x20or\x20invent\x20a\x20network.'),a['push']('-\x20When\x20the\x20user\x27s\x20request\x20clearly\x20targets\x20a\x20DIFFERENT\x20network\x20(e.g.\x20\x22build\x20and\x20test\x20on\x20testnet\x22\x20while\x20the\x20app\x20is\x20on\x20mainnet),\x20set\x20env.network\x20(onchain_operations\x20/\x20bridge_operation)\x20or\x20the\x20call\x27s\x20network\x20field\x20to\x20that\x20network\x20in\x20THIS\x20call.\x20The\x20client\x20detects\x20the\x20mismatch\x20and\x20switches\x20the\x20whole\x20app\x20before\x20executing\x20—\x20via\x20a\x20confirmation\x20card,\x20or\x20automatically\x20when\x20the\x20user\x27s\x20message\x20itself\x20names\x20the\x20target\x20network.'),a['push']('-\x20Read-only\x20queries\x20(query_toolkit\x20context_network)\x20select\x20a\x20network\x20per\x20call\x20and\x20never\x20switch\x20the\x20app.'),a['push'](''),a['push']('##\x20Testnet\x20funds\x20(faucet)'),a['push']('-\x20Test\x20coins\x20are\x20claimable\x20IN-APP:\x20account_operation\x20with\x20{\x20faucet:\x20{\x20name_or_address:\x20\x22\x22,\x20network:\x20\x22testnet\x22\x20}\x20}\x20(\x27\x27\x20=\x20default\x20account;\x20network\x20accepts\x20testnet/localnet\x20only\x20—\x20mainnet\x20has\x20no\x20faucet).'),a['push']('-\x20Never\x20tell\x20the\x20user\x20to\x20visit\x20an\x20external\x20faucet\x20website\x20—\x20the\x20in-app\x20faucet\x20call\x20above\x20is\x20the\x20supported\x20flow.'),a['push'](''),a['push']('##\x20Operation\x20classes');for(const [c,d]of Object['entries'](OPERATION_CLASS_META)){a['push']('-\x20'+c+':\x20'+d['note']);}a['push'](''),a['push']('##\x20Object\x20reuse\x20vs\x20create'),a['push']('-\x20'+CREATE_VS_MODIFY_PATTERN['note']);for(const e of OBJECT_REUSE_RULES){a['push']('\x20\x20-\x20'+e['object_type']+':\x20'+e['recommendation']['replace'](/_/g,'\x20')+'\x20—\x20'+e['reason']);}a['push'](''),a['push']('##\x20Immutability');for(const f of IMMUTABILITY_RULES){const g=f['mutable_after']?.['length']?'\x20(still\x20mutable:\x20'+f['mutable_after']['join'](',\x20')+')':'';a['push']('-\x20'+f['object_type']+'\x20'+f['trigger']+':\x20'+f['message']+g);}a['push'](''),a['push']('##\x20Confirmation\x20levels');const b=[...new Set(CONFIRMATION_RULES['map'](h=>h['level']))];a['push']('-\x20Amount\x20threshold\x20for\x20extra\x20scrutiny:\x20'+formatAmount(DEFAULT_AMOUNT_THRESHOLD)+'\x20WOW.'),a['push']('-\x20Confirm-gate\x20levels:\x20'+b['join'](',\x20')+'.'),a['push'](''),a['push']('##\x20Naming\x20conventions'),a['push']('-\x20Scheme:\x20'+NAMING_CONVENTIONS['scheme']);for(const h of NAMING_CONVENTIONS['recommendations']){a['push']('-\x20'+h);}return a['push']('-\x20Custom\x20permission\x20indices:\x20'+PERMISSION_INDEX_RANGE+'.'),a['push'](''),a['join']('\x0a');}export{OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,NAMING_CONVENTIONS,classifyTool,checkObjectReuseRules,checkImmutabilityRules}from'./knowledge/safety-rules.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONFIRMATION_RULES,resolveOverrideId}from'../knowledge/safety-rules.js';import{isEnabled as
|
|
1
|
+
import{CONFIRMATION_RULES,resolveOverrideId}from'../knowledge/safety-rules.js';import{isEnabled as a373a}from'../config/index.js';import{isPlanPreapproved}from'../goal/plan-approval.js';export function isConfirmGateEnabled(){return a373a('confirm_gate');}const internalErrorCounts={};function logInternalError(a,b){const c=a;internalErrorCounts[c]=(internalErrorCounts[c]??0x0)+0x1;const d=internalErrorCounts[c];console['warn']('[ConfirmGate]\x20internal_error\x20context=\x22'+a+'\x22\x20count='+d+'\x20error='+(b instanceof Error?b['message']:String(b)));}export function getFailMode(a){switch(a){case'irreversible':case'publish':case'amount':return'closed';case'standard':case'none':default:return'open';}}function buildInternalErrorResult(a,b,c){const d=b instanceof Error?b['message']:b!==undefined?String(b):undefined;return{'pass':![],'level':'irreversible','preview':{'level':'irreversible','operation':a,'irreversible':!![],'warnings':[...c?['ConfirmGate\x20rule\x20\x27'+c+'\x27\x20matched\x20but\x20its\x20preview\x20could\x20not\x20be\x20generated.']:['An\x20error\x20occurred\x20while\x20matching\x20confirmation\x20rules.'],...d!==undefined?['Reason:\x20'+d]:[],'The\x20operation\x20was\x20NOT\x20executed.\x20Review\x20the\x20parameters\x20for\x20malformed\x20values\x20(e.g.\x20decimal\x20amounts\x20instead\x20of\x20smallest-unit\x20integers)\x20before\x20confirming.']},'rule_id':'internal_error'};}function emitGuardQuietNotice(a,b,c,d,f){try{const g=f['preview'](a,b,c),h=['[ConfirmGate]\x20guard\x20CREATE\x20proceeded\x20WITHOUT\x20interactive\x20confirmation\x20(confirm_mode:\x20'+d+').','\x20\x20Object:\x20'+String(g['object']??'(unnamed)')+'\x20\x20Network:\x20'+String(g['network']??'?'),...(g['warnings']??[])['map'](i=>'\x20\x20-\x20'+i),'\x20\x20Immutable\x20after\x20creation\x20—\x20changes\x20require\x20a\x20NEW\x20guard\x20+\x20rebind.\x20Verify\x20with\x20analyze_guard_semantics\x20after\x20creation.'];console['warn'](h['join']('\x0a'));}catch(i){console['warn']('[ConfirmGate]\x20guard\x20CREATE\x20proceeded\x20in\x20'+d+'\x20mode\x20(manifest\x20unavailable:\x20'+(i instanceof Error?i['message']:String(i))+')');}}export function confirmGate(a,b,c,d,f,g){if(!isConfirmGateEnabled())return{'pass':!![]};if(c?.['confirmed']===!![])return{'pass':!![]};if(c?.['dry_run']===!![])return{'pass':!![]};let h,i=null;try{h=CONFIRMATION_RULES['find'](n=>{try{return n['when'](a,b,c);}catch(o){logInternalError('rule_when:'+n['id'],o);if(getFailMode(n['level'])==='closed')throw o;return![];}});}catch(n){i=n;}if(i)return logInternalError('rule_search',i),buildInternalErrorResult(a,i);if(!h)return{'pass':!![]};if(getFailMode(h['level'])==='open'&&isPlanPreapproved(c))return{'pass':!![]};const j=resolveOverrideId(h['id'],a),k=j?f?.[j]:undefined;if(k==='auto')return{'pass':!![]};const l=c?.['confirm_mode']==='quiet'||c?.['confirm_mode']==='streamlined'?c['confirm_mode']:'full';if(l!=='full'&&k!=='block'&&getFailMode(h['level'])==='open')return{'pass':!![]};if(h['id']==='guard_create_immutable'&&l!=='full'&&k!=='block')return emitGuardQuietNotice(a,b,c,l,h),{'pass':!![]};if(k!=='block'&&g?.['intent_bypass']!==![]&&h['bypass_on_explicit_intent']&&d&&d['length']>0x0){const o=d['map'](q=>q['toLowerCase']()),p=h['bypass_on_explicit_intent']['some'](q=>o['some'](r=>r['includes'](q['toLowerCase']())));if(p)return{'pass':!![]};}let m;try{m=h['preview'](a,b,c);}catch(q){logInternalError('rule_preview:'+h['id'],q);if(getFailMode(h['level'])==='closed')return buildInternalErrorResult(a,q,h['id']);return{'pass':!![]};}return{'pass':![],'level':h['level'],'preview':m,'rule_id':h['id']};}export function isExplicitlyConfirmed(a){return a?.['confirmed']===!![];}
|
|
@@ -34,6 +34,41 @@ export declare const BenchmarkMigrationSchema: z.ZodObject<{
|
|
|
34
34
|
review_reward: "review_reward";
|
|
35
35
|
}>>;
|
|
36
36
|
reward_funding: z.ZodOptional<z.ZodString>;
|
|
37
|
+
after_sales_mode: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
none: "none";
|
|
39
|
+
return: "return";
|
|
40
|
+
exchange: "exchange";
|
|
41
|
+
warranty: "warranty";
|
|
42
|
+
}>>;
|
|
43
|
+
acceptance_mode: z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
none: "none";
|
|
45
|
+
agent: "agent";
|
|
46
|
+
milestone: "milestone";
|
|
47
|
+
contest: "contest";
|
|
48
|
+
bounty: "bounty";
|
|
49
|
+
}>>;
|
|
50
|
+
installment_mode: z.ZodOptional<z.ZodEnum<{
|
|
51
|
+
none: "none";
|
|
52
|
+
deposit_balance: "deposit_balance";
|
|
53
|
+
milestone_n: "milestone_n";
|
|
54
|
+
}>>;
|
|
55
|
+
affiliate_mode: z.ZodOptional<z.ZodEnum<{
|
|
56
|
+
none: "none";
|
|
57
|
+
commission: "commission";
|
|
58
|
+
}>>;
|
|
59
|
+
crowdfunding_mode: z.ZodOptional<z.ZodEnum<{
|
|
60
|
+
threshold: "threshold";
|
|
61
|
+
none: "none";
|
|
62
|
+
flexible: "flexible";
|
|
63
|
+
}>>;
|
|
64
|
+
sales: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
65
|
+
incentive: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
amount: z.ZodString;
|
|
67
|
+
conditions: z.ZodString;
|
|
68
|
+
basis: z.ZodString;
|
|
69
|
+
claim_window: z.ZodString;
|
|
70
|
+
}, z.core.$strict>>;
|
|
71
|
+
}, z.core.$loose>>>;
|
|
37
72
|
log: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
73
|
network: z.ZodOptional<z.ZodEnum<{
|
|
39
74
|
testnet: "testnet";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from'zod';import{GuardResolutionInputSchema}from'../goal/planning.js';const TemplateSummarySchema=z['object']({'id':z['string']()['describe']('Template\x20id\x20\x27<industry>/<variant>\x27,\x20e.g.\x20\x27retail/scale-marketplace\x27.'),'industry':z['string']()['describe']('Industry\x20vertical.'),'variant':z['string']()['describe']('Business-model\x20variant\x20slug.'),'product_ref':z['string']()['optional']()['describe']('Benchmark\x20product\x20slug\x20this\x20archetype\x20models\x20(e.g.\x20\x27amazon\x27).\x20The\x20only\x20sanctioned\x20company\x20name;\x20users\x20can\x20pick\x20a\x20template\x20by\x20naming\x20the\x20incumbent\x20product.'),'archetype':z['enum'](['leader','challenger']),'key_risk':z['string']()['describe']('Primary\x20risk\x20this\x20template\x20mitigates.'),'node_count':z['number']()['describe']('Machine\x20node\x20count.'),'guard_count':z['number']()['describe']('Guard\x20template\x20count.'),'recommended_role':z['enum'](['merchant','supplier','both'])})['describe']('Compact\x20template\x20listing\x20row.'),TemplateScanFindingSchema=z['object']({'rule_id':z['string']()['optional']()['describe']('Rule\x20id\x20when\x20known\x20(e.g.\x20\x27R-M3-01\x27,\x20\x27R1\x27).'),'severity':z['enum'](['low','medium','high','critical']),'title':z['string'](),'detail':z['string'](),'suggestion':z['string']()})['describe']('One\x20pre-deploy\x20risk\x20finding.'),MigrationEntrySchema=z['object']({'source_element':z['string']()['describe']('Competitor-side\x20element.'),'target_object':z['string']()['optional']()['describe']('WoWok\x20object/mechanism\x20it\x20maps\x20to.'),'mapping_note':z['string']()['describe']('One-line\x20mapping\x20explanation.'),'reason':z['string']()['optional']()['describe']('Why\x20it\x20cannot\x20be\x20migrated,\x20or\x20why\x20it\x20needs\x20a\x20decision.')})['describe']('One\x20competitor\x20element\x20and\x20its\x20WoWok\x20mapping\x20outcome.'),MigrationLogSchema=z['object']({'source':z['object']({'url':z['string']()['optional'](),'description':z['string'](),'detected_industry':z['string'](),'matched_template':z['string']()['describe']('Matched\x20template\x20id\x20\x27<industry>/<variant>\x27.')})['describe']('Migration\x20source\x20provenance.'),'mapped':z['array'](MigrationEntrySchema)['describe']('Elements\x20that\x20map\x20cleanly\x20to\x20WoWok\x20objects.'),'unmapped':z['array'](MigrationEntrySchema)['describe']('Elements\x20that\x20cannot\x20be\x20migrated,\x20with\x20reasons.'),'manual_review':z['array'](MigrationEntrySchema)['describe']('Elements\x20requiring\x20an\x20explicit\x20user\x20decision.'),'wowok_advantages':z['array'](z['string']())['describe']('WoWok\x20platform\x20advantages\x20surfaced\x20during\x20migration.'),'customizable_modules':z['array'](z['string']())['describe']('Business-module\x20ids\x20the\x20user\x20can\x20customize.'),'role_assessment':z['object']({'recommended':z['string'](),'rationale':z['string'](),'alternatives':z['array'](z['string']())})['describe']('Merchant\x20vs\x20supplier\x20role\x20assessment.'),'risk_check':z['object']({'passed':z['boolean'](),'findings':z['array'](z['string']())})['describe']('Dry-run\x20risk\x20check\x20against\x20the\x20matched\x20template.'),'network':z['enum'](['testnet','mainnet'])['describe']('Target\x20network\x20(default\x20testnet).')})['describe']('Structured\x20competitor-migration\x20log.');export const BenchmarkMigrationSchema=z['object']({'action':z['enum'](['template_list','template_get','template_generate','template_scan','migration_import','migration_review','migration_apply'])['describe']('Action:\x20\x27template_list\x27\x20=\x20list\x20the\x20loaded\x20MD\x20industry\x20templates\x20(optional\x20industry\x20filter);\x20'+'\x27template_get\x27\x20=\x20fetch\x20one\x20template\x20by\x20id\x20(template_id\x20required);\x20'+'\x27template_generate\x27\x20=\x20generate\x20a\x20creation\x20plan\x20from\x20a\x20template\x20via\x20the\x20merchant-guide\x20'+'pipeline\x20(template_id\x20required;\x20scan-first\x20—\x20CRITICAL\x20findings\x20block;\x20never\x20executes\x20on-chain);\x20'+'\x27template_scan\x27\x20=\x20pre-deploy\x20risk\x20scan\x20of\x20one\x20template\x20(template_id\x20required;\x20returns\x20'+'risk_level/findings/red_flags\x20plus\x20a\x20drift\x20face\x20—\x20disk-vs-catalog\x20provenance\x20of\x20the\x20'+'scanned\x20body;\x20CRITICAL\x20blocks\x20generation/apply);\x20'+'\x27migration_import\x27\x20=\x20competitor\x20URL/description\x20→\x20migration\x20plan\x20+\x20MigrationLog\x20'+'(description\x20required);\x20'+'\x27migration_review\x27\x20=\x20surface\x20the\x20MigrationLog\x20for\x20user\x20confirmation\x20(log\x20required);\x20'+'\x27migration_apply\x27\x20=\x20run\x20the\x20approved\x20template\x20through\x20the\x20merchant-guide\x20pipeline\x20'+'(template_id\x20required;\x20scan-first\x20—\x20CRITICAL\x20findings\x20block;\x20default\x20network\x20testnet).'),'template_id':z['string']()['optional']()['describe']('Template\x20id\x20\x27<industry>/<variant>\x27\x20(required\x20for\x20template_get\x20/\x20template_generate\x20/\x20template_scan\x20/\x20migration_apply),\x20e.g.\x20\x27retail/scale-marketplace\x27.'),'industry':z['string']()['optional']()['describe']('Industry\x20filter\x20for\x20template_list;\x20industry\x20hint\x20for\x20migration_import.\x20'+'Any\x20registered\x20industry\x20is\x20accepted\x20(builtin:\x20freelance,\x20rental,\x20education,\x20'+'travel,\x20subscription,\x20retail;\x20plus\x20custom\x20industries\x20registered\x20via\x20industry\x20packs).\x20'+'Aliases\x20are\x20resolved\x20(e.g.\x20\x27ecommerce\x27\x20→\x20\x27retail\x27).'),'description':z['string']()['optional']()['describe']('Natural-language\x20business/competitor\x20description\x20(required\x20for\x20migration_import;\x20used\x20by\x20template_generate\x20as\x20the\x20intent\x20text).'),'url':z['string']()['optional']()['describe']('Competitor\x20store/profile\x20URL\x20for\x20migration_import\x20(recorded\x20as\x20provenance\x20only).'),'fee_overrides':z['record'](z['string'](),z['union']([z['number'](),z['string']()]))['optional']()['describe']('Template\x20fee-parameter\x20overrides\x20for\x20template_generate\x20(e.g.\x20commission_rate_bps).'),'guard_resolutions':z['record'](z['string'](),GuardResolutionInputSchema)['optional']()['describe']('Judgment-layer\x20resolutions\x20for\x20pending\x20guard\x20designs\x20(C6-DEEP),\x20keyed\x20by\x20plan.pending_guard_designs[].key.\x20'+'A\x20blocked\x20migration_apply/template_generate\x20lists\x20every\x20unresolved\x20design\x20—\x20resolve\x20each\x20here\x20'+'(kind\x20\x27inline\x27\x20with\x20the\x20Guard\x20table+root,\x20or\x20kind\x20\x27template\x27\x20with\x20a\x20tpl_*\x20id)\x20and\x20re-run\x20the\x20action.\x20'+'Advisory\x20designs\x20that\x20do\x20not\x20apply\x20to\x20this\x20shop\x20may\x20be\x20resolved\x20with\x20{kind:\x27omit\x27}\x20instead\x20'+'(run75747\x20F-38:\x20honored\x20only\x20for\x20designs\x20with\x20no\x20inbound\x20binding;\x20an\x20omit\x20of\x20a\x20bound\x20design\x20'+'is\x20refused\x20with\x20GUARD_OMIT_UNSUPPORTED).\x20'+'The\x20audit\x20freeze\x20gate\x20still\x20decides:\x20resolutions\x20only\x20unblock\x20a\x20plan\x20whose\x20closed\x20audit\x20is\x20clean.'),'review_mode':z['enum'](['review','review_reward','none'])['optional']()['describe']('Per-build\x20review-rail\x20mode\x20(v53\x20templates).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20review_mode\x20applies.'),'reward_funding':z['string']()['optional']()['describe']('Review\x20reward\x20pool\x20funding,\x20smallest-unit\x20string.\x20Required\x20by\x20template_generate/migration_apply\x20when\x20the\x20effective\x20review\x20mode\x20is\x20review_reward\x20(INV-4:\x20the\x20incentive\x20must\x20be\x20funded\x20at\x20build\x20time).'),'log':z['record'](z['string'](),z['unknown']())['optional']()['describe']('A\x20prior\x20MigrationLog\x20(required\x20for\x20migration_review).'),'network':z['enum'](['testnet','mainnet'])['optional']()['describe']('Target\x20network\x20for\x20migration_import\x20/\x20migration_apply\x20(default\x20testnet;\x20mainnet\x20requires\x20explicit\x20user\x20confirmation).')})['strict']();const ScanSummarySchema=z['object']({'risk_level':z['enum'](['low','medium','high','critical']),'passed':z['boolean'](),'finding_count':z['number'](),'findings_by_severity':z['record'](z['string'](),z['number']())['describe']('Finding\x20count\x20keyed\x20by\x20severity.'),'findings':z['array'](TemplateScanFindingSchema)['describe']('Every\x20finding\x20with\x20its\x20rule\x20id,\x20detail\x20and\x20suggestion.'),'red_flags':z['array'](z['string']())})['describe']('Pre-deploy\x20scan\x20summary\x20(generation/apply\x20only\x20runs\x20when\x20passed).');export const BenchmarkMigrationOutputSchema=z['object']({'result':z['discriminatedUnion']('action',[z['object']({'action':z['literal']('template_list'),'count':z['number']()['describe']('Number\x20of\x20templates\x20returned.'),'templates':z['array'](TemplateSummarySchema)['describe']('Template\x20listing\x20rows.'),'load_errors':z['array'](z['string']())['describe']('Template\x20files\x20that\x20failed\x20to\x20load/validate\x20(never\x20silently\x20dropped).')}),z['object']({'action':z['literal']('template_get'),'template':z['record'](z['string'](),z['unknown']())['describe']('Full\x20template\x20object\x20(machine_shape/guards/allocator/fee_params/body/...).')}),z['object']({'action':z['literal']('template_generate'),'template_id':z['string'](),'scan':ScanSummarySchema,'plan':z['record'](z['string'](),z['unknown']())['describe']('Creation\x20plan\x20from\x20the\x20merchant-guide\x20pipeline\x20(never\x20executed\x20on-chain).'),'verdict':z['object']({'buildable':z['boolean'](),'blockers':z['array'](z['string']())})['describe']('Single\x20aggregate\x20ruling\x20over\x20the\x20three\x20signal\x20faces\x20(scan.passed\x20/\x20plan.graph_validation.valid\x20/\x20plan.audit.blocking)\x20—\x20the\x20authoritative\x20go/no-go\x20(bkmn-261012\x20F-M62);\x20the\x20individual\x20faces\x20stay\x20advisory.'),'next_action':z['string']()['describe']('Top-level\x20forwarding\x20of\x20the\x20materialization\x20contract\x20(C6):\x20the\x20guide\x27s\x20\x27Plan\x20ready.\x20Materialize:\x20...\x27\x20text\x20verbatim\x20when\x20the\x20audit\x20is\x20clean;\x20a\x20BLOCKED\x20reroute\x20back\x20to\x20this\x20action\x20otherwise.')}),z['object']({'action':z['literal']('template_scan'),'scan':z['object']({'template_id':z['string'](),'risk_level':z['enum'](['low','medium','high','critical']),'passed':z['boolean'](),'findings':z['array'](TemplateScanFindingSchema),'red_flags':z['array'](z['string']())})['describe']('Full\x20pre-deploy\x20scan\x20result.')}),z['object']({'action':z['literal']('migration_import'),'log':MigrationLogSchema['describe']('The\x20structured\x20migration\x20log.'),'next_action':z['string']()['describe']('Next\x20chain\x20step:\x20run\x20migration_review\x20with\x20this\x20log\x20(C6\x20—\x20the\x20chain\x20is\x20self-describing,\x20no\x20agent\x20re-exploration).')}),z['object']({'action':z['literal']('migration_review'),'log':MigrationLogSchema['describe']('The\x20migration\x20log\x20under\x20review.'),'review_summary':z['object']({'mapped_count':z['number'](),'unmapped_count':z['number'](),'manual_review_count':z['number'](),'risk_passed':z['boolean']()})['describe']('Counts\x20+\x20risk\x20status\x20for\x20the\x20confirmation\x20screen.'),'next_action':z['string']()['describe']('Next\x20chain\x20step:\x20migration_apply\x20with\x20the\x20matched\x20template\x20when\x20the\x20review\x20is\x20clean;\x20surface\x20the\x20unmapped/manual_review\x20items\x20for\x20a\x20user\x20decision\x20otherwise.')}),z['object']({'action':z['literal']('migration_apply'),'template_id':z['string'](),'network':z['enum'](['testnet','mainnet']),'scan':ScanSummarySchema,'plan':z['record'](z['string'](),z['unknown']())['describe']('Creation\x20plan\x20from\x20the\x20merchant-guide\x20pipeline\x20(never\x20executed\x20on-chain).'),'verdict':z['object']({'buildable':z['boolean'](),'blockers':z['array'](z['string']())})['describe']('Single\x20aggregate\x20ruling\x20over\x20the\x20three\x20signal\x20faces\x20(scan.passed\x20/\x20plan.graph_validation.valid\x20/\x20plan.audit.blocking)\x20—\x20the\x20authoritative\x20go/no-go\x20(bkmn-261012\x20F-M62);\x20the\x20individual\x20faces\x20stay\x20advisory.'),'next_action':z['string']()['describe']('Top-level\x20forwarding\x20of\x20the\x20materialization\x20contract\x20(C6):\x20the\x20guide\x27s\x20\x27Plan\x20ready.\x20Materialize:\x20...\x27\x20text\x20verbatim\x20when\x20the\x20audit\x20is\x20clean;\x20a\x20BLOCKED\x20reroute\x20back\x20to\x20this\x20action\x20otherwise.')})])})['strict']();
|
|
1
|
+
import{z}from'zod';import{GuardResolutionInputSchema}from'../goal/planning.js';const TemplateSummarySchema=z['object']({'id':z['string']()['describe']('Template\x20id\x20\x27<industry>/<variant>\x27,\x20e.g.\x20\x27retail/scale-marketplace\x27.'),'industry':z['string']()['describe']('Industry\x20vertical.'),'variant':z['string']()['describe']('Business-model\x20variant\x20slug.'),'product_ref':z['string']()['optional']()['describe']('Benchmark\x20product\x20slug\x20this\x20archetype\x20models\x20(e.g.\x20\x27amazon\x27).\x20The\x20only\x20sanctioned\x20company\x20name;\x20users\x20can\x20pick\x20a\x20template\x20by\x20naming\x20the\x20incumbent\x20product.'),'archetype':z['enum'](['leader','challenger']),'key_risk':z['string']()['describe']('Primary\x20risk\x20this\x20template\x20mitigates.'),'node_count':z['number']()['describe']('Machine\x20node\x20count.'),'guard_count':z['number']()['describe']('Guard\x20template\x20count.'),'recommended_role':z['enum'](['merchant','supplier','both'])})['describe']('Compact\x20template\x20listing\x20row.'),TemplateScanFindingSchema=z['object']({'rule_id':z['string']()['optional']()['describe']('Rule\x20id\x20when\x20known\x20(e.g.\x20\x27R-M3-01\x27,\x20\x27R1\x27).'),'severity':z['enum'](['low','medium','high','critical']),'title':z['string'](),'detail':z['string'](),'suggestion':z['string']()})['describe']('One\x20pre-deploy\x20risk\x20finding.'),MigrationEntrySchema=z['object']({'source_element':z['string']()['describe']('Competitor-side\x20element.'),'target_object':z['string']()['optional']()['describe']('WoWok\x20object/mechanism\x20it\x20maps\x20to.'),'mapping_note':z['string']()['describe']('One-line\x20mapping\x20explanation.'),'reason':z['string']()['optional']()['describe']('Why\x20it\x20cannot\x20be\x20migrated,\x20or\x20why\x20it\x20needs\x20a\x20decision.')})['describe']('One\x20competitor\x20element\x20and\x20its\x20WoWok\x20mapping\x20outcome.'),MigrationLogSchema=z['object']({'source':z['object']({'url':z['string']()['optional'](),'description':z['string'](),'detected_industry':z['string'](),'matched_template':z['string']()['describe']('Matched\x20template\x20id\x20\x27<industry>/<variant>\x27.')})['describe']('Migration\x20source\x20provenance.'),'mapped':z['array'](MigrationEntrySchema)['describe']('Elements\x20that\x20map\x20cleanly\x20to\x20WoWok\x20objects.'),'unmapped':z['array'](MigrationEntrySchema)['describe']('Elements\x20that\x20cannot\x20be\x20migrated,\x20with\x20reasons.'),'manual_review':z['array'](MigrationEntrySchema)['describe']('Elements\x20requiring\x20an\x20explicit\x20user\x20decision.'),'wowok_advantages':z['array'](z['string']())['describe']('WoWok\x20platform\x20advantages\x20surfaced\x20during\x20migration.'),'customizable_modules':z['array'](z['string']())['describe']('Business-module\x20ids\x20the\x20user\x20can\x20customize.'),'role_assessment':z['object']({'recommended':z['string'](),'rationale':z['string'](),'alternatives':z['array'](z['string']())})['describe']('Merchant\x20vs\x20supplier\x20role\x20assessment.'),'risk_check':z['object']({'passed':z['boolean'](),'findings':z['array'](z['string']())})['describe']('Dry-run\x20risk\x20check\x20against\x20the\x20matched\x20template.'),'network':z['enum'](['testnet','mainnet'])['describe']('Target\x20network\x20(default\x20testnet).')})['describe']('Structured\x20competitor-migration\x20log.'),SaleItemIncentiveSchema=z['object']({'amount':z['string']()['describe']('Incentive\x20amount\x20as\x20a\x20buyer-readable\x20string\x20(e.g.\x20\x225\x20USDC\x22\x20or\x20\x221000000000\x20WOW\x20smallest\x20units\x22).\x20Quote-time\x20disclosure\x20only\x20—\x20fund\x20the\x20actual\x20rail\x20separately\x20(e.g.\x20the\x20template\x27s\x20review_reward_pool).'),'conditions':z['string']()['describe']('What\x20the\x20buyer\x20must\x20do\x20to\x20earn\x20it\x20(e.g.\x20\x22leave\x20a\x20written\x20+\x20rated\x20review\x20of\x20the\x20delivered\x20work\x22).\x20Must\x20be\x20perceptible\x20BEFORE\x20the\x20order\x20is\x20placed.'),'basis':z['string']()['describe']('Accrual\x20scope:\x20\x22per-order\x22\x20/\x20\x22once-per-buyer\x22\x20/\x20\x22once-per-buyer-per-order\x22.\x20Matches\x20the\x20claim\x20guard\x27s\x20replay\x20semantics\x20—\x20a\x20recipient-only\x20gate\x20is\x20once-per-buyer-for-life,\x20an\x20order-scoped\x20stamp\x20is\x20per-order\x20(SV-2).'),'claim_window':z['string']()['describe']('How\x20long\x20the\x20buyer\x20has\x20to\x20claim\x20(e.g.\x20\x2214\x20days\x20from\x20the\x20review\x22).\x20Mirror\x20the\x20reward\x20claim\x20guard\x27s\x20window\x20fee_param\x20so\x20the\x20quote\x20never\x20promises\x20more\x20than\x20the\x20rail\x20pays.')})['strict']()['describe']('Optional\x20structured\x20incentive\x20for\x20one\x20sale\x20item\x20(G-07):\x20buyer-perceivable\x20reward\x20terms\x20carried\x20to\x20the\x20compiled\x20plan\x20for\x20quote-time\x20disclosure.\x20DECLARATION\x20ONLY\x20—\x20the\x20chain\x20SaleItem\x20has\x20no\x20such\x20field;\x20the\x20actual\x20payout\x20rail\x20is\x20configured\x20separately.'),SaleItemPlanSchema=z['object']({'incentive':SaleItemIncentiveSchema['optional']()})['passthrough']()['describe']('One\x20sellable\x20SKU\x20in\x20the\x20plan\x20catalog:\x20the\x20chain\x20SaleItem\x20fields\x20plus\x20the\x20optional\x20structured\x20`incentive`\x20declaration\x20(G-07).\x20Unknown\x20keys\x20pass\x20through\x20so\x20chain-side\x20fields\x20can\x20evolve\x20without\x20schema\x20changes.');export const BenchmarkMigrationSchema=z['object']({'action':z['enum'](['template_list','template_get','template_generate','template_scan','migration_import','migration_review','migration_apply'])['describe']('Action:\x20\x27template_list\x27\x20=\x20list\x20the\x20loaded\x20MD\x20industry\x20templates\x20(optional\x20industry\x20filter);\x20'+'\x27template_get\x27\x20=\x20fetch\x20one\x20template\x20by\x20id\x20(template_id\x20required);\x20'+'\x27template_generate\x27\x20=\x20generate\x20a\x20creation\x20plan\x20from\x20a\x20template\x20via\x20the\x20merchant-guide\x20'+'pipeline\x20(template_id\x20required;\x20scan-first\x20—\x20CRITICAL\x20findings\x20block;\x20never\x20executes\x20on-chain);\x20'+'\x27template_scan\x27\x20=\x20pre-deploy\x20risk\x20scan\x20of\x20one\x20template\x20(template_id\x20required;\x20returns\x20'+'risk_level/findings/red_flags\x20plus\x20a\x20drift\x20face\x20—\x20disk-vs-catalog\x20provenance\x20of\x20the\x20'+'scanned\x20body;\x20CRITICAL\x20blocks\x20generation/apply);\x20'+'\x27migration_import\x27\x20=\x20competitor\x20URL/description\x20→\x20migration\x20plan\x20+\x20MigrationLog\x20'+'(description\x20required);\x20'+'\x27migration_review\x27\x20=\x20surface\x20the\x20MigrationLog\x20for\x20user\x20confirmation\x20(log\x20required);\x20'+'\x27migration_apply\x27\x20=\x20run\x20the\x20approved\x20template\x20through\x20the\x20merchant-guide\x20pipeline\x20'+'(template_id\x20required;\x20scan-first\x20—\x20CRITICAL\x20findings\x20block;\x20default\x20network\x20testnet).'),'template_id':z['string']()['optional']()['describe']('Template\x20id\x20\x27<industry>/<variant>\x27\x20(required\x20for\x20template_get\x20/\x20template_generate\x20/\x20template_scan\x20/\x20migration_apply),\x20e.g.\x20\x27retail/scale-marketplace\x27.'),'industry':z['string']()['optional']()['describe']('Industry\x20filter\x20for\x20template_list;\x20industry\x20hint\x20for\x20migration_import.\x20'+'Any\x20registered\x20industry\x20is\x20accepted\x20(builtin:\x20freelance,\x20rental,\x20education,\x20'+'travel,\x20subscription,\x20retail;\x20plus\x20custom\x20industries\x20registered\x20via\x20industry\x20packs).\x20'+'Aliases\x20are\x20resolved\x20(e.g.\x20\x27ecommerce\x27\x20→\x20\x27retail\x27).'),'description':z['string']()['optional']()['describe']('Natural-language\x20business/competitor\x20description\x20(required\x20for\x20migration_import;\x20used\x20by\x20template_generate\x20as\x20the\x20intent\x20text).'),'url':z['string']()['optional']()['describe']('Competitor\x20store/profile\x20URL\x20for\x20migration_import\x20(recorded\x20as\x20provenance\x20only).'),'fee_overrides':z['record'](z['string'](),z['union']([z['number'](),z['string']()]))['optional']()['describe']('Template\x20fee-parameter\x20overrides\x20for\x20template_generate\x20(e.g.\x20commission_rate_bps).'),'guard_resolutions':z['record'](z['string'](),GuardResolutionInputSchema)['optional']()['describe']('Judgment-layer\x20resolutions\x20for\x20pending\x20guard\x20designs\x20(C6-DEEP),\x20keyed\x20by\x20plan.pending_guard_designs[].key.\x20'+'A\x20blocked\x20migration_apply/template_generate\x20lists\x20every\x20unresolved\x20design\x20—\x20resolve\x20each\x20here\x20'+'(kind\x20\x27inline\x27\x20with\x20the\x20Guard\x20table+root,\x20or\x20kind\x20\x27template\x27\x20with\x20a\x20tpl_*\x20id)\x20and\x20re-run\x20the\x20action.\x20'+'Advisory\x20designs\x20that\x20do\x20not\x20apply\x20to\x20this\x20shop\x20may\x20be\x20resolved\x20with\x20{kind:\x27omit\x27}\x20instead\x20'+'(run75747\x20F-38:\x20honored\x20only\x20for\x20designs\x20with\x20no\x20inbound\x20binding;\x20an\x20omit\x20of\x20a\x20bound\x20design\x20'+'is\x20refused\x20with\x20GUARD_OMIT_UNSUPPORTED).\x20'+'The\x20audit\x20freeze\x20gate\x20still\x20decides:\x20resolutions\x20only\x20unblock\x20a\x20plan\x20whose\x20closed\x20audit\x20is\x20clean.'),'review_mode':z['enum'](['review','review_reward','none'])['optional']()['describe']('Per-build\x20review-rail\x20mode\x20(v53\x20templates).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20review_mode\x20applies.'),'reward_funding':z['string']()['optional']()['describe']('Review\x20reward\x20pool\x20funding,\x20smallest-unit\x20string.\x20Required\x20by\x20template_generate/migration_apply\x20when\x20the\x20effective\x20review\x20mode\x20is\x20review_reward\x20(INV-4:\x20the\x20incentive\x20must\x20be\x20funded\x20at\x20build\x20time).'),'after_sales_mode':z['enum'](['return','exchange','warranty','none'])['optional']()['describe']('Per-build\x20after-sales\x20mode\x20(D12\x20重构\x204).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20after_sales_mode\x20applies.\x20Declaring\x20a\x20mode\x20with\x20no\x20backing\x20rail\x20in\x20machine_shape\x20is\x20a\x20compile\x20blocker\x20(AFTER_SALES_RAIL_MISSING).'),'acceptance_mode':z['enum'](['milestone','contest','bounty','agent','none'])['optional']()['describe']('Per-build\x20acceptance/judging\x20mode\x20(D12\x20重构\x202).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20acceptance_mode\x20applies.\x20A\x20judge-decided\x20mode\x20(contest/bounty/agent)\x20without\x20arbitration_mode\x20\x27third_party\x27\x20is\x20a\x20compile\x20blocker\x20(ACCEPTANCE_JUDGE_NOT_INDEPENDENT);\x20a\x20finite\x20revision_rounds_max\x20with\x20no\x20counter\x20Repository\x20guard\x20is\x20a\x20compile\x20blocker\x20(ACCEPTANCE_REVISION_UNBOUNDED).'),'installment_mode':z['enum'](['deposit_balance','milestone_n','none'])['optional']()['describe']('Per-build\x20installment/deposit\x20mode\x20(D12\x20重构\x203).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20installment_mode\x20applies.\x20A\x20capture\x20forward\x20with\x20no\x20fund-gate\x20Guard\x20is\x20a\x20compile\x20blocker\x20(INSTALLMENT_FUNDING_UNGATED);\x20a\x20deposit-held\x20state\x20with\x20no\x20exit\x20rail\x20is\x20a\x20compile\x20blocker\x20(INSTALLMENT_DEPOSIT_STRANDED).'),'affiliate_mode':z['enum'](['commission','none'])['optional']()['describe']('Per-build\x20affiliate\x20commission\x20overlay\x20(D12\x20批\x205).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20affiliate_mode\x20applies.\x20A\x20declared\x20commission\x20overlay\x20with\x20no\x20commission\x20rail\x20is\x20a\x20compile\x20blocker\x20(AFFILIATE_RAIL_MISSING);\x20a\x20commission\x20with\x20no\x20post-lock\x20no-clawback\x20disclosure\x20build_note\x20is\x20a\x20compile\x20blocker\x20(AFFILIATE_CLAWBACK_UNDISCLOSED).'),'crowdfunding_mode':z['enum'](['threshold','flexible','none'])['optional']()['describe']('Per-build\x20crowdfunding\x20campaign\x20overlay\x20(D12\x20批\x207).\x20Absent\x20=\x20the\x20template\x27s\x20declared\x20crowdfunding_mode\x20applies.\x20A\x20declared\x20threshold/flexible\x20overlay\x20with\x20no\x20two-leg\x20escrow-exit\x20gate\x20(release\x20XOR\x20refund,\x20D-BUG-2)\x20is\x20a\x20compile\x20blocker\x20(CROWDFUNDING_THRESHOLD_GATE_MISSING);\x20a\x20threshold\x20gate\x20whose\x20aggregate\x20is\x20NOT\x20a\x20writer-bound\x20sum-where\x20(id_from\x20signer)\x20is\x20a\x20compile\x20blocker\x20(CROWDFUNDING_AGGREGATE_UNBOUND);\x20a\x20missing\x20L-04/L-01/L-05\x20disclosure\x20build_note\x20is\x20a\x20compile\x20blocker\x20(CROWDFUNDING_DISCLOSURE_MISSING).'),'sales':z['array'](SaleItemPlanSchema)['optional']()['describe']('The\x20sellable\x20SKU\x20catalog\x20(upwc-cat-261017\x20CAT-A1\x20/\x20PLAN-SALES-01).\x20Absent/empty\x20=\x20the\x20plan\x20ships\x20no\x20sales\x20step,\x20the\x20published\x20Service\x20freezes\x20with\x20sales:\x20[]\x20and\x20every\x20order_new\x20aborts\x20—\x20a\x20HIGH\x20audit\x20blocker.\x20Item\x20shape\x20follows\x20the\x20chain\x27s\x20SaleItem:\x20{\x20name,\x20price,\x20quantity?,\x20wip_hash?\x20}\x20with\x20price\x20in\x20smallest\x20units.\x20OPTIONAL\x20per\x20item:\x20a\x20structured\x20`incentive`\x20object\x20(G-07:\x20{\x20amount,\x20conditions,\x20basis,\x20claim_window\x20},\x20all\x20strings)\x20declaring\x20the\x20buyer-perceivable\x20reward\x20terms\x20—\x20carried\x20verbatim\x20into\x20the\x20compiled\x20plan\x27s\x20service_sales\x20step\x20for\x20quote-time\x20disclosure;\x20it\x20is\x20plan\x20metadata\x20only\x20and\x20never\x20an\x20on-chain\x20SaleItem\x20field.'),'log':z['record'](z['string'](),z['unknown']())['optional']()['describe']('A\x20prior\x20MigrationLog\x20(required\x20for\x20migration_review).'),'network':z['enum'](['testnet','mainnet'])['optional']()['describe']('Target\x20network\x20for\x20migration_import\x20/\x20migration_apply\x20(default\x20testnet;\x20mainnet\x20requires\x20explicit\x20user\x20confirmation).')})['strict']();const ScanSummarySchema=z['object']({'risk_level':z['enum'](['low','medium','high','critical']),'passed':z['boolean'](),'finding_count':z['number'](),'findings_by_severity':z['record'](z['string'](),z['number']())['describe']('Finding\x20count\x20keyed\x20by\x20severity.'),'findings':z['array'](TemplateScanFindingSchema)['describe']('Every\x20finding\x20with\x20its\x20rule\x20id,\x20detail\x20and\x20suggestion.'),'red_flags':z['array'](z['string']())})['describe']('Pre-deploy\x20scan\x20summary\x20(generation/apply\x20only\x20runs\x20when\x20passed).');export const BenchmarkMigrationOutputSchema=z['object']({'result':z['discriminatedUnion']('action',[z['object']({'action':z['literal']('template_list'),'count':z['number']()['describe']('Number\x20of\x20templates\x20returned.'),'templates':z['array'](TemplateSummarySchema)['describe']('Template\x20listing\x20rows.'),'load_errors':z['array'](z['string']())['describe']('Template\x20files\x20that\x20failed\x20to\x20load/validate\x20(never\x20silently\x20dropped).')}),z['object']({'action':z['literal']('template_get'),'template':z['record'](z['string'](),z['unknown']())['describe']('Full\x20template\x20object\x20(machine_shape/guards/allocator/fee_params/body/...).')}),z['object']({'action':z['literal']('template_generate'),'template_id':z['string'](),'scan':ScanSummarySchema,'plan':z['record'](z['string'](),z['unknown']())['describe']('Creation\x20plan\x20from\x20the\x20merchant-guide\x20pipeline\x20(never\x20executed\x20on-chain).'),'verdict':z['object']({'buildable':z['boolean'](),'blockers':z['array'](z['string']())})['describe']('Single\x20aggregate\x20ruling\x20over\x20the\x20three\x20signal\x20faces\x20(scan.passed\x20/\x20plan.graph_validation.valid\x20/\x20plan.audit.blocking)\x20—\x20the\x20authoritative\x20go/no-go\x20(bkmn-261012\x20F-M62);\x20the\x20individual\x20faces\x20stay\x20advisory.'),'next_action':z['string']()['describe']('Top-level\x20forwarding\x20of\x20the\x20materialization\x20contract\x20(C6):\x20the\x20guide\x27s\x20\x27Plan\x20ready.\x20Materialize:\x20...\x27\x20text\x20verbatim\x20when\x20the\x20audit\x20is\x20clean;\x20a\x20BLOCKED\x20reroute\x20back\x20to\x20this\x20action\x20otherwise.')}),z['object']({'action':z['literal']('template_scan'),'scan':z['object']({'template_id':z['string'](),'risk_level':z['enum'](['low','medium','high','critical']),'passed':z['boolean'](),'findings':z['array'](TemplateScanFindingSchema),'red_flags':z['array'](z['string']())})['describe']('Full\x20pre-deploy\x20scan\x20result.')}),z['object']({'action':z['literal']('migration_import'),'log':MigrationLogSchema['describe']('The\x20structured\x20migration\x20log.'),'next_action':z['string']()['describe']('Next\x20chain\x20step:\x20run\x20migration_review\x20with\x20this\x20log\x20(C6\x20—\x20the\x20chain\x20is\x20self-describing,\x20no\x20agent\x20re-exploration).')}),z['object']({'action':z['literal']('migration_review'),'log':MigrationLogSchema['describe']('The\x20migration\x20log\x20under\x20review.'),'review_summary':z['object']({'mapped_count':z['number'](),'unmapped_count':z['number'](),'manual_review_count':z['number'](),'risk_passed':z['boolean']()})['describe']('Counts\x20+\x20risk\x20status\x20for\x20the\x20confirmation\x20screen.'),'next_action':z['string']()['describe']('Next\x20chain\x20step:\x20migration_apply\x20with\x20the\x20matched\x20template\x20when\x20the\x20review\x20is\x20clean;\x20surface\x20the\x20unmapped/manual_review\x20items\x20for\x20a\x20user\x20decision\x20otherwise.')}),z['object']({'action':z['literal']('migration_apply'),'template_id':z['string'](),'network':z['enum'](['testnet','mainnet']),'scan':ScanSummarySchema,'plan':z['record'](z['string'](),z['unknown']())['describe']('Creation\x20plan\x20from\x20the\x20merchant-guide\x20pipeline\x20(never\x20executed\x20on-chain).'),'verdict':z['object']({'buildable':z['boolean'](),'blockers':z['array'](z['string']())})['describe']('Single\x20aggregate\x20ruling\x20over\x20the\x20three\x20signal\x20faces\x20(scan.passed\x20/\x20plan.graph_validation.valid\x20/\x20plan.audit.blocking)\x20—\x20the\x20authoritative\x20go/no-go\x20(bkmn-261012\x20F-M62);\x20the\x20individual\x20faces\x20stay\x20advisory.'),'next_action':z['string']()['describe']('Top-level\x20forwarding\x20of\x20the\x20materialization\x20contract\x20(C6):\x20the\x20guide\x27s\x20\x27Plan\x20ready.\x20Materialize:\x20...\x27\x20text\x20verbatim\x20when\x20the\x20audit\x20is\x20clean;\x20a\x20BLOCKED\x20reroute\x20back\x20to\x20this\x20action\x20otherwise.')})])})['strict']();
|
|
@@ -29,7 +29,8 @@ export declare const CallAllocation_CreateSchema: z.ZodObject<{
|
|
|
29
29
|
Rate: "Rate";
|
|
30
30
|
RateGross: "RateGross";
|
|
31
31
|
Amount: "Amount";
|
|
32
|
-
|
|
32
|
+
Formula: "Formula";
|
|
33
|
+
}>, z.ZodPipe<z.ZodNumber, z.ZodTransform<"Surplus" | "Rate" | "RateGross" | "Amount" | "Formula", number>>]>;
|
|
33
34
|
}, z.core.$strip>>;
|
|
34
35
|
fix: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
35
36
|
max: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodNull]>>;
|
|
@@ -48,6 +49,13 @@ export declare const CallAllocation_CreateSchema: z.ZodObject<{
|
|
|
48
49
|
}, z.core.$strip>;
|
|
49
50
|
allow_unanchored: z.ZodOptional<z.ZodBoolean>;
|
|
50
51
|
}, z.core.$strict>;
|
|
52
|
+
export declare const FormulaSpecSchema: z.ZodObject<{
|
|
53
|
+
repo: z.ZodString;
|
|
54
|
+
key: z.ZodString;
|
|
55
|
+
selector: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
|
|
56
|
+
predicate: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
57
|
+
ids: z.ZodArray<z.ZodString>;
|
|
58
|
+
}, z.core.$strict>;
|
|
51
59
|
export declare const CallAllocation_OperateSchema: z.ZodObject<{
|
|
52
60
|
object: z.ZodString;
|
|
53
61
|
received_coins: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -63,6 +71,17 @@ export declare const CallAllocation_OperateSchema: z.ZodObject<{
|
|
|
63
71
|
}, z.core.$strict>>;
|
|
64
72
|
}, z.core.$strict>, z.ZodLiteral<"recently">]>>;
|
|
65
73
|
alloc_by_guard: z.ZodOptional<z.ZodString>;
|
|
74
|
+
formula_spec_set: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
allocator_index: z.ZodNumber;
|
|
76
|
+
slot_index: z.ZodNumber;
|
|
77
|
+
spec: z.ZodObject<{
|
|
78
|
+
repo: z.ZodString;
|
|
79
|
+
key: z.ZodString;
|
|
80
|
+
selector: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
|
|
81
|
+
predicate: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
82
|
+
ids: z.ZodArray<z.ZodString>;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
}, z.core.$strict>>;
|
|
66
85
|
}, z.core.$strict>;
|
|
67
86
|
export declare const CallAllocation_DataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
68
87
|
object: z.ZodObject<{
|
|
@@ -94,7 +113,8 @@ export declare const CallAllocation_DataSchema: z.ZodUnion<readonly [z.ZodObject
|
|
|
94
113
|
Rate: "Rate";
|
|
95
114
|
RateGross: "RateGross";
|
|
96
115
|
Amount: "Amount";
|
|
97
|
-
|
|
116
|
+
Formula: "Formula";
|
|
117
|
+
}>, z.ZodPipe<z.ZodNumber, z.ZodTransform<"Surplus" | "Rate" | "RateGross" | "Amount" | "Formula", number>>]>;
|
|
98
118
|
}, z.core.$strip>>;
|
|
99
119
|
fix: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
100
120
|
max: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodNull]>>;
|
|
@@ -127,6 +147,17 @@ export declare const CallAllocation_DataSchema: z.ZodUnion<readonly [z.ZodObject
|
|
|
127
147
|
}, z.core.$strict>>;
|
|
128
148
|
}, z.core.$strict>, z.ZodLiteral<"recently">]>>;
|
|
129
149
|
alloc_by_guard: z.ZodOptional<z.ZodString>;
|
|
150
|
+
formula_spec_set: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
allocator_index: z.ZodNumber;
|
|
152
|
+
slot_index: z.ZodNumber;
|
|
153
|
+
spec: z.ZodObject<{
|
|
154
|
+
repo: z.ZodString;
|
|
155
|
+
key: z.ZodString;
|
|
156
|
+
selector: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
|
|
157
|
+
predicate: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
158
|
+
ids: z.ZodArray<z.ZodString>;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
}, z.core.$strict>>;
|
|
130
161
|
}, z.core.$strict>]>;
|
|
131
162
|
export declare const CallAllocation_InputSchema: z.ZodObject<{
|
|
132
163
|
data: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -159,7 +190,8 @@ export declare const CallAllocation_InputSchema: z.ZodObject<{
|
|
|
159
190
|
Rate: "Rate";
|
|
160
191
|
RateGross: "RateGross";
|
|
161
192
|
Amount: "Amount";
|
|
162
|
-
|
|
193
|
+
Formula: "Formula";
|
|
194
|
+
}>, z.ZodPipe<z.ZodNumber, z.ZodTransform<"Surplus" | "Rate" | "RateGross" | "Amount" | "Formula", number>>]>;
|
|
163
195
|
}, z.core.$strip>>;
|
|
164
196
|
fix: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
165
197
|
max: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodNull]>>;
|
|
@@ -192,6 +224,17 @@ export declare const CallAllocation_InputSchema: z.ZodObject<{
|
|
|
192
224
|
}, z.core.$strict>>;
|
|
193
225
|
}, z.core.$strict>, z.ZodLiteral<"recently">]>>;
|
|
194
226
|
alloc_by_guard: z.ZodOptional<z.ZodString>;
|
|
227
|
+
formula_spec_set: z.ZodOptional<z.ZodObject<{
|
|
228
|
+
allocator_index: z.ZodNumber;
|
|
229
|
+
slot_index: z.ZodNumber;
|
|
230
|
+
spec: z.ZodObject<{
|
|
231
|
+
repo: z.ZodString;
|
|
232
|
+
key: z.ZodString;
|
|
233
|
+
selector: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>;
|
|
234
|
+
predicate: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
235
|
+
ids: z.ZodArray<z.ZodString>;
|
|
236
|
+
}, z.core.$strict>;
|
|
237
|
+
}, z.core.$strict>>;
|
|
195
238
|
}, z.core.$strict>]>;
|
|
196
239
|
env: z.ZodOptional<z.ZodObject<{
|
|
197
240
|
account: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from'zod';import{CoinParamSchema,CallEnvSchema,SubmissionCallSchema,TypeNamedObjectSchema}from'./base.js';import{AllocatorsSchema,PaymentInfoSchema}from'../query/index.js';import{NameOrAddressSchema,ReceivedBalanceOrRecentlySchema,RECEIVE_FORMAT_BLOCK_BALANCE}from'../common/index.js';export const CallAllocation_CreateSchema=z['object']({'object':TypeNamedObjectSchema['describe']('REQUIRED\x20for\x20creating\x20new\x20object.\x20Provide\x20{name:\x20\x27yourName\x27,\x20type:\x20\x27Allocation\x27}\x20to\x20create\x20and\x20name\x20the\x20new\x20Allocation\x20object.'),'allocators':AllocatorsSchema,'coin':CoinParamSchema,'payment_info':PaymentInfoSchema,'allow_unanchored':z['boolean']()['optional']()['describe']('docs#11\x20escape\x20hatch:\x20explicitly\x20allow\x20creating\x20an\x20Allocation\x20whose\x20payment_info\x20has\x20NO\x20for_object\x20anchor\x20while\x20any\x20sharing\x20row\x20uses\x20a\x20GuardIdentifier\x20recipient.\x20'+'Unanchored\x20+\x20GuardIdentifier\x20lets\x20any\x20guard-passing\x20caller\x20redirect\x20the\x20submitted\x20payout\x20address\x20to\x20an\x20arbitrary\x20address\x20—\x20'+'anchor\x20it\x20with\x20payment_info.for_object\x20instead.\x20Set\x20true\x20ONLY\x20after\x20the\x20user\x20explicitly\x20accepts\x20that\x20risk.\x20Default:\x20blocked.')})['strict']()['describe']('Create\x20a\x20new\x20Allocation\x20object.\x20Set\x20\x27object\x27\x20field\x20with\x20{name:\x20\x27yourName\x27,\x20type:\x20\x27Allocation\x27}\x20to\x20name\x20the\x20new\x20object.\x20Notice:\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.');export const CallAllocation_OperateSchema=z['object']({'object':NameOrAddressSchema['describe']('REQUIRED\x20for\x20operating\x20existing\x20object.\x20Provide\x20the\x20Allocation\x20object\x20ID\x20or\x20existing\x20name\x20to\x20reference\x20the\x20target\x20object.'),'received_coins':ReceivedBalanceOrRecentlySchema['optional']()['describe']('Unwrap\x20the\x20CoinWrapper\x20objects\x20received\x20by\x20the\x20Allocation\x20object\x20and\x20deposit\x20them\x20into\x20the\x20pending\x20allocation\x20balance.'+RECEIVE_FORMAT_BLOCK_BALANCE),'alloc_by_guard':NameOrAddressSchema['optional']()['describe']('Verify\x20the\x20specified\x20Guard\x20and\x20execute\x20the\x20corresponding\x20fund\x20distribution.\x20'+'GENERIC\x20SEMANTICS:\x20an\x20Allocation\x20distributes\x20whatever\x20balance\x20it\x20holds\x20—\x20order\x20funds,\x20payroll,\x20dividends,\x20bounties.\x20'+'It\x20defines\x20no\x20scenario-specific\x20rule:\x20eligibility\x20(including\x20issuer\x20identity\x20for\x20standalone\x20use,\x20e.g.\x20an\x20org\x20admin)\x20'+'and\x20differentiation\x20inputs\x20are\x20expressed\x20as\x20Guard\x20constraints,\x20all\x20public\x20and\x20auditable.\x20'+'RECIPIENT\x20RESOLUTION\x20(Recipient\x20enum):\x20'+'Entity\x20→\x20fixed\x20address;\x20Signer\x20→\x20transaction\x20sender;\x20GuardIdentifier\x20n\x20→\x20the\x20address\x20submitted\x20for\x20identifier\x20n\x20(resolved\x20from\x20the\x20passport\x27s\x20submission\x20record).\x20'+'ORDER\x20PATTERN\x20(canonical):\x20the\x20Guard\x20table\x20needs\x20ONE\x20submitted\x20Order,\x20constrained\x20by\x20the\x20Guard\x20(e.g.\x20order.service\x20==\x20host\x20service,\x20'+'progress\x20at\x20a\x20qualifying\x20node,\x20signer\x20==\x20order.owner);\x20that\x20order\x20submission\x20IS\x20the\x20recipient\x20slot.\x20Whoever\x20triggers\x20the\x20distribution,\x20funds\x20necessarily\x20'+'land\x20at\x20an\x20Order\x20OBJECT;\x20delivered\x20CoinWrappers\x20are\x20owned\x20by\x20the\x20order\x20and\x20can\x20be\x20extracted\x20only\x20by\x20the\x20Order\x20object\x20itself\x20'+'(Wow\x20ownership)\x20—\x20the\x20coins\x20then\x20go\x20to\x20the\x20order\x27s\x20current\x20owner.\x20Object\x20receipt\x20=\x20owner\x20receipt.\x20'+'POST-DISTRIBUTION\x20CLAIM\x20(required\x20step):\x20each\x20recipient\x20gets\x20a\x20CoinWrapper\x20(not\x20spendable\x20coins)\x20—\x20EOA\x20wallet\x20→\x20operation_type=\x27payment\x27\x20RECEIVE\x20mode\x20'+'{object:\x27<coinwrapper_id>\x27,\x20receive:true};\x20Order\x20object\x20→\x20operation_type=\x27order\x27\x20{object:\x27<order_id>\x27,\x20receive:\x27recently\x27};\x20Treasury\x20object\x20→\x20treasury\x20receive.\x20'+'Find\x20pending\x20CoinWrappers\x20via\x20query_toolkit\x20query_type=\x27onchain_received\x27;\x20verify\x20via\x20the\x20immutable\x20Payment\x20object\x20(allocation.payment\x20array).\x20'+'RISK:\x20safety\x20follows\x20from\x20the\x20sufficiency\x20of\x20the\x20Guard\x20constraints,\x20not\x20the\x20recipient\x20form\x20—\x20analyze\x20the\x20recipient\x20constraint\x20audit\x20before\x20publish;\x20'+'structural\x20residuals\x20(unavoidable):\x20permissionless\x20alloc\x20allows\x20forced\x20settlement\x20timing,\x20the\x20submitted\x20order\x20is\x20not\x20bound\x20to\x20the\x20settled\x20allocation,\x20'+'and\x20allocators/guards\x20are\x20immutable\x20after\x20publish.')})['strict']()['describe']('Operate\x20on\x20an\x20existing\x20Allocation\x20object.\x20Set\x20\x27object\x27\x20field\x20with\x20the\x20object\x20ID\x20or\x20existing\x20name\x20to\x20specify\x20the\x20target.');export const CallAllocation_DataSchema=z['union']([CallAllocation_CreateSchema,CallAllocation_OperateSchema])['describe']('On-chain\x20Allocation\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Use\x20CallAllocation_CreateSchema\x20by\x20setting\x20\x27object\x27\x20with\x20OBJECT\x20format\x20{name,\x20type_parameter,\x20...}.\x20(2)\x20OPERATE\x20EXISTING:\x20Use\x20CallAllocation_OperateSchema\x20by\x20setting\x20\x27object\x27\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20');export const CallAllocation_InputSchema=z['object']({'data':CallAllocation_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
|
|
1
|
+
import{z}from'zod';import{CoinParamSchema,CallEnvSchema,SubmissionCallSchema,TypeNamedObjectSchema}from'./base.js';import{AllocatorsSchema,PaymentInfoSchema,RepositoryDataWhereSchema}from'../query/index.js';import{NameOrAddressSchema,ReceivedBalanceOrRecentlySchema,RECEIVE_FORMAT_BLOCK_BALANCE}from'../common/index.js';export const CallAllocation_CreateSchema=z['object']({'object':TypeNamedObjectSchema['describe']('REQUIRED\x20for\x20creating\x20new\x20object.\x20Provide\x20{name:\x20\x27yourName\x27,\x20type:\x20\x27Allocation\x27}\x20to\x20create\x20and\x20name\x20the\x20new\x20Allocation\x20object.'),'allocators':AllocatorsSchema,'coin':CoinParamSchema,'payment_info':PaymentInfoSchema,'allow_unanchored':z['boolean']()['optional']()['describe']('docs#11\x20escape\x20hatch:\x20explicitly\x20allow\x20creating\x20an\x20Allocation\x20whose\x20payment_info\x20has\x20NO\x20for_object\x20anchor\x20while\x20any\x20sharing\x20row\x20uses\x20a\x20GuardIdentifier\x20recipient.\x20'+'Unanchored\x20+\x20GuardIdentifier\x20lets\x20any\x20guard-passing\x20caller\x20redirect\x20the\x20submitted\x20payout\x20address\x20to\x20an\x20arbitrary\x20address\x20—\x20'+'anchor\x20it\x20with\x20payment_info.for_object\x20instead.\x20Set\x20true\x20ONLY\x20after\x20the\x20user\x20explicitly\x20accepts\x20that\x20risk.\x20Default:\x20blocked.')})['strict']()['describe']('Create\x20a\x20new\x20Allocation\x20object.\x20Set\x20\x27object\x27\x20field\x20with\x20{name:\x20\x27yourName\x27,\x20type:\x20\x27Allocation\x27}\x20to\x20name\x20the\x20new\x20object.\x20Notice:\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.');export const FormulaSpecSchema=z['object']({'repo':NameOrAddressSchema['describe']('Repository\x20object\x20(ID\x20or\x20LocalMark\x20name)\x20whose\x20policy-key\x20data\x20table\x20is\x20scanned\x20at\x20alloc()\x20time\x20to\x20produce\x20the\x20scalar.\x20'+'Resolved\x20to\x20an\x20address\x20before\x20the\x20call.'),'key':z['string']()['describe']('Policy\x20key\x20(String)\x20inside\x20that\x20Repository\x20whose\x20data\x20rows\x20are\x20the\x20candidate\x20set.\x20Max\x2064\x20bytes.'),'selector':z['union']([z['literal'](0x0),z['literal'](0x1)])['describe']('Which\x20aggregate\x20produces\x20the\x20scalar:\x200\x20=\x20RECORD\x20COUNT\x20(u64\x20—\x20how\x20many\x20candidate\x20rows\x20match\x20the\x20predicate),\x20'+'1\x20=\x20VALUE\x20SUM\x20(u256\x20—\x20sum\x20of\x20the\x20matching\x20rows\x27\x20numeric\x20payloads,\x20overflow-safe).\x20Any\x20other\x20value\x20is\x20refused\x20on-chain\x20(EFORMULA_SPEC_INVALID=24).'),'predicate':RepositoryDataWhereSchema['describe']('Predicate\x20filter\x20applied\x20to\x20each\x20candidate\x27s\x20stored\x20value\x20—\x20SAME\x20wire\x20format\x20as\x20the\x20repository\x20count/sum-where\x20guard\x20queries\x20(1173/1174).\x20'+'kind\x20must\x20match\x20the\x20policy\x20value\x20type;\x20mismatching\x20entries\x20are\x20skipped\x20honestly\x20(never\x20an\x20error).'),'ids':z['array'](z['string']())['describe']('EXPLICIT\x20candidate\x20object\x20IDs\x20(vector<address>)\x20to\x20scan.\x20Duplicates\x20are\x20deduped;\x20max\x20100\x20candidates;\x20'+'an\x20EMPTY\x20list\x20matches\x20no\x20records\x20(scalar\x200)\x20—\x20there\x20is\x20no\x20\x27all\x20objects\x27\x20wildcard.')})['strict']()['describe']('Runtime\x20pricing\x20spec\x20for\x20one\x20Formula\x20sharing\x20slot\x20(FormulaSpec).\x20Payout\x20for\x20that\x20leg\x20=\x20clamp(sharing_coefficient_bps\x20×\x20scalar\x20/\x2010000,\x200,\x20headroom),\x20'+'where\x20scalar\x20=\x20the\x20selected\x20aggregate\x20over\x20the\x20Repository\x20rows.\x20Binding\x20REPLACES\x20any\x20previous\x20spec\x20for\x20the\x20slot;\x20the\x20plan\x20shape\x20itself\x20'+'(which\x20slots\x20are\x20Formula,\x20coefficients)\x20is\x20immutable\x20and\x20was\x20fixed\x20when\x20the\x20allocator\x20was\x20declared.');export const CallAllocation_OperateSchema=z['object']({'object':NameOrAddressSchema['describe']('REQUIRED\x20for\x20operating\x20existing\x20object.\x20Provide\x20the\x20Allocation\x20object\x20ID\x20or\x20existing\x20name\x20to\x20reference\x20the\x20target\x20object.'),'received_coins':ReceivedBalanceOrRecentlySchema['optional']()['describe']('Unwrap\x20the\x20CoinWrapper\x20objects\x20received\x20by\x20the\x20Allocation\x20object\x20and\x20deposit\x20them\x20into\x20the\x20pending\x20allocation\x20balance.'+RECEIVE_FORMAT_BLOCK_BALANCE),'alloc_by_guard':NameOrAddressSchema['optional']()['describe']('Verify\x20the\x20specified\x20Guard\x20and\x20execute\x20the\x20corresponding\x20fund\x20distribution.\x20'+'GENERIC\x20SEMANTICS:\x20an\x20Allocation\x20distributes\x20whatever\x20balance\x20it\x20holds\x20—\x20order\x20funds,\x20payroll,\x20dividends,\x20bounties.\x20'+'It\x20defines\x20no\x20scenario-specific\x20rule:\x20eligibility\x20(including\x20issuer\x20identity\x20for\x20standalone\x20use,\x20e.g.\x20an\x20org\x20admin)\x20'+'and\x20differentiation\x20inputs\x20are\x20expressed\x20as\x20Guard\x20constraints,\x20all\x20public\x20and\x20auditable.\x20'+'RECIPIENT\x20RESOLUTION\x20(Recipient\x20enum):\x20'+'Entity\x20→\x20fixed\x20address;\x20Signer\x20→\x20transaction\x20sender;\x20GuardIdentifier\x20n\x20→\x20the\x20address\x20submitted\x20for\x20identifier\x20n\x20(resolved\x20from\x20the\x20passport\x27s\x20submission\x20record).\x20'+'ORDER\x20PATTERN\x20(canonical):\x20the\x20Guard\x20table\x20needs\x20ONE\x20submitted\x20Order,\x20constrained\x20by\x20the\x20Guard\x20(e.g.\x20order.service\x20==\x20host\x20service,\x20'+'progress\x20at\x20a\x20qualifying\x20node,\x20signer\x20==\x20order.owner);\x20that\x20order\x20submission\x20IS\x20the\x20recipient\x20slot.\x20Whoever\x20triggers\x20the\x20distribution,\x20funds\x20necessarily\x20'+'land\x20at\x20an\x20Order\x20OBJECT;\x20delivered\x20CoinWrappers\x20are\x20owned\x20by\x20the\x20order\x20and\x20can\x20be\x20extracted\x20only\x20by\x20the\x20Order\x20object\x20itself\x20'+'(Wow\x20ownership)\x20—\x20the\x20coins\x20then\x20go\x20to\x20the\x20order\x27s\x20current\x20owner.\x20Object\x20receipt\x20=\x20owner\x20receipt.\x20'+'POST-DISTRIBUTION\x20CLAIM\x20(required\x20step):\x20each\x20recipient\x20gets\x20a\x20CoinWrapper\x20(not\x20spendable\x20coins)\x20—\x20EOA\x20wallet\x20→\x20operation_type=\x27payment\x27\x20RECEIVE\x20mode\x20'+'{object:\x27<coinwrapper_id>\x27,\x20receive:true};\x20Order\x20object\x20→\x20operation_type=\x27order\x27\x20{object:\x27<order_id>\x27,\x20receive:\x27recently\x27};\x20Treasury\x20object\x20→\x20treasury\x20receive.\x20'+'Find\x20pending\x20CoinWrappers\x20via\x20query_toolkit\x20query_type=\x27onchain_received\x27;\x20verify\x20via\x20the\x20immutable\x20Payment\x20object\x20(allocation.payment\x20array).\x20'+'RISK:\x20safety\x20follows\x20from\x20the\x20sufficiency\x20of\x20the\x20Guard\x20constraints,\x20not\x20the\x20recipient\x20form\x20—\x20analyze\x20the\x20recipient\x20constraint\x20audit\x20before\x20publish;\x20'+'structural\x20residuals\x20(unavoidable):\x20permissionless\x20alloc\x20allows\x20forced\x20settlement\x20timing,\x20the\x20submitted\x20order\x20is\x20not\x20bound\x20to\x20the\x20settled\x20allocation,\x20'+'and\x20allocators/guards\x20are\x20immutable\x20after\x20publish.'),'formula_spec_set':z['object']({'allocator_index':z['number']()['int']()['min'](0x0)['describe']('Index\x20of\x20the\x20allocator\x20within\x20allocators.allocators\x20(0-based).\x20Must\x20address\x20an\x20EXISTING\x20allocator,\x20else\x20refused\x20on-chain\x20(EFORMULA_SPEC_INVALID=24).'),'slot_index':z['number']()['int']()['min'](0x0)['describe']('Index\x20of\x20the\x20sharing\x20row\x20within\x20that\x20allocator\x27s\x20sharing[]\x20(0-based).\x20Must\x20address\x20a\x20slot\x20whose\x20mode\x20is\x20Formula,\x20else\x20refused\x20on-chain\x20(EFORMULA_SPEC_INVALID=24).'),'spec':FormulaSpecSchema})['strict']()['optional']()['describe']('Protocol\x20154:\x20bind\x20(or\x20replace)\x20the\x20runtime\x20pricing\x20spec\x20of\x20ONE\x20Formula\x20sharing\x20slot\x20of\x20this\x20Allocation\x20—\x20no\x20re-declaration\x20of\x20the\x20allocator\x20plan,\x20'+'no\x20fund\x20movement.\x20Only\x20the\x20DATA\x20SOURCE\x20(which\x20repository\x20aggregate\x20prices\x20the\x20slot)\x20is\x20set\x20here;\x20the\x20slot\x20itself\x20must\x20already\x20be\x20declared\x20as\x20a\x20'+'Formula\x20leg\x20(mode\x204).\x20An\x20unbound\x20Formula\x20slot\x20prices\x20its\x20scalar\x20as\x200.\x20Requires\x20an\x20SDK\x20build\x20with\x20protocol-154\x20transport.')})['strict']()['describe']('Operate\x20on\x20an\x20existing\x20Allocation\x20object.\x20Set\x20\x27object\x27\x20field\x20with\x20the\x20object\x20ID\x20or\x20existing\x20name\x20to\x20specify\x20the\x20target.');export const CallAllocation_DataSchema=z['union']([CallAllocation_CreateSchema,CallAllocation_OperateSchema])['describe']('On-chain\x20Allocation\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Use\x20CallAllocation_CreateSchema\x20by\x20setting\x20\x27object\x27\x20with\x20OBJECT\x20format\x20{name,\x20type_parameter,\x20...}.\x20(2)\x20OPERATE\x20EXISTING:\x20Use\x20CallAllocation_OperateSchema\x20by\x20setting\x20\x27object\x27\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20');export const CallAllocation_InputSchema=z['object']({'data':CallAllocation_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from'zod';import{WithPermissionObjectSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{NameOrAddressSchema,ReceivedObjectsOrRecentlySchema,DescriptionSchema,LongNameSchema,NameSchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';export const ImEntrySchema=z['object']({'at':NameOrAddressSchema['describe']('Contact\x27s\x20account\x20address\x20or\x20name\x20for\x20instant\x20messaging'),'description':LongNameSchema['optional']()['describe']('Optional\x20description\x20or\x20note\x20about\x20this\x20contact')})['strict']()['describe']('An\x20instant\x20messaging\x20contact\x20entry\x20(at\x20+\x20optional\x20description).\x20NO\x20status\x20field\x20by\x20design:\x20on\x20chain,\x20Im.status\x20is\x20self-declared\x20—\x20each\x20member\x20sets\x20its\x20OWN\x20status\x20(your\x20own\x20via\x20data.my_status;\x20other\x20members\x20via\x20their\x20own\x20contact-status\x20update),\x20and\x20creating\x20an\x20entry\x20always\x20starts\x20it\x20with\x20an\x20empty\x20status.');export const ImsOperationSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add')['describe']('Add\x20new\x20IM\x20contacts\x20to\x20the\x20list'),'im':z['array'](ImEntrySchema)['describe']('List\x20of\x20IM\x20contacts\x20to\x20add')})['strict']()['describe']('Add\x20operation:\x20Append\x20new\x20contacts\x20to\x20the\x20existing\x20IM\x20list'),z['object']({'op':z['literal']('set')['describe']('Set/replace\x20all\x20IM\x20contacts'),'im':z['array'](ImEntrySchema)['describe']('Complete\x20list\x20of\x20IM\x20contacts\x20to\x20set')})['strict']()['describe']('Set\x20operation:\x20Replace\x20entire\x20IM\x20list\x20with\x20new\x20contacts'),z['object']({'op':z['literal']('remove')['describe']('Remove\x20specific\x20IM\x20contacts'),'im':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20contact\x20addresses\x20or\x20names\x20to\x20remove')})['strict']()['describe']('Remove\x20operation:\x20Delete\x20specified\x20contacts\x20from\x20the\x20IM\x20list'),z['object']({'op':z['literal']('clear')['describe']('Clear\x20all\x20IM\x20contacts')})['strict']()['describe']('Clear\x20operation:\x20Remove\x20all\x20contacts\x20from\x20the\x20IM\x20list')])['describe']('IM\x20list\x20operation:\x20add,\x20set,\x20remove,\x20or\x20clear\x20contacts');export const CallContact_DataSchema=z['object']({'object':WithPermissionObjectSchema,'my_status':NameSchema['optional']()['describe']('Set\x20your\x20status\x20message\x20in\x20this\x20contact\x20list.\x20Only\x20valid\x20if\x20your\x20account\x20is\x20already\x20in\x20the\x20IM\x20list'),'description':DescriptionSchema['optional']()['describe']('Contact\x20object\x20description\x20or\x20public\x20information'),'location':LongNameSchema['optional']()['describe']('Physical\x20contact\x20address\x20(where\x20this\x20contact\x20is\x20located\x20—\x20NOT\x20a\x20service\x20area).\x20'+'IMPORTANT:\x20Use\x20a\x20complete\x20hierarchical\x20address\x20whenever\x20possible\x20'+'(e.g.\x20\x27US\x20→\x20California\x20→\x20Los\x20Angeles\x20→\x20Koreatown\x27).\x20'+'If\x20only\x20a\x20partial\x20address\x20is\x20known,\x20EXPAND\x20it\x20to\x20the\x20full\x20standardized\x20form\x20'+'(country\x20→\x20province/state\x20→\x20city\x20→\x20district,\x20worldwide)\x20—\x20when\x20ambiguous,\x20offer\x202-4\x20candidate\x20completions\x20and\x20let\x20the\x20user\x20pick.'),'ims':ImsOperationSchema['optional']()['describe']('IM\x20contact\x20list\x20operation:\x20add,\
|
|
1
|
+
import{z}from'zod';import{WithPermissionObjectSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{NameOrAddressSchema,ReceivedObjectsOrRecentlySchema,DescriptionSchema,LongNameSchema,NameSchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';export const ImEntrySchema=z['object']({'at':NameOrAddressSchema['describe']('Contact\x27s\x20account\x20address\x20or\x20name\x20for\x20instant\x20messaging'),'description':LongNameSchema['optional']()['describe']('Optional\x20description\x20or\x20note\x20about\x20this\x20contact')})['strict']()['describe']('An\x20instant\x20messaging\x20contact\x20entry\x20(at\x20+\x20optional\x20description).\x20NO\x20status\x20field\x20by\x20design:\x20on\x20chain,\x20Im.status\x20is\x20self-declared\x20—\x20each\x20member\x20sets\x20its\x20OWN\x20status\x20(your\x20own\x20via\x20data.my_status;\x20other\x20members\x20via\x20their\x20own\x20contact-status\x20update),\x20and\x20creating\x20an\x20entry\x20always\x20starts\x20it\x20with\x20an\x20empty\x20status.');export const ImsOperationSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add')['describe']('Add\x20new\x20IM\x20contacts\x20to\x20the\x20list'),'im':z['array'](ImEntrySchema)['describe']('List\x20of\x20IM\x20contacts\x20to\x20add')})['strict']()['describe']('Add\x20operation:\x20Append\x20new\x20contacts\x20to\x20the\x20existing\x20IM\x20list'),z['object']({'op':z['literal']('set')['describe']('Set/replace\x20all\x20IM\x20contacts'),'im':z['array'](ImEntrySchema)['describe']('Complete\x20list\x20of\x20IM\x20contacts\x20to\x20set')})['strict']()['describe']('Set\x20operation:\x20Replace\x20entire\x20IM\x20list\x20with\x20new\x20contacts'),z['object']({'op':z['literal']('remove')['describe']('Remove\x20specific\x20IM\x20contacts'),'im':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20contact\x20addresses\x20or\x20names\x20to\x20remove')})['strict']()['describe']('Remove\x20operation:\x20Delete\x20specified\x20contacts\x20from\x20the\x20IM\x20list'),z['object']({'op':z['literal']('clear')['describe']('Clear\x20all\x20IM\x20contacts')})['strict']()['describe']('Clear\x20operation:\x20Remove\x20all\x20contacts\x20from\x20the\x20IM\x20list')])['describe']('IM\x20list\x20operation:\x20add,\x20set,\x20remove,\x20or\x20clear\x20contacts');export const CallContact_DataSchema=z['object']({'object':WithPermissionObjectSchema,'my_status':NameSchema['optional']()['describe']('Set\x20your\x20status\x20message\x20in\x20this\x20contact\x20list.\x20Only\x20valid\x20if\x20your\x20account\x20is\x20already\x20in\x20the\x20IM\x20list'),'description':DescriptionSchema['optional']()['describe']('Contact\x20object\x20description\x20or\x20public\x20information'),'location':LongNameSchema['optional']()['describe']('Physical\x20contact\x20address\x20(where\x20this\x20contact\x20is\x20located\x20—\x20NOT\x20a\x20service\x20area).\x20'+'IMPORTANT:\x20Use\x20a\x20complete\x20hierarchical\x20address\x20whenever\x20possible\x20'+'(e.g.\x20\x27US\x20→\x20California\x20→\x20Los\x20Angeles\x20→\x20Koreatown\x27).\x20'+'If\x20only\x20a\x20partial\x20address\x20is\x20known,\x20EXPAND\x20it\x20to\x20the\x20full\x20standardized\x20form\x20'+'(country\x20→\x20province/state\x20→\x20city\x20→\x20district,\x20worldwide)\x20—\x20when\x20ambiguous,\x20offer\x202-4\x20candidate\x20completions\x20and\x20let\x20the\x20user\x20pick.'),'ims':ImsOperationSchema['optional']()['describe']('IM\x20contact\x20list\x20operation:\x20add/set/remove/clear.\x20Entry\x20shape\x20is\x20{at:\x20address-or-name,\x20description?}\x20ONLY\x20(KLM-FIND-11,\x20klook-mn\x20261019)\x20—\x20there\x20is\x20NO\x20\x27remark\x27\x20field\x20and\x20NO\x20per-contact\x20\x27status\x27\x20field:\x20on-chain\x20Im.status\x20is\x20self-declared,\x20your\x20own\x20status\x20rides\x20data.my_status.\x20The\x20array\x20key\x20inside\x20add/set\x20is\x20\x27im\x27.'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Receive\x20objects\x20sent\x20to\x20this\x20Contact\x20object\x20and\x20unwrap\x20them\x20to\x20the\x20permission\x20owner.'+RECEIVE_FORMAT_BLOCK_OBJECTS)})['strict']()['describe']('On-chain\x20Contact\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Contact.\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 CallContact_InputSchema=z['object']({'data':CallContact_DataSchema['describe']('Contact\x20operation\x20data\x20containing\x20object\x20reference\x20and\x20operations\x20to\x20perform'),'env':CallEnvSchema['optional']()['describe']('Call\x20environment\x20parameters\x20including\x20account,\x20network,\x20and\x20cache\x20settings'),'submission':SubmissionCallSchema['optional']()['describe']('Guard\x20submission\x20data\x20for\x20permission\x20verification')})['strict']()['describe']('Contact\x20object\x20operation\x20data.\x20Manage\x20on-chain\x20contact\x20information\x20and\x20instant\x20messaging\x20addresses\x20for\x20real-time\x20encrypted\x20communication');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from'zod';import{CallEnvSchema,NamedObjectSchema,SubmissionCallSchema}from'./base.js';import{GuardNodeSchema}from'../query/index.js';import{DescriptionSchema,GuardTableItemBaseSchema,NameOrAddressSchema,EntrypointSchema}from'../common/index.js';import{isBoolReturningQuery}from'../utils/guard-query-utils.js';import{ValueType}from'@wowok/wowok';export const CallGuard_RootSchema=z['union']([GuardNodeSchema['refine'](a=>{const b=a,c=['logic_as_u256_greater','logic_as_u256_lesser','logic_as_u256_equal','logic_as_u256_greater_or_equal','logic_as_u256_lesser_or_equal','logic_equal','logic_not','logic_and','logic_or','logic_string_contains','logic_string_nocase_contains','logic_string_nocase_equal','calc_string_contains','calc_string_nocase_contains','calc_string_nocase_equal','vec_contains_bool','vec_contains_address','vec_contains_string','vec_contains_string_nocase','vec_contains_number','query_reward_record_exists','query','identifier'];if(!c['includes'](b['type']))return![];if(b['type']==='query'){const d=b;if(!isBoolReturningQuery(d['query']))return![];}return!![];},{'message':'Guard\x20root\x20node\x20must\x20be\x20an\x20operation\x20that\x20returns\x20Bool.\x20Allowed\x20types:\x20logic_*,\x20calc_string_contains,\x20calc_string_nocase_*,\x20vec_contains_*,\x20reward_record_exist,\x20identifier\x20(must\x20reference\x20Bool\x20type\x20in\x20table).\x20For\x20\x27query\x27\x20type,\x20ONLY\x20queries\x20that\x20return\x20Bool\x20are\x20allowed.\x20Use\x20\x27wowok_buildin_info\x27\x20tool\x20with\x20{\x22info\x22:\x20\x22guard\x20instructions\x22,\x20\x22filter\x22:\x20{\x22returnType\x22:\x20\x22Bool\x22,\x20\x22scope\x22:\x20\x22object\x20query\x22}}\x20to\x20list\x20all\x20Bool-returning\x20queries.\x20Other\x20nodes\x20(calc_number_*,\x20context,\x20non-Bool\x20queries)\x20must\x20be\x20wrapped\x20with\x20a\x20logic\x20operation.'})['describe']('Guard\x20computational\x20tree\x20root\x20node.\x20MUST\x20be\x20an\x20operation\x20that\x20returns\x20a\x20Bool\x20value\x20(pass/fail).\x20For\x20\x27query\x27\x20type,\x20the\x20specific\x20query\x20must\x20return\x20Bool.\x20For\x20\x27identifier\x27\x20type,\x20the\x20referenced\x20table\x20item\x20must\x20have\x20value_type=Bool.'),z['object']({'type':z['literal']('file'),'file_path':z['string']()['describe']('ABSOLUTE\x20path\x20to\x20JSON\x20or\x20Markdown\x20file\x20containing\x20Guard\x20definition.\x20Field\x20name\x20is\x20`file_path`\x20(NOT\x20`file`).\x20File\x20can\x20define:\x20namedNew,\x20description,\x20table,\x20root,\x20rely.'),'format':z['enum'](['json','markdown'])['optional']()['default']('json')['describe']('File\x20format:\x20\x27json\x27\x20or\x20\x27markdown\x27.\x20Default\x20is\x20\x27json\x27.')})['strict']()])['describe']('Guard\x20root\x20definition.\x20Either\x20provide\x20a\x20direct\x20GuardNode\x20tree\x20(must\x20be\x20a\x20logical\x20operation\x20returning\x20Bool)\x20or\x20reference\x20a\x20file\x20to\x20load.\x20When\x20using\x20file\x20type,\x20fields\x20defined\x20in\x20the\x20schema\x20(namedNew,\x20description,\x20table,\x20rely)\x20will\x20OVERRIDE\x20the\x20corresponding\x20fields\x20in\x20the\x20file.');const isBoolValueType=a=>{if(typeof a==='number')return a===ValueType['Bool'];if(typeof a==='string')return a['toLowerCase']()==='bool'||a==='0';return![];};export const GuardBindingHintActionSchema=z['enum'](['buy','forward','allocate','claim_reward','vote','dispute','write_repository','submit_progress','gen_passport','custom'])['describe']('Guard\x20protected\x20action\x20type.\x20Maps\x20to\x20IntentPuzzle.action\x20in\x20the\x20puzzle\x20model.');export const GuardBindingHintHostObjectSchema=z['enum'](['Service','Machine','Arbitration','Reward','Repository','Progress','Demand','Standalone'])['describe']('Host\x20object\x20type\x20that\x20the\x20Guard\x20will\x20bind\x20to.\x20\x27Standalone\x27\x20for\x20independent\x20Guards\x20(rely\x20dependency\x20or\x20gen_passport).');export const GuardBindingHintBindingFieldSchema=z['enum'](['buy_guard','order_allocators','Forward.guard','submission','guard','write_guard','usage_guard','voting_guard','ServiceGuard','none'])['describe']('Binding\x20field\x20on\x20the\x20host\x20object.\x20\x27none\x27\x20for\x20standalone\x20Guards.');export const GuardBindingHintSchema=z['object']({'action':GuardBindingHintActionSchema['describe']('Protected\x20action\x20type.\x20Example:\x20\x27buy\x27\x20for\x20Service\x20buy_guard,\x20\x27forward\x27\x20for\x20Machine\x20Forward.guard.'),'host_object':GuardBindingHintHostObjectSchema['describe']('Host\x20object\x20type.\x20Example:\x20\x27Service\x27,\x20\x27Machine\x27.'),'binding_field':GuardBindingHintBindingFieldSchema['describe']('Binding\x20field.\x20Example:\x20\x27buy_guard\x27,\x20\x27Forward.guard\x27.'),'rule_sentence':z['string']()['optional']()['describe']('One-sentence\x20description\x20of\x20the\x20validation\x20rule\x20(human-readable).\x20Example:\x20\x27Only\x20the\x20author\x20can\x20purchase\x20this\x20service\x27.'),'failure_conditions':z['array'](z['string']())['optional']()['describe']('List\x20of\x20conditions\x20under\x20which\x20the\x20Guard\x20should\x20FAIL.\x20Example:\x20[\x27Signer\x20is\x20not\x20in\x20allowlist\x27,\x27Order\x20is\x20already\x20completed\x27].'),'circular_reference':z['boolean']()['optional']()['describe']('Whether\x20the\x20Guard\x20references\x20the\x20Host\x20Object\x20itself\x20(circular\x20reference\x20pattern).\x20true=Guard\x20queries\x20the\x20Host\x20Object\x20it\x20binds\x20to.')})['strict']()['describe']('Optional\x20semantic\x20hint\x20for\x20Guard\x20capability\x20system.\x20Provides\x20intent\x20+\x20binding\x20context\x20so\x20the\x20MCP\x20server\x20can\x20derive\x20GuardPuzzle,\x20run\x20risk\x20assessment,\x20and\x20generate\x20confirmation\x20text.\x20Strongly\x20recommended:\x20fill\x20this\x20field\x20to\x20enable\x20puzzle_status,\x20matched_scene,\x20suggested_patterns,\x20confirmation_text,\x20and\x20pending_questions\x20in\x20the\x20response\x20guard_advice.');export const CallGuard_DataSchema=z['object']({'namedNew':NamedObjectSchema['optional']()['describe']('Name\x20and\x20optional\x20tags\x20for\x20the\x20new\x20Guard\x20object.\x20Set\x20\x27onChain:\x20true\x27\x20to\x20create\x20a\x20public\x20on-chain\x20identity.\x20When\x20using\x20root.type=\x27file\x27,\x20this\x20field\x20OVERRIDES\x20namedNew\x20in\x20the\x20file.\x20CIRCULAR\x20DEPENDENCY\x20(DOC-01):\x20When\x20a\x20Guard\x20queries\x20a\x20Service\x20that\x20hasn\x27t\x20been\x20created\x20yet,\x20use\x20a\x20LocalMark\x20NAME\x20(not\x20address)\x20in\x20the\x20query\x20table\x20—\x20the\x20name\x20is\x20resolved\x20to\x20an\x20address\x20at\x20transaction\x20build\x20time.\x20Workflow:\x20(1)\x20Create\x20Service\x20(Phase\x201,\x20no\x20publish)\x20→\x20(2)\x20Create\x20Guard\x20referencing\x20Service\x20by\x20name\x20→\x20(3)\x20Update\x20Service.buy_guard\x20=\x20Guard\x20address\x20→\x20(4)\x20Publish\x20Service.'),'description':DescriptionSchema['optional']()['describe']('Guard\x20description.\x20When\x20using\x20root.type=\x27file\x27,\x20this\x20field\x20OVERRIDES\x20description\x20in\x20the\x20file.'),'table':z['array'](GuardTableItemBaseSchema)['optional']()['describe']('Data\x20table\x20of\x20the\x20Guard\x20object.\x20When\x20using\x20root.type=\x27file\x27,\x20this\x20field\x20OVERRIDES\x20table\x20in\x20the\x20file.'),'root':CallGuard_RootSchema['describe']('Root\x20definition:\x20either\x20a\x20direct\x20GuardNode\x20(must\x20be\x20a\x20logical\x20operation\x20returning\x20Bool)\x20or\x20a\x20file\x20reference\x20(type=\x27file\x27).\x20When\x20type=\x27file\x27,\x20the\x20file\x20can\x20define\x20all\x20Guard\x20fields\x20(namedNew,\x20description,\x20table,\x20root,\x20rely),\x20and\x20schema\x20fields\x20override\x20file\x20content.'),'rely':z['object']({'guards':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20dependent\x20Guard\x20object\x20IDs\x20or\x20names.'),'logic_or':z['boolean']()['optional']()['describe']('Whether\x20to\x20use\x20logical\x20OR\x20operator.')})['optional']()['describe']('All\x20Guard\x20objects\x20that\x20the\x20new\x20Guard\x20object\x20depends\x20on.\x20If\x20logic_or\x20is\x20true,\x20the\x20execution\x20result\x20of\x20the\x20new\x20Guard\x20object\x20is\x20the\x20logical\x20OR\x20of\x20the\x20execution\x20results\x20of\x20all\x20dependent\x20Guard\x20objects;\x20otherwise,\x20it\x20is\x20logical\x20AND.\x20When\x20using\x20root.type=\x27file\x27,\x20this\x20field\x20OVERRIDES\x20rely\x20in\x20the\x20file.'),'binding_hint':GuardBindingHintSchema['optional']()['describe']('Phase\x205\x20Guard\x20capability\x20hint.\x20Provides\x20semantic\x20context\x20(action\x20+\x20host_object\x20+\x20binding_field\x20+\x20optional\x20rule/failure_conditions)\x20for\x20puzzle\x20derivation.\x20When\x20provided,\x20the\x20response\x20will\x20include\x20complete\x20guard_advice\x20(puzzle_status,\x20matched_scene,\x20suggested_patterns,\x20confirmation_text,\x20pending_questions).\x20When\x20absent,\x20puzzle_status\x20intent/binding\x20dimensions\x20are\x20marked\x20incomplete.')})['strict']()['refine'](a=>{if(typeof a['root']==='object'&&a['root']!==null&&'type'in a['root']){const c=a['root'];if(c['type']==='file')return!![];}const b=a['root'];if(b['type']==='identifier'&&b['identifier']!==undefined){const d=a['table']?.['find'](e=>e['identifier']===b['identifier']);if(!d)return![];if(!isBoolValueType(d['value_type']))return![];}return!![];},{'message':'Invalid\x20Guard\x20root:\x20When\x20using\x20\x27identifier\x27\x20as\x20root,\x20the\x20referenced\x20table\x20item\x20must\x20exist\x20and\x20have\x20value_type=\x27Bool\x27\x20(or\x200).'})['describe']('On-chain\x20Guard\x20creation.\x20IMPORTANT:\x20All\x20defined\x20data\x20(include\x20all\x20submitted\x20data)\x20must\x20be\x20defined\x20in\x20the\x20\x27table\x27\x20field.\x20USAGE:\x20Set\x20\x27namedNew\x27\x20field\x20with\x20{name,\x20tags?,\x20onChain?}\x20to\x20name\x20the\x20new\x20Guard\x20(you\x20may\x20also\x20use\x20\x27object\x27\x20as\x20an\x20alias\x20for\x20\x27namedNew\x27\x20—\x20the\x20MCP\x20preprocess\x20will\x20convert\x20it\x20automatically).\x20The\x20Guard\x20is\x20immutable\x20once\x20created.\x20Define\x20the\x20validation\x20logic\x20in\x20\x27root\x27\x20field.\x20When\x20root.type=\x27file\x27,\x20the\x20file\x20can\x20contain\x20all\x20Guard\x20fields,\x20and\x20any\x20fields\x20defined\x20in\x20the\x20schema\x20will\x20OVERRIDE\x20the\x20file\x20content.');export const CallGuard_InputSchema=z['object']({'data':CallGuard_DataSchema['describe']('Guard\x20data\x20definition.\x20STRICT\x20object\x20whose\x20ONLY\x20legal\x20keys\x20are:\x20namedNew\x20(alias:\x20object),\x20description,\x20table,\x20root,\x20rely,\x20binding_hint.\x20`account`\x20is\x20NOT\x20a\x20key\x20here\x20—\x20account\x20selection\x20belongs\x20in\x20`env.account`.'),'env':CallEnvSchema['optional']()})['strict']()['describe']('On-chain\x20Guard\x20creation\x20input\x20wrapper.\x20ENVELOPE\x20SHAPE:\x20{\x20data:\x20{\x20namedNew,\x20root,\x20...\x20},\x20env:\x20{\x20account?,\x20network?,\x20...\x20}\x20}\x20—\x20the\x20Guard\x20fields\x20live\x20at\x20`data.data`\x20(one\x20level\x20down),\x20i.e.\x20`data.data.root`\x20and\x20`data.data.namedNew`,\x20NOT\x20at\x20`data`\x20root.\x20Signer\x20account\x20goes\x20in\x20`env.account`,\x20never\x20inside\x20`data`.');export const CallGenPassport_InputSchema=z['object']({'guard':z['union']([NameOrAddressSchema,z['array'](NameOrAddressSchema)])['describe']('Guard\x20object\x20ID(s)\x20to\x20verify\x20and\x20generate\x20passport\x20from.\x20Can\x20be\x20a\x20single\x20guard\x20(string)\x20or\x20multiple\x20guards\x20(array\x20of\x20strings).\x20Supports\x20guard\x20names\x20or\x20addresses.'),'info':SubmissionCallSchema['optional']()['describe']('Optional\x20submission\x20data.\x20If\x20not\x20provided,\x20will\x20attempt\x20to\x20get\x20existing\x20submissions\x20from\x20the\x20guard.'),'env':CallEnvSchema['optional']()})['strict']()['describe']('Generate\x20a\x20new\x20Passport\x20object\x20after\x20Guard\x20verification\x20succeeds.\x20The\x20Passport\x20is\x20an\x20immutable\x20on-chain\x20object\x20that\x20can\x20be\x20used\x20for\x20offline\x20friend\x20verification,\x20transaction\x20condition\x20verification,\x20etc.\x20Supports\x20verifying\x20multiple\x20guards\x20at\x20once.');export const Guard2File_InputSchema=z['object']({'guard':NameOrAddressSchema['describe']('Guard\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'),'network':EntrypointSchema['optional']()['describe']('Network\x20to\x20read\x20the\x20Guard\x20from:\x20\x27localnet\x27\x20|\x20\x27mainnet\x27\x20|\x20\x27testnet\x27.\x20If\x20omitted,\x20the\x20SDK\x27s\x20current\x20default\x20network\x20is\x20used\x20(check\x20via\x20wowok_buildin_info\x20info=\x27current\x20network\x27);\x20the\x20response\x20echoes\x20the\x20resolved\x20network\x20so\x20an\x20export\x20can\x20never\x20be\x20silently\x20read\x20from\x20the\x20wrong\x20chain.'),'env':CallEnvSchema['optional']()})['strict']()['describe']('Query\x20a\x20Guard\x20object\x20from\x20the\x20blockchain\x20and\x20export\x20its\x20definition\x20to\x20a\x20JSON\x20or\x20Markdown\x20file.\x20The\x20exported\x20file\x20can\x20be\x20edited\x20and\x20used\x20to\x20create\x20new\x20Guard\x20objects.');export const Guard2File_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'),'guard':z['string']()['describe']('Guard\x20object\x20ID\x20that\x20was\x20exported'),'network':z['string']()['describe']('Network\x20the\x20Guard\x20was\x20READ\x20from\x20(resolved\x20—\x20the\x20SDK\x20default\x20when\x20the\x20input\x20omitted\x20\x27network\x27)')})['strict']()['describe']('Success\x20result\x20data')})['strict'](),z['object']({'status':z['literal']('error'),'error':z['string']()['describe']('Error\x20message')})['strict']()])['describe']('Guard2File\x20operation\x20output\x20schema\x20with\x20discriminator');export const Guard2File_OutputWrappedSchema=z['object']({'result':Guard2File_OutputSchema})['strict']()['describe']('Guard2File\x20operation\x20output\x20wrapped\x20schema');
|
|
1
|
+
import{z}from'zod';import{CallEnvSchema,NamedObjectSchema,SubmissionCallSchema}from'./base.js';import{GuardNodeSchema}from'../query/index.js';import{DescriptionSchema,GuardTableItemBaseSchema,NameOrAddressSchema,EntrypointSchema}from'../common/index.js';import{isBoolReturningQuery}from'../utils/guard-query-utils.js';import{ValueType}from'@wowok/wowok';export const CallGuard_RootSchema=z['union']([GuardNodeSchema['refine'](a=>{const b=a,c=['logic_as_u256_greater','logic_as_u256_lesser','logic_as_u256_equal','logic_as_u256_greater_or_equal','logic_as_u256_lesser_or_equal','logic_equal','logic_not','logic_and','logic_or','logic_string_contains','logic_string_nocase_contains','logic_string_nocase_equal','calc_string_contains','calc_string_nocase_contains','calc_string_nocase_equal','vec_contains_bool','vec_contains_address','vec_contains_string','vec_contains_string_nocase','vec_contains_number','query_reward_record_exists','query','identifier'];if(!c['includes'](b['type']))return![];if(b['type']==='query'){const d=b;if(!isBoolReturningQuery(d['query']))return![];}return!![];},{'message':'Guard\x20root\x20node\x20must\x20be\x20an\x20operation\x20that\x20returns\x20Bool.\x20Allowed\x20types:\x20logic_*,\x20calc_string_contains,\x20calc_string_nocase_*,\x20vec_contains_*,\x20reward_record_exist,\x20identifier\x20(must\x20reference\x20Bool\x20type\x20in\x20table).\x20For\x20\x27query\x27\x20type,\x20ONLY\x20queries\x20that\x20return\x20Bool\x20are\x20allowed.\x20Use\x20\x27wowok_buildin_info\x27\x20tool\x20with\x20{\x22info\x22:\x20\x22guard\x20instructions\x22,\x20\x22filter\x22:\x20{\x22returnType\x22:\x20\x22Bool\x22,\x20\x22scope\x22:\x20\x22object\x20query\x22}}\x20to\x20list\x20all\x20Bool-returning\x20queries.\x20Other\x20nodes\x20(calc_number_*,\x20context,\x20non-Bool\x20queries)\x20must\x20be\x20wrapped\x20with\x20a\x20logic\x20operation.'})['describe']('Guard\x20computational\x20tree\x20root\x20node.\x20MUST\x20be\x20an\x20operation\x20that\x20returns\x20a\x20Bool\x20value\x20(pass/fail).\x20For\x20\x27query\x27\x20type,\x20the\x20specific\x20query\x20must\x20return\x20Bool.\x20For\x20\x27identifier\x27\x20type,\x20the\x20referenced\x20table\x20item\x20must\x20have\x20value_type=Bool.'),z['object']({'type':z['literal']('file'),'file_path':z['string']()['describe']('ABSOLUTE\x20path\x20to\x20JSON\x20or\x20Markdown\x20file\x20containing\x20Guard\x20definition.\x20Field\x20name\x20is\x20`file_path`\x20(NOT\x20`file`).\x20File\x20can\x20define:\x20namedNew,\x20description,\x20table,\x20root,\x20rely.'),'format':z['enum'](['json','markdown'])['optional']()['default']('json')['describe']('File\x20format:\x20\x27json\x27\x20or\x20\x27markdown\x27.\x20Default\x20is\x20\x27json\x27.')})['strict']()])['describe']('Guard\x20root\x20definition.\x20Either\x20provide\x20a\x20direct\x20GuardNode\x20tree\x20(must\x20be\x20a\x20logical\x20operation\x20returning\x20Bool)\x20or\x20reference\x20a\x20file\x20to\x20load.\x20When\x20using\x20file\x20type,\x20fields\x20defined\x20in\x20the\x20schema\x20(namedNew,\x20description,\x20table,\x20rely)\x20will\x20OVERRIDE\x20the\x20corresponding\x20fields\x20in\x20the\x20file.');const isBoolValueType=a=>{if(typeof a==='number')return a===ValueType['Bool'];if(typeof a==='string')return a['toLowerCase']()==='bool'||a==='0';return![];};export const GuardBindingHintActionSchema=z['enum'](['buy','forward','allocate','claim_reward','vote','dispute','write_repository','submit_progress','gen_passport','custom'])['describe']('Guard\x20protected\x20action\x20type.\x20Maps\x20to\x20IntentPuzzle.action\x20in\x20the\x20puzzle\x20model.');export const GuardBindingHintHostObjectSchema=z['enum'](['Service','Machine','Arbitration','Reward','Repository','Progress','Demand','Standalone'])['describe']('Host\x20object\x20type\x20that\x20the\x20Guard\x20will\x20bind\x20to.\x20\x27Standalone\x27\x20for\x20independent\x20Guards\x20(rely\x20dependency\x20or\x20gen_passport).');export const GuardBindingHintBindingFieldSchema=z['enum'](['buy_guard','order_allocators','Forward.guard','submission','guard','write_guard','usage_guard','voting_guard','ServiceGuard','none'])['describe']('Binding\x20field\x20on\x20the\x20host\x20object.\x20\x27none\x27\x20for\x20standalone\x20Guards.');export const GuardBindingHintSchema=z['object']({'action':GuardBindingHintActionSchema['describe']('Protected\x20action\x20type.\x20Example:\x20\x27buy\x27\x20for\x20Service\x20buy_guard,\x20\x27forward\x27\x20for\x20Machine\x20Forward.guard.'),'host_object':GuardBindingHintHostObjectSchema['describe']('Host\x20object\x20type.\x20Example:\x20\x27Service\x27,\x20\x27Machine\x27.'),'binding_field':GuardBindingHintBindingFieldSchema['describe']('Binding\x20field.\x20Example:\x20\x27buy_guard\x27,\x20\x27Forward.guard\x27.'),'rule_sentence':z['string']()['optional']()['describe']('One-sentence\x20description\x20of\x20the\x20validation\x20rule\x20(human-readable).\x20Example:\x20\x27Only\x20the\x20author\x20can\x20purchase\x20this\x20service\x27.'),'failure_conditions':z['array'](z['string']())['optional']()['describe']('List\x20of\x20conditions\x20under\x20which\x20the\x20Guard\x20should\x20FAIL.\x20Example:\x20[\x27Signer\x20is\x20not\x20in\x20allowlist\x27,\x27Order\x20is\x20already\x20completed\x27].'),'circular_reference':z['boolean']()['optional']()['describe']('Whether\x20the\x20Guard\x20references\x20the\x20Host\x20Object\x20itself\x20(circular\x20reference\x20pattern).\x20true=Guard\x20queries\x20the\x20Host\x20Object\x20it\x20binds\x20to.')})['strict']()['describe']('Optional\x20semantic\x20hint\x20for\x20Guard\x20capability\x20system.\x20Provides\x20intent\x20+\x20binding\x20context\x20so\x20the\x20MCP\x20server\x20can\x20derive\x20GuardPuzzle,\x20run\x20risk\x20assessment,\x20and\x20generate\x20confirmation\x20text.\x20Strongly\x20recommended:\x20fill\x20this\x20field\x20to\x20enable\x20puzzle_status,\x20matched_scene,\x20suggested_patterns,\x20confirmation_text,\x20and\x20pending_questions\x20in\x20the\x20response\x20guard_advice.');export const CallGuard_DataSchema=z['object']({'namedNew':NamedObjectSchema['optional']()['describe']('Name\x20and\x20optional\x20tags\x20for\x20the\x20new\x20Guard\x20object.\x20Set\x20\x27onChain:\x20true\x27\x20to\x20create\x20a\x20public\x20on-chain\x20identity.\x20When\x20using\x20root.type=\x27file\x27,\x20this\x20field\x20OVERRIDES\x20namedNew\x20in\x20the\x20file.\x20CIRCULAR\x20DEPENDENCY\x20(DOC-01):\x20When\x20a\x20Guard\x20queries\x20a\x20Service\x20that\x20hasn\x27t\x20been\x20created\x20yet,\x20use\x20a\x20LocalMark\x20NAME\x20(not\x20address)\x20in\x20the\x20query\x20table\x20—\x20the\x20name\x20is\x20resolved\x20to\x20an\x20address\x20at\x20transaction\x20build\x20time.\x20Workflow:\x20(1)\x20Create\x20Service\x20(Phase\x201,\x20no\x20publish)\x20→\x20(2)\x20Create\x20Guard\x20referencing\x20Service\x20by\x20name\x20→\x20(3)\x20Update\x20Service.buy_guard\x20=\x20Guard\x20address\x20→\x20(4)\x20Publish\x20Service.'),'description':DescriptionSchema['optional']()['describe']('Guard\x20description.\x20When\x20using\x20root.type=\x27file\x27,\x20this\x20field\x20OVERRIDES\x20description\x20in\x20the\x20file.'),'table':z['array'](GuardTableItemBaseSchema)['optional']()['describe']('Data\x20table\x20of\x20the\x20Guard\x20object.\x20When\x20using\x20root.type=\x27file\x27,\x20this\x20field\x20OVERRIDES\x20table\x20in\x20the\x20file.'),'root':CallGuard_RootSchema['describe']('Root\x20definition:\x20either\x20a\x20direct\x20GuardNode\x20(must\x20be\x20a\x20logical\x20operation\x20returning\x20Bool)\x20or\x20a\x20file\x20reference\x20(type=\x27file\x27).\x20When\x20type=\x27file\x27,\x20the\x20file\x20can\x20define\x20all\x20Guard\x20fields\x20(namedNew,\x20description,\x20table,\x20root,\x20rely),\x20and\x20schema\x20fields\x20override\x20file\x20content.'),'rely':z['object']({'guards':z['array'](NameOrAddressSchema)['describe']('List\x20of\x20dependent\x20Guard\x20object\x20IDs\x20or\x20names.'),'logic_or':z['boolean']()['optional']()['describe']('Whether\x20to\x20use\x20logical\x20OR\x20operator.')})['optional']()['describe']('All\x20Guard\x20objects\x20that\x20the\x20new\x20Guard\x20object\x20depends\x20on.\x20If\x20logic_or\x20is\x20true,\x20the\x20execution\x20result\x20of\x20the\x20new\x20Guard\x20object\x20is\x20the\x20logical\x20OR\x20of\x20the\x20execution\x20results\x20of\x20all\x20dependent\x20Guard\x20objects;\x20otherwise,\x20it\x20is\x20logical\x20AND.\x20When\x20using\x20root.type=\x27file\x27,\x20this\x20field\x20OVERRIDES\x20rely\x20in\x20the\x20file.'),'binding_hint':GuardBindingHintSchema['optional']()['describe']('Phase\x205\x20Guard\x20capability\x20hint.\x20Provides\x20semantic\x20context\x20(action\x20+\x20host_object\x20+\x20binding_field\x20+\x20optional\x20rule/failure_conditions)\x20for\x20puzzle\x20derivation.\x20When\x20provided,\x20the\x20response\x20will\x20include\x20complete\x20guard_advice\x20(puzzle_status,\x20matched_scene,\x20suggested_patterns,\x20confirmation_text,\x20pending_questions).\x20When\x20absent,\x20puzzle_status\x20intent/binding\x20dimensions\x20are\x20marked\x20incomplete.')})['strict']()['refine'](a=>{if(typeof a['root']==='object'&&a['root']!==null&&'type'in a['root']){const c=a['root'];if(c['type']==='file')return!![];}const b=a['root'];if(b['type']==='identifier'&&b['identifier']!==undefined){const d=a['table']?.['find'](e=>e['identifier']===b['identifier']);if(!d)return![];if(!isBoolValueType(d['value_type']))return![];}return!![];},{'message':'Invalid\x20Guard\x20root:\x20When\x20using\x20\x27identifier\x27\x20as\x20root,\x20the\x20referenced\x20table\x20item\x20must\x20exist\x20and\x20have\x20value_type=\x27Bool\x27\x20(or\x200).'})['refine'](a=>{const b=a['binding_hint'],c=b?.['action']==='buy'||b?.['binding_field']==='buy_guard';if(!c)return!![];const d=(a['table']??[])['find'](e=>e['identifier']===0x0);return!(d!==undefined&&d['b_submission']===!![]);},{'message':'A\x20buy_guard\x20cannot\x20declare\x20identifier\x200\x20as\x20a\x20submission\x20slot\x20(b_submission:true).\x20Slot\x200\x20carries\x20the\x20transacted\x20Order\x20address\x20by\x20protocol\x20convention,\x20and\x20the\x20order\x20does\x20not\x20exist\x20when\x20the\x20passport\x20is\x20verified\x20at\x20buy\x20time\x20—\x20this\x20guard\x20can\x20never\x20pass\x20and\x20mounting\x20it\x20is\x20refused\x20outright\x20(protocol\x20154,\x20service\x20abort\x2043).\x20Declare\x20slot\x200\x20as\x20a\x20STATIC\x20row\x20(b_submission:false)\x20or\x20move\x20the\x20submission\x20to\x20another\x20identifier\x20(order/allocation\x20rails\x20may\x20keep\x20slot-0\x20submissions\x20—\x20only\x20the\x20buy\x20door\x20is\x20impossible).'})['describe']('On-chain\x20Guard\x20creation.\x20IMPORTANT:\x20All\x20defined\x20data\x20(include\x20all\x20submitted\x20data)\x20must\x20be\x20defined\x20in\x20the\x20\x27table\x27\x20field.\x20USAGE:\x20Set\x20\x27namedNew\x27\x20field\x20with\x20{name,\x20tags?,\x20onChain?}\x20to\x20name\x20the\x20new\x20Guard\x20(you\x20may\x20also\x20use\x20\x27object\x27\x20as\x20an\x20alias\x20for\x20\x27namedNew\x27\x20—\x20the\x20MCP\x20preprocess\x20will\x20convert\x20it\x20automatically).\x20The\x20Guard\x20is\x20immutable\x20once\x20created.\x20Define\x20the\x20validation\x20logic\x20in\x20\x27root\x27\x20field.\x20When\x20root.type=\x27file\x27,\x20the\x20file\x20can\x20contain\x20all\x20Guard\x20fields,\x20and\x20any\x20fields\x20defined\x20in\x20the\x20schema\x20will\x20OVERRIDE\x20the\x20file\x20content.');export const CallGuard_InputSchema=z['object']({'data':CallGuard_DataSchema['describe']('Guard\x20data\x20definition.\x20STRICT\x20object\x20whose\x20ONLY\x20legal\x20keys\x20are:\x20namedNew\x20(alias:\x20object),\x20description,\x20table,\x20root,\x20rely,\x20binding_hint.\x20`account`\x20is\x20NOT\x20a\x20key\x20here\x20—\x20account\x20selection\x20belongs\x20in\x20`env.account`.'),'env':CallEnvSchema['optional']()})['strict']()['describe']('On-chain\x20Guard\x20creation\x20input\x20wrapper.\x20ENVELOPE\x20SHAPE:\x20{\x20data:\x20{\x20namedNew,\x20root,\x20...\x20},\x20env:\x20{\x20account?,\x20network?,\x20...\x20}\x20}\x20—\x20the\x20Guard\x20fields\x20live\x20at\x20`data.data`\x20(one\x20level\x20down),\x20i.e.\x20`data.data.root`\x20and\x20`data.data.namedNew`,\x20NOT\x20at\x20`data`\x20root.\x20Signer\x20account\x20goes\x20in\x20`env.account`,\x20never\x20inside\x20`data`.');export const CallGenPassport_InputSchema=z['object']({'guard':z['union']([NameOrAddressSchema,z['array'](NameOrAddressSchema)])['describe']('Guard\x20object\x20ID(s)\x20to\x20verify\x20and\x20generate\x20passport\x20from.\x20Can\x20be\x20a\x20single\x20guard\x20(string)\x20or\x20multiple\x20guards\x20(array\x20of\x20strings).\x20Supports\x20guard\x20names\x20or\x20addresses.'),'info':SubmissionCallSchema['optional']()['describe']('Optional\x20submission\x20data.\x20If\x20not\x20provided,\x20will\x20attempt\x20to\x20get\x20existing\x20submissions\x20from\x20the\x20guard.'),'env':CallEnvSchema['optional']()})['strict']()['describe']('Generate\x20a\x20new\x20Passport\x20object\x20after\x20Guard\x20verification\x20succeeds.\x20The\x20Passport\x20is\x20an\x20immutable\x20on-chain\x20object\x20that\x20can\x20be\x20used\x20for\x20offline\x20friend\x20verification,\x20transaction\x20condition\x20verification,\x20etc.\x20Supports\x20verifying\x20multiple\x20guards\x20at\x20once.');export const Guard2File_InputSchema=z['object']({'guard':NameOrAddressSchema['describe']('Guard\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'),'network':EntrypointSchema['optional']()['describe']('Network\x20to\x20read\x20the\x20Guard\x20from:\x20\x27localnet\x27\x20|\x20\x27mainnet\x27\x20|\x20\x27testnet\x27.\x20If\x20omitted,\x20the\x20SDK\x27s\x20current\x20default\x20network\x20is\x20used\x20(check\x20via\x20wowok_buildin_info\x20info=\x27current\x20network\x27);\x20the\x20response\x20echoes\x20the\x20resolved\x20network\x20so\x20an\x20export\x20can\x20never\x20be\x20silently\x20read\x20from\x20the\x20wrong\x20chain.'),'env':CallEnvSchema['optional']()})['strict']()['describe']('Query\x20a\x20Guard\x20object\x20from\x20the\x20blockchain\x20and\x20export\x20its\x20definition\x20to\x20a\x20JSON\x20or\x20Markdown\x20file.\x20The\x20exported\x20file\x20can\x20be\x20edited\x20and\x20used\x20to\x20create\x20new\x20Guard\x20objects.');export const Guard2File_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'),'guard':z['string']()['describe']('Guard\x20object\x20ID\x20that\x20was\x20exported'),'network':z['string']()['describe']('Network\x20the\x20Guard\x20was\x20READ\x20from\x20(resolved\x20—\x20the\x20SDK\x20default\x20when\x20the\x20input\x20omitted\x20\x27network\x27)')})['strict']()['describe']('Success\x20result\x20data')})['strict'](),z['object']({'status':z['literal']('error'),'error':z['string']()['describe']('Error\x20message')})['strict']()])['describe']('Guard2File\x20operation\x20output\x20schema\x20with\x20discriminator');export const Guard2File_OutputWrappedSchema=z['object']({'result':Guard2File_OutputSchema})['strict']()['describe']('Guard2File\x20operation\x20output\x20wrapped\x20schema');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ResponseData,LocalMark,enrichMoveError}from'@wowok/wowok';import{classifyError,normalizeErrorMessage,buildSemantic}from'./semantic.js';import{buildReceipt,buildReceiveMovedReceipt}from'./receipt.js';import{recover,resetAttempts}from'../../harness/recover.js';import{stableOperationId}from'../../harness/operation-id.js';import{verify,recordCoverageGap}from'../../harness/verify.js';function applySchemaWarning(a,b){const c=b?.['schema_check'];if(!c||c['warnings']['length']===0x0&&c['errors']['length']===0x0)return a;const d=[...c['warnings'],...c['errors']];let e=a['semantic'];e&&d['length']>0x0&&(e={...e,'warnings':[...e['warnings']||[],...d]});const f={'compatible':c['compatible'],'warnings':d,'client_version':c['client_version'],'server_versions':c['versions']};return{...a,'semantic':e,'schema_warning':f};}function convertBigInts(a){if(typeof a==='bigint')return a['toString']();if(Array['isArray'](a))return a['map'](convertBigInts);if(a instanceof Map){const b={};for(const [c,d]of a)b[String(c)]=convertBigInts(d);return b;}if(a instanceof Set)return Array['from'](a)['map'](convertBigInts);if(a&&typeof a==='object'){const e={};for(const f of Object['keys'](a))e[f]=convertBigInts(a[f]);return e;}return a;}function safeTextJson(a,b){try{return JSON['stringify'](a);}catch(c){return'WARNING:\x20the\x20operation\x20EXECUTED\x20on-chain\x20but\x20its\x20response\x20body\x20failed\x20to\x20serialize\x20'+('('+(c?.['message']??'unknown\x20serialization\x20error')+').\x20Do\x20NOT\x20retry\x20—\x20judge\x20the\x20')+'outcome\x20by\x20the\x20transaction\x20digest\x20instead:\x20query\x20it\x20or\x20re-read\x20the\x20target\x20object.\x20'+('digest:\x20'+(b??'n/a'));}}function recoveryOperationId(a){return a?.['operation_id']??stableOperationId(a?.['operation_type']??'call',a?.['data']);}function failureDiagnosis(a,b,c,d){return verify({'expected':a,'actual':{'result_type':b['kind'],'error_code':c,'error':d}});}function recordSuccessCoverageGap(a,b,c){const d=verify({'expected':a,'actual':{'result_type':'transaction','semantic':b}});recordCoverageGap(d,{'operation_type':c['operation_type']});}function buildSubmissionTemplate(a){const b=a,c=b?.['submission']??[];if(!Array['isArray'](c)||c['length']===0x0)return undefined;const d=Array['isArray'](b?.['guard'])&&b['guard']['length']>0x0?b['guard']:c['map'](f=>({'object':f['guard'],'impack':!![]})),e=c['map'](f=>({'guard':f['guard'],'submission':(Array['isArray'](f['submission'])?f['submission']:[])['map'](h=>{const i=h?.['value_type']??'Address',j=h?.['object_type']?String(h['object_type']):i;return{'identifier':h?.['identifier'],'name':h?.['name']??'','b_submission':!![],'value_type':i,'value':'<'+j+'\x20—\x20see\x20required_fields>'};})}));return{'submission_template':{'type':'submission','guard':d,'submission':e},'submission_placement':{'instruction':'Re-issue\x20the\x20SAME\x20operation\x20(data\x20UNCHANGED)\x20adding\x20the\x20object\x20above\x20as\x20the\x20TOP-LEVEL\x20'+'`submission`\x20field\x20of\x20the\x20tool\x20call\x20—\x20a\x20SIBLING\x20of\x20`data`\x20and\x20`env`,\x20NEVER\x20inside\x20`data`,\x20'+'NEVER\x20at\x20the\x20args\x20root.\x20Use\x20call_with_submission\x20semantics:\x20fill\x20every\x20value\x20slot\x20'+'marked\x20\x22<...\x20—\x20see\x20required_fields>\x22.\x20Field\x20name\x20`impack`\x20is\x20literal\x20(true\x20=\x20the\x20'+'guard\x27s\x20verdict\x20participates);\x20slot\x20254\x20takes\x20the\x20ORDER\x20address\x20bound\x20to\x20the\x20operation.','submission':{'type':'submission','guard':d,'submission':e}}};}export function handleCallResult(a,b){const c=convertBigInts(a),d=buildReceipt(c);if(d['kind']==='error'){const g=enrichMoveError(normalizeErrorMessage(d['error'])),h=classifyError(g),i={'outcome':'failed','message':'Error:\x20'+g,'result':{'type':'error','error':g,'error_code':h['error_code'],'retryable':h['retryable'],'recovery_hint':h['recovery_hint']},'recovery':recover(h['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,h['error_code'],g):undefined},j=applySchemaWarning(i,b);return{'content':[{'type':'text','text':j['message']}],'structuredContent':j};}if(d['kind']==='transaction'){const k=ResponseData(c);if(!d['executed']){const w=enrichMoveError(normalizeErrorMessage(d['txError'])||d['txStatus']||'unknown\x20error'),x=classifyError(w),y={'outcome':'failed','message':'Transaction\x20failed:\x20'+w,'result':{'type':'error','error':w,'error_code':x['error_code'],'retryable':x['retryable'],'recovery_hint':x['recovery_hint']},'recovery':recover(x['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,x['error_code'],w):undefined},z=applySchemaWarning(y,b);return{'content':[{'type':'text','text':z['message']},{'type':'text','text':safeTextJson(k,d['digest'])}],'structuredContent':z};}resetAttempts(recoveryOperationId(b));const l=b?.['response_level']==='full',m=k['filter'](A=>A?.['change']==='created'),n=c?.['effects']?.['gasUsed'],o=A=>{const B=Number(A);return Number['isFinite'](B)?B:undefined;};let p,q;if(n&&typeof n==='object'){const A=o(n['computationCost']);if(A!==undefined){const B=o(n['storageCost'])??0x0,C=o(n['storageRebate'])??0x0,D=o(n['nonRefundableStorageFee'])??0x0;q={'computation':A,'storage':B,'storage_rebate':C,'non_refundable_storage':D},p=A+B+D-C;}}const s={'outcome':'executed','message':'Transaction\x20completed\x20successfully','result':l?{'type':'transaction',...c}:{'type':'transaction','digest':c['digest'],'created':m,...p!==undefined?{'gas_used':p}:{},...q?{'fee_components':q}:{}},'semantic':buildSemantic(d,b)},t=buildReceiveMovedReceipt(b?.['data'],d);t&&(s['result']['receive_receipt']=t,t['objects_moved']===0x0&&t['note']&&(s['message']='Transaction\x20executed\x20(tx_ok=true),\x20but\x20NOTHING\x20MOVED\x20into\x20the\x20wallet\x20'+'(objects_moved=0)\x20—\x20the\x20receive\x20resolved\x20to\x20a\x20no-op.\x20Do\x20NOT\x20report\x20funds\x20'+'or\x20objects\x20as\x20arrived;\x20verify\x20per\x20the\x20note\x20in\x20result.receive_receipt.',s['semantic']&&(s['semantic']={...s['semantic'],'warnings':[...s['semantic']['warnings']??[],t['note']]})));b?.['expected']&&recordSuccessCoverageGap(b['expected'],s['semantic'],b);const u=applySchemaWarning(s,b),v=l?safeTextJson(k,d['digest']):'Transaction\x20executed\x20(compact\x20response):\x20digest\x20'+(d['digest']??'')+';\x20created\x20'+m['length']+'\x20object(s)'+(p!==undefined?';\x20gas\x20'+p+'\x20(raw\x20units)':'')+(t?';\x20receive_receipt:\x20objects_moved='+t['objects_moved']+(t['note']?'\x20—\x20'+t['note']:''):'')+'.\x20Call\x20again\x20with\x20response_level:\x27full\x27\x20to\x20include\x20the\x20complete\x20raw\x20result.';return{'content':[{'type':'text','text':u['message']},{'type':'text','text':v}],'structuredContent':u};}if(d['kind']==='submission'){const E=c?.['submission'],F=Array['isArray'](E)&&E['length']===0x0,G=c?.['guards'],H=F?{'outcome':'pending_input','message':'GUARD\x20EVALUATED\x20FALSE\x20—\x20the\x20condition\x20did\x20not\x20hold.\x20This\x20is\x20NOT\x20a\x20missing-data\x20problem:\x20the\x20Guard\x20table\x20'+'required\x20no\x20submission,\x20so\x20the\x20expression\x20itself\x20returned\x20false.\x20Do\x20NOT\x20retry\x20the\x20same\x20call.','result':{'type':'guard_result','guard_result':![],'guards':G??[],...c},'semantic':b?{'intent':'guard_evaluated_false','status':'pending_input','summary':'Guard\x20expression\x20evaluated\x20to\x20false\x20('+(G??[])['length']+'\x20guard(s)\x20checked)\x20—\x20fix\x20the\x20condition,\x20the\x20object\x20binding,\x20or\x20the\x20on-chain\x20state;\x20do\x20not\x20resubmit\x20the\x20same\x20call','next_actions':[{'action':'Inspect\x20the\x20Guard\x20expression\x20with\x20analyze_guard_semantics\x20(tree\x20+\x20JSON\x20+\x20mermaid)\x20to\x20see\x20WHICH\x20sub-condition\x20is\x20false','reason':'A\x20composite\x20Guard\x20can\x20fail\x20on\x20any\x20operand;\x20the\x20object-level\x20report\x20cannot\x20tell\x20you\x20which','tool':'guard.operate\x20/\x20analyze_guard_semantics','priority':'required'},{'action':'Verify\x20the\x20Guard\x20is\x20bound\x20to\x20THIS\x20order/service\x20—\x20an\x20address\x20constant\x20for\x20another\x20listing\x20makes\x20every\x20condition\x20false','reason':'Hit\x20twice\x20on\x20testnet:\x20a\x20Guard\x20carried\x20a\x20constant\x20address\x20belonging\x20to\x20a\x20different\x20Service','tool':'onchain_objects','priority':'required'},{'action':'Re-read\x20the\x20referenced\x20state\x20with\x20a\x20FORCED-FRESH\x20query\x20before\x20concluding\x20the\x20chain\x20state\x20is\x20wrong','reason':'A\x20cached\x20read\x20can\x20show\x20a\x20pre-transaction\x20value\x20and\x20make\x20a\x20satisfied\x20condition\x20look\x20false','tool':'query_toolkit\x20(onchain_objects,\x20omit\x20no_cache)','priority':'recommended'}]}:undefined}:{'outcome':'pending_input','message':'SUBMISSION\x20REQUIRED\x20—\x20the\x20Guard\x20needs\x20data\x20you\x20have\x20not\x20supplied\x20yet.\x20Retry\x20with\x20the\x20listed\x20values.','result':{'type':'submission',...c,...buildSubmissionTemplate(c)??{}},'semantic':b?{'intent':'guard_submission_required','status':'pending_input','summary':'Guard\x20verification\x20required\x20—\x20fill\x20the\x20submission\x20data\x20and\x20resubmit','next_actions':[{'action':'fill\x20guard\x20submission\x20data\x20and\x20resubmit\x20via\x20call_with_submission','reason':'Guard\x20rejected\x20the\x20call;\x20submission\x20must\x20satisfy\x20the\x20Guard\x20table\x20requirements','tool':'onchain_operations\x20(with\x20submission\x20field)','priority':'required'}]}:undefined},I=applySchemaWarning(H,b);return{'content':[{'type':'text','text':I['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':I};}if(Array['isArray'](c)){const J={'outcome':'executed','message':'Operation\x20completed','result':{'type':'data','data':c}},K=applySchemaWarning(J,b);return{'content':[{'type':'text','text':K['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':K};}if(c===undefined||c===null){const L={'outcome':'executed','message':'Operation\x20completed','result':{'type':'null'}},M=applySchemaWarning(L,b);return{'content':[{'type':'text','text':M['message']}],'structuredContent':M};}const e={'outcome':'executed','message':'Operation\x20completed','result':{'type':'transaction',...c},'semantic':buildSemantic(d,b)},f=applySchemaWarning(e,b);return{'content':[{'type':'text','text':f['message']}],'structuredContent':f};}export function createServerConfig(a,b){return{'name':a['name'],'version':a['version'],'description':b||a['description']};}export function createCapabilitiesConfig(){return{'capabilities':{'prompts':{},'resources':{},'tools':{'listChanged':!![]},'logging':{}}};}export function createToolMeta(a,b){return{'author':'WOWOK\x20Team','createdAt':'2026-02-01','lastUpdated':'2026-02-01','category':a,'tags':b,'requiresAuth':![]};}export function createToolAnnotations(a=![],b=![]){return{'readOnlyHint':a,'destructiveHint':b,'idempotentHint':!![],'openWorldHint':![]};}export async function transformSubmission(a){if(!a)return undefined;const b=(a['guard']||[])['map'](h=>h['object'])['filter'](Boolean),c=(a['submission']||[])['map'](h=>h['guard'])['filter'](Boolean),d=[...new Set([...b,...c])],e=d['length']>0x0?await LocalMark['Instance']()['get_many_address'](d):[],f=new Map();d['forEach']((h,i)=>{const j=e[i];j&&f['set'](h,j);});const g=h=>{if(typeof h!=='string')throw new Error('Guard\x20reference\x20must\x20be\x20a\x20string\x20(got\x20'+(h===undefined?'undefined':typeof h)+')');if(f['has'](h))return f['get'](h);for(const [i,j]of f['entries']()){if(i===h)return j;}if(h['startsWith']('0x'))return h;throw new Error('Guard\x20name\x20or\x20address\x20not\x20found:\x20'+h);};return{'type':'submission','guard':(a['guard']||[])['map'](h=>({'object':g(h['object']),'impack':h['impack']||![]})),'submission':(a['submission']||[])['map'](h=>({'guard':g(h['guard']),'submission':h['submission']||[]}))};}export function validateInput(a,b){return b['parse'](a);}export function getEnvConfig(a){return a??{};}
|
|
1
|
+
import{ResponseData,LocalMark,enrichMoveError}from'@wowok/wowok';import{classifyError,normalizeErrorMessage,buildSemantic}from'./semantic.js';import{buildReceipt,buildReceiveMovedReceipt}from'./receipt.js';import{recover,resetAttempts}from'../../harness/recover.js';import{stableOperationId}from'../../harness/operation-id.js';import{verify,recordCoverageGap}from'../../harness/verify.js';function applySchemaWarning(a,b){const c=b?.['schema_check'];if(!c||c['warnings']['length']===0x0&&c['errors']['length']===0x0)return a;const d=[...c['warnings'],...c['errors']];let e=a['semantic'];e&&d['length']>0x0&&(e={...e,'warnings':[...e['warnings']||[],...d]});const f={'compatible':c['compatible'],'warnings':d,'client_version':c['client_version'],'server_versions':c['versions']};return{...a,'semantic':e,'schema_warning':f};}function convertBigInts(a){if(typeof a==='bigint')return a['toString']();if(Array['isArray'](a))return a['map'](convertBigInts);if(a instanceof Map){const b={};for(const [c,d]of a)b[String(c)]=convertBigInts(d);return b;}if(a instanceof Set)return Array['from'](a)['map'](convertBigInts);if(a&&typeof a==='object'){const e={};for(const f of Object['keys'](a))e[f]=convertBigInts(a[f]);return e;}return a;}function safeTextJson(a,b){try{return JSON['stringify'](a);}catch(c){return'WARNING:\x20the\x20operation\x20EXECUTED\x20on-chain\x20but\x20its\x20response\x20body\x20failed\x20to\x20serialize\x20'+('('+(c?.['message']??'unknown\x20serialization\x20error')+').\x20Do\x20NOT\x20retry\x20—\x20judge\x20the\x20')+'outcome\x20by\x20the\x20transaction\x20digest\x20instead:\x20query\x20it\x20or\x20re-read\x20the\x20target\x20object.\x20'+('digest:\x20'+(b??'n/a'));}}function recoveryOperationId(a){return a?.['operation_id']??stableOperationId(a?.['operation_type']??'call',a?.['data']);}function failureDiagnosis(a,b,c,d){return verify({'expected':a,'actual':{'result_type':b['kind'],'error_code':c,'error':d}});}function recordSuccessCoverageGap(a,b,c){const d=verify({'expected':a,'actual':{'result_type':'transaction','semantic':b}});recordCoverageGap(d,{'operation_type':c['operation_type']});}function buildSubmissionTemplate(a){const b=a,c=b?.['submission']??[];if(!Array['isArray'](c)||c['length']===0x0)return undefined;const d=Array['isArray'](b?.['guard'])&&b['guard']['length']>0x0?b['guard']:c['map'](f=>({'object':f['guard'],'impack':!![]})),e=c['map'](f=>({'guard':f['guard'],'submission':(Array['isArray'](f['submission'])?f['submission']:[])['map'](h=>{const i=h?.['value_type']??'Address',j=h?.['object_type']?String(h['object_type']):i;return{'identifier':h?.['identifier'],'name':h?.['name']??'','b_submission':!![],'value_type':i,'value':'<'+j+'\x20—\x20see\x20required_fields>'};})}));return{'submission_template':{'type':'submission','guard':d,'submission':e},'submission_placement':{'instruction':'Re-issue\x20the\x20SAME\x20operation\x20(data\x20UNCHANGED)\x20adding\x20the\x20object\x20above\x20as\x20the\x20TOP-LEVEL\x20'+'`submission`\x20field\x20of\x20the\x20tool\x20call\x20—\x20a\x20SIBLING\x20of\x20`data`\x20and\x20`env`,\x20NEVER\x20inside\x20`data`,\x20'+'NEVER\x20at\x20the\x20args\x20root.\x20Use\x20call_with_submission\x20semantics:\x20fill\x20every\x20value\x20slot\x20'+'marked\x20\x22<...\x20—\x20see\x20required_fields>\x22.\x20Field\x20name\x20`impack`\x20is\x20literal\x20(true\x20=\x20the\x20'+'guard\x27s\x20verdict\x20participates);\x20slot\x20254\x20takes\x20the\x20ORDER\x20address\x20bound\x20to\x20the\x20operation.','submission':{'type':'submission','guard':d,'submission':e}}};}export function handleCallResult(a,b){const c=convertBigInts(a),d=buildReceipt(c);if(d['kind']==='error'){const g=enrichMoveError(normalizeErrorMessage(d['error'])),h=classifyError(g),i={'outcome':'failed','message':'Error:\x20'+g,'result':{'type':'error','error':g,'error_code':h['error_code'],'retryable':h['retryable'],'recovery_hint':h['recovery_hint']},'recovery':recover(h['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,h['error_code'],g):undefined},j=applySchemaWarning(i,b);return{'content':[{'type':'text','text':j['message']}],'structuredContent':j};}if(d['kind']==='transaction'){const k=ResponseData(c);if(!d['executed']){const w=enrichMoveError(normalizeErrorMessage(d['txError'])||d['txStatus']||'unknown\x20error'),x=classifyError(w),y={'outcome':'failed','message':'Transaction\x20failed:\x20'+w,'result':{'type':'error','error':w,'error_code':x['error_code'],'retryable':x['retryable'],'recovery_hint':x['recovery_hint']},'recovery':recover(x['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,x['error_code'],w):undefined},z=applySchemaWarning(y,b);return{'content':[{'type':'text','text':z['message']},{'type':'text','text':safeTextJson(k,d['digest'])}],'structuredContent':z};}resetAttempts(recoveryOperationId(b));const l=b?.['response_level']==='full',m=k['filter'](A=>A?.['change']==='created'),n=c?.['effects']?.['gasUsed'],o=A=>{const B=Number(A);return Number['isFinite'](B)?B:undefined;};let p,q;if(n&&typeof n==='object'){const A=o(n['computationCost']);if(A!==undefined){const B=o(n['storageCost'])??0x0,C=o(n['storageRebate'])??0x0,D=o(n['nonRefundableStorageFee'])??0x0;q={'computation':A,'storage':B,'storage_rebate':C,'non_refundable_storage':D},p=A+B+D-C;}}const s={'outcome':'executed','message':'Transaction\x20completed\x20successfully','result':l?{'type':'transaction',...c}:{'type':'transaction','digest':c['digest'],'created':m,...p!==undefined?{'gas_used':p}:{},...q?{'fee_components':q}:{}},'semantic':buildSemantic(d,b)},t=buildReceiveMovedReceipt(b?.['data'],d);t&&(s['result']['receive_receipt']=t,t['objects_moved']===0x0&&t['note']&&(s['message']='Transaction\x20executed\x20(tx_ok=true),\x20but\x20NOTHING\x20MOVED\x20into\x20the\x20wallet\x20'+'(objects_moved=0)\x20—\x20the\x20receive\x20resolved\x20to\x20a\x20no-op.\x20Do\x20NOT\x20report\x20funds\x20'+'or\x20objects\x20as\x20arrived;\x20verify\x20per\x20the\x20note\x20in\x20result.receive_receipt.',s['semantic']&&(s['semantic']={...s['semantic'],'warnings':[...s['semantic']['warnings']??[],t['note']]})));b?.['expected']&&recordSuccessCoverageGap(b['expected'],s['semantic'],b);const u=applySchemaWarning(s,b),v=l?safeTextJson(k,d['digest']):'Transaction\x20executed\x20(compact\x20response):\x20digest\x20'+(d['digest']??'')+';\x20created\x20'+m['length']+'\x20object(s)'+(p!==undefined?';\x20gas\x20'+p+'\x20(raw\x20units)':'')+(t?';\x20receive_receipt:\x20objects_moved='+t['objects_moved']+(t['note']?'\x20—\x20'+t['note']:''):'')+'.\x20Call\x20again\x20with\x20response_level:\x27full\x27\x20to\x20include\x20the\x20complete\x20raw\x20result.';return{'content':[{'type':'text','text':u['message']},{'type':'text','text':v}],'structuredContent':u};}if(d['kind']==='submission'){const E=c?.['submission'],F=Array['isArray'](E)&&E['length']===0x0,G=c?.['guards'],H=F?{'outcome':'pending_input','message':'GUARD\x20EVALUATED\x20FALSE\x20—\x20the\x20condition\x20did\x20not\x20hold.\x20This\x20is\x20NOT\x20a\x20missing-data\x20problem:\x20the\x20Guard\x20table\x20'+'required\x20no\x20submission,\x20so\x20the\x20expression\x20itself\x20returned\x20false.\x20Do\x20NOT\x20retry\x20the\x20same\x20call.','result':{'type':'guard_result','guard_result':![],'guards':G??[],...c},'semantic':b?{'intent':'guard_evaluated_false','status':'pending_input','summary':'Guard\x20expression\x20evaluated\x20to\x20false\x20('+(G??[])['length']+'\x20guard(s)\x20checked)\x20—\x20fix\x20the\x20condition,\x20the\x20object\x20binding,\x20or\x20the\x20on-chain\x20state;\x20do\x20not\x20resubmit\x20the\x20same\x20call','next_actions':[{'action':'Inspect\x20the\x20Guard\x20expression\x20with\x20analyze_guard_semantics\x20(tree\x20+\x20JSON\x20+\x20mermaid)\x20to\x20see\x20WHICH\x20sub-condition\x20is\x20false','reason':'A\x20composite\x20Guard\x20can\x20fail\x20on\x20any\x20operand;\x20the\x20object-level\x20report\x20cannot\x20tell\x20you\x20which','tool':'guard.operate\x20/\x20analyze_guard_semantics','priority':'required'},{'action':'Verify\x20the\x20Guard\x20is\x20bound\x20to\x20THIS\x20order/service\x20—\x20an\x20address\x20constant\x20for\x20another\x20listing\x20makes\x20every\x20condition\x20false','reason':'Hit\x20twice\x20on\x20testnet:\x20a\x20Guard\x20carried\x20a\x20constant\x20address\x20belonging\x20to\x20a\x20different\x20Service','tool':'onchain_objects','priority':'required'},{'action':'Re-read\x20the\x20referenced\x20state\x20with\x20a\x20FORCED-FRESH\x20query\x20before\x20concluding\x20the\x20chain\x20state\x20is\x20wrong','reason':'A\x20cached\x20read\x20can\x20show\x20a\x20pre-transaction\x20value\x20and\x20make\x20a\x20satisfied\x20condition\x20look\x20false','tool':'query_toolkit\x20(onchain_objects,\x20omit\x20no_cache)','priority':'recommended'}]}:undefined}:{'outcome':'pending_input','message':'SUBMISSION\x20REQUIRED\x20—\x20the\x20Guard\x20needs\x20data\x20you\x20have\x20not\x20supplied\x20yet.\x20Retry\x20with\x20the\x20listed\x20values.','result':{'type':'submission',...c,...buildSubmissionTemplate(c)??{}},'semantic':b?{'intent':'guard_submission_required','status':'pending_input','summary':'Guard\x20verification\x20required\x20—\x20fill\x20the\x20submission\x20data\x20and\x20resubmit','next_actions':[{'action':'fill\x20guard\x20submission\x20data\x20and\x20resubmit\x20via\x20call_with_submission','reason':'Guard\x20rejected\x20the\x20call;\x20submission\x20must\x20satisfy\x20the\x20Guard\x20table\x20requirements','tool':'onchain_operations\x20(with\x20submission\x20field)','priority':'required'}]}:undefined},I=applySchemaWarning(H,b);return{'content':[{'type':'text','text':I['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':I};}if(Array['isArray'](c)){const J={'outcome':'executed','message':'Operation\x20completed','result':{'type':'data','data':c}},K=applySchemaWarning(J,b);return{'content':[{'type':'text','text':K['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':K};}if(c===undefined||c===null){if(b?.['operation_type']){const N={'outcome':'failed','message':'Operation\x20did\x20NOT\x20execute\x20—\x20the\x20call\x20returned\x20no\x20result\x20(no\x20digest,\x20no\x20on-chain\x20effect).\x20'+'Most\x20common\x20cause:\x20env/submission\x20were\x20nested\x20inside\x20the\x20inner\x20data\x20object\x20instead\x20of\x20being\x20'+'TOP-LEVEL\x20call\x20fields.\x20Re-send\x20with\x20env\x20and\x20submission\x20as\x20SIBLINGS\x20of\x20data\x20(same\x20object\x20level),\x20'+'then\x20verify\x20the\x20object\x20state\x20with\x20a\x20fresh\x20query\x20before\x20treating\x20anything\x20as\x20done.','result':{'type':'error','error':'The\x20call\x20returned\x20no\x20result\x20—\x20no\x20digest,\x20no\x20on-chain\x20effect\x20(the\x20write\x20did\x20NOT\x20happen).','error_code':'invalid_parameter','retryable':!![],'recovery_hint':'Move\x20env\x20and\x20submission\x20OUT\x20of\x20the\x20inner\x20data\x20object\x20to\x20TOP-LEVEL\x20siblings\x20of\x20data,\x20then\x20re-send\x20the\x20identical\x20call.\x20A\x20null\x20result\x20carries\x20no\x20transaction:\x20never\x20treat\x20this\x20as\x20executed,\x20and\x20verify\x20object\x20state\x20with\x20a\x20fresh\x20query\x20afterward.'},'recovery':{'strategy':'adjust_params','should_retry':!![],'max_attempts':0x2,'current_attempt':0x1,'detail':'Re-shape\x20the\x20call\x20envelope:\x20env\x20and\x20submission\x20belong\x20at\x20the\x20TOP\x20level\x20of\x20the\x20call\x20object\x20(siblings\x20of\x20data),\x20not\x20inside\x20data.\x20Re-send\x20after\x20adjusting;\x20a\x20fresh\x20read\x20should\x20then\x20show\x20the\x20on-chain\x20effect.'}},O=applySchemaWarning(N,b);return{'content':[{'type':'text','text':O['message']}],'structuredContent':O};}const L={'outcome':'executed','message':'Call\x20returned\x20no\x20result\x20(null)\x20—\x20treat\x20as\x20a\x20READ\x20with\x20no\x20output,\x20NOT\x20as\x20a\x20confirmed\x20execution','result':{'type':'null'}},M=applySchemaWarning(L,b);return{'content':[{'type':'text','text':M['message']}],'structuredContent':M};}const e={'outcome':'executed','message':'Operation\x20completed','result':{'type':'transaction',...c},'semantic':buildSemantic(d,b)},f=applySchemaWarning(e,b);return{'content':[{'type':'text','text':f['message']}],'structuredContent':f};}export function createServerConfig(a,b){return{'name':a['name'],'version':a['version'],'description':b||a['description']};}export function createCapabilitiesConfig(){return{'capabilities':{'prompts':{},'resources':{},'tools':{'listChanged':!![]},'logging':{}}};}export function createToolMeta(a,b){return{'author':'WOWOK\x20Team','createdAt':'2026-02-01','lastUpdated':'2026-02-01','category':a,'tags':b,'requiresAuth':![]};}export function createToolAnnotations(a=![],b=![]){return{'readOnlyHint':a,'destructiveHint':b,'idempotentHint':!![],'openWorldHint':![]};}export async function transformSubmission(a){if(!a)return undefined;const b=(a['guard']||[])['map'](h=>h['object'])['filter'](Boolean),c=(a['submission']||[])['map'](h=>h['guard'])['filter'](Boolean),d=[...new Set([...b,...c])],e=d['length']>0x0?await LocalMark['Instance']()['get_many_address'](d):[],f=new Map();d['forEach']((h,i)=>{const j=e[i];j&&f['set'](h,j);});const g=h=>{if(typeof h!=='string')throw new Error('Guard\x20reference\x20must\x20be\x20a\x20string\x20(got\x20'+(h===undefined?'undefined':typeof h)+')');if(f['has'](h))return f['get'](h);for(const [i,j]of f['entries']()){if(i===h)return j;}if(h['startsWith']('0x'))return h;throw new Error('Guard\x20name\x20or\x20address\x20not\x20found:\x20'+h);};return{'type':'submission','guard':(a['guard']||[])['map'](h=>({'object':g(h['object']),'impack':h['impack']||![]})),'submission':(a['submission']||[])['map'](h=>({'guard':g(h['guard']),'submission':h['submission']||[]}))};}export function validateInput(a,b){return b['parse'](a);}export function getEnvConfig(a){return a??{};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from'zod';import{CallEnvSchema,CoinParamSchema,SubmissionCallSchema}from'./base.js';import{OperateSchema,ProgressNextSchema}from'./progress.js';import{AccountOrMark_AddressSchema,DescriptionSchema,LongNameSchema,ManyAccountOrMark_AddressSchema,NameOrAddressSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';import{PaymentInfoSchema}from'../query/index.js';export const ArbConfirmSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'confirm':z['boolean']()['describe']('Whether\x20to\x20confirm\x20that\x20the\x20submitted\x20arbitration\x20materials\x20are\x20valid\x20for\x20arbitration.'),'description':DescriptionSchema['optional']()['describe']('Message\x20description\x20for\x20compensation\x20application.'),'proposition':z['array'](LongNameSchema)['optional']()['describe']('Compensation\x20claims.')})['strict']();export const ArbObjectionSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'objection':DescriptionSchema['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration')})['strict']();export const ArbClaimCompensationSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.')})['strict']();export const OrderRenewSchema=z['object']({'allocation':NameOrAddressSchema['describe']('Allocation\x20object\x20ID\x20or\x20name\x20receiving\x20the\x20renewal\x20funds.'),'type_parameter':z['string']()['describe']('Coin\x20type,\x20e.g.\x20\x220x2::wow::WOW\x22.'),'amount':CoinParamSchema['describe']('Renewal\x20payment.'),'info':PaymentInfoSchema['describe']('PaymentInfo\x20for\x20the\x20new\x20Payment\x20object\x20(remark/index,\x20optional\x20for_object/for_guard).'),'operation':ProgressNextSchema['describe']('Renew\x20forward\x20to\x20advance\x20after\x20the\x20funding\x20lands.'),'message':LongNameSchema['optional']()['describe']('Message\x20attached\x20to\x20the\x20forward\x20advance.')})['strict']();export const CallOrder_DataSchema=z['object']({'object':NameOrAddressSchema['describe']('Order\x20object\x20ID\x20or\x20name.'),'agent':ManyAccountOrMark_AddressSchema['optional']()['describe']('Order\x20agent.\x20Agents\x20can\x20operate\x20the\x20order,\x20such\x20as\x20canceling\x20the\x20order,\x20modifying\x20the\x20order\x20status,\x20etc.;\x20but\x20cannot\x20receive\x20the\x20funds\x20received\x20by\x20the\x20order.'),'required_info':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Credential\x20recorded\x20on\x20the\x20order:\x20the\x20merchant\x27s\x20IM\x20user\x20address\x20resolved\x20from\x20the\x20Service\x27s\x20Contact\x20(zero\x20cost)\x20or\x20a\x20WTS\x20Proof\x20object\x20id\x20(on-chain\x20delivery\x20proof\x20embedding\x20that\x20IM\x20address\x20and\x20timestamp;\x20costs\x20gas).\x20The\x20information\x20itself\x20is\x20delivered\x20via\x20Wowok\x20Messenger.\x20WRITE\x20PERMISSION:\x20OWNER-ONLY\x20—\x20only\x20the\x20order\x20owner\x20(the\x20buyer)\x20can\x20set\x20or\x20clear\x20this\x20field;\x20any\x20other\x20signer\x20(including\x20the\x20merchant/service\x20owner)\x20aborts\x20on-chain\x20(MoveAbort\x201,\x20\x27Not\x20the\x20owner\x27).\x20The\x20merchant\x27s\x20role\x20is\x20to\x20READ\x20it\x20and\x20to\x20receive\x20the\x20info\x20over\x20Messenger.\x20ATTESTATION\x20SEMANTICS:\x20the\x20recorded\x20VALUE\x20is\x20self-attested\x20and\x20has\x20no\x20on-chain\x20readback\x20—\x20never\x20trust\x20the\x20value\x20itself\x20as\x20a\x20gate\x20condition.\x20A\x20PRESENCE\x20gate\x20IS\x20legitimate\x20on-chain\x20(query\x20order.required_info\x20is\x20some\x20—\x20see\x20pattern.required_info_evidence_gate):\x20it\x20proves\x20the\x20buyer\x20recorded\x20a\x20credential\x20before\x20handover,\x20without\x20asserting\x20what\x20the\x20credential\x20says.'),'progress':OperateSchema['optional']()['describe']('Advance\x20order\x20process'),'arb_confirm':ArbConfirmSchema['optional']()['describe']('CUSTOMER-side\x20confirm\x20on\x20an\x20Arb\x20case\x20(the\x20order\x20owner;\x20the\x20arbitration\x20object\x27s\x20own\x20confirm\x20tool\x20is\x20the\x20arbitrator\x27s\x20and\x20rejects\x20customers).\x20'+'Moves\x20the\x20case\x20from\x20state\x200\x20to\x20state\x201.\x20REQUIRED\x20after\x20an\x20arbitrator\x20reset\x20—\x20a\x20reset\x20returns\x20the\x20case\x20to\x20state\x200\x20with\x20the\x20indemnity\x20cleared,\x20'+'and\x20only\x20the\x20customer\x20can\x20advance\x20it\x20again;\x20the\x20fee\x20stays\x20locked\x20until\x20this\x20is\x20called.\x20Not\x20the\x20filing\x20step:\x20filing\x20(dispute)\x20lands\x20the\x20case\x20directly\x20in\x20state\x201.'),'arb_objection':ArbObjectionSchema['optional']()['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration.'),'arb_claim_compensation':ArbClaimCompensationSchema['optional']()['describe']('Specify\x20the\x20adjudicated\x20Arb\x20object\x20to\x20obtain\x20order\x20compensation.\x20Succeeds\x20even\x20when\x20the\x20ruled\x20indemnity\x20is\x200\x20—\x20'+'the\x20claim\x20closes\x20the\x20case\x20(state\x205)\x20and\x20lets\x20the\x20arbitrator\x20withdraw\x20the\x20dispute\x20fee\x20immediately.'),'receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20or\x20other\x20objects\x20received\x20by\x20the\x20order\x20and\x20transfer\x20them\x20to\x20the\x20order\x20owner.\x20'+'Consistent\x20with\x20`owner_receive`\x20on\x20other\x20objects\x20(arbitration/contact/demand/machine/permission/repository/reward/service/treasury).'+RECEIVE_FORMAT_BLOCK_OBJECTS),'transfer_to':AccountOrMark_AddressSchema['optional']()['describe']('Set\x20new\x20owner\x20of\x20the\x20order.\x20Requires\x20order\x20owner\x20permission\x20to\x20set.'),'order_renew':OrderRenewSchema['optional']()['describe']('Renewal\x20in\x20ONE\x20transaction:\x20pays\x20into\x20the\x20order\x27s\x20allocation\x20and\x20advances\x20the\x20renew\x20forward\x20atomically\x20'+'(fund\x20+\x20record\x20+\x20advance\x20in\x20a\x20single\x20step).\x20Replaces\x20the\x20legacy\x203-transaction\x20renewal\x20split.\x20'+'The\x20new\x20Payment\x27s\x20sole\x20recipient\x20is\x20the\x20allocation\x20object\x20itself\x20(enforced\x20on-chain).')})['strict']()['describe']('On-chain,\x20operate\x20on\x20an\x20Order\x20object.');export const CallOrder_InputSchema=z['object']({'data':CallOrder_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
|
|
1
|
+
import{z}from'zod';import{CallEnvSchema,CoinParamSchema,SubmissionCallSchema}from'./base.js';import{OperateSchema,ProgressNextSchema}from'./progress.js';import{AccountOrMark_AddressSchema,DescriptionSchema,LongNameSchema,ManyAccountOrMark_AddressSchema,NameOrAddressSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';import{PaymentInfoSchema}from'../query/index.js';export const ArbConfirmSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'confirm':z['boolean']()['describe']('Whether\x20to\x20confirm\x20that\x20the\x20submitted\x20arbitration\x20materials\x20are\x20valid\x20for\x20arbitration.'),'description':DescriptionSchema['optional']()['describe']('Message\x20description\x20for\x20compensation\x20application.'),'proposition':z['array'](LongNameSchema)['optional']()['describe']('Compensation\x20claims.')})['strict']();export const ArbObjectionSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'objection':DescriptionSchema['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration')})['strict']();export const ArbClaimCompensationSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.')})['strict']();export const OrderRenewSchema=z['object']({'allocation':NameOrAddressSchema['describe']('Allocation\x20object\x20ID\x20or\x20name\x20receiving\x20the\x20renewal\x20funds.'),'type_parameter':z['string']()['describe']('Coin\x20type,\x20e.g.\x20\x220x2::wow::WOW\x22.'),'amount':CoinParamSchema['describe']('Renewal\x20payment.'),'info':PaymentInfoSchema['describe']('PaymentInfo\x20for\x20the\x20new\x20Payment\x20object\x20(remark/index,\x20optional\x20for_object/for_guard).'),'operation':ProgressNextSchema['describe']('Renew\x20forward\x20to\x20advance\x20after\x20the\x20funding\x20lands.'),'message':LongNameSchema['optional']()['describe']('Message\x20attached\x20to\x20the\x20forward\x20advance.')})['strict']();export const CallOrder_DataSchema=z['object']({'object':NameOrAddressSchema['describe']('Order\x20object\x20ID\x20or\x20name.'),'agent':ManyAccountOrMark_AddressSchema['optional']()['describe']('Order\x20agent.\x20Agents\x20can\x20operate\x20the\x20order,\x20such\x20as\x20canceling\x20the\x20order,\x20modifying\x20the\x20order\x20status,\x20etc.;\x20but\x20cannot\x20receive\x20the\x20funds\x20received\x20by\x20the\x20order.'),'required_info':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Credential\x20recorded\x20on\x20the\x20order:\x20the\x20merchant\x27s\x20IM\x20user\x20address\x20resolved\x20from\x20the\x20Service\x27s\x20Contact\x20(zero\x20cost)\x20or\x20a\x20WTS\x20Proof\x20object\x20id\x20(on-chain\x20delivery\x20proof\x20embedding\x20that\x20IM\x20address\x20and\x20timestamp;\x20costs\x20gas).\x20The\x20information\x20itself\x20is\x20delivered\x20via\x20Wowok\x20Messenger.\x20ACCEPTED\x20FORMS\x20(upwc-cat-261017\x20T10\x20live\x20probe):\x20a\x20Contact/Proof\x20object\x20ID\x20(0x…),\x20an\x20account\x20ADDRESS,\x20or\x20a\x20REGISTERED\x20mark\x20name\x20—\x20a\x20bare\x20account\x20display\x20name\x20is\x20not\x20an\x20object\x20reference\x20and\x20fails\x20with\x20\x27not\x20found\x27.\x20WRITE\x20PERMISSION:\x20OWNER-ONLY\x20—\x20only\x20the\x20order\x20owner\x20(the\x20buyer)\x20can\x20set\x20or\x20clear\x20this\x20field;\x20any\x20other\x20signer\x20(including\x20the\x20merchant/service\x20owner)\x20aborts\x20on-chain\x20(MoveAbort\x201,\x20\x27Not\x20the\x20owner\x27).\x20The\x20merchant\x27s\x20role\x20is\x20to\x20READ\x20it\x20and\x20to\x20receive\x20the\x20info\x20over\x20Messenger.\x20ATTESTATION\x20SEMANTICS:\x20the\x20recorded\x20VALUE\x20is\x20self-attested\x20and\x20has\x20no\x20on-chain\x20readback\x20—\x20never\x20trust\x20the\x20value\x20itself\x20as\x20a\x20gate\x20condition.\x20A\x20PRESENCE\x20gate\x20IS\x20legitimate\x20on-chain\x20(query\x20order.required_info\x20is\x20some\x20—\x20see\x20pattern.required_info_evidence_gate):\x20it\x20proves\x20the\x20buyer\x20recorded\x20a\x20credential\x20before\x20handover,\x20without\x20asserting\x20what\x20the\x20credential\x20says.'),'progress':OperateSchema['optional']()['describe']('Advance\x20order\x20process'),'arb_confirm':ArbConfirmSchema['optional']()['describe']('CUSTOMER-side\x20confirm\x20on\x20an\x20Arb\x20case\x20(the\x20order\x20owner;\x20the\x20arbitration\x20object\x27s\x20own\x20confirm\x20tool\x20is\x20the\x20arbitrator\x27s\x20and\x20rejects\x20customers).\x20'+'Moves\x20the\x20case\x20from\x20state\x200\x20to\x20state\x201.\x20REQUIRED\x20after\x20an\x20arbitrator\x20reset\x20—\x20a\x20reset\x20returns\x20the\x20case\x20to\x20state\x200\x20with\x20the\x20indemnity\x20cleared,\x20'+'and\x20only\x20the\x20customer\x20can\x20advance\x20it\x20again;\x20the\x20fee\x20stays\x20locked\x20until\x20this\x20is\x20called.\x20Not\x20the\x20filing\x20step:\x20filing\x20(dispute)\x20lands\x20the\x20case\x20directly\x20in\x20state\x201.'),'arb_objection':ArbObjectionSchema['optional']()['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration.'),'arb_claim_compensation':ArbClaimCompensationSchema['optional']()['describe']('Specify\x20the\x20adjudicated\x20Arb\x20object\x20to\x20obtain\x20order\x20compensation.\x20Succeeds\x20even\x20when\x20the\x20ruled\x20indemnity\x20is\x200\x20—\x20'+'the\x20claim\x20closes\x20the\x20case\x20(state\x205)\x20and\x20lets\x20the\x20arbitrator\x20withdraw\x20the\x20dispute\x20fee\x20immediately.'),'receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20or\x20other\x20objects\x20received\x20by\x20the\x20order\x20and\x20transfer\x20them\x20to\x20the\x20order\x20owner.\x20'+'Consistent\x20with\x20`owner_receive`\x20on\x20other\x20objects\x20(arbitration/contact/demand/machine/permission/repository/reward/service/treasury).'+RECEIVE_FORMAT_BLOCK_OBJECTS),'transfer_to':AccountOrMark_AddressSchema['optional']()['describe']('Set\x20new\x20owner\x20of\x20the\x20order.\x20Requires\x20order\x20owner\x20permission\x20to\x20set.'),'order_renew':OrderRenewSchema['optional']()['describe']('Renewal\x20in\x20ONE\x20transaction:\x20pays\x20into\x20the\x20order\x27s\x20allocation\x20and\x20advances\x20the\x20renew\x20forward\x20atomically\x20'+'(fund\x20+\x20record\x20+\x20advance\x20in\x20a\x20single\x20step).\x20Replaces\x20the\x20legacy\x203-transaction\x20renewal\x20split.\x20'+'The\x20new\x20Payment\x27s\x20sole\x20recipient\x20is\x20the\x20allocation\x20object\x20itself\x20(enforced\x20on-chain).')})['strict']()['describe']('On-chain,\x20operate\x20on\x20an\x20Order\x20object.');export const CallOrder_InputSchema=z['object']({'data':CallOrder_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
|