@wowok/agent-mcp 3.4.1 → 3.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp.json +5 -0
- package/dist/chain-semantics/composition-truth.js +1 -1
- package/dist/chain-semantics/eval-order.js +1 -1
- 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 -3
- package/dist/composition/compile.js +1 -1
- package/dist/composition/emit-phases.d.ts +30 -2
- package/dist/composition/emit-phases.js +1 -1
- package/dist/composition/guard-fill.d.ts +8 -0
- package/dist/composition/guard-fill.js +1 -1
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/input-normalize.js +1 -1
- package/dist/composition/materialize.d.ts +2 -0
- package/dist/composition/materialize.js +1 -1
- package/dist/composition/mode-gates.js +1 -1
- package/dist/composition/param-disclosure.js +1 -1
- package/dist/composition/plan-retry-ledger.d.ts +16 -0
- package/dist/composition/plan-retry-ledger.js +1 -1
- package/dist/composition/plan.d.ts +15 -1
- package/dist/composition/plan.js +1 -1
- package/dist/config/config-audit.spec.js +1 -1
- package/dist/config/judgment.d.ts +5 -0
- package/dist/config/judgment.js +1 -1
- package/dist/evaluation/builtins/arbitration-score.d.ts +1 -0
- package/dist/evaluation/builtins/arbitration-score.js +1 -1
- package/dist/evaluation/builtins/demand-match.js +1 -1
- package/dist/evaluation/builtins/graph-service.d.ts +8 -0
- package/dist/evaluation/builtins/graph-service.js +1 -1
- package/dist/evaluation/capability.d.ts +9 -0
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/extract.d.ts +9 -1
- package/dist/evaluation/extract.js +1 -1
- package/dist/evaluation/match-operation.js +1 -1
- package/dist/evaluation/match-policy.d.ts +5 -3
- package/dist/evaluation/match-policy.js +1 -1
- package/dist/evaluation/standards.d.ts +1 -0
- package/dist/evaluation/standards.js +1 -1
- package/dist/evaluation/structured-lines.js +1 -1
- package/dist/evaluation/types.d.ts +1 -0
- package/dist/extensions/capability.js +1 -1
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- 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/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.d.ts +17 -1
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arb-fund-facts.d.ts +7 -0
- package/dist/knowledge/arb-fund-facts.js +1 -1
- package/dist/knowledge/arbitration-rail-verifier.d.ts +35 -0
- package/dist/knowledge/arbitration-rail-verifier.js +1 -0
- package/dist/knowledge/arbitration-templates.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +13 -1
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/judgment-baselines.json +1 -0
- package/dist/knowledge/baselines/rules/guard.json +7 -6
- package/dist/knowledge/baselines/rules/progress.json +4 -4
- package/dist/knowledge/baselines/rules/reward.json +118 -3
- package/dist/knowledge/builtin-templates.d.ts +19 -2
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/chain-query-registry.d.ts +14 -0
- package/dist/knowledge/chain-query-registry.js +1 -0
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fee-param-bindings.d.ts +2 -0
- package/dist/knowledge/fee-param-bindings.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-binding-table.js +1 -1
- package/dist/knowledge/guard-binding-verifier.d.ts +7 -0
- package/dist/knowledge/guard-binding-verifier.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-host-context.js +1 -1
- package/dist/knowledge/guard-lint.js +1 -1
- package/dist/knowledge/guard-node-gates.d.ts +3 -1
- package/dist/knowledge/guard-node-gates.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +2 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +2 -0
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/knob-docs.js +1 -1
- package/dist/knowledge/param-schema.d.ts +1 -1
- package/dist/knowledge/param-schema.js +1 -1
- package/dist/knowledge/param-tiers.d.ts +2 -0
- package/dist/knowledge/param-tiers.js +1 -1
- package/dist/knowledge/path-oracle/products/food-delivery.js +1 -1
- package/dist/knowledge/pattern-resolutions.d.ts +2 -0
- package/dist/knowledge/pattern-resolutions.js +1 -1
- package/dist/knowledge/product-detail-source.d.ts +37 -0
- package/dist/knowledge/product-detail-source.js +1 -0
- package/dist/knowledge/product-doc-b5.d.ts +16 -0
- package/dist/knowledge/product-doc-b5.js +1 -0
- package/dist/knowledge/progress-ledger.js +1 -1
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/publish-gate.d.ts +20 -0
- package/dist/knowledge/publish-gate.js +1 -0
- package/dist/knowledge/publish-readiness.d.ts +25 -0
- package/dist/knowledge/publish-readiness.js +1 -0
- package/dist/knowledge/publish-surface-contract.d.ts +16 -0
- package/dist/knowledge/publish-surface-contract.js +1 -0
- package/dist/knowledge/rail-exit-satisfiability.d.ts +25 -0
- package/dist/knowledge/rail-exit-satisfiability.js +1 -0
- package/dist/knowledge/reward-ledger.d.ts +1 -1
- package/dist/knowledge/reward-ledger.js +1 -1
- package/dist/knowledge/reward-risk.d.ts +1 -1
- package/dist/knowledge/reward-risk.js +1 -1
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/service-ledger.d.ts +3 -1
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/template-loader.d.ts +41 -2
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +17 -0
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-test-profiles.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +4 -0
- 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.js +1 -1
- package/dist/participation/customer-interest.d.ts +4 -0
- package/dist/participation/customer-interest.js +1 -1
- package/dist/participation/game-context.js +1 -1
- package/dist/participation/node-action-advisor.d.ts +4 -0
- package/dist/participation/node-action-advisor.js +1 -1
- package/dist/participation/radar-core.js +1 -1
- package/dist/participation/time-window.d.ts +11 -0
- package/dist/participation/time-window.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +28 -3
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/object-panorama.d.ts +4 -0
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/review/order.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +24 -0
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +11 -7
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.d.ts +4 -0
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +28 -0
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +21 -0
- package/dist/schema/call/contact.d.ts +4 -0
- package/dist/schema/call/demand.d.ts +4 -0
- package/dist/schema/call/guard.d.ts +12 -0
- package/dist/schema/call/handler.d.ts +1 -0
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +16 -8
- package/dist/schema/call/normalize-error.d.ts +1 -0
- package/dist/schema/call/normalize-error.js +1 -0
- package/dist/schema/call/order.d.ts +7 -3
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/payment.d.ts +7 -3
- package/dist/schema/call/permission.d.ts +4 -0
- package/dist/schema/call/personal.d.ts +4 -0
- package/dist/schema/call/progress.d.ts +4 -0
- package/dist/schema/call/progress.js +1 -1
- package/dist/schema/call/proof.d.ts +8 -0
- package/dist/schema/call/proof.js +1 -1
- package/dist/schema/call/receipt.js +1 -1
- package/dist/schema/call/repository.d.ts +4 -0
- package/dist/schema/call/reward.d.ts +6 -2
- package/dist/schema/call/reward.js +1 -1
- package/dist/schema/call/semantic.d.ts +2 -2
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +21 -7
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +10 -6
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/envelope-unify.d.ts +1 -0
- package/dist/schema/envelope-unify.js +1 -1
- package/dist/schema/evaluation/index.d.ts +43 -0
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +14 -2
- package/dist/schema/goal/planning.d.ts +18 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +12 -0
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/keeper/index.d.ts +1 -0
- package/dist/schema/local/index.d.ts +10 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/local/wip.js +1 -1
- package/dist/schema/messenger/index.d.ts +1 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +98 -13
- package/dist/schema/operations.js +1 -1
- package/dist/schema/persona/index.d.ts +22 -0
- package/dist/schema/query/bi.d.ts +28 -2
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +67 -61
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/workflow/index.js +1 -1
- package/dist/schema-query-impl/index.d.ts +1 -0
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +2 -1
- package/dist/schemas/benchmark_migration_operation.output.json +74 -0
- package/dist/schemas/benchmark_migration_operation.schema.json +33 -1
- package/dist/schemas/bridge_operation.output.json +2 -1
- package/dist/schemas/bridge_operation.schema.json +40 -0
- package/dist/schemas/evaluation_operation.output.json +96 -0
- package/dist/schemas/evaluation_operation.schema.json +39 -0
- package/dist/schemas/goal_operation.schema.json +32 -0
- package/dist/schemas/guard2file.schema.json +8 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/intent_radar.output.json +10 -2
- package/dist/schemas/intent_radar.schema.json +5 -1
- package/dist/schemas/keeper_operation.output.json +2 -1
- package/dist/schemas/local_cache_operation.output.json +2 -1
- package/dist/schemas/local_history_operation.output.json +2 -1
- package/dist/schemas/local_info_operation.output.json +2 -1
- package/dist/schemas/local_mark_operation.output.json +2 -1
- package/dist/schemas/local_mark_operation.schema.json +10 -1
- package/dist/schemas/machineNode2file.schema.json +8 -0
- package/dist/schemas/messenger_operation.output.json +2 -1
- package/dist/schemas/messenger_operation.schema.json +2 -1
- package/dist/schemas/monitor_events.output.json +2 -1
- package/dist/schemas/monitor_subscription.output.json +2 -1
- package/dist/schemas/onchain_events.output.json +206 -13
- package/dist/schemas/onchain_events.schema.json +16 -0
- package/dist/schemas/onchain_operations.output.json +22 -3
- package/dist/schemas/onchain_operations.schema.json +982 -327
- package/dist/schemas/onchain_operations_allocation.schema.json +20 -13
- package/dist/schemas/onchain_operations_arbitration.schema.json +9 -1
- package/dist/schemas/onchain_operations_contact.schema.json +8 -0
- package/dist/schemas/onchain_operations_demand.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_passport.schema.json +8 -0
- package/dist/schemas/onchain_operations_gen_proof.schema.json +8 -0
- package/dist/schemas/onchain_operations_guard.schema.json +655 -115
- package/dist/schemas/onchain_operations_machine.schema.json +11 -3
- package/dist/schemas/onchain_operations_order.schema.json +14 -11
- package/dist/schemas/onchain_operations_payment.schema.json +12 -9
- package/dist/schemas/onchain_operations_permission.schema.json +8 -0
- package/dist/schemas/onchain_operations_personal.schema.json +8 -0
- package/dist/schemas/onchain_operations_progress.schema.json +9 -1
- package/dist/schemas/onchain_operations_proof.schema.json +9 -1
- package/dist/schemas/onchain_operations_repository.schema.json +8 -0
- package/dist/schemas/onchain_operations_reward.schema.json +14 -11
- package/dist/schemas/onchain_operations_service.schema.json +25 -12
- package/dist/schemas/onchain_operations_treasury.schema.json +17 -19
- package/dist/schemas/onchain_table_data.output.json +52 -10
- package/dist/schemas/persona_operation.output.json +57 -0
- package/dist/schemas/persona_operation.schema.json +9 -0
- package/dist/schemas/query_toolkit.output.json +326 -23
- package/dist/schemas/query_toolkit.schema.json +18 -5
- package/dist/schemas/wip_file.output.json +2 -2
- package/dist/schemas/wip_file.schema.json +2 -2
- package/dist/schemas/workflow_operation.schema.json +1 -1
- package/dist/tools/error-catalog.d.ts +17 -0
- package/dist/tools/error-catalog.js +1 -0
- package/dist/tools/handlers/benchmark-migration.d.ts +29 -8
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/entry-edge-recipe.d.ts +101 -0
- package/dist/tools/handlers/entry-edge-recipe.js +1 -0
- package/dist/tools/handlers/escrow-deficit.d.ts +10 -0
- package/dist/tools/handlers/escrow-deficit.js +1 -0
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/fund-rail-recipe.d.ts +10 -0
- package/dist/tools/handlers/fund-rail-recipe.js +1 -0
- package/dist/tools/handlers/intent-radar.js +1 -1
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/mark-namespace.d.ts +30 -0
- package/dist/tools/handlers/mark-namespace.js +1 -0
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain-name-registration.d.ts +1 -0
- package/dist/tools/handlers/onchain-name-registration.js +1 -1
- package/dist/tools/handlers/onchain-name-registration.spec.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +40 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/publish-binding-echo.d.ts +22 -0
- package/dist/tools/handlers/publish-binding-echo.js +1 -0
- package/dist/tools/handlers/query.d.ts +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/review-chain.d.ts +1 -0
- package/dist/tools/handlers/review-chain.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/handlers/stale-build-check.d.ts +9 -0
- package/dist/tools/handlers/stale-build-check.js +1 -0
- package/dist/tools/handlers/submission-assembly.d.ts +55 -0
- package/dist/tools/handlers/submission-assembly.js +1 -0
- package/dist/tools/handlers/wip.js +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/move-fn-index.gen.js +1 -1
- package/dist/tools/publish-gate-state.d.ts +5 -0
- package/dist/tools/publish-gate-state.js +1 -0
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/onchain.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/retry.js +1 -1
- package/dist/tools/runtime-health.js +1 -1
- package/dist/tools/shared.js +1 -1
- package/dist/tools/upgrade-check.d.ts +1 -0
- package/dist/tools/upgrade-check.js +1 -1
- package/dist/tools/wip-verify-ledger.d.ts +2 -0
- package/dist/tools/wip-verify-ledger.js +1 -1
- package/dist/tools/wrap.d.ts +15 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as a523a from'@wowok/wowok';const SDK_SCHEMA_VERSION=a523a['SCHEMA_VERSION']??'1.0.0',checkSchemaCompatibility=a523a['checkSchemaCompatibility']??((a,b)=>({'compatible':!![]}));export const MCP_SCHEMA_VERSION='1.2.0';export function getSchemaVersions(){return{'sdk':SDK_SCHEMA_VERSION,'mcp':MCP_SCHEMA_VERSION};}export function checkClientSchemaCompatibility(a,b={}){const c=getSchemaVersions(),d={'compatible':!![],'warnings':[],'errors':[],'versions':c,'client_version':a};if(!a)return d;const e=checkSchemaCompatibility(a,c['sdk']);if(!e['compatible']){d['compatible']=![];const g='SDK\x20schema\x20incompatibility:\x20'+e['reason'];b['mode']==='strict'?d['errors']['push'](g):d['warnings']['push'](g);}const f=checkSchemaCompatibility(a,c['mcp']);if(!f['compatible']){d['compatible']=![];const h='MCP\x20schema\x20incompatibility:\x20'+f['reason'];b['mode']==='strict'?d['errors']['push'](h):d['warnings']['push'](h);}return d;}export function attachSchemaWarning(a,b){if(b['warnings']['length']===0x0&&b['errors']['length']===0x0)return a;const c=[];b['warnings']['length']>0x0&&c['push'](...b['warnings']);b['errors']['length']>0x0&&c['push'](...b['errors']);const d=a['semantic']?{...a['semantic'],'warnings':[...a['semantic']['warnings']||[],...c]}:undefined;return{...a,'semantic':d,'schema_warning':{'compatible':b['compatible'],'warnings':c,'client_version':b['client_version'],'server_versions':b['versions']}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from'zod';import{isValidLongName,MAX_LONG_NAME_LENGTH}from'@wowok/wowok';import{EntrypointSchema,NameOrAddressSchema}from'../common/index.js';import{SubmissionCallSchema}from'../call/base.js';import{unifyWorkflowInput}from'../envelope-unify.js';export const WorkflowOperateOpSchema=z['enum'](['next','hold','unhold','adminUnhold'])['describe']('Forward\x20operation:\x20\x27next\x27\x20=\x20accomplish\x20the\x20forward;\x20\x27hold\x27\x20=\x20block\x20the\x20forward;\x20'+'\x27unhold\x27\x20=\x20release\x20own\x20hold;\x20\x27adminUnhold\x27\x20=\x20force-release\x20via\x20permission\x20224.');export const WorkflowAccountSchema=z['object']({'address':z['string']()['describe']('Local\x20account\x20address'),'name':z['string']()['optional']()['describe']('Local\x20account\x20name\x20(if\x20any)')})['describe']('A\x20local\x20account\x20that\x20can\x20execute\x20a\x20forward');export const WorkflowForwardViewSchema=z['object']({'next_node':z['string']()['describe']('Target\x20node\x20this\x20forward\x20advances\x20INTO'),'forward':z['string']()['describe']('Forward\x20(operation)\x20name'),'weight':z['number']()['describe']('Forward\x20weight\x20contributed\x20toward\x20the\x20pair\x20threshold'),'threshold':z['number']()['describe']('Pair\x20threshold\x20the\x20forward\x20contributes\x20to'),'guard':z['string']()['optional']()['describe']('Guard\x20bound\x20to\x20this\x20forward\x20—\x20must\x20be\x20verified\x20(passport)\x20before\x20the\x20transition'),'guard_submissions':z['array'](z['object']({'identifier':z['number'](),'name':z['string']()['describe']('Human-readable\x20field\x20name'),'value_type':z['string']()['describe']('Expected\x20value\x20type\x20(Address,\x20U64,\x20String,\x20VecAddress,\x20...)'),'object_type':z['string']()['optional']()['describe']('When\x20value_type\x20is\x20an\x20object\x20address\x20—\x20the\x20expected\x20object\x20type\x20(e.g.\x20Order)')}))['optional']()['describe']('Guard\x20submission\x20fields\x20the\x20user\x20must\x20fill\x20to\x20advance\x20this\x20forward\x20(from\x20the\x20guard\x27s\x20b_submission\x20table\x20items)'),'operator_kind':z['enum'](['order_holder','named_operator','permission_index'])['describe']('How\x20this\x20forward\x27s\x20operator\x20is\x20resolved'),'permission_index':z['number']()['optional']()['describe']('Permission\x20index\x20when\x20operator_kind\x20is\x20\x27permission_index\x27'),'named_operator':z['string']()['optional']()['describe']('NamedOperator\x20namespace\x20when\x20operator_kind\x20is\x20\x27named_operator\x27'),'executable_accounts':z['array'](WorkflowAccountSchema)['describe']('LOCAL\x20accounts\x20that\x20can\x20execute\x20this\x20forward\x20(may\x20be\x20empty\x20—\x20then\x20no\x20local\x20account\x20is\x20authorized)')})['describe']('A\x20reachable\x20forward\x20with\x20its\x20permission\x20+\x20guard\x20+\x20executable\x20local\x20accounts');export const WorkflowTaskSchema=z['object']({'progress':z['string']()['describe']('Progress\x20object\x20address'),'progress_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20progress\x20(local\x20account/mark\x20name,\x20when\x20resolved)'),'current':z['string']()['describe']('Current\x20node\x20of\x20the\x20Progress\x20(\x27\x27\x20=\x20initial)'),'machine':z['string']()['describe']('Machine\x20object\x20address'),'machine_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20machine\x20object\x20(when\x20resolved)'),'task':z['string']()['nullable']()['describe']('Bound\x20task\x20(Order)\x20address,\x20or\x20null'),'task_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20bound\x20Order\x20(when\x20resolved)'),'service':z['string']()['optional']()['describe']('Service\x20address\x20(resolved\x20via\x20the\x20bound\x20Order,\x20if\x20any)'),'service_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20Service\x20object\x20(when\x20resolved)'),'context_repositories':z['array'](z['object']({'address':z['string']()['describe']('Context\x20repository\x20address'),'name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20repository\x20(when\x20resolved)')}))['optional']()['describe']('Context\x20repositories\x20bound\x20to\x20the\x20Progress\x20(zero\x20or\x20more)'),'options':z['array'](WorkflowForwardViewSchema)['describe']('ALL\x20reachable\x20next-node\x20forwards\x20with\x20permission\x20+\x20guard\x20+\x20executable\x20accounts\x20(may\x20be\x20empty\x20for\x20a\x20completed/terminal\x20progress)'),'terminal':z['boolean']()['describe']('True\x20when\x20the\x20current\x20node\x20has\x20no\x20outgoing\x20forwards\x20(workflow\x20is\x20stuck\x20or\x20finished)'),'actionable':z['boolean']()['describe']('True\x20when\x20at\x20least\x20one\x20LOCAL\x20account\x20can\x20execute\x20a\x20forward\x20right\x20now;\x20false\x20for\x20progress\x20that\x20is\x20merely\x20related\x20(e.g.\x20already\x20completed)'),'history_count':z['number']()['optional']()['describe']('On-chain\x20Progress.history\x20length\x20(append-only)\x20—\x200\x20when\x20no\x20migrations\x20yet'),'current_time':z['number']()['optional']()['describe']('Chain\x20clock\x20(ms)\x20when\x20the\x20current\x20node\x20was\x20entered\x20(Progress.current_time)\x20—\x20for\x20elapsed-dwell\x20display')})['describe']('A\x20progress\x20object\x20related\x20to\x20a\x20local\x20account:\x20actionable\x20(a\x20local\x20account\x20can\x20act\x20on\x20it)\x20or\x20related\x20(order\x20holder\x20/\x20named\x20operator\x20/\x20session\x20operator\x20involvement\x20—\x20viewable\x20history)');const WorkflowOperationInputUnion=z['discriminatedUnion']('action',[z['object']({'action':z['literal']('list'),'limit':z['number']()['int']()['min'](0x1)['max'](0x64)['optional']()['describe']('Max\x20progress\x20entries\x20to\x20return,\x20actionable\x20first\x20(default\x2050)'),'network':EntrypointSchema['optional'](),'no_cache':z['boolean']()['optional']()}),z['object']({'action':z['literal']('operate'),'progress':NameOrAddressSchema['describe']('Progress\x20object\x20(name\x20or\x20address)\x20to\x20operate\x20on'),'account':z['string']()['optional']()['describe']('Signing\x20account\x20(name\x20or\x20address).\x20Defaults\x20to\x20the\x20first\x20executable\x20local\x20account.'),'operate':z['object']({'operation':z['object']({'next_node_name':z['string']()['describe']('Target\x20node\x20name'),'forward':z['string']()['describe']('Forward\x20name')})['strict'](),'op':WorkflowOperateOpSchema,'message':z['string']()['optional']()['refine'](a=>a===undefined||isValidLongName(a),{'message':'Forward\x20message\x20exceeds\x20the\x20'+MAX_LONG_NAME_LENGTH+'-byte\x20on-chain\x20limit\x20'+'(UTF-8\x20bytes;\x20a\x20CJK\x20character\x20costs\x20~3\x20bytes).\x20Keep\x20the\x20message\x20short\x20'+'(e.g.\x20\x27delivered\x20per\x20route\x20A,\x20POD\x20photo\x20taken\x27)\x20and\x20put\x20long\x20evidence\x20'+'off-chain,\x20referencing\x20it\x20by\x20hash/URL\x20inside\x20the\x20message'})['describe']('Optional\x20human-readable\x20message\x20recorded\x20on-chain\x20(≤256\x20UTF-8\x20bytes\x20—\x20Move\x20LONG_NAME\x20cap,\x20enforced\x20here\x20before\x20the\x20transaction\x20is\x20built)')})['strict']()['describe']('⚠️\x20SINGLE-OPERATOR\x20LOCK:\x20each\x20forward\x20is\x20locked\x20by\x20the\x20FIRST\x20operator\x20that\x20accomplishes\x20it\x20—\x20a\x20different\x20account\x20'+'re-executing\x20the\x20same\x20accomplished\x20forward\x20aborts\x20E_NOT_THE_HOLDER,\x20and\x20the\x20weight\x20is\x20counted\x20only\x20once.\x20'+'Multi-operator\x20cooperation\x20(threshold\x20>\x201)\x20is\x20done\x20via\x20DISTINCT\x20forwards\x20(one\x20per\x20contributor).\x20The\x20workflow\x20'+'\x27list\x27\x20action\x20already\x20hides\x20accomplished\x20forwards\x20and\x20restricts\x20held\x20forwards\x20to\x20their\x20holder.'),'submission':SubmissionCallSchema['optional']()['describe']('Guard\x20submissions\x20for\x20guarded\x20forwards\x20(forward.guard_submissions\x20in\x20the\x20list\x20describes\x20each\x20required\x20field).\x20'+'Fill\x20`submission:\x20[{\x20guard:\x20\x27<guard>\x27,\x20submission:\x20[{\x20identifier,\x20b_submission:\x20true,\x20value_type,\x20value\x20}]\x20}]`\x20'+'with\x20the\x20value\x20the\x20user\x20entered\x20for\x20each\x20b_submission\x20field.'),'confirmed':z['boolean']()['optional']()['describe']('Phase\x202\x20ConfirmGate:\x20set\x20to\x20true\x20to\x20proceed\x20after\x20a\x20\x27pending_confirmation\x27\x20result\x20(required\x20when\x20submitting\x20guard\x20submission\x20data).\x20The\x20operation\x20is\x20NOT\x20executed\x20until\x20you\x20re-call\x20with\x20confirmed=true\x20after\x20user\x20consent.'),'dry_run':z['boolean']()['optional']()['describe']('Phase\x201\x20dry_run:\x20when\x20true,\x20SIMULATE\x20the\x20transaction\x20without\x20signing\x20or\x20submitting.\x20Returns\x20effects\x20+\x20events\x20showing\x20what\x20WOULD\x20happen\x20—\x20no\x20on-chain\x20state\x20is\x20modified,\x20no\x20gas\x20is\x20charged.\x20Use\x20this\x20to\x20verify\x20that\x20a\x20forward\x20(especially\x20a\x20guarded\x20one)\x20will\x20succeed\x20before\x20committing.'),'network':EntrypointSchema['optional'](),'no_cache':z['boolean']()['optional']()}),z['object']({'action':z['literal']('task'),'progress':NameOrAddressSchema['describe']('Progress\x20object\x20(name\x20or\x20address)\x20to\x20snapshot'),'network':EntrypointSchema['optional'](),'no_cache':z['boolean']()['optional']()}),z['object']({'action':z['literal']('history'),'progress':NameOrAddressSchema['describe']('Progress\x20object\x20(name\x20or\x20address)\x20whose\x20history\x20to\x20sync\x20and\x20view'),'limit':z['number']()['int']()['min'](0x1)['max'](0x1f4)['optional']()['describe']('Max\x20history\x20records\x20to\x20return,\x20newest\x20first\x20(default\x2050)'),'prune':z['boolean']()['optional']()['describe']('Run\x20the\x2090-day\x20retention\x20cleanup\x20of\x20stale\x20progress\x20histories\x20(default\x20true)'),'network':EntrypointSchema['optional'](),'no_cache':z['boolean']()['optional']()})])['describe']('workflow_operation\x20input.\x20action=\x27list\x27\x20enumerates\x20progress\x20related\x20to\x20local\x20accounts\x20(actionable\x20first,\x20'+'plus\x20completed/related\x20progress\x20with\x20viewable\x20history);\x20'+'action=\x27task\x27\x20builds\x20the\x20SAME\x20snapshot\x20for\x20ONE\x20progress\x20(options\x20may\x20carry\x20empty\x20executable_accounts\x20—\x20the\x20client\x20grays\x20the\x20actions);\x20'+'action=\x27operate\x27\x20advances/holds/unholds\x20a\x20forward\x20as\x20a\x20chosen\x20local\x20account;\x20'+'action=\x27history\x27\x20incrementally\x20syncs\x20+\x20returns\x20a\x20progress\x27s\x20on-chain\x20history.');export const WorkflowOperationInputSchema=z['preprocess'](unifyWorkflowInput,WorkflowOperationInputUnion);export const WorkflowHistoryForwardSchema=z['object']({'forward':z['string']()['describe']('Forward\x20(operation)\x20name'),'who':z['string']()['nullable']()['describe']('Operator\x20address\x20that\x20performed\x20the\x20forward\x20(null\x20=\x20not\x20yet\x20held)'),'who_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20operator\x20(account\x20name,\x20else\x20LocalMark)'),'msg':z['string']()['describe']('Message\x20recorded\x20with\x20the\x20forward'),'accomplished':z['boolean']()['describe']('Whether\x20the\x20forward\x20was\x20accomplished'),'weight':z['number']()['optional']()['describe']('Forward\x20weight\x20(from\x20the\x20machine\x20config;\x20the\x20chain\x20Holder\x20snapshot\x20stores\x20no\x20per-forward\x20weight)'),'time':z['number']()['describe']('Last\x20operation\x20time\x20(on-chain\x20clock\x20ms)'),'retained_submission':z['array'](z['object']({'identifier':z['number'](),'value_type':z['number'](),'value':z['unknown'](),'display_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20first\x20address-typed\x20value\x20(when\x20resolved)')}))['optional']()['describe']('Retained\x20Guard\x20submission\x20entries')})['describe']('One\x20forward\x20execution\x20inside\x20a\x20session\x20snapshot');export const WorkflowHistorySessionSchema=z['object']({'next_node':z['string']()['describe']('Session\x20target\x20node\x20(the\x20not-yet-migrated\x20direction)'),'weights':z['number']()['describe']('Accumulated\x20forward\x20weight\x20at\x20migration\x20time'),'threshold':z['number']()['describe']('Threshold\x20required\x20to\x20complete\x20the\x20pair'),'forwards':z['array'](WorkflowHistoryForwardSchema)['describe']('Forward\x20executions\x20in\x20this\x20session')})['describe']('Session\x20snapshot\x20captured\x20at\x20migration\x20time');export const WorkflowHistoryRecordSchema=z['object']({'index':z['number']()['describe']('On-chain\x20history\x20index\x20(0-based,\x20append-only)'),'node':z['string']()['describe']('Node\x20migrated\x20FROM'),'next_node':z['string']()['describe']('Node\x20migrated\x20TO'),'time':z['number']()['describe']('Migration\x20time\x20(on-chain\x20clock\x20ms)'),'session':z['array'](WorkflowHistorySessionSchema)['describe']('Full\x20session\x20snapshot\x20at\x20migration')})['describe']('One\x20on-chain\x20Progress\x20history\x20record\x20(a\x20completed\x20migration)');export const WorkflowHistoryViewSchema=z['object']({'progress':z['string']()['describe']('Progress\x20object\x20address'),'current':z['string']()['optional']()['describe']('Current\x20node\x20as\x20of\x20this\x20sync'),'records':z['array'](WorkflowHistoryRecordSchema)['describe']('History\x20records,\x20newest\x20first'),'synced':z['number']()['describe']('Number\x20of\x20records\x20newly\x20synced\x20in\x20this\x20call'),'cursor':z['number']()['describe']('Last\x20synced\x20history\x20index\x20(0-based;\x20-1\x20=\x20none\x20yet)'),'pruned':z['number']()['describe']('Progress\x20entries\x20cleaned\x20by\x20the\x2090-day\x20retention\x20in\x20this\x20call')})['describe']('A\x20progress\x27s\x20synced\x20on-chain\x20history');export const WorkflowOperationResultSchema=z['object']({'action':z['enum'](['list','task','operate','history']),'tasks':z['array'](WorkflowTaskSchema)['optional']()['describe']('Present\x20for\x20action=\x27list\x27\x20and\x20action=\x27task\x27\x20(a\x20one-element\x20array\x20—\x20the\x20same\x20snapshot\x20shape\x20as\x20a\x20list\x20item,\x20built\x20for\x20the\x20requested\x20progress\x20regardless\x20of\x20local-account\x20relation;\x20executable_accounts\x20may\x20be\x20empty\x20when\x20no\x20local\x20account\x20is\x20authorized)'),'operate':z['unknown']()['optional']()['describe']('Present\x20for\x20action=\x27operate\x27\x20(the\x20underlying\x20progress\x20operation\x20result)'),'history':WorkflowHistoryViewSchema['optional']()['describe']('Present\x20for\x20action=\x27history\x27'),'note':z['string']()['optional']()})['describe']('workflow_operation\x20result');export const WorkflowOperationOutputSchema=z['object']({'result':WorkflowOperationResultSchema})['describe']('workflow_operation\x20output\x20envelope');
|
|
1
|
+
import{z}from'zod';import{isValidLongName,MAX_LONG_NAME_LENGTH}from'@wowok/wowok';import{EntrypointSchema,NameOrAddressSchema}from'../common/index.js';import{SubmissionCallSchema}from'../call/base.js';import{unifyWorkflowInput}from'../envelope-unify.js';export const WorkflowOperateOpSchema=z['enum'](['next','hold','unhold','adminUnhold'])['describe']('Forward\x20operation:\x20\x27next\x27\x20=\x20accomplish\x20the\x20forward;\x20\x27hold\x27\x20=\x20block\x20the\x20forward;\x20'+'\x27unhold\x27\x20=\x20release\x20own\x20hold;\x20\x27adminUnhold\x27\x20=\x20force-release\x20via\x20permission\x20224.');export const WorkflowAccountSchema=z['object']({'address':z['string']()['describe']('Local\x20account\x20address'),'name':z['string']()['optional']()['describe']('Local\x20account\x20name\x20(if\x20any)')})['describe']('A\x20local\x20account\x20that\x20can\x20execute\x20a\x20forward');export const WorkflowForwardViewSchema=z['object']({'next_node':z['string']()['describe']('Target\x20node\x20this\x20forward\x20advances\x20INTO'),'forward':z['string']()['describe']('Forward\x20(operation)\x20name'),'weight':z['number']()['describe']('Forward\x20weight\x20contributed\x20toward\x20the\x20pair\x20threshold'),'threshold':z['number']()['describe']('Pair\x20threshold\x20the\x20forward\x20contributes\x20to'),'guard':z['string']()['optional']()['describe']('Guard\x20bound\x20to\x20this\x20forward\x20—\x20must\x20be\x20verified\x20(passport)\x20before\x20the\x20transition'),'guard_submissions':z['array'](z['object']({'identifier':z['number'](),'name':z['string']()['describe']('Human-readable\x20field\x20name'),'value_type':z['string']()['describe']('Expected\x20value\x20type\x20(Address,\x20U64,\x20String,\x20VecAddress,\x20...)'),'object_type':z['string']()['optional']()['describe']('When\x20value_type\x20is\x20an\x20object\x20address\x20—\x20the\x20expected\x20object\x20type\x20(e.g.\x20Order)')}))['optional']()['describe']('Guard\x20submission\x20fields\x20the\x20user\x20must\x20fill\x20to\x20advance\x20this\x20forward\x20(from\x20the\x20guard\x27s\x20b_submission\x20table\x20items)'),'operator_kind':z['enum'](['order_holder','named_operator','permission_index'])['describe']('How\x20this\x20forward\x27s\x20operator\x20is\x20resolved'),'permission_index':z['number']()['optional']()['describe']('Permission\x20index\x20when\x20operator_kind\x20is\x20\x27permission_index\x27'),'named_operator':z['string']()['optional']()['describe']('NamedOperator\x20namespace\x20when\x20operator_kind\x20is\x20\x27named_operator\x27'),'executable_accounts':z['array'](WorkflowAccountSchema)['describe']('LOCAL\x20accounts\x20that\x20can\x20execute\x20this\x20forward\x20(may\x20be\x20empty\x20—\x20then\x20no\x20local\x20account\x20is\x20authorized)')})['describe']('A\x20reachable\x20forward\x20with\x20its\x20permission\x20+\x20guard\x20+\x20executable\x20local\x20accounts');export const WorkflowTaskSchema=z['object']({'progress':z['string']()['describe']('Progress\x20object\x20address'),'progress_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20progress\x20(local\x20account/mark\x20name,\x20when\x20resolved)'),'current':z['string']()['describe']('Current\x20node\x20of\x20the\x20Progress\x20(\x27\x27\x20=\x20initial)'),'machine':z['string']()['describe']('Machine\x20object\x20address'),'machine_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20machine\x20object\x20(when\x20resolved)'),'task':z['string']()['nullable']()['describe']('Bound\x20task\x20(Order)\x20address,\x20or\x20null'),'task_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20bound\x20Order\x20(when\x20resolved)'),'service':z['string']()['optional']()['describe']('Service\x20address\x20(resolved\x20via\x20the\x20bound\x20Order,\x20if\x20any)'),'service_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20Service\x20object\x20(when\x20resolved)'),'context_repositories':z['array'](z['object']({'address':z['string']()['describe']('Context\x20repository\x20address'),'name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20repository\x20(when\x20resolved)')}))['optional']()['describe']('Context\x20repositories\x20bound\x20to\x20the\x20Progress\x20(zero\x20or\x20more)'),'options':z['array'](WorkflowForwardViewSchema)['describe']('ALL\x20reachable\x20next-node\x20forwards\x20with\x20permission\x20+\x20guard\x20+\x20executable\x20accounts\x20(may\x20be\x20empty\x20for\x20a\x20completed/terminal\x20progress)'),'terminal':z['boolean']()['describe']('True\x20when\x20the\x20current\x20node\x20has\x20no\x20outgoing\x20forwards\x20(workflow\x20is\x20stuck\x20or\x20finished)'),'actionable':z['boolean']()['describe']('True\x20when\x20at\x20least\x20one\x20LOCAL\x20account\x20can\x20execute\x20a\x20forward\x20right\x20now;\x20false\x20for\x20progress\x20that\x20is\x20merely\x20related\x20(e.g.\x20already\x20completed)'),'history_count':z['number']()['optional']()['describe']('On-chain\x20Progress.history\x20length\x20(append-only)\x20—\x200\x20when\x20no\x20migrations\x20yet'),'current_time':z['number']()['optional']()['describe']('Chain\x20clock\x20(ms)\x20when\x20the\x20current\x20node\x20was\x20entered\x20(Progress.current_time)\x20—\x20for\x20elapsed-dwell\x20display')})['describe']('A\x20progress\x20object\x20related\x20to\x20a\x20local\x20account:\x20actionable\x20(a\x20local\x20account\x20can\x20act\x20on\x20it)\x20or\x20related\x20(order\x20holder\x20/\x20named\x20operator\x20/\x20session\x20operator\x20involvement\x20—\x20viewable\x20history)');const WorkflowOperationInputUnion=z['discriminatedUnion']('action',[z['object']({'action':z['literal']('list'),'limit':z['number']()['int']()['min'](0x1)['max'](0x64)['optional']()['describe']('Max\x20progress\x20entries\x20to\x20return,\x20actionable\x20first\x20(default\x2050)'),'network':EntrypointSchema['optional'](),'no_cache':z['boolean']()['optional']()}),z['object']({'action':z['literal']('operate'),'progress':NameOrAddressSchema['describe']('Progress\x20object\x20(name\x20or\x20address)\x20to\x20operate\x20on'),'account':z['string']()['optional']()['describe']('Signing\x20account\x20(name\x20or\x20address).\x20Defaults\x20to\x20the\x20first\x20executable\x20local\x20account.'),'operate':z['object']({'operation':z['object']({'next_node_name':z['string']()['describe']('Target\x20node\x20name'),'forward':z['string']()['describe']('Forward\x20name')})['strict'](),'op':WorkflowOperateOpSchema,'message':z['string']()['optional']()['refine'](a=>a===undefined||isValidLongName(a),{'message':'Forward\x20message\x20exceeds\x20the\x20'+MAX_LONG_NAME_LENGTH+'-byte\x20on-chain\x20limit\x20'+'(UTF-8\x20bytes;\x20a\x20CJK\x20character\x20costs\x20~3\x20bytes).\x20Keep\x20the\x20message\x20short\x20'+'(e.g.\x20\x27delivered\x20per\x20route\x20A,\x20POD\x20photo\x20taken\x27)\x20and\x20put\x20long\x20evidence\x20'+'off-chain,\x20referencing\x20it\x20by\x20hash/URL\x20inside\x20the\x20message'})['describe']('Optional\x20human-readable\x20message\x20recorded\x20on-chain\x20(≤256\x20UTF-8\x20bytes\x20—\x20Move\x20LONG_NAME\x20cap,\x20enforced\x20here\x20before\x20the\x20transaction\x20is\x20built)')})['strict']()['describe']('⚠️\x20SINGLE-OPERATOR\x20LOCK:\x20each\x20forward\x20is\x20locked\x20by\x20the\x20FIRST\x20operator\x20that\x20accomplishes\x20it\x20—\x20a\x20different\x20account\x20'+'re-executing\x20the\x20same\x20accomplished\x20forward\x20aborts\x20E_NOT_THE_HOLDER,\x20and\x20the\x20weight\x20is\x20counted\x20only\x20once.\x20'+'Multi-operator\x20cooperation\x20(threshold\x20>\x201)\x20is\x20done\x20via\x20DISTINCT\x20forwards\x20(one\x20per\x20contributor).\x20The\x20workflow\x20'+'\x27list\x27\x20action\x20already\x20hides\x20accomplished\x20forwards\x20and\x20restricts\x20held\x20forwards\x20to\x20their\x20holder.'),'submission':SubmissionCallSchema['optional']()['describe']('Guard\x20submissions\x20for\x20guarded\x20forwards\x20(forward.guard_submissions\x20in\x20the\x20list\x20describes\x20each\x20required\x20field).\x20'+'Fill\x20`submission:\x20[{\x20guard:\x20\x27<guard>\x27,\x20submission:\x20[{\x20identifier,\x20b_submission:\x20true,\x20value_type,\x20value\x20}]\x20}]`\x20'+'with\x20the\x20value\x20the\x20user\x20entered\x20for\x20each\x20b_submission\x20field.'),'confirmed':z['boolean']()['optional']()['describe']('Phase\x202\x20ConfirmGate:\x20set\x20to\x20true\x20to\x20proceed\x20after\x20a\x20\x27pending_confirmation\x27\x20result\x20(required\x20when\x20submitting\x20guard\x20submission\x20data).\x20The\x20operation\x20is\x20NOT\x20executed\x20until\x20you\x20re-call\x20with\x20confirmed=true\x20after\x20user\x20consent.'),'dry_run':z['boolean']()['optional']()['describe']('Phase\x201\x20dry_run:\x20when\x20true,\x20SIMULATE\x20the\x20transaction\x20without\x20signing\x20or\x20submitting.\x20Returns\x20effects\x20+\x20events\x20showing\x20what\x20WOULD\x20happen\x20—\x20no\x20on-chain\x20state\x20is\x20modified,\x20no\x20gas\x20is\x20charged.\x20Use\x20this\x20to\x20verify\x20that\x20a\x20forward\x20(especially\x20a\x20guarded\x20one)\x20will\x20succeed\x20before\x20committing.'),'network':EntrypointSchema['optional'](),'no_cache':z['boolean']()['optional']()}),z['object']({'action':z['literal']('task'),'progress':NameOrAddressSchema['describe']('Progress\x20object\x20(name\x20or\x20address)\x20to\x20snapshot'),'network':EntrypointSchema['optional'](),'no_cache':z['boolean']()['optional']()}),z['object']({'action':z['literal']('history'),'progress':NameOrAddressSchema['describe']('Progress\x20object\x20(name\x20or\x20address)\x20whose\x20history\x20to\x20sync\x20and\x20view'),'limit':z['number']()['int']()['min'](0x1)['max'](0x1f4)['optional']()['describe']('Max\x20history\x20records\x20to\x20return,\x20newest\x20first\x20(default\x2050)'),'prune':z['boolean']()['optional']()['describe']('Run\x20the\x2090-day\x20retention\x20cleanup\x20of\x20stale\x20progress\x20histories\x20(default\x20true)'),'network':EntrypointSchema['optional'](),'no_cache':z['boolean']()['optional']()})])['describe']('workflow_operation\x20input.\x20action=\x27list\x27\x20enumerates\x20progress\x20related\x20to\x20local\x20accounts\x20(actionable\x20first,\x20'+'plus\x20completed/related\x20progress\x20with\x20viewable\x20history);\x20'+'action=\x27task\x27\x20builds\x20the\x20SAME\x20snapshot\x20for\x20ONE\x20progress\x20(options\x20may\x20carry\x20empty\x20executable_accounts\x20—\x20the\x20client\x20grays\x20the\x20actions);\x20'+'action=\x27operate\x27\x20advances/holds/unholds\x20a\x20forward\x20as\x20a\x20chosen\x20local\x20account;\x20'+'action=\x27history\x27\x20incrementally\x20syncs\x20+\x20returns\x20a\x20progress\x27s\x20on-chain\x20history.\x20'+'NETWORK\x20POSITION\x20(single):\x20the\x20native\x20shape\x20takes\x20network\x20at\x20the\x20TOP\x20LEVEL\x20of\x20the\x20input;\x20the\x20onchain\x20progress\x20envelope\x20'+'({operation_type:\x27progress\x27,\x20data,\x20env})\x20takes\x20it\x20in\x20env.\x20A\x20network\x20misplaced\x20inside\x20data\x20(or\x20inside\x20env\x20on\x20the\x20native\x20shape)\x20'+'is\x20REFUSED\x20with\x20a\x20fail-loud\x20error\x20—\x20it\x20never\x20silently\x20falls\x20back\x20to\x20the\x20default\x20network.');export const WorkflowOperationInputSchema=z['preprocess'](unifyWorkflowInput,WorkflowOperationInputUnion);export const WorkflowHistoryForwardSchema=z['object']({'forward':z['string']()['describe']('Forward\x20(operation)\x20name'),'who':z['string']()['nullable']()['describe']('Operator\x20address\x20that\x20performed\x20the\x20forward\x20(null\x20=\x20not\x20yet\x20held)'),'who_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20operator\x20(account\x20name,\x20else\x20LocalMark)'),'msg':z['string']()['describe']('Message\x20recorded\x20with\x20the\x20forward'),'accomplished':z['boolean']()['describe']('Whether\x20the\x20forward\x20was\x20accomplished'),'weight':z['number']()['optional']()['describe']('Forward\x20weight\x20(from\x20the\x20machine\x20config;\x20the\x20chain\x20Holder\x20snapshot\x20stores\x20no\x20per-forward\x20weight)'),'time':z['number']()['describe']('Last\x20operation\x20time\x20(on-chain\x20clock\x20ms)'),'retained_submission':z['array'](z['object']({'identifier':z['number'](),'value_type':z['number'](),'value':z['unknown'](),'display_name':z['string']()['optional']()['describe']('Display\x20name\x20for\x20the\x20first\x20address-typed\x20value\x20(when\x20resolved)')}))['optional']()['describe']('Retained\x20Guard\x20submission\x20entries')})['describe']('One\x20forward\x20execution\x20inside\x20a\x20session\x20snapshot');export const WorkflowHistorySessionSchema=z['object']({'next_node':z['string']()['describe']('Session\x20target\x20node\x20(the\x20not-yet-migrated\x20direction)'),'weights':z['number']()['describe']('Accumulated\x20forward\x20weight\x20at\x20migration\x20time'),'threshold':z['number']()['describe']('Threshold\x20required\x20to\x20complete\x20the\x20pair'),'forwards':z['array'](WorkflowHistoryForwardSchema)['describe']('Forward\x20executions\x20in\x20this\x20session')})['describe']('Session\x20snapshot\x20captured\x20at\x20migration\x20time');export const WorkflowHistoryRecordSchema=z['object']({'index':z['number']()['describe']('On-chain\x20history\x20index\x20(0-based,\x20append-only)'),'node':z['string']()['describe']('Node\x20migrated\x20FROM'),'next_node':z['string']()['describe']('Node\x20migrated\x20TO'),'time':z['number']()['describe']('Migration\x20time\x20(on-chain\x20clock\x20ms)'),'session':z['array'](WorkflowHistorySessionSchema)['describe']('Full\x20session\x20snapshot\x20at\x20migration')})['describe']('One\x20on-chain\x20Progress\x20history\x20record\x20(a\x20completed\x20migration)');export const WorkflowHistoryViewSchema=z['object']({'progress':z['string']()['describe']('Progress\x20object\x20address'),'current':z['string']()['optional']()['describe']('Current\x20node\x20as\x20of\x20this\x20sync'),'records':z['array'](WorkflowHistoryRecordSchema)['describe']('History\x20records,\x20newest\x20first'),'synced':z['number']()['describe']('Number\x20of\x20records\x20newly\x20synced\x20in\x20this\x20call'),'cursor':z['number']()['describe']('Last\x20synced\x20history\x20index\x20(0-based;\x20-1\x20=\x20none\x20yet)'),'pruned':z['number']()['describe']('Progress\x20entries\x20cleaned\x20by\x20the\x2090-day\x20retention\x20in\x20this\x20call')})['describe']('A\x20progress\x27s\x20synced\x20on-chain\x20history');export const WorkflowOperationResultSchema=z['object']({'action':z['enum'](['list','task','operate','history']),'tasks':z['array'](WorkflowTaskSchema)['optional']()['describe']('Present\x20for\x20action=\x27list\x27\x20and\x20action=\x27task\x27\x20(a\x20one-element\x20array\x20—\x20the\x20same\x20snapshot\x20shape\x20as\x20a\x20list\x20item,\x20built\x20for\x20the\x20requested\x20progress\x20regardless\x20of\x20local-account\x20relation;\x20executable_accounts\x20may\x20be\x20empty\x20when\x20no\x20local\x20account\x20is\x20authorized)'),'operate':z['unknown']()['optional']()['describe']('Present\x20for\x20action=\x27operate\x27\x20(the\x20underlying\x20progress\x20operation\x20result)'),'history':WorkflowHistoryViewSchema['optional']()['describe']('Present\x20for\x20action=\x27history\x27'),'note':z['string']()['optional']()})['describe']('workflow_operation\x20result');export const WorkflowOperationOutputSchema=z['object']({'result':WorkflowOperationResultSchema})['describe']('workflow_operation\x20output\x20envelope');
|
|
@@ -65,6 +65,7 @@ export interface GuardSemanticsPartyEvaluation {
|
|
|
65
65
|
}>;
|
|
66
66
|
query_dependencies: number[];
|
|
67
67
|
unresolved_queries: Array<number | string>;
|
|
68
|
+
unresolved_identifiers: number[];
|
|
68
69
|
has_time_conditions: boolean;
|
|
69
70
|
has_signer_constraints: boolean;
|
|
70
71
|
has_rely_composition: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFileSync,existsSync,writeFileSync,mkdirSync}from'fs';import{resolve,join,dirname}from'path';import{fileURLToPath}from'url';import{GUARDQUERY,ObjectType,ValueType}from'@wowok/wowok';import{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence}from'../knowledge/tools-reference.js';import{GUARD_DESIGN_PATTERNS,getGuardDesignPattern,GUARD_DESIGN_PATTERNS_VERSION,GUARD_SCHEMA_NOTES}from'../knowledge/guard-design-patterns.js';import{OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,PROTOCOL_SLOT_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,NAMING_CONVENTIONS,SAFETY_RULES_VERSION}from'../knowledge/safety-rules.js';import{listTemplates as a526a,getTemplateDetail,instantiateTemplate,getTemplateCounts,TEMPLATE_OBJECT_TYPES}from'../knowledge/template-registry.js';import{GUARD_TEMPLATES,GUARD_TEMPLATES_VERSION,GUARD_TEMPLATES_COUNT}from'../knowledge/guard-templates.js';import{lintGuard,formatLintResult}from'../knowledge/guard-lint.js';import{renderGuardTreeIndented,renderGuardMermaid,walkGuardTree}from'../knowledge/guard-render.js';import{getGuardQueryByIdOrName}from'../schema/utils/guard-query-utils.js';const __dirname=fileURLToPath(new URL('.',import.meta.url)),SCHEMAS_DIR=resolve(__dirname,'../../dist/schemas'),WORKSPACE_TMP_DIR=resolve(process['cwd'](),'.trae','tmp');export function areSchemasAvailable(){return existsSync(SCHEMAS_DIR)&&existsSync(join(SCHEMAS_DIR,'index.json'));}export function getSchemaIndex(){try{const a=join(SCHEMAS_DIR,'index.json');if(!existsSync(a))return null;const b=readFileSync(a,'utf-8');return JSON['parse'](b);}catch{return null;}}export function listSchemas(){const a=getSchemaIndex();if(!a)return[];return[...a['tools']||[],...a['operations']||[]];}export function getSchema(a){try{let b=join(SCHEMAS_DIR,a+'.schema.json');!existsSync(b)&&(b=join(SCHEMAS_DIR,a+'.json'));if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}export function getOutputSchema(a){try{const b=join(SCHEMAS_DIR,a+'.output.json');if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}function guardParamImportance(a){if(!a['required'])return'optional';return a['type']==='address'||a['type']==='vec_address'?'identity-critical':'required';}const GUARD_PARAM_IMPORTANCE_RANK={'identity-critical':0x0,'required':0x1,'optional':0x2};function projectGuardParam(a){return{'name':a['name'],'type':a['type'],'meaning':a['description'],'importance':guardParamImportance(a),'required':a['required'],'default':a['default']??null,'constraint':a['constraint']??null};}function projectGuardTemplate(a){return{'id':a['id'],'scene_id':a['scene_id'],'name':a['name'],'description':a['description'],'verifier_constraint_level':a['verifier_constraint_level']??null,'recommended_patterns':a['recommended_patterns'],'applicable_industries':a['applicable_industries'],'relevant_risks':a['relevant_risks'],'creation_notes':a['creation_notes'],'example_use_case':a['example_use_case'],'parameters':a['parameters']['map'](projectGuardParam)['sort']((c,d)=>GUARD_PARAM_IMPORTANCE_RANK[c['importance']]-GUARD_PARAM_IMPORTANCE_RANK[d['importance']]),'example_table':a['example_table'],'example_root':a['example_root']};}export function getGuardTemplates(a){if(!a)return{'version':GUARD_TEMPLATES_VERSION,'count':GUARD_TEMPLATES_COUNT,'templates':GUARD_TEMPLATES['map'](c=>({'id':c['id'],'scene_id':c['scene_id'],'name':c['name'],'description':c['description'],'verifier_constraint_level':c['verifier_constraint_level']??null,'parameter_count':c['parameters']['length']}))};const b=GUARD_TEMPLATES['find'](c=>c['id']===a||c['name']===a);return b?projectGuardTemplate(b):null;}export function getSchemaField(a,b){const c=getSchema(a);if(!c)return null;const d=b['split']('.')['filter'](Boolean);let e=c;for(const f of d){if(!e||typeof e!=='object')return null;if(e['properties']&&f in e['properties']){e=e['properties'][f];continue;}if(e['items']&&typeof e['items']==='object'){if(/^\d+$/['test'](f)){e=e['items'];continue;}if(e['items']['properties']&&f in e['items']['properties']){e=e['items']['properties'][f];continue;}}if(Array['isArray'](e['oneOf'])||Array['isArray'](e['anyOf'])){const g=e['oneOf']??e['anyOf'];for(const h of g){if(h&&typeof h==='object'&&h['properties']&&f in h['properties']){e=h['properties'][f];break;}}continue;}if(f in e){e=e[f];continue;}return null;}return e;}function resolveSchemaRefs(a,b=new Set()){if(!a||typeof a!=='object')return a;if(Array['isArray'](a))return a['map'](d=>resolveSchemaRefs(d,b));const c={};for(const [d,e]of Object['entries'](a)){if(d==='$ref'&&typeof e==='string'){if(e['startsWith']('#'))c[d]=e;else{const f=loadRefSchema(e,b);f&&Object['assign'](c,resolveSchemaRefs(f,b));}}else typeof e==='object'?c[d]=resolveSchemaRefs(e,b):c[d]=e;}return c;}function loadRefSchema(a,b){if(a['startsWith']('#'))return null;if(b['has'](a))return{'description':'Circular\x20reference\x20to\x20'+a};b['add'](a);try{const c=join(SCHEMAS_DIR,a);if(!existsSync(c))return null;const d=readFileSync(c,'utf-8');return JSON['parse'](d);}catch{return null;}}export function searchSchemas(a){const b=listSchemas(),c=a['toLowerCase']();return b['filter'](d=>{const e=d['name']['toLowerCase']()['includes'](c),f=d['title']?.['toLowerCase']()['includes'](c),g=d['description']?.['toLowerCase']()['includes'](c);return e||f||g;});}export function listOperations(){const a=getSchemaIndex();if(!a)return[];return(a['operations']||[])['filter'](b=>b['name']['startsWith']('onchain_operations_'));}function writeResponseToFile(a,b){try{let c;if(b)c=resolve(process['cwd'](),b);else{!existsSync(WORKSPACE_TMP_DIR)&&mkdirSync(WORKSPACE_TMP_DIR,{'recursive':!![]});const g=Date['now']();c=join(WORKSPACE_TMP_DIR,'schema-'+g+'.json');}const d=dirname(c);!existsSync(d)&&mkdirSync(d,{'recursive':!![]});const f=typeof a==='string'?a:JSON['stringify'](a,null,0x2);return writeFileSync(c,f,'utf-8'),c;}catch(h){return null;}}const INLINE_CHAR_LIMIT=0x20*0x400,AUTO_OVERFLOW_DIR='.wowok/tmp';function unionVariantLabel(a){if(!a||typeof a!=='object')return'variant';const b=a['properties']&&typeof a['properties']==='object'?a['properties']:undefined;if(b)for(const [c,d]of Object['entries'](b)){if(d&&typeof d==='object'&&d['const']!==undefined)return c+'='+String(d['const']);}return typeof a['title']==='string'?a['title']:'variant';}export function buildSchemaSummary(a){const b=[];a&&typeof a['title']==='string'&&b['push']('Title:\x20'+a['title']);const c=a&&typeof a==='object'?a['properties']:undefined;if(c&&typeof c==='object'&&!Array['isArray'](c)){const d=Array['isArray'](a['required'])?a['required']:[],e=Object['keys'](c);b['push']('Top-level\x20fields\x20('+e['length']+',\x20*\x20=\x20required):');for(const f of e['slice'](0x0,0x28)){const g=c[f]??{},h=Array['isArray'](g['type'])?g['type']['join']('|'):g['type']??(g['$ref']?'ref':g['anyOf']||g['oneOf']?'union':'any'),i=d['includes'](f)?'*':'',j=typeof g['description']==='string'&&g['description']['length']>0x0?'\x20—\x20'+g['description']['split']('\x0a')[0x0]['slice'](0x0,0x50):'';b['push']('\x20\x20-\x20'+f+i+':\x20'+h+j);}e['length']>0x28&&b['push']('\x20\x20-\x20...and\x20'+(e['length']-0x28)+'\x20more\x20—\x20use\x20action=\x27get_field\x27\x20with\x20field_path\x20to\x20inspect');}else{if(a&&(Array['isArray'](a['oneOf'])||Array['isArray'](a['anyOf']))){const k=a['oneOf']??a['anyOf'];b['push']('Union\x20of\x20'+k['length']+'\x20variants:');for(const m of k['slice'](0x0,0x28)){const o=m&&typeof m['description']==='string'&&m['description']['length']>0x0?'\x20—\x20'+m['description']['split']('\x0a')[0x0]['slice'](0x0,0x50):'';b['push']('\x20\x20-\x20'+unionVariantLabel(m)+o);}k['length']>0x28&&b['push']('\x20\x20-\x20...and\x20'+(k['length']-0x28)+'\x20more');const l=k['filter'](q=>q&&typeof q==='object'&&q['properties']&&typeof q['properties']==='object');if(l['length']===k['length']&&l['length']>0x0){const q=Object['keys'](l[0x0]['properties'])['filter'](r=>l['every'](s=>Object['prototype']['hasOwnProperty']['call'](s['properties'],r)));b['push'](q['length']>0x0?'Common\x20fields\x20(declared\x20by\x20ALL\x20'+l['length']+'\x20variants):\x20'+q['join'](',\x20')+'.':'No\x20field\x20is\x20declared\x20by\x20all\x20'+l['length']+'\x20variants\x20—\x20each\x20variant\x20takes\x20its\x20own\x20parameters.');}else b['push']('Field\x20names\x20differ\x20per\x20variant\x20—\x20read\x20the\x20variant\x27s\x20own\x20list\x20above.\x20'+'The\x20discriminator\x20(\x22operation\x22\x20and\x20friends)\x20is\x20the\x20only\x20shared\x20key.');for(const r of k['slice'](0x0,0x28)){const s=r&&typeof r==='object'&&r['properties']&&typeof r['properties']==='object'?Object['keys'](r['properties']):[];if(s['length']===0x0)continue;b['push']('\x20\x20\x20\x20'+unionVariantLabel(r)+'\x20fields:\x20'+s['join'](',\x20'));}b['push']('Drill\x20into\x20the\x20variant\x20you\x20need\x20with\x20action=\x27get_field\x27\x20(name\x20+\x20field_path)\x20—\x20the\x20lists\x20above\x20are\x20a\x20summary,\x20not\x20the\x20schema.');}else b['push']('No\x20top-level\x20properties\x20map\x20—\x20use\x20action=\x27get_field\x27\x20with\x20a\x20field_path\x20to\x20inspect\x20this\x20schema.');}return b['join']('\x0a');}export function autoOverflowToFile(a,b){try{const c=JSON['stringify'](a)['length'];if(c<=INLINE_CHAR_LIMIT)return null;const d=process['env']['WOWOK_SCHEMA_TMP_DIR'],e=d?resolve(d):resolve(process['cwd'](),AUTO_OVERFLOW_DIR);!existsSync(e)&&mkdirSync(e,{'recursive':!![]});const f=b['replace'](/[^a-zA-Z0-9_-]/g,'_'),g=f+'.schema.json',h=join(e,g);return writeFileSync(h,JSON['stringify'](a,null,0x2),'utf-8'),{'absolute_path':h,'relative_path':d?h:join(AUTO_OVERFLOW_DIR,g),'bytes':c,'summary':buildSchemaSummary(a)};}catch{return null;}}export function processSchemaQuery(a){const {action:b,name:c,query:d,field_path:f,template:g,output_file:h,object_type:i,params:j}=a;if(b==='get_guard_templates'){const k=getGuardTemplates(g);if(!k)return{'success':![],'action':b,'data':null,'message':'Guard\x20template\x20\x27'+g+'\x27\x20not\x20found\x20in\x20the\x20unified\x20library\x20(v'+GUARD_TEMPLATES_VERSION+').\x20Omit\x20\x27template\x27\x20to\x20list\x20every\x20id.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20guard\x20template\x20ids.','Ids\x20are\x20scene-namespaced\x20—\x20e.g.\x20tpl_buy_guard_*\x20(purchase\x20gates),\x20tpl_machine_*\x20(forward\x20gates),\x20tpl_reward_*\x20(claim\x20gates).\x20Pass\x20a\x20listed\x20id\x20for\x20the\x20full\x20parameterized\x20disclosure\x20(meaning,\x20default,\x20constraint,\x20importance).']};if(h){const l=writeResponseToFile(k,h);if(l)return{'success':!![],'action':b,'data':null,'message':'Guard\x20template'+(g?'\x20\x27'+g+'\x27':'s')+'\x20written\x20to\x20file:\x20'+l,'output_file_path':l,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+l]};}return{'success':!![],'action':b,'data':k,'message':g?'Retrieved\x20Guard\x20template:\x20'+g:'Retrieved\x20'+(Array['isArray'](k['templates'])?k['templates']['length']:0x0)+'\x20Guard\x20templates'};}if(b==='get_templates'){if(!g){const p=a526a(i),q=getTemplateCounts(),r={'total':p['length'],'filter':i??null,'counts_by_object_type':q,'templates':p};if(h){const s=writeResponseToFile(r,h);if(s)return{'success':!![],'action':b,'data':null,'message':p['length']+'\x20templates\x20written\x20to\x20file:\x20'+s,'output_file_path':s,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+s]};}return{'success':!![],'action':b,'data':r,'message':p['length']+'\x20template(s)'+(i?'\x20for\x20object_type=\x27'+i+'\x27':'')+'\x20'+('(total\x20registry:\x20'+Object['values'](q)['reduce']((t,u)=>t+u,0x0)+'\x20across\x20'+TEMPLATE_OBJECT_TYPES['length']+'\x20object\x20types).\x20')+'Provide\x20\x27template\x27\x20(id)\x20for\x20full\x20detail;\x20add\x20\x27params\x27\x20(JSON\x20string)\x20to\x20instantiate.'};}if(!j){const t=getTemplateDetail(g);if(!t)return{'success':![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20not\x20found\x20in\x20the\x20unified\x20registry.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20template\x20metadata\x20(id\x20+\x20object_type\x20+\x20parameters).','Filter\x20by\x20object_type:\x20'+TEMPLATE_OBJECT_TYPES['join'](',\x20')]};if(h){const u=writeResponseToFile(t,h);if(u)return{'success':!![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20detail\x20written\x20to\x20file:\x20'+u,'output_file_path':u,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+u]};}return{'success':!![],'action':b,'data':t,'message':'Template\x20\x27'+g+'\x27\x20('+t['object_type']+',\x20'+(t['instantiable']?'instantiable':'guidance-only')+').\x20'+'To\x20instantiate,\x20call\x20again\x20with\x20\x27params\x27\x20=\x20JSON\x20object\x20of\x20the\x20declared\x20parameters.'};}let m;try{const v=JSON['parse'](j);if(!v||typeof v!=='object'||Array['isArray'](v))return{'success':![],'action':b,'data':null,'message':'\x27params\x27\x20must\x20be\x20a\x20JSON\x20object\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27),\x20got\x20'+(Array['isArray'](v)?'array':typeof v)+'.'};m=v;}catch(w){return{'success':![],'action':b,'data':null,'message':'Failed\x20to\x20parse\x20\x27params\x27\x20as\x20JSON:\x20'+(w instanceof Error?w['message']:String(w)),'suggestions':['Example:\x20params=\x27{\x22whitelist\x22:[\x220xabc...\x22]}\x27']};}const n=instantiateTemplate(g,m);if(!n['ok'])return{'success':![],'action':b,'data':n['guidance']!==undefined?{'guidance':n['guidance']}:null,'message':'Instantiation\x20failed\x20for\x20\x27'+g+'\x27:\x20'+n['error'],'suggestions':n['missing_params']?['Missing\x20required\x20params:\x20'+n['missing_params']['join'](',\x20'),'Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']:['Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']};const o={'object_type':n['object_type'],'template_id':n['template_id'],'body':n['body'],...n['notes']?{'notes':n['notes']}:{}};if(h){const x=writeResponseToFile(o,h);if(x)return{'success':!![],'action':b,'data':null,'message':'Instantiated\x20template\x20\x27'+g+'\x27\x20written\x20to\x20file:\x20'+x,'output_file_path':x,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+x]};}return{'success':!![],'action':b,'data':o,'message':'Instantiated\x20\x27'+g+'\x27\x20('+n['object_type']+').\x20'+'Review\x20the\x20body\x20against\x20the\x20onchain_operations\x20schema\x20before\x20submitting.'};}if(b==='get_tool_reference'){if(c){const z=getToolReference(c);if(!z)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found\x20in\x20the\x20tool\x20reference.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20all\x20tools.','Available\x20tools:\x20'+TOOLS_REFERENCE['map'](B=>B['name'])['join'](',\x20')]};const A=getToolSequence(c);return{'success':!![],'action':b,'data':{'tool':z,'call_sequence':A??null},'message':'Retrieved\x20tool\x20reference:\x20'+c};}if(d){const B=searchToolReference(d);return{'success':!![],'action':b,'data':{'tools':B,'count':B['length']},'message':'Found\x20'+B['length']+'\x20tool(s)\x20matching\x20\x27'+d+'\x27','suggestions':B['length']===0x0?['Try\x20a\x20broader\x20keyword\x20(e.g.\x20\x27onchain\x27,\x20\x27guard\x27,\x20\x27schema\x27),\x20or\x20omit\x20\x27query\x27\x20to\x20list\x20all\x20tools.']:undefined};}const y=TOOLS_REFERENCE['map'](C=>({'name':C['name'],'summary':C['summary'],'actions':C['actions']??[],'notes':C['notes']??[]}));return{'success':!![],'action':b,'data':{'tools':y,'count':y['length']},'message':'Retrieved\x20reference\x20for\x20'+y['length']+'\x20MCP\x20tools.\x20Pass\x20name=\x27<tool>\x27\x20for\x20full\x20detail\x20(params,\x20prerequisites,\x20follow-ups).'};}if(b==='get_guard_design_patterns'){if(c){const D=getGuardDesignPattern(c);if(!D)return{'success':![],'action':b,'data':null,'message':'Guard\x20design\x20pattern\x20\x27'+c+'\x27\x20not\x20found.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20the\x20full\x20catalog.','Available\x20pattern\x20ids:\x20'+GUARD_DESIGN_PATTERNS['map'](E=>E['id'])['join'](',\x20')]};return{'success':!![],'action':b,'data':{'pattern':D},'message':'Retrieved\x20Guard\x20design\x20pattern:\x20'+c};}if(d){const E=GUARD_DESIGN_PATTERNS['filter'](G=>G['host']===d),F=E['length']>0x0?E:GUARD_DESIGN_PATTERNS['filter'](G=>G['business_requirement']['toLowerCase']()['includes'](d['toLowerCase']())||G['logic_summary']['toLowerCase']()['includes'](d['toLowerCase']()));return{'success':!![],'action':b,'data':{'patterns':F,'count':F['length'],'filtered_by':E['length']>0x0?'host':'keyword','schema_notes':GUARD_SCHEMA_NOTES},'message':'Found\x20'+F['length']+'\x20Guard\x20design\x20pattern(s)\x20matching\x20\x27'+d+'\x27','suggestions':F['length']===0x0?['Filter\x20by\x20host:\x20service_buy_guard,\x20service_allocator_guard,\x20machine_forward,\x20progress_submission,\x20reward_claim,\x20repository_write,\x20arbitration_usage,\x20arbitration_voting,\x20gen_passport']:undefined};}const C=GUARD_DESIGN_PATTERNS['map'](G=>({'id':G['id'],'business_requirement':G['business_requirement'],'host':G['host'],'data_source':G['data_source'],'verifier_level':G['verifier_level'],'logic_summary':G['logic_summary'],'key_queries':G['key_queries'],'notes':G['notes']??[]}));return{'success':!![],'action':b,'data':{'patterns':C,'count':C['length'],'version':GUARD_DESIGN_PATTERNS_VERSION,'schema_notes':GUARD_SCHEMA_NOTES},'message':'Retrieved\x20'+C['length']+'\x20Guard\x20design\x20patterns.\x20Pass\x20name=\x27<pattern_id>\x27\x20for\x20full\x20detail\x20(witness\x20types,\x20mitigated\x20risks,\x20industries).'};}if(b==='get_safety_rules')return{'success':!![],'action':b,'data':{'version':SAFETY_RULES_VERSION,'object_reuse_rules':OBJECT_REUSE_RULES,'create_vs_modify_pattern':CREATE_VS_MODIFY_PATTERN,'immutability_rules':IMMUTABILITY_RULES,'protocol_slot_rules':PROTOCOL_SLOT_RULES,'operation_type_classification':OPERATION_TYPE_CLASSIFICATION,'operation_class_meta':OPERATION_CLASS_META,'naming_conventions':NAMING_CONVENTIONS},'message':'Retrieved\x20safety\x20rule\x20tables\x20(reuse\x20/\x20immutability\x20/\x20protocol\x20slots\x20/\x20operation\x20classification\x20/\x20naming).\x20'+'Key\x20points:\x20prefer\x20REUSING\x20existing\x20objects\x20(string\x20reference\x20=\x20reuse,\x20object\x20shape\x20=\x20create);\x20'+'Machine\x20publish\x20locks\x20nodes/pairs/forwards,\x20Service\x20publish\x20locks\x20machine/order_allocators/arbitrations\x20(sales\x20stays\x20mutable);\x20'+'Guard\x20is\x20CREATE-only\x20immutable;\x20on-chain\x20writes\x20require\x20explicit\x20user\x20confirmation;\x20'+'Guards\x20bound\x20on\x20machine\x20forwards\x20MUST\x20declare\x20protocol\x20slot\x20254\x20(task\x20binding),\x20and\x20every\x20allocator\x20{GuardIdentifier:N}\x20leg\x20MUST\x20name\x20a\x20declared\x20b_submission\x20Address\x20slot.'};if(!areSchemasAvailable())return{'success':![],'action':b,'data':null,'message':'Schema\x20files\x20are\x20not\x20available.\x20Please\x20run\x20\x27npm\x20run\x20generate:schemas\x27\x20first.','suggestions':['Run\x20\x27npm\x20run\x20generate:schemas\x27\x20to\x20generate\x20schema\x20files','Ensure\x20the\x20dist/schemas\x20directory\x20exists']};switch(b){case'list':{const G=listSchemas();return{'success':!![],'action':b,'data':G,'message':'Found\x20'+G['length']+'\x20available\x20schemas'};}case'get':{if(!c)return{'success':![],'action':b,'data':null,'message':'Schema\x20name\x20is\x20required\x20for\x20\x27get\x27\x20action','suggestions':['Provide\x20a\x20schema\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};const H=getSchema(c);if(!H){const J=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20not\x20found','suggestions':J['length']>0x0?J['map'](K=>'Did\x20you\x20mean:\x20'+K['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};}if(h){const K=writeResponseToFile(H,h);if(K)return{'success':!![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+K,'output_file_path':K,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+K]};}const I=autoOverflowToFile(H,c);if(I)return{'success':!![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20is\x20large\x20('+Math['round'](I['bytes']/0x400)+'\x20KB)\x20—\x20'+'written\x20to\x20file\x20instead\x20of\x20inlining\x20to\x20protect\x20your\x20context.','output_file_path':I['absolute_path'],'inline_summary':I['summary'],'suggestions':['Read\x20the\x20full\x20file\x20with\x20the\x20Read\x20tool:\x20'+I['absolute_path'],'If\x20the\x20sandbox\x20blocks\x20that\x20path,\x20resolve\x20the\x20relative\x20path\x20\x27'+I['relative_path']+'\x27\x20against\x20the\x20workspace\x20root\x20and\x20read\x20that.','Without\x20file\x20access,\x20query\x20specific\x20fields\x20via\x20action=\x27get_field\x27\x20with\x20name=\x27'+c+'\x27\x20and\x20a\x20field_path\x20from\x20the\x20summary\x20below.']};return{'success':!![],'action':b,'data':H,'message':'Retrieved\x20schema:\x20'+c};}case'get_field':{if(!c||!f)return{'success':![],'action':b,'data':null,'message':'Both\x20\x27name\x27\x20and\x20\x27field_path\x27\x20are\x20required\x20for\x20\x27get_field\x27\x20action','suggestions':['Example:\x20{action:\x20\x27get_field\x27,\x20name:\x20\x27onchain_operations_machine\x27,\x20field_path:\x20\x27data.node\x27}','Use\x20\x27get\x27\x20action\x20to\x20retrieve\x20the\x20full\x20schema']};const L=getSchemaField(c,f);if(!L)return{'success':![],'action':b,'data':null,'message':'Field\x20path\x20\x27'+f+'\x27\x20not\x20found\x20in\x20schema\x20\x27'+c+'\x27','suggestions':['Check\x20the\x20field\x20path\x20(dot-separated,\x20e.g.\x20\x27data.node\x27)','Use\x20\x27get\x27\x20action\x20to\x20see\x20the\x20full\x20schema\x20structure']};return{'success':!![],'action':b,'data':L,'message':'Retrieved\x20field\x20\x27'+f+'\x27\x20from\x20schema\x20\x27'+c+'\x27'};}case'search':{if(!d)return{'success':![],'action':b,'data':null,'message':'Search\x20query\x20is\x20required\x20for\x20\x27search\x27\x20action'};const M=searchSchemas(d);return{'success':!![],'action':b,'data':M,'message':'Found\x20'+M['length']+'\x20schemas\x20matching\x20\x27'+d+'\x27'};}case'list_operations':{const N=listOperations();return{'success':!![],'action':b,'data':N,'message':'Found\x20'+N['length']+'\x20on-chain\x20operations'};}case'get_guard_queries':{const O=d?.['trim']()['toLowerCase'](),P=R=>({'id':R['id'],'name':R['name'],'objectType':ObjectType[R['objectType']]??String(R['objectType']),'returnType':ValueType[R['return']]??String(R['return'])});if(O){const R=GUARDQUERY['filter'](S=>S['name']['toLowerCase']()['includes'](O)||S['description']?.['toLowerCase']()['includes'](O)||String(S['id'])===O)['map'](S=>({...P(S),'description':S['description']}));return{'success':!![],'action':b,'data':R,'message':'Found\x20'+R['length']+'\x20GUARDQUERY\x20entries\x20matching\x20\x27'+d+'\x27\x20'+('(of\x20'+GUARDQUERY['length']+'\x20total).\x20Use\x20names,\x20not\x20numeric\x20ids,\x20in\x20Guard\x20trees\x20—\x20')+'names\x20fail\x20loudly\x20at\x20validation\x20when\x20wrong;\x20a\x20wrong-but-existing\x20id\x20silently\x20checks\x20a\x20different\x20field.'};}if(h){const S=GUARDQUERY['map'](U=>({...P(U),'description':U['description']})),T=writeResponseToFile(S,h);if(T)return{'success':!![],'action':b,'data':null,'message':'Full\x20GUARDQUERY\x20catalog\x20('+S['length']+'\x20entries)\x20written\x20to\x20file:\x20'+T,'output_file_path':T,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+T]};}const Q=GUARDQUERY['map'](P);return{'success':!![],'action':b,'data':Q,'message':'GUARDQUERY\x20catalog:\x20'+Q['length']+'\x20entries\x20(compact\x20form\x20—\x20id,\x20name,\x20objectType,\x20returnType).\x20'+'Add\x20query=\x27<keyword>\x27\x20for\x20full\x20entries\x20with\x20descriptions,\x20or\x20output_file\x20to\x20dump\x20all\x20details\x20to\x20a\x20file.\x20'+'Prefer\x20NAME\x20references\x20in\x20Guard\x20trees;\x20a\x20numeric\x20id\x20is\x20resolved\x20verbatim\x20and\x20a\x20wrong-but-existing\x20id\x20'+'silently\x20checks\x20a\x20different\x20field.'};}case'get_output':{if(!c)return{'success':![],'action':b,'data':null,'message':'Tool\x20name\x20is\x20required\x20for\x20\x27get_output\x27\x20action','suggestions':['Provide\x20a\x20tool\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools\x20and\x20their\x20outputPath']};const U=getOutputSchema(c);if(!U){const W=listSchemas(),X=W['find'](Z=>Z['name']===c);if(X)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20exists\x20but\x20has\x20no\x20output\x20schema\x20file.\x20The\x20tool\x20may\x20not\x20declare\x20an\x20outputSchema,\x20or\x20the\x20schema\x20file\x20was\x20not\x20generated.','suggestions':['Use\x20\x27get\x27\x20action\x20with\x20name=\x27'+c+'\x27\x20to\x20retrieve\x20its\x20input\x20schema']};const Y=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found','suggestions':Y['length']>0x0?Y['map'](Z=>'Did\x20you\x20mean:\x20'+Z['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools']};}if(h){const Z=writeResponseToFile(U,h);if(Z)return{'success':!![],'action':b,'data':null,'message':'Output\x20schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+Z,'output_file_path':Z,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+Z]};}const V=autoOverflowToFile(U,c);if(V)return{'success':!![],'action':b,'data':null,'message':'Output\x20schema\x20\x27'+c+'\x27\x20is\x20large\x20('+Math['round'](V['bytes']/0x400)+'\x20KB)\x20—\x20'+'written\x20to\x20file\x20instead\x20of\x20inlining\x20to\x20protect\x20your\x20context.','output_file_path':V['absolute_path'],'inline_summary':V['summary'],'suggestions':['Read\x20the\x20full\x20file\x20with\x20the\x20Read\x20tool:\x20'+V['absolute_path'],'If\x20the\x20sandbox\x20blocks\x20that\x20path,\x20resolve\x20the\x20relative\x20path\x20\x27'+V['relative_path']+'\x27\x20against\x20the\x20workspace\x20root\x20and\x20read\x20that.','Without\x20file\x20access,\x20query\x20specific\x20fields\x20via\x20action=\x27get_field\x27\x20with\x20name=\x27'+c+'\x27\x20and\x20a\x20field_path\x20from\x20the\x20summary\x20below.']};return{'success':!![],'action':b,'data':U,'message':'Retrieved\x20output\x20schema:\x20'+c};}default:return{'success':![],'action':b,'data':null,'message':'Unknown\x20action:\x20'+b,'suggestions':['Use\x20\x27list\x27,\x20\x27get\x27,\x20\x27get_field\x27,\x20\x27get_output\x27,\x20\x27search\x27,\x20\x27list_operations\x27,\x20\x27get_guard_templates\x27,\x20\x27get_tool_reference\x27,\x20\x27get_guard_design_patterns\x27,\x20\x27get_safety_rules\x27,\x20\x27get_templates\x27,\x20or\x20\x27analyze_guard_semantics\x27']};}}const GUARD_SEMANTICS_READING_CHECKLIST=['WHO\x20can\x20satisfy\x20this\x20Guard\x20(identity:\x20Signer\x20bindings,\x20Entity\x20membership,\x20allowlists)?','WHEN\x20can\x20it\x20be\x20satisfied\x20(time:\x20Clock\x20comparisons,\x20deadlines,\x20windows)?','WHAT\x20evidence\x20must\x20the\x20caller\x20submit\x20(b_submission\x20table\x20entries\x20—\x20Payment/Order/Proof\x20objects)?','WHICH\x20on-chain\x20data\x20does\x20it\x20read,\x20and\x20can\x20that\x20data\x20change\x20(Repository\x20entries\x20are\x20MUTABLE\x20—\x20who\x20controls\x20the\x20writes)?','WHAT\x20does\x20the\x20counterparty\x20gain/lose\x20in\x20each\x20branch\x20of\x20the\x20logic\x20tree?','ARE\x20there\x20error-level\x20diagnostics\x20or\x20critical\x20risks\x20(they\x20block\x20or\x20endanger\x20execution)?'];export async function analyzeGuardSemantics(a){const b=await lintGuard(a,{'auto_fix':![]}),c={'root':a['root'],'table':(a['table']??[])['map'](k=>({'identifier':k['identifier'],'name':k['name'],'value_type':k['value_type']??'Address','b_submission':k['b_submission']??![],'value':k['value']})),'guardName':a['description']??null,'rely':a['rely']??null},d=renderGuardTreeIndented(c),e=renderGuardMermaid(a['root']),f=new Set(),g=[];let h=![],i=![];walkGuardTree(a['root'],k=>{if(k['type']==='context'){if(k['context']==='Clock')h=!![];if(k['context']==='Signer')i=!![];}if(k['type']==='query'&&k['query']!==undefined&&k['query']!==null){if(typeof k['query']==='number'){const l=getGuardQueryByIdOrName(k['query']);if(l)f['add'](l['id']);else g['push'](k['query']);}else{const m=getGuardQueryByIdOrName(k['query']);if(m)f['add'](m['id']);else g['push'](k['query']);}}});const j={'submission_requirements':(a['table']??[])['filter'](k=>k['b_submission']===!![])['map'](k=>({'identifier':k['identifier'],'value_type':k['value_type'],'object_type':k['object_type'],'name':k['name']})),'data_sources':(a['table']??[])['filter'](k=>k['b_submission']!==!![])['map'](k=>({'identifier':k['identifier'],'kind':k['is_system_address']?'system_address':k['object_type']?'object':'fixed_value','value_type':k['value_type'],'object_type':k['object_type'],'name':k['name'],'is_mutable_onchain':k['object_type']==='Repository'})),'query_dependencies':[...f]['sort']((k,l)=>k-l),'unresolved_queries':g,'has_time_conditions':h,'has_signer_constraints':i,'has_rely_composition':Array['isArray'](a['rely']?.['guards'])&&a['rely']['guards']['length']>0x0,'reading_checklist':GUARD_SEMANTICS_READING_CHECKLIST};return{'render':{'tree_indented':d,'mermaid':e},'lint':b,'party_evaluation':j};}export{formatLintResult};
|
|
1
|
+
import{readFileSync,existsSync,writeFileSync,mkdirSync}from'fs';import{resolve,join,dirname}from'path';import{fileURLToPath}from'url';import{GUARDQUERY,ObjectType,ValueType}from'@wowok/wowok';import{TOOLS_REFERENCE,getToolReference,searchToolReference,getToolSequence}from'../knowledge/tools-reference.js';import{GUARD_DESIGN_PATTERNS,getGuardDesignPattern,GUARD_DESIGN_PATTERNS_VERSION,GUARD_SCHEMA_NOTES}from'../knowledge/guard-design-patterns.js';import{OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,PROTOCOL_SLOT_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,NAMING_CONVENTIONS,SAFETY_RULES_VERSION}from'../knowledge/safety-rules.js';import{listTemplates as a535a,getTemplateDetail,instantiateTemplate,getTemplateCounts,TEMPLATE_OBJECT_TYPES}from'../knowledge/template-registry.js';import{GUARD_TEMPLATES,GUARD_TEMPLATES_VERSION,GUARD_TEMPLATES_COUNT}from'../knowledge/guard-templates.js';import{lintGuard,formatLintResult}from'../knowledge/guard-lint.js';import{renderGuardTreeIndented,renderGuardMermaid,walkGuardTree}from'../knowledge/guard-render.js';import{getGuardQueryByIdOrName}from'../schema/utils/guard-query-utils.js';const __dirname=fileURLToPath(new URL('.',import.meta.url)),SCHEMAS_DIR=resolve(__dirname,'../../dist/schemas'),WORKSPACE_TMP_DIR=resolve(process['cwd'](),'.trae','tmp');export function areSchemasAvailable(){return existsSync(SCHEMAS_DIR)&&existsSync(join(SCHEMAS_DIR,'index.json'));}export function getSchemaIndex(){try{const a=join(SCHEMAS_DIR,'index.json');if(!existsSync(a))return null;const b=readFileSync(a,'utf-8');return JSON['parse'](b);}catch{return null;}}export function listSchemas(){const a=getSchemaIndex();if(!a)return[];return[...a['tools']||[],...a['operations']||[]];}export function getSchema(a){try{let b=join(SCHEMAS_DIR,a+'.schema.json');!existsSync(b)&&(b=join(SCHEMAS_DIR,a+'.json'));if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}export function getOutputSchema(a){try{const b=join(SCHEMAS_DIR,a+'.output.json');if(!existsSync(b))return null;const c=readFileSync(b,'utf-8'),d=JSON['parse'](c);return resolveSchemaRefs(d);}catch{return null;}}function guardParamImportance(a){if(!a['required'])return'optional';return a['type']==='address'||a['type']==='vec_address'?'identity-critical':'required';}const GUARD_PARAM_IMPORTANCE_RANK={'identity-critical':0x0,'required':0x1,'optional':0x2};function projectGuardParam(a){return{'name':a['name'],'type':a['type'],'meaning':a['description'],'importance':guardParamImportance(a),'required':a['required'],'default':a['default']??null,'constraint':a['constraint']??null};}function projectGuardTemplate(a){return{'id':a['id'],'scene_id':a['scene_id'],'name':a['name'],'description':a['description'],'verifier_constraint_level':a['verifier_constraint_level']??null,'recommended_patterns':a['recommended_patterns'],'applicable_industries':a['applicable_industries'],'relevant_risks':a['relevant_risks'],'creation_notes':a['creation_notes'],'example_use_case':a['example_use_case'],'parameters':a['parameters']['map'](projectGuardParam)['sort']((c,d)=>GUARD_PARAM_IMPORTANCE_RANK[c['importance']]-GUARD_PARAM_IMPORTANCE_RANK[d['importance']]),'example_table':a['example_table'],'example_root':a['example_root']};}export function getGuardTemplates(a){if(!a)return{'version':GUARD_TEMPLATES_VERSION,'count':GUARD_TEMPLATES_COUNT,'templates':GUARD_TEMPLATES['map'](c=>({'id':c['id'],'scene_id':c['scene_id'],'name':c['name'],'description':c['description'],'verifier_constraint_level':c['verifier_constraint_level']??null,'parameter_count':c['parameters']['length']}))};const b=GUARD_TEMPLATES['find'](c=>c['id']===a||c['name']===a);return b?projectGuardTemplate(b):null;}export function getSchemaField(a,b){const c=getSchema(a);if(!c)return null;const d=b['split']('.')['filter'](Boolean);let e=c;for(const f of d){if(!e||typeof e!=='object')return null;if(e['properties']&&f in e['properties']){e=e['properties'][f];continue;}if(e['items']&&typeof e['items']==='object'){if(/^\d+$/['test'](f)){e=e['items'];continue;}if(e['items']['properties']&&f in e['items']['properties']){e=e['items']['properties'][f];continue;}}if(Array['isArray'](e['oneOf'])||Array['isArray'](e['anyOf'])){const g=e['oneOf']??e['anyOf'];for(const h of g){if(h&&typeof h==='object'&&h['properties']&&f in h['properties']){e=h['properties'][f];break;}}continue;}if(f in e){e=e[f];continue;}return null;}return e;}function resolveSchemaRefs(a,b=new Set()){if(!a||typeof a!=='object')return a;if(Array['isArray'](a))return a['map'](d=>resolveSchemaRefs(d,b));const c={};for(const [d,e]of Object['entries'](a)){if(d==='$ref'&&typeof e==='string'){if(e['startsWith']('#'))c[d]=e;else{const f=loadRefSchema(e,b);f&&Object['assign'](c,resolveSchemaRefs(f,b));}}else typeof e==='object'?c[d]=resolveSchemaRefs(e,b):c[d]=e;}return c;}function loadRefSchema(a,b){if(a['startsWith']('#'))return null;if(b['has'](a))return{'description':'Circular\x20reference\x20to\x20'+a};b['add'](a);try{const c=join(SCHEMAS_DIR,a);if(!existsSync(c))return null;const d=readFileSync(c,'utf-8');return JSON['parse'](d);}catch{return null;}}export function searchSchemas(a){const b=listSchemas(),c=a['toLowerCase']();return b['filter'](d=>{const e=d['name']['toLowerCase']()['includes'](c),f=d['title']?.['toLowerCase']()['includes'](c),g=d['description']?.['toLowerCase']()['includes'](c);return e||f||g;});}export function listOperations(){const a=getSchemaIndex();if(!a)return[];return(a['operations']||[])['filter'](b=>b['name']['startsWith']('onchain_operations_'));}function writeResponseToFile(a,b){try{let c;if(b)c=resolve(process['cwd'](),b);else{!existsSync(WORKSPACE_TMP_DIR)&&mkdirSync(WORKSPACE_TMP_DIR,{'recursive':!![]});const g=Date['now']();c=join(WORKSPACE_TMP_DIR,'schema-'+g+'.json');}const d=dirname(c);!existsSync(d)&&mkdirSync(d,{'recursive':!![]});const f=typeof a==='string'?a:JSON['stringify'](a,null,0x2);return writeFileSync(c,f,'utf-8'),c;}catch(h){return null;}}const INLINE_CHAR_LIMIT=0x20*0x400,AUTO_OVERFLOW_DIR='.wowok/tmp';function unionVariantLabel(a){if(!a||typeof a!=='object')return'variant';const b=a['properties']&&typeof a['properties']==='object'?a['properties']:undefined;if(b)for(const [c,d]of Object['entries'](b)){if(d&&typeof d==='object'&&d['const']!==undefined)return c+'='+String(d['const']);}return typeof a['title']==='string'?a['title']:'variant';}export function buildSchemaSummary(a){const b=[];a&&typeof a['title']==='string'&&b['push']('Title:\x20'+a['title']);const c=a&&typeof a==='object'?a['properties']:undefined;if(c&&typeof c==='object'&&!Array['isArray'](c)){const d=Array['isArray'](a['required'])?a['required']:[],e=Object['keys'](c);b['push']('Top-level\x20fields\x20('+e['length']+',\x20*\x20=\x20required):');for(const f of e['slice'](0x0,0x28)){const g=c[f]??{},h=Array['isArray'](g['type'])?g['type']['join']('|'):g['type']??(g['$ref']?'ref':g['anyOf']||g['oneOf']?'union':'any'),i=d['includes'](f)?'*':'',j=typeof g['description']==='string'&&g['description']['length']>0x0?'\x20—\x20'+g['description']['split']('\x0a')[0x0]['slice'](0x0,0x50):'';b['push']('\x20\x20-\x20'+f+i+':\x20'+h+j);}e['length']>0x28&&b['push']('\x20\x20-\x20...and\x20'+(e['length']-0x28)+'\x20more\x20—\x20use\x20action=\x27get_field\x27\x20with\x20field_path\x20to\x20inspect');}else{if(a&&(Array['isArray'](a['oneOf'])||Array['isArray'](a['anyOf']))){const k=a['oneOf']??a['anyOf'];b['push']('Union\x20of\x20'+k['length']+'\x20variants:');for(const m of k['slice'](0x0,0x28)){const o=m&&typeof m['description']==='string'&&m['description']['length']>0x0?'\x20—\x20'+m['description']['split']('\x0a')[0x0]['slice'](0x0,0x50):'';b['push']('\x20\x20-\x20'+unionVariantLabel(m)+o);}k['length']>0x28&&b['push']('\x20\x20-\x20...and\x20'+(k['length']-0x28)+'\x20more');const l=k['filter'](q=>q&&typeof q==='object'&&q['properties']&&typeof q['properties']==='object');if(l['length']===k['length']&&l['length']>0x0){const q=Object['keys'](l[0x0]['properties'])['filter'](r=>l['every'](s=>Object['prototype']['hasOwnProperty']['call'](s['properties'],r)));b['push'](q['length']>0x0?'Common\x20fields\x20(declared\x20by\x20ALL\x20'+l['length']+'\x20variants):\x20'+q['join'](',\x20')+'.':'No\x20field\x20is\x20declared\x20by\x20all\x20'+l['length']+'\x20variants\x20—\x20each\x20variant\x20takes\x20its\x20own\x20parameters.');}else b['push']('Field\x20names\x20differ\x20per\x20variant\x20—\x20read\x20the\x20variant\x27s\x20own\x20list\x20above.\x20'+'The\x20discriminator\x20(\x22operation\x22\x20and\x20friends)\x20is\x20the\x20only\x20shared\x20key.');for(const r of k['slice'](0x0,0x28)){const s=r&&typeof r==='object'&&r['properties']&&typeof r['properties']==='object'?Object['keys'](r['properties']):[];if(s['length']===0x0)continue;b['push']('\x20\x20\x20\x20'+unionVariantLabel(r)+'\x20fields:\x20'+s['join'](',\x20'));}b['push']('Drill\x20into\x20the\x20variant\x20you\x20need\x20with\x20action=\x27get_field\x27\x20(name\x20+\x20field_path)\x20—\x20the\x20lists\x20above\x20are\x20a\x20summary,\x20not\x20the\x20schema.');}else b['push']('No\x20top-level\x20properties\x20map\x20—\x20use\x20action=\x27get_field\x27\x20with\x20a\x20field_path\x20to\x20inspect\x20this\x20schema.');}return b['join']('\x0a');}export function autoOverflowToFile(a,b){try{const c=JSON['stringify'](a)['length'];if(c<=INLINE_CHAR_LIMIT)return null;const d=process['env']['WOWOK_SCHEMA_TMP_DIR'],e=d?resolve(d):resolve(process['cwd'](),AUTO_OVERFLOW_DIR);!existsSync(e)&&mkdirSync(e,{'recursive':!![]});const f=b['replace'](/[^a-zA-Z0-9_-]/g,'_'),g=f+'.schema.json',h=join(e,g);return writeFileSync(h,JSON['stringify'](a,null,0x2),'utf-8'),{'absolute_path':h,'relative_path':d?h:join(AUTO_OVERFLOW_DIR,g),'bytes':c,'summary':buildSchemaSummary(a)};}catch{return null;}}export function processSchemaQuery(a){const {action:b,name:c,query:d,field_path:f,template:g,output_file:h,object_type:i,params:j}=a;if(b==='get_guard_templates'){const k=getGuardTemplates(g);if(!k)return{'success':![],'action':b,'data':null,'message':'Guard\x20template\x20\x27'+g+'\x27\x20not\x20found\x20in\x20the\x20unified\x20library\x20(v'+GUARD_TEMPLATES_VERSION+').\x20Omit\x20\x27template\x27\x20to\x20list\x20every\x20id.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20guard\x20template\x20ids.','Ids\x20are\x20scene-namespaced\x20—\x20e.g.\x20tpl_buy_guard_*\x20(purchase\x20gates),\x20tpl_machine_*\x20(forward\x20gates),\x20tpl_reward_*\x20(claim\x20gates).\x20Pass\x20a\x20listed\x20id\x20for\x20the\x20full\x20parameterized\x20disclosure\x20(meaning,\x20default,\x20constraint,\x20importance).']};if(h){const l=writeResponseToFile(k,h);if(l)return{'success':!![],'action':b,'data':null,'message':'Guard\x20template'+(g?'\x20\x27'+g+'\x27':'s')+'\x20written\x20to\x20file:\x20'+l,'output_file_path':l,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+l]};}return{'success':!![],'action':b,'data':k,'message':g?'Retrieved\x20Guard\x20template:\x20'+g:'Retrieved\x20'+(Array['isArray'](k['templates'])?k['templates']['length']:0x0)+'\x20Guard\x20templates'};}if(b==='get_templates'){if(!g){const p=a535a(i),q=getTemplateCounts(),r={'total':p['length'],'filter':i??null,'counts_by_object_type':q,'templates':p};if(h){const s=writeResponseToFile(r,h);if(s)return{'success':!![],'action':b,'data':null,'message':p['length']+'\x20templates\x20written\x20to\x20file:\x20'+s,'output_file_path':s,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+s]};}return{'success':!![],'action':b,'data':r,'message':p['length']+'\x20template(s)'+(i?'\x20for\x20object_type=\x27'+i+'\x27':'')+'\x20'+('(total\x20registry:\x20'+Object['values'](q)['reduce']((t,u)=>t+u,0x0)+'\x20across\x20'+TEMPLATE_OBJECT_TYPES['length']+'\x20object\x20types).\x20')+'Provide\x20\x27template\x27\x20(id)\x20for\x20full\x20detail;\x20add\x20\x27params\x27\x20(JSON\x20string)\x20to\x20instantiate.'};}if(!j){const t=getTemplateDetail(g);if(!t)return{'success':![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20not\x20found\x20in\x20the\x20unified\x20registry.','suggestions':['Omit\x20\x27template\x27\x20to\x20list\x20all\x20template\x20metadata\x20(id\x20+\x20object_type\x20+\x20parameters).','Filter\x20by\x20object_type:\x20'+TEMPLATE_OBJECT_TYPES['join'](',\x20')]};if(h){const u=writeResponseToFile(t,h);if(u)return{'success':!![],'action':b,'data':null,'message':'Template\x20\x27'+g+'\x27\x20detail\x20written\x20to\x20file:\x20'+u,'output_file_path':u,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+u]};}return{'success':!![],'action':b,'data':t,'message':'Template\x20\x27'+g+'\x27\x20('+t['object_type']+',\x20'+(t['instantiable']?'instantiable':'guidance-only')+').\x20'+'To\x20instantiate,\x20call\x20again\x20with\x20\x27params\x27\x20=\x20JSON\x20object\x20of\x20the\x20declared\x20parameters.'};}let m;try{const v=JSON['parse'](j);if(!v||typeof v!=='object'||Array['isArray'](v))return{'success':![],'action':b,'data':null,'message':'\x27params\x27\x20must\x20be\x20a\x20JSON\x20object\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27),\x20got\x20'+(Array['isArray'](v)?'array':typeof v)+'.'};m=v;}catch(w){return{'success':![],'action':b,'data':null,'message':'Failed\x20to\x20parse\x20\x27params\x27\x20as\x20JSON:\x20'+(w instanceof Error?w['message']:String(w)),'suggestions':['Example:\x20params=\x27{\x22whitelist\x22:[\x220xabc...\x22]}\x27']};}const n=instantiateTemplate(g,m);if(!n['ok'])return{'success':![],'action':b,'data':n['guidance']!==undefined?{'guidance':n['guidance']}:null,'message':'Instantiation\x20failed\x20for\x20\x27'+g+'\x27:\x20'+n['error'],'suggestions':n['missing_params']?['Missing\x20required\x20params:\x20'+n['missing_params']['join'](',\x20'),'Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']:['Call\x20with\x20\x27template\x27\x20only\x20(no\x20\x27params\x27)\x20to\x20see\x20full\x20parameter\x20declarations.']};const o={'object_type':n['object_type'],'template_id':n['template_id'],'body':n['body'],...n['notes']?{'notes':n['notes']}:{}};if(h){const x=writeResponseToFile(o,h);if(x)return{'success':!![],'action':b,'data':null,'message':'Instantiated\x20template\x20\x27'+g+'\x27\x20written\x20to\x20file:\x20'+x,'output_file_path':x,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+x]};}return{'success':!![],'action':b,'data':o,'message':'Instantiated\x20\x27'+g+'\x27\x20('+n['object_type']+').\x20'+'Review\x20the\x20body\x20against\x20the\x20onchain_operations\x20schema\x20before\x20submitting.'};}if(b==='get_tool_reference'){if(c){const z=getToolReference(c);if(!z)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found\x20in\x20the\x20tool\x20reference.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20all\x20tools.','Available\x20tools:\x20'+TOOLS_REFERENCE['map'](B=>B['name'])['join'](',\x20')]};const A=getToolSequence(c);return{'success':!![],'action':b,'data':{'tool':z,'call_sequence':A??null},'message':'Retrieved\x20tool\x20reference:\x20'+c};}if(d){const B=searchToolReference(d);return{'success':!![],'action':b,'data':{'tools':B,'count':B['length']},'message':'Found\x20'+B['length']+'\x20tool(s)\x20matching\x20\x27'+d+'\x27','suggestions':B['length']===0x0?['Try\x20a\x20broader\x20keyword\x20(e.g.\x20\x27onchain\x27,\x20\x27guard\x27,\x20\x27schema\x27),\x20or\x20omit\x20\x27query\x27\x20to\x20list\x20all\x20tools.']:undefined};}const y=TOOLS_REFERENCE['map'](C=>({'name':C['name'],'summary':C['summary'],'actions':C['actions']??[],'notes':C['notes']??[]}));return{'success':!![],'action':b,'data':{'tools':y,'count':y['length']},'message':'Retrieved\x20reference\x20for\x20'+y['length']+'\x20MCP\x20tools.\x20Pass\x20name=\x27<tool>\x27\x20for\x20full\x20detail\x20(params,\x20prerequisites,\x20follow-ups).'};}if(b==='get_guard_design_patterns'){if(c){const D=getGuardDesignPattern(c);if(!D)return{'success':![],'action':b,'data':null,'message':'Guard\x20design\x20pattern\x20\x27'+c+'\x27\x20not\x20found.','suggestions':['Omit\x20\x27name\x27\x20to\x20list\x20the\x20full\x20catalog.','Available\x20pattern\x20ids:\x20'+GUARD_DESIGN_PATTERNS['map'](E=>E['id'])['join'](',\x20')]};return{'success':!![],'action':b,'data':{'pattern':D},'message':'Retrieved\x20Guard\x20design\x20pattern:\x20'+c};}if(d){const E=GUARD_DESIGN_PATTERNS['filter'](G=>G['host']===d),F=E['length']>0x0?E:GUARD_DESIGN_PATTERNS['filter'](G=>G['business_requirement']['toLowerCase']()['includes'](d['toLowerCase']())||G['logic_summary']['toLowerCase']()['includes'](d['toLowerCase']()));return{'success':!![],'action':b,'data':{'patterns':F,'count':F['length'],'filtered_by':E['length']>0x0?'host':'keyword','schema_notes':GUARD_SCHEMA_NOTES},'message':'Found\x20'+F['length']+'\x20Guard\x20design\x20pattern(s)\x20matching\x20\x27'+d+'\x27','suggestions':F['length']===0x0?['Filter\x20by\x20host:\x20service_buy_guard,\x20service_allocator_guard,\x20machine_forward,\x20progress_submission,\x20reward_claim,\x20repository_write,\x20arbitration_usage,\x20arbitration_voting,\x20gen_passport']:undefined};}const C=GUARD_DESIGN_PATTERNS['map'](G=>({'id':G['id'],'business_requirement':G['business_requirement'],'host':G['host'],'data_source':G['data_source'],'verifier_level':G['verifier_level'],'logic_summary':G['logic_summary'],'key_queries':G['key_queries'],'notes':G['notes']??[]}));return{'success':!![],'action':b,'data':{'patterns':C,'count':C['length'],'version':GUARD_DESIGN_PATTERNS_VERSION,'schema_notes':GUARD_SCHEMA_NOTES},'message':'Retrieved\x20'+C['length']+'\x20Guard\x20design\x20patterns.\x20Pass\x20name=\x27<pattern_id>\x27\x20for\x20full\x20detail\x20(witness\x20types,\x20mitigated\x20risks,\x20industries).'};}if(b==='get_safety_rules')return{'success':!![],'action':b,'data':{'version':SAFETY_RULES_VERSION,'object_reuse_rules':OBJECT_REUSE_RULES,'create_vs_modify_pattern':CREATE_VS_MODIFY_PATTERN,'immutability_rules':IMMUTABILITY_RULES,'protocol_slot_rules':PROTOCOL_SLOT_RULES,'operation_type_classification':OPERATION_TYPE_CLASSIFICATION,'operation_class_meta':OPERATION_CLASS_META,'naming_conventions':NAMING_CONVENTIONS},'message':'Retrieved\x20safety\x20rule\x20tables\x20(reuse\x20/\x20immutability\x20/\x20protocol\x20slots\x20/\x20operation\x20classification\x20/\x20naming).\x20'+'Key\x20points:\x20prefer\x20REUSING\x20existing\x20objects\x20(string\x20reference\x20=\x20reuse,\x20object\x20shape\x20=\x20create);\x20'+'Machine\x20publish\x20locks\x20nodes/pairs/forwards,\x20Service\x20publish\x20locks\x20machine/order_allocators/arbitrations\x20(sales\x20stays\x20mutable);\x20'+'Guard\x20is\x20CREATE-only\x20immutable;\x20on-chain\x20writes\x20require\x20explicit\x20user\x20confirmation;\x20'+'Guards\x20bound\x20on\x20machine\x20forwards\x20MUST\x20declare\x20protocol\x20slot\x20254\x20(task\x20binding),\x20and\x20every\x20allocator\x20{GuardIdentifier:N}\x20leg\x20MUST\x20name\x20a\x20declared\x20b_submission\x20Address\x20slot.'};if(!areSchemasAvailable())return{'success':![],'action':b,'data':null,'message':'Schema\x20files\x20are\x20not\x20available.\x20Please\x20run\x20\x27npm\x20run\x20generate:schemas\x27\x20first.','suggestions':['Run\x20\x27npm\x20run\x20generate:schemas\x27\x20to\x20generate\x20schema\x20files','Ensure\x20the\x20dist/schemas\x20directory\x20exists']};switch(b){case'list':{const G=listSchemas();return{'success':!![],'action':b,'data':G,'message':'Found\x20'+G['length']+'\x20available\x20schemas'};}case'get':{if(!c)return{'success':![],'action':b,'data':null,'message':'Schema\x20name\x20is\x20required\x20for\x20\x27get\x27\x20action','suggestions':['Provide\x20a\x20schema\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};const H=getSchema(c);if(!H){const J=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20not\x20found','suggestions':J['length']>0x0?J['map'](K=>'Did\x20you\x20mean:\x20'+K['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20schemas']};}if(h){const K=writeResponseToFile(H,h);if(K)return{'success':!![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+K,'output_file_path':K,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+K]};}const I=autoOverflowToFile(H,c);if(I)return{'success':!![],'action':b,'data':null,'message':'Schema\x20\x27'+c+'\x27\x20is\x20large\x20('+Math['round'](I['bytes']/0x400)+'\x20KB)\x20—\x20'+'written\x20to\x20file\x20instead\x20of\x20inlining\x20to\x20protect\x20your\x20context.','output_file_path':I['absolute_path'],'inline_summary':I['summary'],'suggestions':['Read\x20the\x20full\x20file\x20with\x20the\x20Read\x20tool:\x20'+I['absolute_path'],'If\x20the\x20sandbox\x20blocks\x20that\x20path,\x20resolve\x20the\x20relative\x20path\x20\x27'+I['relative_path']+'\x27\x20against\x20the\x20workspace\x20root\x20and\x20read\x20that.','Without\x20file\x20access,\x20query\x20specific\x20fields\x20via\x20action=\x27get_field\x27\x20with\x20name=\x27'+c+'\x27\x20and\x20a\x20field_path\x20from\x20the\x20summary\x20below.']};return{'success':!![],'action':b,'data':H,'message':'Retrieved\x20schema:\x20'+c};}case'get_field':{if(!c||!f)return{'success':![],'action':b,'data':null,'message':'Both\x20\x27name\x27\x20and\x20\x27field_path\x27\x20are\x20required\x20for\x20\x27get_field\x27\x20action','suggestions':['Example:\x20{action:\x20\x27get_field\x27,\x20name:\x20\x27onchain_operations_machine\x27,\x20field_path:\x20\x27data.node\x27}','Use\x20\x27get\x27\x20action\x20to\x20retrieve\x20the\x20full\x20schema']};const L=getSchemaField(c,f);if(!L)return{'success':![],'action':b,'data':null,'message':'Field\x20path\x20\x27'+f+'\x27\x20not\x20found\x20in\x20schema\x20\x27'+c+'\x27','suggestions':['Check\x20the\x20field\x20path\x20(dot-separated,\x20e.g.\x20\x27data.node\x27)','Use\x20\x27get\x27\x20action\x20to\x20see\x20the\x20full\x20schema\x20structure']};return{'success':!![],'action':b,'data':L,'message':'Retrieved\x20field\x20\x27'+f+'\x27\x20from\x20schema\x20\x27'+c+'\x27'};}case'search':{if(!d)return{'success':![],'action':b,'data':null,'message':'Search\x20query\x20is\x20required\x20for\x20\x27search\x27\x20action'};const M=searchSchemas(d);return{'success':!![],'action':b,'data':M,'message':'Found\x20'+M['length']+'\x20schemas\x20matching\x20\x27'+d+'\x27'};}case'list_operations':{const N=listOperations();return{'success':!![],'action':b,'data':N,'message':'Found\x20'+N['length']+'\x20on-chain\x20operations'};}case'get_guard_queries':{const O=d?.['trim']()['toLowerCase'](),P=R=>({'id':R['id'],'name':R['name'],'objectType':ObjectType[R['objectType']]??String(R['objectType']),'returnType':ValueType[R['return']]??String(R['return'])});if(O){const R=GUARDQUERY['filter'](S=>S['name']['toLowerCase']()['includes'](O)||S['description']?.['toLowerCase']()['includes'](O)||String(S['id'])===O)['map'](S=>({...P(S),'description':S['description']}));return{'success':!![],'action':b,'data':R,'message':'Found\x20'+R['length']+'\x20GUARDQUERY\x20entries\x20matching\x20\x27'+d+'\x27\x20'+('(of\x20'+GUARDQUERY['length']+'\x20total).\x20Use\x20names,\x20not\x20numeric\x20ids,\x20in\x20Guard\x20trees\x20—\x20')+'names\x20fail\x20loudly\x20at\x20validation\x20when\x20wrong;\x20a\x20wrong-but-existing\x20id\x20silently\x20checks\x20a\x20different\x20field.'};}if(h){const S=GUARDQUERY['map'](U=>({...P(U),'description':U['description']})),T=writeResponseToFile(S,h);if(T)return{'success':!![],'action':b,'data':null,'message':'Full\x20GUARDQUERY\x20catalog\x20('+S['length']+'\x20entries)\x20written\x20to\x20file:\x20'+T,'output_file_path':T,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+T]};}const Q=GUARDQUERY['map'](P);return{'success':!![],'action':b,'data':Q,'message':'GUARDQUERY\x20catalog:\x20'+Q['length']+'\x20entries\x20(compact\x20form\x20—\x20id,\x20name,\x20objectType,\x20returnType).\x20'+'Add\x20query=\x27<keyword>\x27\x20for\x20full\x20entries\x20with\x20descriptions,\x20or\x20output_file\x20to\x20dump\x20all\x20details\x20to\x20a\x20file.\x20'+'Prefer\x20NAME\x20references\x20in\x20Guard\x20trees;\x20a\x20numeric\x20id\x20is\x20resolved\x20verbatim\x20and\x20a\x20wrong-but-existing\x20id\x20'+'silently\x20checks\x20a\x20different\x20field.'};}case'get_output':{if(!c)return{'success':![],'action':b,'data':null,'message':'Tool\x20name\x20is\x20required\x20for\x20\x27get_output\x27\x20action','suggestions':['Provide\x20a\x20tool\x20name','Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools\x20and\x20their\x20outputPath']};const U=getOutputSchema(c);if(!U){const W=listSchemas(),X=W['find'](Z=>Z['name']===c);if(X)return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20exists\x20but\x20has\x20no\x20output\x20schema\x20file.\x20The\x20tool\x20may\x20not\x20declare\x20an\x20outputSchema,\x20or\x20the\x20schema\x20file\x20was\x20not\x20generated.','suggestions':['Use\x20\x27get\x27\x20action\x20with\x20name=\x27'+c+'\x27\x20to\x20retrieve\x20its\x20input\x20schema']};const Y=searchSchemas(c)['slice'](0x0,0x5);return{'success':![],'action':b,'data':null,'message':'Tool\x20\x27'+c+'\x27\x20not\x20found','suggestions':Y['length']>0x0?Y['map'](Z=>'Did\x20you\x20mean:\x20'+Z['name']+'?'):['Use\x20\x27list\x27\x20action\x20to\x20see\x20available\x20tools']};}if(h){const Z=writeResponseToFile(U,h);if(Z)return{'success':!![],'action':b,'data':null,'message':'Output\x20schema\x20\x27'+c+'\x27\x20written\x20to\x20file:\x20'+Z,'output_file_path':Z,'suggestions':['Use\x20Read\x20tool\x20to\x20open\x20'+Z]};}const V=autoOverflowToFile(U,c);if(V)return{'success':!![],'action':b,'data':null,'message':'Output\x20schema\x20\x27'+c+'\x27\x20is\x20large\x20('+Math['round'](V['bytes']/0x400)+'\x20KB)\x20—\x20'+'written\x20to\x20file\x20instead\x20of\x20inlining\x20to\x20protect\x20your\x20context.','output_file_path':V['absolute_path'],'inline_summary':V['summary'],'suggestions':['Read\x20the\x20full\x20file\x20with\x20the\x20Read\x20tool:\x20'+V['absolute_path'],'If\x20the\x20sandbox\x20blocks\x20that\x20path,\x20resolve\x20the\x20relative\x20path\x20\x27'+V['relative_path']+'\x27\x20against\x20the\x20workspace\x20root\x20and\x20read\x20that.','Without\x20file\x20access,\x20query\x20specific\x20fields\x20via\x20action=\x27get_field\x27\x20with\x20name=\x27'+c+'\x27\x20and\x20a\x20field_path\x20from\x20the\x20summary\x20below.']};return{'success':!![],'action':b,'data':U,'message':'Retrieved\x20output\x20schema:\x20'+c};}default:return{'success':![],'action':b,'data':null,'message':'Unknown\x20action:\x20'+b,'suggestions':['Use\x20\x27list\x27,\x20\x27get\x27,\x20\x27get_field\x27,\x20\x27get_output\x27,\x20\x27search\x27,\x20\x27list_operations\x27,\x20\x27get_guard_templates\x27,\x20\x27get_tool_reference\x27,\x20\x27get_guard_design_patterns\x27,\x20\x27get_safety_rules\x27,\x20\x27get_templates\x27,\x20or\x20\x27analyze_guard_semantics\x27']};}}const GUARD_SEMANTICS_READING_CHECKLIST=['WHO\x20can\x20satisfy\x20this\x20Guard\x20(identity:\x20Signer\x20bindings,\x20Entity\x20membership,\x20allowlists)?','WHEN\x20can\x20it\x20be\x20satisfied\x20(time:\x20Clock\x20comparisons,\x20deadlines,\x20windows)?','WHAT\x20evidence\x20must\x20the\x20caller\x20submit\x20(b_submission\x20table\x20entries\x20—\x20Payment/Order/Proof\x20objects)?','WHICH\x20on-chain\x20data\x20does\x20it\x20read,\x20and\x20can\x20that\x20data\x20change\x20(Repository\x20entries\x20are\x20MUTABLE\x20—\x20who\x20controls\x20the\x20writes)?','WHAT\x20does\x20the\x20counterparty\x20gain/lose\x20in\x20each\x20branch\x20of\x20the\x20logic\x20tree?','ARE\x20there\x20error-level\x20diagnostics\x20or\x20critical\x20risks\x20(they\x20block\x20or\x20endanger\x20execution)?'];export async function analyzeGuardSemantics(a){const b=await lintGuard(a,{'auto_fix':![]}),c={'root':a['root'],'table':(a['table']??[])['map'](l=>({'identifier':l['identifier'],'name':l['name'],'value_type':l['value_type']??'Address','b_submission':l['b_submission']??![],'value':l['value']})),'guardName':a['description']??null,'rely':a['rely']??null},d=renderGuardTreeIndented(c),e=renderGuardMermaid(a['root']),f=new Set(),g=[],h=new Set();let i=![],j=![];walkGuardTree(a['root'],l=>{if(l['type']==='context'){if(l['context']==='Clock')i=!![];if(l['context']==='Signer')j=!![];}l['type']==='identifier'&&typeof l['identifier']==='number'&&h['add'](l['identifier']);if(l['type']==='query'){const m=l['object'];m&&typeof m==='object'&&typeof m['identifier']==='number'&&h['add'](m['identifier']);const n=l['parameters'];if(Array['isArray'](n))for(const o of n){o&&typeof o==='object'&&typeof o['identifier']==='number'&&h['add'](o['identifier']);}}if(l['type']==='query'&&l['query']!==undefined&&l['query']!==null){if(typeof l['query']==='number'){const q=getGuardQueryByIdOrName(l['query']);if(q)f['add'](q['id']);else g['push'](l['query']);}else{const r=getGuardQueryByIdOrName(l['query']);if(r)f['add'](r['id']);else g['push'](l['query']);}}});const k={'submission_requirements':(a['table']??[])['filter'](l=>l['b_submission']===!![])['map'](l=>({'identifier':l['identifier'],'value_type':l['value_type'],'object_type':l['object_type'],'name':l['name']})),'data_sources':(a['table']??[])['filter'](l=>l['b_submission']!==!![])['map'](l=>({'identifier':l['identifier'],'kind':l['is_system_address']?'system_address':l['object_type']?'object':'fixed_value','value_type':l['value_type'],'object_type':l['object_type'],'name':l['name'],'is_mutable_onchain':l['object_type']==='Repository'})),'query_dependencies':[...f]['sort']((l,m)=>l-m),'unresolved_queries':g,'unresolved_identifiers':[...h]['filter'](l=>!(a['table']??[])['some'](m=>m['identifier']===l))['sort']((l,m)=>l-m),'has_time_conditions':i,'has_signer_constraints':j,'has_rely_composition':Array['isArray'](a['rely']?.['guards'])&&a['rely']['guards']['length']>0x0,'reading_checklist':GUARD_SEMANTICS_READING_CHECKLIST};return{'render':{'tree_indented':d,'mermaid':e},'lint':b,'party_evaluation':k};}export{formatLintResult};
|
|
@@ -3813,9 +3813,10 @@
|
|
|
3813
3813
|
"type": "string",
|
|
3814
3814
|
"enum": [
|
|
3815
3815
|
"repository_write",
|
|
3816
|
+
"rating_write",
|
|
3816
3817
|
"reward_claim"
|
|
3817
3818
|
],
|
|
3818
|
-
"description": "Which chained review step this report describes. repository_write = structured reputation record (rating/tags) into the caller-named Repository; reward_claim = incentive claim on the caller-named Reward."
|
|
3819
|
+
"description": "Which chained review step this report describes. repository_write = structured reputation record (rating/tags) into the caller-named Repository; rating_write = the derived U64 star row (F30 gf32-mn-261103: written alongside repository_write when the repository declares a U64 rating policy — like→5, dislike→1 — so reward guards that read the U64 star policy can pass without a hand-built second write); reward_claim = incentive claim on the caller-named Reward."
|
|
3819
3820
|
},
|
|
3820
3821
|
"status": {
|
|
3821
3822
|
"type": "string",
|
|
@@ -1569,6 +1569,80 @@
|
|
|
1569
1569
|
],
|
|
1570
1570
|
"additionalProperties": false
|
|
1571
1571
|
},
|
|
1572
|
+
"digest_check": {
|
|
1573
|
+
"description": "O-F49: the plan-generation-time template_digest vs the CURRENT catalog's digest for the plan's template — present when the plan names a tracked template. A false template_digest_match (or version mismatch) is what the pre-execution stale-plan gate refuses on.",
|
|
1574
|
+
"type": "object",
|
|
1575
|
+
"properties": {
|
|
1576
|
+
"plan_catalog_version": {
|
|
1577
|
+
"anyOf": [
|
|
1578
|
+
{
|
|
1579
|
+
"type": "number"
|
|
1580
|
+
},
|
|
1581
|
+
{
|
|
1582
|
+
"type": "null"
|
|
1583
|
+
}
|
|
1584
|
+
]
|
|
1585
|
+
},
|
|
1586
|
+
"current_catalog_version": {
|
|
1587
|
+
"type": "number"
|
|
1588
|
+
},
|
|
1589
|
+
"plan_template_digest": {
|
|
1590
|
+
"anyOf": [
|
|
1591
|
+
{
|
|
1592
|
+
"type": "string"
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
"type": "null"
|
|
1596
|
+
}
|
|
1597
|
+
]
|
|
1598
|
+
},
|
|
1599
|
+
"current_template_digest": {
|
|
1600
|
+
"anyOf": [
|
|
1601
|
+
{
|
|
1602
|
+
"type": "string"
|
|
1603
|
+
},
|
|
1604
|
+
{
|
|
1605
|
+
"type": "null"
|
|
1606
|
+
}
|
|
1607
|
+
]
|
|
1608
|
+
},
|
|
1609
|
+
"template_digest_match": {
|
|
1610
|
+
"type": "boolean"
|
|
1611
|
+
}
|
|
1612
|
+
},
|
|
1613
|
+
"required": [
|
|
1614
|
+
"plan_catalog_version",
|
|
1615
|
+
"current_catalog_version",
|
|
1616
|
+
"plan_template_digest",
|
|
1617
|
+
"current_template_digest"
|
|
1618
|
+
],
|
|
1619
|
+
"additionalProperties": false
|
|
1620
|
+
},
|
|
1621
|
+
"verdict_override": {
|
|
1622
|
+
"description": "O-F49 audit trail: the override_stale_build:true accepted this round — the refused verdict/build face the caller consciously overrode. Absent on a normally gated run.",
|
|
1623
|
+
"type": "object",
|
|
1624
|
+
"properties": {
|
|
1625
|
+
"parameter": {
|
|
1626
|
+
"type": "string"
|
|
1627
|
+
},
|
|
1628
|
+
"reason": {
|
|
1629
|
+
"type": "string"
|
|
1630
|
+
},
|
|
1631
|
+
"stale_build": {
|
|
1632
|
+
"type": "object",
|
|
1633
|
+
"propertyNames": {
|
|
1634
|
+
"type": "string"
|
|
1635
|
+
},
|
|
1636
|
+
"additionalProperties": {}
|
|
1637
|
+
}
|
|
1638
|
+
},
|
|
1639
|
+
"required": [
|
|
1640
|
+
"parameter",
|
|
1641
|
+
"reason",
|
|
1642
|
+
"stale_build"
|
|
1643
|
+
],
|
|
1644
|
+
"additionalProperties": false
|
|
1645
|
+
},
|
|
1572
1646
|
"next_action": {
|
|
1573
1647
|
"type": "string",
|
|
1574
1648
|
"description": "One-click forwarding: deploy-complete guidance, the resume recipe (completed_steps + previous_outputs) after a mid-run failure, or the STOP-retrying ruling when the same error recurred."
|
|
@@ -399,6 +399,22 @@
|
|
|
399
399
|
"description": "Per-claim reward bounty mounted on the claim guard_add, smallest-unit string. Schema-required on the mount (BK15-F09): compile blocks with REVIEW_REWARD_AMOUNT_MISSING when absent — the kernel never fabricates a real-money parameter.",
|
|
400
400
|
"type": "string"
|
|
401
401
|
},
|
|
402
|
+
"experience_compensation_mode": {
|
|
403
|
+
"description": "Per-build goodwill (experience-compensation) track mode (K3 C-11). Absent = the template's declared experience_compensation_mode applies — delivery/on-demand-errand and delivery/restaurant-marketplace ship 'reward' as the catalog default. 'reward' arms an independent PRE-FUNDED Reward pool buyers claim proactively for late/SLA-miss failures (nothing is ever deducted from the merchant — the chain has no debit primitive); 'none' drops the track.",
|
|
404
|
+
"type": "string",
|
|
405
|
+
"enum": [
|
|
406
|
+
"reward",
|
|
407
|
+
"none"
|
|
408
|
+
]
|
|
409
|
+
},
|
|
410
|
+
"experience_pool_funding": {
|
|
411
|
+
"description": "Experience-compensation pool funding, smallest-unit string. HARD-REQUIRED when the effective experience_compensation_mode is 'reward' (K3 C-11, INV-4 family): template_generate refuses the build up-front rather than promising an unfunded goodwill pool — plan it as ~expected failures x fee_param experience_claim_amount. The compile kernel also blocks with EXPERIENCE_COMPENSATION_UNFUNDED — this input gate just fails before the pipeline runs. (N2, K4R-261103 / ssd F-01: this key is a COMPILE INPUT, never a fee_param — a value mis-passed via fee_overrides is auto-rescued to this channel and echoed.)",
|
|
412
|
+
"type": "string"
|
|
413
|
+
},
|
|
414
|
+
"compensation_fund": {
|
|
415
|
+
"description": "Arbitration compensation-pool funding, smallest-unit string (N1, K4R-261103 / ddmq F-22). HARD-REQUIRED on any build that mounts an arb-ruling-won edge (tpl_forward_arb_ruling_won): its claimed_by sequencing seal makes the award claim the enforcement step, and an unfunded claim aborts code 27 — compile blocks with COMPENSATION_FUND_REQUIRED. Plan it at >= 3x a typical order (the chain's award ceiling is MAX_INDEMNITY_MULTIPLE = 3x the order value basis). Compile INPUT, never a fee_param; the fee_overrides spelling also lands here via the inputs spread.",
|
|
416
|
+
"type": "string"
|
|
417
|
+
},
|
|
402
418
|
"after_sales_mode": {
|
|
403
419
|
"description": "Per-build after-sales mode (D12 refactor 4). Absent = the template's declared after_sales_mode applies. Declaring a mode with no backing rail in machine_shape is a compile blocker (AFTER_SALES_RAIL_MISSING).",
|
|
404
420
|
"type": "string",
|
|
@@ -497,6 +513,10 @@
|
|
|
497
513
|
"description": "One sellable SKU in the plan catalog: the chain SaleItem fields plus the optional structured `incentive` declaration (G-07). Unknown keys pass through so chain-side fields can evolve without schema changes."
|
|
498
514
|
}
|
|
499
515
|
},
|
|
516
|
+
"allow_unpinned_wip": {
|
|
517
|
+
"description": "Explicit risk acceptance (F-07, 2026-11-04): ship SKUs whose .wip detail file carries NO hash pin. template_generate REFUSES an unpinned catalog by default (CRITICAL input gap — the SDK aborts a sale configure whose wip is empty, and an unpinned SKU gives buyers no delivery-integrity guarantee). Preferred cures: pass per-SKU wip_hash (from the wip_file generate/upload/verify flow — the session ledger backfills it automatically when THIS process uploaded or verified the file), or declare product_detail_source so the kernel resolves the sources. Set true ONLY after the user explicitly accepts an unpinned catalog; the wip_anchor face in the response is then marked acknowledged:true instead of blocking.",
|
|
518
|
+
"type": "boolean"
|
|
519
|
+
},
|
|
500
520
|
"log": {
|
|
501
521
|
"description": "A prior MigrationLog (required for migration_review).",
|
|
502
522
|
"type": "object",
|
|
@@ -515,7 +535,7 @@
|
|
|
515
535
|
]
|
|
516
536
|
},
|
|
517
537
|
"plan": {
|
|
518
|
-
"description": "The creation plan to execute (required for plan_execute): pass the object returned under 'plan' by template_generate VERBATIM — mutating steps by hand is what the 32-manual-write era did. Executing requires verdict.buildable=true; a blocked plan is refused at the freeze gate.",
|
|
538
|
+
"description": "The creation plan to execute (required for plan_execute): pass the object returned under 'plan' by template_generate VERBATIM — mutating steps by hand is what the 32-manual-write era did. Alternatively pass {root:'file', path:'<plan.json>'} to read the plan from disk (HAR-P1-14: avoids echoing a 38-40-step plan through the tool-call arguments; the file must contain the plan envelope or the bare plan as JSON). Executing requires verdict.buildable=true; a blocked plan is refused at the freeze gate.",
|
|
519
539
|
"type": "object",
|
|
520
540
|
"propertyNames": {
|
|
521
541
|
"type": "string"
|
|
@@ -564,6 +584,18 @@
|
|
|
564
584
|
],
|
|
565
585
|
"additionalProperties": false
|
|
566
586
|
},
|
|
587
|
+
"override_stale_build": {
|
|
588
|
+
"description": "plan_execute (O-F49): the ONLY bypass for the verdict hard gate. The gate refuses execution when the plan carries verdict.buildable:false or the running build state is UNVERIFIED (stale_build — the dist lags the workspace src). Pass true ONLY to consciously accept that risk; the override is audited into the response as verdict_override. Prefer rebuilding (pnpm build in the mcp workspace) and re-running template_generate.",
|
|
589
|
+
"type": "boolean"
|
|
590
|
+
},
|
|
591
|
+
"arbitration_vote_policy": {
|
|
592
|
+
"description": "Compile-time voting-surface choice (O-F26): 'open' (default) keeps the kernel's constant Bool-true open-vote injection for third_party venues (any Passport holder may vote); 'party_panel' SKIPS the injection so the R-ARB-VOTE-LOCK publish gate demands an explicitly configured roster/threshold voting guard (tpl_voting_guard_party_only / tpl_voting_guard_numeric_weight). The constant-true face is scanner-red-flagged either way.",
|
|
593
|
+
"type": "string",
|
|
594
|
+
"enum": [
|
|
595
|
+
"open",
|
|
596
|
+
"party_panel"
|
|
597
|
+
]
|
|
598
|
+
},
|
|
567
599
|
"env": {
|
|
568
600
|
"description": "Environment for on-chain execution (plan_execute): forwarded to the executor (e.g. { network: 'testnet' }).",
|
|
569
601
|
"type": "object",
|
|
@@ -1492,9 +1492,10 @@
|
|
|
1492
1492
|
"type": "string",
|
|
1493
1493
|
"enum": [
|
|
1494
1494
|
"repository_write",
|
|
1495
|
+
"rating_write",
|
|
1495
1496
|
"reward_claim"
|
|
1496
1497
|
],
|
|
1497
|
-
"description": "Which chained review step this report describes. repository_write = structured reputation record (rating/tags) into the caller-named Repository; reward_claim = incentive claim on the caller-named Reward."
|
|
1498
|
+
"description": "Which chained review step this report describes. repository_write = structured reputation record (rating/tags) into the caller-named Repository; rating_write = the derived U64 star row (F30 gf32-mn-261103: written alongside repository_write when the repository declares a U64 rating policy — like→5, dislike→1 — so reward guards that read the U64 star policy can pass without a hand-built second write); reward_claim = incentive claim on the caller-named Reward."
|
|
1498
1499
|
},
|
|
1499
1500
|
"status": {
|
|
1500
1501
|
"type": "string",
|
|
@@ -112,6 +112,14 @@
|
|
|
112
112
|
"description": "Phase 1 dry_run: when true, SIMULATE the transaction without signing or submitting. Returns effects + events showing what WOULD happen — no on-chain state is modified, no gas is charged. Use this to verify that an operation will succeed before committing. The returned digest will be 'dry_run:<timestamp>' and objectChanges will be empty (simulation only).",
|
|
113
113
|
"type": "boolean"
|
|
114
114
|
},
|
|
115
|
+
"window_profile": {
|
|
116
|
+
"description": "Time-window profile for trial runs (N8 ktt6 F-14 re-carving of the 'business windows are never test-compressed' ruling, 2026-11-04). 'production' (default): compressed time-window violations BLOCK publish exactly as before. 'test': compressed windows are ADMITTED so a disposable trial store can run its full lifecycle fast — R-TIME-PROFILE violations degrade to loud named disclosures, and the publish itself is BLOCKED on a real network (testnet/mainnet); point the trial at a local/dev chain (env.network='localnet'). Trial discipline: test-profile stores are throwaway — a production store must re-issue WITHOUT this flag (guards freeze at publish, so compressed windows are unrepairable except by rebuilding the store).",
|
|
117
|
+
"type": "string",
|
|
118
|
+
"enum": [
|
|
119
|
+
"production",
|
|
120
|
+
"test"
|
|
121
|
+
]
|
|
122
|
+
},
|
|
115
123
|
"response_level": {
|
|
116
124
|
"description": "Write-success response size. 'compact' (default) trims the structured result to key fields (digest + created object references); 'full' includes the complete raw result. Default: compact.",
|
|
117
125
|
"type": "string",
|
|
@@ -252,6 +260,14 @@
|
|
|
252
260
|
"description": "Phase 1 dry_run: when true, SIMULATE the transaction without signing or submitting. Returns effects + events showing what WOULD happen — no on-chain state is modified, no gas is charged. Use this to verify that an operation will succeed before committing. The returned digest will be 'dry_run:<timestamp>' and objectChanges will be empty (simulation only).",
|
|
253
261
|
"type": "boolean"
|
|
254
262
|
},
|
|
263
|
+
"window_profile": {
|
|
264
|
+
"description": "Time-window profile for trial runs (N8 ktt6 F-14 re-carving of the 'business windows are never test-compressed' ruling, 2026-11-04). 'production' (default): compressed time-window violations BLOCK publish exactly as before. 'test': compressed windows are ADMITTED so a disposable trial store can run its full lifecycle fast — R-TIME-PROFILE violations degrade to loud named disclosures, and the publish itself is BLOCKED on a real network (testnet/mainnet); point the trial at a local/dev chain (env.network='localnet'). Trial discipline: test-profile stores are throwaway — a production store must re-issue WITHOUT this flag (guards freeze at publish, so compressed windows are unrepairable except by rebuilding the store).",
|
|
265
|
+
"type": "string",
|
|
266
|
+
"enum": [
|
|
267
|
+
"production",
|
|
268
|
+
"test"
|
|
269
|
+
]
|
|
270
|
+
},
|
|
255
271
|
"response_level": {
|
|
256
272
|
"description": "Write-success response size. 'compact' (default) trims the structured result to key fields (digest + created object references); 'full' includes the complete raw result. Default: compact.",
|
|
257
273
|
"type": "string",
|
|
@@ -370,6 +386,14 @@
|
|
|
370
386
|
"description": "Phase 1 dry_run: when true, SIMULATE the transaction without signing or submitting. Returns effects + events showing what WOULD happen — no on-chain state is modified, no gas is charged. Use this to verify that an operation will succeed before committing. The returned digest will be 'dry_run:<timestamp>' and objectChanges will be empty (simulation only).",
|
|
371
387
|
"type": "boolean"
|
|
372
388
|
},
|
|
389
|
+
"window_profile": {
|
|
390
|
+
"description": "Time-window profile for trial runs (N8 ktt6 F-14 re-carving of the 'business windows are never test-compressed' ruling, 2026-11-04). 'production' (default): compressed time-window violations BLOCK publish exactly as before. 'test': compressed windows are ADMITTED so a disposable trial store can run its full lifecycle fast — R-TIME-PROFILE violations degrade to loud named disclosures, and the publish itself is BLOCKED on a real network (testnet/mainnet); point the trial at a local/dev chain (env.network='localnet'). Trial discipline: test-profile stores are throwaway — a production store must re-issue WITHOUT this flag (guards freeze at publish, so compressed windows are unrepairable except by rebuilding the store).",
|
|
391
|
+
"type": "string",
|
|
392
|
+
"enum": [
|
|
393
|
+
"production",
|
|
394
|
+
"test"
|
|
395
|
+
]
|
|
396
|
+
},
|
|
373
397
|
"response_level": {
|
|
374
398
|
"description": "Write-success response size. 'compact' (default) trims the structured result to key fields (digest + created object references); 'full' includes the complete raw result. Default: compact.",
|
|
375
399
|
"type": "string",
|
|
@@ -488,6 +512,14 @@
|
|
|
488
512
|
"description": "Phase 1 dry_run: when true, SIMULATE the transaction without signing or submitting. Returns effects + events showing what WOULD happen — no on-chain state is modified, no gas is charged. Use this to verify that an operation will succeed before committing. The returned digest will be 'dry_run:<timestamp>' and objectChanges will be empty (simulation only).",
|
|
489
513
|
"type": "boolean"
|
|
490
514
|
},
|
|
515
|
+
"window_profile": {
|
|
516
|
+
"description": "Time-window profile for trial runs (N8 ktt6 F-14 re-carving of the 'business windows are never test-compressed' ruling, 2026-11-04). 'production' (default): compressed time-window violations BLOCK publish exactly as before. 'test': compressed windows are ADMITTED so a disposable trial store can run its full lifecycle fast — R-TIME-PROFILE violations degrade to loud named disclosures, and the publish itself is BLOCKED on a real network (testnet/mainnet); point the trial at a local/dev chain (env.network='localnet'). Trial discipline: test-profile stores are throwaway — a production store must re-issue WITHOUT this flag (guards freeze at publish, so compressed windows are unrepairable except by rebuilding the store).",
|
|
517
|
+
"type": "string",
|
|
518
|
+
"enum": [
|
|
519
|
+
"production",
|
|
520
|
+
"test"
|
|
521
|
+
]
|
|
522
|
+
},
|
|
491
523
|
"response_level": {
|
|
492
524
|
"description": "Write-success response size. 'compact' (default) trims the structured result to key fields (digest + created object references); 'full' includes the complete raw result. Default: compact.",
|
|
493
525
|
"type": "string",
|
|
@@ -638,6 +670,14 @@
|
|
|
638
670
|
"description": "Phase 1 dry_run: when true, SIMULATE the transaction without signing or submitting. Returns effects + events showing what WOULD happen — no on-chain state is modified, no gas is charged. Use this to verify that an operation will succeed before committing. The returned digest will be 'dry_run:<timestamp>' and objectChanges will be empty (simulation only).",
|
|
639
671
|
"type": "boolean"
|
|
640
672
|
},
|
|
673
|
+
"window_profile": {
|
|
674
|
+
"description": "Time-window profile for trial runs (N8 ktt6 F-14 re-carving of the 'business windows are never test-compressed' ruling, 2026-11-04). 'production' (default): compressed time-window violations BLOCK publish exactly as before. 'test': compressed windows are ADMITTED so a disposable trial store can run its full lifecycle fast — R-TIME-PROFILE violations degrade to loud named disclosures, and the publish itself is BLOCKED on a real network (testnet/mainnet); point the trial at a local/dev chain (env.network='localnet'). Trial discipline: test-profile stores are throwaway — a production store must re-issue WITHOUT this flag (guards freeze at publish, so compressed windows are unrepairable except by rebuilding the store).",
|
|
675
|
+
"type": "string",
|
|
676
|
+
"enum": [
|
|
677
|
+
"production",
|
|
678
|
+
"test"
|
|
679
|
+
]
|
|
680
|
+
},
|
|
641
681
|
"response_level": {
|
|
642
682
|
"description": "Write-success response size. 'compact' (default) trims the structured result to key fields (digest + created object references); 'full' includes the complete raw result. Default: compact.",
|
|
643
683
|
"type": "string",
|