@hyperscale0/hsx 1.0.0-rc.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/CHANGELOG.md +32 -4
  2. package/README.md +58 -36
  3. package/bin/hsx.ts +2 -0
  4. package/dist/bin/hsx.js +2 -0
  5. package/dist/bin/hsx.js.map +1 -1
  6. package/dist/src/ast.d.ts +10 -2
  7. package/dist/src/ast.d.ts.map +1 -1
  8. package/dist/src/ast.js +24 -0
  9. package/dist/src/ast.js.map +1 -1
  10. package/dist/src/cli.d.ts +3 -1
  11. package/dist/src/cli.d.ts.map +1 -1
  12. package/dist/src/cli.js +25 -5
  13. package/dist/src/cli.js.map +1 -1
  14. package/dist/src/compile.d.ts +9 -5
  15. package/dist/src/compile.d.ts.map +1 -1
  16. package/dist/src/compile.js +9 -3
  17. package/dist/src/compile.js.map +1 -1
  18. package/dist/src/cost.d.ts +3 -1
  19. package/dist/src/cost.d.ts.map +1 -1
  20. package/dist/src/cost.js +124 -94
  21. package/dist/src/cost.js.map +1 -1
  22. package/dist/src/diagnostics.d.ts.map +1 -1
  23. package/dist/src/diagnostics.js +89 -5
  24. package/dist/src/diagnostics.js.map +1 -1
  25. package/dist/src/emit.d.ts +4 -3
  26. package/dist/src/emit.d.ts.map +1 -1
  27. package/dist/src/emit.js +28 -233
  28. package/dist/src/emit.js.map +1 -1
  29. package/dist/src/format.js.map +1 -1
  30. package/dist/src/index.d.ts +4 -3
  31. package/dist/src/index.d.ts.map +1 -1
  32. package/dist/src/index.js +3 -1
  33. package/dist/src/index.js.map +1 -1
  34. package/dist/src/ir.d.ts.map +1 -1
  35. package/dist/src/lex.d.ts.map +1 -1
  36. package/dist/src/lsp/server.d.ts +32 -0
  37. package/dist/src/lsp/server.d.ts.map +1 -0
  38. package/dist/src/lsp/server.js +391 -0
  39. package/dist/src/lsp/server.js.map +1 -0
  40. package/dist/src/modules.d.ts +2 -0
  41. package/dist/src/modules.d.ts.map +1 -1
  42. package/dist/src/modules.js +14 -14
  43. package/dist/src/modules.js.map +1 -1
  44. package/dist/src/parse.js +3 -3
  45. package/dist/src/parse.js.map +1 -1
  46. package/dist/src/std-bundle.d.ts +2 -0
  47. package/dist/src/std-bundle.d.ts.map +1 -0
  48. package/dist/src/std-bundle.js +88 -0
  49. package/dist/src/std-bundle.js.map +1 -0
  50. package/dist/src/std-library.d.ts +5 -0
  51. package/dist/src/std-library.d.ts.map +1 -0
  52. package/dist/src/std-library.js +9 -0
  53. package/dist/src/std-library.js.map +1 -0
  54. package/dist/src/typecheck.d.ts.map +1 -1
  55. package/dist/src/typecheck.js +859 -156
  56. package/dist/src/typecheck.js.map +1 -1
  57. package/dist/src/version.d.ts +1 -1
  58. package/dist/src/version.d.ts.map +1 -1
  59. package/dist/src/version.js +1 -1
  60. package/dist/src/version.js.map +1 -1
  61. package/docs/README.md +12 -0
  62. package/docs/assets/hsx.svg +18 -0
  63. package/docs/guide/01-first-program.md +2 -2
  64. package/docs/guide/02-money.md +1 -1
  65. package/docs/guide/03-instruments.md +44 -3
  66. package/docs/guide/04-lifecycles.md +18 -3
  67. package/docs/guide/05-fees-and-splits.md +2 -2
  68. package/docs/guide/06-schedules.md +1 -1
  69. package/docs/guide/07-composition.md +8 -2
  70. package/docs/guide/08-writing-a-module.md +13 -2
  71. package/docs/guide/09-cost.md +3 -3
  72. package/docs/guide/10-diagnostics.md +1 -1
  73. package/docs/llms-full.txt +458 -194
  74. package/docs/llms.txt +2 -2
  75. package/docs/playground.md +55 -0
  76. package/docs/reference/cli.md +5 -3
  77. package/docs/reference/diagnostics.md +223 -37
  78. package/docs/reference/grammar.md +2 -2
  79. package/docs/reference/std/advance.md +2 -2
  80. package/docs/reference/std/cancellable_booking.md +10 -10
  81. package/docs/reference/std/captured_payment.md +14 -14
  82. package/docs/reference/std/conditional_disbursement.md +3 -3
  83. package/docs/reference/std/credit_facility.md +2 -2
  84. package/docs/reference/std/held_payment.md +37 -33
  85. package/docs/reference/std/instant_transfer.md +8 -8
  86. package/docs/reference/std/metered.md +2 -2
  87. package/docs/reference/std/pooled_split.md +2 -2
  88. package/docs/reference/std/premium_forward.md +13 -13
  89. package/docs/reference/std/reconciled_payout.md +2 -2
  90. package/docs/reference/std/recurring_collection.md +2 -2
  91. package/docs/reference/std/rotating_pool.md +2 -2
  92. package/docs/reference/std/scheduled.md +18 -18
  93. package/docs/reference/std/security_deposit.md +14 -14
  94. package/docs/reference/std/settlement_batch.md +2 -2
  95. package/docs/reference/std/swap.md +18 -18
  96. package/docs/reference/std/threshold_pool.md +2 -2
  97. package/docs/reference/std/weighted_distribution.md +2 -2
  98. package/docs/reference/types.md +1 -1
  99. package/docs/reference/udl-output.md +2 -3
  100. package/examples/01-first-program/README.md +1 -1
  101. package/examples/01-first-program/tip-jar.hsx +1 -1
  102. package/examples/02-imports-and-archetypes/README.md +1 -4
  103. package/examples/02-imports-and-archetypes/photo-booth.hsx +1 -1
  104. package/examples/03-diagnostics/corner-shop-fixed.hsx +1 -1
  105. package/examples/03-diagnostics/corner-shop.hsx +1 -1
  106. package/examples/04-complete-product/README.md +0 -3
  107. package/examples/04-complete-product/study-hall.hsx +1 -1
  108. package/examples/05-watch-club/README.md +0 -3
  109. package/examples/05-watch-club/watch-club.hsx +1 -1
  110. package/examples/README.md +35 -4
  111. package/examples/advance/advance.hsx +1 -1
  112. package/examples/advance/advance.udl +10 -5
  113. package/examples/cancellable_booking/cancellable_booking.hsx +1 -1
  114. package/examples/cancellable_booking/cancellable_booking.udl +3 -1
  115. package/examples/captured_payment/captured_payment.hsx +1 -1
  116. package/examples/captured_payment/captured_payment.udl +4 -1
  117. package/examples/conditional_disbursement/conditional_disbursement.hsx +1 -1
  118. package/examples/conditional_disbursement/conditional_disbursement.udl +5 -3
  119. package/examples/cost-table.json +1602 -382
  120. package/examples/credit_facility/credit_facility.hsx +1 -1
  121. package/examples/credit_facility/credit_facility.udl +16 -9
  122. package/examples/held_payment/held_payment.hsx +1 -1
  123. package/examples/held_payment/held_payment.udl +38 -3
  124. package/examples/instant_transfer/instant_transfer.hsx +1 -1
  125. package/examples/instant_transfer/instant_transfer.udl +11 -5
  126. package/examples/metered/metered.hsx +1 -1
  127. package/examples/metered/metered.udl +4 -2
  128. package/examples/pooled_split/pooled_split.hsx +1 -1
  129. package/examples/pooled_split/pooled_split.udl +6 -3
  130. package/examples/premium_forward/premium_forward.hsx +1 -1
  131. package/examples/premium_forward/premium_forward.udl +10 -4
  132. package/examples/reconciled_payout/reconciled_payout.hsx +1 -1
  133. package/examples/reconciled_payout/reconciled_payout.udl +4 -2
  134. package/examples/recurring_collection/recurring_collection.hsx +1 -1
  135. package/examples/recurring_collection/recurring_collection.udl +12 -7
  136. package/examples/rotating_pool/rotating_pool.hsx +1 -1
  137. package/examples/rotating_pool/rotating_pool.udl +14 -4
  138. package/examples/scheduled/scheduled.hsx +1 -1
  139. package/examples/scheduled/scheduled.udl +9 -4
  140. package/examples/security_deposit/security_deposit.hsx +1 -1
  141. package/examples/security_deposit/security_deposit.udl +17 -3
  142. package/examples/settlement_batch/settlement_batch.hsx +1 -1
  143. package/examples/swap/swap.hsx +1 -1
  144. package/examples/swap/swap.udl +12 -6
  145. package/examples/threshold_pool/threshold_pool.hsx +1 -1
  146. package/examples/threshold_pool/threshold_pool.udl +4 -2
  147. package/examples/weighted_distribution/weighted_distribution.hsx +1 -1
  148. package/examples/weighted_distribution/weighted_distribution.udl +4 -2
  149. package/package.json +15 -6
  150. package/skills/hsx/SKILL.md +26 -26
  151. package/src/ast.ts +34 -2
  152. package/src/cli.ts +32 -13
  153. package/src/compile.ts +15 -7
  154. package/src/cost.ts +176 -104
  155. package/src/diagnostics.ts +89 -4
  156. package/src/emit.ts +34 -266
  157. package/src/index.ts +10 -7
  158. package/src/lsp/server.ts +460 -0
  159. package/src/modules.ts +21 -13
  160. package/src/parse.ts +3 -3
  161. package/src/std-bundle.ts +91 -0
  162. package/src/std-library.ts +12 -0
  163. package/src/typecheck.ts +1147 -235
  164. package/src/version.ts +1 -1
  165. package/std/SEMANTICS.md +12 -3
  166. package/std/{settlements → money_flows}/advance.hsx +1 -1
  167. package/std/{settlements → money_flows}/cancellable_booking.hsx +4 -3
  168. package/std/{settlements → money_flows}/captured_payment.hsx +35 -6
  169. package/std/{settlements → money_flows}/conditional_disbursement.hsx +17 -16
  170. package/std/{settlements → money_flows}/credit_facility.hsx +1 -2
  171. package/std/{settlements → money_flows}/held_payment.hsx +59 -25
  172. package/std/money_flows/index.hsx +3 -0
  173. package/std/{settlements → money_flows}/instant_transfer.hsx +2 -3
  174. package/std/{settlements → money_flows}/metered.hsx +1 -1
  175. package/std/{settlements → money_flows}/pooled_split.hsx +3 -3
  176. package/std/{settlements → money_flows}/premium_forward.hsx +22 -23
  177. package/std/{settlements → money_flows}/reconciled_payout.hsx +3 -3
  178. package/std/{settlements → money_flows}/recurring_collection.hsx +1 -1
  179. package/std/{settlements → money_flows}/rotating_pool.hsx +8 -6
  180. package/std/{settlements → money_flows}/scheduled.hsx +22 -27
  181. package/std/{settlements → money_flows}/security_deposit.hsx +38 -14
  182. package/std/{settlements → money_flows}/settlement_batch.hsx +3 -3
  183. package/std/{settlements → money_flows}/swap.hsx +41 -16
  184. package/std/{settlements → money_flows}/threshold_pool.hsx +5 -5
  185. package/std/{settlements → money_flows}/weighted_distribution.hsx +6 -6
  186. package/docs/sessions/2026-09-02-two-instruments.hsx +0 -21
  187. package/docs/sessions/2026-09-02-two-instruments.md +0 -41
  188. package/std/settlements/index.hsx +0 -3
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # held_payment
4
4
 
5
- Source: [`std/settlements/held_payment.hsx`](../../../std/settlements/held_payment.hsx)
5
+ Source: [`std/money_flows/held_payment.hsx`](../../../std/money_flows/held_payment.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -31,34 +31,38 @@ Source: [`std/settlements/held_payment.hsx`](../../../std/settlements/held_payme
31
31
 
32
32
  ## Actions and clauses
33
33
 
34
- | Action | Clauses lowered |
35
- | --------------------- | --------------------------------------------------------------------------------------------- |
36
- | `fund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
37
- | `fund_piece_3` | `agent description`, `moves`, `steps`, `summary` |
38
- | `collect_service_fee` | `agent description`, `moves`, `steps`, `summary` |
39
- | `release_piece_2` | `agent description`, `moves`, `steps`, `summary` |
40
- | `release_piece_3` | `agent description`, `moves`, `steps`, `summary` |
41
- | `refund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
42
- | `refund_piece_3` | `agent description`, `moves`, `steps`, `summary` |
43
- | `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
44
- | `unfund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
45
- | `unfund_piece_3` | `agent description`, `moves`, `steps`, `summary` |
46
- | `create` | `agent description`, `moves`, `steps`, `summary` |
47
- | `fund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
48
- | `release_name` | `agent description`, `deadline`, `description`, `input`, `moves`, `port`, `steps`, `summary` |
49
- | `release_on_deadline` | `due`, `moves`, `steps`, `summary` |
50
- | `cancel` | `agent description`, `deadline`, `moves`, `steps`, `summary` |
51
- | `fund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
52
- | `release_piece_2` | `agent description`, `moves`, `steps`, `summary` |
53
- | `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
54
- | `fund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
55
- | `release_piece_2` | `agent description`, `moves`, `steps`, `summary` |
56
- | `refund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
57
- | `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
58
- | `abandon` | `agent description`, `moves`, `steps`, `summary` |
59
- | `create` | `agent description`, `moves`, `steps`, `summary` |
60
- | `fund` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
61
- | `release_action` | `agent description`, `deadline`, `moves`, `port`, `sandbox failure point`, `steps`, `summary` |
62
- | `release_on_deadline` | `due`, `event name`, `moves`, `steps`, `summary` |
63
- | `cancel` | `agent description`, `deadline`, `event name`, `moves`, `steps`, `summary` |
64
- | `abandon` | `agent description`, `moves`, `steps`, `summary` |
34
+ | Action | Clauses lowered |
35
+ | --------------------- | ------------------------------------------------------------------------------------------------------ |
36
+ | `fund_piece_2` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
37
+ | `fund_piece_3` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
38
+ | `collect_service_fee` | `agent description`, `moves`, `steps`, `summary` |
39
+ | `release_piece_2` | `agent description`, `moves`, `steps`, `summary` |
40
+ | `release_piece_3` | `agent description`, `moves`, `steps`, `summary` |
41
+ | `refund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
42
+ | `refund_piece_3` | `agent description`, `moves`, `steps`, `summary` |
43
+ | `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
44
+ | `unfund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
45
+ | `unfund_piece_3` | `agent description`, `moves`, `steps`, `summary` |
46
+ | `create` | `agent description`, `moves`, `steps`, `summary` |
47
+ | `fund_piece_1` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
48
+ | `release_name` | `agent description`, `deadline`, `input`, `moves`, `port`, `sandbox failure point`, `steps`, `summary` |
49
+ | `release_on_deadline` | `due`, `moves`, `steps`, `summary` |
50
+ | `cancel` | `agent description`, `deadline`, `moves`, `steps`, `summary` |
51
+ | `fund_piece_2` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
52
+ | `release_piece_2` | `agent description`, `moves`, `steps`, `summary` |
53
+ | `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
54
+ | `fund_piece_2` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
55
+ | `release_piece_2` | `agent description`, `moves`, `steps`, `summary` |
56
+ | `refund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
57
+ | `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
58
+ | `abandon` | `agent description`, `moves`, `steps`, `summary` |
59
+ | `dispute` | `agent description`, `description`, `moves`, `steps`, `summary` |
60
+ | `resume` | `agent description`, `description`, `moves`, `steps`, `summary` |
61
+ | `create` | `agent description`, `moves`, `steps`, `summary` |
62
+ | `fund` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
63
+ | `release_action` | `agent description`, `deadline`, `moves`, `port`, `sandbox failure point`, `steps`, `summary` |
64
+ | `release_on_deadline` | `due`, `event name`, `moves`, `steps`, `summary` |
65
+ | `cancel` | `agent description`, `deadline`, `event name`, `moves`, `steps`, `summary` |
66
+ | `abandon` | `agent description`, `moves`, `steps`, `summary` |
67
+ | `dispute` | `agent description`, `description`, `moves`, `steps`, `summary` |
68
+ | `resume` | `agent description`, `description`, `moves`, `steps`, `summary` |
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # instant_transfer
4
4
 
5
- Source: [`std/settlements/instant_transfer.hsx`](../../../std/settlements/instant_transfer.hsx)
5
+ Source: [`std/money_flows/instant_transfer.hsx`](../../../std/money_flows/instant_transfer.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -22,9 +22,9 @@ None.
22
22
 
23
23
  ## Actions and clauses
24
24
 
25
- | Action | Clauses lowered |
26
- | --------------------- | ------------------------------------------------ |
27
- | `create` | `agent description`, `moves`, `steps`, `summary` |
28
- | `pay_piece_1` | `agent description`, `moves`, `steps`, `summary` |
29
- | `pay_piece_2` | `agent description`, `moves`, `steps`, `summary` |
30
- | `collect_service_fee` | `agent description`, `moves`, `steps`, `summary` |
25
+ | Action | Clauses lowered |
26
+ | --------------------- | ------------------------------------------------------------------------- |
27
+ | `create` | `agent description`, `moves`, `steps`, `summary` |
28
+ | `pay_piece_1` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
29
+ | `pay_piece_2` | `agent description`, `moves`, `steps`, `summary` |
30
+ | `collect_service_fee` | `agent description`, `moves`, `steps`, `summary` |
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # metered
4
4
 
5
- Source: [`std/settlements/metered.hsx`](../../../std/settlements/metered.hsx)
5
+ Source: [`std/money_flows/metered.hsx`](../../../std/money_flows/metered.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # pooled_split
4
4
 
5
- Source: [`std/settlements/pooled_split.hsx`](../../../std/settlements/pooled_split.hsx)
5
+ Source: [`std/money_flows/pooled_split.hsx`](../../../std/money_flows/pooled_split.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # premium_forward
4
4
 
5
- Source: [`std/settlements/premium_forward.hsx`](../../../std/settlements/premium_forward.hsx)
5
+ Source: [`std/money_flows/premium_forward.hsx`](../../../std/money_flows/premium_forward.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -26,14 +26,14 @@ Source: [`std/settlements/premium_forward.hsx`](../../../std/settlements/premium
26
26
 
27
27
  ## Actions and clauses
28
28
 
29
- | Action | Clauses lowered |
30
- | ----------------- | ---------------------------------------------------------------------------------------- |
31
- | `create` | `agent description`, `steps`, `summary` |
32
- | `fund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
33
- | `fund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
34
- | `bind` | `agent description`, `description`, `input`, `moves`, `port`, `steps`, `summary` |
35
- | `forward_piece_2` | `agent description`, `moves`, `steps`, `summary` |
36
- | `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
37
- | `abandon` | `agent description`, `steps`, `summary` |
38
- | `endorsement` | `agent description`, `capture input`, `description`, `input`, `port`, `steps`, `summary` |
39
- | `lapse` | `due`, `steps`, `summary` |
29
+ | Action | Clauses lowered |
30
+ | ----------------- | ------------------------------------------------------------------------------------------ |
31
+ | `create` | `agent description`, `steps`, `summary` |
32
+ | `fund_piece_1` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
33
+ | `fund_piece_2` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
34
+ | `bind` | `agent description`, `input`, `moves`, `port`, `sandbox failure point`, `steps`, `summary` |
35
+ | `forward_piece_2` | `agent description`, `moves`, `steps`, `summary` |
36
+ | `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
37
+ | `abandon` | `agent description`, `steps`, `summary` |
38
+ | `endorsement` | `agent description`, `capture input`, `input`, `port`, `steps`, `summary` |
39
+ | `lapse` | `due`, `steps`, `summary` |
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # reconciled_payout
4
4
 
5
- Source: [`std/settlements/reconciled_payout.hsx`](../../../std/settlements/reconciled_payout.hsx)
5
+ Source: [`std/money_flows/reconciled_payout.hsx`](../../../std/money_flows/reconciled_payout.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # recurring_collection
4
4
 
5
- Source: [`std/settlements/recurring_collection.hsx`](../../../std/settlements/recurring_collection.hsx)
5
+ Source: [`std/money_flows/recurring_collection.hsx`](../../../std/money_flows/recurring_collection.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # rotating_pool
4
4
 
5
- Source: [`std/settlements/rotating_pool.hsx`](../../../std/settlements/rotating_pool.hsx)
5
+ Source: [`std/money_flows/rotating_pool.hsx`](../../../std/money_flows/rotating_pool.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # scheduled
4
4
 
5
- Source: [`std/settlements/scheduled.hsx`](../../../std/settlements/scheduled.hsx)
5
+ Source: [`std/money_flows/scheduled.hsx`](../../../std/money_flows/scheduled.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -33,19 +33,19 @@ Source: [`std/settlements/scheduled.hsx`](../../../std/settlements/scheduled.hsx
33
33
 
34
34
  ## Actions and clauses
35
35
 
36
- | Action | Clauses lowered |
37
- | ------------------- | ------------------------------------------------------------------------------------------------- |
38
- | `create` | `agent description`, `steps`, `summary` |
39
- | `create` | `agent description`, `moves`, `steps`, `summary` |
40
- | `approve` | `agent description`, `steps`, `summary` |
41
- | `advance` | `agent description`, `moves`, `steps`, `summary` |
42
- | `delinquent_action` | `due`, `sets at`, `steps`, `summary` |
43
- | `complete` | `due`, `steps`, `summary` |
44
- | `write_off` | `agent description`, `steps`, `summary` |
45
- | `create` | `agent description`, `steps`, `summary` |
46
- | `repay` | `agent description`, `capture input`, `description`, `input`, `moves`, `port`, `steps`, `summary` |
47
- | `refund` | `agent description`, `moves`, `steps`, `summary` |
48
- | `create` | `agent description`, `steps`, `summary` |
49
- | `open_period` | `due`, `steps`, `summary` |
50
- | `collect_period` | `agent description`, `capture input`, `description`, `input`, `moves`, `port`, `steps`, `summary` |
51
- | `until` | `agent description`, `capture input`, `description`, `input`, `port`, `steps`, `summary` |
36
+ | Action | Clauses lowered |
37
+ | ------------------- | -------------------------------------------------------------------------------------------------------------------------- |
38
+ | `create` | `agent description`, `steps`, `summary` |
39
+ | `create` | `agent description`, `moves`, `steps`, `summary` |
40
+ | `approve` | `agent description`, `steps`, `summary` |
41
+ | `advance` | `agent description`, `moves`, `steps`, `summary` |
42
+ | `delinquent_action` | `due`, `sets at`, `steps`, `summary` |
43
+ | `complete` | `due`, `steps`, `summary` |
44
+ | `write_off` | `agent description`, `steps`, `summary` |
45
+ | `create` | `agent description`, `steps`, `summary` |
46
+ | `repay` | `agent description`, `capture input`, `description`, `input`, `moves`, `port`, `steps`, `summary` |
47
+ | `refund` | `agent description`, `moves`, `steps`, `summary` |
48
+ | `create` | `agent description`, `steps`, `summary` |
49
+ | `open_period` | `due`, `steps`, `summary` |
50
+ | `collect_period` | `agent description`, `capture input`, `description`, `input`, `moves`, `port`, `sandbox failure point`, `steps`, `summary` |
51
+ | `until` | `agent description`, `capture input`, `input`, `port`, `steps`, `summary` |
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # security_deposit
4
4
 
5
- Source: [`std/settlements/security_deposit.hsx`](../../../std/settlements/security_deposit.hsx)
5
+ Source: [`std/money_flows/security_deposit.hsx`](../../../std/money_flows/security_deposit.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -32,15 +32,15 @@ Source: [`std/settlements/security_deposit.hsx`](../../../std/settlements/securi
32
32
 
33
33
  ## Actions and clauses
34
34
 
35
- | Action | Clauses lowered |
36
- | --------------- | ---------------------------------------------------------------------------------------------------------------- |
37
- | `create` | `agent description`, `moves`, `steps`, `summary` |
38
- | `place_deposit` | `agent description`, `moves`, `steps`, `summary` |
39
- | `claim_name` | `agent description`, `description`, `input`, `moves`, `port`, `steps`, `summary` |
40
- | `return_name` | `agent description`, `moves`, `steps`, `summary` |
41
- | `create` | `agent description`, `deadline`, `moves`, `steps`, `summary` |
42
- | `fund` | `agent description`, `deadline`, `moves`, `sandbox failure point`, `steps`, `summary` |
43
- | `claim` | `agent description`, `capture input`, `deadline`, `decided amount`, `input`, `moves`, `port`, `steps`, `summary` |
44
- | `return` | `agent description`, `deadline`, `moves`, `port`, `steps`, `summary` |
45
- | `expire` | `due`, `moves`, `steps`, `summary` |
46
- | `cancel` | `agent description`, `moves`, `steps`, `summary` |
35
+ | Action | Clauses lowered |
36
+ | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
37
+ | `create` | `agent description`, `moves`, `steps`, `summary` |
38
+ | `place_deposit` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
39
+ | `claim_name` | `agent description`, `input`, `moves`, `port`, `steps`, `summary` |
40
+ | `return_name` | `agent description`, `capture input`, `input`, `moves`, `port`, `steps`, `summary` |
41
+ | `create` | `agent description`, `deadline`, `moves`, `steps`, `summary` |
42
+ | `fund` | `agent description`, `deadline`, `moves`, `sandbox failure point`, `steps`, `summary` |
43
+ | `claim` | `agent description`, `capture input`, `deadline`, `decided amount`, `input`, `moves`, `port`, `sandbox failure point`, `steps`, `summary` |
44
+ | `return` | `agent description`, `deadline`, `moves`, `port`, `steps`, `summary` |
45
+ | `expire` | `due`, `moves`, `steps`, `summary` |
46
+ | `cancel` | `agent description`, `moves`, `steps`, `summary` |
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # settlement_batch
4
4
 
5
- Source: [`std/settlements/settlement_batch.hsx`](../../../std/settlements/settlement_batch.hsx)
5
+ Source: [`std/money_flows/settlement_batch.hsx`](../../../std/money_flows/settlement_batch.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # swap
4
4
 
5
- Source: [`std/settlements/swap.hsx`](../../../std/settlements/swap.hsx)
5
+ Source: [`std/money_flows/swap.hsx`](../../../std/money_flows/swap.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -28,19 +28,19 @@ Source: [`std/settlements/swap.hsx`](../../../std/settlements/swap.hsx)
28
28
 
29
29
  ## Actions and clauses
30
30
 
31
- | Action | Clauses lowered |
32
- | --------- | --------------------------------------------------------------------------------------------------------------------------- |
33
- | `abandon` | `agent description`, `moves`, `public action`, `steps`, `summary` |
34
- | `cancel` | `agent description`, `moves`, `public action`, `steps`, `summary` |
35
- | `create` | `agent description`, `moves`, `public action`, `steps`, `summary` |
36
- | `dispute` | `agent description`, `deadline`, `moves`, `port`, `public action`, `steps`, `summary` |
37
- | `fund` | `agent description`, `moves`, `public action`, `steps`, `summary` |
38
- | `post` | `due`, `moves`, `steps`, `summary` |
39
- | `release` | `agent description`, `moves`, `port`, `public action`, `sets at`, `steps`, `summary` |
40
- | `create` | `agent description`, `moves`, `public action`, `steps`, `summary` |
41
- | `fund` | `agent description`, `event name`, `moves`, `public action`, `sandbox failure point`, `steps`, `summary` |
42
- | `release` | `agent description`, `event name`, `moves`, `port`, `public action`, `sandbox failure point`, `sets at`, `steps`, `summary` |
43
- | `post` | `due`, `event name`, `moves`, `steps`, `summary` |
44
- | `dispute` | `agent description`, `deadline`, `event name`, `moves`, `port`, `public action`, `steps`, `summary` |
45
- | `cancel` | `agent description`, `event name`, `moves`, `public action`, `steps`, `summary` |
46
- | `abandon` | `agent description`, `event name`, `moves`, `public action`, `steps`, `summary` |
31
+ | Action | Clauses lowered |
32
+ | --------- | ----------------------------------------------------------------------------------------------------------------------------- |
33
+ | `abandon` | `agent description`, `moves`, `public action`, `steps`, `summary` |
34
+ | `cancel` | `agent description`, `moves`, `public action`, `steps`, `summary` |
35
+ | `create` | `agent description`, `moves`, `public action`, `steps`, `summary` |
36
+ | `dispute` | `agent description`, `capture input`, `deadline`, `input`, `moves`, `port`, `public action`, `steps`, `summary` |
37
+ | `fund` | `agent description`, `moves`, `public action`, `sandbox failure point`, `steps`, `summary` |
38
+ | `post` | `due`, `moves`, `steps`, `summary` |
39
+ | `release` | `agent description`, `moves`, `port`, `public action`, `sandbox failure point`, `sets at`, `steps`, `summary` |
40
+ | `create` | `agent description`, `moves`, `public action`, `steps`, `summary` |
41
+ | `fund` | `agent description`, `event name`, `moves`, `public action`, `sandbox failure point`, `steps`, `summary` |
42
+ | `release` | `agent description`, `event name`, `moves`, `port`, `public action`, `sandbox failure point`, `sets at`, `steps`, `summary` |
43
+ | `post` | `due`, `event name`, `moves`, `steps`, `summary` |
44
+ | `dispute` | `agent description`, `capture input`, `deadline`, `event name`, `input`, `moves`, `port`, `public action`, `steps`, `summary` |
45
+ | `cancel` | `agent description`, `event name`, `moves`, `public action`, `steps`, `summary` |
46
+ | `abandon` | `agent description`, `event name`, `moves`, `public action`, `steps`, `summary` |
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # threshold_pool
4
4
 
5
- Source: [`std/settlements/threshold_pool.hsx`](../../../std/settlements/threshold_pool.hsx)
5
+ Source: [`std/money_flows/threshold_pool.hsx`](../../../std/money_flows/threshold_pool.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -1,8 +1,8 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # weighted_distribution
4
4
 
5
- Source: [`std/settlements/weighted_distribution.hsx`](../../../std/settlements/weighted_distribution.hsx)
5
+ Source: [`std/money_flows/weighted_distribution.hsx`](../../../std/money_flows/weighted_distribution.hsx)
6
6
 
7
7
  ## Export
8
8
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # Types
4
4
 
@@ -1,13 +1,12 @@
1
- <!-- Generated by scripts/docs/build.ts for HSX 1.0.0-rc.1. Do not edit. -->
1
+ <!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
2
2
 
3
3
  # UDL output
4
4
 
5
- An accepted compile returns four artifacts.
5
+ An accepted compile returns three artifacts.
6
6
 
7
7
  | Artifact | Contents |
8
8
  | -------------- | ----------------------------------------------------------------------------------- |
9
9
  | `document` | The canonical UDL object. Serialize it with `serializeUdl` from `@hyperscale0/udl`. |
10
- | `frame` | The Business Frame paired with the document. |
11
10
  | `originMap` | Canonical UDL paths mapped to authored HSX spans. |
12
11
  | `costManifest` | The deterministic manifest pinned to the supplied rate card. |
13
12
 
@@ -14,7 +14,7 @@ hsx build tip-jar.hsx # the compiled IR
14
14
  name is `snake_case` and becomes the IR document's `product`; the title is
15
15
  optional and is what people read.
16
16
 
17
- **`import { instant_transfer } from "std/settlements"`** brings in one settlement brick.
17
+ **`import { instant_transfer } from "std/money_flows"`** brings in one settlement brick.
18
18
  `"settlement"` is the only module there is, and it holds seventeen settlement
19
19
  bricks. A brick you have not imported cannot be instantiated, so the imports
20
20
  at the top tell you what shape of company this is before you read a line of it.
@@ -5,7 +5,7 @@
5
5
 
6
6
  program tip_jar "Tip jar"
7
7
 
8
- import { instant_transfer } from "std/settlements"
8
+ import { instant_transfer } from "std/money_flows"
9
9
 
10
10
  party listener: person
11
11
  party host: business
@@ -46,10 +46,7 @@ asset booth: good { title_transfer: off_platform }
46
46
 
47
47
  `title_transfer: off_platform` records that ownership of the booth changes
48
48
  hands outside the platform. Money stays on-platform; this flag describes the
49
- object. Today `frameFor` emits `offPlatform` as an empty list alongside the
50
- frame's five constant fields (`confidence: "high"`, `conservationGroups: []`,
51
- `offPlatform: []`, `openQuestions: []`, and `rules: []`), so callers never
52
- assume the list carries parsed asset flags.
49
+ object.
53
50
 
54
51
  ## Fees have a side, and the side matters
55
52
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  program photo_booth "Photo booth rentals"
10
10
 
11
- import { held_payment } from "std/settlements"
11
+ import { held_payment } from "std/money_flows"
12
12
 
13
13
  party renter: person
14
14
  party company: business
@@ -4,7 +4,7 @@
4
4
 
5
5
  program corner_shop "Corner shop"
6
6
 
7
- import { held_payment } from "std/settlements"
7
+ import { held_payment } from "std/money_flows"
8
8
 
9
9
  party shopper: person
10
10
  party grocer: business
@@ -6,7 +6,7 @@
6
6
 
7
7
  program corner_shop "Corner shop"
8
8
 
9
- import { held_payment } from "std/settlements"
9
+ import { held_payment } from "std/money_flows"
10
10
 
11
11
  party shopper: person
12
12
 
@@ -78,9 +78,6 @@ tutor_payout_payout_1
78
78
  tutor_payout_payout_2
79
79
  ```
80
80
 
81
- The Business Frame's `mechanics` come back as `escrow` and `marketplace`,
82
- derived from the settlement bricks rather than declared.
83
-
84
81
  One program carries at most **20** money events (`MONEY_EVENT_BUDGET`). This
85
82
  one uses nine. Every installment anchor, fee leg, cancellation leg, and
86
83
  abandonment refund counts one, so the budget is the real ceiling on how much
@@ -14,7 +14,7 @@
14
14
 
15
15
  program study_hall "Study hall"
16
16
 
17
- import { held_payment, security_deposit, pooled_split } from "std/settlements"
17
+ import { held_payment, security_deposit, pooled_split } from "std/money_flows"
18
18
 
19
19
  party student: person
20
20
  party tutor: business
@@ -4,6 +4,3 @@ This reference program joins the algebra needed for one club product. It keeps
4
4
  each watch attached to explicit sale, deposit, and trade rules. Membership due
5
5
  dates open periods, while callers still author every money action. Seller
6
6
  payouts close through stored provider evidence.
7
-
8
- The acceptance proof lives in
9
- `toolchain/system-tests/test/watch-club.acceptance.spec.ts`.
@@ -11,7 +11,7 @@ import {
11
11
  scheduled,
12
12
  settlement_batch,
13
13
  swap
14
- } from "std/settlements"
14
+ } from "std/money_flows"
15
15
 
16
16
  party member: person
17
17
  party seller: business
@@ -1,12 +1,43 @@
1
1
  # Examples
2
2
 
3
- Each standard-library module has its own directory with an HSX program, a
3
+ Each money flow has its own directory with an HSX program, a
4
4
  short lesson, and pinned canonical UDL bytes. The test suite reads the module
5
- list from `std/settlements`, compiles every program, and compares each emitted
5
+ list from `std/money_flows`, compiles every program, and compares each emitted
6
6
  document byte for byte.
7
7
 
8
- The numbered examples remain as longer lessons. They cover a first program,
9
- imports, diagnostic repair, a composed product, and a multi-instrument club.
8
+ The numbered examples provide end-to-end walkthroughs:
9
+
10
+ - [01 · Your first program](01-first-program/README.md)
11
+ - [02 · Imports and modules](02-imports-and-archetypes/README.md)
12
+ - [03 · Diagnostics](03-diagnostics/README.md)
13
+ - [04 · Complete product](04-complete-product/README.md)
14
+ - [05 · Watch club](05-watch-club/README.md)
15
+
16
+ ## Money flows
17
+
18
+ Each money flow has a runnable example directory:
19
+
20
+ - [advance](advance/README.md)
21
+ - [cancellable_booking](cancellable_booking/README.md)
22
+ - [captured_payment](captured_payment/README.md)
23
+ - [conditional_disbursement](conditional_disbursement/README.md)
24
+ - [credit_facility](credit_facility/README.md)
25
+ - [held_payment](held_payment/README.md)
26
+ - [instant_transfer](instant_transfer/README.md)
27
+ - [metered](metered/README.md)
28
+ - [pooled_split](pooled_split/README.md)
29
+ - [premium_forward](premium_forward/README.md)
30
+ - [reconciled_payout](reconciled_payout/README.md)
31
+ - [recurring_collection](recurring_collection/README.md)
32
+ - [rotating_pool](rotating_pool/README.md)
33
+ - [scheduled](scheduled/README.md)
34
+ - [security_deposit](security_deposit/README.md)
35
+ - [settlement_batch](settlement_batch/README.md)
36
+ - [swap](swap/README.md)
37
+ - [threshold_pool](threshold_pool/README.md)
38
+ - [weighted_distribution](weighted_distribution/README.md)
39
+
40
+ ## Running an example
10
41
 
11
42
  Run an example with the installed CLI:
12
43
 
@@ -1,5 +1,5 @@
1
1
  program advance_example "Advance example"
2
- import { advance } from "std/settlements"
2
+ import { advance } from "std/money_flows"
3
3
  party funder: business
4
4
  party recipient: business
5
5
  settlement advance_payment = advance {