@wowok/agent-mcp 2.6.3 → 2.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -9
- package/dist/customer/customer-advice.d.ts +31 -0
- package/dist/customer/customer-advice.js +129 -0
- package/dist/customer/index.d.ts +2 -0
- package/dist/customer/index.js +2 -0
- package/dist/customer/info-puzzle.d.ts +8 -1
- package/dist/customer/info-puzzle.js +30 -5
- package/dist/customer/order-monitor.d.ts +2 -0
- package/dist/customer/order-monitor.js +3 -2
- package/dist/customer/post-purchase.d.ts +2 -0
- package/dist/customer/post-purchase.js +6 -5
- package/dist/customer/preorder-compare.d.ts +24 -0
- package/dist/customer/preorder-compare.js +34 -0
- package/dist/customer/reminder-system.d.ts +2 -0
- package/dist/customer/reminder-system.js +2 -1
- package/dist/customer/risk-assessment.js +4 -3
- package/dist/customer/types.d.ts +5 -0
- package/dist/examples/arbitration-dispute-create.json +41 -0
- package/dist/examples/arbitration-vote-weighted.json +35 -0
- package/dist/examples/arbitration-voting-guard-add.json +38 -0
- package/dist/examples/demand-present-service.json +33 -0
- package/dist/examples/gen-passport-verify-guard.json +48 -0
- package/dist/examples/guard-template-balance-check.json +36 -15
- package/dist/examples/guard-template-time-lock.json +33 -12
- package/dist/examples/insurance-guard-claim-timelock.json +75 -0
- package/dist/examples/insurance-guard-withdraw-allocation.json +96 -0
- package/dist/examples/insurance-machine-create-publish.json +75 -0
- package/dist/examples/insurance-service-allocators-publish.json +56 -0
- package/dist/examples/machine-multisig-threshold.json +86 -0
- package/dist/examples/machine-template-7node-rental.json +99 -94
- package/dist/examples/payment-scenario-bound.json +45 -0
- package/dist/examples/rental-ziroom-machine-create.json +126 -114
- package/dist/examples/rental-ziroom-permission-create.json +10 -3
- package/dist/examples/rental-ziroom-service-create.json +27 -18
- package/dist/examples/retail-adv-guard-customer-win-create.json +80 -0
- package/dist/examples/retail-adv-guard-messenger-proof-create.json +65 -0
- package/dist/examples/retail-adv-guard-reward-timeout-create.json +92 -0
- package/dist/examples/retail-adv-reward-guard-add.json +51 -0
- package/dist/examples/retail-myshop-allocation-activate.json +55 -0
- package/dist/examples/retail-myshop-arbitration-create.json +40 -0
- package/dist/examples/retail-myshop-contact-create.json +43 -0
- package/dist/examples/retail-myshop-order-create.json +56 -0
- package/dist/examples/retail-myshop-progress-operate.json +38 -0
- package/dist/examples/retail-myshop-reward-create.json +35 -0
- package/dist/examples/service-discount-issue.json +46 -0
- package/dist/examples/threebody-guard-create.json +56 -0
- package/dist/examples/threebody-machine-create.json +72 -0
- package/dist/examples/threebody-permission-create.json +38 -0
- package/dist/examples/threebody-service-allocators.json +49 -0
- package/dist/examples/travel-guard-time-lock.json +69 -0
- package/dist/examples/travel-guard-weather-oracle.json +70 -0
- package/dist/examples/travel-machine-create.json +136 -0
- package/dist/examples/travel-repository-create.json +47 -0
- package/dist/examples/travel-service-create.json +102 -0
- package/dist/examples/travel-treasury-create.json +34 -0
- package/dist/examples/treasury-deposit.json +37 -0
- package/dist/examples/treasury-withdraw.json +38 -0
- package/dist/extensions/business-modules.d.ts +49 -0
- package/dist/extensions/business-modules.js +287 -0
- package/dist/extensions/capability-manifest.js +192 -5
- package/dist/extensions/constraint-registry.js +3 -1
- package/dist/extensions/modes.js +10 -4
- package/dist/extensions/registry.d.ts +14 -9
- package/dist/extensions/registry.js +69 -14
- package/dist/extensions/types.d.ts +1 -0
- package/dist/knowledge/fund-layer.d.ts +67 -1
- package/dist/knowledge/fund-layer.js +561 -12
- package/dist/knowledge/guard-templates.d.ts +10 -0
- package/dist/knowledge/guard-templates.js +50 -0
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.js +2 -2
- package/dist/knowledge/machine-risk.js +4 -1
- package/dist/knowledge/progress-context.js +1 -1
- package/dist/knowledge/progress-ledger.js +3 -3
- package/dist/knowledge/progress-templates.js +1 -1
- package/dist/knowledge/progress-translation.js +1 -1
- package/dist/knowledge/safety-rules.d.ts +83 -1
- package/dist/knowledge/safety-rules.js +166 -2
- package/dist/knowledge/scenario-modes.d.ts +1 -1
- package/dist/knowledge/scenario-modes.js +13 -11
- package/dist/knowledge/template-registry.d.ts +48 -0
- package/dist/knowledge/template-registry.js +341 -0
- package/dist/knowledge/tool-constraints.js +6 -6
- package/dist/knowledge/tools-reference.js +11 -8
- package/dist/participation/merchant-interest.d.ts +32 -0
- package/dist/participation/merchant-interest.js +100 -0
- package/dist/participation/radar-core.d.ts +104 -0
- package/dist/participation/radar-core.js +269 -0
- package/dist/project/context-assembly.js +8 -0
- package/dist/project/edit-planner.js +27 -56
- package/dist/project/evaluation.d.ts +36 -0
- package/dist/project/evaluation.js +422 -56
- package/dist/project/game-theory.d.ts +43 -0
- package/dist/project/game-theory.js +177 -0
- package/dist/project/graph-builder.js +1 -0
- package/dist/project/handlers.d.ts +38 -0
- package/dist/project/handlers.js +65 -35
- package/dist/project/intent-analyzer.d.ts +71 -0
- package/dist/project/intent-analyzer.js +149 -0
- package/dist/project/machine-nodes.d.ts +2 -0
- package/dist/project/machine-nodes.js +36 -0
- package/dist/project/merchant-guide.d.ts +165 -0
- package/dist/project/merchant-guide.js +264 -0
- package/dist/project/mode-actions.d.ts +199 -0
- package/dist/project/mode-actions.js +309 -0
- package/dist/project/participation-radar.d.ts +18 -0
- package/dist/project/participation-radar.js +428 -0
- package/dist/project/pipeline-actions.d.ts +101 -0
- package/dist/project/pipeline-actions.js +109 -0
- package/dist/project/semantic-graph.d.ts +95 -0
- package/dist/project/semantic-graph.js +245 -0
- package/dist/schema/call/allocation.d.ts +11 -11
- package/dist/schema/call/allocation.js +11 -1
- package/dist/schema/call/arbitration.d.ts +21 -21
- package/dist/schema/call/arbitration.js +17 -9
- package/dist/schema/call/base.d.ts +2 -2
- package/dist/schema/call/base.js +1 -1
- package/dist/schema/call/bridge.d.ts +127 -127
- package/dist/schema/call/bridge.js +12 -12
- package/dist/schema/call/contact.d.ts +3 -3
- package/dist/schema/call/demand.d.ts +3 -3
- package/dist/schema/call/guard.d.ts +11 -11
- package/dist/schema/call/guard.js +1 -1
- package/dist/schema/call/machine.d.ts +216 -21
- package/dist/schema/call/machine.js +1 -1
- package/dist/schema/call/order.d.ts +7 -7
- package/dist/schema/call/payment.d.ts +3 -3
- package/dist/schema/call/permission.d.ts +3 -3
- package/dist/schema/call/personal.d.ts +337 -3
- package/dist/schema/call/personal.js +10 -0
- package/dist/schema/call/progress.d.ts +177 -9
- package/dist/schema/call/progress.js +7 -3
- package/dist/schema/call/proof.d.ts +6 -6
- package/dist/schema/call/repository.d.ts +3 -3
- package/dist/schema/call/reward.d.ts +57 -57
- package/dist/schema/call/semantic.js +41 -1
- package/dist/schema/call/service.d.ts +114 -114
- package/dist/schema/call/service.js +11 -2
- package/dist/schema/call/treasury.d.ts +57 -57
- package/dist/schema/messenger/index.js +4 -1
- package/dist/schema/operations.d.ts +713 -291
- package/dist/schema/operations.js +33 -0
- package/dist/schema/project/index.d.ts +4635 -100
- package/dist/schema/project/index.js +868 -1
- package/dist/schema/query/index.d.ts +363 -19
- package/dist/schema/query/index.js +25 -3
- package/dist/schema/schema-query/index.d.ts +13 -7
- package/dist/schema/schema-query/index.js +29 -5
- package/dist/schema/trust/index.d.ts +1012 -6
- package/dist/schema/trust/index.js +212 -11
- package/dist/schema/utils/skills-recommendation.js +1 -0
- package/dist/schema-query/index.d.ts +4 -1
- package/dist/schema-query/index.js +255 -1
- package/dist/schemas/bridge_operation.schema.json +14 -7
- package/dist/schemas/guard2file.schema.json +2 -0
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/machineNode2file.schema.json +2 -0
- package/dist/schemas/messenger_operation.schema.json +1 -1
- package/dist/schemas/onchain_operations.schema.json +143 -15
- package/dist/schemas/onchain_operations_allocation.schema.json +2 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +7 -5
- package/dist/schemas/onchain_operations_contact.schema.json +1 -0
- package/dist/schemas/onchain_operations_demand.schema.json +1 -0
- package/dist/schemas/onchain_operations_gen_passport.schema.json +2 -0
- package/dist/schemas/onchain_operations_gen_proof.schema.json +2 -0
- package/dist/schemas/onchain_operations_guard.schema.json +578 -0
- package/dist/schemas/onchain_operations_machine.schema.json +1 -0
- package/dist/schemas/onchain_operations_order.schema.json +4 -3
- package/dist/schemas/onchain_operations_payment.schema.json +1 -0
- package/dist/schemas/onchain_operations_permission.schema.json +1 -0
- package/dist/schemas/onchain_operations_personal.schema.json +37 -0
- package/dist/schemas/onchain_operations_progress.schema.json +90 -3
- package/dist/schemas/onchain_operations_proof.schema.json +1 -0
- package/dist/schemas/onchain_operations_repository.schema.json +1 -0
- package/dist/schemas/onchain_operations_reward.schema.json +1 -0
- package/dist/schemas/onchain_operations_service.schema.json +4 -3
- package/dist/schemas/onchain_operations_treasury.schema.json +1 -0
- package/dist/schemas/project_operation.output.json +2243 -1
- package/dist/schemas/project_operation.schema.json +683 -1
- package/dist/schemas/query_toolkit.output.json +1 -1
- package/dist/schemas/query_toolkit.schema.json +37 -0
- package/dist/schemas/schema_query.output.json +1 -1
- package/dist/schemas/schema_query.schema.json +30 -5
- package/dist/schemas/trust_score.output.json +392 -1
- package/dist/schemas/trust_score.schema.json +275 -1
- package/dist/tools/handlers/onchain.js +73 -8
- package/dist/tools/handlers/project.js +46 -0
- package/dist/tools/handlers/query.js +117 -2
- package/dist/tools/handlers/schema-query.js +41 -0
- package/dist/tools/handlers/trust.js +192 -6
- package/dist/tools/index.js +52 -9
- package/dist/tools/wrap.js +194 -15
- package/package.json +2 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Reward Pool Object (MyShop Retail)",
|
|
3
|
+
"description": "Create an empty Reward object for MyShop service-quality rewards and compensation. The Reward is later referenced by claim Guards that prevent double-claiming, and funded via coin_add.",
|
|
4
|
+
"tags": ["reward", "claim", "retail"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "reward",
|
|
7
|
+
"source": "MyShop verified deployment walkthrough (docs/examples/MyShop_Advanced) — adapted to current schema",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "reward",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "myshop_reward_v2",
|
|
16
|
+
"type_parameter": "0x2::wow::WOW",
|
|
17
|
+
"permission": "myshop_perm_v2",
|
|
18
|
+
"replaceExistName": true
|
|
19
|
+
},
|
|
20
|
+
"description": "MyShop reward pool for wonderful service and compensation"
|
|
21
|
+
},
|
|
22
|
+
"env": {
|
|
23
|
+
"network": "testnet",
|
|
24
|
+
"no_cache": true,
|
|
25
|
+
"confirmed": true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"notes": [
|
|
29
|
+
"Create the Reward EMPTY first (no coin_add, no guard_add): claim Guards are then built to reference this Reward object and use the query_reward_record_exists query instruction for double-claim protection — the Reward object must exist before the Guards that query it can be created.",
|
|
30
|
+
"Reward MAY share the Service's Permission (here myshop_perm_v2) for unified governance — service.move reward_add_imp has NO permission-conflict check. This is the opposite of Arbitration, which MUST use an independent Permission (E_ARBITRATION_PERMISSION_CONFLICT).",
|
|
31
|
+
"Adaptation: the doc omitted type_parameter — schema-valid because TokenTypeWithDefaultSchema defaults to '0x2::wow::WOW'; shown explicitly here for clarity.",
|
|
32
|
+
"Fund the pool later with coin_add; claimants trigger distribution by passing their claim Guard address in the 'claim' field. guard_add registers which Guards may claim from this Reward.",
|
|
33
|
+
"name/permission live INSIDE 'object' (TypeNamedObjectWithPermissionSchema). replaceExistName:true force-rebinds the local name if already taken — use deliberately."
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Issue Discount Coupons to Customers (Service)",
|
|
3
|
+
"description": "Issue 100 transferable=false 10%-off RATES discount coupons named summer_2026_10pct for myshop_service_v2, targeted at a specific customer, valid until end of 2026.",
|
|
4
|
+
"tags": ["service", "discount", "coupon", "marketing", "retail"],
|
|
5
|
+
"industry": "retail",
|
|
6
|
+
"operation_type": "service",
|
|
7
|
+
"source": "constructed under T-09 authorization; grounded in DiscountSchema + DiscountTypeSchema + service.ts SDK — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "service",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": "myshop_service_v2",
|
|
15
|
+
"discount": {
|
|
16
|
+
"name": "summer_2026_10pct",
|
|
17
|
+
"discount_type": "RATES",
|
|
18
|
+
"discount_value": 1000,
|
|
19
|
+
"benchmark": 100000000,
|
|
20
|
+
"time_ms_start": 1782864000000,
|
|
21
|
+
"time_ms_end": 1798761599000,
|
|
22
|
+
"count": 100,
|
|
23
|
+
"recipient": {
|
|
24
|
+
"entities": [
|
|
25
|
+
{ "name_or_address": "alice" }
|
|
26
|
+
],
|
|
27
|
+
"check_all_founded": false
|
|
28
|
+
},
|
|
29
|
+
"transferable": false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"env": {
|
|
33
|
+
"network": "testnet",
|
|
34
|
+
"no_cache": true,
|
|
35
|
+
"confirmed": true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"notes": [
|
|
39
|
+
"discount_type 'RATES' means discount_value is a RATIO in ten-thousandths: 1000 = 1000/10000 = 10% off. 'FIXED' (numeric 1) means discount_value is a fixed deduction in the token's smallest unit. String form ('RATES'/'FIXED') is recommended over numeric 0/1.",
|
|
40
|
+
"benchmark (optional): the discount only applies when the order amount EXCEEDS this value (smallest unit; 100000000 = 0.1 WOW). Omit for unconditional discounts.",
|
|
41
|
+
"time_ms_start/time_ms_end are Unix MILLISECONDS (not seconds). time_ms_end is REQUIRED; time_ms_start optional (starts immediately if omitted). 1782864000000 = 2026-07-01T00:00:00Z, 1798761599000 = 2026-12-31T15:59:59Z.",
|
|
42
|
+
"count = total usage count across all issued coupon objects; recipient.entities lists the receiving accounts (object form {name_or_address}); check_all_founded:false tolerates unresolved names instead of aborting.",
|
|
43
|
+
"transferable:false locks the coupon to the recipient (cannot be sold/gifted). Each issued coupon is a separate on-chain Discount object owned by the recipient; customers attach it at order time via order_new buy.discount (discount object ID or name).",
|
|
44
|
+
"Cleanup: issued discounts can be destroyed later via discount_destroy: ['<discount_object_id_or_name>']. Issuing discounts is an L3 operation on a live Service — no pause required."
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Signer-Identity Buy Guard — Strict Single-Identity Binding (ThreeBody Signature)",
|
|
3
|
+
"description": "Guard that passes only when the transaction signer equals the fixed author address stored in the Guard table (logic_equal[context(Signer), identifier(0)]). Bound as Service buy_guard so only the author can purchase the signature service — Level 1 strict single-identity binding.",
|
|
4
|
+
"tags": ["guard", "buy_guard", "signer-identity", "signature", "allowlist"],
|
|
5
|
+
"industry": "general",
|
|
6
|
+
"operation_type": "guard",
|
|
7
|
+
"source": "docs/examples/ThreeBody_Signature — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "guard",
|
|
13
|
+
"data": {
|
|
14
|
+
"namedNew": {
|
|
15
|
+
"name": "threebody_buy_guard",
|
|
16
|
+
"tags": ["signature", "buy-guard", "level1-strict"],
|
|
17
|
+
"replaceExistName": true
|
|
18
|
+
},
|
|
19
|
+
"description": "Verify buyer is the service author (signer_author). Only the author can purchase this signature service. LEVEL 1 strict single-identity binding: the author role is permanently tied to one address; if the address is lost/rotated, rebuild the Guard and re-bind Service.buy_guard.",
|
|
20
|
+
"table": [
|
|
21
|
+
{
|
|
22
|
+
"identifier": 0,
|
|
23
|
+
"b_submission": false,
|
|
24
|
+
"value_type": "Address",
|
|
25
|
+
"value": "signer_author",
|
|
26
|
+
"name": "Author address"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"root": {
|
|
30
|
+
"type": "logic_equal",
|
|
31
|
+
"nodes": [
|
|
32
|
+
{
|
|
33
|
+
"type": "context",
|
|
34
|
+
"context": "Signer"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "identifier",
|
|
38
|
+
"identifier": 0
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"env": {
|
|
44
|
+
"account": "signer_author",
|
|
45
|
+
"network": "testnet",
|
|
46
|
+
"confirmed": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"notes": [
|
|
50
|
+
"Verified against CallGuard_DataSchema (schema/call/guard.ts): namedNew/description/table/root are the strict top-level fields; table items match GuardTableItemBaseSchema strict shape {identifier, b_submission, value_type, value, name} (common/index.ts) — value_type 'Address' string form accepted by ValueTypeUserSchema.",
|
|
51
|
+
"Root must return Bool: logic_equal is in the allowed root list (CallGuard_RootSchema refine). context node uses enum ['Signer'|'Clock'|'Guard'] (GuardNodeSchema, query/index.ts); identifier node references table identifier 0.",
|
|
52
|
+
"The Address table value uses a LOCAL-MARK account name ('signer_author'), resolved to an address at transaction build time — this also breaks the Guard<->Service circular dependency (bind by name, publish later).",
|
|
53
|
+
"Guard is IMMUTABLE once created: the whitelist cannot be tampered with, but a lost/rotated author address requires building a new Guard and re-binding buy_guard (documented lock-in trade-off, R-C4-04).",
|
|
54
|
+
"DESENSITIZED: doc account 'three_body_author' -> 'signer_author'; guard renamed to local mark 'threebody_buy_guard'."
|
|
55
|
+
]
|
|
56
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Signature-Approval Machine with Permission-Gated Forwards (ThreeBody Signature)",
|
|
3
|
+
"description": "Two-node signing workflow 'Book Delivered -> Signature Completed'. Each forward is gated by its own permissionIndex (1000/1001), so only accounts granted that index in the Permission object can advance that stage. Extendable to M-of-N multi-signature gates by adding weighted forwards and raising pair threshold.",
|
|
4
|
+
"tags": ["machine", "multisig", "signature", "approval-gate", "permissionIndex", "publish"],
|
|
5
|
+
"industry": "general",
|
|
6
|
+
"operation_type": "machine",
|
|
7
|
+
"source": "docs/examples/ThreeBody_Signature — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "machine",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "threebody_machine",
|
|
16
|
+
"permission": "threebody_permission",
|
|
17
|
+
"replaceExistName": true
|
|
18
|
+
},
|
|
19
|
+
"description": "Signature service workflow: Book Delivered -> Signature Completed",
|
|
20
|
+
"node": {
|
|
21
|
+
"op": "add",
|
|
22
|
+
"nodes": [
|
|
23
|
+
{
|
|
24
|
+
"name": "Book Delivered",
|
|
25
|
+
"pairs": [
|
|
26
|
+
{
|
|
27
|
+
"prev_node": "",
|
|
28
|
+
"threshold": 0,
|
|
29
|
+
"forwards": [
|
|
30
|
+
{
|
|
31
|
+
"name": "Confirm Delivery",
|
|
32
|
+
"permissionIndex": 1000,
|
|
33
|
+
"weight": 1
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "Signature Completed",
|
|
41
|
+
"pairs": [
|
|
42
|
+
{
|
|
43
|
+
"prev_node": "Book Delivered",
|
|
44
|
+
"threshold": 1,
|
|
45
|
+
"forwards": [
|
|
46
|
+
{
|
|
47
|
+
"name": "Complete Signature",
|
|
48
|
+
"permissionIndex": 1001,
|
|
49
|
+
"weight": 1
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"publish": true
|
|
58
|
+
},
|
|
59
|
+
"env": {
|
|
60
|
+
"account": "signer_author",
|
|
61
|
+
"network": "testnet",
|
|
62
|
+
"confirmed": true
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"notes": [
|
|
66
|
+
"Shapes verified against MachineNodeSchema / MachineNodePairSchema / MachineForwardSchema (schema/query/index.ts) + CallMachine_DataSchema (schema/call/machine.ts). Forwards use camelCase permissionIndex (namedOperator is the alternative); the schema-level one-of refine requires namedOperator OR permissionIndex on every forward.",
|
|
67
|
+
"Entry-forward invariants satisfied: pair with prev_node='' has >=1 forward (FIX-002), and publish:true on a NEW machine requires an entry forward (FIX-02 refine) — 'Confirm Delivery' covers both.",
|
|
68
|
+
"Threshold semantics: pair 1 threshold 0 is exempt (single-forward pair — one signature advances). Pair 2 threshold 1 equals the summed weight of its single forward. MULTI-SIG EXTENSION: add more forwards {permissionIndex or namedOperator, weight} to the pair and set threshold > 1 — the node only advances once accumulated signature weight >= threshold (e.g. 2-of-3 approvers).",
|
|
69
|
+
"publish: true IRREVERSIBLY locks nodes/pairs/forwards — env.confirmed: true required (ConfirmGate).",
|
|
70
|
+
"DESENSITIZED: doc account 'three_body_author' -> 'signer_author'; objects renamed to local marks 'threebody_machine' / 'threebody_permission'."
|
|
71
|
+
]
|
|
72
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Permission with Role Indexes for Signing Workflow (ThreeBody Signature)",
|
|
3
|
+
"description": "Permission object for a signature/approval service: grants the author account user-defined indexes 1000-1009 (1000 gates the 'Confirm Delivery' forward, 1001 gates the 'Complete Signature' forward, 1002-1009 reserved) plus built-in index 306 (SERVICE_MACHINE) for binding the Machine to the Service.",
|
|
4
|
+
"tags": ["permission", "multisig", "signature", "role-index", "approval-workflow"],
|
|
5
|
+
"industry": "general",
|
|
6
|
+
"operation_type": "permission",
|
|
7
|
+
"source": "docs/examples/ThreeBody_Signature — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "permission",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "threebody_permission",
|
|
16
|
+
"replaceExistName": true
|
|
17
|
+
},
|
|
18
|
+
"description": "Permission for ThreeBody signature service (multi-role signing workflow)",
|
|
19
|
+
"table": {
|
|
20
|
+
"op": "add perm by entity",
|
|
21
|
+
"entity": { "name_or_address": "signer_author" },
|
|
22
|
+
"index": [1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 306]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"env": {
|
|
26
|
+
"account": "signer_author",
|
|
27
|
+
"network": "testnet",
|
|
28
|
+
"confirmed": true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"notes": [
|
|
32
|
+
"Shape verified against CallPermission_DataSchema (schema/call/permission.ts): 'add perm by entity' = TablePermByEntitySchema {entity: AccountOrMark_AddressSchema, index: PermissionIndexTypeSchema[]} — entity-centric grant of MANY indexes to ONE account.",
|
|
33
|
+
"Index validity (PermissionIndexTypeSchema, schema/query/index.ts): user-defined indexes must be 1000-65535; 306 is built-in SERVICE_MACHINE (authorizes binding a Machine to a Service).",
|
|
34
|
+
"Multi-signer pattern: grant DIFFERENT forward indexes to DIFFERENT signer accounts (e.g. 'add perm by index' {index: 1000, entity: [signer_a, signer_b]}) so each Machine forward is gated to its own approver set; the creator is auto-admin and bypasses per-index checks, so these grants only bite for non-admin operators.",
|
|
35
|
+
"DESENSITIZED: doc account 'three_body_author' -> 'signer_author' (generic role name); object renamed to local-mark 'threebody_permission'.",
|
|
36
|
+
"replaceExistName: true triggers ConfirmGate — env.confirmed: true is required or the call blocks with pending_confirmation."
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Configure Order Allocators with Entity-Treasury Recipient (ThreeBody Signature)",
|
|
3
|
+
"description": "Pre-publish Service configuration: 100% of completed-order funds route to the fixed Treasury object via an allocator Guard that verifies order.service == this service. Entity(treasury) recipient makes the fund flow caller-independent (no Signer binding needed). Also sets customer_required contact fields.",
|
|
4
|
+
"tags": ["service", "order_allocators", "treasury-first", "allocation", "guard", "signature"],
|
|
5
|
+
"industry": "general",
|
|
6
|
+
"operation_type": "service",
|
|
7
|
+
"source": "docs/examples/ThreeBody_Signature — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "service",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": "threebody_signature_service",
|
|
15
|
+
"order_allocators": {
|
|
16
|
+
"description": "Signature service fund allocation - 100% to author Treasury",
|
|
17
|
+
"threshold": 0,
|
|
18
|
+
"allocators": [
|
|
19
|
+
{
|
|
20
|
+
"guard": "threebody_allocator_guard",
|
|
21
|
+
"sharing": [
|
|
22
|
+
{
|
|
23
|
+
"who": {
|
|
24
|
+
"Entity": { "name_or_address": "threebody_treasury" }
|
|
25
|
+
},
|
|
26
|
+
"sharing": 10000,
|
|
27
|
+
"mode": "Rate"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"customer_required": ["phone", "email", "shipping_address"]
|
|
34
|
+
},
|
|
35
|
+
"env": {
|
|
36
|
+
"account": "signer_author",
|
|
37
|
+
"network": "testnet"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"notes": [
|
|
41
|
+
"Verified against CallService_DataSchema (schema/call/service.ts): order_allocators matches AllocatorsSchema (query/index.ts) {description, threshold, allocators[]}; sharing items match AllocationSharingSchema {who: RecipientSchema, sharing, mode}.",
|
|
42
|
+
"Recipient form: {Entity: {name_or_address: 'threebody_treasury'}} — Entity is an OBJECT with name_or_address, NOT a bare string (RecipientSchema). Funds flow to the fixed Treasury regardless of who triggers allocation (R-C3-06 safe); the referenced allocator Guard separately verifies order.service == this service (R-C3-05).",
|
|
43
|
+
"Rate mode: sharing 10000 = 100% (basis points); Rate items in one allocator must sum to 10000 when no Surplus item exists. threshold 0 allows allocation of any balance.",
|
|
44
|
+
"ORDER_ALLOCATORS IS PERMANENTLY IMMUTABLE AFTER PUBLISH (service.move:503) — this call must run BEFORE publish:true; the Service must also be unpublished when the machine field was bound earlier.",
|
|
45
|
+
"Prerequisite objects (created by separate calls, not shown): 'threebody_signature_service' (service, unpublished), 'threebody_allocator_guard' (guard: logic_equal[query order.service, identifier(service)]), 'threebody_treasury' (treasury sharing this service's permission).",
|
|
46
|
+
"customer_required entries validated against NotEmptyNameSchema (non-empty, <=64 bcs chars).",
|
|
47
|
+
"DESENSITIZED: doc account 'three_body_author' -> 'signer_author'; objects renamed to local marks ('threebody_signature_service', 'threebody_treasury', 'threebody_allocator_guard')."
|
|
48
|
+
]
|
|
49
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Time-Lock Guard via Order-Witness Progress Query (Travel)",
|
|
3
|
+
"description": "Create a Guard that enforces a relative time-lock before order completion: passes only when the on-chain Clock exceeds the order's Progress current-node entry timestamp plus a fixed duration. The runtime submission is the ORDER id, transparently converted to its Progress via convert_witness='OrderProgress'.",
|
|
4
|
+
"tags": ["guard", "travel", "time-lock", "clock", "witness", "OrderProgress", "forward-guard"],
|
|
5
|
+
"industry": "travel",
|
|
6
|
+
"operation_type": "guard",
|
|
7
|
+
"source": "docs/examples/Travel — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "guard",
|
|
13
|
+
"data": {
|
|
14
|
+
"namedNew": {
|
|
15
|
+
"name": "travel_complete_guard",
|
|
16
|
+
"tags": ["travel", "time-lock", "complete"],
|
|
17
|
+
"replaceExistName": true
|
|
18
|
+
},
|
|
19
|
+
"description": "Time-lock guard for travel order completion. Requires current clock > progress.current_time + 1000ms.",
|
|
20
|
+
"table": [
|
|
21
|
+
{
|
|
22
|
+
"identifier": 0,
|
|
23
|
+
"b_submission": true,
|
|
24
|
+
"value_type": "Address",
|
|
25
|
+
"name": "Order ID (submitted at runtime)"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"identifier": 1,
|
|
29
|
+
"b_submission": false,
|
|
30
|
+
"value_type": "U64",
|
|
31
|
+
"value": 1000,
|
|
32
|
+
"name": "Time-lock duration in ms"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"root": {
|
|
36
|
+
"type": "logic_as_u256_greater",
|
|
37
|
+
"nodes": [
|
|
38
|
+
{"type": "context", "context": "Clock"},
|
|
39
|
+
{
|
|
40
|
+
"type": "calc_number_add",
|
|
41
|
+
"nodes": [
|
|
42
|
+
{
|
|
43
|
+
"type": "query",
|
|
44
|
+
"query": "progress.current_time",
|
|
45
|
+
"object": {"identifier": 0, "convert_witness": "OrderProgress"},
|
|
46
|
+
"parameters": []
|
|
47
|
+
},
|
|
48
|
+
{"type": "identifier", "identifier": 1}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"env": {
|
|
55
|
+
"account": "travel_provider",
|
|
56
|
+
"network": "testnet",
|
|
57
|
+
"no_cache": true,
|
|
58
|
+
"confirmed": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"notes": [
|
|
62
|
+
"Order-witness time-lock pattern: the Guard table receives the ORDER id at runtime (identifier 0, b_submission:true), and the query node converts it to the order's associated Progress object via convert_witness='OrderProgress' (WitnessTypeSchema, id 100) before reading progress.current_time (query id 1272, returns U64 ms — the current-node entry timestamp). Root is logic_as_u256_greater[context Clock, calc_number_add[current_time, duration]] — i.e. now > entry_time + lock_duration. Root returns Bool via a logic_as_u256_* comparison, satisfying CallGuard_RootSchema.",
|
|
63
|
+
"Node-shape check (query/index.ts GuardNodeSchema, strict): context node {type:'context', context:'Clock'} — Clock returns the current on-chain timestamp (U64 ms); calc_number_add carries a 'nodes' array and returns U256; the query node carries query + object{identifier, convert_witness?} + optional parameters ([] here — progress.current_time takes no parameters). All field names verified against the discriminated union members.",
|
|
64
|
+
"Difference from the sibling library example guard-template-time-lock.json: the template submits the PROGRESS address directly and compares current_time >= an ABSOLUTE deadline stored in the table. This travel variant instead submits the ORDER id (witness conversion), uses a Clock context node, and enforces a RELATIVE duration (entry_time + delta) — use this form when the caller naturally holds the Order id and the lock is 'wait N ms after entering the node' rather than 'wait until date D'.",
|
|
65
|
+
"duration value 1000 (ms, 1 second) is TEST-ONLY so the example can complete immediately; production should use hours/days (e.g. 28800000 = 8h). The duration is static (b_submission:false) so it cannot be manipulated per-trigger.",
|
|
66
|
+
"Bound to the Machine's complete_trip forward (see sibling travel-machine-create example). Because Forward.guard verifies BEFORE the transition, current_time is still the entry timestamp of the CURRENT node (Ice Scooting) — exactly the intended anchor. Guards are immutable once created.",
|
|
67
|
+
"Desensitization: doc payload already uses generic local-mark names only (travel_provider, travel_complete_guard); no real personal data or raw 0x object addresses present — nothing replaced."
|
|
68
|
+
]
|
|
69
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Weather Oracle Guard via Repository Quote (Travel)",
|
|
3
|
+
"description": "Create a Guard that passes only when a weather record EXISTS for the submitted activity date: root query 'repository.data has' on the weather Repository with the runtime-submitted UTC-midnight timestamp converted via convert_number_address. Bound to the Machine's go_ice_scooting forward to gate weather-dependent activities.",
|
|
4
|
+
"tags": ["guard", "travel", "weather", "oracle", "repository", "query", "forward-guard"],
|
|
5
|
+
"industry": "travel",
|
|
6
|
+
"operation_type": "guard",
|
|
7
|
+
"source": "docs/examples/Travel — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "guard",
|
|
13
|
+
"data": {
|
|
14
|
+
"namedNew": {
|
|
15
|
+
"name": "weather_check_guard",
|
|
16
|
+
"tags": ["weather", "check", "travel"],
|
|
17
|
+
"replaceExistName": true
|
|
18
|
+
},
|
|
19
|
+
"description": "Weather check guard for ice scooting activity. Checks if weather data exists for the activity date.",
|
|
20
|
+
"table": [
|
|
21
|
+
{
|
|
22
|
+
"identifier": 0,
|
|
23
|
+
"b_submission": false,
|
|
24
|
+
"value_type": "Address",
|
|
25
|
+
"value": "weather_repo",
|
|
26
|
+
"name": "Weather Repository address"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"identifier": 1,
|
|
30
|
+
"b_submission": false,
|
|
31
|
+
"value_type": "String",
|
|
32
|
+
"value": "Condition",
|
|
33
|
+
"name": "Repository policy name"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"identifier": 2,
|
|
37
|
+
"b_submission": true,
|
|
38
|
+
"value_type": "U64",
|
|
39
|
+
"name": "Activity date timestamp (submitted at runtime)"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"root": {
|
|
43
|
+
"type": "query",
|
|
44
|
+
"query": "repository.data has",
|
|
45
|
+
"object": {"identifier": 0},
|
|
46
|
+
"parameters": [
|
|
47
|
+
{"type": "identifier", "identifier": 1},
|
|
48
|
+
{
|
|
49
|
+
"type": "convert_number_address",
|
|
50
|
+
"node": {"type": "identifier", "identifier": 2}
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"env": {
|
|
56
|
+
"account": "travel_provider",
|
|
57
|
+
"network": "testnet",
|
|
58
|
+
"no_cache": true,
|
|
59
|
+
"confirmed": true
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"notes": [
|
|
63
|
+
"Weather-oracle-via-Repository pattern: an external data provider (weather_provider account) publishes timestamp-keyed records into a Repository policy ('Condition'); this Guard quotes that Repository at workflow-runtime to prove a record exists for the activity date before allowing the Ice Scooting forward. This is the canonical way to oracle off-chain data into a Machine transition without trusting the caller.",
|
|
64
|
+
"Query signature check (ts-sdk packages/wowok guard-ins.ts, id 1166 'repository.data has'): parameters [String policyName, Address dataId], returns Bool — so it is a valid ROOT node (call/guard.ts CallGuard_RootSchema refine allows 'query' roots only for Bool-returning queries). Parameter 2 must be Address type: the U64 timestamp is wrapped in convert_number_address (GuardNodeSchema {type:'convert_number_address', node}) to produce the data-id key the Repository uses.",
|
|
65
|
+
"Table check (common/index.ts GuardTableItemBaseSchema, strict — only identifier/b_submission/value_type/value/name): identifiers 0-1 are static (b_submission:false, value fixed at creation — note identifier 0 holds the Repository by local-mark NAME 'weather_repo', resolved to an address at build time; the repo name must be resolvable by THIS account, which is why the doc sets onChain:true on weather_repo for cross-account resolution). Identifier 2 is b_submission:true with NO value — supplied per-trigger via the top-level submission field when operating the Progress forward.",
|
|
66
|
+
"Timestamp alignment contract: Repository data is keyed by the exact numeric id written by the data provider; the activity_date submitted at Guard trigger time must EXACTLY equal that id (doc aligns both to UTC 00:00:00 via Math.floor(now/86400000)*86400000). A mismatch makes the query return false and the Guard fails. This Guard checks EXISTENCE only — it does not compare the weather value ('sunny' vs 'rainy'); value-based rejection would require the 'repository.data' query plus a comparison node.",
|
|
67
|
+
"Guards are IMMUTABLE once created — create before binding into the Machine forward (see sibling travel-machine-create example).",
|
|
68
|
+
"Desensitization: doc payload already uses generic local-mark names only (travel_provider, weather_repo, weather_check_guard); no real personal data or raw 0x object addresses present — nothing replaced."
|
|
69
|
+
]
|
|
70
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create and Publish Multi-Segment Travel Machine with Forward Guards",
|
|
3
|
+
"description": "Create a 5-node Iceland travel workflow Machine (entry -> Buy Insurance -> SPA -> Ice Scooting -> Complete/Cancel) and publish it in one transaction. Three forwards are gated by Guards: weather oracle check (go_ice_scooting), time-lock (complete_trip), and always-pass cancel (cancel_trip). Each forward uses a distinct permissionIndex.",
|
|
4
|
+
"tags": ["machine", "travel", "workflow", "forward-guard", "publish", "multi-node"],
|
|
5
|
+
"industry": "travel",
|
|
6
|
+
"operation_type": "machine",
|
|
7
|
+
"source": "docs/examples/Travel — schema-validated, not chain-verified",
|
|
8
|
+
"verified": false,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "machine",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "travel_machine",
|
|
16
|
+
"permission": "travel_permission",
|
|
17
|
+
"replaceExistName": true
|
|
18
|
+
},
|
|
19
|
+
"description": "Iceland travel service workflow: (init) -> Buy Insurance -> SPA -> Ice Scooting -> Complete/Cancel",
|
|
20
|
+
"node": {
|
|
21
|
+
"op": "add",
|
|
22
|
+
"bReplace": true,
|
|
23
|
+
"nodes": [
|
|
24
|
+
{
|
|
25
|
+
"name": "Buy Insurance",
|
|
26
|
+
"pairs": [
|
|
27
|
+
{
|
|
28
|
+
"prev_node": "",
|
|
29
|
+
"threshold": 1,
|
|
30
|
+
"forwards": [
|
|
31
|
+
{
|
|
32
|
+
"name": "buy_insurance",
|
|
33
|
+
"weight": 1,
|
|
34
|
+
"permissionIndex": 1000
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "SPA",
|
|
42
|
+
"pairs": [
|
|
43
|
+
{
|
|
44
|
+
"prev_node": "Buy Insurance",
|
|
45
|
+
"threshold": 1,
|
|
46
|
+
"forwards": [
|
|
47
|
+
{
|
|
48
|
+
"name": "go_spa",
|
|
49
|
+
"weight": 1,
|
|
50
|
+
"permissionIndex": 1001
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "Ice Scooting",
|
|
58
|
+
"pairs": [
|
|
59
|
+
{
|
|
60
|
+
"prev_node": "SPA",
|
|
61
|
+
"threshold": 1,
|
|
62
|
+
"forwards": [
|
|
63
|
+
{
|
|
64
|
+
"name": "go_ice_scooting",
|
|
65
|
+
"weight": 1,
|
|
66
|
+
"permissionIndex": 1004,
|
|
67
|
+
"guard": {
|
|
68
|
+
"guard": "weather_check_guard",
|
|
69
|
+
"retained_submission": []
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "Complete",
|
|
78
|
+
"pairs": [
|
|
79
|
+
{
|
|
80
|
+
"prev_node": "Ice Scooting",
|
|
81
|
+
"threshold": 1,
|
|
82
|
+
"forwards": [
|
|
83
|
+
{
|
|
84
|
+
"name": "complete_trip",
|
|
85
|
+
"weight": 1,
|
|
86
|
+
"permissionIndex": 1002,
|
|
87
|
+
"guard": {
|
|
88
|
+
"guard": "travel_complete_guard",
|
|
89
|
+
"retained_submission": []
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "Cancel",
|
|
98
|
+
"pairs": [
|
|
99
|
+
{
|
|
100
|
+
"prev_node": "Ice Scooting",
|
|
101
|
+
"threshold": 1,
|
|
102
|
+
"forwards": [
|
|
103
|
+
{
|
|
104
|
+
"name": "cancel_trip",
|
|
105
|
+
"weight": 1,
|
|
106
|
+
"permissionIndex": 1003,
|
|
107
|
+
"guard": {
|
|
108
|
+
"guard": "travel_cancel_guard",
|
|
109
|
+
"retained_submission": []
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"publish": true
|
|
119
|
+
},
|
|
120
|
+
"env": {
|
|
121
|
+
"account": "travel_provider",
|
|
122
|
+
"network": "testnet",
|
|
123
|
+
"no_cache": true,
|
|
124
|
+
"confirmed": true
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"notes": [
|
|
128
|
+
"Multi-segment workflow pattern: 5 nodes form a linear chain with a terminal fork — Ice Scooting has TWO outgoing paths (complete_trip -> Complete, cancel_trip -> Cancel), each guarded differently. Demonstrates per-forward Guard binding (Forward.guard) combined with per-forward permissionIndex, the canonical way to put conditional gates on workflow transitions.",
|
|
129
|
+
"Schema check (call/machine.ts CallMachine_DataSchema, strict): 'object' uses the OBJECT form of WithPermissionObjectSchema (NamedObjectWithPermissionSchema — name, permission, replaceExistName); node uses NodeSchema op='add' with bReplace:true + nodes array; publish=true on NEW machine creation triggers the FIX-02 entry-forward refine — satisfied because the 'Buy Insurance' pair has prev_node='' with a non-empty forwards list (FIX-002).",
|
|
130
|
+
"Pair/forward semantics (query/index.ts MachineNodePairSchema): forwards describe INCOMING transitions — the forward in a node's pair (prev_node='X') is the action that advances Progress FROM X INTO this node. Field is 'prev_node' (NOT 'prior_node' — that name only appears in the separate 'add forward'/'remove forward' ops). threshold is per-pair; weight sums across the pair's forwards must reach threshold to advance.",
|
|
131
|
+
"Forward check (query/index.ts MachineForwardSchema, strict — only name/namedOperator/permissionIndex/weight/guard allowed): every forward provides permissionIndex (1000-1004), satisfying the one-of namedOperator/permissionIndex refine (namedOperator:'' is the order-owner wildcard alternative). Guarded forwards use the OBJECT guard form {guard: '<name>', retained_submission: []} (MachineForwardGuardSchema); a plain string shorthand 'guard': '<name>' is also accepted via preprocess when no retained_submission is needed.",
|
|
132
|
+
"Guard evaluation order: Forward.guard verifies BEFORE the transition executes, so a forward Guard querying THIS progress's progress.current sees the SOURCE node, not the target. Here weather_check_guard queries an external Repository (safe) and travel_complete_guard queries time-lock data (safe); neither checks progress.current == target, which would always fail.",
|
|
133
|
+
"publish:true is IRREVERSIBLE and freezes the node set — nodes cannot be changed after publish, and only published Machines can bind to a Service (service.machine). Guards referenced by name (weather_check_guard, travel_complete_guard, travel_cancel_guard) and the Permission (travel_permission, with indexes 1000-1004 granted to the operator) must exist BEFORE this call — see the sibling travel-guard-weather-oracle / travel-guard-time-lock examples and Travel doc Steps 1/3.",
|
|
134
|
+
"Desensitization: doc payload already uses generic local-mark names only (travel_provider, travel_machine, travel_permission, guard names); no real personal data, phone numbers, or raw 0x object addresses present — nothing replaced."
|
|
135
|
+
]
|
|
136
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Create Data Repository with Write Policy (Travel)",
|
|
3
|
+
"description": "Create an on-chain Repository (weather_repo) with a 'Condition' policy defining write rules (write_guard, id_from, value_type) for travel weather data shared across accounts",
|
|
4
|
+
"tags": ["repository", "policies", "write_guard", "travel", "data"],
|
|
5
|
+
"industry": "travel",
|
|
6
|
+
"operation_type": "repository",
|
|
7
|
+
"source": "Travel verified deployment walkthrough (docs/examples/Travel) — adapted to current schema",
|
|
8
|
+
"verified": true,
|
|
9
|
+
"network": "testnet",
|
|
10
|
+
"call": {
|
|
11
|
+
"tool": "onchain_operations",
|
|
12
|
+
"operation_type": "repository",
|
|
13
|
+
"data": {
|
|
14
|
+
"object": {
|
|
15
|
+
"name": "weather_repo",
|
|
16
|
+
"permission": "weather_permission",
|
|
17
|
+
"replaceExistName": true,
|
|
18
|
+
"onChain": true
|
|
19
|
+
},
|
|
20
|
+
"description": "Weather data repository for Iceland travel activities",
|
|
21
|
+
"policies": {
|
|
22
|
+
"op": "add",
|
|
23
|
+
"policy": [
|
|
24
|
+
{
|
|
25
|
+
"name": "Condition",
|
|
26
|
+
"description": "Weather condition policy for activity dates",
|
|
27
|
+
"write_guard": [],
|
|
28
|
+
"id_from": "None",
|
|
29
|
+
"value_type": "String"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"env": {
|
|
35
|
+
"network": "testnet",
|
|
36
|
+
"no_cache": true,
|
|
37
|
+
"confirmed": true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"notes": [
|
|
41
|
+
"onChain:true is REQUIRED here for cross-account name resolution: weather_repo is created by the weather_provider account, but its name is later referenced in a Guard table by the travel_provider account. Without onChain:true the name is stored LOCALLY ONLY on the creator's device (private) and cannot be resolved by any other account; with onChain:true the name is published on-chain and becomes publicly visible/resolvable.",
|
|
42
|
+
"write_guard semantics: the schema is z.array(PolicyWriteGuardSchema) with no minimum length, so an EMPTY array is valid and means NO Guard verification is required to write data under this policy — writes are gated only by the Repository's Permission. Non-empty entries must be PolicyWriteGuard OBJECTS {guard, id_from_submission?, data_from_submission?}, never bare guard-name strings.",
|
|
43
|
+
"id_from 'None' means the writer MUST specify the data ID explicitly on every write (IdFromSchema accepts 0/1/2 or 'None'/'Clock'/'Signer', case-insensitive). 'Clock' makes the data ID the current on-chain timestamp; 'Signer' makes it the writer's address.",
|
|
44
|
+
"policies is an op discriminated union: {op:'add'|'set', policy:[PolicyRule...]} | {op:'remove', policy:[name strings...]} | {op:'clear'} — never a bare array. PolicyRule requires name, description, write_guard, id_from, value_type (quote_guard is optional; value_type 'String' is a valid ValueTypeSchema literal).",
|
|
45
|
+
"Doc payload validated against current CallRepository_DataSchema with no drift; only restructured from the raw MCP envelope (data.operation_type/data.data) into the example-library call shape. The verified walkthrough executed this call with env.account='weather_provider' (a different account than travel_provider, which is exactly why onChain:true matters)."
|
|
46
|
+
]
|
|
47
|
+
}
|