@wowok/agent-mcp 2.7.8 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/config/runtime.d.ts +1 -1
- package/dist/config/runtime.js +1 -1
- package/dist/examples/rental-ziroom-machine-create.json +1 -2
- package/dist/examples/rental-ziroom-permission-create.json +1 -2
- package/dist/examples/rental-ziroom-service-create.json +1 -2
- package/dist/experience/experience-reuse.js +1 -1
- package/dist/experience/index.d.ts +2 -1
- package/dist/experience/index.js +1 -1
- package/dist/experience/persistence-config.d.ts +6 -0
- package/dist/experience/persistence-config.js +1 -0
- package/dist/experience/persistence.d.ts +21 -0
- package/dist/experience/persistence.js +1 -0
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/experience/user-profile.js +1 -1
- package/dist/extensions/business-modules.d.ts +1 -1
- package/dist/extensions/capability-manifest.d.ts +2 -83
- package/dist/extensions/capability-manifest.js +1 -1
- package/dist/extensions/constraint-registry.d.ts +6 -4
- package/dist/extensions/constraint-registry.js +1 -1
- package/dist/extensions/index.d.ts +4 -5
- package/dist/extensions/index.js +1 -1
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/metric-registry.d.ts +6 -4
- package/dist/extensions/metric-registry.js +1 -1
- package/dist/extensions/mode-evaluator.d.ts +2 -3
- package/dist/extensions/mode-evaluator.js +1 -1
- package/dist/extensions/registry.d.ts +3 -25
- package/dist/extensions/registry.js +1 -1
- package/dist/extensions/types.d.ts +1 -69
- package/dist/goal/GoalClassifier.d.ts +17 -0
- package/dist/goal/GoalClassifier.js +1 -0
- package/dist/goal/GoalEngine.d.ts +155 -0
- package/dist/goal/GoalEngine.js +1 -0
- package/dist/goal/GoalStore.d.ts +27 -0
- package/dist/goal/GoalStore.js +1 -0
- package/dist/goal/plan-approval.d.ts +5 -0
- package/dist/goal/plan-approval.js +1 -0
- package/dist/goal/types.d.ts +80 -0
- package/dist/goal/types.js +1 -0
- package/dist/harness/index.d.ts +2 -7
- package/dist/harness/index.js +1 -1
- package/dist/harness/plan.d.ts +1 -1
- package/dist/harness/types.d.ts +0 -35
- package/dist/index.js +1 -1
- package/dist/knowledge/account-marks.d.ts +36 -0
- package/dist/knowledge/account-marks.js +1 -0
- package/dist/knowledge/audit-rules.d.ts +3 -1
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/examples-scanner-cli.js +1 -1
- package/dist/knowledge/examples-scanner.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +13 -9
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/goal-completion.d.ts +19 -0
- package/dist/knowledge/goal-completion.js +1 -0
- package/dist/knowledge/guard-bindings.d.ts +21 -0
- package/dist/knowledge/guard-bindings.js +1 -0
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.d.ts +6 -3
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/mcp-schema-audit-cli.js +1 -1
- package/dist/knowledge/mcp-schema-audit.js +1 -1
- package/dist/knowledge/operation-dictionary.js +1 -1
- package/dist/knowledge/passport-confirm.js +1 -1
- package/dist/knowledge/passport-puzzle.js +1 -1
- package/dist/knowledge/passport-translation.js +1 -1
- package/dist/knowledge/proof-risk.js +1 -1
- package/dist/knowledge/reward-risk.d.ts +1 -1
- package/dist/knowledge/reward-risk.js +1 -1
- package/dist/knowledge/safety-rules.d.ts +2 -1
- package/dist/knowledge/safety-rules.js +1 -1
- package/dist/knowledge/scenario-topology.d.ts +43 -0
- package/dist/knowledge/scenario-topology.js +1 -0
- package/dist/knowledge/service-translation.js +1 -1
- package/dist/knowledge/supply-chain.js +1 -1
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/knowledge/workflow-guidance.d.ts +36 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/knowledge/workspace-lists.d.ts +57 -0
- package/dist/knowledge/workspace-lists.js +1 -0
- package/dist/loop-engineering/context-collect.d.ts +1 -1
- package/dist/monitor/EventRouter.d.ts +10 -0
- package/dist/monitor/EventRouter.js +1 -0
- package/dist/monitor/EventStore.d.ts +32 -12
- package/dist/monitor/EventStore.js +1 -1
- package/dist/monitor/MonitorLoop.d.ts +81 -0
- package/dist/monitor/MonitorLoop.js +1 -0
- package/dist/monitor/ProblemBridge.d.ts +32 -0
- package/dist/monitor/ProblemBridge.js +1 -0
- package/dist/monitor/ScopeResolver.d.ts +59 -0
- package/dist/monitor/ScopeResolver.js +1 -0
- package/dist/monitor/SubscriptionStore.d.ts +13 -0
- package/dist/monitor/SubscriptionStore.js +1 -0
- package/dist/monitor/SuggestionBridge.d.ts +38 -0
- package/dist/monitor/SuggestionBridge.js +1 -0
- package/dist/monitor/normalize.d.ts +8 -0
- package/dist/monitor/normalize.js +1 -0
- package/dist/monitor/types.d.ts +89 -0
- package/dist/monitor/types.js +1 -0
- package/dist/participation/arbitrator-interest.d.ts +20 -0
- package/dist/participation/arbitrator-interest.js +1 -0
- package/dist/participation/demander-interest.d.ts +23 -0
- package/dist/participation/demander-interest.js +1 -0
- package/dist/persona/address-format.d.ts +1 -1
- package/dist/persona/address-format.js +1 -1
- package/dist/persona/distill-goal.d.ts +20 -0
- package/dist/persona/distill-goal.js +1 -0
- package/dist/persona/index.d.ts +2 -0
- package/dist/persona/index.js +1 -1
- package/dist/persona/model.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -0
- package/dist/{project → playbooks/service-build}/context-assembly.d.ts +9 -4
- package/dist/playbooks/service-build/context-assembly.js +1 -0
- package/dist/{project → playbooks/service-build}/game-theory.d.ts +1 -1
- package/dist/playbooks/service-build/index.d.ts +14 -0
- package/dist/playbooks/service-build/index.js +1 -0
- package/dist/{project → playbooks/service-build}/intent-analyzer.d.ts +1 -1
- package/dist/playbooks/service-build/intent-analyzer.js +1 -0
- package/dist/playbooks/service-build/machine-nodes.js +1 -0
- package/dist/{project → playbooks/service-build}/machine-panorama.d.ts +5 -3
- package/dist/playbooks/service-build/machine-panorama.js +1 -0
- package/dist/{project → playbooks/service-build}/merchant-guide.d.ts +21 -1
- package/dist/playbooks/service-build/merchant-guide.js +1 -0
- package/dist/{project → playbooks/service-build}/mode-actions.d.ts +32 -8
- package/dist/playbooks/service-build/mode-actions.js +1 -0
- package/dist/playbooks/service-build/namespace.d.ts +2 -0
- package/dist/playbooks/service-build/namespace.js +1 -0
- package/dist/{project → playbooks/service-build}/object-panorama.d.ts +2 -3
- package/dist/playbooks/service-build/object-panorama.js +1 -0
- package/dist/{project → playbooks/service-build}/participation-radar.d.ts +4 -5
- package/dist/playbooks/service-build/participation-radar.js +1 -0
- package/dist/{project → playbooks/service-build}/pipeline-actions.d.ts +9 -9
- package/dist/playbooks/service-build/pipeline-actions.js +1 -0
- package/dist/playbooks/service-build/process.d.ts +6 -0
- package/dist/playbooks/service-build/process.js +1 -0
- package/dist/playbooks/service-build/relationship-profile.d.ts +2 -0
- package/dist/playbooks/service-build/relationship-profile.js +1 -0
- package/dist/playbooks/service-build/risk-aggregator.js +1 -0
- package/dist/{project → playbooks/service-build}/semantic-graph.d.ts +7 -3
- package/dist/playbooks/service-build/semantic-graph.js +1 -0
- package/dist/{project → playbooks/service-build}/service-panorama.d.ts +3 -19
- package/dist/playbooks/service-build/service-panorama.js +1 -0
- package/dist/relationship/derivation.d.ts +88 -0
- package/dist/relationship/derivation.js +1 -0
- package/dist/relationship/incentive.d.ts +38 -0
- package/dist/relationship/incentive.js +1 -0
- package/dist/relationship/index.d.ts +4 -0
- package/dist/relationship/index.js +1 -0
- package/dist/relationship/registry.d.ts +13 -0
- package/dist/relationship/registry.js +1 -0
- package/dist/relationship/types.d.ts +45 -0
- package/dist/relationship/types.js +1 -0
- package/dist/review/arb.d.ts +6 -0
- package/dist/review/arb.js +1 -0
- package/dist/review/demand.d.ts +3 -0
- package/dist/review/demand.js +1 -0
- package/dist/review/index.d.ts +3 -0
- package/dist/review/index.js +1 -0
- package/dist/review/machine.d.ts +3 -0
- package/dist/review/machine.js +1 -0
- package/dist/review/order.d.ts +9 -0
- package/dist/review/order.js +1 -0
- package/dist/review/progress.d.ts +3 -0
- package/dist/review/progress.js +1 -0
- package/dist/review/repository.d.ts +3 -0
- package/dist/review/repository.js +1 -0
- package/dist/review/service.d.ts +5 -0
- package/dist/review/service.js +1 -0
- package/dist/review/types.d.ts +156 -0
- package/dist/review/types.js +1 -0
- package/dist/rules.d.ts +2 -2
- package/dist/rules.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/safety/index.d.ts +1 -1
- package/dist/safety/index.js +1 -1
- package/dist/safety/preview.d.ts +1 -0
- package/dist/safety/preview.js +1 -1
- package/dist/schema/call/allocation.d.ts +1 -1
- package/dist/schema/call/arbitration.d.ts +1 -1
- package/dist/schema/call/base.d.ts +1 -1
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +29 -7
- package/dist/schema/call/bridge.js +1 -1
- package/dist/schema/call/contact.d.ts +1 -1
- package/dist/schema/call/contact.js +1 -1
- package/dist/schema/call/demand.d.ts +1 -1
- package/dist/schema/call/demand.js +1 -1
- package/dist/schema/call/guard.d.ts +3 -3
- package/dist/schema/call/handler.d.ts +0 -3
- package/dist/schema/call/handler.js +1 -1
- package/dist/schema/call/machine.d.ts +2 -2
- package/dist/schema/call/order.d.ts +1 -1
- package/dist/schema/call/payment.d.ts +1 -1
- package/dist/schema/call/permission.d.ts +1 -1
- package/dist/schema/call/personal.d.ts +1 -1
- package/dist/schema/call/progress.d.ts +1 -1
- package/dist/schema/call/proof.d.ts +2 -2
- package/dist/schema/call/repository.d.ts +1 -1
- package/dist/schema/call/repository.js +1 -1
- package/dist/schema/call/reward.d.ts +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.d.ts +1 -1
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/call/treasury.d.ts +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/goal/index.d.ts +343 -0
- package/dist/schema/goal/index.js +1 -0
- package/dist/schema/goal/planning.d.ts +465 -0
- package/dist/schema/goal/planning.js +1 -0
- package/dist/schema/index.d.ts +1 -2
- package/dist/schema/index.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +323 -1
- package/dist/schema/industry-pack/index.js +1 -1
- package/dist/schema/industry-pack/modes.d.ts +326 -0
- package/dist/schema/industry-pack/modes.js +1 -0
- package/dist/schema/intent-radar/index.d.ts +19 -19
- package/dist/schema/local/index.d.ts +11 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/operations.d.ts +258 -19
- package/dist/schema/operations.js +1 -1
- package/dist/schema/permission/index.d.ts +1 -0
- package/dist/schema/permission/index.js +1 -1
- package/dist/schema/persona/index.d.ts +40 -0
- package/dist/schema/persona/index.js +1 -1
- package/dist/schema/query/bi.d.ts +912 -0
- package/dist/schema/query/bi.js +1 -0
- package/dist/schema/query/index.d.ts +663 -2
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/utils/skills-recommendation.d.ts +0 -1
- package/dist/schema/utils/skills-recommendation.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +32 -3
- package/dist/schemas/account_operation.schema.json +8 -4
- package/dist/schemas/bridge_operation.output.json +26 -3
- package/dist/schemas/bridge_operation.schema.json +85 -13
- package/dist/schemas/config_operation.output.json +1 -1
- package/dist/schemas/config_operation.schema.json +1 -1
- package/dist/schemas/goal_operation.schema.json +1092 -0
- package/dist/schemas/guard2file.schema.json +3 -3
- package/dist/schemas/index.json +12 -13
- package/dist/schemas/industry_pack_operation.output.json +1073 -0
- package/dist/schemas/industry_pack_operation.schema.json +236 -2
- package/dist/schemas/local_info_operation.output.json +2 -2
- package/dist/schemas/local_mark_operation.output.json +2 -2
- package/dist/schemas/machineNode2file.schema.json +3 -3
- package/dist/schemas/messenger_operation.output.json +2 -2
- package/dist/schemas/monitor_events.output.json +78 -3
- package/dist/schemas/monitor_events.schema.json +24 -1
- package/dist/schemas/monitor_subscription.output.json +1462 -0
- package/dist/schemas/monitor_subscription.schema.json +327 -0
- package/dist/schemas/onchain_events.output.json +5 -5
- package/dist/schemas/onchain_operations.output.json +2 -2
- package/dist/schemas/onchain_operations.schema.json +100 -100
- package/dist/schemas/onchain_operations_allocation.schema.json +7 -7
- package/dist/schemas/onchain_operations_arbitration.schema.json +6 -6
- package/dist/schemas/onchain_operations_contact.schema.json +6 -6
- package/dist/schemas/onchain_operations_demand.schema.json +6 -6
- package/dist/schemas/onchain_operations_gen_passport.schema.json +3 -3
- package/dist/schemas/onchain_operations_gen_proof.schema.json +3 -3
- package/dist/schemas/onchain_operations_guard.schema.json +3 -3
- package/dist/schemas/onchain_operations_machine.schema.json +5 -5
- package/dist/schemas/onchain_operations_order.schema.json +5 -5
- package/dist/schemas/onchain_operations_payment.schema.json +4 -4
- package/dist/schemas/onchain_operations_permission.schema.json +5 -5
- package/dist/schemas/onchain_operations_personal.schema.json +3 -3
- package/dist/schemas/onchain_operations_progress.schema.json +5 -5
- package/dist/schemas/onchain_operations_proof.schema.json +3 -3
- package/dist/schemas/onchain_operations_repository.schema.json +7 -7
- package/dist/schemas/onchain_operations_reward.schema.json +9 -9
- package/dist/schemas/onchain_operations_service.schema.json +11 -11
- package/dist/schemas/onchain_operations_treasury.schema.json +9 -9
- package/dist/schemas/onchain_table_data.output.json +399 -2
- package/dist/schemas/onchain_table_data.schema.json +22 -22
- package/dist/schemas/permission_operation.schema.json +6 -2
- package/dist/schemas/persona_operation.output.json +145 -0
- package/dist/schemas/persona_operation.schema.json +28 -2
- package/dist/schemas/query_toolkit.output.json +1514 -22
- package/dist/schemas/query_toolkit.schema.json +465 -11
- package/dist/schemas/workflow_operation.schema.json +4 -4
- package/dist/task/ProcessStore.d.ts +98 -0
- package/dist/task/ProcessStore.js +1 -0
- package/dist/task/playbook.d.ts +11 -0
- package/dist/task/playbook.js +1 -0
- package/dist/task/stage-gate.d.ts +22 -0
- package/dist/task/stage-gate.js +1 -0
- package/dist/{project → task}/substep-trace.d.ts +6 -45
- package/dist/task/types.d.ts +144 -0
- package/dist/task/types.js +1 -0
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/goal.d.ts +4 -0
- package/dist/tools/handlers/goal.js +1 -0
- package/dist/tools/handlers/industry-pack.js +1 -1
- package/dist/tools/handlers/local.d.ts +4 -3
- package/dist/tools/handlers/local.js +1 -1
- package/dist/tools/handlers/monitor.d.ts +24 -0
- package/dist/tools/handlers/monitor.js +1 -1
- package/dist/tools/handlers/network.d.ts +1 -0
- package/dist/tools/handlers/network.js +1 -0
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/permission.js +1 -1
- package/dist/tools/handlers/persona.js +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/watch.js +1 -1
- package/dist/tools/handlers/workflow.js +1 -1
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/rules-hook.d.ts +1 -0
- package/dist/tools/rules-hook.js +1 -1
- package/dist/tools/shared.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +5 -4
- package/dist/harness/checkpoint.d.ts +0 -8
- package/dist/harness/checkpoint.js +0 -1
- package/dist/knowledge/deployment-scanner.d.ts +0 -66
- package/dist/knowledge/deployment-scanner.js +0 -1
- package/dist/mode-market/index.d.ts +0 -3
- package/dist/mode-market/index.js +0 -1
- package/dist/mode-market/registry.d.ts +0 -53
- package/dist/mode-market/registry.js +0 -1
- package/dist/mode-market/review.d.ts +0 -27
- package/dist/mode-market/review.js +0 -1
- package/dist/mode-market/submission.d.ts +0 -25
- package/dist/mode-market/submission.js +0 -1
- package/dist/project/business-puzzle.js +0 -1
- package/dist/project/context-assembly.js +0 -1
- package/dist/project/deployment-bridge.d.ts +0 -5
- package/dist/project/deployment-bridge.js +0 -1
- package/dist/project/deployment-doc.d.ts +0 -190
- package/dist/project/deployment-doc.js +0 -1
- package/dist/project/edit-planner.d.ts +0 -123
- package/dist/project/edit-planner.js +0 -1
- package/dist/project/evaluation-fix.spec.d.ts +0 -1
- package/dist/project/evaluation-fix.spec.js +0 -1
- package/dist/project/evaluation.d.ts +0 -127
- package/dist/project/evaluation.js +0 -1
- package/dist/project/graph-builder.d.ts +0 -51
- package/dist/project/graph-builder.js +0 -1
- package/dist/project/graph.d.ts +0 -70
- package/dist/project/graph.js +0 -1
- package/dist/project/handlers.d.ts +0 -524
- package/dist/project/handlers.js +0 -1
- package/dist/project/index.d.ts +0 -91
- package/dist/project/index.js +0 -1
- package/dist/project/intent-analyzer.js +0 -1
- package/dist/project/machine-nodes.js +0 -1
- package/dist/project/machine-panorama.js +0 -1
- package/dist/project/merchant-guide.js +0 -1
- package/dist/project/mode-actions.js +0 -1
- package/dist/project/namespace.d.ts +0 -72
- package/dist/project/namespace.js +0 -1
- package/dist/project/object-panorama.js +0 -1
- package/dist/project/participation-radar.js +0 -1
- package/dist/project/pipeline-actions.js +0 -1
- package/dist/project/project-store.d.ts +0 -110
- package/dist/project/project-store.js +0 -1
- package/dist/project/query.d.ts +0 -43
- package/dist/project/query.js +0 -1
- package/dist/project/risk-aggregator.js +0 -1
- package/dist/project/semantic-assembler.d.ts +0 -93
- package/dist/project/semantic-assembler.js +0 -1
- package/dist/project/semantic-graph.js +0 -1
- package/dist/project/service-panorama.js +0 -1
- package/dist/project/stage-gate.d.ts +0 -52
- package/dist/project/stage-gate.js +0 -1
- package/dist/project/task-tracker.d.ts +0 -30
- package/dist/project/task-tracker.js +0 -1
- package/dist/schema/project/index.d.ts +0 -2021
- package/dist/schema/project/index.js +0 -1
- package/dist/schema/task-status.d.ts +0 -62
- package/dist/schema/task-status.js +0 -1
- package/dist/schemas/project_operation.output.json +0 -7877
- package/dist/schemas/project_operation.schema.json +0 -1139
- package/dist/schemas/query_task_status.output.json +0 -211
- package/dist/schemas/query_task_status.schema.json +0 -18
- package/dist/tools/handlers/project.d.ts +0 -2
- package/dist/tools/handlers/project.js +0 -1
- package/dist/tools/handlers/task-status.d.ts +0 -2
- package/dist/tools/handlers/task-status.js +0 -1
- /package/dist/{project → playbooks/service-build}/business-puzzle.d.ts +0 -0
- /package/dist/{project → playbooks/service-build}/game-theory.js +0 -0
- /package/dist/{project → playbooks/service-build}/machine-nodes.d.ts +0 -0
- /package/dist/{project → playbooks/service-build}/object-type.d.ts +0 -0
- /package/dist/{project → playbooks/service-build}/object-type.js +0 -0
- /package/dist/{project → playbooks/service-build}/reverse-mapping.d.ts +0 -0
- /package/dist/{project → playbooks/service-build}/reverse-mapping.js +0 -0
- /package/dist/{project → playbooks/service-build}/risk-aggregator.d.ts +0 -0
- /package/dist/{project → playbooks/service-build}/workflow-design-assessment.d.ts +0 -0
- /package/dist/{project → playbooks/service-build}/workflow-design-assessment.js +0 -0
- /package/dist/{project → task}/substep-trace.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function shortHex(b){return b['length']>0xe?b['slice'](0x0,0x6)+'…'+b['slice'](-0x4):b;}export function fmtDuration(a){if(a===null||a===undefined||a==='')return'--';const b=Number(a);if(!Number['isFinite'](b)||b<=0x0)return'--';const c=[[0x5265c00,'d'],[0x36ee80,'h'],[0xea60,'m'],[0x3e8,'s']],d=[];let e=Math['floor'](b);for(const [f,g]of c){if(d['length']>=0x2)break;const h=Math['floor'](e/f);e-=h*f;if(h>0x0)d['push'](''+h+g);else{if(d['length']>0x0)break;}}return d['length']===0x0?'<1s':d['join']('\x20');}export function assembleServiceReview(a){const b=a['service'],c=[];if(!b['published'])c['push']({'v':'UNPUBLISHED','tone':'amber','tip':'Service\x20is\x20not\x20published\x20—\x20invisible\x20to\x20customers\x20on\x20the\x20WoW\x20market\x20listing;\x20every\x20sale\x20item\x20is\x20unbuyable.'});else b['paused']&&c['push']({'v':'PAUSED','tone':'red','tip':'Service\x20is\x20paused\x20—\x20new\x20orders\x20are\x20rejected\x20(existing\x20orders\x20still\x20progress);\x20every\x20sale\x20item\x20is\x20unbuyable.'});const d=!b['published']||b['paused'],e={'kind':'items','title':'Sales\x20('+b['sales']['length']+')','empty':'No\x20sale\x20items\x20configured\x20—\x20the\x20storefront\x20is\x20empty.','items':b['sales']['map'](o=>({'name':o['name']||'(unnamed)','meta':[{'label':'price','value':o['price_display']||o['price']||'--','tip':o['price_tip']||'On-chain\x20price\x20in\x20the\x20smallest\x20unit.\x20Payment\x20token\x20info\x20unavailable\x20—\x20showing\x20the\x20raw\x20stored\x20value.'},{'label':'stock','value':o['stock']??'--','tip':'Remaining\x20sellable\x20stock\x20for\x20this\x20item.'},{'label':'wip','value':o['wip']||'--','tip':'Work-in-progress\x20product\x20template.\x20Every\x20purchase\x20mints\x20a\x20new\x20item\x20from\x20this\x20WIP\x20blueprint.'}],'badge':o['suspension']?{'v':'SUSPENDED','tone':'red'}:null,'dim':d||!!o['suspension']}))},f={'kind':'core','title':'Permission','rows':[{'label':'Permission','ref':{'address':b['permission'],'obj_type':'Permission'}}]},g={'kind':'fields','columns':0x2,'fields':[{'label':'Location','tip':'The\x20service\x20area\x20and\x20scope\x20as\x20stated\x20by\x20the\x20merchant.','value':b['location']?{'t':'text','v':b['location']}:null},{'label':'Purchase\x20guard','tip':'Guard\x20every\x20customer\x20must\x20pass\x20to\x20place\x20an\x20order\x20(whitelist\x20/\x20KYC\x20/\x20payment\x20proof).\x20Set\x20→\x20buyers\x20must\x20satisfy\x20its\x20conditions;\x20unset\x20→\x20purchase\x20is\x20unconditional.','value':a['buy_guard']?.['address']??b['buy_guard']?{'t':'addr','v':a['buy_guard']?.['address']??b['buy_guard'],'obj_type':'Guard'}:null},{'label':'Compensation\x20fund','tip':'Pre-funded\x20on-chain\x20guarantee.\x20Buyers\x20can\x20claim\x20from\x20this\x20fund\x20BEFORE\x20going\x20to\x20arbitration\x20—\x20the\x20key\x20risk-reduction\x20signal\x20customers\x20look\x20for.\x20Merchant-side\x20withdrawal\x20is\x20gated\x20by\x20the\x20Setting\x20lock:\x20the\x20Service\x20must\x20be\x20paused\x20and\x20the\x20window\x20elapsed\x20(paused_time\x20+\x20setting_lock_duration\x20≤\x20now).','value':b['compensation_fund']?{'t':'text','v':b['compensation_fund']}:null},{'label':'Published','tip':'Service\x20is\x20published\x20→\x20visible\x20to\x20customers\x20on\x20the\x20WoW\x20market\x20listing.\x20Unpublished\x20→\x20merchant-only\x20preview.','value':b['published']?{'t':'badge','v':'YES','tone':'red'}:{'t':'badge','v':'no','tone':'green'}},{'label':'Paused','tip':'When\x20paused,\x20new\x20orders\x20are\x20rejected\x20(existing\x20orders\x20still\x20progress).\x20If\x20paused,\x20shows\x20the\x20time\x20of\x20the\x20most\x20recent\x20pause\x20(the\x20PAUSE\x20tx\x20timestamp);\x20\x27no\x27\x20=\x20not\x20paused.\x20The\x20pause\x20timestamp\x20anchors\x20the\x20Setting-lock\x20window\x20that\x20gates\x20compensation-fund\x20withdrawal\x20and\x20arbitration/reward\x20removal.','value':b['paused']?{'t':'time','v':b['paused_time']??0x0,'tip':'Most\x20recent\x20pause\x20(the\x20PAUSE\x20tx\x20timestamp).'}:{'t':'text','v':'no'}},{'label':'Setting\x20lock','tip':'Lock\x20window\x20(ms)\x20anchored\x20at\x20the\x20pause\x20timestamp.\x20It\x20gates\x20exactly\x20three\x20operations:\x20withdrawing\x20the\x20Compensation\x20fund,\x20and\x20removing/clearing\x20Arbitrations\x20or\x20Rewards\x20while\x20the\x20Service\x20is\x20published\x20—\x20each\x20requires\x20the\x20Service\x20to\x20be\x20paused\x20AND\x20the\x20window\x20elapsed\x20since\x20the\x20pause.\x20Adding\x20arbitrations/rewards\x20and\x20every\x20other\x20setting\x20change\x20are\x20NOT\x20gated;\x20unpublished\x20services\x20may\x20remove\x20rewards/arbitrations\x20freely.','value':{'t':'text','v':fmtDuration(b['setting_lock_duration'])}},{'label':'UM','tip':'Update\x20Manager\x20—\x20a\x20Contact\x20designated\x20as\x20this\x20Service\x27s\x20customer-service\x20/\x20update\x20channel.\x20Buyers\x20and\x20off-chain\x20clients\x20route\x20support\x20requests\x20and\x20update\x20notices\x20through\x20this\x20Contact.','value':b['um']?{'t':'addr','v':b['um'],'obj_type':'Contact'}:null},{'label':'Machine','tip':'Workflow\x20Machine\x20bound\x20to\x20this\x20Service.\x20Orders\x20inherit\x20it\x20at\x20buy\x20time\x20—\x20an\x20order\x27s\x20Machine\x20and\x20its\x20fulfillment\x20Progress\x20nodes\x20are\x20fixed\x20when\x20the\x20order\x20is\x20created.','value':b['machine']?{'t':'addr','v':b['machine'],'obj_type':'Machine'}:null},{'label':'Customer\x20requirements','tip':'Proof\x20types\x20every\x20customer\x20must\x20satisfy\x20before/while\x20ordering\x20(e.g.\x20ID\x20proof,\x20residency,\x20off-chain\x20signature).','value':b['customer_required']['length']?{'t':'text','v':b['customer_required']['join'](',\x20')}:null},{'label':'Arbitrations','tip':'Dispute\x20channels\x20bound\x20to\x20this\x20Service.\x20An\x20arbitration\x20resolves\x20conflicts\x20when\x20the\x20compensation-fund\x20claim-path\x20does\x20not\x20suffice.\x20While\x20published,\x20removing/clearing\x20is\x20gated\x20by\x20the\x20Setting\x20lock\x20(the\x20Service\x20must\x20be\x20paused\x20and\x20the\x20window\x20elapsed);\x20adding\x20is\x20allowed\x20anytime.','value':{'t':'count','n':b['arbitrations']['length'],'panel_title':'Arbitrations','addrs':b['arbitrations']}},{'label':'Rewards','tip':'On-chain\x20reward\x20pools\x20bound\x20to\x20this\x20Service\x20—\x20typically\x20pay\x20out\x20to\x20customers\x20on\x20purchase\x20milestones,\x20or\x20to\x20staff\x20for\x20on-time\x20fulfillment.\x20While\x20published,\x20removing/clearing\x20is\x20gated\x20by\x20the\x20Setting\x20lock\x20(the\x20Service\x20must\x20be\x20paused\x20and\x20the\x20window\x20elapsed);\x20adding\x20is\x20allowed\x20anytime.','value':{'t':'count','n':b['rewards']['length'],'panel_title':'Rewards','addrs':b['rewards']}},{'label':'Repositories','tip':'Evidence\x20/\x20data\x20repositories\x20consulted\x20for\x20fulfillment\x20proofs.\x20The\x20Machine\x20workflow\x20can\x20require\x20repository-gated\x20consensus\x20before\x20advancing\x20a\x20stage.','value':{'t':'count','n':b['repositories']['length'],'panel_title':'Repositories','addrs':b['repositories']}}]},h=a['machine_graph'],i=h?{'kind':'graph','title':'Workflow\x20Graph','empty':'No\x20workflow\x20machine\x20bound\x20to\x20this\x20Service.','graph':{'machineAddress':h['address'],'machineName':h['name'],'published':h['published'],'paused':h['paused'],'nodes':h['nodes'],'edges':h['edges']}}:null,j=a['allocator_guards']['map']((o,p)=>({'name':'Guard\x20'+(p+0x1),'ref':{'address':o['address'],'obj_type':'Guard'},'meta':[{'label':'entries','value':String(o['table_entry_count']),'tip':'Guard\x20table\x20entries\x20=\x20the\x20conditions\x20/\x20proof\x20slots\x20defined\x20in\x20this\x20guard.'},{'label':'submissions','value':String(o['submission_slot_count']),'tip':'Submission\x20slots\x20=\x20dynamic\x20proof\x20fields\x20the\x20operator\x20must\x20fill\x20at\x20execution\x20time.'},...o['rep']!=null?[{'label':'rep','value':o['rep']?'yes':'no','tip':'Reputation-flagged\x20guard\x20—\x20requires\x20a\x20reputation\x20marker\x20to\x20pass.'}]:[],...o['relies_logic_and']!=null?[{'label':'logic','value':o['relies_logic_and']?'AND':'OR','tip':'AND\x20=\x20all\x20relied-guards\x20must\x20pass;\x20OR\x20=\x20any\x20relied-guard\x20passing\x20is\x20enough.'}]:[],...o['relies']['length']>0x0?[{'label':'relies','value':String(o['relies']['length']),'tip':'Upstream\x20guards\x20this\x20guard\x20composes\x20with\x20(evidence\x20verification\x20chaining)\x20—\x20open\x20the\x20Guard\x20detail\x20for\x20the\x20full\x20tree.'}]:[]],'note':o['description']??undefined}));if(b['order_allocators']){const o=b['order_allocators'];j['push']({'name':'Order\x20allocators','meta':[{'label':'threshold','value':o['threshold']??'--','tip':'Escrow\x20amount\x20threshold\x20above\x20which\x20the\x20allocator\x20strategy\x20applies.'}],'note':o['description']||'(no\x20description)'}),o['allocators']['forEach']((p,q)=>{j['push']({'name':'Allocator\x20'+(q+0x1),'ref':{'address':p['guard'],'obj_type':'Guard'},'meta':[{'label':'shares','value':String(p['sharing_count']),'tip':'Number\x20of\x20settlement\x20shares\x20this\x20allocator\x20guard\x20controls.'},...p['max']?[{'label':'max','value':p['max'],'tip':'Per-share\x20cap\x20for\x20this\x20allocator\x20guard.'}]:[]]});});}const k={'kind':'items','title':'Allocation\x20Guards\x20('+a['allocator_guards']['length']+')','empty':'No\x20allocation\x20guards\x20—\x20settlement\x20splits\x20use\x20the\x20default\x20allocator\x20strategy.\x20(A\x20configured\x20purchase\x20guard\x20is\x20listed\x20in\x20the\x20Fields\x20card.)','items':j},l=a['related']['groups']['reduce']((p,q)=>p+q['items']['length'],0x0),m={'kind':'related','title':'Related\x20objects'+(l>0x0?'\x20('+l+')':''),'empty':'No\x20other\x20on-chain\x20objects\x20reference\x20or\x20use\x20this\x20Service\x20yet\x20—\x20orders,\x20progress,\x20allocations,\x20payments\x20and\x20guards\x20targeting\x20this\x20Service\x20will\x20appear\x20here.','groups':a['related']['groups']['map'](p=>({'label':p['type_label'],'items':p['items']['map'](q=>({'address':q['address'],'time':q['time']}))})),'count':l},n=[e,f,g,...i?[i]:[],k,m];return{'action':'review_pack','object_type':'Service','head':{'address':b['address'],'network':a['network'],'name':b['name'],'description':b['description']||null,'tags':b['tags'],'last_active_ms':b['onchain_last_updated']?Number(b['onchain_last_updated']['timestamp_ms'])||null:null,'badges':c,'info_rows':[]},'sections':n,'data_gaps':a['data_gaps']};}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
export type ReviewTone = "green" | "amber" | "red" | "gray" | "blue" | "yellow";
|
|
2
|
+
export type ReviewValue = {
|
|
3
|
+
t: "text";
|
|
4
|
+
v: string;
|
|
5
|
+
tone?: "dim" | "strong";
|
|
6
|
+
} | {
|
|
7
|
+
t: "time";
|
|
8
|
+
v: number;
|
|
9
|
+
tip?: string;
|
|
10
|
+
} | {
|
|
11
|
+
t: "addr";
|
|
12
|
+
v: string;
|
|
13
|
+
obj_type?: string;
|
|
14
|
+
badge?: {
|
|
15
|
+
v: string;
|
|
16
|
+
tone: ReviewTone;
|
|
17
|
+
};
|
|
18
|
+
} | {
|
|
19
|
+
t: "progress";
|
|
20
|
+
v: string;
|
|
21
|
+
node: string | null;
|
|
22
|
+
since: number | null;
|
|
23
|
+
machine?: string | null;
|
|
24
|
+
} | {
|
|
25
|
+
t: "count";
|
|
26
|
+
n: number;
|
|
27
|
+
panel_title?: string;
|
|
28
|
+
addrs?: string[];
|
|
29
|
+
} | {
|
|
30
|
+
t: "badge";
|
|
31
|
+
v: string;
|
|
32
|
+
tone: ReviewTone;
|
|
33
|
+
} | {
|
|
34
|
+
t: "deadline";
|
|
35
|
+
v: number;
|
|
36
|
+
tip?: string;
|
|
37
|
+
} | {
|
|
38
|
+
t: "longtext";
|
|
39
|
+
v: string;
|
|
40
|
+
} | null;
|
|
41
|
+
export interface ReviewField {
|
|
42
|
+
label: string;
|
|
43
|
+
tip?: string;
|
|
44
|
+
value: ReviewValue;
|
|
45
|
+
}
|
|
46
|
+
export interface ReviewCoreRow {
|
|
47
|
+
label: string;
|
|
48
|
+
ref: {
|
|
49
|
+
address: string;
|
|
50
|
+
obj_type: string;
|
|
51
|
+
};
|
|
52
|
+
meta?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ReviewItem {
|
|
55
|
+
name: string;
|
|
56
|
+
ref?: {
|
|
57
|
+
address: string;
|
|
58
|
+
obj_type: string;
|
|
59
|
+
};
|
|
60
|
+
meta: {
|
|
61
|
+
label: string;
|
|
62
|
+
value: string;
|
|
63
|
+
tip?: string;
|
|
64
|
+
}[];
|
|
65
|
+
hash?: string | null;
|
|
66
|
+
badge?: {
|
|
67
|
+
v: string;
|
|
68
|
+
tone: ReviewTone;
|
|
69
|
+
} | null;
|
|
70
|
+
dim?: boolean;
|
|
71
|
+
note?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface ReviewRelatedGroup {
|
|
74
|
+
label: string;
|
|
75
|
+
items: {
|
|
76
|
+
address: string;
|
|
77
|
+
time: number | null;
|
|
78
|
+
}[];
|
|
79
|
+
}
|
|
80
|
+
export interface ReviewGraph {
|
|
81
|
+
machineAddress: string;
|
|
82
|
+
machineName: string | null;
|
|
83
|
+
published: boolean | null;
|
|
84
|
+
paused: boolean | null;
|
|
85
|
+
nodes: {
|
|
86
|
+
name: string;
|
|
87
|
+
description: string | null;
|
|
88
|
+
}[];
|
|
89
|
+
edges: {
|
|
90
|
+
from: string;
|
|
91
|
+
to: string;
|
|
92
|
+
threshold: number;
|
|
93
|
+
forwards: {
|
|
94
|
+
name: string;
|
|
95
|
+
weight: number;
|
|
96
|
+
guard: string | null;
|
|
97
|
+
retained_submission: number[] | null;
|
|
98
|
+
named_operator: string | null;
|
|
99
|
+
permission_index: number | null;
|
|
100
|
+
}[];
|
|
101
|
+
}[];
|
|
102
|
+
}
|
|
103
|
+
export type ReviewSection = {
|
|
104
|
+
kind: "fields";
|
|
105
|
+
fields: ReviewField[];
|
|
106
|
+
columns?: 1 | 2;
|
|
107
|
+
} | {
|
|
108
|
+
kind: "items";
|
|
109
|
+
title: string;
|
|
110
|
+
empty: string;
|
|
111
|
+
items: ReviewItem[];
|
|
112
|
+
} | {
|
|
113
|
+
kind: "core";
|
|
114
|
+
title: string;
|
|
115
|
+
rows: ReviewCoreRow[];
|
|
116
|
+
} | {
|
|
117
|
+
kind: "graph";
|
|
118
|
+
title: string;
|
|
119
|
+
empty: string;
|
|
120
|
+
graph: ReviewGraph;
|
|
121
|
+
} | {
|
|
122
|
+
kind: "related";
|
|
123
|
+
title: string;
|
|
124
|
+
empty: string;
|
|
125
|
+
groups: ReviewRelatedGroup[];
|
|
126
|
+
count?: number;
|
|
127
|
+
};
|
|
128
|
+
export interface ReviewHead {
|
|
129
|
+
address: string;
|
|
130
|
+
network: string;
|
|
131
|
+
name: string | null;
|
|
132
|
+
description: string | null;
|
|
133
|
+
tags: string[];
|
|
134
|
+
last_active_ms: number | null;
|
|
135
|
+
badges: {
|
|
136
|
+
v: string;
|
|
137
|
+
tone: ReviewTone;
|
|
138
|
+
tip?: string;
|
|
139
|
+
}[];
|
|
140
|
+
amount?: {
|
|
141
|
+
text: string;
|
|
142
|
+
tip?: string;
|
|
143
|
+
};
|
|
144
|
+
info_rows: {
|
|
145
|
+
label: string;
|
|
146
|
+
tip?: string;
|
|
147
|
+
value: ReviewValue;
|
|
148
|
+
}[][];
|
|
149
|
+
}
|
|
150
|
+
export interface ReviewPack {
|
|
151
|
+
action: "review_pack";
|
|
152
|
+
object_type: string;
|
|
153
|
+
head: ReviewHead;
|
|
154
|
+
sections: ReviewSection[];
|
|
155
|
+
data_gaps: string[];
|
|
156
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
package/dist/rules.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ export { validateOperation, hasBlockingViolations, getWarningViolations, type Co
|
|
|
2
2
|
export { computeServiceTrustScore, type ServiceTrustMetrics, } from "./knowledge/trust-metrics.js";
|
|
3
3
|
export { AUDIT_RULES, auditService, hasBlockingErrors, getErrors, getWarnings, summarizeFindings, type AuditFinding, } from "./knowledge/audit-rules.js";
|
|
4
4
|
export { confirmGate, isConfirmGateEnabled, isExplicitlyConfirmed, getFailMode, type ConfirmResult, type FailMode, } from "./safety/confirm-gate.js";
|
|
5
|
-
export { renderPreview } from "./safety/preview.js";
|
|
5
|
+
export { renderPreview, renderPreviewHuman } from "./safety/preview.js";
|
|
6
6
|
export { CONFIRMATION_RULES, SAFETY_RULES_VERSION, DEFAULT_AMOUNT_THRESHOLD, getAmountThreshold, formatAmount, collectDefaultWarnings, type OperationPreview, type ConfirmLevel, type ConfirmationRule, } from "./knowledge/safety-rules.js";
|
|
7
7
|
export { distillIntent, extractSignals } from "./experience/intent-distill.js";
|
|
8
8
|
export type { DistilledIntent } from "./experience/types.js";
|
|
9
9
|
export { Harness, getHarness, setHarness } from "./harness/index.js";
|
|
10
|
-
export type { ODG, ExpectedResult, VerifyReport, RecoveryAction,
|
|
10
|
+
export type { ODG, ExpectedResult, VerifyReport, RecoveryAction, } from "./harness/types.js";
|
|
11
11
|
export { getDefaultPreferences, inferPreferences, matchServiceToPreferences, mergePreferences, validatePreferences, SUPPORTED_INDUSTRIES, type IndustryTemplate, type Industry, type PreferenceInference, type ServiceForMatching, type PreferenceMatchResult, } from "./customer/user-preferences.js";
|
|
12
12
|
export type { UserPreferences } from "./customer/types.js";
|
|
13
13
|
export declare function buildSoftRulesPrompt(): string;
|
package/dist/rules.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{validateOperation,hasBlockingViolations,getWarningViolations}from'./knowledge/tool-constraints.js';export{computeServiceTrustScore}from'./knowledge/trust-metrics.js';export{AUDIT_RULES,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings}from'./knowledge/audit-rules.js';export{confirmGate,isConfirmGateEnabled,isExplicitlyConfirmed,getFailMode}from'./safety/confirm-gate.js';export{renderPreview}from'./safety/preview.js';export{CONFIRMATION_RULES,SAFETY_RULES_VERSION,DEFAULT_AMOUNT_THRESHOLD,getAmountThreshold,formatAmount,collectDefaultWarnings}from'./knowledge/safety-rules.js';export{distillIntent,extractSignals}from'./experience/intent-distill.js';export{Harness,getHarness,setHarness}from'./harness/index.js';export{getDefaultPreferences,inferPreferences,matchServiceToPreferences,mergePreferences,validatePreferences,SUPPORTED_INDUSTRIES}from'./customer/user-preferences.js';import{CONFIRMATION_RULES,DEFAULT_AMOUNT_THRESHOLD,formatAmount,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_CLASS_META,NAMING_CONVENTIONS}from'./knowledge/safety-rules.js';const PERMISSION_INDEX_RANGE='1000-65535\x20(0-999\x20reserved)';export function buildSoftRulesPrompt(){const a=[];a['push']('##\x20Token\x20amounts'),a['push']('-\x20Token\x20amounts\x20are\x20U64\x20integers\x20in\x20the\x20smallest\x20unit.\x201\x20WOW\x20=\x201_000_000_000\x20(9\x20decimals).'),a['push']('-\x20Amount\x20input\x20accepts\x20\x272WOW\x27\x20/\x20\x2710.5WOW\x27\x20(auto-converted)\x20or\x20a\x20raw\x20integer\x20\x272000000000\x27.'),a['push']('-\x20Always\x20query\x20token\x20precision\x20via\x20query_toolkit\x20before\x20using\x20a\x20non-WOW\x20token.'),a['push'](''),a['push']('##\x20Operation\x20classes');for(const [c,d]of Object['entries'](OPERATION_CLASS_META)){a['push']('-\x20'+c+':\x20'+d['note']);}a['push'](''),a['push']('##\x20Object\x20reuse\x20vs\x20create'),a['push']('-\x20'+CREATE_VS_MODIFY_PATTERN['note']);for(const e of OBJECT_REUSE_RULES){a['push']('\x20\x20-\x20'+e['object_type']+':\x20'+e['recommendation']['replace'](/_/g,'\x20')+'\x20—\x20'+e['reason']);}a['push'](''),a['push']('##\x20Immutability');for(const f of IMMUTABILITY_RULES){const g=f['mutable_after']?.['length']?'\x20(still\x20mutable:\x20'+f['mutable_after']['join'](',\x20')+')':'';a['push']('-\x20'+f['object_type']+'\x20'+f['trigger']+':\x20'+f['message']+g);}a['push'](''),a['push']('##\x20Confirmation\x20levels');const b=[...new Set(CONFIRMATION_RULES['map'](h=>h['level']))];a['push']('-\x20Amount\x20threshold\x20for\x20extra\x20scrutiny:\x20'+formatAmount(DEFAULT_AMOUNT_THRESHOLD)+'\x20WOW.'),a['push']('-\x20Confirm-gate\x20levels:\x20'+b['join'](',\x20')+'.'),a['push'](''),a['push']('##\x20Naming\x20conventions'),a['push']('-\x20Scheme:\x20'+NAMING_CONVENTIONS['scheme']);for(const h of NAMING_CONVENTIONS['recommendations']){a['push']('-\x20'+h);}return a['push']('-\x20Custom\x20permission\x20indices:\x20'+PERMISSION_INDEX_RANGE+'.'),a['push'](''),a['join']('\x0a');}export{OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,NAMING_CONVENTIONS,classifyTool,checkObjectReuseRules,checkImmutabilityRules}from'./knowledge/safety-rules.js';
|
|
1
|
+
export{validateOperation,hasBlockingViolations,getWarningViolations}from'./knowledge/tool-constraints.js';export{computeServiceTrustScore}from'./knowledge/trust-metrics.js';export{AUDIT_RULES,auditService,hasBlockingErrors,getErrors,getWarnings,summarizeFindings}from'./knowledge/audit-rules.js';export{confirmGate,isConfirmGateEnabled,isExplicitlyConfirmed,getFailMode}from'./safety/confirm-gate.js';export{renderPreview,renderPreviewHuman}from'./safety/preview.js';export{CONFIRMATION_RULES,SAFETY_RULES_VERSION,DEFAULT_AMOUNT_THRESHOLD,getAmountThreshold,formatAmount,collectDefaultWarnings}from'./knowledge/safety-rules.js';export{distillIntent,extractSignals}from'./experience/intent-distill.js';export{Harness,getHarness,setHarness}from'./harness/index.js';export{getDefaultPreferences,inferPreferences,matchServiceToPreferences,mergePreferences,validatePreferences,SUPPORTED_INDUSTRIES}from'./customer/user-preferences.js';import{CONFIRMATION_RULES,DEFAULT_AMOUNT_THRESHOLD,formatAmount,OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_CLASS_META,NAMING_CONVENTIONS}from'./knowledge/safety-rules.js';const PERMISSION_INDEX_RANGE='1000-65535\x20(0-999\x20reserved)';export function buildSoftRulesPrompt(){const a=[];a['push']('##\x20Token\x20amounts'),a['push']('-\x20Token\x20amounts\x20are\x20U64\x20integers\x20in\x20the\x20smallest\x20unit.\x201\x20WOW\x20=\x201_000_000_000\x20(9\x20decimals).'),a['push']('-\x20Amount\x20input\x20accepts\x20\x272WOW\x27\x20/\x20\x2710.5WOW\x27\x20(auto-converted)\x20or\x20a\x20raw\x20integer\x20\x272000000000\x27.'),a['push']('-\x20Always\x20query\x20token\x20precision\x20via\x20query_toolkit\x20before\x20using\x20a\x20non-WOW\x20token.'),a['push'](''),a['push']('##\x20Operation\x20classes');for(const [c,d]of Object['entries'](OPERATION_CLASS_META)){a['push']('-\x20'+c+':\x20'+d['note']);}a['push'](''),a['push']('##\x20Object\x20reuse\x20vs\x20create'),a['push']('-\x20'+CREATE_VS_MODIFY_PATTERN['note']);for(const e of OBJECT_REUSE_RULES){a['push']('\x20\x20-\x20'+e['object_type']+':\x20'+e['recommendation']['replace'](/_/g,'\x20')+'\x20—\x20'+e['reason']);}a['push'](''),a['push']('##\x20Immutability');for(const f of IMMUTABILITY_RULES){const g=f['mutable_after']?.['length']?'\x20(still\x20mutable:\x20'+f['mutable_after']['join'](',\x20')+')':'';a['push']('-\x20'+f['object_type']+'\x20'+f['trigger']+':\x20'+f['message']+g);}a['push'](''),a['push']('##\x20Confirmation\x20levels');const b=[...new Set(CONFIRMATION_RULES['map'](h=>h['level']))];a['push']('-\x20Amount\x20threshold\x20for\x20extra\x20scrutiny:\x20'+formatAmount(DEFAULT_AMOUNT_THRESHOLD)+'\x20WOW.'),a['push']('-\x20Confirm-gate\x20levels:\x20'+b['join'](',\x20')+'.'),a['push'](''),a['push']('##\x20Naming\x20conventions'),a['push']('-\x20Scheme:\x20'+NAMING_CONVENTIONS['scheme']);for(const h of NAMING_CONVENTIONS['recommendations']){a['push']('-\x20'+h);}return a['push']('-\x20Custom\x20permission\x20indices:\x20'+PERMISSION_INDEX_RANGE+'.'),a['push'](''),a['join']('\x0a');}export{OBJECT_REUSE_RULES,CREATE_VS_MODIFY_PATTERN,IMMUTABILITY_RULES,OPERATION_TYPE_CLASSIFICATION,OPERATION_CLASS_META,NAMING_CONVENTIONS,classifyTool,checkObjectReuseRules,checkImmutabilityRules}from'./knowledge/safety-rules.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONFIRMATION_RULES,resolveOverrideId}from'../knowledge/safety-rules.js';import{isEnabled as
|
|
1
|
+
import{CONFIRMATION_RULES,resolveOverrideId}from'../knowledge/safety-rules.js';import{isEnabled as a325a}from'../config/index.js';import{isPlanPreapproved}from'../goal/plan-approval.js';export function isConfirmGateEnabled(){return a325a('confirm_gate');}const internalErrorCounts={};function logInternalError(a,b){const c=a;internalErrorCounts[c]=(internalErrorCounts[c]??0x0)+0x1;const d=internalErrorCounts[c];console['warn']('[ConfirmGate]\x20internal_error\x20context=\x22'+a+'\x22\x20count='+d+'\x20error='+(b instanceof Error?b['message']:String(b)));}export function getFailMode(a){switch(a){case'irreversible':case'publish':case'amount':return'closed';case'standard':case'none':default:return'open';}}function buildInternalErrorResult(){return{'pass':![],'level':'irreversible','preview':{'level':'irreversible','operation':'unknown','irreversible':!![]},'rule_id':'internal_error'};}export function confirmGate(a,b,c,d,f){if(!isConfirmGateEnabled())return{'pass':!![]};if(c?.['confirmed']===!![])return{'pass':!![]};let g,h=null;try{g=CONFIRMATION_RULES['find'](l=>{try{return l['when'](a,b,c);}catch(m){logInternalError('rule_when:'+l['id'],m);if(getFailMode(l['level'])==='closed')throw m;return![];}});}catch(l){h=l;}if(h)return logInternalError('rule_search',h),buildInternalErrorResult();if(!g)return{'pass':!![]};if(getFailMode(g['level'])==='open'&&isPlanPreapproved(c))return{'pass':!![]};const i=resolveOverrideId(g['id'],a),j=i?f?.[i]:undefined;if(j==='auto')return{'pass':!![]};if(j!=='block'&&g['bypass_on_explicit_intent']&&d&&d['length']>0x0){const m=d['map'](o=>o['toLowerCase']()),n=g['bypass_on_explicit_intent']['some'](o=>m['some'](q=>q['includes'](o['toLowerCase']())));if(n)return{'pass':!![]};}let k;try{k=g['preview'](a,b,c);}catch(o){logInternalError('rule_preview:'+g['id'],o);if(getFailMode(g['level'])==='closed')return buildInternalErrorResult();return{'pass':!![]};}return{'pass':![],'level':g['level'],'preview':k,'rule_id':g['id']};}export function isExplicitlyConfirmed(a){return a?.['confirmed']===!![];}
|
package/dist/safety/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { confirmGate, isConfirmGateEnabled, isExplicitlyConfirmed, type ConfirmResult, } from "./confirm-gate.js";
|
|
2
|
-
export { renderPreview } from "./preview.js";
|
|
2
|
+
export { renderPreview, renderPreviewHuman } from "./preview.js";
|
|
3
3
|
export { CONFIRMATION_RULES, DEFAULT_VALUE_WARNINGS, DEFAULT_AMOUNT_THRESHOLD, getAmountThreshold, formatAmount, collectDefaultWarnings, type ConfirmLevel, type OperationPreview, type ConfirmationRule, SAFETY_RULES_VERSION, } from "../knowledge/safety-rules.js";
|
package/dist/safety/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{confirmGate,isConfirmGateEnabled,isExplicitlyConfirmed}from'./confirm-gate.js';export{renderPreview}from'./preview.js';export{CONFIRMATION_RULES,DEFAULT_VALUE_WARNINGS,DEFAULT_AMOUNT_THRESHOLD,getAmountThreshold,formatAmount,collectDefaultWarnings,SAFETY_RULES_VERSION}from'../knowledge/safety-rules.js';
|
|
1
|
+
export{confirmGate,isConfirmGateEnabled,isExplicitlyConfirmed}from'./confirm-gate.js';export{renderPreview,renderPreviewHuman}from'./preview.js';export{CONFIRMATION_RULES,DEFAULT_VALUE_WARNINGS,DEFAULT_AMOUNT_THRESHOLD,getAmountThreshold,formatAmount,collectDefaultWarnings,SAFETY_RULES_VERSION}from'../knowledge/safety-rules.js';
|
package/dist/safety/preview.d.ts
CHANGED
package/dist/safety/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const LEVEL_LABEL={'none':'none','standard':'Standard\x20confirmation','amount':'Amount\x20confirmation','publish':'Publish\x20confirmation\x20(irreversible\x20lock)','irreversible':'Irreversible\x20operation\x20confirmation'},CONFIRMATION_REQUIRED_OPERATIONS=['guard\x20(CREATE\x20—\x20immutable,\x20cannot\x20be\x20edited\x20or\x20deleted)','service\x20(publish=true\x20—\x20locks\x20machine/order_allocators)','machine\x20(publish=true\x20—\x20locks\x20nodes/pairs/forwards)','arbitration\x20(verdict\x20—\x20irreversible)','payment\x20(send\x20—\x20irreversible)','treasury\x20(withdraw/external_withdraw/external_deposit\x20—\x20irreversible)','reward\x20/\x20treasury\x20/\x20service
|
|
1
|
+
import{formatShortAddress}from'../persona/address-format.js';const LEVEL_LABEL={'none':'none','standard':'Standard\x20confirmation','amount':'Amount\x20confirmation','publish':'Publish\x20confirmation\x20(irreversible\x20lock)','irreversible':'Irreversible\x20operation\x20confirmation'},CONFIRMATION_REQUIRED_OPERATIONS=['guard\x20(CREATE\x20—\x20immutable,\x20cannot\x20be\x20edited\x20or\x20deleted)','service\x20(publish=true\x20—\x20locks\x20machine/order_allocators)','machine\x20(publish=true\x20—\x20locks\x20nodes/pairs/forwards)','arbitration\x20(verdict\x20—\x20irreversible)','payment\x20(send/receive\x20—\x20irreversible)','treasury\x20(withdraw/external_withdraw/external_deposit\x20—\x20irreversible)','reward\x20coin_add\x20/\x20treasury\x20deposit\x20/\x20allocation\x20funding\x20/\x20arbitration\x20fee\x20/\x20service\x20compensation_fund_add\x20/\x20service\x20order_new\x20payment\x20(amount-sensitive)','progress\x20(node\x20advance\x20—\x20may\x20release\x20funds;\x20owner_receive\x20—\x20fund\x20claim)','gen_passport\x20(gas-consuming\x20test)'];export function renderPreview(a){const b=[];b['push']('⚠️\x20\x20Confirmation\x20required\x20—\x20'+LEVEL_LABEL[a['level']]),b['push']('\x20\x20Operation:\x20'+a['operation']);if(a['object'])b['push']('\x20\x20Object:\x20'+a['object']);if(a['network'])b['push']('\x20\x20Network:\x20'+a['network']);if(a['account']!==undefined)b['push']('\x20\x20Account:\x20'+(a['account']===''?'(default)':a['account']));a['amount']&&b['push']('\x20\x20Amount:\x20'+a['amount']['human_readable']+'\x20('+a['amount']['value']+'\x20smallest\x20unit)'+(a['amount']['recipient']?'\x20→\x20'+a['amount']['recipient']:''));a['immutable_after']&&a['immutable_after']['length']>0x0&&b['push']('\x20\x20Fields\x20becoming\x20immutable:\x20'+a['immutable_after']['join'](',\x20'));if(a['warnings']&&a['warnings']['length']>0x0){b['push']('\x20\x20Warnings:');for(const c of a['warnings'])b['push']('\x20\x20\x20\x20-\x20'+c);}a['irreversible']&&b['push']('\x20\x20⛔\x20This\x20operation\x20is\x20IRREVERSIBLE.\x20It\x20cannot\x20be\x20undone.');b['push'](''),b['push']('Confirm\x20by\x20re-calling\x20with\x20env.confirmed=true,\x20or\x20modify/cancel.'),b['push'](''),b['push']('Operations\x20that\x20require\x20env.confirmed=true:');for(const d of CONFIRMATION_REQUIRED_OPERATIONS){b['push']('\x20\x20-\x20'+d);}return b['push']('Example:\x20{\x22env\x22:\x20{\x22account\x22:\x20\x22...\x22,\x20\x22network\x22:\x20\x22testnet\x22,\x20\x22confirmed\x22:\x20true}}'),b['join']('\x0a');}const OPERATION_MEANINGS={'payment':'Send\x20a\x20payment\x20on-chain.\x20Funds\x20leave\x20your\x20account\x20and\x20are\x20credited\x20to\x20the\x20recipient.','service':'Publish\x20/\x20update\x20this\x20Service.\x20Publishing\x20locks\x20its\x20machine\x20and\x20order-allocator\x20configuration\x20—\x20further\x20changes\x20require\x20a\x20new\x20Service\x20version.','machine':'Publish\x20this\x20Machine\x20workflow.\x20Publishing\x20locks\x20its\x20nodes,\x20pairs\x20and\x20forwards\x20—\x20the\x20flow\x20cannot\x20be\x20redesigned\x20afterwards.','arbitration':'Issue\x20the\x20arbitration\x20verdict.\x20The\x20verdict\x20is\x20final\x20and\x20cannot\x20be\x20changed.','treasury':'Move\x20funds\x20in/out\x20of\x20a\x20Treasury.\x20Withdrawals\x20are\x20on-chain\x20transfers\x20and\x20cannot\x20be\x20undone.','reward':'Distribute\x20rewards\x20from\x20a\x20Service.\x20Funds\x20are\x20transferred\x20on-chain\x20immediately.','guard':'Create\x20a\x20Guard.\x20Guards\x20are\x20CREATE-only\x20and\x20immutable\x20—\x20they\x20can\x20never\x20be\x20edited\x20or\x20deleted;\x20changing\x20one\x20means\x20creating\x20a\x20new\x20Guard\x20and\x20rebinding.','progress':'Advance\x20an\x20order\x20(Progress\x20node).\x20Depending\x20on\x20the\x20node\x20this\x20may\x20release\x20funds\x20to\x20the\x20counterparty.','gen_passport':'Run\x20a\x20Guard\x20test\x20(generate\x20a\x20test\x20Passport).\x20This\x20consumes\x20gas\x20but\x20changes\x20nothing\x20permanent.'};function fallbackMeaning(a){return'Execute\x20the\x20\x22'+a+'\x22\x20operation\x20on-chain.';}function shortish(a){return/^(0x)?[0-9a-fA-F]{8,64}$/['test'](a)?formatShortAddress(a):a;}export function renderPreviewHuman(a){const b=[];b['push']('What\x20this\x20does'),b['push']('\x20\x20'+(OPERATION_MEANINGS[a['operation']]??fallbackMeaning(a['operation']))),b['push'](''),b['push']('How\x20it\x20will\x20run');if(a['object'])b['push']('\x20\x20Object:\x20\x20\x20'+shortish(a['object']));a['account']!==undefined&&b['push']('\x20\x20Account:\x20\x20'+(a['account']===''?'(current\x20account)':shortish(a['account'])));if(a['network'])b['push']('\x20\x20Network:\x20\x20'+a['network']);a['amount']&&b['push']('\x20\x20Amount:\x20\x20\x20'+a['amount']['human_readable']+(a['amount']['recipient']?'\x20\x20→\x20\x20to\x20'+shortish(a['amount']['recipient']):''));b['push'](''),b['push']('What\x20happens\x20after\x20you\x20confirm');a['immutable_after']&&a['immutable_after']['length']>0x0&&b['push']('\x20\x20-\x20These\x20become\x20PERMANENT:\x20'+a['immutable_after']['join'](',\x20'));a['irreversible']&&b['push']('\x20\x20-\x20The\x20operation\x20is\x20IRREVERSIBLE\x20—\x20it\x20cannot\x20be\x20undone\x20or\x20cancelled.');if(a['warnings']&&a['warnings']['length']>0x0){b['push']('\x20\x20Notes:');for(const c of a['warnings'])b['push']('\x20\x20\x20\x20-\x20'+c);}return!(a['immutable_after']&&a['immutable_after']['length']>0x0)&&!a['irreversible']&&!(a['warnings']&&a['warnings']['length']>0x0)&&b['push']('\x20\x20-\x20The\x20operation\x20is\x20submitted\x20to\x20the\x20network\x20immediately.'),b['join']('\x0a');}
|
|
@@ -200,7 +200,7 @@ export declare const CallAllocation_InputSchema: z.ZodObject<{
|
|
|
200
200
|
no_auto_register: z.ZodOptional<z.ZodBoolean>;
|
|
201
201
|
confirmed: z.ZodOptional<z.ZodBoolean>;
|
|
202
202
|
user_intent_phrases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
203
|
-
|
|
203
|
+
plan_approval: z.ZodOptional<z.ZodString>;
|
|
204
204
|
client_schema_version: z.ZodOptional<z.ZodString>;
|
|
205
205
|
schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
206
206
|
dry_run: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -335,7 +335,7 @@ export declare const CallArbitration_InputSchema: z.ZodObject<{
|
|
|
335
335
|
no_auto_register: z.ZodOptional<z.ZodBoolean>;
|
|
336
336
|
confirmed: z.ZodOptional<z.ZodBoolean>;
|
|
337
337
|
user_intent_phrases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
338
|
-
|
|
338
|
+
plan_approval: z.ZodOptional<z.ZodString>;
|
|
339
339
|
client_schema_version: z.ZodOptional<z.ZodString>;
|
|
340
340
|
schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
341
341
|
dry_run: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -79,7 +79,7 @@ export declare const CallEnvSchema: z.ZodObject<{
|
|
|
79
79
|
no_auto_register: z.ZodOptional<z.ZodBoolean>;
|
|
80
80
|
confirmed: z.ZodOptional<z.ZodBoolean>;
|
|
81
81
|
user_intent_phrases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
-
|
|
82
|
+
plan_approval: z.ZodOptional<z.ZodString>;
|
|
83
83
|
client_schema_version: z.ZodOptional<z.ZodString>;
|
|
84
84
|
schema_strict_mode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
85
85
|
dry_run: z.ZodOptional<z.ZodBoolean>;
|