@wowok/agent-mcp 3.2.7 → 3.3.0
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/README.md +2 -2
- 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.js +1 -1
- package/dist/composition/compile.d.ts +10 -1
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.d.ts +10 -0
- package/dist/composition/inflight.js +1 -1
- package/dist/extensions/business-modules.d.ts +1 -1
- package/dist/extensions/business-modules.js +1 -1
- package/dist/extensions/capability-manifest.js +1 -1
- package/dist/extensions/industry-audit.spec.js +1 -1
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/graph/onchain/edge-schema.js +1 -1
- package/dist/graph/onchain/facts.spec.js +1 -1
- package/dist/graph/onchain/field-manifest.js +1 -1
- package/dist/harness/index.d.ts +1 -0
- package/dist/harness/index.js +1 -1
- package/dist/harness/operation-id.d.ts +1 -0
- package/dist/harness/operation-id.js +1 -0
- package/dist/harness/recover.js +1 -1
- package/dist/index.js +1 -1
- package/dist/intent/types.d.ts +1 -1
- package/dist/intent/types.js +1 -1
- package/dist/keeper/KeeperScan.d.ts +2 -1
- package/dist/keeper/KeeperScan.js +1 -1
- package/dist/keeper/keeper.spec.js +1 -1
- package/dist/keeper/types.d.ts +3 -0
- package/dist/keeper/types.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.d.ts +34 -0
- package/dist/knowledge/allocator-rail-verifier.js +1 -0
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/arbitration-templates.js +1 -1
- package/dist/knowledge/arbitration-venue-order.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +19 -1
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/alloc_audit.json +1 -1
- package/dist/knowledge/baselines/rules/arb.json +1 -1
- package/dist/knowledge/baselines/rules/guard.json +106 -1
- package/dist/knowledge/baselines/rules/machine.json +9 -6
- package/dist/knowledge/baselines/rules/plan.json +40 -17
- package/dist/knowledge/baselines/semantic-facts.js +1 -1
- package/dist/knowledge/builtin-templates.d.ts +1 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/contract-invariants.js +1 -1
- package/dist/knowledge/discount-threshold.d.ts +11 -0
- package/dist/knowledge/discount-threshold.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-anchor-reach.d.ts +1 -1
- package/dist/knowledge/guard-anchor-reach.js +1 -1
- package/dist/knowledge/guard-bindings.js +1 -1
- package/dist/knowledge/guard-design-patterns.d.ts +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-field-cognition.js +1 -1
- package/dist/knowledge/guard-ledger.js +1 -1
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.d.ts +1 -0
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-submission-brief.d.ts +6 -0
- package/dist/knowledge/guard-submission-brief.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +2 -2
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-ledger.js +1 -1
- package/dist/knowledge/machine-puzzle.d.ts +1 -1
- package/dist/knowledge/machine-puzzle.js +1 -1
- package/dist/knowledge/machine-risk.js +1 -1
- package/dist/knowledge/machine-templates.js +1 -1
- package/dist/knowledge/machine-topology.d.ts +8 -0
- package/dist/knowledge/machine-topology.js +1 -1
- package/dist/knowledge/machine-translation.js +1 -1
- package/dist/knowledge/order-ledger.js +1 -1
- package/dist/knowledge/permission-ledger.js +1 -1
- package/dist/knowledge/protocol-facts.d.ts +16 -0
- package/dist/knowledge/protocol-facts.js +1 -0
- package/dist/knowledge/recipient-constraint.js +1 -1
- package/dist/knowledge/reward-ledger.d.ts +2 -1
- package/dist/knowledge/reward-ledger.js +1 -1
- package/dist/knowledge/reward-templates.js +1 -1
- package/dist/knowledge/safety-rules.d.ts +0 -2
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +7 -0
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-loader.d.ts +13 -1
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +2 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/tool-constraints.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +7 -3
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/monitor/normalize.d.ts +1 -1
- package/dist/monitor/normalize.js +1 -1
- package/dist/monitor/types.d.ts +1 -1
- package/dist/monitor/types.js +1 -1
- package/dist/participation/radar-core.d.ts +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/game-theory.d.ts +1 -0
- package/dist/playbooks/service-build/game-theory.js +1 -1
- package/dist/playbooks/service-build/intent-analyzer.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +8 -0
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/object-panorama.d.ts +28 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.d.ts +2 -0
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/reverse-mapping-nk4.spec.js +1 -1
- package/dist/playbooks/service-build/reverse-mapping.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/relationship/registry.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/role/profiles.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/safety/preview.d.ts +1 -0
- package/dist/safety/preview.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +19 -1
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +1 -1
- package/dist/schema/call/arbitration.d.ts +8 -8
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +52 -5
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +3 -0
- package/dist/schema/call/contact.d.ts +5 -5
- package/dist/schema/call/demand.d.ts +5 -5
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/guard.d.ts +3 -3
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +13 -5
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/order.d.ts +5 -5
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/permission.d.ts +5 -5
- package/dist/schema/call/personal.d.ts +4 -4
- package/dist/schema/call/progress.d.ts +5 -5
- package/dist/schema/call/progress.js +1 -1
- package/dist/schema/call/proof.js +1 -1
- package/dist/schema/call/receipt.d.ts +8 -0
- package/dist/schema/call/receipt.js +1 -1
- package/dist/schema/call/repository.d.ts +9 -9
- package/dist/schema/call/repository.js +1 -1
- package/dist/schema/call/reward.d.ts +25 -5
- package/dist/schema/call/reward.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +10 -5
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +5 -5
- package/dist/schema/common/index.d.ts +6 -6
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/goal/index.d.ts +17 -1
- package/dist/schema/goal/planning.d.ts +28 -2
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +3 -0
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +9 -0
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/local/index.d.ts +31 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +57 -43
- package/dist/schema/operations.js +1 -1
- package/dist/schema/query/bi.d.ts +22 -6
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +164 -102
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-query/index.d.ts +2 -0
- package/dist/schema/schema-query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/utils/permission-machine-check.d.ts +2 -0
- package/dist/schema/utils/permission-machine-check.js +1 -1
- package/dist/schema/workflow/index.d.ts +1 -1
- package/dist/schema-query-impl/index.d.ts +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +3 -0
- package/dist/schemas/account_operation.schema.json +4 -4
- package/dist/schemas/benchmark_migration_operation.output.json +42 -0
- package/dist/schemas/benchmark_migration_operation.schema.json +40 -3
- package/dist/schemas/bridge_operation.output.json +3 -0
- package/dist/schemas/goal_operation.schema.json +52 -2
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +8 -0
- package/dist/schemas/industry_pack_operation.schema.json +9 -0
- package/dist/schemas/intent_radar.output.json +8 -2
- package/dist/schemas/intent_radar.schema.json +4 -1
- package/dist/schemas/local_cache_operation.output.json +3 -0
- package/dist/schemas/local_history_operation.output.json +3 -0
- package/dist/schemas/local_info_operation.output.json +3 -0
- package/dist/schemas/local_mark_operation.output.json +3 -0
- package/dist/schemas/messenger_operation.schema.json +4 -4
- package/dist/schemas/monitor_events.schema.json +3 -1
- package/dist/schemas/onchain_events.output.json +275 -11
- package/dist/schemas/onchain_events.schema.json +25 -1
- package/dist/schemas/onchain_operations.output.json +47 -5
- package/dist/schemas/onchain_operations.schema.json +664 -179
- package/dist/schemas/onchain_operations_allocation.schema.json +7 -7
- package/dist/schemas/onchain_operations_arbitration.schema.json +21 -15
- package/dist/schemas/onchain_operations_contact.schema.json +15 -10
- package/dist/schemas/onchain_operations_demand.schema.json +15 -10
- package/dist/schemas/onchain_operations_gen_passport.schema.json +5 -5
- package/dist/schemas/onchain_operations_gen_proof.schema.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +346 -8
- package/dist/schemas/onchain_operations_machine.schema.json +24 -11
- package/dist/schemas/onchain_operations_order.schema.json +17 -12
- package/dist/schemas/onchain_operations_permission.schema.json +10 -5
- package/dist/schemas/onchain_operations_personal.schema.json +2 -2
- package/dist/schemas/onchain_operations_progress.schema.json +17 -12
- package/dist/schemas/onchain_operations_proof.schema.json +6 -6
- package/dist/schemas/onchain_operations_repository.schema.json +19 -14
- package/dist/schemas/onchain_operations_reward.schema.json +96 -15
- package/dist/schemas/onchain_operations_service.schema.json +33 -21
- package/dist/schemas/onchain_operations_treasury.schema.json +15 -10
- package/dist/schemas/onchain_table_data.output.json +7 -7
- package/dist/schemas/query_toolkit.output.json +268 -44
- package/dist/schemas/query_toolkit.schema.json +1 -1
- package/dist/schemas/schema_query.schema.json +7 -2
- package/dist/schemas/workflow_operation.schema.json +5 -5
- package/dist/schemas/wowok_buildin_info.output.json +140 -3
- package/dist/schemas/wowok_buildin_info.schema.json +2 -2
- package/dist/tools/handlers/benchmark-migration.d.ts +66 -1
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/dispatch-expectations.d.ts +0 -1
- package/dist/tools/handlers/dispatch-expectations.js +1 -1
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/intent-radar.js +1 -1
- package/dist/tools/handlers/keeper.d.ts +1 -1
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +12 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.d.ts +1 -0
- package/dist/tools/handlers/query.js +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/index.js +1 -1
- package/dist/tools/move-fn-index.gen.js +1 -1
- package/dist/tools/registry/agent.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/files.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/rules-hook.js +1 -1
- package/dist/tools/upgrade-check.d.ts +23 -0
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wip-deploy-assist.d.ts +6 -0
- package/dist/tools/wip-deploy-assist.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ERROR_CODE_VALUES=['invalid_parameter','guard_rejected','state_conflict','insufficient_balance','transaction_expired','stock_exhausted','sale_suspended','discount_invalid','object_not_found','permission_denied','time_lock_not_elapsed','immutable_violation','network_error','rate_limit','gas_exceeded','bcs_error','signature_error','config_error','wip_verification_failed','wip_storage_unavailable','submission_unknown','move_abort_unmapped','unknown'];
|
|
1
|
+
export const ERROR_CODE_VALUES=['invalid_parameter','guard_rejected','state_conflict','insufficient_balance','transaction_expired','stock_exhausted','sale_suspended','discount_invalid','object_not_found','permission_denied','time_lock_not_elapsed','immutable_violation','network_error','rate_limit','gas_exceeded','insufficient_gas','bcs_error','signature_error','config_error','wip_verification_failed','wip_storage_unavailable','wip_storage_rejected','submission_unknown','move_abort_unmapped','missing_data','unknown'];
|
|
@@ -92,7 +92,7 @@ export declare const CallGuard_DataSchema: z.ZodObject<{
|
|
|
92
92
|
table: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
93
93
|
identifier: z.ZodNumber;
|
|
94
94
|
b_submission: z.ZodBoolean;
|
|
95
|
-
value_type: z.ZodUnion<readonly [z.ZodLiteral<ValueType.Bool>, z.ZodLiteral<ValueType.Address>, z.ZodLiteral<ValueType.String>, z.ZodLiteral<ValueType.U8>, z.ZodLiteral<ValueType.U16>, z.ZodLiteral<ValueType.U32>, z.ZodLiteral<ValueType.U64>, z.ZodLiteral<ValueType.U128>, z.ZodLiteral<ValueType.U256>, z.ZodLiteral<ValueType.VecBool>, z.ZodLiteral<ValueType.VecAddress>, z.ZodLiteral<ValueType.VecString>, z.ZodLiteral<ValueType.VecU8>, z.ZodLiteral<ValueType.VecU16>, z.ZodLiteral<ValueType.VecU32>, z.ZodLiteral<ValueType.VecU64>, z.ZodLiteral<ValueType.VecU128>, z.ZodLiteral<ValueType.VecU256>, z.ZodLiteral<ValueType.VecVecU8>, z.ZodLiteral<"Bool">, z.ZodLiteral<"Address">, z.ZodLiteral<"String">, z.ZodLiteral<"U8">, z.ZodLiteral<"U16">, z.ZodLiteral<"U32">, z.ZodLiteral<"U64">, z.ZodLiteral<"U128">, z.ZodLiteral<"U256">, z.ZodLiteral<"VecBool">, z.ZodLiteral<"VecAddress">, z.ZodLiteral<"VecString">, z.ZodLiteral<"VecU8">, z.ZodLiteral<"VecU16">, z.ZodLiteral<"VecU32">, z.ZodLiteral<"VecU64">, z.ZodLiteral<"VecU128">, z.ZodLiteral<"VecU256">, z.ZodLiteral<"VecVecU8">, z.ZodLiteral<"bool">, z.ZodLiteral<"address">, z.ZodLiteral<"string">, z.ZodLiteral<"u8">, z.ZodLiteral<"u16">, z.ZodLiteral<"u32">, z.ZodLiteral<"u64">, z.ZodLiteral<"u128">, z.ZodLiteral<"u256">, z.ZodLiteral<"vecbool">, z.ZodLiteral<"vecaddress">, z.ZodLiteral<"vecstring">, z.ZodLiteral<"vecu8">, z.ZodLiteral<"vecu16">, z.ZodLiteral<"vecu32">, z.ZodLiteral<"vecu64">, z.ZodLiteral<"vecu128">, z.ZodLiteral<"vecu256">, z.ZodLiteral<"vecvecu8">]
|
|
95
|
+
value_type: z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<ValueType.Bool>, z.ZodLiteral<ValueType.Address>, z.ZodLiteral<ValueType.String>, z.ZodLiteral<ValueType.U8>, z.ZodLiteral<ValueType.U16>, z.ZodLiteral<ValueType.U32>, z.ZodLiteral<ValueType.U64>, z.ZodLiteral<ValueType.U128>, z.ZodLiteral<ValueType.U256>, z.ZodLiteral<ValueType.VecBool>, z.ZodLiteral<ValueType.VecAddress>, z.ZodLiteral<ValueType.VecString>, z.ZodLiteral<ValueType.VecU8>, z.ZodLiteral<ValueType.VecU16>, z.ZodLiteral<ValueType.VecU32>, z.ZodLiteral<ValueType.VecU64>, z.ZodLiteral<ValueType.VecU128>, z.ZodLiteral<ValueType.VecU256>, z.ZodLiteral<ValueType.VecVecU8>, z.ZodLiteral<"Bool">, z.ZodLiteral<"Address">, z.ZodLiteral<"String">, z.ZodLiteral<"U8">, z.ZodLiteral<"U16">, z.ZodLiteral<"U32">, z.ZodLiteral<"U64">, z.ZodLiteral<"U128">, z.ZodLiteral<"U256">, z.ZodLiteral<"VecBool">, z.ZodLiteral<"VecAddress">, z.ZodLiteral<"VecString">, z.ZodLiteral<"VecU8">, z.ZodLiteral<"VecU16">, z.ZodLiteral<"VecU32">, z.ZodLiteral<"VecU64">, z.ZodLiteral<"VecU128">, z.ZodLiteral<"VecU256">, z.ZodLiteral<"VecVecU8">, z.ZodLiteral<"bool">, z.ZodLiteral<"address">, z.ZodLiteral<"string">, z.ZodLiteral<"u8">, z.ZodLiteral<"u16">, z.ZodLiteral<"u32">, z.ZodLiteral<"u64">, z.ZodLiteral<"u128">, z.ZodLiteral<"u256">, z.ZodLiteral<"vecbool">, z.ZodLiteral<"vecaddress">, z.ZodLiteral<"vecstring">, z.ZodLiteral<"vecu8">, z.ZodLiteral<"vecu16">, z.ZodLiteral<"vecu32">, z.ZodLiteral<"vecu64">, z.ZodLiteral<"vecu128">, z.ZodLiteral<"vecu256">, z.ZodLiteral<"vecvecu8">]>>;
|
|
96
96
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodUnion<readonly [z.ZodObject<{
|
|
97
97
|
name_or_address: z.ZodOptional<z.ZodString>;
|
|
98
98
|
local_mark_first: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -169,7 +169,7 @@ export declare const CallGuard_InputSchema: z.ZodObject<{
|
|
|
169
169
|
table: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
170
170
|
identifier: z.ZodNumber;
|
|
171
171
|
b_submission: z.ZodBoolean;
|
|
172
|
-
value_type: z.ZodUnion<readonly [z.ZodLiteral<ValueType.Bool>, z.ZodLiteral<ValueType.Address>, z.ZodLiteral<ValueType.String>, z.ZodLiteral<ValueType.U8>, z.ZodLiteral<ValueType.U16>, z.ZodLiteral<ValueType.U32>, z.ZodLiteral<ValueType.U64>, z.ZodLiteral<ValueType.U128>, z.ZodLiteral<ValueType.U256>, z.ZodLiteral<ValueType.VecBool>, z.ZodLiteral<ValueType.VecAddress>, z.ZodLiteral<ValueType.VecString>, z.ZodLiteral<ValueType.VecU8>, z.ZodLiteral<ValueType.VecU16>, z.ZodLiteral<ValueType.VecU32>, z.ZodLiteral<ValueType.VecU64>, z.ZodLiteral<ValueType.VecU128>, z.ZodLiteral<ValueType.VecU256>, z.ZodLiteral<ValueType.VecVecU8>, z.ZodLiteral<"Bool">, z.ZodLiteral<"Address">, z.ZodLiteral<"String">, z.ZodLiteral<"U8">, z.ZodLiteral<"U16">, z.ZodLiteral<"U32">, z.ZodLiteral<"U64">, z.ZodLiteral<"U128">, z.ZodLiteral<"U256">, z.ZodLiteral<"VecBool">, z.ZodLiteral<"VecAddress">, z.ZodLiteral<"VecString">, z.ZodLiteral<"VecU8">, z.ZodLiteral<"VecU16">, z.ZodLiteral<"VecU32">, z.ZodLiteral<"VecU64">, z.ZodLiteral<"VecU128">, z.ZodLiteral<"VecU256">, z.ZodLiteral<"VecVecU8">, z.ZodLiteral<"bool">, z.ZodLiteral<"address">, z.ZodLiteral<"string">, z.ZodLiteral<"u8">, z.ZodLiteral<"u16">, z.ZodLiteral<"u32">, z.ZodLiteral<"u64">, z.ZodLiteral<"u128">, z.ZodLiteral<"u256">, z.ZodLiteral<"vecbool">, z.ZodLiteral<"vecaddress">, z.ZodLiteral<"vecstring">, z.ZodLiteral<"vecu8">, z.ZodLiteral<"vecu16">, z.ZodLiteral<"vecu32">, z.ZodLiteral<"vecu64">, z.ZodLiteral<"vecu128">, z.ZodLiteral<"vecu256">, z.ZodLiteral<"vecvecu8">]
|
|
172
|
+
value_type: z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<ValueType.Bool>, z.ZodLiteral<ValueType.Address>, z.ZodLiteral<ValueType.String>, z.ZodLiteral<ValueType.U8>, z.ZodLiteral<ValueType.U16>, z.ZodLiteral<ValueType.U32>, z.ZodLiteral<ValueType.U64>, z.ZodLiteral<ValueType.U128>, z.ZodLiteral<ValueType.U256>, z.ZodLiteral<ValueType.VecBool>, z.ZodLiteral<ValueType.VecAddress>, z.ZodLiteral<ValueType.VecString>, z.ZodLiteral<ValueType.VecU8>, z.ZodLiteral<ValueType.VecU16>, z.ZodLiteral<ValueType.VecU32>, z.ZodLiteral<ValueType.VecU64>, z.ZodLiteral<ValueType.VecU128>, z.ZodLiteral<ValueType.VecU256>, z.ZodLiteral<ValueType.VecVecU8>, z.ZodLiteral<"Bool">, z.ZodLiteral<"Address">, z.ZodLiteral<"String">, z.ZodLiteral<"U8">, z.ZodLiteral<"U16">, z.ZodLiteral<"U32">, z.ZodLiteral<"U64">, z.ZodLiteral<"U128">, z.ZodLiteral<"U256">, z.ZodLiteral<"VecBool">, z.ZodLiteral<"VecAddress">, z.ZodLiteral<"VecString">, z.ZodLiteral<"VecU8">, z.ZodLiteral<"VecU16">, z.ZodLiteral<"VecU32">, z.ZodLiteral<"VecU64">, z.ZodLiteral<"VecU128">, z.ZodLiteral<"VecU256">, z.ZodLiteral<"VecVecU8">, z.ZodLiteral<"bool">, z.ZodLiteral<"address">, z.ZodLiteral<"string">, z.ZodLiteral<"u8">, z.ZodLiteral<"u16">, z.ZodLiteral<"u32">, z.ZodLiteral<"u64">, z.ZodLiteral<"u128">, z.ZodLiteral<"u256">, z.ZodLiteral<"vecbool">, z.ZodLiteral<"vecaddress">, z.ZodLiteral<"vecstring">, z.ZodLiteral<"vecu8">, z.ZodLiteral<"vecu16">, z.ZodLiteral<"vecu32">, z.ZodLiteral<"vecu64">, z.ZodLiteral<"vecu128">, z.ZodLiteral<"vecu256">, z.ZodLiteral<"vecvecu8">]>>;
|
|
173
173
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodUnion<readonly [z.ZodObject<{
|
|
174
174
|
name_or_address: z.ZodOptional<z.ZodString>;
|
|
175
175
|
local_mark_first: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -275,7 +275,7 @@ export declare const CallGenPassport_InputSchema: z.ZodObject<{
|
|
|
275
275
|
submission: z.ZodArray<z.ZodObject<{
|
|
276
276
|
identifier: z.ZodNumber;
|
|
277
277
|
b_submission: z.ZodBoolean;
|
|
278
|
-
value_type: z.ZodUnion<readonly [z.ZodLiteral<ValueType.Bool>, z.ZodLiteral<ValueType.Address>, z.ZodLiteral<ValueType.String>, z.ZodLiteral<ValueType.U8>, z.ZodLiteral<ValueType.U16>, z.ZodLiteral<ValueType.U32>, z.ZodLiteral<ValueType.U64>, z.ZodLiteral<ValueType.U128>, z.ZodLiteral<ValueType.U256>, z.ZodLiteral<ValueType.VecBool>, z.ZodLiteral<ValueType.VecAddress>, z.ZodLiteral<ValueType.VecString>, z.ZodLiteral<ValueType.VecU8>, z.ZodLiteral<ValueType.VecU16>, z.ZodLiteral<ValueType.VecU32>, z.ZodLiteral<ValueType.VecU64>, z.ZodLiteral<ValueType.VecU128>, z.ZodLiteral<ValueType.VecU256>, z.ZodLiteral<ValueType.VecVecU8>, z.ZodLiteral<"Bool">, z.ZodLiteral<"Address">, z.ZodLiteral<"String">, z.ZodLiteral<"U8">, z.ZodLiteral<"U16">, z.ZodLiteral<"U32">, z.ZodLiteral<"U64">, z.ZodLiteral<"U128">, z.ZodLiteral<"U256">, z.ZodLiteral<"VecBool">, z.ZodLiteral<"VecAddress">, z.ZodLiteral<"VecString">, z.ZodLiteral<"VecU8">, z.ZodLiteral<"VecU16">, z.ZodLiteral<"VecU32">, z.ZodLiteral<"VecU64">, z.ZodLiteral<"VecU128">, z.ZodLiteral<"VecU256">, z.ZodLiteral<"VecVecU8">, z.ZodLiteral<"bool">, z.ZodLiteral<"address">, z.ZodLiteral<"string">, z.ZodLiteral<"u8">, z.ZodLiteral<"u16">, z.ZodLiteral<"u32">, z.ZodLiteral<"u64">, z.ZodLiteral<"u128">, z.ZodLiteral<"u256">, z.ZodLiteral<"vecbool">, z.ZodLiteral<"vecaddress">, z.ZodLiteral<"vecstring">, z.ZodLiteral<"vecu8">, z.ZodLiteral<"vecu16">, z.ZodLiteral<"vecu32">, z.ZodLiteral<"vecu64">, z.ZodLiteral<"vecu128">, z.ZodLiteral<"vecu256">, z.ZodLiteral<"vecvecu8">]
|
|
278
|
+
value_type: z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<ValueType.Bool>, z.ZodLiteral<ValueType.Address>, z.ZodLiteral<ValueType.String>, z.ZodLiteral<ValueType.U8>, z.ZodLiteral<ValueType.U16>, z.ZodLiteral<ValueType.U32>, z.ZodLiteral<ValueType.U64>, z.ZodLiteral<ValueType.U128>, z.ZodLiteral<ValueType.U256>, z.ZodLiteral<ValueType.VecBool>, z.ZodLiteral<ValueType.VecAddress>, z.ZodLiteral<ValueType.VecString>, z.ZodLiteral<ValueType.VecU8>, z.ZodLiteral<ValueType.VecU16>, z.ZodLiteral<ValueType.VecU32>, z.ZodLiteral<ValueType.VecU64>, z.ZodLiteral<ValueType.VecU128>, z.ZodLiteral<ValueType.VecU256>, z.ZodLiteral<ValueType.VecVecU8>, z.ZodLiteral<"Bool">, z.ZodLiteral<"Address">, z.ZodLiteral<"String">, z.ZodLiteral<"U8">, z.ZodLiteral<"U16">, z.ZodLiteral<"U32">, z.ZodLiteral<"U64">, z.ZodLiteral<"U128">, z.ZodLiteral<"U256">, z.ZodLiteral<"VecBool">, z.ZodLiteral<"VecAddress">, z.ZodLiteral<"VecString">, z.ZodLiteral<"VecU8">, z.ZodLiteral<"VecU16">, z.ZodLiteral<"VecU32">, z.ZodLiteral<"VecU64">, z.ZodLiteral<"VecU128">, z.ZodLiteral<"VecU256">, z.ZodLiteral<"VecVecU8">, z.ZodLiteral<"bool">, z.ZodLiteral<"address">, z.ZodLiteral<"string">, z.ZodLiteral<"u8">, z.ZodLiteral<"u16">, z.ZodLiteral<"u32">, z.ZodLiteral<"u64">, z.ZodLiteral<"u128">, z.ZodLiteral<"u256">, z.ZodLiteral<"vecbool">, z.ZodLiteral<"vecaddress">, z.ZodLiteral<"vecstring">, z.ZodLiteral<"vecu8">, z.ZodLiteral<"vecu16">, z.ZodLiteral<"vecu32">, z.ZodLiteral<"vecu64">, z.ZodLiteral<"vecu128">, z.ZodLiteral<"vecu256">, z.ZodLiteral<"vecvecu8">]>>;
|
|
279
279
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodUnion<readonly [z.ZodObject<{
|
|
280
280
|
name_or_address: z.ZodOptional<z.ZodString>;
|
|
281
281
|
local_mark_first: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -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']('Path\x20to\x20JSON\x20or\x20Markdown\x20file\x20containing\x20Guard\x20definition.\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.'),'env':CallEnvSchema['optional']()})['strict']()['describe']('On-chain\x20Guard\x20creation\x20input\x20wrapper.\x20Contains\x20the\x20Guard\x20data\x20definition\x20and\x20optional\x20environment\x20settings.');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).'})['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}from'./receipt.js';import{recover,resetAttempts}from'../../harness/recover.js';import{verify,recordCoverageGap}from'../../harness/verify.js';function applySchemaWarning(a,b){const c=b?.['schema_check'];if(!c||c['warnings']['length']===0x0&&c['errors']['length']===0x0)return a;const d=[...c['warnings'],...c['errors']];let e=a['semantic'];e&&d['length']>0x0&&(e={...e,'warnings':[...e['warnings']||[],...d]});const f={'compatible':c['compatible'],'warnings':d,'client_version':c['client_version'],'server_versions':c['versions']};return{...a,'semantic':e,'schema_warning':f};}function convertBigInts(a){if(typeof a==='bigint')return a['toString']();if(Array['isArray'](a))return a['map'](convertBigInts);if(a 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']??a?.['operation_type']??'call';}function failureDiagnosis(a,b,c,d){return verify({'expected':a,'actual':{'result_type':b['kind'],'error_code':c,'error':d}});}function recordSuccessCoverageGap(a,b,c){const d=verify({'expected':a,'actual':{'result_type':'transaction','semantic':b}});recordCoverageGap(d,{'operation_type':c['operation_type']});}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}};}export function handleCallResult(a,b){const c=convertBigInts(a),d=buildReceipt(c);if(d['kind']==='error'){const g=enrichMoveError(normalizeErrorMessage(d['error'])),h=classifyError(g),i={'outcome':'failed','message':'Error:\x20'+g,'result':{'type':'error','error':g,'error_code':h['error_code'],'retryable':h['retryable'],'recovery_hint':h['recovery_hint']},'recovery':recover(h['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,h['error_code'],g):undefined},j=applySchemaWarning(i,b);return{'content':[{'type':'text','text':j['message']}],'structuredContent':j};}if(d['kind']==='transaction'){const k=ResponseData(c);if(!d['executed']){const q=enrichMoveError(normalizeErrorMessage(d['txError'])||d['txStatus']||'unknown\x20error'),s=classifyError(q),t={'outcome':'failed','message':'Transaction\x20failed:\x20'+q,'result':{'type':'error','error':q,'error_code':s['error_code'],'retryable':s['retryable'],'recovery_hint':s['recovery_hint']},'recovery':recover(s['error_code']??'unknown',recoveryOperationId(b)),'diagnosis':b?.['expected']?failureDiagnosis(b['expected'],d,s['error_code'],q):undefined},u=applySchemaWarning(t,b);return{'content':[{'type':'text','text':u['message']},{'type':'text','text':safeTextJson(k,d['digest'])}],'structuredContent':u};}resetAttempts(recoveryOperationId(b));const l=b?.['response_level']==='full',m=k['filter'](v=>v?.['change']==='created'),n={'outcome':'executed','message':'Transaction\x20completed\x20successfully','result':l?{'type':'transaction',...c}:{'type':'transaction','digest':c['digest'],'created':m},'semantic':buildSemantic(d,b)};b?.['expected']&&recordSuccessCoverageGap(b['expected'],n['semantic'],b);const o=applySchemaWarning(n,b),p=l?safeTextJson(k,d['digest']):'Transaction\x20executed\x20(compact\x20response):\x20digest\x20'+(d['digest']??'')+';\x20created\x20'+m['length']+'\x20object(s).\x20Call\x20again\x20with\x20response_level:\x27full\x27\x20to\x20include\x20the\x20complete\x20raw\x20result.';return{'content':[{'type':'text','text':o['message']},{'type':'text','text':p}],'structuredContent':o};}if(d['kind']==='submission'){const v=c?.['submission'],w=Array['isArray'](v)&&v['length']===0x0,x=c?.['guards'],y=w?{'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':x??[],...c},'semantic':b?{'intent':'guard_evaluated_false','status':'pending_input','summary':'Guard\x20expression\x20evaluated\x20to\x20false\x20('+(x??[])['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},z=applySchemaWarning(y,b);return{'content':[{'type':'text','text':z['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':z};}if(Array['isArray'](c)){const A={'outcome':'executed','message':'Operation\x20completed','result':{'type':'data','data':c}},B=applySchemaWarning(A,b);return{'content':[{'type':'text','text':B['message']},{'type':'text','text':JSON['stringify'](c)}],'structuredContent':B};}if(c===undefined||c===null){const C={'outcome':'executed','message':'Operation\x20completed','result':{'type':'null'}},D=applySchemaWarning(C,b);return{'content':[{'type':'text','text':D['message']}],'structuredContent':D};}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){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??{};}
|
|
@@ -89,6 +89,7 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
89
89
|
}, z.core.$strict>, z.ZodString]>>>>;
|
|
90
90
|
}, z.core.$strict>>;
|
|
91
91
|
}, z.core.$strict>>;
|
|
92
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
92
93
|
}, z.core.$strict>>;
|
|
93
94
|
bReplace: z.ZodOptional<z.ZodBoolean>;
|
|
94
95
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -116,6 +117,7 @@ export declare const NodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
116
117
|
}, z.core.$strict>, z.ZodString]>>>>;
|
|
117
118
|
}, z.core.$strict>>;
|
|
118
119
|
}, z.core.$strict>>;
|
|
120
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
119
121
|
}, z.core.$strict>>;
|
|
120
122
|
bReplace: z.ZodOptional<z.ZodBoolean>;
|
|
121
123
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -190,6 +192,7 @@ export declare const NodeFieldSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUni
|
|
|
190
192
|
}, z.core.$strict>, z.ZodString]>>>>;
|
|
191
193
|
}, z.core.$strict>>;
|
|
192
194
|
}, z.core.$strict>>;
|
|
195
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
193
196
|
}, z.core.$strict>>;
|
|
194
197
|
bReplace: z.ZodOptional<z.ZodBoolean>;
|
|
195
198
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -217,6 +220,7 @@ export declare const NodeFieldSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUni
|
|
|
217
220
|
}, z.core.$strict>, z.ZodString]>>>>;
|
|
218
221
|
}, z.core.$strict>>;
|
|
219
222
|
}, z.core.$strict>>;
|
|
223
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
220
224
|
}, z.core.$strict>>;
|
|
221
225
|
bReplace: z.ZodOptional<z.ZodBoolean>;
|
|
222
226
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -343,6 +347,7 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
|
|
|
343
347
|
}, z.core.$strict>, z.ZodString]>>>>;
|
|
344
348
|
}, z.core.$strict>>;
|
|
345
349
|
}, z.core.$strict>>;
|
|
350
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
346
351
|
}, z.core.$strict>>;
|
|
347
352
|
bReplace: z.ZodOptional<z.ZodBoolean>;
|
|
348
353
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -370,6 +375,7 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
|
|
|
370
375
|
}, z.core.$strict>, z.ZodString]>>>>;
|
|
371
376
|
}, z.core.$strict>>;
|
|
372
377
|
}, z.core.$strict>>;
|
|
378
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
373
379
|
}, z.core.$strict>>;
|
|
374
380
|
bReplace: z.ZodOptional<z.ZodBoolean>;
|
|
375
381
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -420,7 +426,7 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
|
|
|
420
426
|
}, z.core.$strict>]>>;
|
|
421
427
|
pause: z.ZodOptional<z.ZodBoolean>;
|
|
422
428
|
publish: z.ZodOptional<z.ZodBoolean>;
|
|
423
|
-
owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
429
|
+
owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
|
|
424
430
|
id: z.ZodString;
|
|
425
431
|
type: z.ZodString;
|
|
426
432
|
content_raw: z.ZodOptional<z.ZodAny>;
|
|
@@ -437,7 +443,7 @@ export declare const CallMachine_DataSchema: z.ZodObject<{
|
|
|
437
443
|
version: z.ZodOptional<z.ZodString>;
|
|
438
444
|
digest: z.ZodOptional<z.ZodString>;
|
|
439
445
|
}, z.core.$strict>>;
|
|
440
|
-
}, z.core.$strict
|
|
446
|
+
}, z.core.$strict>]>>;
|
|
441
447
|
um: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
442
448
|
}, z.core.$strict>;
|
|
443
449
|
export declare const CallMachine_InputSchema: z.ZodObject<{
|
|
@@ -519,6 +525,7 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
|
|
|
519
525
|
}, z.core.$strict>, z.ZodString]>>>>;
|
|
520
526
|
}, z.core.$strict>>;
|
|
521
527
|
}, z.core.$strict>>;
|
|
528
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
522
529
|
}, z.core.$strict>>;
|
|
523
530
|
bReplace: z.ZodOptional<z.ZodBoolean>;
|
|
524
531
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -546,6 +553,7 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
|
|
|
546
553
|
}, z.core.$strict>, z.ZodString]>>>>;
|
|
547
554
|
}, z.core.$strict>>;
|
|
548
555
|
}, z.core.$strict>>;
|
|
556
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
549
557
|
}, z.core.$strict>>;
|
|
550
558
|
bReplace: z.ZodOptional<z.ZodBoolean>;
|
|
551
559
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -596,7 +604,7 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
|
|
|
596
604
|
}, z.core.$strict>]>>;
|
|
597
605
|
pause: z.ZodOptional<z.ZodBoolean>;
|
|
598
606
|
publish: z.ZodOptional<z.ZodBoolean>;
|
|
599
|
-
owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
607
|
+
owner_receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
|
|
600
608
|
id: z.ZodString;
|
|
601
609
|
type: z.ZodString;
|
|
602
610
|
content_raw: z.ZodOptional<z.ZodAny>;
|
|
@@ -613,7 +621,7 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
|
|
|
613
621
|
version: z.ZodOptional<z.ZodString>;
|
|
614
622
|
digest: z.ZodOptional<z.ZodString>;
|
|
615
623
|
}, z.core.$strict>>;
|
|
616
|
-
}, z.core.$strict
|
|
624
|
+
}, z.core.$strict>]>>;
|
|
617
625
|
um: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
618
626
|
}, z.core.$strict>;
|
|
619
627
|
env: z.ZodOptional<z.ZodObject<{
|
|
@@ -654,7 +662,7 @@ export declare const CallMachine_InputSchema: z.ZodObject<{
|
|
|
654
662
|
submission: z.ZodArray<z.ZodObject<{
|
|
655
663
|
identifier: z.ZodNumber;
|
|
656
664
|
b_submission: z.ZodBoolean;
|
|
657
|
-
value_type: z.ZodUnion<readonly [z.ZodLiteral<import("@wowok/wowok").ValueType.Bool>, z.ZodLiteral<import("@wowok/wowok").ValueType.Address>, z.ZodLiteral<import("@wowok/wowok").ValueType.String>, z.ZodLiteral<import("@wowok/wowok").ValueType.U8>, z.ZodLiteral<import("@wowok/wowok").ValueType.U16>, z.ZodLiteral<import("@wowok/wowok").ValueType.U32>, z.ZodLiteral<import("@wowok/wowok").ValueType.U64>, z.ZodLiteral<import("@wowok/wowok").ValueType.U128>, z.ZodLiteral<import("@wowok/wowok").ValueType.U256>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecBool>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecAddress>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecString>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU8>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU16>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU32>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU64>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU128>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU256>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecVecU8>, z.ZodLiteral<"Bool">, z.ZodLiteral<"Address">, z.ZodLiteral<"String">, z.ZodLiteral<"U8">, z.ZodLiteral<"U16">, z.ZodLiteral<"U32">, z.ZodLiteral<"U64">, z.ZodLiteral<"U128">, z.ZodLiteral<"U256">, z.ZodLiteral<"VecBool">, z.ZodLiteral<"VecAddress">, z.ZodLiteral<"VecString">, z.ZodLiteral<"VecU8">, z.ZodLiteral<"VecU16">, z.ZodLiteral<"VecU32">, z.ZodLiteral<"VecU64">, z.ZodLiteral<"VecU128">, z.ZodLiteral<"VecU256">, z.ZodLiteral<"VecVecU8">, z.ZodLiteral<"bool">, z.ZodLiteral<"address">, z.ZodLiteral<"string">, z.ZodLiteral<"u8">, z.ZodLiteral<"u16">, z.ZodLiteral<"u32">, z.ZodLiteral<"u64">, z.ZodLiteral<"u128">, z.ZodLiteral<"u256">, z.ZodLiteral<"vecbool">, z.ZodLiteral<"vecaddress">, z.ZodLiteral<"vecstring">, z.ZodLiteral<"vecu8">, z.ZodLiteral<"vecu16">, z.ZodLiteral<"vecu32">, z.ZodLiteral<"vecu64">, z.ZodLiteral<"vecu128">, z.ZodLiteral<"vecu256">, z.ZodLiteral<"vecvecu8">]
|
|
665
|
+
value_type: z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<import("@wowok/wowok").ValueType.Bool>, z.ZodLiteral<import("@wowok/wowok").ValueType.Address>, z.ZodLiteral<import("@wowok/wowok").ValueType.String>, z.ZodLiteral<import("@wowok/wowok").ValueType.U8>, z.ZodLiteral<import("@wowok/wowok").ValueType.U16>, z.ZodLiteral<import("@wowok/wowok").ValueType.U32>, z.ZodLiteral<import("@wowok/wowok").ValueType.U64>, z.ZodLiteral<import("@wowok/wowok").ValueType.U128>, z.ZodLiteral<import("@wowok/wowok").ValueType.U256>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecBool>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecAddress>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecString>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU8>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU16>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU32>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU64>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU128>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU256>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecVecU8>, z.ZodLiteral<"Bool">, z.ZodLiteral<"Address">, z.ZodLiteral<"String">, z.ZodLiteral<"U8">, z.ZodLiteral<"U16">, z.ZodLiteral<"U32">, z.ZodLiteral<"U64">, z.ZodLiteral<"U128">, z.ZodLiteral<"U256">, z.ZodLiteral<"VecBool">, z.ZodLiteral<"VecAddress">, z.ZodLiteral<"VecString">, z.ZodLiteral<"VecU8">, z.ZodLiteral<"VecU16">, z.ZodLiteral<"VecU32">, z.ZodLiteral<"VecU64">, z.ZodLiteral<"VecU128">, z.ZodLiteral<"VecU256">, z.ZodLiteral<"VecVecU8">, z.ZodLiteral<"bool">, z.ZodLiteral<"address">, z.ZodLiteral<"string">, z.ZodLiteral<"u8">, z.ZodLiteral<"u16">, z.ZodLiteral<"u32">, z.ZodLiteral<"u64">, z.ZodLiteral<"u128">, z.ZodLiteral<"u256">, z.ZodLiteral<"vecbool">, z.ZodLiteral<"vecaddress">, z.ZodLiteral<"vecstring">, z.ZodLiteral<"vecu8">, z.ZodLiteral<"vecu16">, z.ZodLiteral<"vecu32">, z.ZodLiteral<"vecu64">, z.ZodLiteral<"vecu128">, z.ZodLiteral<"vecu256">, z.ZodLiteral<"vecvecu8">]>>;
|
|
658
666
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodUnion<readonly [z.ZodObject<{
|
|
659
667
|
name_or_address: z.ZodOptional<z.ZodString>;
|
|
660
668
|
local_mark_first: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -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,EntrypointSchema}from'../common/index.js';function gateNumber(a){if(a===null||a===undefined||a==='')return 0x0;const b=Number(a);return Number['isFinite'](b)?b:null;}export function machinePublishGateViolation(a){if(!Array['isArray'](a)||a['length']===0x0)return'The\x20Machine\x20has\x20no\x20nodes,\x20so\x20it\x20cannot\x20be\x20published\x20(E_EMPTY_MACHINE).\x20'+'Publish\x20validates\x20the\x20whole\x20graph:\x20add\x20at\x20least\x20one\x20node,\x20including\x20the\x20first\x20node\x20carrying\x20the\x20'+'entry\x20pair\x20(prev_node:\x20\x22\x22)\x20that\x20Progress\x20starts\x20from\x20—\x20send\x20the\x20nodes\x20in\x20the\x20SAME\x20call\x20as\x20publish:true\x20'+'(bReplace:true,\x20or\x20op:\x22set\x22),\x20because\x20the\x20graph\x20is\x20frozen\x20the\x20moment\x20publish\x20succeeds.';const b=a,c=new Set(b['map'](e=>e?.['name'])['filter'](e=>typeof e==='string'));let d=![];for(const e of b){const f=Array['isArray'](e?.['pairs'])?e['pairs']:[],g=typeof e?.['name']==='string'?e['name']:'<unnamed\x20node>';for(const h of f){const i=typeof h?.['prev_node']==='string'?h['prev_node']:null,j=Array['isArray'](h?.['forwards'])?h['forwards']:[];if(i===''){if(j['length']===0x0)return'The\x20entry\x20pair\x20of\x20node\x20\x22'+g+'\x22\x20(prev_node:\x20\x22\x22)\x20carries\x20no\x20forward\x20(E_EMPTY_ENTRY_PAIR).\x20'+'Progress\x20starts\x20at\x20the\x20empty\x20initial\x20state\x20\x22\x22\x20and\x20can\x20only\x20leave\x20it\x20through\x20an\x20entry\x20forward,\x20so\x20'+'every\x20order\x20on\x20this\x20Machine\x20would\x20be\x20stuck\x20forever.\x20Add\x20at\x20least\x20one\x20forward\x20to\x20that\x20pair.\x20Do\x20NOT\x20'+'delete\x20the\x20entry\x20pair\x20to\x20silence\x20this\x20—\x20a\x20Machine\x20with\x20no\x20entry\x20edge\x20fails\x20the\x20sibling\x20check\x20instead\x20'+'(E_NO_ENTRY_EDGE).';d=!![];}else{if(i!==null&&!c['has'](i))return'The\x20pair\x20of\x20node\x20\x22'+g+'\x22\x20declares\x20prev_node\x20\x22'+i+'\x22,\x20which\x20is\x20not\x20a\x20node\x20of\x20this\x20Machine\x20'+'(E_EDGE_SOURCE_NOT_FOUND)\x20—\x20that\x20edge\x20is\x20unreachable\x20and\x20its\x20source\x20node\x20can\x20never\x20be\x20entered.\x20'+'Fix\x20the\x20name,\x20or\x20add\x20the\x20missing\x20source\x20node.\x20Mind\x20the\x20direction\x20convention:\x20the\x20pair\x20belongs\x20to\x20'+'the\x20node\x20being\x20advanced\x20INTO,\x20with\x20prev_node\x20naming\x20the\x20node\x20it\x20comes\x20from\x20(the\x20entry\x20edge\x20is\x20the\x20'+'one\x20with\x20the\x20EMPTY\x20prev_node).\x20Export\x20the\x20current\x20graph\x20with\x20machineNode2file\x20before\x20editing.';}let k=0x0;for(const m of j){const n=m?.['namedOperator']!==undefined&&m?.['namedOperator']!==null,o=m?.['permissionIndex']!==undefined&&m?.['permissionIndex']!==null;if(!n&&!o)return'Forward\x20\x22'+(m?.['name']??'<unnamed>')+'\x22\x20of\x20node\x20\x22'+g+'\x22\x20names\x20no\x20operator\x20'+'(E_FORWARD_NO_IDENTITY),\x20so\x20nobody\x20can\x20be\x20authorized\x20to\x20execute\x20it\x20and\x20the\x20Machine\x20cannot\x20be\x20'+'published.\x20Set\x20namedOperator\x20(use\x20\x22\x22\x20for\x20the\x20order\x20payer,\x20or\x20a\x20Progress\x20operator\x20namespace)\x20or\x20'+'permissionIndex\x20(a\x20USER_DEFINED\x20index\x20>=\x201000).\x20A\x20guard\x20does\x20NOT\x20satisfy\x20this:\x20it\x20is\x20a\x20'+'post-verification\x20check,\x20not\x20an\x20identity.';const p=gateNumber(m?.['weight']);if(p!==null)k+=p;}const l=gateNumber(h?.['threshold']);if(l!==null&&k<l){const q=i===''?'entry\x20->\x20'+g:i+'\x20->\x20'+g;return'Pair\x20('+q+')\x20can\x20never\x20migrate:\x20its\x20threshold\x20('+l+')\x20is\x20greater\x20than\x20the\x20sum\x20of\x20its\x20'+('forward\x20weights\x20('+k+')\x20(E_UNREACHABLE_THRESHOLD).\x20Each\x20forward\x20contributes\x20its\x20weight\x20AT\x20')+'MOST\x20ONCE\x20—\x20it\x20is\x20locked\x20by\x20the\x20first\x20operator\x20who\x20accomplishes\x20it,\x20and\x20a\x20second\x20operator\x20re-running\x20'+'it\x20aborts\x20E_NOT_THE_HOLDER\x20—\x20so\x20the\x20reachable\x20maximum\x20is\x20the\x20sum\x20of\x20the\x20DISTINCT\x20forward\x20weights.\x20'+'Lower\x20the\x20threshold,\x20or\x20add\x20one\x20distinct\x20forward\x20per\x20contributing\x20operator\x20(threshold\x202\x20->\x20begin_a\x20+\x20'+'begin_b,\x20each\x20weight\x201).\x20Never\x20try\x20to\x20reach\x20a\x20high\x20threshold\x20by\x20re-running\x20one\x20forward\x20repeatedly.';}}}if(!d)return'The\x20Machine\x20has\x20no\x20entry\x20edge\x20(E_NO_ENTRY_EDGE)\x20—\x20no\x20node\x20declares\x20a\x20pair\x20with\x20prev_node:\x20\x22\x22,\x20so\x20'+'Progress\x20starts\x20at\x20the\x20empty\x20initial\x20state\x20and\x20has\x20no\x20edge\x20to\x20advance\x20on.\x20Add\x20the\x20entry\x20pair\x20to\x20your\x20'+'first\x20node:\x20pairs:[{prev_node:\x22\x22,\x20forwards:[{name:\x22start\x22,\x20weight:1,\x20namedOperator:\x22\x22}]}].\x20The\x20fix\x20must\x20'+'land\x20BEFORE\x20publish\x20—\x20machineNode2file\x20exports\x20the\x20current\x20graph\x20so\x20you\x20can\x20diff\x20it\x20against\x20the\x20fixed\x20one.';return null;}function validateEntryForward(a){for(const b of a){if(!b['pairs'])continue;for(const c of b['pairs']){if(c['prev_node']==='')return!![];}}return![];}const ENTRY_FORWARD_ERROR_MESSAGE='Machine\x20has\x20no\x20entry\x20forward.\x20At\x20least\x20one\x20node\x20must\x20have\x20a\x20pair\x20with\x20prev_node=\x22\x22\x20(empty\x20string),\x20'+'which\x20defines\x20how\x20Progress\x20advances\x20from\x20the\x20initial\x20state\x20(current=\x22\x22)\x20to\x20the\x20first\x20node.\x20'+'Without\x20an\x20entry\x20forward,\x20the\x20workflow\x20will\x20be\x20permanently\x20stuck.\x20'+'Example:\x20{name:\x20\x27Subscribed\x27,\x20pairs:\x20[{prev_node:\x20\x27\x27,\x20forwards:\x20[{name:\x20\x27Subscribe\x27,\x20weight:\x201}]}]}';export const ProgressNamedOperatorSchema=z['object']({'op':z['union']([z['literal']('add'),z['literal']('set'),z['literal']('remove')]),'name':NotEmptyNameSchema,'operators':ManyAccountOrMark_AddressSchema})['strict']();export const ProgressNewSchema=z['object']({'task':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Task\x20bound\x20to\x20the\x20Progress\x20object.\x20It\x20is\x20an\x20object\x20ID\x20or\x20name'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20Progress\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'progress_namedOperator':ProgressNamedOperatorSchema['optional']()['describe']('Add,\x20set,\x20and\x20remove\x20operators\x20for\x20the\x20permission\x20namespace\x20of\x20the\x20Progress\x20object.'),'namedNew':NamedObjectSchema['optional']()})['strict']();export const NodeAddForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward':z['array'](MachineForwardSchema)['describe']('List\x20of\x20operations\x20between\x20the\x20previous\x20and\x20next\x20nodes.'),'threshold':z['union']([z['number']()['int']()['min'](0x0),z['null']()])['optional']()['describe']('Threshold\x20of\x20operations\x20that\x20need\x20to\x20be\x20completed\x20to\x20migrate\x20from\x20the\x20previous\x20node\x20to\x20the\x20next\x20node.')})['strict']();export const NodeRemoveForwardDataSchema=z['object']({'prior_node_name':NameSchema['describe']('Name\x20of\x20the\x20previous\x20node.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.'),'forward_name':z['array'](NameSchema)['describe']('List\x20of\x20operation\x20names\x20to\x20delete.')})['strict']();export const NodeRemovePriorNodeDataSchema=z['object']({'prior_node_name':z['array'](NameSchema)['describe']('List\x20of\x20previous\x20node\x20names\x20to\x20delete.'),'node_name':NameSchema['describe']('Name\x20of\x20the\x20next\x20node.')})['strict']();export const NodeSchema=z['discriminatedUnion']('op',[z['object']({'op':z['literal']('add'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Add\x20nodes.'),z['object']({'op':z['literal']('set'),'nodes':z['array'](MachineNodeSchema)['describe']('List\x20of\x20nodes\x20to\x20add\x20or\x20set.'),'bReplace':z['boolean']()['optional']()['describe']('Whether\x20to\x20replace\x20existing\x20nodes.\x20If\x20true,\x20existing\x20nodes\x20will\x20be\x20replaced;\x20if\x20false,\x20nodes\x20will\x20be\x20added\x20by\x20merging.')})['strict']()['describe']('Set\x20nodes.'),z['object']({'op':z['literal']('remove'),'nodes':z['array'](NameSchema)['describe']('List\x20of\x20node\x20names\x20to\x20delete.')})['strict']()['describe']('Delete\x20nodes.'),z['object']({'op':z['literal']('clear')})['strict']()['describe']('Clear\x20all\x20nodes.'),z['object']({'op':z['literal']('exchange'),'node_one':NameSchema['describe']('Name\x20of\x20the\x20first\x20node.'),'node_other':NameSchema['describe']('Name\x20of\x20the\x20second\x20node.')})['strict']()['describe']('Exchange\x20the\x20positions\x20of\x20two\x20nodes.'),z['object']({'op':z['literal']('rename'),'node_name_old':NameSchema['describe']('Name\x20of\x20thenode.'),'node_name_new':NameSchema['describe']('New\x20name\x20of\x20the\x20node.')})['strict']()['describe']('Rename\x20node.'),z['object']({'op':z['literal']('remove\x20prior\x20node'),'pairs':z['array'](NodeRemovePriorNodeDataSchema)['describe']('List\x20of\x20previous-next\x20node\x20pairs\x20to\x20delete.')})['strict']()['describe']('Delete\x20previous-next\x20node\x20pairs.'),z['object']({'op':z['literal']('add\x20forward'),'data':z['array'](NodeAddForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20add.')})['strict']()['describe']('Add\x20operations.'),z['object']({'op':z['literal']('remove\x20forward'),'data':z['array'](NodeRemoveForwardDataSchema)['describe']('List\x20of\x20operations\x20to\x20delete.')})['strict']()['describe']('Delete\x20operations.')])['superRefine']((a,b)=>{(a['op']==='add'||a['op']==='set')&&a['bReplace']===!![]&&(!validateEntryForward(a['nodes'])&&b['addIssue']({'code':z['ZodIssueCode']['custom'],'message':ENTRY_FORWARD_ERROR_MESSAGE}));});export const NodeJsonOrMarkdownFileSchema=z['object']({'json_or_markdown_file':z['string']()['describe']('Path\x20to\x20a\x20JSON\x20or\x20Markdown\x20file\x20containing\x20node\x20array\x20for\x20COMPLETE\x20REPLACEMENT\x20of\x20all\x20nodes.\x0a\x0a**File\x20Format\x20Requirements:**\x0a-\x20Must\x20contain\x20a\x20JSON\x20ARRAY\x20of\x20node\x20objects:\x20[{\x22name\x22:\x20\x22...\x22,\x20\x22pairs\x22:\x20[...]},\x20{...}]\x0a-\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field\x20(use\x20NodeSchema\x20for\x20operations)\x0a-\x20Supports\x20JSON\x20or\x20Markdown\x20(with\x20```json\x20code\x20blocks)\x0a\x0a**Node\x20Structure:**\x0aEach\x20node\x20is\x20a\x20directed\x20graph\x20element\x20representing\x20a\x20workflow\x20STATE\x20that\x20an\x20order\x0acan\x20rest\x20in.\x20Its\x20Pairs\x20are\x20the\x20INCOMING\x20edges\x20—\x20this\x20is\x20the\x20one\x20convention\x20the\x0achain\x20enforces,\x20and\x20getting\x20it\x20backwards\x20silently\x20builds\x20a\x20wrong\x20graph:\x0a-\x20name:\x20Node\x20identifier\x20—\x20the\x20DESTINATION\x20of\x20every\x20pair\x20it\x20owns\x0a-\x20role:\x20(optional)\x20business\x20role\x20tag\x20for\x20display\x20layers\x20—\x20one\x20of\x20draft/active/delivered/final/cancelled.\x20SESSION\x20METADATA\x20ONLY\x20(not\x20stored\x20on-chain;\x20echoed\x20back\x20as\x20a\x20NODE\x20ROLES\x20warning)\x0a-\x20pairs:\x20Array\x20of\x20{prev_node,\x20forwards,\x20threshold}\x20—\x20edges\x20ENTERING\x20this\x20node.\x20The\x20key\x20is\x20`prev_node`;\x20`prior_node`\x20is\x20not\x20recognized\x20and\x20is\x20silently\x20dropped.\x0a-\x20forwards:\x20Operations\x20that\x20advance\x20INTO\x20this\x20node\x20FROM\x20its\x20prev_node\x20(NOT\x20operations\x20available\x20from\x20this\x20node)\x0a-\x20threshold:\x20Weight\x20required\x20to\x20migrate\x20into\x20this\x20node\x20along\x20that\x20pair\x0a\x0aDiagram\x20`A\x20--[Go]-->\x20B`\x20therefore\x20lives\x20in\x20node\x20**B**:\x20{name:\x22B\x22,\x20pairs:[{prev_node:\x22A\x22,\x20forwards:[{name:\x22Go\x22,\x20weight:1}]}]}.\x0a\x0a**Forward\x20names\x20must\x20determine\x20the\x20destination.**\x20`next_node`\x20is\x20a\x20CALLER\x20argument\x0a(progress.move:540)\x20and\x20the\x20chain\x20resolves\x20(current,\x20next_node,\x20forward)\x20inside\x20the\x0adestination\x20node\x20(machine.move:275),\x20so\x20one\x20forward\x20name\x20shared\x20by\x20two\x20destinations\x0afrom\x20the\x20same\x20prev_node\x20is\x20legal\x20and\x20lets\x20the\x20caller\x20pick\x20the\x20outcome\x20—\x20including\x0awhether\x20a\x20refund\x20Allocator\x20ever\x20fires.\x20Give\x20each\x20destination\x20its\x20own\x20forward\x20name.\x0a\x0a**Behavior:**\x0a-\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes\x20(equivalent\x20to\x20\x22set\x22\x20with\x20bReplace=true)\x0a-\x20Auto-detects\x20format\x20based\x20on\x20file\x20content\x0a-\x20If\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information')})['strict']();export const NodeFieldSchema=z['union']([NodeSchema,NodeJsonOrMarkdownFileSchema]);export const CallMachine_DataSchema=z['object']({'object':WithPermissionObjectSchema,'progress_new':ProgressNewSchema['optional']()['describe']('Generate\x20new\x20Progress\x20object.'),'description':DescriptionSchema['optional']()['describe']('Description\x20of\x20the\x20object.'),'repository':ObjectsSchema['optional']()['describe']('Set\x20repository\x20list\x20for\x20the\x20object.\x20Used\x20for\x20consensus\x20data\x20management.'),'node':NodeFieldSchema['optional']()['describe']('CRITICAL:\x20Choose\x20ONE\x20of\x20two\x20mutually\x20exclusive\x20modes:\x0a\x0a**Mode\x201:\x20NodeSchema\x20(incremental\x20operations)**\x0aUse\x20for\x20partial\x20modifications:\x20add,\x20set,\x20remove,\x20clear,\x20exchange,\x20rename,\x20remove\x20prior\x20node,\x20add\x20forward,\x20remove\x20forward.\x0aFormat:\x20{\x20\x22op\x22:\x20\x22add\x22,\x20\x22nodes\x22:\x20[...],\x20\x22bReplace\x22:\x20false\x20}\x0aThis\x20mode\x20modifies\x20existing\x20nodes\x20incrementally.\x0a\x0a**Mode\x202:\x20NodeJsonOrMarkdownFileSchema\x20(complete\x20replacement)**\x0aUse\x20for\x20complete\x20node\x20redefinition\x20from\x20file.\x0aFormat:\x20{\x20\x22json_or_markdown_file\x22:\x20\x22/path/to/nodes.json\x22\x20}\x0aIMPORTANT:\x20This\x20COMPLETELY\x20REPLACES\x20all\x20existing\x20nodes.\x20File\x20must\x20contain\x20node\x20array\x20[{...},\x20{...}],\x20NOT\x20an\x20operation\x20object\x20with\x20\x22op\x22\x20field.\x0aSupported\x20formats:\x20JSON\x20array\x20or\x20Markdown\x20with\x20code\x20blocks.\x0aIf\x20parsing\x20fails,\x20error\x20includes\x20line\x20number\x20and\x20column\x20information.'),'pause':z['boolean']()['optional']()['describe']('Whether\x20to\x20pause\x20generating\x20new\x20Progress\x20objects.'),'publish':z['boolean']()['optional']()['describe']('Whether\x20to\x20publish\x20the\x20object.\x20After\x20the\x20object\x20is\x20published,\x20new\x20Progress\x20objects\x20can\x20be\x20generated;\x20and\x20node\x20settings\x20will\x20no\x20longer\x20be\x20changeable.\x20⚠️\x20PUBLISH\x20IS\x20A\x20ONE-WAY\x20DOOR\x20AND\x20THE\x20CHAIN\x20VALIDATES\x20THE\x20WHOLE\x20GRAPH\x20AT\x20THAT\x20MOMENT:\x20the\x20on-chain\x20publish\x20gate\x20rejects\x20a\x20Machine\x20that\x20is\x20empty,\x20has\x20no\x20entry\x20edge\x20(no\x20pair\x20with\x20prev_node:\x22\x22),\x20has\x20an\x20entry\x20pair\x20with\x20no\x20forward,\x20references\x20a\x20prev_node\x20that\x20is\x20not\x20a\x20node\x20of\x20this\x20Machine,\x20carries\x20a\x20forward\x20with\x20neither\x20namedOperator\x20nor\x20permissionIndex\x20(a\x20guard\x20is\x20NOT\x20an\x20identity),\x20or\x20has\x20a\x20pair\x20whose\x20threshold\x20exceeds\x20the\x20sum\x20of\x20its\x20forward\x20weights\x20(each\x20forward\x20counts\x20at\x20most\x20once).\x20These\x20aborts\x20(machine:17-22)\x20fire\x20BEFORE\x20the\x20publish\x20lands,\x20so\x20the\x20graph\x20is\x20still\x20editable\x20—\x20but\x20after\x20it\x20succeeds,\x20nodes/forwards,\x20Guard\x20bindings\x20and\x20Service.machine\x20are\x20frozen\x20forever,\x20and\x20a\x20broken\x20graph\x20would\x20only\x20surface\x20at\x20the\x20first\x20transition\x20with\x20no\x20repair\x20path.\x20Send\x20the\x20nodes\x20in\x20the\x20SAME\x20call\x20as\x20publish:true\x20(bReplace:true\x20or\x20op:\x22set\x22)\x20so\x20the\x20complete\x20graph\x20is\x20validated\x20together.\x20⚠️\x20Before\x20publishing,\x20enumerate\x20the\x20graph\x20STOP\x20NODES\x20(nodes\x20with\x20no\x20outgoing\x20Pair)\x20plus\x20every\x20waiting\x20state\x20(review\x20window,\x20handover,\x20open\x20dispute)\x20and\x20verify\x20each\x20has\x20a\x20defined\x20fund\x20exit\x20in\x20the\x20Service\x20order_allocators\x20—\x20withdrawal\x20(release)\x20AND\x20refund.\x20Machine\x20+\x20Allocator\x20are\x20immutable\x20after\x20publish\x20(IMMUT-001);\x20an\x20uncovered\x20stop\x20node\x20strands\x20funds\x20permanently\x20(rule\x20R-M5-03,\x20checklist\x20pattern.fund_flow_stop_node_coverage).'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Machine\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name.')})['strict']()['superRefine']((a,b)=>{if(a['publish']!==!![])return;const c=a['node'];if(!c||'json_or_markdown_file'in c)return;if(c['op']!=='add'&&c['op']!=='set')return;const d=typeof a['object']==='object'&&a['object']!==null;if(!d&&c['bReplace']!==!![])return;if(!Array['isArray'](c['nodes'])||c['nodes']['length']===0x0||typeof c['nodes'][0x0]!=='object')return;const e=machinePublishGateViolation(c['nodes']);e&&b['addIssue']({'code':z['ZodIssueCode']['custom'],'message':e});})['describe']('On-chain\x20Machine\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Machine.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.');export const CallMachine_InputSchema=z['object']({'data':CallMachine_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();export const MachineNode2File_InputSchema=z['object']({'machine':NameOrAddressSchema['describe']('Machine\x20object\x20ID\x20or\x20name\x20to\x20export'),'file_path':z['string']()['optional']()['describe']('Output\x20file\x20path\x20(absolute\x20or\x20relative).\x20Defaults\x20to\x20the\x20workspace\x20directory\x20when\x20omitted.'),'format':z['enum'](['json','markdown'])['optional']()['default']('json')['describe']('Output\x20format:\x20\x27json\x27\x20(default)\x20or\x20\x27markdown\x27'),'network':EntrypointSchema['optional']()['describe']('Network\x20to\x20read\x20the\x20Machine\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\x20(klook\x20B-4:\x20an\x20un-networked\x20\x27not\x20found\x20on\x20chain\x27\x20was\x20actually\x20a\x20testnet\x20read\x20of\x20a\x20localnet\x20object).'),'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'),'network':z['string']()['describe']('Network\x20the\x20Machine\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']('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,EntrypointSchema}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.\x20Chain\x20truth\x20(machine.move:657,\x20the\x20progress-generation\x20entry\x20asserts\x20!bPaused):\x20the\x20pause\x20gates\x20NEW\x20order\x20entry\x20only\x20—\x20in-flight\x20Progress\x20keeps\x20advancing\x20and\x20settling\x20(yfd-ln\x20F-13\x20misread\x20this\x20as\x20a\x20freeze\x20switch;\x20it\x20never\x20was\x20one).'),'publish':z['boolean']()['optional']()['describe']('Whether\x20to\x20publish\x20the\x20object.\x20After\x20the\x20object\x20is\x20published,\x20new\x20Progress\x20objects\x20can\x20be\x20generated;\x20and\x20node\x20settings\x20will\x20no\x20longer\x20be\x20changeable.\x20⚠️\x20PUBLISH\x20IS\x20A\x20ONE-WAY\x20DOOR\x20AND\x20THE\x20CHAIN\x20VALIDATES\x20THE\x20WHOLE\x20GRAPH\x20AT\x20THAT\x20MOMENT:\x20the\x20on-chain\x20publish\x20gate\x20rejects\x20a\x20Machine\x20that\x20is\x20empty,\x20has\x20no\x20entry\x20edge\x20(no\x20pair\x20with\x20prev_node:\x22\x22),\x20has\x20an\x20entry\x20pair\x20with\x20no\x20forward,\x20references\x20a\x20prev_node\x20that\x20is\x20not\x20a\x20node\x20of\x20this\x20Machine,\x20carries\x20a\x20forward\x20with\x20neither\x20namedOperator\x20nor\x20permissionIndex\x20(a\x20guard\x20is\x20NOT\x20an\x20identity),\x20or\x20has\x20a\x20pair\x20whose\x20threshold\x20exceeds\x20the\x20sum\x20of\x20its\x20forward\x20weights\x20(each\x20forward\x20counts\x20at\x20most\x20once).\x20These\x20aborts\x20(machine:17-22)\x20fire\x20BEFORE\x20the\x20publish\x20lands,\x20so\x20the\x20graph\x20is\x20still\x20editable\x20—\x20but\x20after\x20it\x20succeeds,\x20nodes/forwards,\x20Guard\x20bindings\x20and\x20Service.machine\x20are\x20frozen\x20forever,\x20and\x20a\x20broken\x20graph\x20would\x20only\x20surface\x20at\x20the\x20first\x20transition\x20with\x20no\x20repair\x20path.\x20Send\x20the\x20nodes\x20in\x20the\x20SAME\x20call\x20as\x20publish:true\x20(bReplace:true\x20or\x20op:\x22set\x22)\x20so\x20the\x20complete\x20graph\x20is\x20validated\x20together.\x20⚠️\x20Before\x20publishing,\x20enumerate\x20the\x20graph\x20STOP\x20NODES\x20(nodes\x20with\x20no\x20outgoing\x20Pair)\x20plus\x20every\x20waiting\x20state\x20(review\x20window,\x20handover,\x20open\x20dispute)\x20and\x20verify\x20each\x20has\x20a\x20defined\x20fund\x20exit\x20in\x20the\x20Service\x20order_allocators\x20—\x20withdrawal\x20(release)\x20AND\x20refund.\x20Machine\x20+\x20Allocator\x20are\x20immutable\x20after\x20publish\x20(IMMUT-001);\x20an\x20uncovered\x20stop\x20node\x20strands\x20funds\x20permanently\x20(rule\x20R-M5-03,\x20checklist\x20pattern.fund_flow_stop_node_coverage).'),'owner_receive':ReceivedObjectsOrRecentlySchema['optional']()['describe']('Unwrap\x20CoinWrapper\x20objects\x20and\x20other\x20objects\x20received\x20by\x20this\x20Machine\x20object\x20and\x20send\x20them\x20to\x20the\x20owner\x20of\x20its\x20Permission\x20object.'+RECEIVE_FORMAT_BLOCK_OBJECTS),'um':z['union']([NameOrAddressSchema,z['null']()])['optional']()['describe']('Contact\x20object\x20ID\x20or\x20name.')})['strict']()['superRefine']((a,b)=>{if(a['publish']!==!![])return;const c=a['node'];if(!c||'json_or_markdown_file'in c)return;if(c['op']!=='add'&&c['op']!=='set')return;const d=typeof a['object']==='object'&&a['object']!==null;if(!d&&c['bReplace']!==!![])return;if(!Array['isArray'](c['nodes'])||c['nodes']['length']===0x0||typeof c['nodes'][0x0]!=='object')return;const e=machinePublishGateViolation(c['nodes']);e&&b['addIssue']({'code':z['ZodIssueCode']['custom'],'message':e});})['describe']('On-chain\x20Machine\x20operations.\x20USAGE:\x20(1)\x20CREATE\x20NEW:\x20Set\x20\x27object\x27\x20field\x20with\x20OBJECT\x20format\x20{name,\x20permission,\x20...}\x20to\x20create\x20a\x20Machine.\x20NOTE:\x20\x27name\x27\x20goes\x20INSIDE\x20\x27object\x27,\x20NOT\x20at\x20the\x20data\x20root\x20level.\x20\x27permission\x27\x20can\x20be\x20a\x20new\x20Permission\x20object\x20or\x20reference\x20an\x20existing\x20one\x20-\x20check\x20\x27object\x27\x20field\x20description\x20for\x20details.\x20(2)\x20OPERATE\x20EXISTING:\x20Set\x20\x27object\x27\x20field\x20with\x20STRING\x20format\x20(object\x20ID\x20or\x20name).\x20The\x20\x27object\x27\x20field\x20is\x20CRITICAL\x20and\x20REQUIRED\x20in\x20both\x20cases.\x20STRING\x20for\x20existing,\x20OBJECT\x20for\x20new\x20creation.');export const CallMachine_InputSchema=z['object']({'data':CallMachine_DataSchema,'env':CallEnvSchema['optional'](),'submission':SubmissionCallSchema['optional']()})['strict']();export const MachineNode2File_InputSchema=z['object']({'machine':NameOrAddressSchema['describe']('Machine\x20object\x20ID\x20or\x20name\x20to\x20export'),'file_path':z['string']()['optional']()['describe']('Output\x20file\x20path\x20(absolute\x20or\x20relative).\x20Defaults\x20to\x20the\x20workspace\x20directory\x20when\x20omitted.'),'format':z['enum'](['json','markdown'])['optional']()['default']('json')['describe']('Output\x20format:\x20\x27json\x27\x20(default)\x20or\x20\x27markdown\x27'),'network':EntrypointSchema['optional']()['describe']('Network\x20to\x20read\x20the\x20Machine\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\x20(klook\x20B-4:\x20an\x20un-networked\x20\x27not\x20found\x20on\x20chain\x27\x20was\x20actually\x20a\x20testnet\x20read\x20of\x20a\x20localnet\x20object).'),'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'),'network':z['string']()['describe']('Network\x20the\x20Machine\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']('MachineNode2File\x20operation\x20output');export const MachineNode2File_OutputWrappedSchema=z['object']({'result':MachineNode2File_OutputSchema})['strict']()['describe']('MachineNode2File\x20operation\x20output\x20wrapped\x20schema');
|
|
@@ -68,7 +68,7 @@ export declare const CallOrder_DataSchema: z.ZodObject<{
|
|
|
68
68
|
arb_claim_compensation: z.ZodOptional<z.ZodObject<{
|
|
69
69
|
arb: z.ZodString;
|
|
70
70
|
}, z.core.$strict>>;
|
|
71
|
-
receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
71
|
+
receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
|
|
72
72
|
id: z.ZodString;
|
|
73
73
|
type: z.ZodString;
|
|
74
74
|
content_raw: z.ZodOptional<z.ZodAny>;
|
|
@@ -85,7 +85,7 @@ export declare const CallOrder_DataSchema: z.ZodObject<{
|
|
|
85
85
|
version: z.ZodOptional<z.ZodString>;
|
|
86
86
|
digest: z.ZodOptional<z.ZodString>;
|
|
87
87
|
}, z.core.$strict>>;
|
|
88
|
-
}, z.core.$strict
|
|
88
|
+
}, z.core.$strict>]>>;
|
|
89
89
|
transfer_to: z.ZodOptional<z.ZodObject<{
|
|
90
90
|
name_or_address: z.ZodOptional<z.ZodString>;
|
|
91
91
|
local_mark_first: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -148,7 +148,7 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
|
|
|
148
148
|
arb_claim_compensation: z.ZodOptional<z.ZodObject<{
|
|
149
149
|
arb: z.ZodString;
|
|
150
150
|
}, z.core.$strict>>;
|
|
151
|
-
receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
151
|
+
receive: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"recently">, z.ZodString, z.ZodArray<z.ZodObject<{
|
|
152
152
|
id: z.ZodString;
|
|
153
153
|
type: z.ZodString;
|
|
154
154
|
content_raw: z.ZodOptional<z.ZodAny>;
|
|
@@ -165,7 +165,7 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
|
|
|
165
165
|
version: z.ZodOptional<z.ZodString>;
|
|
166
166
|
digest: z.ZodOptional<z.ZodString>;
|
|
167
167
|
}, z.core.$strict>>;
|
|
168
|
-
}, z.core.$strict
|
|
168
|
+
}, z.core.$strict>]>>;
|
|
169
169
|
transfer_to: z.ZodOptional<z.ZodObject<{
|
|
170
170
|
name_or_address: z.ZodOptional<z.ZodString>;
|
|
171
171
|
local_mark_first: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -229,7 +229,7 @@ export declare const CallOrder_InputSchema: z.ZodObject<{
|
|
|
229
229
|
submission: z.ZodArray<z.ZodObject<{
|
|
230
230
|
identifier: z.ZodNumber;
|
|
231
231
|
b_submission: z.ZodBoolean;
|
|
232
|
-
value_type: z.ZodUnion<readonly [z.ZodLiteral<import("@wowok/wowok").ValueType.Bool>, z.ZodLiteral<import("@wowok/wowok").ValueType.Address>, z.ZodLiteral<import("@wowok/wowok").ValueType.String>, z.ZodLiteral<import("@wowok/wowok").ValueType.U8>, z.ZodLiteral<import("@wowok/wowok").ValueType.U16>, z.ZodLiteral<import("@wowok/wowok").ValueType.U32>, z.ZodLiteral<import("@wowok/wowok").ValueType.U64>, z.ZodLiteral<import("@wowok/wowok").ValueType.U128>, z.ZodLiteral<import("@wowok/wowok").ValueType.U256>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecBool>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecAddress>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecString>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU8>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU16>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU32>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU64>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU128>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU256>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecVecU8>, z.ZodLiteral<"Bool">, z.ZodLiteral<"Address">, z.ZodLiteral<"String">, z.ZodLiteral<"U8">, z.ZodLiteral<"U16">, z.ZodLiteral<"U32">, z.ZodLiteral<"U64">, z.ZodLiteral<"U128">, z.ZodLiteral<"U256">, z.ZodLiteral<"VecBool">, z.ZodLiteral<"VecAddress">, z.ZodLiteral<"VecString">, z.ZodLiteral<"VecU8">, z.ZodLiteral<"VecU16">, z.ZodLiteral<"VecU32">, z.ZodLiteral<"VecU64">, z.ZodLiteral<"VecU128">, z.ZodLiteral<"VecU256">, z.ZodLiteral<"VecVecU8">, z.ZodLiteral<"bool">, z.ZodLiteral<"address">, z.ZodLiteral<"string">, z.ZodLiteral<"u8">, z.ZodLiteral<"u16">, z.ZodLiteral<"u32">, z.ZodLiteral<"u64">, z.ZodLiteral<"u128">, z.ZodLiteral<"u256">, z.ZodLiteral<"vecbool">, z.ZodLiteral<"vecaddress">, z.ZodLiteral<"vecstring">, z.ZodLiteral<"vecu8">, z.ZodLiteral<"vecu16">, z.ZodLiteral<"vecu32">, z.ZodLiteral<"vecu64">, z.ZodLiteral<"vecu128">, z.ZodLiteral<"vecu256">, z.ZodLiteral<"vecvecu8">]
|
|
232
|
+
value_type: z.ZodPreprocess<z.ZodUnion<readonly [z.ZodLiteral<import("@wowok/wowok").ValueType.Bool>, z.ZodLiteral<import("@wowok/wowok").ValueType.Address>, z.ZodLiteral<import("@wowok/wowok").ValueType.String>, z.ZodLiteral<import("@wowok/wowok").ValueType.U8>, z.ZodLiteral<import("@wowok/wowok").ValueType.U16>, z.ZodLiteral<import("@wowok/wowok").ValueType.U32>, z.ZodLiteral<import("@wowok/wowok").ValueType.U64>, z.ZodLiteral<import("@wowok/wowok").ValueType.U128>, z.ZodLiteral<import("@wowok/wowok").ValueType.U256>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecBool>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecAddress>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecString>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU8>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU16>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU32>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU64>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU128>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecU256>, z.ZodLiteral<import("@wowok/wowok").ValueType.VecVecU8>, z.ZodLiteral<"Bool">, z.ZodLiteral<"Address">, z.ZodLiteral<"String">, z.ZodLiteral<"U8">, z.ZodLiteral<"U16">, z.ZodLiteral<"U32">, z.ZodLiteral<"U64">, z.ZodLiteral<"U128">, z.ZodLiteral<"U256">, z.ZodLiteral<"VecBool">, z.ZodLiteral<"VecAddress">, z.ZodLiteral<"VecString">, z.ZodLiteral<"VecU8">, z.ZodLiteral<"VecU16">, z.ZodLiteral<"VecU32">, z.ZodLiteral<"VecU64">, z.ZodLiteral<"VecU128">, z.ZodLiteral<"VecU256">, z.ZodLiteral<"VecVecU8">, z.ZodLiteral<"bool">, z.ZodLiteral<"address">, z.ZodLiteral<"string">, z.ZodLiteral<"u8">, z.ZodLiteral<"u16">, z.ZodLiteral<"u32">, z.ZodLiteral<"u64">, z.ZodLiteral<"u128">, z.ZodLiteral<"u256">, z.ZodLiteral<"vecbool">, z.ZodLiteral<"vecaddress">, z.ZodLiteral<"vecstring">, z.ZodLiteral<"vecu8">, z.ZodLiteral<"vecu16">, z.ZodLiteral<"vecu32">, z.ZodLiteral<"vecu64">, z.ZodLiteral<"vecu128">, z.ZodLiteral<"vecu256">, z.ZodLiteral<"vecvecu8">]>>;
|
|
233
233
|
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodUnion<readonly [z.ZodObject<{
|
|
234
234
|
name_or_address: z.ZodOptional<z.ZodString>;
|
|
235
235
|
local_mark_first: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -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.'),'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.\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']();
|