@hyperscale0/hsx 2.1.0 → 2.2.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.
- package/CHANGELOG.md +36 -7
- package/dist/src/cli.d.ts +1 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +39 -5
- package/dist/src/cli.js.map +1 -1
- package/dist/src/compile.d.ts +0 -1
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +15 -1
- package/dist/src/compile.js.map +1 -1
- package/dist/src/cost.d.ts +3 -3
- package/dist/src/cost.d.ts.map +1 -1
- package/dist/src/cost.js +22 -12
- package/dist/src/cost.js.map +1 -1
- package/dist/src/parse.d.ts.map +1 -1
- package/dist/src/parse.js +10 -14
- package/dist/src/parse.js.map +1 -1
- package/dist/src/std-bundle.d.ts.map +1 -1
- package/dist/src/std-bundle.js +20 -84
- package/dist/src/std-bundle.js.map +1 -1
- package/dist/src/typecheck.d.ts.map +1 -1
- package/dist/src/typecheck.js +171 -39
- package/dist/src/typecheck.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/docs/README.md +8 -2
- package/docs/guide/01-first-program.md +1 -1
- package/docs/guide/06-schedules.md +5 -1
- package/docs/guide/08-writing-a-module.md +48 -0
- package/docs/llms-full.txt +1928 -421
- package/docs/llms.txt +2 -3
- package/docs/piece-plans.md +120 -0
- package/docs/reference/cli.md +6 -5
- package/docs/reference/diagnostics.md +9 -9
- package/docs/reference/grammar.md +2 -3
- package/docs/reference/std/advance.md +94 -17
- package/docs/reference/std/cancellable_booking.md +138 -17
- package/docs/reference/std/captured_payment.md +96 -24
- package/docs/reference/std/conditional_disbursement.md +82 -14
- package/docs/reference/std/credit_facility.md +89 -16
- package/docs/reference/std/held_payment.md +155 -55
- package/docs/reference/std/instant_transfer.md +79 -12
- package/docs/reference/std/metered.md +71 -9
- package/docs/reference/std/pooled_split.md +76 -7
- package/docs/reference/std/premium_forward.md +100 -20
- package/docs/reference/std/reconciled_payout.md +84 -14
- package/docs/reference/std/rotating_pool.md +112 -24
- package/docs/reference/std/scheduled.md +117 -32
- package/docs/reference/std/security_deposit.md +119 -27
- package/docs/reference/std/settlement_batch.md +105 -24
- package/docs/reference/std/swap.md +113 -26
- package/docs/reference/std/threshold_pool.md +120 -29
- package/docs/reference/std/weighted_distribution.md +117 -21
- package/docs/reference/types.md +15 -15
- package/docs/reference/udl-output.md +6 -6
- package/examples/01-first-program/README.md +1 -1
- package/examples/{02-imports-and-archetypes → 02-imports-and-modules}/README.md +1 -1
- package/examples/{02-imports-and-archetypes → 02-imports-and-modules}/photo-booth.hsx +1 -1
- package/examples/04-complete-product/README.md +1 -1
- package/examples/05-authored-instrument/README.md +5 -0
- package/examples/05-authored-instrument/payment.hsx +37 -0
- package/examples/05-watch-club/watch-club.hsx +0 -1
- package/examples/README.md +1 -2
- package/examples/advance/advance.udl +29 -6
- package/examples/cancellable_booking/cancellable_booking.udl +19 -0
- package/examples/captured_payment/captured_payment.hsx +0 -4
- package/examples/captured_payment/captured_payment.udl +6 -0
- package/examples/conditional_disbursement/conditional_disbursement.hsx +0 -2
- package/examples/conditional_disbursement/conditional_disbursement.udl +4 -0
- package/examples/cost-table.json +136 -8
- package/examples/credit_facility/credit_facility.hsx +0 -3
- package/examples/credit_facility/credit_facility.udl +17 -1
- package/examples/held_payment/held_payment.udl +16 -0
- package/examples/instant_transfer/instant_transfer.udl +6 -0
- package/examples/metered/metered.udl +5 -1
- package/examples/pooled_split/pooled_split.udl +4 -0
- package/examples/premium_forward/premium_forward.udl +4 -0
- package/examples/reconciled_payout/reconciled_payout.udl +7 -0
- package/examples/rotating_pool/rotating_pool.udl +8 -0
- package/examples/scheduled/scheduled.udl +18 -3
- package/examples/security_deposit/security_deposit.udl +13 -0
- package/examples/settlement_batch/settlement_batch.udl +4 -0
- package/examples/swap/swap.udl +10 -0
- package/examples/threshold_pool/threshold_pool.udl +11 -0
- package/examples/weighted_distribution/weighted_distribution.udl +9 -0
- package/package.json +10 -10
- package/skills/hsx/SKILL.md +2 -36
- package/src/cli.ts +41 -5
- package/src/compile.ts +14 -6
- package/src/cost.ts +13 -16
- package/src/parse.ts +15 -10
- package/src/std-bundle.ts +21 -88
- package/src/typecheck.ts +207 -34
- package/src/version.ts +1 -1
- package/std/SEMANTICS.md +33 -128
- package/std/money_flows/advance.hsx +39 -26
- package/std/money_flows/cancellable_booking.hsx +275 -8
- package/std/money_flows/captured_payment.hsx +1 -9
- package/std/money_flows/conditional_disbursement.hsx +0 -6
- package/std/money_flows/credit_facility.hsx +0 -9
- package/std/money_flows/held_payment.hsx +39 -1
- package/std/money_flows/index.hsx +2 -1
- package/std/money_flows/metered.hsx +1 -5
- package/std/money_flows/scheduled.hsx +29 -119
- package/std/money_flows/threshold_pool.hsx +40 -5
- package/std/money_flows/weighted_distribution.hsx +47 -5
- package/docs/reference/std/recurring_collection.md +0 -25
- package/examples/recurring_collection/README.md +0 -3
- package/examples/recurring_collection/recurring_collection.hsx +0 -21
- package/examples/recurring_collection/recurring_collection.udl +0 -1135
- package/std/money_flows/recurring_collection.hsx +0 -72
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
module std.money_flows.recurring_collection
|
|
2
|
-
|
|
3
|
-
// Bounded lifecycle state tracker for recurring collections without direct balance movement.
|
|
4
|
-
//
|
|
5
|
-
// ### Purpose
|
|
6
|
-
// `recurring_collection` tracks the ongoing execution state of a series of recurring collections.
|
|
7
|
-
// It carries no money amount and no account bindings; each `collect` call records that an installment
|
|
8
|
-
// occurred, and `end` closes the series permanently. It is typically paired with an external billing
|
|
9
|
-
// engine or a separate debt obligation instrument.
|
|
10
|
-
//
|
|
11
|
-
// ### Selection guidance
|
|
12
|
-
// - vs `scheduled`: `recurring_collection` moves no money and has no ledger accounts or amount partitioning.
|
|
13
|
-
// It is a pure lifecycle tracker. Choose `scheduled` when the platform itself must calculate installment amounts,
|
|
14
|
-
// enforce calendar intervals, or debit customer accounts.
|
|
15
|
-
// - vs `metered`: `metered` bills variable usage against a rate card with real balance movements.
|
|
16
|
-
// `recurring_collection` only records collection lifecycle steps.
|
|
17
|
-
//
|
|
18
|
-
// ### Parameters
|
|
19
|
-
// - `marker`: Optional descriptive text marker stored on the recurring collection record.
|
|
20
|
-
//
|
|
21
|
-
// ### Decision ports
|
|
22
|
-
// None. State transitions are controlled directly by API actions (`collect`, `end`).
|
|
23
|
-
//
|
|
24
|
-
// ### Example
|
|
25
|
-
// ```hsx
|
|
26
|
-
// program recurring_collection_example "Recurring collection example"
|
|
27
|
-
// import { recurring_collection, scheduled } from "std/money_flows"
|
|
28
|
-
// party debtor: person
|
|
29
|
-
// party repayment_source: business
|
|
30
|
-
// party recipient: business
|
|
31
|
-
// settlement obligation = scheduled {
|
|
32
|
-
// mode: obligation
|
|
33
|
-
// payer: repayment_source
|
|
34
|
-
// payee: recipient
|
|
35
|
-
// debtor: debtor
|
|
36
|
-
// amount: principal: money(SAR)
|
|
37
|
-
// count: 2
|
|
38
|
-
// every: P30D
|
|
39
|
-
// first_due: firstDueAt
|
|
40
|
-
// mandate: port mandate_evidence
|
|
41
|
-
// }
|
|
42
|
-
// settlement collection = recurring_collection {}
|
|
43
|
-
// port mandate_evidence {
|
|
44
|
-
// allowed: [repayment_source]
|
|
45
|
-
// shape: { evidenceReference: text }
|
|
46
|
-
// }
|
|
47
|
-
// ```
|
|
48
|
-
export instrument recurring_collection(marker: optional<text>) {
|
|
49
|
-
agent_description: concat("Reach for ", words(instrument), " to track a bounded run of scheduled collections, one call per recorded installment. It carries no amount and no account, and every action only advances its own state. A settlement that debits an account on a schedule is a different shape.");
|
|
50
|
-
fields {}
|
|
51
|
-
lifecycle {
|
|
52
|
-
states active ended;
|
|
53
|
-
initial active;
|
|
54
|
-
on collect: active -> active;
|
|
55
|
-
on end: active -> ended;
|
|
56
|
-
}
|
|
57
|
-
action create {
|
|
58
|
-
agent_description: "Open the collection so installments can be recorded against it. This is the first call and the collection starts active. It moves no money.";
|
|
59
|
-
summary: "Create a bounded recurring collection";
|
|
60
|
-
steps: [];
|
|
61
|
-
}
|
|
62
|
-
action collect {
|
|
63
|
-
agent_description: "Record one due installment as collected. The collection must still be active, and it stays active afterwards so the next installment can follow. It moves no money.";
|
|
64
|
-
summary: "Collect one due installment";
|
|
65
|
-
steps: [];
|
|
66
|
-
}
|
|
67
|
-
action end {
|
|
68
|
-
agent_description: "Close the collection so no further installment can be recorded. Only an active collection can end, and ended is final. It moves no money.";
|
|
69
|
-
summary: "End future collections";
|
|
70
|
-
steps: [];
|
|
71
|
-
}
|
|
72
|
-
}
|