@wowok/skills 1.0.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.
Files changed (70) hide show
  1. package/README.md +156 -0
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +177 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +19 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/skills.d.ts +5 -0
  11. package/dist/skills.d.ts.map +1 -0
  12. package/dist/skills.js +46 -0
  13. package/dist/skills.js.map +1 -0
  14. package/dist/types.d.ts +9 -0
  15. package/dist/types.d.ts.map +1 -0
  16. package/dist/types.js +3 -0
  17. package/dist/types.js.map +1 -0
  18. package/examples/Insurance/Insurance.md +594 -0
  19. package/examples/Insurance/Insurance_TestResults.md +481 -0
  20. package/examples/Insurance/insurance_complete_guard_v1.json +50 -0
  21. package/examples/MyShop/MyShop.md +1353 -0
  22. package/examples/MyShop/MyShop_TestResults.md +1003 -0
  23. package/examples/MyShop_Advanced/MyShop_Advanced.md +1898 -0
  24. package/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +1297 -0
  25. package/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +743 -0
  26. package/examples/MyShop_Advanced/machine_nodes.json +222 -0
  27. package/examples/ThreeBody_Signature/ThreeBody_Signature.md +776 -0
  28. package/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +599 -0
  29. package/examples/Travel/Travel.md +1157 -0
  30. package/examples/Travel/Travel_TestResults.md +743 -0
  31. package/examples/Travel/calc-weather-timestamps.js +8 -0
  32. package/examples/Travel/travel_machine_v2_export.json +104 -0
  33. package/examples/Travel/weather_check_guard_v1.json +51 -0
  34. package/package.json +56 -0
  35. package/schemas/onchain_operations/_common.md +236 -0
  36. package/schemas/onchain_operations/_index.md +22 -0
  37. package/schemas/onchain_operations/allocation.md +50 -0
  38. package/schemas/onchain_operations/arbitration.md +95 -0
  39. package/schemas/onchain_operations/contact.md +36 -0
  40. package/schemas/onchain_operations/demand.md +52 -0
  41. package/schemas/onchain_operations/gen_passport.md +43 -0
  42. package/schemas/onchain_operations/guard.md +136 -0
  43. package/schemas/onchain_operations/machine.md +70 -0
  44. package/schemas/onchain_operations/order.md +57 -0
  45. package/schemas/onchain_operations/payment.md +32 -0
  46. package/schemas/onchain_operations/permission.md +57 -0
  47. package/schemas/onchain_operations/personal.md +59 -0
  48. package/schemas/onchain_operations/progress.md +35 -0
  49. package/schemas/onchain_operations/repository.md +81 -0
  50. package/schemas/onchain_operations/reward.md +40 -0
  51. package/schemas/onchain_operations/service.md +104 -0
  52. package/schemas/onchain_operations/treasury.md +74 -0
  53. package/schemas/schema-account_operation.md +402 -0
  54. package/schemas/schema-guard2file.md +153 -0
  55. package/schemas/schema-local_info_operation.md +160 -0
  56. package/schemas/schema-local_mark_operation.md +148 -0
  57. package/schemas/schema-machineNode2file.md +155 -0
  58. package/schemas/schema-messenger_operation.md +547 -0
  59. package/schemas/schema-onchain_events.md +201 -0
  60. package/schemas/schema-onchain_table_data.md +334 -0
  61. package/schemas/schema-query_toolkit.md +375 -0
  62. package/schemas/schema-wip_file.md +240 -0
  63. package/schemas/schema-wowok_buildin_info.md +296 -0
  64. package/scripts/install.js +113 -0
  65. package/wowok-build/SKILL.md +606 -0
  66. package/wowok-guard/SKILL.md +374 -0
  67. package/wowok-machine/SKILL.md +512 -0
  68. package/wowok-order/SKILL.md +499 -0
  69. package/wowok-safety/SKILL.md +381 -0
  70. package/wowok-tools/SKILL.md +635 -0
@@ -0,0 +1,52 @@
1
+ # onchain_operations / demand
2
+
3
+ Post service requests with reward pools on-chain.
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallDemand_Data {
9
+ // Object reference - string (existing) or object (create new)
10
+ object: WithPermissionObject;
11
+
12
+ // Recommend Service to Demand
13
+ present?: {
14
+ recommend: string; // Recommendation text
15
+ by_guard?: string; // Guard to verify through
16
+ service?: string; // Service ID or name
17
+ };
18
+
19
+ description?: string; // Demand description
20
+ location?: string; // Demand location
21
+
22
+ rewards?: ObjectsOp; // Reward operations
23
+
24
+ // Service Guard list (discriminated union)
25
+ guards?: {
26
+ op: "add" | "set";
27
+ guard: {
28
+ guard: string; // Guard object ID
29
+ service_identifier?: number | null; // Service identifier in Guard
30
+ }[];
31
+ } | {
32
+ op: "remove";
33
+ guard: string[]; // Guard IDs/names to remove
34
+ } | {
35
+ op: "clear";
36
+ };
37
+
38
+ // Feedback on presenters (array — multiple feedback entries)
39
+ feedback?: {
40
+ who: AccountOrMark_Address; // Presenter's account
41
+ acceptance_score?: number; // 0-255 acceptance score
42
+ feedback?: string; // Feedback content
43
+ }[];
44
+
45
+ owner_receive?: ReceivedObjectsOrRecently;
46
+ um?: string | null; // Contact object
47
+ }
48
+ ```
49
+
50
+ ---
51
+
52
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, WithPermissionObject, ObjectsOp, AccountOrMark_Address, ReceivedObjectsOrRecently.
@@ -0,0 +1,43 @@
1
+ # onchain_operations / gen_passport
2
+
3
+ Create immutable verified credentials after Guard validation passes.
4
+
5
+ > **IMPORTANT**: Unlike other onchain operations, `gen_passport` uses a FLAT input structure — fields `guard`, `info`, `env` are directly at the top level, NOT nested under a `data` wrapper.
6
+
7
+ ## Input Schema
8
+
9
+ ```typescript
10
+ CallGenPassport_Input {
11
+ guard: string | string[]; // Guard object ID(s) to verify. Can be a single guard or an array of guards.
12
+ info?: SubmissionCall; // Optional submission data
13
+ env?: CallEnv; // Optional environment configuration
14
+ }
15
+ ```
16
+
17
+ ## Features
18
+
19
+ - **Single Guard**: Pass a single guard ID or name as a string
20
+ - **Multiple Guards**: Pass an array of guard IDs or names to verify multiple guards at once
21
+ - **Name Resolution**: Supports both guard addresses and LocalMark names
22
+
23
+ ## Examples
24
+
25
+ ### Single Guard
26
+ ```typescript
27
+ {
28
+ guard: "my-guard-name", // or "0x1234567890abcdef..."
29
+ env: { network: "testnet" }
30
+ }
31
+ ```
32
+
33
+ ### Multiple Guards
34
+ ```typescript
35
+ {
36
+ guard: ["guard-1", "guard-2", "0x1234567890abcdef..."],
37
+ env: { network: "testnet" }
38
+ }
39
+ ```
40
+
41
+ ---
42
+
43
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall.
@@ -0,0 +1,136 @@
1
+ # onchain_operations / guard
2
+
3
+ Create immutable programmable validation rules that return boolean results.
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallGuard_Data {
9
+ namedNew?: NamedObject; // Name for new Guard
10
+ description?: string; // Guard description
11
+
12
+ // Data table definitions
13
+ table?: {
14
+ identifier: number; // 0-255
15
+ b_submission: boolean; // User submission required
16
+ value_type: ValueType; // Expected type
17
+ value?: SupportedValue; // Default value (if b_submission=false)
18
+ name?: string; // Description
19
+ }[];
20
+
21
+ // Rule tree root (required)
22
+ root: {
23
+ type: "node";
24
+ node: GuardNode; // Direct node tree
25
+ } | {
26
+ type: "file";
27
+ file_path: string; // Load from file
28
+ format?: "json" | "markdown";
29
+ };
30
+
31
+ // Dependent Guards
32
+ rely?: {
33
+ guards: string[];
34
+ logic_or?: boolean; // OR vs AND logic
35
+ };
36
+ }
37
+
38
+ // GuardNode (recursive structure)
39
+ //
40
+ // The GuardNode is a recursive, strongly-typed computational tree.
41
+ // Each node has a `type` field that discriminates its behavior.
42
+ // Below are the major categories:
43
+ //
44
+ // Logic & Comparison:
45
+ // logic_and (nodes[], 2-8) → Bool: ALL must be true
46
+ // logic_or (nodes[], 2-8) → Bool: ANY must be true
47
+ // logic_not (node, 1) → Bool: Inverts boolean
48
+ // logic_equal (nodes[], 2-8) → Bool: Type+value equality
49
+ // logic_string_contains (nodes[], 2-8) → Bool: Substring (case-sensitive)
50
+ // logic_string_nocase_contains (nodes[], 2-8) → Bool: Substring (case-insensitive)
51
+ // logic_string_nocase_equal (nodes[], 2-8) → Bool: String equality (ci)
52
+ // logic_as_u256_equal (nodes[], 2-8) → Bool: Numeric equality
53
+ // logic_as_u256_greater (nodes[], 2-8) → Bool: First > all others
54
+ // logic_as_u256_lesser (nodes[], 2-8) → Bool: First < all others
55
+ // logic_as_u256_greater_or_equal (nodes[], 2-8) → Bool: First >= all others
56
+ // logic_as_u256_lesser_or_equal (nodes[], 2-8) → Bool: First <= all others
57
+ //
58
+ // Arithmetic (calc_*):
59
+ // calc_number_add (nodes[], 2-8) → U256: Sequential addition
60
+ // calc_number_subtract (nodes[], 2-8) → U256: Sequential subtraction
61
+ // calc_number_multiply (nodes[], 2-8) → U256: Sequential multiplication
62
+ // calc_number_divide (nodes[], 2-8) → U256: Sequential division
63
+ // calc_number_mod (nodes[], 2-8) → U256: Sequential modulo
64
+ // calc_string_length (node, 1) → U64: UTF-8 byte length
65
+ // calc_string_contains (nodes[], 2-8) → Bool: cs substring check
66
+ // calc_string_nocase_contains (nodes[], 2-8) → Bool: ci substring check
67
+ // calc_string_nocase_equal (nodes[], 2-8) → Bool: ci string equality
68
+ // calc_string_indexof (left+right+order) → U64: Find substring index
69
+ // calc_string_nocase_indexof (left+right+order) → U64: Find substring index (ci)
70
+ //
71
+ // Type Conversion (convert_*):
72
+ // convert_number_address (node, 1) → Address: Number → Address
73
+ // convert_address_number (node, 1) → U256: Address → Number
74
+ // convert_number_string (node, 1) → String: Number → String
75
+ // convert_string_number (node, 1) → U256: Parse string as number
76
+ // convert_safe_u8..convert_safe_u256 (node, 1) → U8..U256: Safe numeric cast
77
+ //
78
+ // Vector Operations (vec_*):
79
+ // vec_length (node, 1) → U64: Element count
80
+ // vec_contains_bool (nodes[], 2-8) → Bool: All values present
81
+ // vec_contains_address (nodes[], 2-8) → Bool: Address containment
82
+ // vec_contains_string (nodes[], 2-8) → Bool: String containment (cs)
83
+ // vec_contains_string_nocase (nodes[], 2-8) → Bool: String containment (ci)
84
+ // vec_contains_number (nodes[], 2-8) → Bool: Number containment
85
+ // vec_indexof_* (left+right+order) → U64: Find index in vector
86
+ //
87
+ // WoWok Object Query:
88
+ // query (query + object + parameters) → varies: Query on-chain data
89
+ // identifier (identifier 0-255) → varies: Read from Guard table
90
+ // value_type (node, 1) → U8: Get ValueType of child result
91
+ //
92
+ // Record Check Operations (record_*):
93
+ // record_check_recipient_order (...) → Bool: Order count by recipient
94
+ // record_check_recipient_progress (...) → Bool: Progress count by recipient
95
+ // record_check_recipient_reward (...) → Bool: Reward count by recipient
96
+ // record_check_treasury_history_item (...) → Bool: Treasury history
97
+ // record_check_progress_history_item (...) → Bool: Progress history
98
+ //
99
+ // For the complete canonical list of all 70+ types, see
100
+ // the MCP source at `src/schema/query/index.ts` `GuardNodeSchema`.
101
+ GuardNode = {
102
+ // Multi-operand nodes (2-8 children)
103
+ logic?: "and" | "or";
104
+ nodes: GuardNode[];
105
+ } | {
106
+ // Single-operand nodes
107
+ logic?: "not";
108
+ node: GuardNode;
109
+ } | {
110
+ // Query nodes
111
+ type: "query";
112
+ query: number | string;
113
+ object: {
114
+ identifier: number;
115
+ convert_witness?: number;
116
+ };
117
+ parameters: GuardNode[];
118
+ } | {
119
+ // Context nodes
120
+ type: "context";
121
+ context: "Signer" | "Clock" | "Guard";
122
+ } | {
123
+ // Identifier nodes
124
+ type: "identifier";
125
+ identifier: number;
126
+ } | {
127
+ // Constant value nodes
128
+ type: "constant";
129
+ value_type: ValueType;
130
+ value: SupportedValue;
131
+ }
132
+ ```
133
+
134
+ ---
135
+
136
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, NamedObject.
@@ -0,0 +1,70 @@
1
+ # onchain_operations / machine
2
+
3
+ Design and deploy automated workflow templates (Machines) that define how services are delivered.
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallMachine_Data {
9
+ // Object reference - string (existing) or object (create new)
10
+ object: WithPermissionObject;
11
+
12
+ // Generate new Progress
13
+ progress_new?: {
14
+ task?: string | null; // Task ID
15
+ repository?: ObjectsOp; // Repository list
16
+ progress_namedOperator?: { // Manage namespace operators
17
+ op: "add" | "set" | "remove";
18
+ name: string;
19
+ operators: ManyAccountOrMark_Address;
20
+ };
21
+ namedNew?: NamedObject; // Name for new Progress
22
+ };
23
+
24
+ description?: string; // Machine description
25
+ repository?: ObjectsOp; // Consensus repositories
26
+
27
+ // Node operations - TWO MODES (mutually exclusive)
28
+ node?:
29
+ // Mode 1: Incremental operations
30
+ | {
31
+ op: "add" | "set";
32
+ nodes: MachineNode[];
33
+ bReplace?: boolean;
34
+ }
35
+ | { op: "remove"; nodes: string[] }
36
+ | { op: "clear" }
37
+ | { op: "exchange"; node_one: string; node_other: string }
38
+ | { op: "rename"; node_name_old: string; node_name_new: string }
39
+ | { op: "remove prior node"; pairs: NodeRemovePriorNodeData[] }
40
+ | { op: "add forward"; data: NodeAddForwardData[] }
41
+ | { op: "remove forward"; data: NodeRemoveForwardData[] }
42
+ // Mode 2: Complete replacement from file
43
+ | { json_or_markdown_file: string };
44
+
45
+ pause?: boolean; // Pause new Progress
46
+ publish?: boolean; // Publish (nodes immutable)
47
+ owner_receive?: ReceivedObjectsOrRecently;
48
+ um?: string | null; // Contact object
49
+ }
50
+
51
+ // MachineNode definition
52
+ MachineNode {
53
+ name: string; // Node name (initial is "")
54
+ pairs: {
55
+ prior_node: string; // Previous node ("" for entry)
56
+ forwards: {
57
+ name: string; // Forward name
58
+ namedOperator?: string; // Per-Progress namespace
59
+ permissionIndex?: number; // Shared permission index
60
+ weight: number; // Forward weight
61
+ guard?: string; // Optional Guard
62
+ }[];
63
+ threshold?: number; // Weight threshold
64
+ }[];
65
+ }
66
+ ```
67
+
68
+ ---
69
+
70
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, WithPermissionObject, ObjectsOp, NamedObject, ManyAccountOrMark_Address, ReceivedObjectsOrRecently.
@@ -0,0 +1,57 @@
1
+ # onchain_operations / order
2
+
3
+ Manage the order lifecycle, including arbitration, progress advancement, refunds, and setting agents.
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallOrder_Data {
9
+ object: string; // Order ID or name (required)
10
+
11
+ // Manage agents
12
+ agents?: ManyAccountOrMark_Address;
13
+
14
+ // Set required info (Contact or WTS)
15
+ required_info?: string | null;
16
+
17
+ // Advance progress
18
+ progress?: {
19
+ operation: {
20
+ next_node_name: string;
21
+ forward: string;
22
+ };
23
+ hold?: boolean;
24
+ adminUnhold?: boolean;
25
+ message?: string;
26
+ };
27
+
28
+ // Submit compensation request
29
+ arb_confirm?: {
30
+ arb: string; // Arb object ID
31
+ confirm: boolean; // Confirm materials valid
32
+ description?: string;
33
+ proposition?: string[]; // Compensation claims
34
+ };
35
+
36
+ // Appeal arbitration result
37
+ arb_objection?: {
38
+ arb: string;
39
+ objection: string; // Appeal reason
40
+ };
41
+
42
+ // Claim compensation
43
+ arb_claim_compensation?: {
44
+ arb: string;
45
+ };
46
+
47
+ // Receive funds/objects
48
+ receive?: QueryReceivedResult;
49
+
50
+ // Transfer order ownership
51
+ transfer_to?: AccountOrMark_Address;
52
+ }
53
+ ```
54
+
55
+ ---
56
+
57
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, AccountOrMark_Address, ManyAccountOrMark_Address.
@@ -0,0 +1,32 @@
1
+ # onchain_operations / payment
2
+
3
+ Send instant, irreversible coin transfers to any wallet address.
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallPayment_Data {
9
+ // Object reference — create new only (Payment is immutable)
10
+ object: {
11
+ name?: string; // Object name
12
+ tags?: string[]; // Tags
13
+ onChain?: boolean; // Public on-chain name
14
+ replaceExistName?: boolean; // Force claim name
15
+ type_parameter?: string; // Token type (default: "0x2::wow::WOW")
16
+ };
17
+
18
+ revenue: { // Array of payment recipients
19
+ recipient: AccountOrMark_Address; // Who receives payment
20
+ amount: CoinParam; // Payment amount
21
+ }[];
22
+
23
+ info: { // Payment metadata
24
+ remark?: string; // Payment remark
25
+ index?: number; // Payment index
26
+ };
27
+ }
28
+ ```
29
+
30
+ ---
31
+
32
+ See [_common.md](./_common.md) for shared types: CallEnv, CoinParam, AccountOrMark_Address.
@@ -0,0 +1,57 @@
1
+ # onchain_operations / permission
2
+
3
+ Define who can perform which operations on WoWok objects.
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallPermission_Data {
9
+ // Object reference - string (existing) or object (create new)
10
+ object?: NormalObject;
11
+
12
+ description?: string; // Permission description
13
+
14
+ // Permission table operations
15
+ table?: {
16
+ op: "add perm by index" | "set perm by index" | "remove perm by index";
17
+ index: number; // Permission index
18
+ entity: ManyAccountOrMark_Address;
19
+ } | {
20
+ op: "add perm by entity" | "set perm by entity" | "remove perm by entity";
21
+ entity: AccountOrMark_Address;
22
+ index: number[];
23
+ };
24
+
25
+ // Advanced entity operations (requires admin)
26
+ entity?: {
27
+ op: "swap" | "replace" | "copy";
28
+ entity1: AccountOrMark_Address;
29
+ entity2: AccountOrMark_Address;
30
+ } | {
31
+ op: "del";
32
+ entity: AccountOrMark_Address;
33
+ };
34
+
35
+ // Admin management (builder only)
36
+ admin?: {
37
+ op: "add" | "remove" | "set";
38
+ addresses: ManyAccountOrMark_Address;
39
+ };
40
+
41
+ // Remark operations
42
+ remark?: {
43
+ op: "set" | "remove" | "clear";
44
+ index?: number;
45
+ remark?: string;
46
+ };
47
+
48
+ apply?: string[]; // Objects to apply permission to
49
+ builder?: AccountOrMark_Address; // Set/transfer ownership
50
+ owner_receive?: ReceivedObjectsOrRecently;
51
+ um?: string | null; // Contact object
52
+ }
53
+ ```
54
+
55
+ ---
56
+
57
+ See [_common.md](./_common.md) for shared types: CallEnv, NormalObject, AccountOrMark_Address, ManyAccountOrMark_Address, ReceivedObjectsOrRecently.
@@ -0,0 +1,59 @@
1
+ # onchain_operations / personal
2
+
3
+ Establish and manage your on-chain public identity. **CRITICAL: Everything here is PERMANENTLY PUBLIC on the blockchain!**
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallPersonal_Data {
9
+ description?: string; // Public description
10
+
11
+ referrer?: string | AccountOrMark_Address | null; // Referrer for joining network
12
+
13
+ // PUBLIC on-chain personal info (discriminated union)
14
+ information?: {
15
+ op: "add";
16
+ data: { // Records to add
17
+ name: string; // Record name (social handle, URL, etc.)
18
+ value_type: ValueType; // Value type
19
+ value: SupportedValue; // Value
20
+ }[];
21
+ } | {
22
+ op: "remove";
23
+ name: string[]; // Record names to remove
24
+ } | {
25
+ op: "clear";
26
+ };
27
+
28
+ // PUBLIC on-chain identity mark (discriminated union)
29
+ mark?: {
30
+ op: "add";
31
+ data: {
32
+ address: string; // Address to mark
33
+ name?: string; // Mark name
34
+ tags?: string[]; // Tags
35
+ }[];
36
+ } | {
37
+ op: "remove";
38
+ data: {
39
+ address: string;
40
+ tags?: string[];
41
+ }[];
42
+ } | {
43
+ op: "clear";
44
+ address: ManyAccountOrMark_Address;
45
+ } | {
46
+ op: "transfer"; // Transfer mark to another address
47
+ to: AccountOrMark_Address;
48
+ } | {
49
+ op: "replace"; // Replace with new mark object
50
+ new_mark_object: string;
51
+ } | {
52
+ op: "destroy"; // Permanently destroy mark
53
+ };
54
+ }
55
+ ```
56
+
57
+ ---
58
+
59
+ See [_common.md](./_common.md) for shared types: CallEnv, AccountOrMark_Address, ManyAccountOrMark_Address.
@@ -0,0 +1,35 @@
1
+ # onchain_operations / progress
2
+
3
+ Track and manage active workflows in real-time.
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallProgress_Data {
9
+ object: string; // Progress ID or name (required)
10
+ task?: string | null; // Target task ID
11
+ repository?: ObjectsOp; // Context repositories
12
+
13
+ // Manage namespace operators
14
+ progress_namedOperator?: {
15
+ op: "add" | "set" | "remove";
16
+ name: string;
17
+ operators: ManyAccountOrMark_Address;
18
+ };
19
+
20
+ // Advance workflow
21
+ operate?: {
22
+ operation: {
23
+ next_node_name: string; // Target node
24
+ forward: string; // Forward name
25
+ };
26
+ hold?: boolean; // Lock permission
27
+ adminUnhold?: boolean; // Allow admin unlock
28
+ message?: string; // Operation note
29
+ };
30
+ }
31
+ ```
32
+
33
+ ---
34
+
35
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, ObjectsOp, ManyAccountOrMark_Address.
@@ -0,0 +1,81 @@
1
+ # onchain_operations / repository
2
+
3
+ Read/write database with consensus field + address as key, strongly-typed data as value.
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallRepository_Data {
9
+ // Object reference - string (existing) or object (create new)
10
+ object: WithPermissionObject;
11
+
12
+ description?: string; // Repository description
13
+
14
+ // Policy rules (discriminated by op)
15
+ policies?: {
16
+ op: "add" | "set";
17
+ policy: PolicyRule[];
18
+ } | {
19
+ op: "remove";
20
+ policy: string[]; // Policy names to remove
21
+ } | {
22
+ op: "clear";
23
+ };
24
+
25
+ // Add data (discriminated union)
26
+ data_add?: {
27
+ name: string;
28
+ write_guard?: string;
29
+ data: SupportedValue;
30
+ } | {
31
+ name: string;
32
+ items: {
33
+ data: {
34
+ id: string | number;
35
+ data: SupportedValue;
36
+ }[];
37
+ write_guard?: string;
38
+ }[];
39
+ };
40
+
41
+ // Remove data (discriminated union)
42
+ data_remove?: {
43
+ name: string;
44
+ write_guard?: string;
45
+ } | {
46
+ name: string;
47
+ items: {
48
+ id: (string | number)[];
49
+ write_guard?: string;
50
+ }[];
51
+ };
52
+
53
+ rewards?: ObjectsOp; // Reward operations
54
+ owner_receive?: ReceivedObjectsOrRecently;
55
+ um?: string | null; // Contact object
56
+ }
57
+ ```
58
+
59
+ ### PolicyRule
60
+
61
+ ```typescript
62
+ PolicyWriteGuard {
63
+ guard: string; // Guard object ID
64
+ id_from_submission?: number; // Guard table index for data ID (omit = user specifies)
65
+ data_from_submission?: number; // Guard table index for data value (omit = user specifies)
66
+ }
67
+
68
+ PolicyRule {
69
+ name: string; // Policy rule name
70
+ description: string; // Policy rule description
71
+ write_guard: PolicyWriteGuard[]; // Guard list for write verification
72
+ quote_guard?: string | null; // Guard for on-chain quote verification (null = no verification required)
73
+ id_from: 0 | 1 | 2 | "None" | "Clock" | "Signer" | "none" | "clock" | "signer";
74
+ // Data ID source: 0/None = user-specified, 1/Clock = timestamp, 2/Signer = signer ID
75
+ value_type: ValueType; // Type of data value
76
+ }
77
+ ```
78
+
79
+ ---
80
+
81
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, WithPermissionObject, ValueType, ObjectsOp, ReceivedObjectsOrRecently.
@@ -0,0 +1,40 @@
1
+ # onchain_operations / reward
2
+
3
+ Create reward pools and set claim conditions by Guard verification.
4
+
5
+ ## Data Schema
6
+
7
+ ```typescript
8
+ CallReward_Data {
9
+ // Object reference - string (existing) or object (create new)
10
+ object: TypedPermissionObject;
11
+
12
+ claim?: string; // Guard object ID for claiming
13
+ description?: string; // Reward description
14
+ coin_add?: CoinParam; // Add funds
15
+ receive?: ReceivedBalanceOrRecently; // Unwrap CoinWrapper
16
+
17
+ // Add reward Guards (each specifies a claim condition)
18
+ guard_add?: {
19
+ guard: string; // Guard object ID to verify
20
+ recipient: Recipient; // Who receives reward
21
+ amount: { // Amount (discriminated union)
22
+ type: "GuardU64Identifier";
23
+ value: number; // Identifier 0-255 in Guard table
24
+ } | {
25
+ type: "Fixed";
26
+ value: number; // Fixed amount
27
+ };
28
+ expiration_time?: number; // Expiration timestamp (ms)
29
+ store_from_id?: number | null; // Guard table storage identifier
30
+ }[];
31
+
32
+ guard_remove_expired?: boolean; // Remove expired Guards
33
+ guard_expiration_time?: number | null; // Lock adding new Guards until this time (ms)
34
+ owner_receive?: ReceivedObjectsOrRecently;
35
+ um?: string | null; // Contact object
36
+ }
37
+
38
+ ---
39
+
40
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, TypedPermissionObject, CoinParam, ReceivedBalanceOrRecently, ReceivedObjectsOrRecently, Recipient.