@hyperscale0/hsx 2.0.0 → 2.0.2
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 +25 -0
- package/dist/src/cli.d.ts +1 -1
- package/dist/src/diagnostics.d.ts.map +1 -1
- package/dist/src/diagnostics.js +7 -0
- package/dist/src/diagnostics.js.map +1 -1
- package/dist/src/std-bundle.js +19 -19
- package/dist/src/std-bundle.js.map +1 -1
- package/dist/src/typecheck.js +89 -1
- 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/guide/01-first-program.md +1 -1
- package/docs/guide/09-cost.md +1 -1
- package/docs/llms-full.txt +64 -39
- package/docs/llms.txt +2 -2
- package/docs/reference/cli.md +2 -2
- package/docs/reference/diagnostics.md +21 -1
- package/docs/reference/grammar.md +1 -1
- package/docs/reference/std/advance.md +1 -1
- package/docs/reference/std/cancellable_booking.md +1 -1
- package/docs/reference/std/captured_payment.md +1 -1
- package/docs/reference/std/conditional_disbursement.md +1 -1
- package/docs/reference/std/credit_facility.md +1 -1
- package/docs/reference/std/held_payment.md +41 -36
- package/docs/reference/std/instant_transfer.md +1 -1
- package/docs/reference/std/metered.md +1 -1
- package/docs/reference/std/pooled_split.md +1 -1
- package/docs/reference/std/premium_forward.md +1 -1
- package/docs/reference/std/reconciled_payout.md +1 -1
- package/docs/reference/std/recurring_collection.md +1 -1
- package/docs/reference/std/rotating_pool.md +1 -1
- package/docs/reference/std/scheduled.md +1 -1
- package/docs/reference/std/security_deposit.md +1 -1
- package/docs/reference/std/settlement_batch.md +1 -1
- package/docs/reference/std/swap.md +1 -1
- package/docs/reference/std/threshold_pool.md +1 -1
- package/docs/reference/std/weighted_distribution.md +1 -1
- package/docs/reference/types.md +1 -1
- package/docs/reference/udl-output.md +1 -1
- package/examples/advance/advance.udl +6 -6
- package/examples/cancellable_booking/cancellable_booking.udl +10 -10
- package/examples/captured_payment/captured_payment.udl +6 -6
- package/examples/conditional_disbursement/conditional_disbursement.udl +2 -2
- package/examples/cost-table.json +18 -78
- package/examples/credit_facility/credit_facility.udl +10 -10
- package/examples/held_payment/held_payment.udl +23 -12
- package/examples/instant_transfer/instant_transfer.udl +6 -6
- package/examples/metered/metered.udl +4 -4
- package/examples/pooled_split/pooled_split.udl +10 -10
- package/examples/premium_forward/premium_forward.udl +12 -12
- package/examples/recurring_collection/recurring_collection.udl +8 -8
- package/examples/rotating_pool/rotating_pool.udl +78 -78
- package/examples/scheduled/scheduled.udl +6 -6
- package/examples/security_deposit/security_deposit.udl +2 -2
- package/examples/swap/swap.udl +22 -22
- package/examples/threshold_pool/threshold_pool.udl +10 -10
- package/examples/weighted_distribution/weighted_distribution.udl +2 -2
- package/package.json +3 -3
- package/skills/hsx/SKILL.md +2 -2
- package/src/diagnostics.ts +10 -0
- package/src/std-bundle.ts +19 -19
- package/src/typecheck.ts +105 -1
- package/src/version.ts +1 -1
- package/std/money_flows/advance.hsx +45 -0
- package/std/money_flows/cancellable_booking.hsx +45 -0
- package/std/money_flows/captured_payment.hsx +55 -0
- package/std/money_flows/conditional_disbursement.hsx +46 -0
- package/std/money_flows/credit_facility.hsx +57 -0
- package/std/money_flows/held_payment.hsx +152 -3
- package/std/money_flows/instant_transfer.hsx +42 -0
- package/std/money_flows/metered.hsx +41 -0
- package/std/money_flows/pooled_split.hsx +41 -0
- package/std/money_flows/premium_forward.hsx +51 -0
- package/std/money_flows/reconciled_payout.hsx +42 -0
- package/std/money_flows/recurring_collection.hsx +45 -0
- package/std/money_flows/rotating_pool.hsx +51 -0
- package/std/money_flows/scheduled.hsx +53 -0
- package/std/money_flows/security_deposit.hsx +58 -0
- package/std/money_flows/settlement_batch.hsx +51 -0
- package/std/money_flows/swap.hsx +53 -0
- package/std/money_flows/threshold_pool.hsx +51 -0
- package/std/money_flows/weighted_distribution.hsx +54 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperscale0/hsx",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "The strictly typed HSX language: compile total financial programs into canonical UDL.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hsx",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"typecheck": "tsc -p tsconfig.json"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@hyperscale0/udl": "2.0.
|
|
88
|
+
"@hyperscale0/udl": "2.0.2"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"bun-types": "1.4.2",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"Amir Ayub",
|
|
97
97
|
"Sara AlBakaawi"
|
|
98
98
|
],
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "70ddac0ae5599ca61c7951b027befbeb6eea9f96"
|
|
100
100
|
}
|
package/skills/hsx/SKILL.md
CHANGED
|
@@ -11,7 +11,7 @@ Use this skill when a task creates or changes an `.hsx` program, chooses a money
|
|
|
11
11
|
|
|
12
12
|
One file declares one `program`. Declare parties and assets before using them. Import money flows from `std/money_flows`. Apply each selected instrument as a `settlement`, and declare every decision port it names. A program may also declare general instruments and subjects.
|
|
13
13
|
|
|
14
|
-
Start with [the first-program guide](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/guide/01-first-program.md). Read the generated [grammar](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/reference/grammar.md), [types](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/reference/types.md), and [money flows reference](https://github.com/hyperscale0/hyperscale-hsx/tree/main/docs/reference/std) for the exact surface.
|
|
14
|
+
Start with [the first-program guide](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/guide/01-first-program.md). Read the [instruments](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/guide/03-instruments.md), [lifecycles](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/guide/04-lifecycles.md), [composition](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/guide/07-composition.md), and [writing a module](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/guide/08-writing-a-module.md) chapters for instrument architecture. Read the generated [grammar](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/reference/grammar.md), [types](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/reference/types.md), and [money flows reference](https://github.com/hyperscale0/hyperscale-hsx/tree/main/docs/reference/std) for the exact surface.
|
|
15
15
|
|
|
16
16
|
## Choose a money flow
|
|
17
17
|
|
|
@@ -39,7 +39,7 @@ The money flows are demonstrated below. The marker before each program lets the
|
|
|
39
39
|
|
|
40
40
|
## Diagnostic loop
|
|
41
41
|
|
|
42
|
-
Run `hsx check` after each coherent edit. Read the first error code, open the [diagnostics reference](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/reference/diagnostics.md), apply the catalog fix, and compile again. Match tools on the stable `HSX####` code, not the message. Never patch emitted UDL to bypass a refusal.
|
|
42
|
+
Run `hsx check` after each coherent edit. Read the first error code, open the [diagnostics guide](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/guide/10-diagnostics.md) and [diagnostics reference](https://github.com/hyperscale0/hyperscale-hsx/blob/main/docs/reference/diagnostics.md), apply the catalog fix, and compile again. Match tools on the stable `HSX####` code, not the message. Never patch emitted UDL to bypass a refusal.
|
|
43
43
|
|
|
44
44
|
## Money rules
|
|
45
45
|
|
package/src/diagnostics.ts
CHANGED
|
@@ -355,6 +355,16 @@ action pay { computes remainder rest { amount_ref: total; on_zero: refuse; total
|
|
|
355
355
|
fix: "Move all money in one currency; a program bills in one ledger currency.",
|
|
356
356
|
example: instrument("", "amount: money<SAR>; fee: money<USD>;"),
|
|
357
357
|
},
|
|
358
|
+
{
|
|
359
|
+
code: "HSX1306",
|
|
360
|
+
stage: "typecheck",
|
|
361
|
+
title: "Fixed-currency amount moved in another currency",
|
|
362
|
+
fix: "Bind the currency of a money<CUR> move or account step as the constant CUR; the compiler pins a binding that reads the instrument's currency field.",
|
|
363
|
+
example: instrument(
|
|
364
|
+
`action pay { agent_description: "Pay the amount."; moves: [{ "bind": { "amount": { "from": "instance"; "path": "fields.amount"; }; "currency": { "from": "const"; "value": "USD"; }; "destinationAccountId": { "from": "instance"; "path": "fields.payeeAccountId"; }; "sourceAccountId": { "from": "instance"; "path": "fields.payerAccountId"; }; }; "key": "transfer"; "operation": "internal_transfer.create"; }]; steps: []; }`,
|
|
365
|
+
"amount: money<SAR>; payeeAccountId: account<SAR>; payerAccountId: account<SAR>;",
|
|
366
|
+
),
|
|
367
|
+
},
|
|
358
368
|
{
|
|
359
369
|
code: "HSX1401",
|
|
360
370
|
stage: "typecheck",
|