@wowok/agent-mcp 3.2.1 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/dist/chain-semantics/field-capability.d.ts +11 -0
  2. package/dist/chain-semantics/field-capability.js +1 -0
  3. package/dist/chain-semantics/freeze-map.d.ts +11 -0
  4. package/dist/chain-semantics/freeze-map.js +1 -0
  5. package/dist/chain-semantics/fund-flow.d.ts +10 -0
  6. package/dist/chain-semantics/fund-flow.js +1 -0
  7. package/dist/chain-semantics/guard-verbs.d.ts +22 -0
  8. package/dist/chain-semantics/guard-verbs.js +1 -0
  9. package/dist/chain-semantics/index.d.ts +10 -0
  10. package/dist/chain-semantics/index.js +1 -0
  11. package/dist/chain-semantics/object-graph.d.ts +18 -0
  12. package/dist/chain-semantics/object-graph.js +1 -0
  13. package/dist/communication/wts-attestation.d.ts +34 -0
  14. package/dist/communication/wts-attestation.js +1 -0
  15. package/dist/composition/audit.d.ts +10 -0
  16. package/dist/composition/audit.js +1 -0
  17. package/dist/composition/compile.d.ts +38 -0
  18. package/dist/composition/compile.js +1 -0
  19. package/dist/composition/materialize.d.ts +64 -0
  20. package/dist/composition/materialize.js +1 -0
  21. package/dist/composition/plan.d.ts +92 -0
  22. package/dist/composition/plan.js +1 -0
  23. package/dist/composition/reflux.d.ts +28 -0
  24. package/dist/composition/reflux.js +1 -0
  25. package/dist/config/judgment.d.ts +25 -0
  26. package/dist/config/rule-engine.d.ts +10 -0
  27. package/dist/config/rule-engine.js +1 -1
  28. package/dist/evaluation/builtins/graph-service.spec.js +1 -1
  29. package/dist/evaluation/engine.js +1 -1
  30. package/dist/experience/realtime-feedback.js +1 -1
  31. package/dist/extensions/business-modules.js +1 -1
  32. package/dist/extensions/industry-pack.js +1 -1
  33. package/dist/extensions/modes.js +1 -1
  34. package/dist/graph/onchain/expand.js +1 -1
  35. package/dist/graph/onchain/exposure.js +1 -1
  36. package/dist/graph/onchain/facts.js +1 -1
  37. package/dist/keeper/detectors.d.ts +7 -0
  38. package/dist/keeper/detectors.js +1 -1
  39. package/dist/keeper/types.d.ts +1 -1
  40. package/dist/keeper/types.js +1 -1
  41. package/dist/knowledge/allocation-ledger.js +1 -1
  42. package/dist/knowledge/allocation-puzzle.js +1 -1
  43. package/dist/knowledge/allocation-risk.d.ts +2 -1
  44. package/dist/knowledge/allocation-risk.js +1 -1
  45. package/dist/knowledge/allocation-templates.js +1 -1
  46. package/dist/knowledge/arb-fund-facts.d.ts +31 -0
  47. package/dist/knowledge/arb-fund-facts.js +1 -0
  48. package/dist/knowledge/audit-rules.js +1 -1
  49. package/dist/knowledge/baselines/rules/allocation.json +75 -16
  50. package/dist/knowledge/baselines/rules/guard.json +27 -8
  51. package/dist/knowledge/baselines/rules/plan.json +161 -0
  52. package/dist/knowledge/baselines/semantic-facts.d.ts +12 -0
  53. package/dist/knowledge/baselines/semantic-facts.js +1 -0
  54. package/dist/knowledge/builtin-templates.d.ts +3 -1
  55. package/dist/knowledge/builtin-templates.js +1 -1
  56. package/dist/knowledge/entity-recipient-guard.d.ts +21 -0
  57. package/dist/knowledge/entity-recipient-guard.js +1 -0
  58. package/dist/knowledge/getting-started.js +1 -1
  59. package/dist/knowledge/guard-design-patterns.js +1 -1
  60. package/dist/knowledge/guard-ledger.js +1 -1
  61. package/dist/knowledge/guard-risk.js +1 -1
  62. package/dist/knowledge/guard-templates.js +1 -1
  63. package/dist/knowledge/index.js +1 -1
  64. package/dist/knowledge/industry-registry.js +1 -1
  65. package/dist/knowledge/jsonrpc-enum.js +1 -1
  66. package/dist/knowledge/machine-topology.d.ts +34 -0
  67. package/dist/knowledge/machine-topology.js +1 -1
  68. package/dist/knowledge/onchain-constants.d.ts +2 -2
  69. package/dist/knowledge/onchain-constants.js +1 -1
  70. package/dist/knowledge/scenario-modes.d.ts +13 -0
  71. package/dist/knowledge/scenario-modes.js +1 -1
  72. package/dist/knowledge/service-allocation-semantics.js +1 -1
  73. package/dist/knowledge/service-ledger.js +1 -1
  74. package/dist/knowledge/service-templates.js +1 -1
  75. package/dist/knowledge/strategy-manuals.js +1 -1
  76. package/dist/knowledge/template-loader.d.ts +37 -1
  77. package/dist/knowledge/template-loader.js +1 -1
  78. package/dist/knowledge/template-registry.js +1 -1
  79. package/dist/knowledge/template-scanner.js +1 -1
  80. package/dist/knowledge/tool-constraints.js +1 -1
  81. package/dist/knowledge/tools-reference.js +1 -1
  82. package/dist/knowledge/workflow-guidance.d.ts +4 -0
  83. package/dist/knowledge/workflow-guidance.js +1 -1
  84. package/dist/monitor/MonitorLoop.js +1 -1
  85. package/dist/participation/radar-core.d.ts +6 -0
  86. package/dist/participation/radar-core.js +1 -1
  87. package/dist/playbooks/service-build/business-puzzle.js +1 -1
  88. package/dist/playbooks/service-build/index.d.ts +1 -0
  89. package/dist/playbooks/service-build/intent-analyzer.d.ts +1 -0
  90. package/dist/playbooks/service-build/intent-analyzer.js +1 -1
  91. package/dist/playbooks/service-build/machine-nodes.d.ts +1 -1
  92. package/dist/playbooks/service-build/machine-nodes.js +1 -1
  93. package/dist/playbooks/service-build/machine-panorama.js +1 -1
  94. package/dist/playbooks/service-build/merchant-guide.js +1 -1
  95. package/dist/playbooks/service-build/migration-planner.js +1 -1
  96. package/dist/playbooks/service-build/object-panorama.d.ts +27 -1
  97. package/dist/playbooks/service-build/object-panorama.js +1 -1
  98. package/dist/playbooks/service-build/participation-radar.js +1 -1
  99. package/dist/playbooks/service-build/pipeline-actions.d.ts +4 -0
  100. package/dist/playbooks/service-build/pipeline-actions.js +1 -1
  101. package/dist/playbooks/service-build/relationship-profile.js +1 -1
  102. package/dist/playbooks/service-build/semantic-graph.d.ts +1 -0
  103. package/dist/playbooks/service-build/semantic-graph.js +1 -1
  104. package/dist/playbooks/service-build/service-panorama.js +1 -1
  105. package/dist/playbooks/service-build/service-quote.js +1 -1
  106. package/dist/review/index.js +1 -1
  107. package/dist/safety/confirm-gate.js +1 -1
  108. package/dist/schema/call/machine.d.ts +1 -0
  109. package/dist/schema/call/machine.js +1 -1
  110. package/dist/schema/call/order.d.ts +60 -0
  111. package/dist/schema/call/order.js +1 -1
  112. package/dist/schema/call/semantic.js +1 -1
  113. package/dist/schema/call/service.d.ts +56 -0
  114. package/dist/schema/call/service.js +1 -1
  115. package/dist/schema/common/index.js +1 -1
  116. package/dist/schema/goal/planning.d.ts +7 -0
  117. package/dist/schema/goal/planning.js +1 -1
  118. package/dist/schema/index.d.ts +1 -0
  119. package/dist/schema/index.js +1 -1
  120. package/dist/schema/industry-pack/index.d.ts +26 -0
  121. package/dist/schema/industry-pack/index.js +1 -1
  122. package/dist/schema/local/index.js +1 -1
  123. package/dist/schema/messenger/index.d.ts +20 -0
  124. package/dist/schema/messenger/index.js +1 -1
  125. package/dist/schema/operations.d.ts +50 -0
  126. package/dist/schema/persona/index.d.ts +110 -0
  127. package/dist/schema/query/bi.d.ts +2 -0
  128. package/dist/schema/query/bi.js +1 -1
  129. package/dist/schema/query/index.js +1 -1
  130. package/dist/schema/schema-version.js +1 -1
  131. package/dist/schema/service-clone/index.d.ts +46 -0
  132. package/dist/schema/service-clone/index.js +1 -0
  133. package/dist/schema/utils/node-parser.js +1 -1
  134. package/dist/schema-query-impl/index.js +1 -1
  135. package/dist/schemas/index.json +7 -1
  136. package/dist/schemas/industry_pack_operation.output.json +113 -0
  137. package/dist/schemas/industry_pack_operation.schema.json +7 -1
  138. package/dist/schemas/messenger_operation.output.json +42 -4
  139. package/dist/schemas/onchain_operations.output.json +1 -1
  140. package/dist/schemas/onchain_operations.schema.json +409 -98
  141. package/dist/schemas/onchain_operations_allocation.schema.json +5 -5
  142. package/dist/schemas/onchain_operations_arbitration.schema.json +2 -2
  143. package/dist/schemas/onchain_operations_contact.schema.json +1 -1
  144. package/dist/schemas/onchain_operations_demand.schema.json +3 -3
  145. package/dist/schemas/onchain_operations_gen_passport.schema.json +1 -1
  146. package/dist/schemas/onchain_operations_guard.schema.json +59 -59
  147. package/dist/schemas/onchain_operations_machine.schema.json +3 -3
  148. package/dist/schemas/onchain_operations_order.schema.json +133 -1
  149. package/dist/schemas/onchain_operations_progress.schema.json +1 -1
  150. package/dist/schemas/onchain_operations_proof.schema.json +1 -1
  151. package/dist/schemas/onchain_operations_repository.schema.json +1 -1
  152. package/dist/schemas/onchain_operations_reward.schema.json +4 -4
  153. package/dist/schemas/onchain_operations_service.schema.json +188 -9
  154. package/dist/schemas/onchain_operations_treasury.schema.json +7 -7
  155. package/dist/schemas/onchain_table_data.output.json +5 -1
  156. package/dist/schemas/persona_operation.output.json +266 -0
  157. package/dist/schemas/persona_operation.schema.json +42 -0
  158. package/dist/schemas/query_toolkit.output.json +46 -46
  159. package/dist/schemas/query_toolkit.schema.json +5 -1
  160. package/dist/schemas/service_clone_operation.output.json +168 -0
  161. package/dist/schemas/service_clone_operation.schema.json +49 -0
  162. package/dist/schemas/workflow_operation.schema.json +1 -1
  163. package/dist/tools/handlers/benchmark-migration.d.ts +17 -0
  164. package/dist/tools/handlers/benchmark-migration.js +1 -1
  165. package/dist/tools/handlers/config.js +1 -1
  166. package/dist/tools/handlers/industry-pack.js +1 -1
  167. package/dist/tools/handlers/messenger.js +1 -1
  168. package/dist/tools/handlers/onchain.js +1 -1
  169. package/dist/tools/handlers/query.js +1 -1
  170. package/dist/tools/handlers/service-clone.d.ts +2 -0
  171. package/dist/tools/handlers/service-clone.js +1 -0
  172. package/dist/tools/index.js +1 -1
  173. package/dist/tools/registry/business.js +1 -1
  174. package/dist/tools/wrap.d.ts +6 -1
  175. package/dist/tools/wrap.js +1 -1
  176. package/package.json +4 -3
@@ -1 +1 @@
1
- import{z}from'zod';import{WithPermissionObjectSchema,NamedObjectSchema,ObjectsSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{MachineNodeSchema,MachineForwardSchema}from'../query/index.js';import{ManyAccountOrMark_AddressSchema,NameOrAddressSchema,NameSchema,NotEmptyNameSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS,DescriptionSchema}from'../common/index.js';function validateEntryForward(a){for(const b of a){if(!b['pairs'])continue;for(const c of b['pairs']){if(c['prev_node']==='')return!![];}}return![];}const ENTRY_FORWARD_ERROR_MESSAGE='Machine\x20has\x20no\x20entry\x20forward.\x20At\x20least\x20one\x20node\x20must\x20have\x20a\x20pair\x20with\x20prev_node=\x22\x22\x20(empty\x20string),\x20'+'which\x20defines\x20how\x20Progress\x20advances\x20from\x20the\x20initial\x20state\x20(current=\x22\x22)\x20to\x20the\x20first\x20node.\x20'+'Without\x20an\x20entry\x20forward,\x20the\x20workflow\x20will\x20be\x20permanently\x20stuck.\x20'+'Example:\x20{name:\x20\x27Subscribed\x27,\x20pairs:\x20[{prev_node:\x20\x27\x27,\x20forwards:\x20[{name:\x20\x27Subscribe\x27,\x20weight:\x201}]}]}';export const ProgressNamedOperatorSchema=z['object']({'op':z['union']([z['literal']('add'),z['literal']('set'),z['literal']('remove')]),'name':NotEmptyNameSchema,'operators':ManyAccountOrMark_AddressSchema})['strict']();export const ProgressNewSchema=z['object']({'task':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Task\x20bound\x20to\x20the\x20Progress\x20object.\x20It\x20is\x20an\x20object\x20ID\x20or\x20name'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20Progress\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'progress_namedOperator':ProgressNamedOperatorSchema['optional']()['describe']('Add,\x20set,\x20and\x20remove\x20operators\x20for\x20the\x20permission\x20namespace\x20of\x20the\x20Progress\x20object.'),'namedNew':NamedObjectSchema['optional']()})['strict']();export const NodeAddForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward':z['array'](MachineForwardSchema)['describe']('List\x20of\x20operations\x20between\x20the\x20previous\x20and\x20next\x20nodes.'),'threshold':z['union']([z['number']()['int']()['min'](0x0),z['null']()])['optional']()['describe']('Threshold\x20of\x20operations\x20that\x20need\x20to\x20be\x20completed\x20to\x20migrate\x20from\x20the\x20previous\x20node\x20to\x20the\x20next\x20node.')})['strict']();export const NodeRemoveForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward_name':z['array'](NameSchema)['describe']('List\x20of\x20operation\x20names\x20to\x20delete.')})['strict']();export const NodeRemovePriorNodeDataSchema=z['object']({'prior_node_name':z['array'](NameSchema)['describe']('List\x20of\x20previous\x20node\x20names\x20to\x20delete.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.')})['strict']();export const NodeSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Add\x20nodes.'),z['object']({'op':z['literal']('set'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Set\x20nodes.'),z['object']({'op':z['literal']('remove'),'nodes':z['array'](NameSchema)['describe']('List\x20of\x20node\x20names\x20to\x20delete.')})['strict']()['describe']('Delete\x20nodes.'),z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20all\x20nodes.'),z['object']({'op':z['literal']('exchange'),'node_one':NameSchema['describe']('Name\x20of\x20the\x20first\x20node.'),'node_other':NameSchema['describe']('Name\x20of\x20the\x20second\x20node.')})['strict']()['describe']('Exchange\x20the\x20positions\x20of\x20two\x20nodes.'),z['object']({'op':z['literal']('rename'),'node_name_old':NameSchema['describe']('Name\x20of\x20thenode.'),'node_name_new':NameSchema['describe']('New\x20name\x20of\x20the\x20node.')})['strict']()['describe']('Rename\x20node.'),z['object']({'op':z['literal']('remove\x20prior\x20node'),'pairs':z['array'](NodeRemovePriorNodeDataSchema)['describe']('List\x20of\x20previous-next\x20node\x20pairs\x20to\x20delete.')})['strict']()['describe']('Delete\x20previous-next\x20node\x20pairs.'),z['object']({'op':z['literal']('add\x20forward'),'data':z['array'](NodeAddForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20add.')})['strict']()['describe']('Add\x20operations.'),z['object']({'op':z['literal']('remove\x20forward'),'data':z['array'](NodeRemoveForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20delete.')})['strict']()['describe']('Delete\x20operations.')])['superRefine']((a,b)=>{(a['op']==='add'||a['op']==='set')&&a['bReplace']===!![]&&(!validateEntryForward(a['nodes'])&&b['addIssue']({'code':z['ZodIssueCode']['custom'],'message':ENTRY_FORWARD_ERROR_MESSAGE}));});export const NodeJsonOrMarkdownFileSchema=z['object']({'json_or_markdown_file':z['string']()['describe']('Path\x20to\x20a\x20JSON\x20or\x20Markdown\x20file\x20containing\x20node\x20array\x20for\x20COMPLETE\x20REPLACEMENT\x20of\x20all\x20nodes.\x0a\x0a**File\x20Format\x20Requirements:**\x0a-\x20Must\x20contain\x20a\x20JSON\x20ARRAY\x20of\x20node\x20objects:\x20[{\x22name\x22:\x20\x22...\x22,\x20\x22pairs\x22:\x20[...]},\x20{...}]\x0a-\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field\x20(use\x20NodeSchema\x20for\x20operations)\x0a-\x20Supports\x20JSON\x20or\x20Markdown\x20(with\x20```json\x20code\x20blocks)\x0a\x0a**Node\x20Structure:**\x0aEach\x20node\x20is\x20a\x20directed\x20graph\x20element\x20representing\x20workflow\x20states\x20and\x20transitions:\x0a-\x20name:\x20Node\x20identifier\x0a-\x20role:\x20(optional)\x20business\x20role\x20tag\x20for\x20display\x20layers\x20—\x20one\x20of\x20draft/active/delivered/final/cancelled.\x20SESSION\x20METADATA\x20ONLY\x20(not\x20stored\x20on-chain;\x20echoed\x20back\x20as\x20a\x20NODE\x20ROLES\x20warning)\x0a-\x20pairs:\x20Array\x20of\x20{prior_node,\x20forwards,\x20threshold}\x20defining\x20connections\x0a-\x20forwards:\x20Operations\x20available\x20from\x20this\x20node\x0a-\x20threshold:\x20Required\x20weight\x20to\x20advance\x0a\x0a**Behavior:**\x0a-\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes\x20(equivalent\x20to\x20\x22set\x22\x20with\x20bReplace=true)\x0a-\x20Auto-detects\x20format\x20based\x20on\x20file\x20content\x0a-\x20If\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information')})['strict']();export const NodeFieldSchema=z['union']([NodeSchema,NodeJsonOrMarkdownFileSchema]);export const CallMachine_DataSchema=z['object']({'object':WithPermissionObjectSchema,'progress_new':ProgressNewSchema['optional']()['describe']('Generate\x20new\x20Progress\x20object.'),'description':DescriptionSchema['optional']()['describe']('Description\x20of\x20the\x20object.'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'node':NodeFieldSchema['optional']()['describe']('CRITICAL:\x20Choose\x20ONE\x20of\x20two\x20mutually\x20exclusive\x20modes:\x0a\x0a**Mode\x201:\x20NodeSchema\x20(incremental\x20operations)**\x0aUse\x20for\x20partial\x20modifications:\x20add,\x20set,\x20remove,\x20clear,\x20exchange,\x20rename,\x20remove\x20prior\x20node,\x20add\x20forward,\x20remove\x20forward.\x0aFormat:\x20{\x20\x22op\x22:\x20\x22add\x22,\x20\x22nodes\x22:\x20[...],\x20\x22bReplace\x22:\x20false\x20}\x0aThis\x20mode\x20modifies\x20existing\x20nodes\x20incrementally.\x0a\x0a**Mode\x202:\x20NodeJsonOrMarkdownFileSchema\x20(complete\x20replacement)**\x0aUse\x20for\x20complete\x20node\x20redefinition\x20from\x20file.\x0aFormat:\x20{\x20\x22json_or_markdown_file\x22:\x20\x22/path/to/nodes.json\x22\x20}\x0aIMPORTANT:\x20This\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes.\x20File\x20must\x20contain\x20node\x20array\x20[{...},\x20{...}],\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field.\x0aSupported\x20formats:\x20JSON\x20array\x20or\x20Markdown\x20with\x20code\x20blocks.\x0aIf\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information.'),'pause':z['boolean']()['optional']()['describe']('Whether\x20to\x20pause\x20generating\x20new\x20Progress\x20objects.'),'publish':z['boolean']()['optional']()['describe']('Whether\x20to\x20publish\x20the\x20object.\x20After\x20the\x20object\x20is\x20published,\x20new\x20Progress\x20objects\x20can\x20be\x20generated;\x20and\x20node\x20settings\x20will\x20no\x20longer\x20be\x20changeable.\x20⚠️\x20Before\x20publishing,\x20enumerate\x20the\x20graph\x20STOP\x20NODES\x20(nodes\x20with\x20no\x20outgoing\x20Pair)\x20plus\x20every\x20waiting\x20state\x20(review\x20window,\x20handover,\x20open\x20dispute)\x20and\x20verify\x20each\x20has\x20a\x20defined\x20fund\x20exit\x20in\x20the\x20Service\x20order_allocators\x20—\x20withdrawal\x20(release)\x20AND\x20refund.\x20Machine\x20+\x20Allocator\x20are\x20immutable\x20after\x20publish\x20(IMMUT-001);\x20an\x20uncovered\x20stop\x20node\x20strands\x20funds\x20permanently\x20(rule\x20R-M5-03,\x20checklist\x20pattern.fund_flow_stop_node_coverage).'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Machine\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name.')})['strict']()['refine'](a=>{if(a['publish']!==!![])return!![];if(!a['node'])return!![];if('json_or_markdown_file'in a['node'])return!![];if('nodes'in a['node']&&Array['isArray'](a['node']['nodes'])){const b=typeof a['object']==='object'&&a['object']!==null,c=a['node']['bReplace']===!![];if(b||c){const d=a['node']['nodes'];if(Array['isArray'](d)&&d['length']>0x0&&typeof d[0x0]==='object')return validateEntryForward(d);}}return!![];},{'message':ENTRY_FORWARD_ERROR_MESSAGE})['describe']('On-chain\x20Machine\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Machine.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.');export const CallMachine_InputSchema=z['object']({'data':CallMachine_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();export const MachineNode2File_InputSchema=z['object']({'machine':NameOrAddressSchema['describe']('Machine\x20object\x20ID\x20or\x20name\x20to\x20export'),'file_path':z['string']()['optional']()['describe']('Output\x20file\x20path\x20(absolute\x20or\x20relative).\x20Defaults\x20to\x20the\x20workspace\x20directory\x20when\x20omitted.'),'format':z['enum'](['json','markdown'])['optional']()['default']('json')['describe']('Output\x20format:\x20\x27json\x27\x20(default)\x20or\x20\x27markdown\x27'),'env':CallEnvSchema['optional']()})['strict']()['describe']('Query\x20a\x20Machine\x20object\x20from\x20the\x20blockchain\x20and\x20export\x20its\x20node\x20definition\x20to\x20a\x20JSON\x20or\x20Markdown\x20file.\x20The\x20exported\x20file\x20can\x20be\x20edited\x20and\x20used\x20to\x20create\x20new\x20Machine\x20objects.');export const MachineNode2File_OutputSchema=z['discriminatedUnion']('status',[z['object']({'status':z['literal']('success'),'data':z['object']({'file_path':z['string']()['describe']('Absolute\x20path\x20of\x20the\x20exported\x20file'),'format':z['enum'](['json','markdown'])['describe']('Export\x20format'),'machine_object':NameOrAddressSchema['describe']('Machine\x20object\x20ID'),'node_count':z['number']()['describe']('Number\x20of\x20nodes\x20exported')})['strict']()['describe']('Success\x20result\x20data')})['strict'](),z['object']({'status':z['literal']('error'),'error':z['string']()['describe']('Error\x20message')})['strict']()])['describe']('MachineNode2File\x20operation\x20output');export const MachineNode2File_OutputWrappedSchema=z['object']({'result':MachineNode2File_OutputSchema})['strict']()['describe']('MachineNode2File\x20operation\x20output\x20wrapped\x20schema');
1
+ import{z}from'zod';import{WithPermissionObjectSchema,NamedObjectSchema,ObjectsSchema,CallEnvSchema,SubmissionCallSchema}from'./base.js';import{MachineNodeSchema,MachineForwardSchema}from'../query/index.js';import{ManyAccountOrMark_AddressSchema,NameOrAddressSchema,NameSchema,NotEmptyNameSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS,DescriptionSchema}from'../common/index.js';function gateNumber(a){if(a===null||a===undefined||a==='')return 0x0;const b=Number(a);return Number['isFinite'](b)?b:null;}export function machinePublishGateViolation(a){if(!Array['isArray'](a)||a['length']===0x0)return'The\x20Machine\x20has\x20no\x20nodes,\x20so\x20it\x20cannot\x20be\x20published\x20(E_EMPTY_MACHINE).\x20'+'Publish\x20validates\x20the\x20whole\x20graph:\x20add\x20at\x20least\x20one\x20node,\x20including\x20the\x20first\x20node\x20carrying\x20the\x20'+'entry\x20pair\x20(prev_node:\x20\x22\x22)\x20that\x20Progress\x20starts\x20from\x20—\x20send\x20the\x20nodes\x20in\x20the\x20SAME\x20call\x20as\x20publish:true\x20'+'(bReplace:true,\x20or\x20op:\x22set\x22),\x20because\x20the\x20graph\x20is\x20frozen\x20the\x20moment\x20publish\x20succeeds.';const b=a,c=new Set(b['map'](e=>e?.['name'])['filter'](e=>typeof e==='string'));let d=![];for(const e of b){const f=Array['isArray'](e?.['pairs'])?e['pairs']:[],g=typeof e?.['name']==='string'?e['name']:'<unnamed\x20node>';for(const h of f){const i=typeof h?.['prev_node']==='string'?h['prev_node']:null,j=Array['isArray'](h?.['forwards'])?h['forwards']:[];if(i===''){if(j['length']===0x0)return'The\x20entry\x20pair\x20of\x20node\x20\x22'+g+'\x22\x20(prev_node:\x20\x22\x22)\x20carries\x20no\x20forward\x20(E_EMPTY_ENTRY_PAIR).\x20'+'Progress\x20starts\x20at\x20the\x20empty\x20initial\x20state\x20\x22\x22\x20and\x20can\x20only\x20leave\x20it\x20through\x20an\x20entry\x20forward,\x20so\x20'+'every\x20order\x20on\x20this\x20Machine\x20would\x20be\x20stuck\x20forever.\x20Add\x20at\x20least\x20one\x20forward\x20to\x20that\x20pair.\x20Do\x20NOT\x20'+'delete\x20the\x20entry\x20pair\x20to\x20silence\x20this\x20—\x20a\x20Machine\x20with\x20no\x20entry\x20edge\x20fails\x20the\x20sibling\x20check\x20instead\x20'+'(E_NO_ENTRY_EDGE).';d=!![];}else{if(i!==null&&!c['has'](i))return'The\x20pair\x20of\x20node\x20\x22'+g+'\x22\x20declares\x20prev_node\x20\x22'+i+'\x22,\x20which\x20is\x20not\x20a\x20node\x20of\x20this\x20Machine\x20'+'(E_EDGE_SOURCE_NOT_FOUND)\x20—\x20that\x20edge\x20is\x20unreachable\x20and\x20its\x20source\x20node\x20can\x20never\x20be\x20entered.\x20'+'Fix\x20the\x20name,\x20or\x20add\x20the\x20missing\x20source\x20node.\x20Mind\x20the\x20direction\x20convention:\x20the\x20pair\x20belongs\x20to\x20'+'the\x20node\x20being\x20advanced\x20INTO,\x20with\x20prev_node\x20naming\x20the\x20node\x20it\x20comes\x20from\x20(the\x20entry\x20edge\x20is\x20the\x20'+'one\x20with\x20the\x20EMPTY\x20prev_node).\x20Export\x20the\x20current\x20graph\x20with\x20machineNode2file\x20before\x20editing.';}let k=0x0;for(const m of j){const n=m?.['namedOperator']!==undefined&&m?.['namedOperator']!==null,o=m?.['permissionIndex']!==undefined&&m?.['permissionIndex']!==null;if(!n&&!o)return'Forward\x20\x22'+(m?.['name']??'<unnamed>')+'\x22\x20of\x20node\x20\x22'+g+'\x22\x20names\x20no\x20operator\x20'+'(E_FORWARD_NO_IDENTITY),\x20so\x20nobody\x20can\x20be\x20authorized\x20to\x20execute\x20it\x20and\x20the\x20Machine\x20cannot\x20be\x20'+'published.\x20Set\x20namedOperator\x20(use\x20\x22\x22\x20for\x20the\x20order\x20payer,\x20or\x20a\x20Progress\x20operator\x20namespace)\x20or\x20'+'permissionIndex\x20(a\x20USER_DEFINED\x20index\x20>=\x201000).\x20A\x20guard\x20does\x20NOT\x20satisfy\x20this:\x20it\x20is\x20a\x20'+'post-verification\x20check,\x20not\x20an\x20identity.';const p=gateNumber(m?.['weight']);if(p!==null)k+=p;}const l=gateNumber(h?.['threshold']);if(l!==null&&k<l){const q=i===''?'entry\x20->\x20'+g:i+'\x20->\x20'+g;return'Pair\x20('+q+')\x20can\x20never\x20migrate:\x20its\x20threshold\x20('+l+')\x20is\x20greater\x20than\x20the\x20sum\x20of\x20its\x20'+('forward\x20weights\x20('+k+')\x20(E_UNREACHABLE_THRESHOLD).\x20Each\x20forward\x20contributes\x20its\x20weight\x20AT\x20')+'MOST\x20ONCE\x20—\x20it\x20is\x20locked\x20by\x20the\x20first\x20operator\x20who\x20accomplishes\x20it,\x20and\x20a\x20second\x20operator\x20re-running\x20'+'it\x20aborts\x20E_NOT_THE_HOLDER\x20—\x20so\x20the\x20reachable\x20maximum\x20is\x20the\x20sum\x20of\x20the\x20DISTINCT\x20forward\x20weights.\x20'+'Lower\x20the\x20threshold,\x20or\x20add\x20one\x20distinct\x20forward\x20per\x20contributing\x20operator\x20(threshold\x202\x20->\x20begin_a\x20+\x20'+'begin_b,\x20each\x20weight\x201).\x20Never\x20try\x20to\x20reach\x20a\x20high\x20threshold\x20by\x20re-running\x20one\x20forward\x20repeatedly.';}}}if(!d)return'The\x20Machine\x20has\x20no\x20entry\x20edge\x20(E_NO_ENTRY_EDGE)\x20—\x20no\x20node\x20declares\x20a\x20pair\x20with\x20prev_node:\x20\x22\x22,\x20so\x20'+'Progress\x20starts\x20at\x20the\x20empty\x20initial\x20state\x20and\x20has\x20no\x20edge\x20to\x20advance\x20on.\x20Add\x20the\x20entry\x20pair\x20to\x20your\x20'+'first\x20node:\x20pairs:[{prev_node:\x22\x22,\x20forwards:[{name:\x22start\x22,\x20weight:1,\x20namedOperator:\x22\x22}]}].\x20The\x20fix\x20must\x20'+'land\x20BEFORE\x20publish\x20—\x20machineNode2file\x20exports\x20the\x20current\x20graph\x20so\x20you\x20can\x20diff\x20it\x20against\x20the\x20fixed\x20one.';return null;}function validateEntryForward(a){for(const b of a){if(!b['pairs'])continue;for(const c of b['pairs']){if(c['prev_node']==='')return!![];}}return![];}const ENTRY_FORWARD_ERROR_MESSAGE='Machine\x20has\x20no\x20entry\x20forward.\x20At\x20least\x20one\x20node\x20must\x20have\x20a\x20pair\x20with\x20prev_node=\x22\x22\x20(empty\x20string),\x20'+'which\x20defines\x20how\x20Progress\x20advances\x20from\x20the\x20initial\x20state\x20(current=\x22\x22)\x20to\x20the\x20first\x20node.\x20'+'Without\x20an\x20entry\x20forward,\x20the\x20workflow\x20will\x20be\x20permanently\x20stuck.\x20'+'Example:\x20{name:\x20\x27Subscribed\x27,\x20pairs:\x20[{prev_node:\x20\x27\x27,\x20forwards:\x20[{name:\x20\x27Subscribe\x27,\x20weight:\x201}]}]}';export const ProgressNamedOperatorSchema=z['object']({'op':z['union']([z['literal']('add'),z['literal']('set'),z['literal']('remove')]),'name':NotEmptyNameSchema,'operators':ManyAccountOrMark_AddressSchema})['strict']();export const ProgressNewSchema=z['object']({'task':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Task\x20bound\x20to\x20the\x20Progress\x20object.\x20It\x20is\x20an\x20object\x20ID\x20or\x20name'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20Progress\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'progress_namedOperator':ProgressNamedOperatorSchema['optional']()['describe']('Add,\x20set,\x20and\x20remove\x20operators\x20for\x20the\x20permission\x20namespace\x20of\x20the\x20Progress\x20object.'),'namedNew':NamedObjectSchema['optional']()})['strict']();export const NodeAddForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward':z['array'](MachineForwardSchema)['describe']('List\x20of\x20operations\x20between\x20the\x20previous\x20and\x20next\x20nodes.'),'threshold':z['union']([z['number']()['int']()['min'](0x0),z['null']()])['optional']()['describe']('Threshold\x20of\x20operations\x20that\x20need\x20to\x20be\x20completed\x20to\x20migrate\x20from\x20the\x20previous\x20node\x20to\x20the\x20next\x20node.')})['strict']();export const NodeRemoveForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward_name':z['array'](NameSchema)['describe']('List\x20of\x20operation\x20names\x20to\x20delete.')})['strict']();export const NodeRemovePriorNodeDataSchema=z['object']({'prior_node_name':z['array'](NameSchema)['describe']('List\x20of\x20previous\x20node\x20names\x20to\x20delete.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.')})['strict']();export const NodeSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Add\x20nodes.'),z['object']({'op':z['literal']('set'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Set\x20nodes.'),z['object']({'op':z['literal']('remove'),'nodes':z['array'](NameSchema)['describe']('List\x20of\x20node\x20names\x20to\x20delete.')})['strict']()['describe']('Delete\x20nodes.'),z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20all\x20nodes.'),z['object']({'op':z['literal']('exchange'),'node_one':NameSchema['describe']('Name\x20of\x20the\x20first\x20node.'),'node_other':NameSchema['describe']('Name\x20of\x20the\x20second\x20node.')})['strict']()['describe']('Exchange\x20the\x20positions\x20of\x20two\x20nodes.'),z['object']({'op':z['literal']('rename'),'node_name_old':NameSchema['describe']('Name\x20of\x20thenode.'),'node_name_new':NameSchema['describe']('New\x20name\x20of\x20the\x20node.')})['strict']()['describe']('Rename\x20node.'),z['object']({'op':z['literal']('remove\x20prior\x20node'),'pairs':z['array'](NodeRemovePriorNodeDataSchema)['describe']('List\x20of\x20previous-next\x20node\x20pairs\x20to\x20delete.')})['strict']()['describe']('Delete\x20previous-next\x20node\x20pairs.'),z['object']({'op':z['literal']('add\x20forward'),'data':z['array'](NodeAddForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20add.')})['strict']()['describe']('Add\x20operations.'),z['object']({'op':z['literal']('remove\x20forward'),'data':z['array'](NodeRemoveForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20delete.')})['strict']()['describe']('Delete\x20operations.')])['superRefine']((a,b)=>{(a['op']==='add'||a['op']==='set')&&a['bReplace']===!![]&&(!validateEntryForward(a['nodes'])&&b['addIssue']({'code':z['ZodIssueCode']['custom'],'message':ENTRY_FORWARD_ERROR_MESSAGE}));});export const NodeJsonOrMarkdownFileSchema=z['object']({'json_or_markdown_file':z['string']()['describe']('Path\x20to\x20a\x20JSON\x20or\x20Markdown\x20file\x20containing\x20node\x20array\x20for\x20COMPLETE\x20REPLACEMENT\x20of\x20all\x20nodes.\x0a\x0a**File\x20Format\x20Requirements:**\x0a-\x20Must\x20contain\x20a\x20JSON\x20ARRAY\x20of\x20node\x20objects:\x20[{\x22name\x22:\x20\x22...\x22,\x20\x22pairs\x22:\x20[...]},\x20{...}]\x0a-\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field\x20(use\x20NodeSchema\x20for\x20operations)\x0a-\x20Supports\x20JSON\x20or\x20Markdown\x20(with\x20```json\x20code\x20blocks)\x0a\x0a**Node\x20Structure:**\x0aEach\x20node\x20is\x20a\x20directed\x20graph\x20element\x20representing\x20a\x20workflow\x20STATE\x20that\x20an\x20order\x0acan\x20rest\x20in.\x20Its\x20Pairs\x20are\x20the\x20INCOMING\x20edges\x20—\x20this\x20is\x20the\x20one\x20convention\x20the\x0achain\x20enforces,\x20and\x20getting\x20it\x20backwards\x20silently\x20builds\x20a\x20wrong\x20graph:\x0a-\x20name:\x20Node\x20identifier\x20—\x20the\x20DESTINATION\x20of\x20every\x20pair\x20it\x20owns\x0a-\x20role:\x20(optional)\x20business\x20role\x20tag\x20for\x20display\x20layers\x20—\x20one\x20of\x20draft/active/delivered/final/cancelled.\x20SESSION\x20METADATA\x20ONLY\x20(not\x20stored\x20on-chain;\x20echoed\x20back\x20as\x20a\x20NODE\x20ROLES\x20warning)\x0a-\x20pairs:\x20Array\x20of\x20{prev_node,\x20forwards,\x20threshold}\x20—\x20edges\x20ENTERING\x20this\x20node.\x20The\x20key\x20is\x20`prev_node`;\x20`prior_node`\x20is\x20not\x20recognized\x20and\x20is\x20silently\x20dropped.\x0a-\x20forwards:\x20Operations\x20that\x20advance\x20INTO\x20this\x20node\x20FROM\x20its\x20prev_node\x20(NOT\x20operations\x20available\x20from\x20this\x20node)\x0a-\x20threshold:\x20Weight\x20required\x20to\x20migrate\x20into\x20this\x20node\x20along\x20that\x20pair\x0a\x0aDiagram\x20`A\x20--[Go]-->\x20B`\x20therefore\x20lives\x20in\x20node\x20**B**:\x20{name:\x22B\x22,\x20pairs:[{prev_node:\x22A\x22,\x20forwards:[{name:\x22Go\x22,\x20weight:1}]}]}.\x0a\x0a**Forward\x20names\x20must\x20determine\x20the\x20destination.**\x20`next_node`\x20is\x20a\x20CALLER\x20argument\x0a(progress.move:540)\x20and\x20the\x20chain\x20resolves\x20(current,\x20next_node,\x20forward)\x20inside\x20the\x0adestination\x20node\x20(machine.move:275),\x20so\x20one\x20forward\x20name\x20shared\x20by\x20two\x20destinations\x0afrom\x20the\x20same\x20prev_node\x20is\x20legal\x20and\x20lets\x20the\x20caller\x20pick\x20the\x20outcome\x20—\x20including\x0awhether\x20a\x20refund\x20Allocator\x20ever\x20fires.\x20Give\x20each\x20destination\x20its\x20own\x20forward\x20name.\x0a\x0a**Behavior:**\x0a-\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes\x20(equivalent\x20to\x20\x22set\x22\x20with\x20bReplace=true)\x0a-\x20Auto-detects\x20format\x20based\x20on\x20file\x20content\x0a-\x20If\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information')})['strict']();export const NodeFieldSchema=z['union']([NodeSchema,NodeJsonOrMarkdownFileSchema]);export const CallMachine_DataSchema=z['object']({'object':WithPermissionObjectSchema,'progress_new':ProgressNewSchema['optional']()['describe']('Generate\x20new\x20Progress\x20object.'),'description':DescriptionSchema['optional']()['describe']('Description\x20of\x20the\x20object.'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'node':NodeFieldSchema['optional']()['describe']('CRITICAL:\x20Choose\x20ONE\x20of\x20two\x20mutually\x20exclusive\x20modes:\x0a\x0a**Mode\x201:\x20NodeSchema\x20(incremental\x20operations)**\x0aUse\x20for\x20partial\x20modifications:\x20add,\x20set,\x20remove,\x20clear,\x20exchange,\x20rename,\x20remove\x20prior\x20node,\x20add\x20forward,\x20remove\x20forward.\x0aFormat:\x20{\x20\x22op\x22:\x20\x22add\x22,\x20\x22nodes\x22:\x20[...],\x20\x22bReplace\x22:\x20false\x20}\x0aThis\x20mode\x20modifies\x20existing\x20nodes\x20incrementally.\x0a\x0a**Mode\x202:\x20NodeJsonOrMarkdownFileSchema\x20(complete\x20replacement)**\x0aUse\x20for\x20complete\x20node\x20redefinition\x20from\x20file.\x0aFormat:\x20{\x20\x22json_or_markdown_file\x22:\x20\x22/path/to/nodes.json\x22\x20}\x0aIMPORTANT:\x20This\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes.\x20File\x20must\x20contain\x20node\x20array\x20[{...},\x20{...}],\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field.\x0aSupported\x20formats:\x20JSON\x20array\x20or\x20Markdown\x20with\x20code\x20blocks.\x0aIf\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information.'),'pause':z['boolean']()['optional']()['describe']('Whether\x20to\x20pause\x20generating\x20new\x20Progress\x20objects.'),'publish':z['boolean']()['optional']()['describe']('Whether\x20to\x20publish\x20the\x20object.\x20After\x20the\x20object\x20is\x20published,\x20new\x20Progress\x20objects\x20can\x20be\x20generated;\x20and\x20node\x20settings\x20will\x20no\x20longer\x20be\x20changeable.\x20⚠️\x20PUBLISH\x20IS\x20A\x20ONE-WAY\x20DOOR\x20AND\x20THE\x20CHAIN\x20VALIDATES\x20THE\x20WHOLE\x20GRAPH\x20AT\x20THAT\x20MOMENT:\x20machine::assert_publishable\x20rejects\x20a\x20Machine\x20that\x20is\x20empty,\x20has\x20no\x20entry\x20edge\x20(no\x20pair\x20with\x20prev_node:\x22\x22),\x20has\x20an\x20entry\x20pair\x20with\x20no\x20forward,\x20references\x20a\x20prev_node\x20that\x20is\x20not\x20a\x20node\x20of\x20this\x20Machine,\x20carries\x20a\x20forward\x20with\x20neither\x20namedOperator\x20nor\x20permissionIndex\x20(a\x20guard\x20is\x20NOT\x20an\x20identity),\x20or\x20has\x20a\x20pair\x20whose\x20threshold\x20exceeds\x20the\x20sum\x20of\x20its\x20forward\x20weights\x20(each\x20forward\x20counts\x20at\x20most\x20once).\x20These\x20aborts\x20(machine:17-22)\x20fire\x20BEFORE\x20the\x20publish\x20lands,\x20so\x20the\x20graph\x20is\x20still\x20editable\x20—\x20but\x20after\x20it\x20succeeds,\x20nodes/forwards,\x20Guard\x20bindings\x20and\x20Service.machine\x20are\x20frozen\x20forever,\x20and\x20a\x20broken\x20graph\x20would\x20only\x20surface\x20at\x20the\x20first\x20transition\x20with\x20no\x20repair\x20path.\x20Send\x20the\x20nodes\x20in\x20the\x20SAME\x20call\x20as\x20publish:true\x20(bReplace:true\x20or\x20op:\x22set\x22)\x20so\x20the\x20complete\x20graph\x20is\x20validated\x20together.\x20⚠️\x20Before\x20publishing,\x20enumerate\x20the\x20graph\x20STOP\x20NODES\x20(nodes\x20with\x20no\x20outgoing\x20Pair)\x20plus\x20every\x20waiting\x20state\x20(review\x20window,\x20handover,\x20open\x20dispute)\x20and\x20verify\x20each\x20has\x20a\x20defined\x20fund\x20exit\x20in\x20the\x20Service\x20order_allocators\x20—\x20withdrawal\x20(release)\x20AND\x20refund.\x20Machine\x20+\x20Allocator\x20are\x20immutable\x20after\x20publish\x20(IMMUT-001);\x20an\x20uncovered\x20stop\x20node\x20strands\x20funds\x20permanently\x20(rule\x20R-M5-03,\x20checklist\x20pattern.fund_flow_stop_node_coverage).'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Machine\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name.')})['strict']()['superRefine']((a,b)=>{if(a['publish']!==!![])return;const c=a['node'];if(!c||'json_or_markdown_file'in c)return;if(c['op']!=='add'&&c['op']!=='set')return;const d=typeof a['object']==='object'&&a['object']!==null;if(!d&&c['bReplace']!==!![])return;if(!Array['isArray'](c['nodes'])||c['nodes']['length']===0x0||typeof c['nodes'][0x0]!=='object')return;const e=machinePublishGateViolation(c['nodes']);e&&b['addIssue']({'code':z['ZodIssueCode']['custom'],'message':e});})['describe']('On-chain\x20Machine\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Machine.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.');export const CallMachine_InputSchema=z['object']({'data':CallMachine_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();export const MachineNode2File_InputSchema=z['object']({'machine':NameOrAddressSchema['describe']('Machine\x20object\x20ID\x20or\x20name\x20to\x20export'),'file_path':z['string']()['optional']()['describe']('Output\x20file\x20path\x20(absolute\x20or\x20relative).\x20Defaults\x20to\x20the\x20workspace\x20directory\x20when\x20omitted.'),'format':z['enum'](['json','markdown'])['optional']()['default']('json')['describe']('Output\x20format:\x20\x27json\x27\x20(default)\x20or\x20\x27markdown\x27'),'env':CallEnvSchema['optional']()})['strict']()['describe']('Query\x20a\x20Machine\x20object\x20from\x20the\x20blockchain\x20and\x20export\x20its\x20node\x20definition\x20to\x20a\x20JSON\x20or\x20Markdown\x20file.\x20The\x20exported\x20file\x20can\x20be\x20edited\x20and\x20used\x20to\x20create\x20new\x20Machine\x20objects.');export const MachineNode2File_OutputSchema=z['discriminatedUnion']('status',[z['object']({'status':z['literal']('success'),'data':z['object']({'file_path':z['string']()['describe']('Absolute\x20path\x20of\x20the\x20exported\x20file'),'format':z['enum'](['json','markdown'])['describe']('Export\x20format'),'machine_object':NameOrAddressSchema['describe']('Machine\x20object\x20ID'),'node_count':z['number']()['describe']('Number\x20of\x20nodes\x20exported')})['strict']()['describe']('Success\x20result\x20data')})['strict'](),z['object']({'status':z['literal']('error'),'error':z['string']()['describe']('Error\x20message')})['strict']()])['describe']('MachineNode2File\x20operation\x20output');export const MachineNode2File_OutputWrappedSchema=z['object']({'result':MachineNode2File_OutputSchema})['strict']()['describe']('MachineNode2File\x20operation\x20output\x20wrapped\x20schema');
@@ -12,6 +12,26 @@ export declare const ArbObjectionSchema: z.ZodObject<{
12
12
  export declare const ArbClaimCompensationSchema: z.ZodObject<{
13
13
  arb: z.ZodString;
14
14
  }, z.core.$strict>;
15
+ export declare const OrderRenewSchema: z.ZodObject<{
16
+ allocation: z.ZodString;
17
+ type_parameter: z.ZodString;
18
+ amount: z.ZodUnion<readonly [z.ZodObject<{
19
+ balance: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
20
+ }, z.core.$strip>, z.ZodObject<{
21
+ coin: z.ZodString;
22
+ }, z.core.$strip>]>;
23
+ info: z.ZodObject<{
24
+ for_object: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
25
+ for_guard: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
26
+ remark: z.ZodString;
27
+ index: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
28
+ }, z.core.$strip>;
29
+ operation: z.ZodObject<{
30
+ next_node_name: z.ZodString;
31
+ forward: z.ZodString;
32
+ }, z.core.$strict>;
33
+ message: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$strict>;
15
35
  export declare const CallOrder_DataSchema: z.ZodObject<{
16
36
  object: z.ZodString;
17
37
  agent: z.ZodOptional<z.ZodObject<{
@@ -70,6 +90,26 @@ export declare const CallOrder_DataSchema: z.ZodObject<{
70
90
  name_or_address: z.ZodOptional<z.ZodString>;
71
91
  local_mark_first: z.ZodOptional<z.ZodBoolean>;
72
92
  }, z.core.$strict>>;
93
+ order_renew: z.ZodOptional<z.ZodObject<{
94
+ allocation: z.ZodString;
95
+ type_parameter: z.ZodString;
96
+ amount: z.ZodUnion<readonly [z.ZodObject<{
97
+ balance: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
98
+ }, z.core.$strip>, z.ZodObject<{
99
+ coin: z.ZodString;
100
+ }, z.core.$strip>]>;
101
+ info: z.ZodObject<{
102
+ for_object: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
103
+ for_guard: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
104
+ remark: z.ZodString;
105
+ index: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
106
+ }, z.core.$strip>;
107
+ operation: z.ZodObject<{
108
+ next_node_name: z.ZodString;
109
+ forward: z.ZodString;
110
+ }, z.core.$strict>;
111
+ message: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strict>>;
73
113
  }, z.core.$strict>;
74
114
  export declare const CallOrder_InputSchema: z.ZodObject<{
75
115
  data: z.ZodObject<{
@@ -130,6 +170,26 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
130
170
  name_or_address: z.ZodOptional<z.ZodString>;
131
171
  local_mark_first: z.ZodOptional<z.ZodBoolean>;
132
172
  }, z.core.$strict>>;
173
+ order_renew: z.ZodOptional<z.ZodObject<{
174
+ allocation: z.ZodString;
175
+ type_parameter: z.ZodString;
176
+ amount: z.ZodUnion<readonly [z.ZodObject<{
177
+ balance: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
178
+ }, z.core.$strip>, z.ZodObject<{
179
+ coin: z.ZodString;
180
+ }, z.core.$strip>]>;
181
+ info: z.ZodObject<{
182
+ for_object: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
183
+ for_guard: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
184
+ remark: z.ZodString;
185
+ index: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
186
+ }, z.core.$strip>;
187
+ operation: z.ZodObject<{
188
+ next_node_name: z.ZodString;
189
+ forward: z.ZodString;
190
+ }, z.core.$strict>;
191
+ message: z.ZodOptional<z.ZodString>;
192
+ }, z.core.$strict>>;
133
193
  }, z.core.$strict>;
134
194
  env: z.ZodOptional<z.ZodObject<{
135
195
  account: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -1 +1 @@
1
- import{z}from'zod';import{CallEnvSchema,SubmissionCallSchema}from'./base.js';import{OperateSchema}from'./progress.js';import{AccountOrMark_AddressSchema,DescriptionSchema,LongNameSchema,ManyAccountOrMark_AddressSchema,NameOrAddressSchema,ReceivedObjectsOrRecentlySchema,RECEIVE_FORMAT_BLOCK_OBJECTS}from'../common/index.js';export const ArbConfirmSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'confirm':z['boolean']()['describe']('Whether\x20to\x20confirm\x20that\x20the\x20submitted\x20arbitration\x20materials\x20are\x20valid\x20for\x20arbitration.'),'description':DescriptionSchema['optional']()['describe']('Message\x20description\x20for\x20compensation\x20application.'),'proposition':z['array'](LongNameSchema)['optional']()['describe']('Compensation\x20claims.')})['strict']();export const ArbObjectionSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.'),'objection':DescriptionSchema['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration')})['strict']();export const ArbClaimCompensationSchema=z['object']({'arb':NameOrAddressSchema['describe']('Arb\x20object\x20ID\x20or\x20name.')})['strict']();export const CallOrder_DataSchema=z['object']({'object':NameOrAddressSchema['describe']('Order\x20object\x20ID\x20or\x20name.'),'agent':ManyAccountOrMark_AddressSchema['optional']()['describe']('Order\x20agent.\x20Agents\x20can\x20operate\x20the\x20order,\x20such\x20as\x20canceling\x20the\x20order,\x20modifying\x20the\x20order\x20status,\x20etc.;\x20but\x20cannot\x20receive\x20the\x20funds\x20received\x20by\x20the\x20order.'),'required_info':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('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.'),'progress':OperateSchema['optional']()['describe']('Advance\x20order\x20process'),'arb_confirm':ArbConfirmSchema['optional']()['describe']('CUSTOMER-side\x20confirm\x20on\x20an\x20Arb\x20case\x20(the\x20order\x20owner;\x20the\x20arbitration\x20object\x27s\x20own\x20confirm\x20tool\x20is\x20the\x20arbitrator\x27s\x20and\x20rejects\x20customers).\x20'+'Moves\x20the\x20case\x20from\x20state\x200\x20to\x20state\x201.\x20REQUIRED\x20after\x20an\x20arbitrator\x20reset\x20—\x20a\x20reset\x20returns\x20the\x20case\x20to\x20state\x200\x20with\x20the\x20indemnity\x20cleared,\x20'+'and\x20only\x20the\x20customer\x20can\x20advance\x20it\x20again;\x20the\x20fee\x20stays\x20locked\x20until\x20this\x20is\x20called.\x20Not\x20the\x20filing\x20step:\x20filing\x20(dispute)\x20lands\x20the\x20case\x20directly\x20in\x20state\x201.'),'arb_objection':ArbObjectionSchema['optional']()['describe']('Oppose\x20and\x20appeal\x20the\x20arbitration\x20result,\x20request\x20re-arbitration.'),'arb_claim_compensation':ArbClaimCompensationSchema['optional']()['describe']('Specify\x20the\x20adjudicated\x20Arb\x20object\x20to\x20obtain\x20order\x20compensation.\x20Succeeds\x20even\x20when\x20the\x20ruled\x20indemnity\x20is\x200\x20—\x20'+'the\x20claim\x20closes\x20the\x20case\x20(state\x205)\x20and\x20lets\x20the\x20arbitrator\x20withdraw\x20the\x20dispute\x20fee\x20immediately.'),'receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20or\x20other\x20objects\x20received\x20by\x20the\x20order\x20and\x20transfer\x20them\x20to\x20the\x20order\x20owner.\x20'+'Consistent\x20with\x20`owner_receive`\x20on\x20other\x20objects\x20(arbitration/contact/demand/machine/permission/repository/reward/service/treasury).'+RECEIVE_FORMAT_BLOCK_OBJECTS),'transfer_to':AccountOrMark_AddressSchema['optional']()['describe']('Set\x20new\x20owner\x20of\x20the\x20order.\x20Requires\x20order\x20owner\x20permission\x20to\x20set.')})['strict']()['describe']('On-chain,\x20operate\x20on\x20an\x20Order\x20object.');export const CallOrder_InputSchema=z['object']({'data':CallOrder_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();
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.'),'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']();