@wowok/agent-mcp 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication/evidence.d.ts +6 -0
- package/dist/communication/evidence.js +1 -0
- package/dist/evaluation/acceptance.d.ts +24 -0
- package/dist/evaluation/acceptance.js +1 -0
- package/dist/evaluation/builtins/demand-match.d.ts +3 -2
- package/dist/evaluation/builtins/demand-match.js +1 -1
- package/dist/evaluation/builtins/service-risk.d.ts +2 -1
- package/dist/evaluation/builtins/service-risk.js +1 -1
- package/dist/evaluation/index.d.ts +1 -0
- package/dist/evaluation/index.js +1 -1
- package/dist/evaluation/match-operation.d.ts +14 -0
- package/dist/evaluation/match-operation.js +1 -0
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/goal/GoalClassifier.js +1 -1
- package/dist/goal/GoalEngine.d.ts +8 -0
- package/dist/goal/GoalEngine.js +1 -1
- package/dist/goal/types.d.ts +1 -1
- package/dist/harness/auto-escalation.d.ts +0 -12
- package/dist/harness/auto-escalation.js +1 -1
- package/dist/harness/index.d.ts +1 -14
- package/dist/harness/index.js +1 -1
- package/dist/harness/types.d.ts +0 -38
- package/dist/intent/types.d.ts +1 -1
- package/dist/intent/types.js +1 -1
- package/dist/keeper/KeeperScan.d.ts +39 -0
- package/dist/keeper/KeeperScan.js +1 -0
- package/dist/keeper/KeeperStore.d.ts +43 -0
- package/dist/keeper/KeeperStore.js +1 -0
- package/dist/keeper/detectors.d.ts +23 -0
- package/dist/keeper/detectors.js +1 -0
- package/dist/keeper/keeper.spec.d.ts +1 -0
- package/dist/keeper/keeper.spec.js +1 -0
- package/dist/keeper/types.d.ts +65 -0
- package/dist/keeper/types.js +1 -0
- package/dist/knowledge/demand-risk.js +1 -1
- package/dist/knowledge/event-semantics.d.ts +3 -0
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/event-semantics.spec.d.ts +1 -0
- package/dist/knowledge/event-semantics.spec.js +1 -0
- package/dist/knowledge/evidence-review.d.ts +23 -0
- package/dist/knowledge/evidence-review.js +1 -1
- package/dist/knowledge/examples-scanner-cli.js +1 -1
- package/dist/knowledge/examples-scanner.js +1 -1
- package/dist/knowledge/guard-bytecode-spec.d.ts +82 -0
- package/dist/knowledge/guard-bytecode-spec.js +1 -0
- package/dist/knowledge/guard-design-patterns.d.ts +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/index.d.ts +10 -6
- 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/migration-preflight.d.ts +27 -0
- package/dist/knowledge/migration-preflight.js +1 -0
- package/dist/knowledge/scenario-modes.d.ts +1 -1
- package/dist/knowledge/scenario-modes.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 +20 -0
- package/dist/knowledge/workflow-guidance.js +1 -1
- package/dist/monitor/MonitorLoop.d.ts +1 -0
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/monitor/ScopeResolver.js +1 -1
- package/dist/monitor/SuggestionBridge.d.ts +1 -1
- package/dist/monitor/SuggestionBridge.js +1 -1
- package/dist/monitor/SuggestionBridge.spec.d.ts +1 -0
- package/dist/monitor/SuggestionBridge.spec.js +1 -0
- package/dist/monitor/normalize.js +1 -1
- package/dist/monitor/types.d.ts +0 -1
- package/dist/monitor/types.js +1 -1
- package/dist/participation/employee-kpi.d.ts +12 -0
- package/dist/participation/employee-kpi.js +1 -1
- package/dist/participation/employee-kpi.spec.d.ts +1 -0
- package/dist/participation/employee-kpi.spec.js +1 -0
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/mode-actions.d.ts +19 -6
- package/dist/playbooks/service-build/mode-actions.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/relationship/derivation.d.ts +6 -0
- package/dist/relationship/derivation.js +1 -1
- package/dist/relationship/derivation.spec.d.ts +1 -0
- package/dist/relationship/derivation.spec.js +1 -0
- package/dist/role/index.d.ts +2 -2
- package/dist/role/index.js +1 -1
- package/dist/role/model.d.ts +2 -1
- package/dist/role/model.js +1 -1
- package/dist/role/types.d.ts +5 -0
- package/dist/rules.d.ts +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/employee/index.d.ts +61 -1
- package/dist/schema/employee/index.js +1 -1
- package/dist/schema/evaluation/index.d.ts +70 -5
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +43 -7
- package/dist/schema/industry-pack/modes.d.ts +42 -6
- package/dist/schema/industry-pack/modes.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +3 -0
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/keeper/index.d.ts +475 -0
- package/dist/schema/keeper/index.js +1 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +2 -0
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +34 -0
- package/dist/schema/query/bi.d.ts +188 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +48 -48
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-query/index.d.ts +2 -11
- package/dist/schema/schema-query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/utils/skills-recommendation.js +1 -1
- package/dist/schema/watch/index.d.ts +4 -0
- package/dist/schema/watch/index.js +1 -1
- package/dist/schema-query-impl/index.d.ts +33 -14
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/employee_operation.output.json +100 -0
- package/dist/schemas/employee_operation.schema.json +148 -5
- package/dist/schemas/evaluation_operation.output.json +135 -9
- package/dist/schemas/evaluation_operation.schema.json +176 -7
- package/dist/schemas/index.json +7 -1
- package/dist/schemas/industry_pack_operation.output.json +158 -32
- package/dist/schemas/intent_radar.output.json +2 -0
- package/dist/schemas/intent_radar.schema.json +1 -0
- package/dist/schemas/keeper_operation.output.json +1274 -0
- package/dist/schemas/keeper_operation.schema.json +359 -0
- package/dist/schemas/messenger_operation.schema.json +8 -0
- package/dist/schemas/onchain_events.output.json +55 -11
- package/dist/schemas/onchain_events.schema.json +4 -0
- package/dist/schemas/onchain_table_data.output.json +59 -0
- package/dist/schemas/query_toolkit.output.json +428 -0
- package/dist/schemas/query_toolkit.schema.json +59 -0
- package/dist/schemas/schema_query.output.json +1 -64
- package/dist/schemas/schema_query.schema.json +18 -3
- package/dist/schemas/watch_operation.output.json +21 -1
- package/dist/task/playbook.js +1 -1
- package/dist/task/types.d.ts +1 -1
- package/dist/tools/handlers/bridge.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/employee.d.ts +6 -0
- package/dist/tools/handlers/employee.js +1 -1
- package/dist/tools/handlers/employee.spec.d.ts +1 -0
- package/dist/tools/handlers/employee.spec.js +1 -0
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/evaluation.spec.d.ts +1 -0
- package/dist/tools/handlers/evaluation.spec.js +1 -0
- package/dist/tools/handlers/intent-radar.js +1 -1
- package/dist/tools/handlers/keeper.d.ts +12 -0
- package/dist/tools/handlers/keeper.js +1 -0
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/schema-query.js +1 -1
- package/dist/tools/handlers/watch.js +1 -1
- package/dist/tools/handlers/workflow.js +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/registry/agent.d.ts +2 -0
- package/dist/tools/registry/agent.js +1 -0
- package/dist/tools/registry/bridge.d.ts +2 -0
- package/dist/tools/registry/bridge.js +1 -0
- package/dist/tools/registry/business.d.ts +2 -0
- package/dist/tools/registry/business.js +1 -0
- package/dist/tools/registry/config.d.ts +2 -0
- package/dist/tools/registry/config.js +1 -0
- package/dist/tools/registry/files.d.ts +2 -0
- package/dist/tools/registry/files.js +1 -0
- package/dist/tools/registry/identity.d.ts +2 -0
- package/dist/tools/registry/identity.js +1 -0
- package/dist/tools/registry/local.d.ts +2 -0
- package/dist/tools/registry/local.js +1 -0
- package/dist/tools/registry/messenger.d.ts +2 -0
- package/dist/tools/registry/messenger.js +1 -0
- package/dist/tools/registry/monitor.d.ts +2 -0
- package/dist/tools/registry/monitor.js +1 -0
- package/dist/tools/registry/onchain.d.ts +2 -0
- package/dist/tools/registry/onchain.js +1 -0
- package/dist/tools/registry/query.d.ts +2 -0
- package/dist/tools/registry/query.js +1 -0
- package/dist/tools/registry/trust.d.ts +2 -0
- package/dist/tools/registry/trust.js +1 -0
- package/dist/tools/shared.js +1 -1
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
- package/dist/examples/arbitration-dispute-create.json +0 -41
- package/dist/examples/arbitration-vote-weighted.json +0 -35
- package/dist/examples/arbitration-voting-guard-add.json +0 -38
- package/dist/examples/demand-present-service.json +0 -33
- package/dist/examples/education-contact-create.json +0 -40
- package/dist/examples/freelance-contact-create.json +0 -40
- package/dist/examples/gen-passport-verify-guard.json +0 -48
- package/dist/examples/guard-template-balance-check.json +0 -59
- package/dist/examples/guard-template-time-lock.json +0 -60
- package/dist/examples/insurance-guard-claim-timelock.json +0 -75
- package/dist/examples/insurance-guard-withdraw-allocation.json +0 -96
- package/dist/examples/insurance-machine-create.json +0 -75
- package/dist/examples/insurance-service-allocators.json +0 -55
- package/dist/examples/machine-multisig-threshold.json +0 -87
- package/dist/examples/machine-publish.json +0 -30
- package/dist/examples/machine-template-7node-rental.json +0 -119
- package/dist/examples/payment-scenario-bound.json +0 -45
- package/dist/examples/rental-ziroom-machine-create.json +0 -148
- package/dist/examples/rental-ziroom-permission-create.json +0 -41
- package/dist/examples/rental-ziroom-service-create.json +0 -36
- package/dist/examples/retail-adv-guard-customer-win-create.json +0 -80
- package/dist/examples/retail-adv-guard-messenger-proof-create.json +0 -65
- package/dist/examples/retail-adv-guard-reward-timeout-create.json +0 -92
- package/dist/examples/retail-adv-reward-guard-add.json +0 -51
- package/dist/examples/retail-myshop-allocation-activate.json +0 -55
- package/dist/examples/retail-myshop-arbitration-create.json +0 -40
- package/dist/examples/retail-myshop-contact-create.json +0 -43
- package/dist/examples/retail-myshop-order-create.json +0 -56
- package/dist/examples/retail-myshop-progress-operate.json +0 -38
- package/dist/examples/retail-myshop-reward-create.json +0 -35
- package/dist/examples/retail-myshop-service-create.json +0 -38
- package/dist/examples/retail-myshop-service-customer-required.json +0 -31
- package/dist/examples/service-discount-issue.json +0 -46
- package/dist/examples/subscription-contact-create.json +0 -40
- package/dist/examples/threebody-guard-create.json +0 -56
- package/dist/examples/threebody-machine-create.json +0 -71
- package/dist/examples/threebody-permission-create.json +0 -38
- package/dist/examples/threebody-service-allocators.json +0 -48
- package/dist/examples/travel-guard-time-lock.json +0 -69
- package/dist/examples/travel-guard-weather-oracle.json +0 -70
- package/dist/examples/travel-machine-create.json +0 -135
- package/dist/examples/travel-repository-create.json +0 -47
- package/dist/examples/travel-service-create.json +0 -34
- package/dist/examples/travel-treasury-create.json +0 -34
- package/dist/examples/treasury-deposit.json +0 -37
- package/dist/examples/treasury-withdraw.json +0 -38
- package/dist/harness/plan.d.ts +0 -33
- package/dist/harness/plan.js +0 -1
- package/dist/knowledge/demand-matching.d.ts +0 -29
- package/dist/knowledge/demand-matching.js +0 -1
- package/dist/knowledge/guard-context.d.ts +0 -56
- package/dist/knowledge/guard-context.js +0 -1
- package/dist/knowledge/guard-migration.d.ts +0 -48
- package/dist/knowledge/guard-migration.js +0 -1
- package/dist/schemas/guard-node-schema.json +0 -1000
- package/dist/task/stage-gate.d.ts +0 -22
- package/dist/task/stage-gate.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{handleWatchOperation}from'../handlers/watch.js';import{handlePersonaOperation}from'../handlers/persona.js';import{createToolMeta,WatchOperationInputSchema,WatchOperationOutputSchema,PersonaOperationInputSchema,PersonaOperationOutputSchema}from'../../schema/index.js';export const IDENTITY_TOOLS=[{'name':'watch_operation','handler':handleWatchOperation,'config':{'title':'🔭\x20Watch\x20-\x20Identity-Centric\x20On-chain\x20Console','summary':'Resolve\x20who\x20you\x20are\x20against\x20an\x20object,\x20expand\x20its\x20relations,\x20enumerate\x20actions,\x20and\x20reason\x20value→game→path.','description':'Identity-centric\x20on-chain\x20console\x20(K3\x2023).\x20Read-only.\x20Resolves\x20YOUR\x20identity\x20against\x20a\x20focus\x20object\x20(on-chain\x20manifest\x20role\x20⊕\x20persona),\x20then\x20layers\x20its\x20base\x20data,\x20relation\x20expansion,\x20actionable\x20operations,\x20and\x20four-stage\x20reasoning.\x0a\x0a'+'Actions:\x0a'+'\x20\x20•\x20focus\x20—\x20resolve\x20who\x20the\x20active\x20account\x20is\x20relative\x20to\x20a\x20focus\x20object\x20(order\x20holder\x20/\x20demander\x20/\x20merchant\x20/\x20supplier\x20/\x20collaborator\x20/\x20arbitrator\x20/\x20neutral)\x20+\x20its\x20base\x20data.\x20The\x20resolved\x20identity\x20decides\x20the\x20reasoning\x20direction:\x20neutral\x20→\x20objective\x20narration\x20only;\x20operative\x20role\x20→\x20game/path\x20reasoning.\x0a'+'\x20\x20•\x20expand\x20—\x20enumerate\x20direct\x20relations\x20out\x20of\x20the\x20focus\x20object\x20(machine\x20/\x20permission\x20/\x20arbitration\x20/\x20order\x20/\x20reward\x20/\x20repository\x20/\x20buy_guard\x20…),\x20plus\x20the\x20transparent\x20sub-order\x20purchasing\x20graph\x20for\x20a\x20Service\x20(frozen\x20forward\x20guards\x20→\x20purchased\x20sub-services\x20+\x20required\x20proofs).\x0a'+'\x20\x20•\x20actions\x20—\x20enumerate\x20actionable\x20on-chain\x20operations\x20for\x20the\x20active\x20account\x20on\x20the\x20focus\x20object\x20(e.g.\x20progress_next\x20per\x20forward\x20with\x20executability\x20judgment\x20via\x20order-holder\x20/\x20permission-index\x20/\x20named-operator\x20paths).\x0a'+'\x20\x20•\x20reason\x20—\x20four-stage\x20reasoning\x20(identity\x20→\x20value\x20→\x20game\x20→\x20path)\x20for\x20the\x20account.\x20neutral/system\x20→\x20objective\x20narration\x20only\x20(no\x20recommendation);\x20operative\x20role\x20→\x20value\x20perspective\x20+\x20interest\x20anchors,\x20game\x20power\x20+\x20strategy,\x20and\x20the\x20actionable\x20path.\x0a\x0a'+'🔭\x20Tool\x20selection\x20(avoid\x20confusion):\x20query_toolkit\x20/\x20onchain_table_data\x20=\x20PURE\x20DATA\x20queries\x20(\x22what\x20data\x20is\x20here?\x22,\x20no\x20identity).\x20watch_operation\x20=\x20IDENTITY-CENTERED\x20orchestration\x20(\x22who\x20am\x20I\x20relative\x20to\x20this\x20object,\x20what\x20is\x20it\x20related\x20to,\x20and\x20what\x20can\x20I\x20do?\x22).\x20For\x20a\x20raw\x20object\x20or\x20the\x20address\x27s\x20objective\x20profile,\x20use\x20query_toolkit\x20(incl.\x20query_type=\x22address_profile\x22);\x20for\x20identity\x20+\x20relations\x20+\x20operations\x20+\x20reasoning,\x20use\x20watch_operation.\x0a\x0a'+'Read-only:\x20never\x20mutates\x20chain\x20state.\x20The\x20caller\x20decides\x20and\x20acts\x20via\x20onchain_operations.\x0a\x0a'+'💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27watch_operation\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema.','inputSchema':WatchOperationInputSchema,'outputSchema':WatchOperationOutputSchema,'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':![]},'_meta':createToolMeta('watch',['watch','identity','role','relation','operation','console','focus','expand','actions','reason','game','value','path'])}},{'name':'persona_operation','handler':handlePersonaOperation,'config':{'title':'👤\x20Persona\x20-\x20User\x20Identity\x20Setting','summary':'User\x20identity\x20setting\x20(preferences,\x20strategy,\x20spec;\x20long-term\x20+\x20current).','description':'Read/write\x20the\x20user\x27s\x20systematic\x20identity\x20setting\x20(persona):\x20preferences,\x20'+'competitive\x20strategy,\x20experience\x20rules,\x20self\x20profile,\x20and\x20spec.\x0a\x0a'+'LAYERS:\x20long_term\x20=\x20STABLE\x20identity\x20(USER-DRIVEN\x20only\x20—\x20never\x20auto-rewrite).\x20'+'current\x20=\x20transient\x20context\x20(SMART-UPDATABLE\x20—\x20AI\x20may\x20merge/replace\x20from\x20'+'conversation\x20experience\x20or\x20account\x20behavior).\x20Scope:\x20system\x20(all\x20accounts,\x20'+'be\x20conservative)\x20or\x20account\x20(one\x20chain\x20address,\x20higher\x20priority).\x0a\x0a'+'Actions:\x0a'+'\x20\x20•\x20get\x20—\x20resolve\x20the\x20priority-merged\x20effective\x20persona\x20(+\x20injection\x20+\x20context\x20text).\x0a'+'\x20\x20•\x20list\x20—\x20list\x20stored\x20personas\x20and\x20built-in\x20industry\x20defaults.\x0a'+'\x20\x20•\x20set\x20—\x20user-driven\x20write/update\x20of\x20any\x20layer\x20(≤300\x20lines\x20enforced).\x0a'+'\x20\x20•\x20analyze\x20—\x20extract\x20identity\x20signals\x20from\x20free-form\x20context\x20(website\x20/\x20experience\x20summary).\x0a'+'\x20\x20•\x20apply\x20—\x20merge/replace\x20analyzed\x20signals\x20into\x20the\x20CURRENT\x20layer\x20only.\x0a'+'\x20\x20•\x20sync\x20—\x20merge\x20account\x20behavior\x20(experience\x20layer)\x20into\x20the\x20CURRENT\x20layer.\x0a'+'\x20\x20•\x20remove\x20—\x20delete\x20a\x20persona\x20(fall\x20back\x20to\x20defaults).\x0a'+'\x20\x20•\x20strategy\x20—\x20resolve\x20a\x20merchant\x27s\x20strategy\x20statements\x20into\x20structured\x20StrategyIntents\x20+\x20deterministic\x20infrastructure-lever\x20suggestions\x20(discount\x20/\x20reward\x20/\x20buy_guard\x20/\x20machine_design).\x20Producer-only;\x20other\x20roles\x20get\x20an\x20explanatory\x20note.\x0a'+'\x20\x20•\x20region_hint\x20—\x20read\x20the\x20locally-stored\x20delivery\x20address\x20as\x20a\x20region-matching\x20hint;\x20or\x20(with\x20`propose`)\x20build\x20a\x20CONSENT-GATED\x20save\x20proposal\x20—\x20never\x20auto-writes\x20private\x20data.\x0a'+'\x20\x20•\x20distill\x20—\x20turn\x20one\x20goal\x27s\x20memory\x20(outcome,\x20TaskProcess\x20problems/feedback,\x20registered\x20objects)\x20into\x20a\x20CURRENT-layer\x20PROPOSAL\x20(+\x20evidence\x20+\x20summary).\x20Never\x20auto-writes:\x20persist\x20via\x20set/apply\x20after\x20the\x20user\x20confirms.\x20Industry\x20pack.json\x20files\x20stay\x20read-only\x20knowledge.\x0a\x0a'+'Read/write\x20local\x20state\x20only;\x20never\x20mutates\x20chain\x20state.\x0a\x0a'+'💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27persona_operation\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema.','inputSchema':PersonaOperationInputSchema,'outputSchema':PersonaOperationOutputSchema,'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':![]},'_meta':createToolMeta('persona',['persona','profile','identity','preference','strategy','spec','portrait'])}}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{handleAccountOperation,handleMarkOperation,handleInfoOperation}from'../handlers/local.js';import{statusErrorShape}from'../wrap.js';import{createToolMeta,AccountOperationSchema,LocalMarkOperationSchema,LocalInfoOperationSchema,AccountOperationOutputWrappedSchema,LocalMarkOperationOutputWrappedSchema,LocalInfoOperationOutputWrappedSchema}from'../../schema/index.js';export const LOCAL_TOOLS=[{'name':'account_operation','handler':handleAccountOperation,'config':{'title':'Account\x20-\x20Wallet\x20Management\x20&\x20Token\x20Transfer','summary':'Wallet\x20management\x20(local)\x20+\x20token\x20transfer\x20(on-chain,\x20confirmed).','description':'Manage\x20WoWok\x20accounts\x20locally:\x20generate,\x20suspend,\x20resume,\x20faucet-test,\x20sign\x20data,\x20etc.\x0a\x0a💰\x20TRANSFER\x20(on-chain\x20fund\x20movement):\x20the\x20`transfer`\x20sub-op\x20moves\x20tokens\x20on-chain\x20and\x20is\x20IRREVERSIBLE.\x20Amounts\x20accept\x20display\x20format\x20with\x20symbol\x20(\x222.5WOW\x22)\x20—\x20converted\x20with\x20the\x20token\x27s\x20decimals\x20—\x20or\x20raw\x20smallest-unit\x20integers;\x20bare\x20decimals\x20are\x20rejected.\x20The\x20first\x20call\x20returns\x20a\x20pending_confirmation\x20preview\x20(amount,\x20token\x20full\x20type,\x20recipient);\x20re-call\x20with\x20transfer.confirmed=true\x20after\x20user\x20consent\x20to\x20execute.\x0a\x0a💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27account_operation\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema\x20before\x20calling.','inputSchema':AccountOperationSchema,'outputSchema':AccountOperationOutputWrappedSchema,'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':!![],'openWorldHint':![]},'_meta':createToolMeta('operation',['account','local','private','wallet','transfer','fund'])},'errorShapeBuilder':statusErrorShape},{'name':'local_mark_operation','handler':handleMarkOperation,'config':{'title':'🔒\x20LOCAL\x20ONLY:\x20LocalMark\x20-\x20Address\x20Book\x20Management','summary':'LOCAL\x20address\x20book\x20(name/tag\x20for\x20addresses\x20and\x20object\x20IDs).','description':'100%\x20LOCAL,\x20NEVER\x20ON-CHAIN\x20🔒\x20Manage\x20ID\x20names\x20and\x20tags\x20stored\x20ONLY\x20on\x20your\x20local\x20device\x20for\x20easy\x20identification\x20of\x20user\x20address\x20or\x20object\x20IDs\x20by\x20name.\x0a\x0a💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27local_mark_operation\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema\x20before\x20calling.','inputSchema':LocalMarkOperationSchema,'outputSchema':LocalMarkOperationOutputWrappedSchema,'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':!![],'openWorldHint':![]},'_meta':createToolMeta('operation',['mark','local','private','address-book','off-chain'])},'errorShapeBuilder':statusErrorShape},{'name':'local_info_operation','handler':handleInfoOperation,'config':{'title':'🔒\x20LOCAL\x20ONLY:\x20LocalInfo\x20-\x20Private\x20Data\x20Management','summary':'LOCAL\x20private\x20data\x20(delivery\x20addresses,\x20phone\x20numbers).','description':'100%\x20LOCAL,\x20NEVER\x20ON-CHAIN\x20🔒\x20Manage\x20sensitive\x20personal\x20information\x20stored\x20ONLY\x20on\x20your\x20device:\x20delivery\x20addresses,\x20phone\x20numbers,\x20contacts.\x0a\x0a💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27local_info_operation\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema\x20before\x20calling.','inputSchema':LocalInfoOperationSchema,'outputSchema':LocalInfoOperationOutputWrappedSchema,'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':!![],'openWorldHint':![]},'_meta':createToolMeta('operation',['info','local','private','data-management','off-chain'])},'errorShapeBuilder':statusErrorShape}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{handleMessengerOperation}from'../handlers/messenger.js';import{operationErrorShape}from'../wrap.js';import{createToolMeta,MessengerOperationInputSchema,MessengerOperationOutputSchema}from'../../schema/index.js';export const MESSENGER_TOOLS=[{'name':'messenger_operation','handler':handleMessengerOperation,'config':{'title':'💬\x20Messenger\x20Operations','summary':'End-to-end\x20encrypted\x20messaging\x20(send/watch/WTS/blacklist).','description':'WoWok\x20encrypted\x20messenger\x20operations:\x20watch\x20conversations\x20(with\x20unread\x20filtering,\x20preview\x20messages),\x20send\x20message,\x20send\x20file,\x20watch\x20messages\x20(with\x20viewed\x20status\x20filtering),\x20extract\x20zip\x20messages,\x20generate\x20WTS,\x20verify\x20WTS,\x20sign\x20WTS,\x20WTS\x20to\x20HTML,\x20proof\x20message\x20on-chain,\x20manage\x20blacklist,\x20friendslist,\x20guardlist,\x20settings,\x20mark\x20messages\x20as\x20viewed,\x20mark\x20conversation\x20as\x20viewed,\x20and\x20pull\x20messages\x20from\x20server.\x0a\x0a💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27messenger_operation\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema\x20before\x20calling.','inputSchema':MessengerOperationInputSchema,'outputSchema':MessengerOperationOutputSchema,'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':![],'openWorldHint':!![]},'_meta':createToolMeta('operation',['messenger','message','file','wts','blacklist','friendslist','guardlist','settings','proof','communication'])},'errorShapeBuilder':operationErrorShape,'timeoutMs':0x7530}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{handleMonitorEvents,handleMonitorSubscription}from'../handlers/monitor.js';import{handleKeeperOperation}from'../handlers/keeper.js';import{createToolMeta,MonitorEventsInputSchema,MonitorEventsResultSchema,MonitorSubscriptionInputSchema,MonitorSubscriptionResultSchema,KeeperOperationInputSchema,KeeperOperationOutputSchema}from'../../schema/index.js';export const MONITOR_TOOLS=[{'name':'monitor_events','handler':handleMonitorEvents,'config':{'title':'🔔\x20Monitor\x20Events\x20-\x20Persistent\x20Store\x20&\x20Read\x20State','summary':'Persistent\x20monitor\x20event\x20store:\x20paginated\x20events\x20with\x20read\x20flags;\x20mark\x20read/unread.','description':'Query\x20and\x20manage\x20the\x20PERSISTENT\x20monitor\x20event\x20store\x20—\x20the\x20same\x20store\x20the\x20client\x20UI\x27s\x20'+'Monitor\x20page\x20reads.\x20Events\x20are\x20captured\x20by\x20the\x20resident\x20MonitorLoop\x20(client\x20sidecar,\x20'+'or\x20the\x20stdio\x20MCP\x20server\x20when\x20MONITOR_LOOP=1)\x20across\x209\x20modules\x20(order\x20/\x20arb\x20/\x20demand\x20/\x20'+'progress\x20/\x20treasury\x20/\x20reward\x20/\x20service\x20/\x20entity\x20/\x20payment),\x20stored\x20APPEND-ONLY\x20per\x20'+'event\x20(no\x20ring\x20buffer,\x20survives\x20restarts),\x20and\x20carry\x20a\x20per-event\x20read\x20flag\x20persisted\x20in\x20SQLite.\x0a\x0a'+'Actions\x20(action):\x0a'+'\x20\x20•\x20query\x20—\x20paginated\x20events,\x20newest\x20first.\x20Returns\x20events[]\x20(id,\x20module,\x20type,\x20time,\x20seen,\x20event),\x20'+'total,\x20module_counts,\x20unread_by_module,\x20total_unread.\x20Filter\x20with\x20module/event_type/since/until;\x20'+'paginate\x20with\x20limit/offset.\x20relevant_only\x20(default\x20TRUE)\x20restricts\x20to\x20events\x20that\x20hit\x20your\x20scope\x20'+'closure/focus/filters\x20(the\x20de-noised\x20agent\x20todo\x20stream);\x20pass\x20false\x20for\x20the\x20full\x20firehose.\x20'+'with_reason\x20attaches\x20each\x20event\x27s\x20relevance\x20annotation\x20(why\x20it\x20concerns\x20you)\x20+\x20a\x20delivered\x20flag.\x0a'+'\x20\x20•\x20mark_read\x20—\x20mark\x20event_ids\x20(format\x20\x27<eventSeq>:<txDigest>\x27)\x20as\x20read.\x20Idempotent;\x20returns\x20marked\x20count\x20+\x20total_unread.\x0a'+'\x20\x20•\x20mark_all_read\x20—\x20mark\x20ALL\x20stored\x20events\x20read\x20(optionally\x20scoped\x20to\x20module).\x20Returns\x20marked\x20count\x20+\x20total_unread.\x0a\x0a'+'Cross-process\x20note:\x20read\x20state\x20is\x20SHARED\x20with\x20the\x20client\x20app\x20(same\x20SQLite\x20store)\x20—\x20marking\x20'+'events\x20read\x20here\x20clears\x20the\x20client\x27s\x20Monitor\x20unread\x20badge\x20and\x20vice\x20versa.\x20Configure\x20the\x20'+'scope/filters\x20behind\x20relevant_only\x20via\x20the\x20monitor_subscription\x20tool.\x0a\x0a'+'💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27monitor_events\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema.','inputSchema':MonitorEventsInputSchema,'outputSchema':MonitorEventsResultSchema,'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':![]},'_meta':createToolMeta('monitor',['monitor','events','unread','read','notification','order','arbitration','demand','progress'])}},{'name':'monitor_subscription','handler':handleMonitorSubscription,'config':{'title':'🔔\x20Monitor\x20Subscription\x20-\x20Scope,\x20Filters\x20&\x20Todo-Stream\x20Config','summary':'Monitor\x20subscription\x20config:\x20scope-closure\x20rules,\x20focus\x20objects,\x20per-type\x20switches,\x20conditional\x20filters;\x20scope\x20preview\x20+\x20filter\x20dry-run.','description':'The\x20SINGLE\x20entry\x20point\x20for\x20monitor\x20v4\x20subscription\x20configuration\x20(the\x20client\x20settings\x20'+'panel\x20and\x20agent\x20conversations\x20both\x20use\x20this\x20tool).\x20The\x20config\x20drives\x20three\x20layers:\x20'+'the\x20SCOPE\x20CLOSURE\x20(which\x20objects\x27\x20events\x20are\x20relevant\x20to\x20you:\x20anchor\x20accounts\x20→\x20'+'permissions\x20→\x20managed\x20objects\x20→\x20merchant/buyer\x20orders\x20→\x20order\x20children,\x20plus\x20explicit\x20'+'focus\x20objects),\x20the\x20TODO-STREAM\x20switches\x20(per-event-type\x20delivery\x20on/off),\x20and\x20'+'conditional\x20FILTERS\x20(field-path\x20predicates\x20over\x20event\x20payloads).\x20Event\x20CAPTURE\x20is\x20'+'unaffected\x20by\x20these\x20switches\x20EXCEPT\x20NewPaymentEvent,\x20which\x20is\x20captured\x20only\x20when\x20'+'switched\x20ON\x20here\x20(high-volume\x20fund\x20receipts,\x20opt-in).\x0a\x0a'+'Actions\x20(action):\x0a'+'\x20\x20•\x20get\x20—\x20effective\x20config\x20(defaults\x20merged)\x20+\x20resolved\x20state:\x20scope_version,\x20per-layer\x20'+'closure\x20counts,\x20capture_types,\x20last_poll_at,\x20and\x20this\x20process\x27s\x20MonitorLoop\x20status.\x0a'+'\x20\x20•\x20save\x20—\x20merge\x20a\x20partial\x20config\x20(scope.rules/events/loop\x20merge\x20field-wise;\x20'+'focus_objects/filters\x20REPLACE\x20wholesale;\x20loop\x20params\x20clamped\x20to\x20safe\x20bounds),\x20then\x20'+'trigger\x20an\x20IMMEDIATE\x20scope\x20re-resolve;\x20a\x20scope\x20change\x20schedules\x20a\x20non-blocking\x20'+'re-annotation\x20backfill\x20over\x20loop.backfill_days.\x0a'+'\x20\x20•\x20reset\x20—\x20restore\x20the\x20default\x20config\x20and\x20re-resolve.\x0a'+'\x20\x20•\x20scope_preview\x20—\x20the\x20current\x20scope\x20closure\x20grouped\x20by\x20layer\x20(accounts\x20/\x20permissions\x20/\x20'+'managed_objects\x20/\x20services\x20/\x20orders\x20/\x20order_children\x20/\x20focus),\x20paginated\x20with\x20limit/offset,\x20'+'optionally\x20restricted\x20to\x20one\x20layer\x20via\x20rule.\x20Inspect\x20this\x20BEFORE\x20tuning\x20the\x20rule\x20switches.\x0a'+'\x20\x20•\x20test_filter\x20—\x20dry-run\x20a\x20filter\x20draft\x20over\x20the\x20most\x20recent\x20captured\x20events\x20(sample,\x20'+'default\x20200,\x20max\x201000):\x20returns\x20matched\x20count,\x20scanned\x20count,\x20and\x20up\x20to\x205\x20sample\x20events.\x20'+'Preview\x20a\x20filter\x27s\x20noise/hit\x20rate\x20BEFORE\x20saving\x20it\x20into\x20config.filters.\x0a\x0a'+'💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27monitor_subscription\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema.','inputSchema':MonitorSubscriptionInputSchema,'outputSchema':MonitorSubscriptionResultSchema,'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':![]},'_meta':createToolMeta('monitor',['monitor','subscription','scope','focus','filter','config','todo','relevance'])}},{'name':'keeper_operation','handler':handleKeeperOperation,'config':{'title':'⏰\x20Keeper\x20—\x20Actionable\x20Reminders\x20&\x20Authorized\x20Auto-Execution','summary':'Who-benefits-who-pushes:\x20scans\x20the\x20monitor\x20scope\x20for\x20actionable\x20state\x20(unclaimed\x20funds,\x20advanceable\x20workflow\x20nodes),\x20routes\x20tasks\x20to\x20beneficiaries;\x20per-task\x20dismiss/execute\x20+\x20standing\x20auto-execute\x20rules.','description':'The\x20chain\x20has\x20NO\x20time-triggered\x20execution:\x20a\x20time-locked\x20Guard\x20becoming\x20satisfiable,\x20'+'CoinWrappers\x20waiting\x20to\x20be\x20unwrapped,\x20or\x20a\x20stalled\x20workflow\x20node\x20produce\x20NO\x20events\x20—\x20'+'someone\x20must\x20send\x20a\x20transaction\x20(gas).\x20The\x20keeper\x20is\x20the\x20MCP-side\x20answer,\x20built\x20on\x20one\x20'+'principle:\x20WHO\x20BENEFITS,\x20WHO\x20PUSHES.\x20It\x20scans\x20the\x20monitor\x20scope\x20(accounts/orders\x20resolved\x20'+'by\x20monitor_subscription)\x20on\x20its\x20own\x20cadence\x20inside\x20the\x20MonitorLoop\x20tick,\x20and\x20routes\x20every\x20'+'actionable\x20item\x20to\x20its\x20beneficiary\x20as\x20a\x20KeeperTask.\x0a\x0a'+'Detectors\x20(v1):\x0a'+'\x20\x20•\x20payment_unclaimed\x20—\x20you\x20own\x20unclaimed\x20CoinWrapper(s):\x20funds\x20one\x20\x27payment\x20{receive:true}\x27\x20'+'away\x20from\x20your\x20wallet.\x20Keeper-executable\x20and\x20auto-executable\x20(claim-to-self:\x20funds\x20only\x20ever\x20'+'move\x20INTO\x20your\x20own\x20wallet).\x0a'+'\x20\x20•\x20progress_actionable\x20—\x20an\x20in-scope\x20order\x27s\x20workflow\x20has\x20a\x20forward\x20YOU\x20can\x20execute\x20from\x20the\x20'+'current\x20node\x20(session-aware;\x20guard/permission/named-operator\x20judged\x20on-chain).\x20Reminder-only:\x20'+'advancing\x20may\x20release\x20funds\x20to\x20a\x20counterparty,\x20so\x20execution\x20stays\x20with\x20you\x20via\x20workflow_operation.\x0a\x0a'+'Actions\x20(action):\x0a'+'\x20\x20•\x20tasks\x20—\x20list\x20reminders\x20(pending\x20first).\x20Filter\x20by\x20status/detector/beneficiary;\x20paginate.\x0a'+'\x20\x20•\x20dismiss\x20—\x20record\x20\x27I\x20won\x27t\x20act\x20on\x20this\x27.\x20A\x20dismissed\x20task\x20re-opens\x20ONLY\x20when\x20the\x20underlying\x20'+'state\x20materially\x20changes\x20(new\x20funds\x20arrived,\x20a\x20new\x20forward\x20opened)\x20—\x20never\x20for\x20the\x20identical\x20state.\x0a'+'\x20\x20•\x20execute\x20—\x20act\x20NOW\x20on\x20one\x20keeper-executable\x20task\x20as\x20its\x20beneficiary.\x20This\x20explicit\x20call\x20IS\x20the\x20'+'user\x20decision\x20(no\x20rule\x20needed).\x20Signing\x20stays\x20in\x20the\x20existing\x20on-chain\x20pipeline\x20(env.account\x20=\x20'+'beneficiary);\x20the\x20keeper\x20never\x20touches\x20keys.\x0a'+'\x20\x20•\x20rules\x20/\x20rule_set\x20/\x20rule_remove\x20—\x20standing\x20AUTO-EXECUTE\x20authorizations\x20(用户授权的自动决策).\x20'+'Nothing\x20auto-executes\x20without\x20an\x20enabled\x20rule;\x20v1\x20restricts\x20auto-execution\x20to\x20payment_unclaimed.\x20'+'Every\x20auto-exec\x20stamps\x20the\x20rule\x20id\x20into\x20the\x20task\x27s\x20resolution\x20audit;\x20failed\x20attempts\x20cool\x20down\x20'+'(no\x20gas-burn\x20retry\x20loops);\x20per-scan\x20auto-exec\x20is\x20capped.\x0a'+'\x20\x20•\x20config\x20/\x20config_set\x20—\x20master\x20switch,\x20per-detector\x20switches,\x20scan\x20cadence\x20(default\x202min),\x20'+'scan\x20bounds,\x20auto-exec\x20gas\x20guard\x20and\x20failure\x20cooldown.\x0a'+'\x20\x20•\x20scan\x20—\x20force\x20a\x20scan\x20now\x20(cadence\x20gate\x20bypassed).\x20Requires\x20a\x20resolved\x20monitor\x20scope.\x0a'+'\x20\x20•\x20status\x20—\x20last\x20scan\x20time,\x20next\x20due,\x20pending\x20counts\x20per\x20detector.\x0a\x0a'+'💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27keeper_operation\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema.','inputSchema':KeeperOperationInputSchema,'outputSchema':KeeperOperationOutputSchema,'annotations':{'readOnlyHint':![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':![]},'_meta':createToolMeta('monitor',['keeper','reminder','todo','auto-execute','rule','unclaimed','payment','workflow','task'])}}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{handleOnchainOperations}from'../handlers/onchain.js';import{applyOnchainRules}from'../rules-hook.js';import{createToolMeta,OnchainOperationsSchema,CallOutputSchema}from'../../schema/index.js';export const ONCHAIN_TOOLS=[{'name':'onchain_operations','handler':handleOnchainOperations,'config':{'title':'⛓️\x20On-chain\x20Operations','summary':'On-chain\x20ops:\x20service,\x20machine,\x20progress,\x20repository,\x20arbitration,\x20etc.','description':'On-chain\x20operations\x20for\x20WoWok\x20object:\x20service\x20(marketplace\x20listings),\x20machine\x20(workflow\x20templates),\x20progress\x20(order\x20tracking),\x20repository\x20(on-chain\x20database),\x20arbitration\x20(dispute\x20resolution),\x20contact\x20(IM\x20management),\x20treasury\x20(team\x20funds),\x20reward\x20(incentive\x20pools),\x20allocation\x20(auto-distribution),\x20permission\x20(access\x20control),\x20guard\x20(programmable\x20trust\x20rules),\x20personal\x20(public\x20profile),\x20payment\x20(direct\x20coin\x20transfers),\x20demand\x20(service\x20requests),\x20order\x20(order\x20management),\x20gen_passport\x20(verified\x20credentials),\x20proof\x20(on-chain\x20proof\x20objects),\x20gen_proof\x20(generate\x20proof\x20shortcut).\x0a\x0a💰\x20FUND\x20SAFETY\x20(service/arbitration/treasury/reward/allocation/payment):\x20amounts\x20are\x20parsed\x20against\x20the\x20target\x20object\x27s\x20IMMUTABLE\x20generic\x20token\x20type\x20(e.g.\x20Treasury<USDT>\x20accepts\x20ONLY\x20USDT\x20—\x20mismatched\x20coins/token_types\x20are\x20BLOCKED\x20before\x20execution).\x20Monetary\x20input\x20with\x20unresolvable\x20token\x20precision\x20is\x20BLOCKED\x20(never\x20guesses\x20decimals)\x20with\x20known-token\x20suggestions;\x20retry\x20once\x20the\x20token\x20info\x20resolves.\x20Display-format\x20amounts\x20like\x20\x222WOW\x22\x20are\x20converted\x20to\x20raw\x20u64\x20using\x20the\x20token\x27s\x20own\x20decimals.\x0a\x0a🔒\x20GUARD\x20PRESET\x20BINDINGS:\x20objects\x20declare\x20preset\x20slots\x20where\x20guard\x20submissions\x20gain\x20business\x20meaning\x20—\x20Reward\x20reads\x20claim\x20recipient\x20(address)\x20/\x20amount\x20(u64)\x20/\x20expiration_time\x20(claim\x20deadline;\x20contract\x20asserts\x20clock\x20≤\x20expiration_time);\x20Allocation\x20reads\x20split\x20payee\x20(address)\x20and\x20Rate\x20(basis\x20points,\x20must\x20complete\x2010000\x20unless\x20a\x20Surplus\x20entry\x20exists);\x20Demand\x20reads\x20the\x20presented\x20service\x20(address);\x20Treasury\x20reads\x20deposit/withdraw\x20amounts\x20(number)\x20—\x20external_withdraw\x20is\x20a\x20PAYMENT\x20AUTHORIZATION;\x20Repository\x20reads\x20row\x20key\x20(address)\x20and\x20row\x20data\x20(any\x20type);\x20Arbitration\x20reads\x20vote\x20weight\x20(number)\x20and\x20usage_guard\x20(dispute-opening\x20gate);\x20Machine\x20Forward\x20requires\x20retained_submissions\x20as\x20mandatory\x20evidence.\x20When\x20configuring\x20rewards\x20for\x20staff:\x20consider\x20an\x20owner\x20fund-recovery\x20escape\x20guard\x20(Signer\x20recipient\x20+\x20GuardU64Identifier\x20amount\x20+\x20Clock-based\x20lock)\x20—\x20claim\x20is\x20the\x20ONLY\x20exit\x20from\x20a\x20Reward\x27s\x20balance\x20(owner_receive\x20extracts\x20RECEIVED\x20objects,\x20never\x20the\x20balance).\x20relationship_profile\x20surfaces\x20these\x20creator/user\x20semantics\x20on\x20touched\x20objects.\x0a\x0a🌐\x20SCENARIO\x20TOPOLOGY:\x20object\x20fields\x20that\x20reference\x20other\x20objects\x20are\x20SCENARIO\x20BRIDGES,\x20not\x20data\x20pointers\x20—\x20Demand.present(Service)\x20welds\x20need-expression\x20and\x20product-listing\x20into\x20a\x20matchmaking\x20capability\x20that\x20belongs\x20to\x20neither\x20object\x20alone;\x20Order\x20copies\x20the\x20Service\x27s\x20machine\x20at\x20creation\x20(order\x20keeps\x20its\x20own\x20fulfillment\x20path);\x20Service\x20pre-binds\x20arbitrations\x20+\x20compensation_fund\x20(fairness:\x20E_ARBITRATION_PERMISSION_CONFLICT\x20rejects\x20arbitrations\x20sharing\x20the\x20service\x27s\x20own\x20permission);\x20um\x20binds\x20a\x20Contact\x20per\x20object;\x20permission\x20fields\x20route\x20ALL\x20admin\x20operations\x20through\x20one\x20governance\x20backbone.\x20Whole\x20applications\x20are\x20BRIDGE\x20CHAINS\x20(standard\x20e-commerce:\x20qualification→purchase→communication→fulfillment→escrow_split→incentive;\x20procurement\x20tender:\x20supply_match→…→dispute).\x20relationship_profile\x20auto-surfaces\x20the\x20bridges\x20implied\x20by\x20a\x20topology\x27s\x20touched\x20objects\x20(K3\x2003\x20§3.5).\x0a\x0a⚡\x20MACHINE\x20FORWARD\x20LOCK\x20(threshold\x20design):\x20each\x20forward\x20is\x20SINGLE-OPERATOR-LOCKED\x20—\x20it\x20contributes\x20its\x20weight\x20AT\x20MOST\x20ONCE\x20(progress.move\x20session_accomplish_imp;\x20a\x20second\x20operator\x20re-executing\x20the\x20same\x20accomplished\x20forward\x20aborts\x20E_NOT_THE_HOLDER).\x20A\x20Pair\x27s\x20maximum\x20achievable\x20weight\x20=\x20sum\x20of\x20its\x20DISTINCT\x20forward\x20weights;\x20if\x20that\x20sum\x20<\x20threshold\x20the\x20transition\x20can\x20never\x20migrate\x20(workflow\x20stuck).\x20Multi-operator\x20cooperation\x20(threshold\x20>\x201)\x20MUST\x20use\x20one\x20DISTINCT\x20forward\x20per\x20contributing\x20operator\x20(e.g.\x20threshold\x202\x20→\x20begin_a\x20+\x20begin_b,\x20each\x20weight\x201)\x20—\x20never\x20one\x20forward\x20reused\x20by\x20several\x20people.\x20machine-risk\x20R-M1-12/13\x20and\x20machine-confirm\x20C-12\x20flag\x20such\x20designs\x20before\x20publish.\x0a\x0a💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27onchain_operations\x27\x20to\x20retrieve\x20the\x20complete\x20parameter\x20schema.\x20For\x20individual\x20operation\x20schemas\x20(e.g.,\x20\x27onchain_operations_permission\x27),\x20use\x20schema_query\x20with\x20action=\x27list_operations\x27\x20to\x20see\x20all\x20available\x20operation\x20schemas.','inputSchema':OnchainOperationsSchema,'outputSchema':CallOutputSchema,'annotations':{'readOnlyHint':![],'destructiveHint':!![],'idempotentHint':![],'openWorldHint':!![]},'_meta':createToolMeta('operation',['service','machine','progress','repository','arbitration','contact','treasury','reward','allocation','permission','guard','personal','payment','demand','order','gen_passport','proof','gen_proof','on-chain','blockchain'])},'applyRules':applyOnchainRules}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{handleWatchQueryOperations,handleOnchainTableData,handleOnchainEvents,handleWowokInfo}from'../handlers/query.js';import{handleSchemaQuery}from'../handlers/schema-query.js';import{createToolMeta,WatchQueryOperationsSchema,WatchQueryOperationsResultSchema,OnchainTableDataSchema,OnchainTableDataResultSchema,OnchainEventsInputSchema,OnchainEventsResultSchema,ProtocolInfoQuerySchema,ProtocolInfoResultSchema,SchemaQueryInputSchema,SchemaQueryOutputSchema}from'../../schema/index.js';export const QUERY_TOOLS=[{'name':'query_toolkit','handler':handleWatchQueryOperations,'config':{'title':'🔍\x20Data\x20Query\x20Toolkit','summary':'Query\x20on-chain\x20objects,\x20balances,\x20profiles,\x20history,\x20tokens\x20(19\x20types).','description':'WOWOK\x20data\x20query\x20toolkit\x20—\x2019\x20query\x20types\x20covering\x20local\x20device\x20data\x20and\x20on-chain\x20blockchain\x20data:\x0a\x0a'+'LOCAL\x20(device-only,\x20never\x20on-chain):\x0a'+'1.\x20local_mark_list\x20—\x20Query\x20your\x20LOCAL\x20address\x20book:\x20maps\x20human-readable\x20names\x20to\x20blockchain\x20addresses\x20with\x20optional\x20tags.\x20Use\x20to\x20resolve\x20names→addresses\x20or\x20find\x20addresses\x20by\x20tag.\x0a'+'2.\x20account_list\x20—\x20Query\x20your\x20LOCAL\x20accounts\x20(addresses,\x20messenger\x20status,\x20suspension\x20state).\x20Use\x20filter.includePubkey=true\x20to\x20also\x20include\x20public\x20keys.\x20Use\x20to\x20discover\x20available\x20accounts\x20before\x20operations.\x20NOTE:\x20local\x20accounts\x20are\x20just\x20ONE\x20form\x20of\x20distributed\x20account\x20—\x20WoWok\x20serves\x20ANY\x20account\x20on\x20ANY\x20device;\x20every\x20on-chain/BI\x20query\x20below\x20also\x20accepts\x20any\x200x\x20address\x20(LocalMark\x20names\x20are\x20a\x20convenience,\x20not\x20a\x20requirement).\x0a'+'3.\x20local_info_list\x20—\x20Query\x20your\x20LOCAL\x20private\x20info:\x20sensitive\x20data\x20like\x20delivery\x20addresses,\x20phone\x20numbers,\x20contacts\x20stored\x20ONLY\x20on\x20this\x20device.\x0a'+'4.\x20token_list\x20—\x20Query\x20cached\x20token\x20metadata:\x20symbol,\x20decimals,\x20icon\x20URL,\x20description\x20for\x20tokens\x20previously\x20fetched\x20from\x20chain.\x20Use\x20to\x20look\x20up\x20token\x20precision/decimals\x20before\x20performing\x20token\x20operations.\x20Returns:\x20TokenTypeInfo[]\x20(type,\x20alias,\x20name,\x20symbol,\x20decimals,\x20iconUrl).\x0a'+'5.\x20account_balance\x20—\x20Query\x20an\x20account\x27s\x20coin\x20balance\x20OR\x20Paginated\x20coin\x20objects.\x20Use\x20balance=true\x20for\x20total\x20amount,\x20or\x20coin={cursor,limit}\x20to\x20list\x20individual\x20coin\x20objects.\x20Supports\x20multi-token\x20via\x20token_type\x20parameter.\x20Results\x20include\x20`_money_display`\x20with\x20unit-converted\x20values\x20+\x20decimals\x20reminder.\x0a'+'6.\x20local_names\x20—\x20Query\x20local\x20names\x20by\x20a\x20list\x20of\x20addresses.\x20For\x20each\x20address,\x20returns\x20the\x20resolved\x20account\x20name\x20(if\x20exists)\x20and\x20local\x20mark\x20name\x20(if\x20exists).\x20Returns:\x20{\x20account?,\x20local_mark?,\x20address\x20}[].\x0a\x0a'+'ONCHAIN\x20(blockchain):\x0a'+'7.\x20onchain_personal_profile\x20—\x20Query\x20any\x20user\x27s\x20PUBLIC\x20on-chain\x20profile:\x20social\x20links,\x20reputation\x20(likes/dislikes),\x20personal\x20info\x20records,\x20voting\x20history,\x20referrer.\x0a'+'8.\x20onchain_objects\x20—\x20Batch\x20query\x20on-chain\x20WOWOK\x20objects\x20by\x20ID\x20or\x20name:\x20supports\x20Service,\x20Machine,\x20Order,\x20Treasury,\x20Reward,\x20Arb,\x20Personal,\x20Contact,\x20and\x20more.\x20Monetary\x20fields\x20include\x20`_money_display`\x20annotations\x20(token\x20type\x20from\x20the\x20object\x27s\x20immutable\x20generic).\x0a'+'9.\x20onchain_received\x20—\x20Query\x20objects\x20(Payments,\x20Tokens,\x20NFTs)\x20received\x20by\x20a\x20specific\x20object.\x20Supports\x20pagination\x20and\x20type\x20filter.\x20CoinWrapper\x20mode\x20returns\x20token-aware\x20`_money_display`.\x0a'+'10.\x20onchain_transaction\x20—\x20Verify\x20what\x20a\x20specific\x20transaction\x20did\x20on-chain\x20(status,\x20object\x20changes,\x20balance\x20changes,\x20gas,\x20events).\x20Balance\x20changes\x20include\x20`_money_display`\x20(unit-converted\x20via\x20each\x20change\x27s\x20own\x20coin_type;\x20signed\x20amounts\x20supported).\x0a'+'11.\x20onchain_object_history\x20—\x20FORENSICS:\x20all\x20transactions\x20that\x20touched\x20an\x20object\x20(auditing\x20only\x20—\x20prefer\x20assemble_context\x20for\x20AI\x20context\x20building).\x0a'+'12.\x20onchain_address_activity\x20—\x20FORENSICS:\x20all\x20transactions\x20sent\x20by\x20an\x20address\x20(auditing\x20only).\x0a'+'13.\x20token_value_convert\x20—\x20Convert\x20between\x20raw\x20on-chain\x20smallest\x20units\x20(u64)\x20and\x20human\x20unit\x20values\x20in\x20EITHER\x20direction\x20(e.g.\x20\x222200000000\x22\x20↔\x20\x222.2\x22\x20WOW).\x20Unit→raw\x20is\x20REFUSED\x20when\x20token\x20precision\x20cannot\x20be\x20resolved\x20(never\x20guesses\x20decimals).\x0a'+'14.\x20address_profile\x20—\x20Unified\x20address\x20profile:\x20classifies\x20an\x20address\x20(user\x20/\x20business\x20object\x20/\x20system\x20singleton),\x20then\x20batches\x20identity\x20+\x20reputation\x20(like/dislike/favor)\x20+\x20order/contact\x20membership\x20+\x20core/tx\x20reverse\x20bindings\x20+\x20the\x20object\x20itself.\x20For\x20Service\x20addresses\x20the\x20result\x20merges\x20a\x20service_analysis\x20block\x20(description\x20/\x20payment\x20token\x20/\x20shelf\x20split\x20/\x20location\x20/\x20trust-risk\x20/\x20on-chain\x20last\x20update).\x20The\x20one-stop\x20\x27who/what\x20is\x20this\x20address\x27\x20entry.\x0a'+'15.\x20address_profiles\x20—\x20BATCH\x20form\x20of\x20address_profile\x20(up\x20to\x2050\x20addresses\x20in\x20ONE\x20call):\x20same\x20per-address\x20shape\x20—\x20classification,\x20identity,\x20reputation\x20votes,\x20memberships,\x20reverse\x20bindings,\x20object,\x20activity,\x20role\x20evidence,\x20plus\x20the\x20service_analysis\x20merge\x20for\x20Service\x20addresses.\x20List\x20views\x20needing\x20profiles\x20for\x20many\x20rows\x20should\x20ALWAYS\x20prefer\x20this\x20over\x20N\x20single\x20calls.\x20Returns:\x20(AddressProfile\x20|\x20null)[]\x20(result\x20order\x20matches\x20the\x20request).\x0a'+'16.\x20service_supply_chain\x20—\x20Resolve\x20a\x20Service\x27s\x20transparent\x20sub-order\x20purchasing\x20graph\x20(K3\x2023\x20§3.6):\x20reads\x20the\x20bound\x20Machine\x27s\x20frozen\x20forwards,\x20finds\x20purchasing-commitment\x20Guards,\x20and\x20returns\x20each\x20forward\x27s\x20purchased\x20sub-services\x20+\x20required\x20sub-order\x20proof\x20fields.\x20Use\x20for\x20buyer\x20due-diligence,\x20compose_service,\x20anti_cheat\x20(shell-merchant\x20detection),\x20merchant\x20self-check,\x20or\x20Watch\x20relation\x20expansion.\x0a'+'17.\x20workspace_lists\x20—\x20ONE-CALL\x20Quick\x20Access\x20workspace\x20object\x20lists\x20for\x20an\x20account\x20(treasuries/repositories/contacts/machines/rewards/others)\x20via\x20the\x20permission\x20reverse\x20chain,\x20TTL-cached.\x0a'+'18.\x20marks_of_account\x20—\x20Like/Favor\x20list:\x20every\x20address\x20(object\x20or\x20user)\x20the\x20account\x20ever\x20liked/disliked/favored,\x20deduplicated,\x20with\x20the\x20CURRENT\x20active\x20vote\x20kinds\x20per\x20target\x20(voter\x20Resource\x20mark\x20table\x20+\x20EntityLinker\x20clock),\x20TTL-cached.\x0a'+'19.\x20migration_preflight\x20—\x20Cross-network\x20build\x20detection:\x20report\x20an\x20account\x27s\x20Services/Machines/Treasuries/etc.\x20on\x20a\x20source\x20network\x20(default\x20testnet)\x20vs\x20target\x20network\x20(default\x20mainnet),\x20plus\x20a\x20business-facing\x20checklist\x20of\x20settings\x20to\x20confirm/change\x20when\x20migrating\x20(payment\x20token\x20/\x20location\x20/\x20arbitration\x20/\x20WIP\x20/\x20gas).\x0a\x0a'+'For\x20dynamic\x20table\x20data\x20queries\x20(pagination,\x20table\x20items),\x20use\x20the\x20\x27onchain_table_data\x27\x20tool.\x20For\x20state-transition\x20events,\x20use\x20the\x20\x27onchain_events\x27\x20tool.\x0a\x0a'+'💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27query_toolkit\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema\x20with\x20all\x20query\x20types\x20and\x20field\x20definitions.','inputSchema':WatchQueryOperationsSchema,'outputSchema':WatchQueryOperationsResultSchema,'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':!![]},'_meta':createToolMeta('query',['watch','query','on-chain','local','events','objects','tokens','balance','profile'])}},{'name':'onchain_table_data','handler':handleOnchainTableData,'config':{'title':'📊\x20Query\x20WoWok\x20On-chain\x20Table\x20Data','summary':'Query\x20on-chain\x20dynamic\x20field\x20tables\x20with\x20pagination\x20(table\x20+\x20table-item\x20queries).','description':'Query\x20the\x20dynamic\x20table\x20data\x20of\x20on-chain\x20objects\x20(ONE-TIME\x20query\x20—\x20NOT\x20a\x20realtime\x20subscription).\x20Supports\x20paginated\x20table\x20queries\x20and\x20specific\x20table\x20item\x20lookups.\x20Each\x20table\x20item\x20belongs\x20to\x20a\x20parent\x20object\x20type\x20and\x20has\x20a\x20specific\x20meaning:\x0a\x0a'+'1.\x20onchain_table\x20—\x20Paginated\x20query\x20of\x20ANY\x20object\x27s\x20dynamic\x20fields\x20table\x20(Parent:\x20any\x20object).\x20Returns\x20all\x20entries\x20with\x20keys,\x20types,\x20and\x20object\x20IDs.\x20Use\x20to\x20explore\x20all\x20sub-items\x20of\x20an\x20object.\x0a'+'2.\x20onchain_table_item_repository_data\x20—\x20Query\x20a\x20record\x20from\x20a\x20Repository\x27s\x20on-chain\x20key-value\x20database\x20(Parent:\x20Repository).\x20Key:\x20name\x20+\x20entity\x20(address\x20or\x20number).\x20Returns\x20the\x20stored\x20data\x20record\x20with\x20typed\x20value.\x0a'+'3.\x20onchain_table_item_permission_perm\x20—\x20Query\x20a\x20permission\x20entry\x20from\x20a\x20Permission\x20object\x27s\x20access\x20control\x20table\x20(Parent:\x20Permission).\x20Key:\x20user\x20address\x20or\x20Guard\x20ID.\x20Returns\x20the\x20permission\x20list\x20(perm[])\x20granted\x20to\x20that\x20user/guard.\x0a'+'4.\x20onchain_table_item_entity_registrar\x20—\x20Query\x20an\x20entity\x27s\x20registration\x20record\x20from\x20the\x20GLOBAL\x20EntityRegistrar\x20(Parent:\x20system\x20EntityRegistrar).\x20Key:\x20user\x20address.\x20Returns\x20registration\x20info:\x20description,\x20referrer,\x20records,\x20mark_object.\x0a'+'5.\x20onchain_table_item_entity_linker\x20—\x20Query\x20community\x20votes/endorsements\x20for\x20an\x20entity\x20from\x20the\x20GLOBAL\x20EntityLinker\x20(Parent:\x20system\x20EntityLinker).\x20Key:\x20entity\x20address.\x20Returns\x20vote\x20records\x20(likes/dislikes/favor)\x20showing\x20community\x20trust.\x0a'+'6.\x20onchain_table_item_entity_contact\x20—\x20Query\x20which\x20customer-service\x20Contacts\x20an\x20entity\x20is\x20a\x20member\x20of,\x20from\x20the\x20GLOBAL\x20EntityContact\x20reverse\x20index\x20(Parent:\x200xaa9).\x20Key:\x20entity\x20address.\x20Returns\x20contact\x20memberships\x20(contact\x20+\x20time).\x0a'+'7.\x20onchain_table_item_object_linker_core\x20—\x20Query\x20which\x20bounded\x20core\x20objects\x20(Service/Machine/Treasury/Reward/Demand/Arbitration/Arb/Contact)\x20bind\x20to\x20a\x20target,\x20from\x20the\x20GLOBAL\x20ObjectLinkerCore\x20reverse\x20index\x20(Parent:\x200xaae).\x20Lossless\x20fixed;\x20use\x20for\x20DEFAULT\x20reverse\x20lookups\x20(e.g.\x20which\x20services\x20use\x20a\x20permission).\x0a'+'8.\x20onchain_table_item_object_linker_tx\x20—\x20Query\x20which\x20operational\x20objects\x20(Order/Progress/Payment/Allocation/Guard/Permission)\x20bind\x20to\x20a\x20target,\x20from\x20the\x20GLOBAL\x20ObjectLinkerTx\x20reverse\x20index\x20(Parent:\x200xaaf).\x20Lossy\x20FIFO\x20(recent\x20only);\x20use\x20for\x20ORDER/PROGRESS/operational\x20reverse\x20lookups\x20(e.g.\x20which\x20orders\x20a\x20service\x20has).\x0a'+'9.\x20onchain_table_item_reward_record\x20—\x20Query\x20a\x20reward\x20claim\x20record\x20from\x20a\x20Reward\x20object\x27s\x20distribution\x20table\x20(Parent:\x20Reward).\x20Key:\x20recipient\x20address.\x20Returns\x20claim\x20history:\x20guard\x20used,\x20total\x20claimed,\x20per-claim\x20details.\x0a'+'10.\x20onchain_table_item_demand_presenter\x20—\x20Query\x20a\x20demand\x20submission\x20from\x20a\x20Demand\x20object\x27s\x20presenter\x20table\x20(Parent:\x20Demand).\x20Key:\x20presenter\x20address.\x20Returns\x20submission\x20details:\x20recommendation,\x20service,\x20feedback,\x20acceptance\x20score.\x0a'+'11.\x20onchain_table_item_treasury_history\x20—\x20Query\x20a\x20payment\x20record\x20from\x20a\x20Treasury\x27s\x20history\x20table\x20(Parent:\x20Treasury).\x20Key:\x20payment\x20ID\x20(address).\x20Returns\x20payment\x20details:\x20operation\x20type,\x20signer,\x20amount,\x20external\x20guard.\x0a'+'12.\x20onchain_table_item_machine_node\x20—\x20Query\x20a\x20workflow\x20node\x20definition\x20from\x20a\x20Machine\x20object\x27s\x20node\x20table\x20(Parent:\x20Machine).\x20Key:\x20node\x20name\x20(string).\x20Returns\x20node\x20configuration:\x20pairs,\x20forwards,\x20guards,\x20thresholds.\x0a'+'13.\x20onchain_table_item_progress_history\x20—\x20Query\x20a\x20progress\x20step\x20record\x20from\x20a\x20Progress\x20object\x27s\x20history\x20table\x20(Parent:\x20Progress).\x20Key:\x20sequence\x20number\x20(u64).\x20Returns\x20step\x20details:\x20node,\x20next_node,\x20session\x20state,\x20time.\x0a'+'14.\x20onchain_table_item_address_mark\x20—\x20Query\x20a\x20PUBLIC\x20on-chain\x20name/tag\x20mark\x20from\x20an\x20AddressMark\x20object\x27s\x20table\x20(Parent:\x20AddressMark).\x20Key:\x20address.\x20Returns\x20public\x20labels:\x20entity,\x20name,\x20tags[].\x20Unlike\x20local\x20marks,\x20these\x20are\x20published\x20on-chain.\x0a'+'15.\x20onchain_table_item_entity_order\x20—\x20Query\x20the\x20orders\x20a\x20user\x20participates\x20in,\x20from\x20the\x20GLOBAL\x20EntityOrder\x20reverse\x20index\x20(Parent:\x200xaa8).\x20Key:\x20user\x20address.\x20Returns\x20order\x20addresses\x20with\x20role\x20bitmask\x20(1=owner,\x202=agent)\x20and\x20last\x20role-update\x20time\x20(raw\x20index,\x20without\x20full\x20order\x20objects).\x0a'+'16.\x20onchain_orders_of_user\x20—\x20Query\x20EVERY\x20order\x20a\x20user\x20participates\x20in\x20(as\x20owner\x20and/or\x20agent)\x20via\x20the\x20GLOBAL\x20EntityOrder\x20reverse\x20index\x20(Parent:\x200xaa8),\x20resolving\x20each\x20to\x20its\x20full\x20on-chain\x20Order\x20object.\x20Each\x20result\x20includes\x20role\x20info:\x20role\x20bitmask,\x20is_owner,\x20is_agent,\x20role\x20update\x20time,\x20and\x20the\x20full\x20order.\x20Use\x20to\x20get\x20a\x20user\x27s\x20complete\x20order\x20list\x20with\x20role\x20attributes.\x0a'+'17.\x20onchain_orders_of_users\x20—\x20Cross-account\x20variant:\x20query\x20EVERY\x20order\x20that\x20ANY\x20of\x20the\x20given\x20accounts\x20participates\x20in,\x20merged\x20into\x20ONE\x20deduped\x20list\x20(per-account\x20roles\x20merged)\x20with\x20SERVER-SIDE\x20enrichment\x20identical\x20to\x20the\x20Service\x20panorama\x20Orders\x20tab\x20—\x20amount/item\x20prices\x20as\x20human\x20token\x20display,\x20progress\x20node\x20+\x20entry\x20time,\x20allocation\x20fund\x20state,\x20updated\x20time.\x20Non-blocking\x20per-account\x20errors\x20(account_errors).\x20Use\x20for\x20a\x20local\x20wallet\x27s\x20complete\x20order\x20list\x20in\x20ONE\x20call.\x0a'+'18.\x20onchain_table_item_generic\x20—\x20Query\x20a\x20generic\x20table\x20item\x20from\x20ANY\x20object\x27s\x20dynamic\x20fields\x20(Parent:\x20any\x20object).\x20Supports\x20arbitrary\x20key\x20types\x20(address,\x20u64,\x20string,\x20object\x20ID,\x20etc.).\x20Use\x20for\x20custom\x20objects\x20and\x20general-purpose\x20table\x20lookups.\x20Returns:\x20ObjectBase\x20|\x20undefined.\x0a'+'19.\x20address_profile\x20—\x20hosted\x20in\x20the\x20query_toolkit\x20tool\x20(query_type=\x22address_profile\x22)\x20—\x20unified\x20address\x20profile\x20with\x20a\x20merged\x20service_analysis\x20block\x20for\x20Service\x20addresses.\x0a'+'20.\x20service_supply_chain\x20—\x20hosted\x20in\x20the\x20query_toolkit\x20tool\x20(query_type=\x22service_supply_chain\x22)\x20—\x20resolves\x20a\x20Service\x27s\x20transparent\x20sub-order\x20purchasing\x20graph.\x0a\x0a'+'🧭\x20Tool\x20selection\x20(avoid\x20confusion):\x20use\x20query_toolkit\x20to\x20query\x20a\x20WHOLE\x20object/balance/profile;\x20use\x20onchain_events\x20to\x20query\x20state-transition\x20events;\x20use\x20onchain_table_data\x20(this\x20tool)\x20to\x20paginate\x20over\x20ONE\x20object\x27s\x20dynamic\x20table\x20fields\x20or\x20read\x20a\x20single\x20table\x20item.\x0a\x0a'+'💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27onchain_table_data\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema\x20with\x20all\x20table\x20item\x20types\x20and\x20field\x20definitions.','inputSchema':OnchainTableDataSchema,'outputSchema':OnchainTableDataResultSchema,'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':!![]},'_meta':createToolMeta('table\x20query',['on-chain','table','dynamic\x20fields','pagination','repository','permission','reward','demand','treasury','machine','progress'])}},{'name':'onchain_events','handler':handleOnchainEvents,'config':{'title':'📅\x20Query\x20WoWok\x20On-chain\x20Events','summary':'Watch\x20on-chain\x20state-transition\x20and\x20fund-flow\x20events\x20(all\x2016\x20framework\x20types).','description':'Query\x20on-chain\x20WoWok\x20events\x20by\x20type\x20(a\x20ONE-TIME\x20paginated\x20query\x20—\x20NOT\x20a\x20realtime\x20subscription).\x20All\x2016\x20framework\x20event\x20types\x20are\x20supported,\x20grouped\x20by\x20business\x20family:\x20market\x20opportunity\x20(ServiceEvent,\x20ArbitrationEvent,\x20DemandChangedEvent,\x20DemandPresentEvent),\x20order/workflow\x20(NewOrderEvent,\x20ProgressEvent),\x20dispute\x20(ArbEvent,\x20VoteEvent,\x20FeedbackEvent),\x20reputation\x20(DemandFeedbackEvent,\x20NewEntityEvent),\x20fund\x20flow\x20(AllocationEvent,\x20TreasuryEvent,\x20RewardClaimEvent,\x20RewardFundEvent,\x20NewPaymentEvent).\x20Use\x20pagination\x20cursor\x20for\x20fetching\x20large\x20result\x20sets.\x0a\x0a💰\x20NewPaymentEvent\x20is\x20the\x20universal\x20fund-flow\x20receipt:\x20every\x20treasury\x20withdraw/deposit,\x20allocation\x20split\x20and\x20compensation\x20payout\x20mints\x20one.\x20Its\x20`from_object`\x20is\x20the\x20internal-only\x20funding-source\x20object\x20(Treasury/Allocation/Service\x20—\x20set\x20by\x20the\x20framework,\x20never\x20user\x20code),\x20and\x20`info.for_object`/`info.for_guard`\x20are\x20user-settable\x20business\x20routing\x20hints;\x20both\x20are\x20registered\x20as\x20on-chain\x20affiliations.\x20NewOrderEvent.amount\x20includes\x20`_money_display`\x20annotation\x20(unit-converted\x20via\x20the\x20order\x27s\x20Service\x20generic\x20token\x20type;\x20raw-only\x20with\x20retry\x20hint\x20when\x20precision\x20is\x20unavailable).\x0a\x0a🧭\x20Tool\x20selection\x20(avoid\x20confusion):\x20use\x20query_toolkit\x20to\x20query\x20whole\x20objects/balances/profiles;\x20use\x20onchain_table_data\x20to\x20query\x20ONE\x20object\x27s\x20dynamic\x20table\x20fields;\x20use\x20onchain_events\x20(this\x20tool)\x20to\x20query\x20EVENTS\x20by\x20type.\x0a\x0a💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27onchain_events\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema\x20with\x20all\x20event\x20types\x20and\x20field\x20definitions.','inputSchema':OnchainEventsInputSchema,'outputSchema':OnchainEventsResultSchema,'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':!![]},'_meta':createToolMeta('watch\x20wowook\x20events',['events','on-chain','arbitration','order','progress','demand','entity'])}},{'name':'wowok_buildin_info','handler':handleWowokInfo,'config':{'title':'ℹ️\x20WoWok\x20Build-in\x20Information','summary':'Protocol\x20constants,\x20built-in\x20permissions,\x20bridge\x20tokens,\x20funding\x20guidance.','description':'Query\x20WoWok\x20protocol\x20information:\x20\x27constants\x27,\x20\x27built-in\x20permissions\x27,\x20\x27common\x20mistakes\x27,\x20\x27guard\x20instructions\x27,\x20\x27current\x20network\x27,\x20\x27value\x20types\x27,\x20\x27mainnet\x20bridge\x20tokens\x27,\x20or\x20\x27funding\x20guidance\x27.\x20Use\x20\x27common\x20mistakes\x27\x20to\x20proactively\x20learn\x20known\x20field-name/unit/workflow\x20pitfalls\x20before\x20submitting\x20an\x20operation\x20(e.g.\x20filter\x20operation:\x22compensation_fund_add\x22).\x20For\x20\x27mainnet\x20bridge\x20tokens\x27:\x20returns\x20cross-chain\x20bridge\x20tokens\x20(ETH,\x20WETH,\x20WBTC,\x20USDC,\x20USDT)\x20with\x20each\x20token\x27s\x20symbol,\x20WOW-side\x20type\x20tag\x20(wowTypeTag),\x20EVM\x20address,\x20decimals,\x20and\x20description.\x20The\x20wowTypeTag\x20(format\x20{address}::{module}::{struct})\x20can\x20be\x20used\x20directly\x20as\x20the\x20`type_parameter`\x20of\x20Service\x20/\x20Treasury\x20/\x20Reward\x20/\x20Allocation\x20objects\x20to\x20set\x20their\x20payment\x20token\x20—\x20e.g.\x20use\x20USDT\x27s\x20wowTypeTag\x20to\x20create\x20a\x20Service\x20that\x20accepts\x20USDT\x20payments.\x20For\x20\x27funding\x20guidance\x27:\x20returns\x20how\x20to\x20obtain\x20WOW\x20gas\x20and\x20payment\x20tokens\x20—\x20testnet\x20faucet,\x20mainnet\x20ETH\x20cross-chain\x20bridge\x20flow,\x20and\x20the\x20WOW\x20mainnet\x20airdrop\x20link.\x20Use\x20this\x20when\x20a\x20user\x20asks\x20how\x20to\x20obtain\x20tokens/gas/funds,\x20or\x20as\x20a\x20proactive\x20first-use\x20reminder.','inputSchema':ProtocolInfoQuerySchema,'outputSchema':ProtocolInfoResultSchema,'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':!![]},'_meta':createToolMeta('WoWok\x20info',['build-in','constants','permissions','guard','network','value-types','bridge-tokens','funding-guidance','faucet','airdrop'])}},{'name':'schema_query','handler':handleSchemaQuery,'config':{'title':'📋\x20Schema\x20Query','summary':'Query\x20JSON\x20schemas\x20for\x20any\x20sub-tool\x20(action:\x20list/get/get_output/search).','description':'Look\x20up\x20JSON\x20Schemas\x20for\x20WoWok\x20MCP\x20tools\x20and\x20on-chain\x20operations.\x20'+'This\x20is\x20the\x20authoritative\x20reference\x20for\x20exact\x20parameter\x20structures,\x20types,\x20and\x20required\x20fields.\x20'+'Always\x20check\x20the\x20schema\x20before\x20calling\x20an\x20unfamiliar\x20tool.\x0a\x0a'+'Actions:\x0a'+'\x20\x20\x27list\x27\x20-\x20Show\x20all\x20available\x20schemas\x20(tools\x20+\x20on-chain\x20operations).\x20Start\x20here\x20to\x20discover\x20what\x20exists.\x0a'+'\x20\x20\x27get\x27\x20-\x20Fetch\x20the\x20full\x20input\x20JSON\x20Schema\x20by\x20name\x20(e.g.\x20\x27onchain_operations\x27).\x20Use\x20with\x20the\x20\x27name\x27\x20param.\x0a'+'\x20\x20\x27get_output\x27\x20-\x20Fetch\x20the\x20output\x20JSON\x20Schema\x20of\x20a\x20tool\x20by\x20name\x20(e.g.\x20\x27onchain_operations\x27).\x20Use\x20with\x20the\x20\x27name\x27\x20param.\x20Use\x20this\x20to\x20understand\x20a\x20tool\x27s\x20return\x20value\x20structure.\x0a'+'\x20\x20\x27get_field\x27\x20-\x20Query\x20a\x20single\x20field\x20by\x20dot-path\x20(e.g.\x20field_path=\x27data.node.nodes.0.pairs\x27).\x20Cheaper\x20than\x20\x27get\x27\x20when\x20you\x20only\x20need\x20one\x20subtree.\x0a'+'\x20\x20\x27search\x27\x20-\x20Find\x20schemas\x20by\x20keyword,\x20matching\x20name/title/description.\x20Use\x20with\x20the\x20\x27query\x27\x20param.\x0a'+'\x20\x20\x27list_operations\x27\x20-\x20Show\x20only\x20on-chain\x20operation\x20schemas\x20(prefixed\x20\x27onchain_operations_\x27).\x20Narrower\x20than\x20\x27list\x27.\x0a'+'\x20\x20\x27get_guard_templates\x27\x20-\x20Guard\x20creation\x20templates\x20+\x20best\x20practices\x20(e.g.\x20signer_verification,\x20progress_node_check).\x20Omit\x20\x27template\x27\x20to\x20list\x20all.\x0a'+'\x20\x20\x27get_tool_reference\x27\x20-\x20MCP\x20tool\x20usage\x20reference\x20(summaries,\x20actions,\x20prerequisites,\x20notes).\x20Pass\x20name=\x27<tool>\x27\x20for\x20one\x20tool,\x20query=\x27<keyword>\x27\x20to\x20search,\x20or\x20omit\x20for\x20the\x20full\x20catalog.\x0a'+'\x20\x20\x27get_guard_design_patterns\x27\x20-\x20Curated\x20Guard\x20design\x20patterns\x20(business\x20requirement\x20→\x20logic\x20tree\x20template).\x20Pass\x20name=\x27<pattern_id>\x27,\x20query=\x27<host>\x27\x20(e.g.\x20\x27service_buy_guard\x27,\x20\x27machine_forward\x27),\x20or\x20omit\x20for\x20the\x20full\x20catalog.\x0a'+'\x20\x20\x27get_safety_rules\x27\x20-\x20Safety\x20rule\x20tables\x20sunk\x20from\x20the\x20wowok-safety\x20skill:\x20object\x20reuse,\x20immutability-after-publish,\x20LOCAL/ONCHAIN/QUERY\x20classification,\x20naming\x20conventions.\x0a'+'\x20\x20\x27analyze_guard_semantics\x27\x20-\x20Parse\x20+\x20evaluate\x20ANY\x20Guard\x20JSON\x20(pass\x20guard=<json>):\x20rendered\x20logic\x20tree,\x20lint\x20+\x20risk\x20diagnostics,\x20and\x20a\x20party-perspective\x20fact\x20sheet\x20(who\x20can\x20trigger,\x20time\x20constraints,\x20evidence\x20required,\x20data\x20sources\x20read\x20—\x20including\x20which\x20are\x20mutable\x20on-chain).\x20BOTH\x20transacting\x20parties\x20should\x20run\x20this\x20before\x20relying\x20on\x20a\x20Guard\x20(e.g.\x20a\x20refund\x20or\x20fund-release\x20Guard\x20is\x20a\x20free-form\x20game\x20condition\x20tree,\x20not\x20necessarily\x20tied\x20to\x20any\x20Machine\x20node).','inputSchema':SchemaQueryInputSchema,'outputSchema':SchemaQueryOutputSchema,'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':![]},'_meta':createToolMeta('schema',['schema','json-schema','types','structure','validation','reference'])}}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{handleTrustScore}from'../handlers/trust.js';import{handleEvaluationOperation}from'../handlers/evaluation.js';import{createToolMeta,TrustScoreInputSchema,TrustScoreOutputSchema,EvaluationOperationInputSchema,EvaluationOperationOutputSchema}from'../../schema/index.js';export const TRUST_TOOLS=[{'name':'trust_score','handler':handleTrustScore,'config':{'title':'🛡️\x20Trust\x20Score\x20-\x20Service\x20Risk\x20&\x20Trust\x20Assessment','summary':'Service\x20trust/risk\x20assessment\x20(0-100\x20score,\x205\x20dimensions).','description':'Proactively\x20query\x20the\x20trust\x20score\x20and\x20risk\x20assessment\x20of\x20a\x20Service\x20object.\x20'+'This\x20is\x20the\x20standalone\x20query\x20form\x20of\x20the\x20trust_score\x20field\x20that\x20is\x20otherwise\x20only\x20'+'passively\x20injected\x20into\x20onchain_operations\x20semantic\x20output.\x0a\x0a'+'Returns:\x0a'+'\x20\x20•\x20trust_score\x20(0-100,\x205\x20dimensions:\x20arbitration/reviews/fulfillment/fund_safety/transparency)\x0a'+'\x20\x20•\x20risk_score\x20(4\x20dimensions:\x20workflow/fund/trust/behavior,\x20100-point)\x20when\x20depth\x20>=\x20\x27evaluate\x27\x0a'+'\x20\x20•\x20info_puzzle\x20completeness\x20+\x20gaps\x20summary\x0a'+'\x20\x20•\x20service_basics\x20snapshot\x20(published/paused/sales/guards/arbitrations)\x0a\x0a'+'Use\x20this\x20tool\x20when\x20the\x20user\x20asks\x20\x27is\x20this\x20service\x20trustworthy?\x27,\x20\x27should\x20I\x20buy\x20from\x20this\x20merchant?\x27,\x20'+'\x27what\x27s\x20the\x20risk\x20of\x20ordering\x20this\x20service?\x27,\x20or\x20any\x20explicit\x20trust/risk\x20inquiry\x20about\x20a\x20Service.\x0a\x0a'+'🧭\x20Tool\x20selection\x20(avoid\x20confusion):\x20trust_score\x20=\x20trust/risk\x20of\x20ONE\x20Service;\x20'+'evaluation_operation\x20=\x20game-theory\x20best-move\x20advice\x20at\x20an\x20Arb/Progress\x20state;\x20'+'query_toolkit\x20query_type=\x27reverse_map\x27\x20=\x20deterministic\x20multi-object\x20business\x20report.\x0a\x0a'+'Parameters:\x0a'+'\x20\x20•\x20service\x20(required)\x20—\x20Service\x20object\x20ID\x20or\x20local_mark\x20name.\x0a'+'\x20\x20•\x20order_amount\x20(optional)\x20—\x20Order\x20amount\x20in\x20smallest\x20token\x20unit\x20(e.g.\x202000000000\x20for\x202\x20WOW).\x20'+'Defaults\x20to\x20the\x20service\x27s\x20first\x20active\x20sale\x20price.\x0a'+'\x20\x20•\x20depth\x20(optional,\x20default\x20\x27evaluate\x27)\x20—\x20\x27browse\x27\x20(trust\x20score\x20only),\x20\x27evaluate\x27\x20(+\x20risk\x20assessment),\x20'+'\x27preorder\x27\x20(most\x20thorough,\x20includes\x20market\x20context\x20dimension).\x0a\x0a'+'💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27trust_score\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema.','inputSchema':TrustScoreInputSchema,'outputSchema':TrustScoreOutputSchema,'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':![]},'_meta':createToolMeta('trust',['trust','score','risk','service','merchant','reputation','safety','evaluate'])}},{'name':'evaluation_operation','handler':handleEvaluationOperation,'config':{'title':'🧠\x20Evaluation\x20-\x20Pluggable\x20Business\x20Intelligence','summary':'Business\x20evaluations:\x20arb/node\x20games,\x20path\x20reasoning,\x20match,\x20arbitration\x20score.','description':'Run\x20pluggable\x20business\x20evaluations\x20(data\x20sources\x20+\x20rules\x20+\x20user\x20injection).\x20'+'Each\x20evaluation\x20returns\x20ranked\x20best-move\x20recommendations\x20with\x20payoff\x20notes\x20and\x20risks.\x0a\x0a'+'Actions:\x0a'+'\x20\x20•\x20arb_game\x20—\x20advise\x20the\x20best\x20move\x20at\x20an\x20Arb\x20state\x20(7-state\x20lifecycle)\x20for\x20a\x20perspective\x20(customer/merchant/arbitrator).\x0a'+'\x20\x20•\x20node_game\x20—\x20advise\x20the\x20best\x20move\x20at\x20a\x20Progress\x20node\x20for\x20a\x20perspective\x20(merchant/customer/prospect/supplier/collaborator/arbitrator).\x0a'+'\x20\x20•\x20capability_gap\x20—\x20compare\x20a\x20demand\x20capability\x20vector\x20against\x20a\x20service\x20capability\x20vector;\x20returns\x20per-capability\x20gaps.\x0a'+'\x20\x20•\x20compose_service\x20—\x20check\x20whether\x20a\x20SET\x20of\x20services\x20can\x20jointly\x20satisfy\x20a\x20demand\x20(supply-chain\x20composition).\x0a'+'\x20\x20•\x20demand_match\x20—\x20rank\x20candidate\x20services\x20against\x20a\x20demand\x20capability\x20vector\x20(+\x20user\x20injection\x20/\x20persona).\x0a'+'\x20\x20•\x20service_match\x20—\x20supplier-side\x20mirror:\x20rank\x20candidate\x20demands\x20against\x20a\x20service\x20capability\x20vector.\x0a'+'\x20\x20•\x20service_risk\x20—\x20risk\x20assessment\x20of\x20ONE\x20service\x20from\x20raw\x20puzzle\x20data\x20(browse/evaluate/preorder/monitor\x20depth).\x0a'+'\x20\x20•\x20path_reasoning\x20—\x20path-level\x20game:\x20enumerate\x20full\x20routes\x20from\x20the\x20current\x20node,\x20rank\x20by\x20value/acceptance\x20reachability\x20(a→b\x20vs\x20a→c\x20competition).\x0a'+'\x20\x20•\x20evidence_review\x20—\x20deterministic\x20off-chain\x20evidence\x20closure\x20gate\x20(auto_pass\x20/\x20auto_reject\x20/\x20manual_review)\x20for\x20arbitration\x20evidence\x20(signature\x20photos,\x20voice\x20recordings,\x20delivery\x20proofs,\x20weather\x20data).\x20Single-item\x20mode\x20(kind\x20+\x20hash_committed)\x20or\x20LIST\x20mode\x20(`items`):\x20list\x20mode\x20returns\x20the\x20structured\x20usable/manual/rejected\x20list\x20plus\x20`proof_candidates`\x20—\x20auto-passed\x20items\x20with\x20their\x20on-chain\x20Proof\x20refs,\x20ready\x20for\x20the\x20dispute\x20initiator\x20to\x20reference\x20in\x20the\x20dispute\x20description\x20(the\x20user\x20confirms\x20the\x20final\x20selection;\x20never\x20auto-attached).\x0a'+'\x20\x20•\x20discover_services\x20—\x20ACTIVE\x20supply\x20discovery:\x20enumerate\x20every\x20published\x20(shared)\x20Service\x20on-chain,\x20gate+rank\x20by\x20location\x20fit\x20under\x20a\x20sensitivity\x20(strict=100%\x20city\x20match\x20/\x20near=neighboring\x20cities\x20/\x20logistics=soft\x20region\x20signal;\x20inferred\x20from\x20description\x20when\x20omitted),\x20and\x20get\x20consent-gated\x20scope-expansion\x20advice.\x20Enumerated\x20via\x20JSON-RPC\x20ServiceEvent.\x20Passive\x20side:\x20post\x20a\x20Demand\x20and\x20Services\x20present\x20via\x20DemandPresenter.\x0a\x0a'+'\x20\x20•\x20discover_demands\x20—\x20enumerate\x20on-chain\x20Demands\x20(supplier-side\x20discovery;\x20optional\x20location\x20substring\x20filter).\x20Enumerated\x20via\x20JSON-RPC\x20DemandChangedEvent.\x0a\x0a'+'\x20\x20•\x20demand_present\x20—\x20supply-side\x20orchestration:\x20discover\x20Demands\x20+\x20match\x20THIS\x20service\x20to\x20them\x20(service_match)\x20+\x20attach\x20the\x20present\x20path\x20per\x20demand\x20(demand.present_service\x20vs\x20demand.present_service_with_passport\x20when\x20the\x20demand\x20has\x20presentation\x20guards).\x20Read-only\x20—\x20the\x20actual\x20present\x20is\x20a\x20WRITE\x20via\x20onchain_operations.\x20Enumerated\x20via\x20JSON-RPC\x20DemandChangedEvent.\x0a\x0a'+'\x20\x20•\x20market_metrics\x20—\x20supply/demand/trust\x20market\x20metrics\x20aggregated\x20from\x20JSON-RPC\x20event\x20enumeration.\x0a\x0a'+'\x20\x20•\x20market_operations\x20—\x20operational\x20aggregations:\x20journey_funnel\x20(due-diligence→order→completed→reviews),\x20referral_attribution,\x20customer_relationship,\x20dynamic_pricing\x20(merchant\x20pricing\x20suggestion\x20from\x20market_signals).\x0a\x0a'+'\x20\x20•\x20anti_cheat\x20—\x20governance:\x20detect\x20fake\x20reviews\x20/\x20wash\x20orders\x20/\x20compensation-fund\x20manipulation\x20from\x20service\x20+\x20orders\x20+\x20reviews\x20evidence.\x0a\x0a'+'\x20\x20•\x20match_discover\x20—\x20ONE-SHOT\x20intent→service\x20orchestration:\x20enumerate\x20services\x20+\x20location\x20gate\x20+\x206-dimension\x20demand_match\x20scoring\x20in\x20a\x20single\x20call.\x20Inputs:\x20description\x20+\x20location\x20+\x20optional\x20sensitivity/budget/required_capabilities/coin_type.\x20Returns\x20location-gated\x20Top-N\x20services\x20with\x20per-service\x206-dim\x20breakdown\x20(region/industry/price/trust/capabilities/tags)\x20+\x20recommendation\x20reasons.\x20Enumerated\x20via\x20JSON-RPC\x20ServiceEvent.\x0a\x0a'+'\x20\x20•\x20arbitration_score\x20—\x20dual-perspective\x20arbitration\x20trust\x20assessment:\x20score\x20an\x20Arbitration\x20object\x20from\x20the\x20user-trust\x20angle\x20(timeliness/objection/indemnity/feedback/experience/capital)\x20and\x20the\x20merchant-fairness\x20angle\x20(fee/governance/operational).\x20Inputs:\x20arbitration\x20config\x20+\x20pre-aggregated\x20history[]\x20+\x20optional\x20entity_votes/fee_median.\x20Returns\x20trust\x20+\x20fairness\x20EvaluationResults\x20+\x20combined\x200-100.\x0a\x0a'+'\x20\x20•\x20account_events\x20—\x20account-centric\x20attention\x20feed:\x20run\x20hot-pluggable\x20watchers\x20(messenger_unread,\x20order_collection,\x20demand_presented,\x20reputation_integrity)\x20over\x20one\x20account\x20and\x20return\x20a\x20unified,\x20priority-sorted\x20prompt\x20list\x20of\x20what\x20needs\x20the\x20account\x27s\x20attention.\x20Inputs:\x20account\x20+\x20optional\x20categories[];\x20reputation_integrity\x20additionally\x20consumes\x20review\x20rows\x20(reviews[]\x20from\x20a\x20Service\x27s\x20ReviewRepository\x20via\x20onchain_table_data\x20+\x20optional\x20order_history[]\x20for\x20no-order-no-review\x20verification)\x20and\x20flags\x20manipulation/unverified/declining-trend\x20signals.\x20Read-only\x20(passive\x20check\x20—\x20never\x20marks\x20messages\x20viewed).\x0a\x0a'+'Read-only:\x20computes\x20recommendations\x20from\x20pure\x20data;\x20never\x20mutates\x20chain\x20state.\x20'+'The\x20caller\x20decides\x20and\x20acts\x20via\x20onchain_operations\x20/\x20messenger_operation.\x0a\x0a'+'🧭\x20Tool\x20selection\x20(avoid\x20confusion):\x20evaluation_operation\x20=\x20best-move\x20advice\x20at\x20an\x20Arb/Progress\x20state\x20(game\x20theory);\x20'+'trust_score\x20=\x20trust/risk\x20of\x20ONE\x20Service;\x20query_toolkit\x20query_type=\x27reverse_map\x27\x20=\x20deterministic\x20multi-object\x20business\x20report.\x0a\x0a'+'💡\x20Schema\x20hint:\x20Use\x20schema_query\x20with\x20action=\x27get\x27\x20and\x20name=\x27evaluation_operation\x27\x20to\x20retrieve\x20the\x20exact\x20parameter\x20schema.','inputSchema':EvaluationOperationInputSchema,'outputSchema':EvaluationOperationOutputSchema,'annotations':{'readOnlyHint':!![],'destructiveHint':![],'idempotentHint':!![],'openWorldHint':![]},'_meta':createToolMeta('evaluation',['evaluate','risk','match','game','score','arb','node','compose','gap'])}}];
|
package/dist/tools/shared.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{confirmGate}from'../safety/confirm-gate.js';import{renderPreview}from'../safety/preview.js';import{validateOperation,hasBlockingViolations,getWarningViolations}from'../knowledge/index.js';import{getHarness}from'../harness/index.js';import{isEnabled as
|
|
1
|
+
import{confirmGate}from'../safety/confirm-gate.js';import{renderPreview}from'../safety/preview.js';import{validateOperation,hasBlockingViolations,getWarningViolations}from'../knowledge/index.js';import{getHarness}from'../harness/index.js';import{isEnabled as a440a}from'../config/index.js';import{classifyError,buildDataSemantic}from'../schema/call/semantic.js';import{strictParse}from'../schema/index.js';export function withHarness(a,b,c){if(!a440a('harness'))return a;try{const d=getHarness(),e=d['expect'](b,c,a['operation_type'],a['data']);return{...a,'harness':d,'expected':e,'operation_id':a['operation_type']+'_'+Date['now']()};}catch{return a;}}export function wrapLocalHandler(a){const {schema:b,operationFn:c,parseLabel:d,buildContext:e}=a;return async f=>{let g;try{g=strictParse(b,f,d);const h=await c(g),i=e(g);return{'content':[{'type':'text','text':JSON['stringify'](h)}],'structuredContent':{'result':{'status':'success','data':h},'semantic':buildDataSemantic(h,i)}};}catch(j){const k=j instanceof Error?j['message']:String(j),l=g?e(g):undefined,m=classifyError(k),n={'status':'error','error':k};if(m['error_code']!==undefined)n['error_code']=m['error_code'];if(m['retryable']!==undefined)n['retryable']=m['retryable'];if(m['recovery_hint']!==undefined)n['recovery_hint']=m['recovery_hint'];return{'content':[{'type':'text','text':'Error:\x20'+k}],'structuredContent':{'result':n,'semantic':buildDataSemantic(undefined,l,!![],k)}};}};}export function buildPendingConfirmation(a,b,c,d){const e=confirmGate(a,b,c,c?.['user_intent_phrases'],d);if(e['pass'])return{'content':[],'structuredContent':null};const f=e['preview'],g=renderPreview(f),h={'message':g,'result':{'type':'pending_confirmation','preview':f,'rule_id':e['rule_id']},'semantic':{'intent':a+'_awaiting_confirmation','status':'pending_input','summary':'Operation\x20blocked\x20by\x20ConfirmGate\x20('+e['level']+').\x20Review\x20the\x20preview\x20and\x20re-call\x20with\x20env.confirmed=true\x20to\x20proceed.','next_actions':[{'action':'confirm:\x20re-call\x20the\x20SAME\x20operation\x20with\x20env.confirmed=true','reason':'ConfirmGate\x20rule\x20\x27'+e['rule_id']+'\x27\x20matched.\x20The\x20operation\x20was\x20NOT\x20executed.','tool':'onchain_operations','priority':'required'}],'warnings':f['warnings']??[]}};return{'content':[{'type':'text','text':g}],'structuredContent':h};}export function buildConstraintError(a,b){const c=b['filter'](g=>g['severity']==='error'),d=c['map'](g=>'\x20\x20•\x20['+g['field']+']\x20'+g['message'])['join']('\x0a'),e='Pre-call\x20constraint\x20violations\x20for\x20\x27'+a+'\x27:\x0a'+d+'\x0a\x0aFix\x20the\x20listed\x20field(s)\x20and\x20retry.',f={'message':e,'result':{'type':'error','error':e,'error_code':'invalid_parameter','retryable':![],'recovery_hint':'Review\x20the\x20constraint\x20violations\x20above\x20and\x20correct\x20the\x20corresponding\x20fields.'}};return{'content':[{'type':'text','text':e}],'structuredContent':f};}export function buildClassifiedErrorResult(a,b,c){const d={...a,'error':b};if(c['error_code']!==undefined)d['error_code']=c['error_code'];if(c['retryable']!==undefined)d['retryable']=c['retryable'];if(c['recovery_hint']!==undefined)d['recovery_hint']=c['recovery_hint'];return d;}export{validateOperation,hasBlockingViolations,getWarningViolations};
|
package/dist/tools/wrap.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{classifyError,buildDataSemantic}from'../schema/call/semantic.js';import{buildClassifiedErrorResult}from'./shared.js';import{shouldRunLightHooks,shouldRunHeavyHooks,recordOperationFailure,recordCriticalRisk,recordCriticalOperation,recordSubstepFailure}from'../harness/auto-escalation.js';import{getHarnessTier,setHarnessTier}from'../config/runtime.js';import{getHarness}from'../harness/index.js';import{recordOperationOutcome}from'../experience/index.js';import{recordIndustrySignal}from'../knowledge/flywheel-loop.js';import{getStageCache}from'../playbooks/service-build/index.js';import{SERVICE_BUILD_STAGES}from'../playbooks/service-build/process.js';import{extractAmount,getAmountThreshold,formatAmount}from'../knowledge/safety-rules.js';function stageIndexOf(a){const b=SERVICE_BUILD_STAGES['indexOf'](a);return b>=0x0?b:0x0;}export function withTimeout(a,b=0x7530,c='operation'){let d;return Promise['race']([a['finally'](()=>{if(d)clearTimeout(d);}),new Promise((e,f)=>{d=setTimeout(()=>{let g='';c['includes']('messenger')&&(g='\x20This\x20is\x20a\x20messenger\x20network\x20operation.\x20Possible\x20causes:\x20'+'(1)\x20messenger\x20server\x20(https://messenger.wowok.net)\x20unreachable,\x20'+'(2)\x20no\x20messenger-enabled\x20account\x20configured\x20(use\x20account_operation\x20to\x20set\x20messenger\x20name),\x20'+'(3)\x20network\x20connectivity\x20issue.\x20'+'Ensure\x20you\x20have\x20a\x20messenger-enabled\x20account\x20and\x20the\x20server\x20is\x20reachable.'),f(new Error('Operation\x20\x27'+c+'\x27\x20timed\x20out\x20after\x20'+b+'ms.'+g));},b);})]);}export function wrapHandlerWithErrorShape(a,b,c,d){return async e=>{try{return await withTimeout(a(e),b,c);}catch(f){if(d){const g=f instanceof Error?f['message']:String(f),h=classifyError(g),i={'operation_type':c,'data':e},j=d(g,h,i);return{'content':[{'type':'text','text':'Error:\x20'+g}],'structuredContent':j};}throw f;}};}export const statusErrorShape=(a,b,c)=>({'result':buildClassifiedErrorResult({'status':'error'},a,b),'semantic':buildDataSemantic(undefined,c,!![],a)});export const operationErrorShape=(a,b,c)=>({'result':buildClassifiedErrorResult({'operation':'error'},a,b),'semantic':buildDataSemantic(undefined,c,!![],a)});export const strictStatusErrorShape=(a,b,c)=>({'result':{'status':'error','error':a}});function checkProjectStage(a,b,c){const d={'analyze_intent':'puzzle','aggregate_risks':'risk','trace_substeps':'substeps'},e=d[a];if(!e)return null;const f=getStageCache(b,c);if(!f){if(a==='analyze_intent')return null;return'project_stage:\x20calling\x20\x27'+a+'\x27\x20before\x20\x27analyze_intent\x27\x20—\x20recommend\x20calling\x20analyze_intent\x20first\x20for\x20project\x20\x27'+b+':'+c+'\x27';}if(stageIndexOf(f['stage'])<stageIndexOf(e)-0x1)return'project_stage:\x20calling\x20\x27'+a+'\x27\x20(stage\x20\x27'+e+'\x27)\x20but\x20project\x20is\x20at\x20stage\x20\x27'+f['stage']+'\x27\x20—\x20recommend\x20completing\x20prior\x20stages\x20first\x20for\x20\x27'+b+':'+c+'\x27';return null;}export function dispatchWithHarness(a,b){return async d=>{const f=[],g=getHarness(),h=shouldRunLightHooks(),i=shouldRunHeavyHooks(),j=isPublishOperation(b,d),k=isSignOperation(b,d),l=getHarnessTier();let m;if(h)try{const o=extractOperationType(b,d),p=extractIntent(b,d);o&&p&&(m=g['expect'](b,p,o,extractData(d)));}catch(q){f['push']('pre_call\x20hook\x20failed:\x20'+(q instanceof Error?q['message']:String(q)));}if(b==='goal_operation'&&h)try{const r=d,s=r?.['action'],t=r?.['project'],u=r?.['version'];if(s&&t&&u){const v=checkProjectStage(s,t,u);v&&f['push'](v);}}catch{}j&&l==='lightweight'&&(setHarnessTier('full'),f['push']('pre_publish:\x20tier\x20forced\x20to\x20full\x20for\x20publish-class\x20operation\x20(GLM5-21\x20§3.3)'));if(j&&l!=='off')try{const x=runPrePublishChecks(b,d);f['push'](...x['warnings']);if(x['critical']['length']>0x0){for(const y of x['critical']){const z=recordCriticalRisk(y);if(z)f['push']('Harness\x20escalated\x20to\x20full\x20tier:\x20'+z['reason']);}return buildHarnessBlockResult('pre_publish','Publish\x20BLOCKED\x20by\x20Harness\x20pre-publish\x20gate\x20(GLM5-21\x20V6):\x20'+(x['critical']['length']+'\x20CRITICAL\x20risk(s)\x20must\x20be\x20resolved\x20before\x20publish.'),x['critical'],x['warnings'],'immutable_violation','Fix\x20the\x20CRITICAL\x20risks\x20listed\x20in\x20the\x20message\x20(e.g.\x20rename\x20dispute/refund\x20nodes\x20per\x20R-M1-11,\x20add\x20the\x20entry\x20pair\x20prev_node=\x22\x22),\x20then\x20retry\x20publish.\x20Nodes/pairs/forwards\x20are\x20immutable\x20after\x20publish\x20—\x20verify\x20via\x20machineNode2file\x20first.');}}catch(A){f['push']('pre_publish\x20hook\x20failed:\x20'+(A instanceof Error?A['message']:String(A)));}if(k&&i)try{const B=extractData(d),C=B?extractAmount(B):null;if(C!==null){const D=getAmountThreshold();let E=null;try{E=BigInt(C);}catch{E=null;}if(E!==null&&E>D)return buildHarnessBlockResult('pre_sign','Sign\x20BLOCKED\x20by\x20Harness\x20pre-sign\x20gate\x20(GLM5-21\x20V7):\x20amount\x20'+formatAmount(E)+'\x20WOW\x20exceeds\x20the\x20full-tier\x20threshold\x20'+formatAmount(D)+'\x20WOW.',['amount\x20'+C+'\x20(smallest\x20unit)\x20>\x20threshold\x20'+D['toString']()+'\x20(smallest\x20unit)'],[],'invalid_parameter','Raise\x20WOWOK_AMOUNT_THRESHOLD\x20to\x20match\x20the\x20intended\x20amount,\x20split\x20the\x20transaction,\x20or\x20reset\x20the\x20harness\x20tier\x20to\x20lightweight\x20(config_operation)\x20after\x20explicit\x20user\x20confirmation.');}}catch(F){f['push']('pre_sign\x20hook\x20failed:\x20'+(F instanceof Error?F['message']:String(F)));}let n;try{n=await a(d);}catch(G){const H=G instanceof Error?G['message']:String(G),I=recordOperationFailure(b,H);I&&f['push']('Harness\x20escalated\x20to\x20full\x20tier:\x20'+I['reason']);if(b==='onchain_operations')try{const J=classifyError(H,G);if(!J['retryable']&&J['error_code']!=='unknown'){const K=recordCriticalOperation(b,J['error_code']);if(K)f['push']('Harness\x20escalated\x20to\x20full\x20tier:\x20'+K['reason']);}}catch{}throw G;}if(h&&m)try{if(n?.['structuredContent']){const L=buildVerifyInput(m,n),M=g['verify'](L);if(M['status']==='fail')f['push']('Harness\x20verify\x20FAIL:\x20'+M['summary']);else M['status']==='warn'&&f['push']('Harness\x20verify\x20WARN:\x20'+M['summary']);}}catch(N){f['push']('post_call\x20hook\x20failed:\x20'+(N instanceof Error?N['message']:String(N)));}if(b==='onchain_operations')try{if(classifyOutcome(n)==='failed'){const O=extractErrorCode(n)??'',P=classifyError(O);if(!P['retryable']&&P['error_code']!=='unknown'){const Q=recordCriticalOperation(b,P['error_code']);if(Q)f['push']('Harness\x20escalated\x20to\x20full\x20tier:\x20'+Q['reason']);}}}catch{}if(b==='goal_operation')try{const R=d?.['action'];if(R==='trace_substeps'){const S=extractCriticalFindingCount(n);if(S>0x0){const T=recordSubstepFailure(String(R)+':\x20'+S+'\x20critical\x20finding(s)');if(T)f['push']('Harness\x20escalated\x20to\x20full\x20tier:\x20'+T['reason']);}}}catch{}if(isWriteClassTool(b))try{const U=extractOperationType(b,d)??b,V=extractIntent(b,d)??b,W=extractData(d)??d,X=classifyOutcome(n),Y=extractErrorCode(n),Z=extractIndustry(d)??'general';recordOperationOutcome(U,W,V,X,Y),recordIndustrySignal(Z,{'type':U},{'success':X==='success','error_code':Y});}catch(a0){f['push']('signal\x20collection\x20failed:\x20'+(a0 instanceof Error?a0['message']:String(a0)));}if(f['length']>0x0){if(n?.['structuredContent']){const a1=n['structuredContent'],a2=a1['semantic'];if(a2){const a3=Array['isArray'](a2['warnings'])?a2['warnings']:[];a2['warnings']=[...a3,...f];}else for(const a4 of f){console['warn']('[harness]\x20'+a4);}}else for(const a5 of f){console['warn']('[harness]\x20'+a5);}}return n;};}function isPublishOperation(a,b){if(a!=='onchain_operations')return![];const c=extractOperationType(a,b);if(c!=='service'&&c!=='machine')return![];const d=extractData(b);return d?.['publish']===!![]||d?.['bPublished']===!![];}function isSignOperation(a,b){if(a==='wip_file'){const c=b?.['operation_type'];return c==='sign';}return a==='onchain_operations';}function extractOperationType(a,b){if(!b||typeof b!=='object')return undefined;const c=b;if(a==='onchain_operations')return typeof c['operation_type']==='string'?c['operation_type']:undefined;if(a==='goal_operation'||a==='industry_pack_operation')return typeof c['action']==='string'?c['action']:undefined;return typeof c['operation_type']==='string'?c['operation_type']:undefined;}function extractIntent(a,b){if(!b||typeof b!=='object')return undefined;const c=b;if((a==='goal_operation'||a==='industry_pack_operation')&&typeof c['action']==='string')return a+':'+c['action'];const d=c['operation_type'];if(typeof d==='string')return a+':'+d;return a;}function extractData(a){if(!a||typeof a!=='object')return undefined;const b=a,c=b['data'];return c&&typeof c==='object'?c:undefined;}function buildVerifyInput(a,b){const c=b['structuredContent']??{},d=c['semantic'];return{'expected':a,'actual':{'result_type':typeof c['result_type']==='string'?c['result_type']:undefined,'semantic':d,'error_code':typeof c['error_code']==='string'?c['error_code']:undefined,'error':typeof c['error']==='string'?c['error']:undefined}};}const WRITE_CLASS_TOOLS=new Set(['onchain_operations','goal_operation','industry_pack_operation','wip_file','messenger_operation','bridge_operation']);function isWriteClassTool(a){return WRITE_CLASS_TOOLS['has'](a);}function classifyOutcome(a){if(!a?.['structuredContent'])return'failed';const b=a['structuredContent'],c=typeof b['status']==='string'?b['status']:typeof b['result_type']==='string'?b['result_type']:'';if(c==='error'||c==='failed')return'failed';if(c==='partial')return'partial';return'success';}function extractErrorCode(a){if(!a?.['structuredContent'])return undefined;const b=a['structuredContent'];if(typeof b['error_code']==='string')return b['error_code'];const c=b['error'];if(typeof c==='string')return c;if(c&&typeof c==='object'){const d=c['code'];if(typeof d==='string')return d;}return undefined;}function extractIndustry(a){if(!a||typeof a!=='object')return undefined;const b=a;if(typeof b['industry']==='string')return b['industry'];const c=b['data'];if(c&&typeof c==='object'){const e=c;if(typeof e['industry']==='string')return e['industry'];}return undefined;}const ANTI_PATTERN_NODE_REGEX=/(^|_)(disputed?|refund(?:ed)?|arbitration|arb)(_|$)/i;function runPrePublishChecks(a,b){const c=[],d=[],e=extractOperationType(a,b),g=extractData(b)??{};if(e==='machine'){const h=g['node'],i=Array['isArray'](h)?h:Array['isArray'](h?.['nodes'])?h['nodes']:[];if(i['length']>0x0){for(const l of i){const m=typeof l?.['name']==='string'?l['name']:'';m&&ANTI_PATTERN_NODE_REGEX['test'](m)&&c['push']('R-M1-11:\x20machine\x20node\x20\x22'+m+'\x22\x20models\x20dispute/refund\x20flow\x20—\x20'+'refunds\x20must\x20route\x20via\x20an\x20Allocator\x20triggered\x20by\x20business\x20states,\x20'+'disputes\x20via\x20the\x20separate\x20Arbitration\x20object\x20(off-Machine)');}const j=new Set();for(const o of i){const q=typeof o?.['name']==='string'?o['name']:'';if(!q)continue;j['has'](q)&&c['push']('MC-C-04:\x20duplicate\x20machine\x20node\x20name\x20\x22'+q+'\x22\x20—\x20on-chain\x20will\x20reject\x20the\x20publish\x20transaction'),j['add'](q);}const k=i['some'](r=>Array['isArray'](r?.['pairs'])&&r['pairs']['some'](s=>s?.['prev_node']===''));!k&&c['push']('Machine\x20has\x20no\x20entry\x20pair\x20(prev_node=\x22\x22)\x20—\x20Progress\x20can\x20never\x20advance\x20'+'from\x20the\x20initial\x20state;\x20orders\x20are\x20permanently\x20stuck');for(const r of i){const s=typeof r?.['name']==='string'?r['name']:'?';for(const t of r?.['pairs']??[]){for(const u of t?.['forwards']??[]){const v=u?.['namedOperator']!==undefined&&u?.['namedOperator']!==null,w=u?.['permissionIndex']!==undefined&&u?.['permissionIndex']!==null;!v&&!w&&d['push']('pre_publish:\x20node\x20\x22'+s+'\x22\x20forward\x20\x22'+String(u?.['name']??'?')+'\x22\x20has\x20neither\x20namedOperator\x20nor\x20permissionIndex\x20—\x20no\x20one\x20can\x20advance\x20it');}}}}else d['push']('pre_publish:\x20publishing\x20machine\x20without\x20inline\x20node\x20data\x20—\x20topology\x20not\x20verifiable\x20in\x20this\x20call;\x20'+'verify\x20nodes/pairs/forwards\x20via\x20machineNode2file\x20BEFORE\x20publish\x20(immutable\x20after\x20publish,\x20IMMUT-001)');d['push']('pre_publish:\x20machine\x20nodes/pairs/forwards\x20become\x20immutable\x20after\x20publish\x20(IMMUT-001)');}return e==='service'&&(d['push']('pre_publish:\x20service\x20machine/order_allocators/arbitrations\x20become\x20immutable\x20after\x20publish\x20(IMMUT-002);\x20sales\x20remains\x20modifiable'),g['machine']===undefined&&d['push']('pre_publish:\x20\x27machine\x27\x20not\x20set\x20in\x20this\x20call\x20—\x20if\x20the\x20service\x20was\x20never\x20bound\x20to\x20a\x20published\x20machine,\x20'+'it\x20cannot\x20process\x20orders\x20and\x20CANNOT\x20be\x20fixed\x20after\x20publish'),g['order_allocators']===undefined&&d['push']('pre_publish:\x20\x27order_allocators\x27\x20not\x20set\x20in\x20this\x20call\x20—\x20immutable\x20after\x20publish;\x20'+'orders\x20will\x20have\x20no\x20fund\x20distribution\x20if\x20never\x20configured')),{'critical':c,'warnings':d};}function buildHarnessBlockResult(a,b,c,d,e,f){const g=[...c['map'](i=>'CRITICAL:\x20'+i),...d['map'](i=>'WARN:\x20'+i)]['join']('\x0a'),h='Error:\x20'+b+(g?'\x0a'+g:'')+'\x0aRecovery:\x20'+f;return{'content':[{'type':'text','text':h}],'structuredContent':{'result':{'type':'error','error':b+'\x20[gate='+a+']','error_code':e,'retryable':![],'recovery_hint':f},'message':h}};}function extractCriticalFindingCount(a){const b=a?.['structuredContent'];if(!b)return 0x0;const c=b['semantic'],d=c?.['summary'];if(typeof d?.['critical_count']==='number'&&d['critical_count']>0x0)return d['critical_count'];const e=b['findings']??c?.['findings'];if(Array['isArray'](e))return e['filter'](h=>h?.['severity']==='error')['length'];const f=a?.['content']?.['map'](h=>'text'in h?h['text']:'')['join']('\x0a')??'',g=f['match'](/\[AUDIT ERROR\]/g);return g?g['length']:0x0;}
|
|
1
|
+
import{classifyError,buildDataSemantic}from'../schema/call/semantic.js';import{buildClassifiedErrorResult}from'./shared.js';import{shouldRunLightHooks,shouldRunHeavyHooks,recordOperationFailure,recordCriticalRisk,recordCriticalOperation,recordSubstepFailure}from'../harness/auto-escalation.js';import{getHarnessTier,setHarnessTier}from'../config/runtime.js';import{getHarness}from'../harness/index.js';import{recordOperationOutcome}from'../experience/index.js';import{recordIndustrySignal}from'../knowledge/flywheel-loop.js';import{getStageCache}from'../playbooks/service-build/index.js';import{SERVICE_BUILD_STAGES}from'../playbooks/service-build/process.js';import{extractAmount,getAmountThreshold,formatAmount}from'../knowledge/safety-rules.js';function stageIndexOf(a){const b=SERVICE_BUILD_STAGES['indexOf'](a);return b>=0x0?b:0x0;}export function withTimeout(a,b=0x7530,c='operation'){let d;return Promise['race']([a['finally'](()=>{if(d)clearTimeout(d);}),new Promise((e,f)=>{d=setTimeout(()=>{let g='';c['includes']('messenger')&&(g='\x20This\x20is\x20a\x20messenger\x20network\x20operation.\x20Possible\x20causes:\x20'+'(1)\x20messenger\x20server\x20(https://messenger.wowok.net)\x20unreachable,\x20'+'(2)\x20no\x20messenger-enabled\x20account\x20configured\x20(use\x20account_operation\x20to\x20set\x20messenger\x20name),\x20'+'(3)\x20network\x20connectivity\x20issue.\x20'+'Ensure\x20you\x20have\x20a\x20messenger-enabled\x20account\x20and\x20the\x20server\x20is\x20reachable.'),f(new Error('Operation\x20\x27'+c+'\x27\x20timed\x20out\x20after\x20'+b+'ms.'+g));},b);})]);}export function wrapHandlerWithErrorShape(a,b,c,d){return async e=>{try{return await withTimeout(a(e),b,c);}catch(f){if(d){const g=f instanceof Error?f['message']:String(f),h=classifyError(g),i={'operation_type':c,'data':e},j=d(g,h,i);return{'content':[{'type':'text','text':'Error:\x20'+g}],'structuredContent':j};}throw f;}};}export const statusErrorShape=(a,b,c)=>({'result':buildClassifiedErrorResult({'status':'error'},a,b),'semantic':buildDataSemantic(undefined,c,!![],a)});export const operationErrorShape=(a,b,c)=>({'result':buildClassifiedErrorResult({'operation':'error'},a,b),'semantic':buildDataSemantic(undefined,c,!![],a)});export const strictStatusErrorShape=(a,b,c)=>({'result':{'status':'error','error':a}});function checkProjectStage(a,b,c){const d={'analyze_intent':'puzzle','aggregate_risks':'risk','trace_substeps':'substeps'},e=d[a];if(!e)return null;const f=getStageCache(b,c);if(!f){if(a==='analyze_intent')return null;return'project_stage:\x20calling\x20\x27'+a+'\x27\x20before\x20\x27analyze_intent\x27\x20—\x20recommend\x20calling\x20analyze_intent\x20first\x20for\x20project\x20\x27'+b+':'+c+'\x27';}if(stageIndexOf(f['stage'])<stageIndexOf(e)-0x1)return'project_stage:\x20calling\x20\x27'+a+'\x27\x20(stage\x20\x27'+e+'\x27)\x20but\x20project\x20is\x20at\x20stage\x20\x27'+f['stage']+'\x27\x20—\x20recommend\x20completing\x20prior\x20stages\x20first\x20for\x20\x27'+b+':'+c+'\x27';return null;}export function dispatchWithHarness(a,b){return async d=>{const f=[],g=getHarness(),h=shouldRunLightHooks(),i=shouldRunHeavyHooks(),j=isPublishOperation(b,d),k=isSignOperation(b,d),l=getHarnessTier();let m;if(h)try{const o=extractOperationType(b,d),p=extractIntent(b,d);o&&p&&(m=g['expect'](b,p,o,extractData(d)));}catch(q){f['push']('pre_call\x20hook\x20failed:\x20'+(q instanceof Error?q['message']:String(q)));}if(b==='goal_operation'&&h)try{const r=d,s=r?.['action'],t=r?.['project'],u=r?.['version'];if(s&&t&&u){const v=checkProjectStage(s,t,u);v&&f['push'](v);}}catch{}j&&l==='lightweight'&&(setHarnessTier('full'),f['push']('pre_publish:\x20tier\x20forced\x20to\x20full\x20for\x20publish-class\x20operation\x20(GLM5-21\x20§3.3)'));if(j&&l!=='off')try{const x=runPrePublishChecks(b,d);f['push'](...x['warnings']);if(x['critical']['length']>0x0){for(const y of x['critical']){const z=recordCriticalRisk(y);if(z)f['push']('Harness\x20escalated\x20to\x20full\x20tier:\x20'+z['reason']);}return buildHarnessBlockResult('pre_publish','Publish\x20BLOCKED\x20by\x20Harness\x20pre-publish\x20gate\x20(GLM5-21\x20V6):\x20'+(x['critical']['length']+'\x20CRITICAL\x20risk(s)\x20must\x20be\x20resolved\x20before\x20publish.'),x['critical'],x['warnings'],'immutable_violation','Fix\x20the\x20CRITICAL\x20risks\x20listed\x20in\x20the\x20message\x20(e.g.\x20rename\x20dispute/refund\x20nodes\x20per\x20R-M1-11,\x20add\x20the\x20entry\x20pair\x20prev_node=\x22\x22),\x20then\x20retry\x20publish.\x20Nodes/pairs/forwards\x20are\x20immutable\x20after\x20publish\x20—\x20verify\x20via\x20machineNode2file\x20first.');}}catch(A){f['push']('pre_publish\x20hook\x20failed:\x20'+(A instanceof Error?A['message']:String(A)));}if(k&&i)try{const B=extractData(d),C=B?extractAmount(B):null;if(C!==null){const D=getAmountThreshold();let E=null;try{E=BigInt(C);}catch{E=null;}if(E!==null&&E>D)return buildHarnessBlockResult('pre_sign','Sign\x20BLOCKED\x20by\x20Harness\x20pre-sign\x20gate\x20(GLM5-21\x20V7):\x20amount\x20'+formatAmount(E)+'\x20WOW\x20exceeds\x20the\x20full-tier\x20threshold\x20'+formatAmount(D)+'\x20WOW.',['amount\x20'+C+'\x20(smallest\x20unit)\x20>\x20threshold\x20'+D['toString']()+'\x20(smallest\x20unit)'],[],'invalid_parameter','Raise\x20WOWOK_AMOUNT_THRESHOLD\x20to\x20match\x20the\x20intended\x20amount,\x20split\x20the\x20transaction,\x20or\x20reset\x20the\x20harness\x20tier\x20to\x20lightweight\x20(config_operation)\x20after\x20explicit\x20user\x20confirmation.');}}catch(F){f['push']('pre_sign\x20hook\x20failed:\x20'+(F instanceof Error?F['message']:String(F)));}let n;try{n=await a(d);}catch(G){const H=G instanceof Error?G['message']:String(G),I=recordOperationFailure(b,H);I&&f['push']('Harness\x20escalated\x20to\x20full\x20tier:\x20'+I['reason']);if(b==='onchain_operations')try{const J=classifyError(H,G);if(!J['retryable']&&J['error_code']!=='unknown'){const K=recordCriticalOperation(b,J['error_code']);if(K)f['push']('Harness\x20escalated\x20to\x20full\x20tier:\x20'+K['reason']);}}catch{}throw G;}if(h&&m)try{if(n?.['structuredContent']){const L=buildVerifyInput(m,n),M=g['verify'](L);if(M['status']==='fail')f['push']('Harness\x20verify\x20FAIL:\x20'+M['summary']);else M['status']==='warn'&&f['push']('Harness\x20verify\x20WARN:\x20'+M['summary']);}}catch(N){f['push']('post_call\x20hook\x20failed:\x20'+(N instanceof Error?N['message']:String(N)));}if(b==='onchain_operations')try{if(classifyOutcome(n)==='failed'){const O=extractErrorCode(n)??'',P=classifyError(O);if(!P['retryable']&&P['error_code']!=='unknown'){const Q=recordCriticalOperation(b,P['error_code']);if(Q)f['push']('Harness\x20escalated\x20to\x20full\x20tier:\x20'+Q['reason']);}}}catch{}if(h){const R=extractIntent(b,d)??b;try{const S=classifyOutcome(n);if(S==='failed'){const T=extractErrorCode(n)??'',U=classifyError(T),V=g['recover'](U['error_code'],R,{'operation_type':b,'data':extractData(d)});f['push']('Harness\x20recover:\x20strategy='+V['strategy']+('\x20(attempt\x20'+V['current_attempt']+'/'+V['max_attempts']+')')+(V['should_retry']?'\x20—\x20retryable':'\x20—\x20do\x20NOT\x20retry\x20blindly')+(V['user_prompt']?'\x20—\x20'+V['user_prompt']:'\x20—\x20'+V['detail']));}else S==='success'&&g['resetRecovery'](R);}catch(W){f['push']('recover\x20hook\x20failed:\x20'+(W instanceof Error?W['message']:String(W)));}}if(b==='goal_operation')try{const X=d?.['action'];if(X==='trace_substeps'){const Y=extractCriticalFindingCount(n);if(Y>0x0){const Z=recordSubstepFailure(String(X)+':\x20'+Y+'\x20critical\x20finding(s)');if(Z)f['push']('Harness\x20escalated\x20to\x20full\x20tier:\x20'+Z['reason']);}}}catch{}if(isWriteClassTool(b))try{const a0=extractOperationType(b,d)??b,a1=extractIntent(b,d)??b,a2=extractData(d)??d,a3=classifyOutcome(n),a4=extractErrorCode(n),a5=extractIndustry(d)??'general';recordOperationOutcome(a0,a2,a1,a3,a4),recordIndustrySignal(a5,{'type':a0},{'success':a3==='success','error_code':a4});}catch(a6){f['push']('signal\x20collection\x20failed:\x20'+(a6 instanceof Error?a6['message']:String(a6)));}if(f['length']>0x0){if(n?.['structuredContent']){const a7=n['structuredContent'],a8=a7['semantic'];if(a8){const a9=Array['isArray'](a8['warnings'])?a8['warnings']:[];a8['warnings']=[...a9,...f];}else for(const aa of f){console['warn']('[harness]\x20'+aa);}}else for(const ab of f){console['warn']('[harness]\x20'+ab);}}return n;};}function isPublishOperation(a,b){if(a!=='onchain_operations')return![];const c=extractOperationType(a,b);if(c!=='service'&&c!=='machine')return![];const d=extractData(b);return d?.['publish']===!![]||d?.['bPublished']===!![];}function isSignOperation(a,b){if(a==='wip_file'){const c=b?.['operation_type'];return c==='sign';}return a==='onchain_operations';}function extractOperationType(a,b){if(!b||typeof b!=='object')return undefined;const c=b;if(a==='onchain_operations')return typeof c['operation_type']==='string'?c['operation_type']:undefined;if(a==='goal_operation'||a==='industry_pack_operation')return typeof c['action']==='string'?c['action']:undefined;return typeof c['operation_type']==='string'?c['operation_type']:undefined;}function extractIntent(a,b){if(!b||typeof b!=='object')return undefined;const c=b;if((a==='goal_operation'||a==='industry_pack_operation')&&typeof c['action']==='string')return a+':'+c['action'];const d=c['operation_type'];if(typeof d==='string')return a+':'+d;return a;}function extractData(a){if(!a||typeof a!=='object')return undefined;const b=a,c=b['data'];return c&&typeof c==='object'?c:undefined;}function buildVerifyInput(a,b){const c=b['structuredContent']??{},d=c['semantic'];return{'expected':a,'actual':{'result_type':typeof c['result_type']==='string'?c['result_type']:undefined,'semantic':d,'error_code':typeof c['error_code']==='string'?c['error_code']:undefined,'error':typeof c['error']==='string'?c['error']:undefined}};}const WRITE_CLASS_TOOLS=new Set(['onchain_operations','goal_operation','industry_pack_operation','wip_file','messenger_operation','bridge_operation']);function isWriteClassTool(a){return WRITE_CLASS_TOOLS['has'](a);}function classifyOutcome(a){if(!a?.['structuredContent'])return'failed';const b=a['structuredContent'],c=typeof b['status']==='string'?b['status']:typeof b['result_type']==='string'?b['result_type']:'';if(c==='error'||c==='failed')return'failed';if(c==='partial')return'partial';return'success';}function extractErrorCode(a){if(!a?.['structuredContent'])return undefined;const b=a['structuredContent'];if(typeof b['error_code']==='string')return b['error_code'];const c=b['error'];if(typeof c==='string')return c;if(c&&typeof c==='object'){const d=c['code'];if(typeof d==='string')return d;}return undefined;}function extractIndustry(a){if(!a||typeof a!=='object')return undefined;const b=a;if(typeof b['industry']==='string')return b['industry'];const c=b['data'];if(c&&typeof c==='object'){const e=c;if(typeof e['industry']==='string')return e['industry'];}return undefined;}const ANTI_PATTERN_NODE_REGEX=/(^|_)(disputed?|refund(?:ed)?|arbitration|arb)(_|$)/i;function runPrePublishChecks(a,b){const c=[],d=[],e=extractOperationType(a,b),g=extractData(b)??{};if(e==='machine'){const h=g['node'],i=Array['isArray'](h)?h:Array['isArray'](h?.['nodes'])?h['nodes']:[];if(i['length']>0x0){for(const l of i){const m=typeof l?.['name']==='string'?l['name']:'';m&&ANTI_PATTERN_NODE_REGEX['test'](m)&&c['push']('R-M1-11:\x20machine\x20node\x20\x22'+m+'\x22\x20models\x20dispute/refund\x20flow\x20—\x20'+'refunds\x20must\x20route\x20via\x20an\x20Allocator\x20triggered\x20by\x20business\x20states,\x20'+'disputes\x20via\x20the\x20separate\x20Arbitration\x20object\x20(off-Machine)');}const j=new Set();for(const o of i){const q=typeof o?.['name']==='string'?o['name']:'';if(!q)continue;j['has'](q)&&c['push']('MC-C-04:\x20duplicate\x20machine\x20node\x20name\x20\x22'+q+'\x22\x20—\x20on-chain\x20will\x20reject\x20the\x20publish\x20transaction'),j['add'](q);}const k=i['some'](r=>Array['isArray'](r?.['pairs'])&&r['pairs']['some'](s=>s?.['prev_node']===''));!k&&c['push']('Machine\x20has\x20no\x20entry\x20pair\x20(prev_node=\x22\x22)\x20—\x20Progress\x20can\x20never\x20advance\x20'+'from\x20the\x20initial\x20state;\x20orders\x20are\x20permanently\x20stuck');for(const r of i){const s=typeof r?.['name']==='string'?r['name']:'?';for(const t of r?.['pairs']??[]){for(const u of t?.['forwards']??[]){const v=u?.['namedOperator']!==undefined&&u?.['namedOperator']!==null,w=u?.['permissionIndex']!==undefined&&u?.['permissionIndex']!==null;!v&&!w&&d['push']('pre_publish:\x20node\x20\x22'+s+'\x22\x20forward\x20\x22'+String(u?.['name']??'?')+'\x22\x20has\x20neither\x20namedOperator\x20nor\x20permissionIndex\x20—\x20no\x20one\x20can\x20advance\x20it');}}}}else d['push']('pre_publish:\x20publishing\x20machine\x20without\x20inline\x20node\x20data\x20—\x20topology\x20not\x20verifiable\x20in\x20this\x20call;\x20'+'verify\x20nodes/pairs/forwards\x20via\x20machineNode2file\x20BEFORE\x20publish\x20(immutable\x20after\x20publish,\x20IMMUT-001)');d['push']('pre_publish:\x20machine\x20nodes/pairs/forwards\x20become\x20immutable\x20after\x20publish\x20(IMMUT-001)');}return e==='service'&&(d['push']('pre_publish:\x20service\x20machine/order_allocators/arbitrations\x20become\x20immutable\x20after\x20publish\x20(IMMUT-002);\x20sales\x20remains\x20modifiable'),g['machine']===undefined&&d['push']('pre_publish:\x20\x27machine\x27\x20not\x20set\x20in\x20this\x20call\x20—\x20if\x20the\x20service\x20was\x20never\x20bound\x20to\x20a\x20published\x20machine,\x20'+'it\x20cannot\x20process\x20orders\x20and\x20CANNOT\x20be\x20fixed\x20after\x20publish'),g['order_allocators']===undefined&&d['push']('pre_publish:\x20\x27order_allocators\x27\x20not\x20set\x20in\x20this\x20call\x20—\x20immutable\x20after\x20publish;\x20'+'orders\x20will\x20have\x20no\x20fund\x20distribution\x20if\x20never\x20configured')),{'critical':c,'warnings':d};}function buildHarnessBlockResult(a,b,c,d,e,f){const g=[...c['map'](i=>'CRITICAL:\x20'+i),...d['map'](i=>'WARN:\x20'+i)]['join']('\x0a'),h='Error:\x20'+b+(g?'\x0a'+g:'')+'\x0aRecovery:\x20'+f;return{'content':[{'type':'text','text':h}],'structuredContent':{'result':{'type':'error','error':b+'\x20[gate='+a+']','error_code':e,'retryable':![],'recovery_hint':f},'message':h}};}function extractCriticalFindingCount(a){const b=a?.['structuredContent'];if(!b)return 0x0;const c=b['semantic'],d=c?.['summary'];if(typeof d?.['critical_count']==='number'&&d['critical_count']>0x0)return d['critical_count'];const e=b['findings']??c?.['findings'];if(Array['isArray'](e))return e['filter'](h=>h?.['severity']==='error')['length'];const f=a?.['content']?.['map'](h=>'text'in h?h['text']:'')['join']('\x0a')??'',g=f['match'](/\[AUDIT ERROR\]/g);return g?g['length']:0x0;}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wowok/agent-mcp",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Making It Easy for AI Agents to Communicate, Collaborate, Trade, and Trust.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"license": "Apache-2.0",
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
53
|
-
"@wowok/wowok": "3.0.
|
|
53
|
+
"@wowok/wowok": "3.0.3",
|
|
54
54
|
"lodash": "^4.18.1",
|
|
55
55
|
"zod": "^4.2.0"
|
|
56
56
|
},
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Open Dispute on an Order (Arbitration Case Creation)",
|
|
3
|
-
"description": "Customer opens a dispute on order myshop_order_v1 via the MyShop Arbitration object, paying the dispute fee and naming the new Arb case object for later vote/verdict operations.",
|
|
4
|
-
"tags": ["arbitration", "dispute", "order", "retail"],
|
|
5
|
-
"industry": "retail",
|
|
6
|
-
"operation_type": "arbitration",
|
|
7
|
-
"source": "constructed under T-09 authorization; grounded in DisputeSchema + SDK arbitration.ts dispute flow + arb.move dispute_imp — schema-validated, not chain-verified",
|
|
8
|
-
"verified": false,
|
|
9
|
-
"network": "testnet",
|
|
10
|
-
"call": {
|
|
11
|
-
"tool": "onchain_operations",
|
|
12
|
-
"operation_type": "arbitration",
|
|
13
|
-
"data": {
|
|
14
|
-
"object": "myshop_arbitration_v2",
|
|
15
|
-
"dispute": {
|
|
16
|
-
"order": "myshop_order_v1",
|
|
17
|
-
"description": "Toy arrived damaged; requesting refund per service promise.",
|
|
18
|
-
"proposition": [
|
|
19
|
-
"Full refund to customer",
|
|
20
|
-
"Partial refund 50%",
|
|
21
|
-
"No refund — service delivered as promised"
|
|
22
|
-
],
|
|
23
|
-
"fee": { "balance": 5000000 },
|
|
24
|
-
"namedArb": { "name": "myshop_dispute_v1" }
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"env": {
|
|
28
|
-
"network": "testnet",
|
|
29
|
-
"no_cache": true,
|
|
30
|
-
"confirmed": true
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"notes": [
|
|
34
|
-
"PREREQUISITES (SDK-validated client-side): the Arbitration must NOT be paused (bPaused=false — new Arbitrations are created paused; unpause first via {object:'myshop_arbitration_v2', pause:false}); the Order must not be already claimed (claimed_by empty) and must have fewer than MAX_DISPUTE_COUNT disputes.",
|
|
35
|
-
"fee uses CoinParam {balance: <smallest unit>} — 5000000 = 0.005 WOW (9 decimals). Contract asserts fee >= arbitration.fee (E_FEE_NOT_ENOUGH); excess is split and returned to the sender.",
|
|
36
|
-
"proposition is the list of options voters choose between; votes reference propositions by 0-BASED INDEX (0='Full refund', 1='Partial 50%', 2='No refund'). Order matters and is immutable once the Arb is created.",
|
|
37
|
-
"namedArb names the NEW Arb (arbitration case) object — strongly recommended: subsequent confirm/vote/arbitration calls reference the case by this name ('myshop_dispute_v1') instead of a raw address.",
|
|
38
|
-
"If the Arbitration has a usage_guard configured, the dispute caller must pass that Guard (SDK auto-adds it to the passport verification list). This example assumes no usage_guard.",
|
|
39
|
-
"The Arb case is created in a pre-voting state; the arbitrator next calls confirm with a voting_deadline to open the voting window."
|
|
40
|
-
]
|
|
41
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Vote on Dispute Propositions via Voting Guard",
|
|
3
|
-
"description": "Eligible arbitrator casts a weighted vote for proposition 0 (full refund) on dispute case myshop_dispute_v1, verifying through the configured voting_guard.",
|
|
4
|
-
"tags": ["arbitration", "vote", "dispute", "guard"],
|
|
5
|
-
"industry": "retail",
|
|
6
|
-
"operation_type": "arbitration",
|
|
7
|
-
"source": "constructed under T-09 authorization; grounded in VoteSchema + SDK arbitration.ts vote flow + arb.move vote (re-vote replaces) — schema-validated, not chain-verified",
|
|
8
|
-
"verified": false,
|
|
9
|
-
"network": "testnet",
|
|
10
|
-
"call": {
|
|
11
|
-
"tool": "onchain_operations",
|
|
12
|
-
"operation_type": "arbitration",
|
|
13
|
-
"data": {
|
|
14
|
-
"object": "myshop_arbitration_v2",
|
|
15
|
-
"vote": {
|
|
16
|
-
"arb": "myshop_dispute_v1",
|
|
17
|
-
"votes": [0],
|
|
18
|
-
"voting_guard": "arbitrator_eligibility_guard"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"env": {
|
|
22
|
-
"network": "testnet",
|
|
23
|
-
"no_cache": true,
|
|
24
|
-
"confirmed": true
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"notes": [
|
|
28
|
-
"votes elements are PROPOSITION INDICES (u8, 0-based) into the dispute's proposition list — [0] means 'agree with proposition 0 (Full refund)'. Voting for multiple propositions at once is allowed (e.g. [0,1]); each listed index receives the voter's full weight. An out-of-range index aborts with E_PROPOSITION_NOT_FOUND.",
|
|
29
|
-
"RE-VOTING REPLACES: a second vote by the same voter removes the old weight from previously voted indices and applies it to the new set (arb.move vote). There is no separate 'unvote' operation.",
|
|
30
|
-
"SDK REQUIREMENT (call/arbitration.ts L264-273): when voting on an EXISTING Arbitration through the SDK/MCP path, vote.voting_guard is effectively REQUIRED — the SDK adds it to the passport verification list and errors 'vote.voting_guard invalid' if omitted, even though the MCP schema marks it optional. Always provide it.",
|
|
31
|
-
"PREREQUISITES: (1) the Arb case must be in Status_Voting — the arbitrator has called confirm with a voting_deadline; (2) voting must be within the deadline (E_VOTING_DEADLINE_PASSED); (3) the guard must be in the Arbitration's voting_guard list (see arbitration-voting-guard-add example) and the voter must pass its verification.",
|
|
32
|
-
"Weight resolution (arbitration.move vote_with_voting_guard): {FixedValue: n} → weight n; {GuardIdentifier: i} → weight read from the voter's passport submission at that Guard table index.",
|
|
33
|
-
"Voting concludes when the arbitrator calls arbitration (verdict) with an indemnity amount; the verdict only RECORDS the indemnity on the Arb — the customer then claims compensation from the Service's compensation_fund via order compensation_claim."
|
|
34
|
-
]
|
|
35
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Configure Weighted Voting Guard on Arbitration",
|
|
3
|
-
"description": "Add an eligibility Guard to the Arbitration's voting_guard list with a fixed vote weight, enabling guard-based weighted voting for dispute cases.",
|
|
4
|
-
"tags": ["arbitration", "voting_guard", "guard", "governance"],
|
|
5
|
-
"industry": "retail",
|
|
6
|
-
"operation_type": "arbitration",
|
|
7
|
-
"source": "constructed under T-09 authorization; grounded in VotingGuardActionSchema + VoteWeightSchema + arbitration.move voting_guard_fixed_add — schema-validated, not chain-verified",
|
|
8
|
-
"verified": false,
|
|
9
|
-
"network": "testnet",
|
|
10
|
-
"call": {
|
|
11
|
-
"tool": "onchain_operations",
|
|
12
|
-
"operation_type": "arbitration",
|
|
13
|
-
"data": {
|
|
14
|
-
"object": "myshop_arbitration_v2",
|
|
15
|
-
"voting_guard": {
|
|
16
|
-
"op": "add",
|
|
17
|
-
"guards": [
|
|
18
|
-
{
|
|
19
|
-
"guard": "arbitrator_eligibility_guard",
|
|
20
|
-
"vote_weight": { "FixedValue": 1 }
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"env": {
|
|
26
|
-
"network": "testnet",
|
|
27
|
-
"no_cache": true,
|
|
28
|
-
"confirmed": true
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"notes": [
|
|
32
|
-
"Two voting modes exist (arbitration.move): OPEN voting (voting_guard list EMPTY — any permission-358 holder votes with weight 1 via vote_imp) and GUARD-WEIGHTED voting (list non-empty — only listed Guards can vote, via vote_with_voting_guard). This call switches the Arbitration to guard-weighted mode.",
|
|
33
|
-
"vote_weight variants (VoteWeightSchema): {FixedValue: n} gives every verified voter weight n (u32, max 65535 in schema); {GuardIdentifier: i} reads the weight dynamically from the voter's Passport submission value at Guard table index i (e.g. reputation-score-weighted voting).",
|
|
34
|
-
"The Guard itself ('arbitrator_eligibility_guard') must exist beforehand (operation_type:'guard') — e.g. a Guard checking the voter holds an arbitrator credential or stake.",
|
|
35
|
-
"op variants: 'add'/'set' take VotingGuard objects; 'remove' takes plain guard names/addresses; 'clear' empties the list (returning to open voting). Requires Arbitration permission index 354 (ARBITRATION_VOTING_GUARD).",
|
|
36
|
-
"Once ANY voting_guard is configured, plain vote (no guard) aborts with E_VOTING_GUARD_USED — every voter must verify through one of the listed Guards."
|
|
37
|
-
]
|
|
38
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Present Service to a Demand (Recommendation)",
|
|
3
|
-
"description": "Recommend myshop_service_v2 to an open Demand object with a recommendation letter, entering the Demand's presenter list for reward eligibility.",
|
|
4
|
-
"tags": ["demand", "present", "recommendation", "service"],
|
|
5
|
-
"industry": "retail",
|
|
6
|
-
"operation_type": "demand",
|
|
7
|
-
"source": "constructed under T-09 authorization; grounded in DemandPresentSchema + demand.ts SDK — schema-validated, not chain-verified",
|
|
8
|
-
"verified": false,
|
|
9
|
-
"network": "testnet",
|
|
10
|
-
"call": {
|
|
11
|
-
"tool": "onchain_operations",
|
|
12
|
-
"operation_type": "demand",
|
|
13
|
-
"data": {
|
|
14
|
-
"object": "toy_repair_demand_v1",
|
|
15
|
-
"present": {
|
|
16
|
-
"recommend": "Our toy repair service matches this demand: 7-day turnaround, WOW escrow payment, independent arbitration coverage.",
|
|
17
|
-
"service": "myshop_service_v2"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"env": {
|
|
21
|
-
"network": "testnet",
|
|
22
|
-
"no_cache": true,
|
|
23
|
-
"confirmed": true
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"notes": [
|
|
27
|
-
"present makes the CALLER a Presenter on the Demand: the recommendation letter (recommend, REQUIRED) plus an optional service reference. Presenters become eligible to claim the Demand's reward pool when the demander accepts their recommendation.",
|
|
28
|
-
"If the Demand has guards configured (ServiceGuard list), the presented Service is verified against them — a Guard may filter which Services qualify (e.g. must have arbitration bound, must be in a category). Use by_guard to select which configured Guard to verify through when several are present.",
|
|
29
|
-
"service is optional but recommended — a bare recommendation without a Service reference gives the demander nothing to inspect.",
|
|
30
|
-
"Follow-up flow: the demander reviews presenters (query_table on DemandPresenter), buys the presented Service, and may leave feedback (FeedbackInfo: acceptance_score 0-255 + feedback text) which updates the presenter's on-chain reputation.",
|
|
31
|
-
"PREREQUISITE: 'toy_repair_demand_v1' exists (created via operation_type:'demand' with object {name, permission, rewards...}) and 'myshop_service_v2' is a published Service."
|
|
32
|
-
]
|
|
33
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Create Education Contact Object",
|
|
3
|
-
"description": "Create a named Contact object for an education provider, with a Permission reference and an IM entry pointing at the support account",
|
|
4
|
-
"tags": ["contact", "messenger", "ims", "education"],
|
|
5
|
-
"industry": "education",
|
|
6
|
-
"operation_type": "contact",
|
|
7
|
-
"source": "Template-generated from K2 industry defaults (not chain-verified)",
|
|
8
|
-
"verified": false,
|
|
9
|
-
"network": "testnet",
|
|
10
|
-
"call": {
|
|
11
|
-
"tool": "onchain_operations",
|
|
12
|
-
"operation_type": "contact",
|
|
13
|
-
"data": {
|
|
14
|
-
"object": {
|
|
15
|
-
"name": "education_contact",
|
|
16
|
-
"permission": "education_permission",
|
|
17
|
-
"replaceExistName": true
|
|
18
|
-
},
|
|
19
|
-
"description": "Education provider contact — course info, attendance, and refund policy",
|
|
20
|
-
"ims": {
|
|
21
|
-
"op": "add",
|
|
22
|
-
"im": [
|
|
23
|
-
{
|
|
24
|
-
"at": "education_support",
|
|
25
|
-
"description": "Primary support account"
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"env": {
|
|
31
|
-
"network": "testnet",
|
|
32
|
-
"no_cache": true,
|
|
33
|
-
"confirmed": true
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"notes": [
|
|
37
|
-
"Bind this Contact to the education Service via the service call's 'um' field.",
|
|
38
|
-
"Tuition should be escrowed and released per lesson (1/N) to prevent run-away disputes."
|
|
39
|
-
]
|
|
40
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Create Freelance Contact Object",
|
|
3
|
-
"description": "Create a named Contact object for a freelance service provider, with a Permission reference and an IM entry pointing at the provider account",
|
|
4
|
-
"tags": ["contact", "messenger", "ims", "freelance"],
|
|
5
|
-
"industry": "freelance",
|
|
6
|
-
"operation_type": "contact",
|
|
7
|
-
"source": "Template-generated from K2 industry defaults (not chain-verified)",
|
|
8
|
-
"verified": false,
|
|
9
|
-
"network": "testnet",
|
|
10
|
-
"call": {
|
|
11
|
-
"tool": "onchain_operations",
|
|
12
|
-
"operation_type": "contact",
|
|
13
|
-
"data": {
|
|
14
|
-
"object": {
|
|
15
|
-
"name": "freelancer_contact",
|
|
16
|
-
"permission": "freelancer_permission",
|
|
17
|
-
"replaceExistName": true
|
|
18
|
-
},
|
|
19
|
-
"description": "Freelance provider contact — reach me for project requirements and delivery milestones",
|
|
20
|
-
"ims": {
|
|
21
|
-
"op": "add",
|
|
22
|
-
"im": [
|
|
23
|
-
{
|
|
24
|
-
"at": "freelancer",
|
|
25
|
-
"description": "Primary provider account"
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"env": {
|
|
31
|
-
"network": "testnet",
|
|
32
|
-
"no_cache": true,
|
|
33
|
-
"confirmed": true
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"notes": [
|
|
37
|
-
"Bind this Contact to the freelance Service via the service call's 'um' field.",
|
|
38
|
-
"ims.im[].at accepts an account name or a full 0x address."
|
|
39
|
-
]
|
|
40
|
-
}
|