@ottochain/sdk 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/cjs/apps/contracts/index.js +1 -1
  2. package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +272 -0
  3. package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +284 -0
  4. package/dist/cjs/apps/contracts/state-machines/contract-universal.js +93 -0
  5. package/dist/cjs/apps/contracts/state-machines/index.js +177 -1
  6. package/dist/cjs/apps/corporate/state-machines/corp-board.js +1022 -0
  7. package/dist/cjs/apps/corporate/state-machines/corp-entity.js +671 -0
  8. package/dist/cjs/apps/corporate/state-machines/corp-securities.js +998 -0
  9. package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +1102 -0
  10. package/dist/cjs/apps/corporate/state-machines/index.js +20 -4440
  11. package/dist/cjs/apps/governance/index.js +7 -7
  12. package/dist/cjs/apps/governance/state-machines/dao-multisig.js +467 -0
  13. package/dist/cjs/apps/governance/state-machines/dao-reputation.js +458 -0
  14. package/dist/cjs/apps/governance/state-machines/dao-single.js +199 -0
  15. package/dist/cjs/apps/governance/state-machines/dao-token.js +503 -0
  16. package/dist/cjs/apps/governance/state-machines/governance-simple.js +482 -0
  17. package/dist/cjs/apps/governance/state-machines/governance-universal.js +138 -0
  18. package/dist/cjs/apps/governance/state-machines/index.js +16 -2934
  19. package/dist/cjs/apps/identity/constants.js +28 -14
  20. package/dist/cjs/apps/identity/index.js +27 -12
  21. package/dist/cjs/apps/identity/state-machines/identity-agent.js +256 -0
  22. package/dist/cjs/apps/identity/state-machines/identity-oracle.js +321 -0
  23. package/dist/cjs/apps/identity/state-machines/identity-universal.js +106 -0
  24. package/dist/cjs/apps/identity/state-machines/index.js +15 -784
  25. package/dist/cjs/apps/markets/index.js +1 -1
  26. package/dist/cjs/apps/markets/state-machines/index.js +14 -2298
  27. package/dist/cjs/apps/markets/state-machines/market-auction.js +283 -0
  28. package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +312 -0
  29. package/dist/cjs/apps/markets/state-machines/market-group-buy.js +407 -0
  30. package/dist/cjs/apps/markets/state-machines/market-prediction.js +485 -0
  31. package/dist/cjs/apps/markets/state-machines/market-universal.js +129 -0
  32. package/dist/cjs/apps/oracles/index.js +36 -0
  33. package/dist/cjs/generated/google/protobuf/struct.js +1 -1
  34. package/dist/cjs/generated/google/protobuf/timestamp.js +1 -1
  35. package/dist/cjs/generated/index.js +26 -22
  36. package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  37. package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  38. package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +1 -1
  39. package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +12 -12
  40. package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +1688 -0
  41. package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +1 -1
  42. package/dist/cjs/generated/ottochain/v1/common.js +1 -1
  43. package/dist/cjs/generated/ottochain/v1/fiber.js +1 -1
  44. package/dist/cjs/generated/ottochain/v1/messages.js +1 -1
  45. package/dist/cjs/generated/ottochain/v1/records.js +1 -1
  46. package/dist/cjs/schema/fiber-app.js +55 -0
  47. package/dist/cjs/schema/index.js +20 -0
  48. package/dist/esm/apps/contracts/index.js +3 -3
  49. package/dist/esm/apps/contracts/state-machines/contract-agreement.js +269 -0
  50. package/dist/esm/apps/contracts/state-machines/contract-escrow.js +281 -0
  51. package/dist/esm/apps/contracts/state-machines/contract-universal.js +90 -0
  52. package/dist/esm/apps/contracts/state-machines/index.js +177 -1
  53. package/dist/esm/apps/corporate/index.js +3 -3
  54. package/dist/esm/apps/corporate/state-machines/corp-board.js +1019 -0
  55. package/dist/esm/apps/corporate/state-machines/corp-entity.js +668 -0
  56. package/dist/esm/apps/corporate/state-machines/corp-securities.js +995 -0
  57. package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +1099 -0
  58. package/dist/esm/apps/corporate/state-machines/index.js +15 -4439
  59. package/dist/esm/apps/governance/index.js +9 -9
  60. package/dist/esm/apps/governance/state-machines/dao-multisig.js +464 -0
  61. package/dist/esm/apps/governance/state-machines/dao-reputation.js +455 -0
  62. package/dist/esm/apps/governance/state-machines/dao-single.js +196 -0
  63. package/dist/esm/apps/governance/state-machines/dao-token.js +500 -0
  64. package/dist/esm/apps/governance/state-machines/governance-simple.js +479 -0
  65. package/dist/esm/apps/governance/state-machines/governance-universal.js +135 -0
  66. package/dist/esm/apps/governance/state-machines/index.js +9 -2933
  67. package/dist/esm/apps/identity/constants.js +28 -14
  68. package/dist/esm/apps/identity/index.js +7 -5
  69. package/dist/esm/apps/identity/state-machines/identity-agent.js +253 -0
  70. package/dist/esm/apps/identity/state-machines/identity-oracle.js +318 -0
  71. package/dist/esm/apps/identity/state-machines/identity-universal.js +103 -0
  72. package/dist/esm/apps/identity/state-machines/index.js +11 -783
  73. package/dist/esm/apps/index.js +5 -5
  74. package/dist/esm/apps/markets/index.js +3 -3
  75. package/dist/esm/apps/markets/state-machines/index.js +8 -2297
  76. package/dist/esm/apps/markets/state-machines/market-auction.js +280 -0
  77. package/dist/esm/apps/markets/state-machines/market-crowdfund.js +309 -0
  78. package/dist/esm/apps/markets/state-machines/market-group-buy.js +404 -0
  79. package/dist/esm/apps/markets/state-machines/market-prediction.js +482 -0
  80. package/dist/esm/apps/markets/state-machines/market-universal.js +126 -0
  81. package/dist/esm/apps/oracles/index.js +21 -0
  82. package/dist/esm/generated/google/protobuf/struct.js +1 -1
  83. package/dist/esm/generated/google/protobuf/timestamp.js +1 -1
  84. package/dist/esm/generated/index.js +8 -4
  85. package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  86. package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  87. package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +1 -1
  88. package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +2 -2
  89. package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +1676 -0
  90. package/dist/esm/generated/ottochain/apps/markets/v1/market.js +1 -1
  91. package/dist/esm/generated/ottochain/v1/common.js +1 -1
  92. package/dist/esm/generated/ottochain/v1/fiber.js +1 -1
  93. package/dist/esm/generated/ottochain/v1/messages.js +1 -1
  94. package/dist/esm/generated/ottochain/v1/records.js +1 -1
  95. package/dist/esm/schema/fiber-app.js +47 -0
  96. package/dist/esm/schema/index.js +4 -0
  97. package/dist/types/apps/contracts/index.d.ts +151 -2
  98. package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +462 -0
  99. package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +511 -0
  100. package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +147 -0
  101. package/dist/types/apps/contracts/state-machines/index.d.ts +149 -0
  102. package/dist/types/apps/corporate/index.d.ts +5263 -3825
  103. package/dist/types/apps/corporate/state-machines/corp-board.d.ts +1479 -0
  104. package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +970 -0
  105. package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +1381 -0
  106. package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +1631 -0
  107. package/dist/types/apps/corporate/state-machines/index.d.ts +5245 -3802
  108. package/dist/types/apps/governance/index.d.ts +875 -37
  109. package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +644 -0
  110. package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +610 -0
  111. package/dist/types/apps/governance/state-machines/dao-single.d.ts +276 -0
  112. package/dist/types/apps/governance/state-machines/dao-token.d.ts +601 -0
  113. package/dist/types/apps/governance/state-machines/governance-simple.d.ts +652 -0
  114. package/dist/types/apps/governance/state-machines/governance-universal.d.ts +181 -0
  115. package/dist/types/apps/governance/state-machines/index.d.ts +9 -2136
  116. package/dist/types/apps/identity/constants.d.ts +8 -6
  117. package/dist/types/apps/identity/index.d.ts +1078 -577
  118. package/dist/types/apps/identity/state-machines/identity-agent.d.ts +401 -0
  119. package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +550 -0
  120. package/dist/types/apps/identity/state-machines/identity-universal.d.ts +151 -0
  121. package/dist/types/apps/identity/state-machines/index.d.ts +1069 -567
  122. package/dist/types/apps/index.d.ts +5 -5
  123. package/dist/types/apps/markets/index.d.ts +535 -7
  124. package/dist/types/apps/markets/state-machines/index.d.ts +8 -1678
  125. package/dist/types/apps/markets/state-machines/market-auction.d.ts +392 -0
  126. package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +443 -0
  127. package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +539 -0
  128. package/dist/types/apps/markets/state-machines/market-prediction.d.ts +651 -0
  129. package/dist/types/apps/markets/state-machines/market-universal.d.ts +191 -0
  130. package/dist/types/apps/oracles/index.d.ts +18 -0
  131. package/dist/types/generated/index.d.ts +3 -2
  132. package/dist/types/generated/ottochain/apps/identity/v1/attestation.d.ts +1 -1
  133. package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +187 -0
  134. package/dist/types/schema/fiber-app.d.ts +139 -0
  135. package/dist/types/schema/index.d.ts +4 -0
  136. package/package.json +1 -1
  137. package/dist/cjs/generated/ottochain/apps/identity/v1/agent.js +0 -619
  138. package/dist/cjs/generated/ottochain/apps/oracles/v1/oracle.js +0 -1223
  139. package/dist/esm/generated/ottochain/apps/identity/v1/agent.js +0 -610
  140. package/dist/esm/generated/ottochain/apps/oracles/v1/oracle.js +0 -1217
  141. package/dist/types/generated/ottochain/apps/identity/v1/agent.d.ts +0 -94
  142. package/dist/types/generated/ottochain/apps/oracles/v1/oracle.d.ts +0 -150
@@ -0,0 +1,610 @@
1
+ /**
2
+ * Reputation-based governance. Minimum reputation required for participation.
3
+ */
4
+ export declare const daoReputationDef: {
5
+ readonly metadata: {
6
+ readonly name: "DAOReputation";
7
+ readonly app: "governance";
8
+ readonly type: "daoReputation";
9
+ readonly version: "1.0.0";
10
+ readonly description: "Reputation-based governance. Minimum reputation required for participation.";
11
+ readonly category: "governance/dao";
12
+ readonly crossReferences: {
13
+ readonly Identity: "member verification";
14
+ readonly Reputation: "threshold checks";
15
+ readonly Contract: "action execution";
16
+ };
17
+ };
18
+ readonly createSchema: {
19
+ readonly required: readonly ["memberThreshold", "voteThreshold", "proposeThreshold", "quorum", "votingPeriodMs"];
20
+ readonly properties: {
21
+ readonly memberThreshold: {
22
+ readonly type: "number";
23
+ readonly description: "Min reputation to join as a member";
24
+ };
25
+ readonly voteThreshold: {
26
+ readonly type: "number";
27
+ readonly description: "Min reputation to vote";
28
+ };
29
+ readonly proposeThreshold: {
30
+ readonly type: "number";
31
+ readonly description: "Min reputation to submit a proposal";
32
+ };
33
+ readonly quorum: {
34
+ readonly type: "number";
35
+ readonly description: "Min total votes (count) to execute";
36
+ };
37
+ readonly votingPeriodMs: {
38
+ readonly type: "number";
39
+ readonly description: "Voting window in milliseconds";
40
+ };
41
+ };
42
+ };
43
+ readonly stateSchema: {
44
+ readonly properties: {
45
+ readonly members: {
46
+ readonly type: "array";
47
+ readonly computed: true;
48
+ };
49
+ readonly memberJoinedAt: {
50
+ readonly type: "object";
51
+ readonly computed: true;
52
+ };
53
+ readonly memberThreshold: {
54
+ readonly type: "number";
55
+ };
56
+ readonly voteThreshold: {
57
+ readonly type: "number";
58
+ };
59
+ readonly proposeThreshold: {
60
+ readonly type: "number";
61
+ };
62
+ readonly quorum: {
63
+ readonly type: "number";
64
+ };
65
+ readonly votingPeriodMs: {
66
+ readonly type: "number";
67
+ };
68
+ readonly proposal: {
69
+ readonly type: "object";
70
+ };
71
+ readonly votes: {
72
+ readonly type: "object";
73
+ readonly computed: true;
74
+ };
75
+ readonly history: {
76
+ readonly type: "array";
77
+ readonly computed: true;
78
+ };
79
+ };
80
+ };
81
+ readonly eventSchemas: {
82
+ readonly propose: {
83
+ readonly description: "Submit a proposal (requires >= proposeThreshold reputation)";
84
+ readonly required: readonly ["proposalId", "title", "description", "actionType", "payload", "agentReputation"];
85
+ readonly properties: {
86
+ readonly agent: {
87
+ readonly type: "address";
88
+ };
89
+ readonly agentReputation: {
90
+ readonly type: "number";
91
+ };
92
+ readonly proposalId: {
93
+ readonly type: "string";
94
+ };
95
+ readonly title: {
96
+ readonly type: "string";
97
+ };
98
+ readonly description: {
99
+ readonly type: "string";
100
+ };
101
+ readonly actionType: {
102
+ readonly type: "string";
103
+ };
104
+ readonly payload: {
105
+ readonly type: "object";
106
+ };
107
+ };
108
+ };
109
+ readonly vote: {
110
+ readonly description: "Cast a vote (requires >= voteThreshold, no double-vote, within window)";
111
+ readonly required: readonly ["vote", "agentReputation"];
112
+ readonly properties: {
113
+ readonly agent: {
114
+ readonly type: "address";
115
+ };
116
+ readonly agentReputation: {
117
+ readonly type: "number";
118
+ };
119
+ readonly vote: {
120
+ readonly type: "string";
121
+ readonly description: "\"for\" | \"against\" | \"abstain\"";
122
+ };
123
+ };
124
+ };
125
+ readonly execute: {
126
+ readonly description: "Execute a passing proposal after voting ends";
127
+ readonly properties: {};
128
+ };
129
+ readonly reject: {
130
+ readonly description: "Formally reject a failed proposal";
131
+ readonly properties: {};
132
+ };
133
+ readonly join: {
134
+ readonly description: "Join the DAO (requires >= memberThreshold reputation)";
135
+ readonly required: readonly ["agentReputation"];
136
+ readonly properties: {
137
+ readonly agent: {
138
+ readonly type: "address";
139
+ };
140
+ readonly agentReputation: {
141
+ readonly type: "number";
142
+ };
143
+ };
144
+ };
145
+ readonly leave: {
146
+ readonly description: "Leave the DAO voluntarily";
147
+ readonly properties: {
148
+ readonly agent: {
149
+ readonly type: "address";
150
+ };
151
+ };
152
+ };
153
+ readonly propose_threshold_change: {
154
+ readonly description: "Propose changing reputation thresholds";
155
+ readonly required: readonly ["proposalId", "agentReputation"];
156
+ readonly properties: {
157
+ readonly agent: {
158
+ readonly type: "address";
159
+ };
160
+ readonly agentReputation: {
161
+ readonly type: "number";
162
+ };
163
+ readonly proposalId: {
164
+ readonly type: "string";
165
+ };
166
+ readonly memberThreshold: {
167
+ readonly type: "number";
168
+ };
169
+ readonly voteThreshold: {
170
+ readonly type: "number";
171
+ };
172
+ readonly proposeThreshold: {
173
+ readonly type: "number";
174
+ };
175
+ };
176
+ };
177
+ };
178
+ readonly states: {
179
+ readonly ACTIVE: {
180
+ readonly id: "ACTIVE";
181
+ readonly isFinal: false;
182
+ readonly metadata: null;
183
+ };
184
+ readonly VOTING: {
185
+ readonly id: "VOTING";
186
+ readonly isFinal: false;
187
+ readonly metadata: null;
188
+ };
189
+ readonly DISSOLVED: {
190
+ readonly id: "DISSOLVED";
191
+ readonly isFinal: true;
192
+ readonly metadata: null;
193
+ };
194
+ };
195
+ readonly initialState: "ACTIVE";
196
+ readonly transitions: readonly [{
197
+ readonly from: "ACTIVE";
198
+ readonly to: "VOTING";
199
+ readonly eventName: "propose";
200
+ readonly guard: {
201
+ readonly ">=": readonly [{
202
+ readonly var: "event.agentReputation";
203
+ }, {
204
+ readonly var: "state.proposeThreshold";
205
+ }];
206
+ };
207
+ readonly effect: {
208
+ readonly merge: readonly [{
209
+ readonly var: "state";
210
+ }, {
211
+ readonly proposal: {
212
+ readonly id: {
213
+ readonly var: "event.proposalId";
214
+ };
215
+ readonly title: {
216
+ readonly var: "event.title";
217
+ };
218
+ readonly description: {
219
+ readonly var: "event.description";
220
+ };
221
+ readonly actionType: {
222
+ readonly var: "event.actionType";
223
+ };
224
+ readonly payload: {
225
+ readonly var: "event.payload";
226
+ };
227
+ readonly proposer: {
228
+ readonly var: "event.agent";
229
+ };
230
+ readonly proposedAt: {
231
+ readonly var: "$timestamp";
232
+ };
233
+ readonly deadline: {
234
+ readonly "+": readonly [{
235
+ readonly var: "$timestamp";
236
+ }, {
237
+ readonly var: "state.votingPeriodMs";
238
+ }];
239
+ };
240
+ };
241
+ readonly votes: {
242
+ readonly for: readonly [];
243
+ readonly against: readonly [];
244
+ readonly abstain: readonly [];
245
+ };
246
+ }];
247
+ };
248
+ readonly dependencies: readonly [];
249
+ }, {
250
+ readonly from: "VOTING";
251
+ readonly to: "VOTING";
252
+ readonly eventName: "vote";
253
+ readonly guard: {
254
+ readonly and: readonly [{
255
+ readonly ">=": readonly [{
256
+ readonly var: "event.agentReputation";
257
+ }, {
258
+ readonly var: "state.voteThreshold";
259
+ }];
260
+ }, {
261
+ readonly "!": readonly [{
262
+ readonly in: readonly [{
263
+ readonly var: "event.agent";
264
+ }, {
265
+ readonly var: "state.votes.for";
266
+ }];
267
+ }];
268
+ }, {
269
+ readonly "!": readonly [{
270
+ readonly in: readonly [{
271
+ readonly var: "event.agent";
272
+ }, {
273
+ readonly var: "state.votes.against";
274
+ }];
275
+ }];
276
+ }, {
277
+ readonly "!": readonly [{
278
+ readonly in: readonly [{
279
+ readonly var: "event.agent";
280
+ }, {
281
+ readonly var: "state.votes.abstain";
282
+ }];
283
+ }];
284
+ }, {
285
+ readonly "<=": readonly [{
286
+ readonly var: "$timestamp";
287
+ }, {
288
+ readonly var: "state.proposal.deadline";
289
+ }];
290
+ }];
291
+ };
292
+ readonly effect: {
293
+ readonly merge: readonly [{
294
+ readonly var: "state";
295
+ }, {
296
+ readonly votes: {
297
+ readonly if: readonly [{
298
+ readonly "===": readonly [{
299
+ readonly var: "event.vote";
300
+ }, "for"];
301
+ }, {
302
+ readonly merge: readonly [{
303
+ readonly var: "state.votes";
304
+ }, {
305
+ readonly for: {
306
+ readonly cat: readonly [{
307
+ readonly var: "state.votes.for";
308
+ }, readonly [{
309
+ readonly var: "event.agent";
310
+ }]];
311
+ };
312
+ }];
313
+ }, {
314
+ readonly "===": readonly [{
315
+ readonly var: "event.vote";
316
+ }, "against"];
317
+ }, {
318
+ readonly merge: readonly [{
319
+ readonly var: "state.votes";
320
+ }, {
321
+ readonly against: {
322
+ readonly cat: readonly [{
323
+ readonly var: "state.votes.against";
324
+ }, readonly [{
325
+ readonly var: "event.agent";
326
+ }]];
327
+ };
328
+ }];
329
+ }, {
330
+ readonly merge: readonly [{
331
+ readonly var: "state.votes";
332
+ }, {
333
+ readonly abstain: {
334
+ readonly cat: readonly [{
335
+ readonly var: "state.votes.abstain";
336
+ }, readonly [{
337
+ readonly var: "event.agent";
338
+ }]];
339
+ };
340
+ }];
341
+ }];
342
+ };
343
+ }];
344
+ };
345
+ readonly dependencies: readonly [];
346
+ }, {
347
+ readonly from: "VOTING";
348
+ readonly to: "ACTIVE";
349
+ readonly eventName: "execute";
350
+ readonly guard: {
351
+ readonly and: readonly [{
352
+ readonly ">": readonly [{
353
+ readonly var: "$timestamp";
354
+ }, {
355
+ readonly var: "state.proposal.deadline";
356
+ }];
357
+ }, {
358
+ readonly ">": readonly [{
359
+ readonly size: {
360
+ readonly var: "state.votes.for";
361
+ };
362
+ }, {
363
+ readonly size: {
364
+ readonly var: "state.votes.against";
365
+ };
366
+ }];
367
+ }, {
368
+ readonly ">=": readonly [{
369
+ readonly "+": readonly [{
370
+ readonly size: {
371
+ readonly var: "state.votes.for";
372
+ };
373
+ }, {
374
+ readonly size: {
375
+ readonly var: "state.votes.against";
376
+ };
377
+ }];
378
+ }, {
379
+ readonly var: "state.quorum";
380
+ }];
381
+ }];
382
+ };
383
+ readonly effect: {
384
+ readonly merge: readonly [{
385
+ readonly var: "state";
386
+ }, {
387
+ readonly history: {
388
+ readonly cat: readonly [{
389
+ readonly var: "state.history";
390
+ }, readonly [{
391
+ readonly type: "executed";
392
+ readonly proposal: {
393
+ readonly var: "state.proposal";
394
+ };
395
+ readonly votes: {
396
+ readonly var: "state.votes";
397
+ };
398
+ readonly at: {
399
+ readonly var: "$timestamp";
400
+ };
401
+ }]];
402
+ };
403
+ readonly proposal: null;
404
+ readonly votes: null;
405
+ }];
406
+ };
407
+ readonly emits: readonly [{
408
+ readonly event: "proposal_executed";
409
+ readonly to: "Reputation";
410
+ readonly payload: {
411
+ readonly action: "increase";
412
+ readonly agents: {
413
+ readonly var: "state.votes.for";
414
+ };
415
+ };
416
+ }];
417
+ readonly dependencies: readonly [];
418
+ }, {
419
+ readonly from: "VOTING";
420
+ readonly to: "ACTIVE";
421
+ readonly eventName: "reject";
422
+ readonly guard: {
423
+ readonly and: readonly [{
424
+ readonly ">": readonly [{
425
+ readonly var: "$timestamp";
426
+ }, {
427
+ readonly var: "state.proposal.deadline";
428
+ }];
429
+ }, {
430
+ readonly or: readonly [{
431
+ readonly "<=": readonly [{
432
+ readonly size: {
433
+ readonly var: "state.votes.for";
434
+ };
435
+ }, {
436
+ readonly size: {
437
+ readonly var: "state.votes.against";
438
+ };
439
+ }];
440
+ }, {
441
+ readonly "<": readonly [{
442
+ readonly "+": readonly [{
443
+ readonly size: {
444
+ readonly var: "state.votes.for";
445
+ };
446
+ }, {
447
+ readonly size: {
448
+ readonly var: "state.votes.against";
449
+ };
450
+ }];
451
+ }, {
452
+ readonly var: "state.quorum";
453
+ }];
454
+ }];
455
+ }];
456
+ };
457
+ readonly effect: {
458
+ readonly merge: readonly [{
459
+ readonly var: "state";
460
+ }, {
461
+ readonly history: {
462
+ readonly cat: readonly [{
463
+ readonly var: "state.history";
464
+ }, readonly [{
465
+ readonly type: "rejected";
466
+ readonly proposal: {
467
+ readonly var: "state.proposal";
468
+ };
469
+ readonly votes: {
470
+ readonly var: "state.votes";
471
+ };
472
+ readonly at: {
473
+ readonly var: "$timestamp";
474
+ };
475
+ }]];
476
+ };
477
+ readonly proposal: null;
478
+ readonly votes: null;
479
+ }];
480
+ };
481
+ readonly dependencies: readonly [];
482
+ }, {
483
+ readonly from: "ACTIVE";
484
+ readonly to: "ACTIVE";
485
+ readonly eventName: "join";
486
+ readonly guard: {
487
+ readonly and: readonly [{
488
+ readonly ">=": readonly [{
489
+ readonly var: "event.agentReputation";
490
+ }, {
491
+ readonly var: "state.memberThreshold";
492
+ }];
493
+ }, {
494
+ readonly "!": readonly [{
495
+ readonly in: readonly [{
496
+ readonly var: "event.agent";
497
+ }, {
498
+ readonly var: "state.members";
499
+ }];
500
+ }];
501
+ }];
502
+ };
503
+ readonly effect: {
504
+ readonly merge: readonly [{
505
+ readonly var: "state";
506
+ }, {
507
+ readonly members: {
508
+ readonly cat: readonly [{
509
+ readonly var: "state.members";
510
+ }, readonly [{
511
+ readonly var: "event.agent";
512
+ }]];
513
+ };
514
+ readonly memberJoinedAt: {
515
+ readonly setKey: readonly [{
516
+ readonly var: "state.memberJoinedAt";
517
+ }, {
518
+ readonly var: "event.agent";
519
+ }, {
520
+ readonly var: "$timestamp";
521
+ }];
522
+ };
523
+ }];
524
+ };
525
+ readonly dependencies: readonly [];
526
+ }, {
527
+ readonly from: "ACTIVE";
528
+ readonly to: "ACTIVE";
529
+ readonly eventName: "leave";
530
+ readonly guard: {
531
+ readonly in: readonly [{
532
+ readonly var: "event.agent";
533
+ }, {
534
+ readonly var: "state.members";
535
+ }];
536
+ };
537
+ readonly effect: {
538
+ readonly merge: readonly [{
539
+ readonly var: "state";
540
+ }, {
541
+ readonly members: {
542
+ readonly filter: readonly [{
543
+ readonly var: "state.members";
544
+ }, {
545
+ readonly "!==": readonly [{
546
+ readonly var: "";
547
+ }, {
548
+ readonly var: "event.agent";
549
+ }];
550
+ }];
551
+ };
552
+ }];
553
+ };
554
+ readonly dependencies: readonly [];
555
+ }, {
556
+ readonly from: "ACTIVE";
557
+ readonly to: "VOTING";
558
+ readonly eventName: "propose_threshold_change";
559
+ readonly guard: {
560
+ readonly ">=": readonly [{
561
+ readonly var: "event.agentReputation";
562
+ }, {
563
+ readonly var: "state.proposeThreshold";
564
+ }];
565
+ };
566
+ readonly effect: {
567
+ readonly merge: readonly [{
568
+ readonly var: "state";
569
+ }, {
570
+ readonly proposal: {
571
+ readonly id: {
572
+ readonly var: "event.proposalId";
573
+ };
574
+ readonly title: "Threshold Change";
575
+ readonly actionType: "threshold_change";
576
+ readonly payload: {
577
+ readonly memberThreshold: {
578
+ readonly var: "event.memberThreshold";
579
+ };
580
+ readonly voteThreshold: {
581
+ readonly var: "event.voteThreshold";
582
+ };
583
+ readonly proposeThreshold: {
584
+ readonly var: "event.proposeThreshold";
585
+ };
586
+ };
587
+ readonly proposer: {
588
+ readonly var: "event.agent";
589
+ };
590
+ readonly proposedAt: {
591
+ readonly var: "$timestamp";
592
+ };
593
+ readonly deadline: {
594
+ readonly "+": readonly [{
595
+ readonly var: "$timestamp";
596
+ }, {
597
+ readonly var: "state.votingPeriodMs";
598
+ }];
599
+ };
600
+ };
601
+ readonly votes: {
602
+ readonly for: readonly [];
603
+ readonly against: readonly [];
604
+ readonly abstain: readonly [];
605
+ };
606
+ }];
607
+ };
608
+ readonly dependencies: readonly [];
609
+ }];
610
+ };