@hyperscale0/hsx 1.0.0-alpha.6 → 1.0.0-rc.1
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 +48 -10
- package/LICENSING.md +3 -3
- package/README.md +37 -149
- package/TRADEMARKS.md +4 -4
- package/dist/src/ast.d.ts +129 -10
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/cli.d.ts +2 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +148 -12
- package/dist/src/cli.js.map +1 -1
- package/dist/src/compile.d.ts +41 -4
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +82 -15
- package/dist/src/compile.js.map +1 -1
- package/dist/src/cost.d.ts +78 -0
- package/dist/src/cost.d.ts.map +1 -0
- package/dist/src/cost.js +369 -0
- package/dist/src/cost.js.map +1 -0
- package/dist/src/diagnostics.d.ts +11 -0
- package/dist/src/diagnostics.d.ts.map +1 -0
- package/dist/src/diagnostics.js +420 -0
- package/dist/src/diagnostics.js.map +1 -0
- package/dist/src/emit.d.ts +35 -0
- package/dist/src/emit.d.ts.map +1 -0
- package/dist/src/emit.js +359 -0
- package/dist/src/emit.js.map +1 -0
- package/dist/src/entry-overrides.d.ts +17 -3
- package/dist/src/entry-overrides.d.ts.map +1 -1
- package/dist/src/entry-overrides.js +180 -35
- package/dist/src/entry-overrides.js.map +1 -1
- package/dist/src/format.d.ts +10 -0
- package/dist/src/format.d.ts.map +1 -0
- package/dist/src/format.js +183 -0
- package/dist/src/format.js.map +1 -0
- package/dist/src/index.d.ts +10 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/ir.d.ts +66 -0
- package/dist/src/ir.d.ts.map +1 -0
- package/dist/src/ir.js +15 -0
- package/dist/src/ir.js.map +1 -0
- package/dist/src/lex.d.ts +9 -1
- package/dist/src/lex.d.ts.map +1 -1
- package/dist/src/lex.js +50 -4
- package/dist/src/lex.js.map +1 -1
- package/dist/src/limits.d.ts +2 -3
- package/dist/src/limits.d.ts.map +1 -1
- package/dist/src/limits.js +2 -3
- package/dist/src/limits.js.map +1 -1
- package/dist/src/modules.d.ts +36 -0
- package/dist/src/modules.d.ts.map +1 -0
- package/dist/src/modules.js +372 -0
- package/dist/src/modules.js.map +1 -0
- package/dist/src/parse.d.ts.map +1 -1
- package/dist/src/parse.js +590 -17
- package/dist/src/parse.js.map +1 -1
- package/dist/src/typecheck.d.ts +8 -0
- package/dist/src/typecheck.d.ts.map +1 -0
- package/dist/src/typecheck.js +2958 -0
- package/dist/src/typecheck.js.map +1 -0
- package/dist/src/version.d.ts +4 -15
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +4 -15
- package/dist/src/version.js.map +1 -1
- package/docs/README.md +23 -0
- package/docs/guide/01-first-program.md +24 -0
- package/docs/guide/02-money.md +25 -0
- package/docs/guide/03-instruments.md +22 -0
- package/docs/guide/04-lifecycles.md +25 -0
- package/docs/guide/05-fees-and-splits.md +45 -0
- package/docs/guide/06-schedules.md +22 -0
- package/docs/guide/07-composition.md +46 -0
- package/docs/guide/08-writing-a-module.md +26 -0
- package/docs/guide/09-cost.md +24 -0
- package/docs/guide/10-diagnostics.md +27 -0
- package/docs/llms-full.txt +1738 -0
- package/docs/llms.txt +45 -0
- package/docs/reference/cli.md +33 -0
- package/docs/reference/diagnostics.md +619 -0
- package/docs/reference/grammar.md +39 -0
- package/docs/reference/std/advance.md +35 -0
- package/docs/reference/std/cancellable_booking.md +35 -0
- package/docs/reference/std/captured_payment.md +43 -0
- package/docs/reference/std/conditional_disbursement.md +33 -0
- package/docs/reference/std/credit_facility.md +35 -0
- package/docs/reference/std/held_payment.md +64 -0
- package/docs/reference/std/instant_transfer.md +30 -0
- package/docs/reference/std/metered.md +27 -0
- package/docs/reference/std/pooled_split.md +26 -0
- package/docs/reference/std/premium_forward.md +39 -0
- package/docs/reference/std/reconciled_payout.md +33 -0
- package/docs/reference/std/recurring_collection.md +25 -0
- package/docs/reference/std/rotating_pool.md +42 -0
- package/docs/reference/std/scheduled.md +51 -0
- package/docs/reference/std/security_deposit.md +46 -0
- package/docs/reference/std/settlement_batch.md +42 -0
- package/docs/reference/std/swap.md +46 -0
- package/docs/reference/std/threshold_pool.md +47 -0
- package/docs/reference/std/weighted_distribution.md +39 -0
- package/docs/reference/types.md +20 -0
- package/docs/reference/udl-output.md +14 -0
- package/docs/sessions/2026-09-02-two-instruments.hsx +21 -0
- package/docs/sessions/2026-09-02-two-instruments.md +41 -0
- package/examples/01-first-program/README.md +45 -0
- package/examples/01-first-program/tip-jar.hsx +17 -0
- package/examples/02-imports-and-archetypes/README.md +99 -0
- package/examples/02-imports-and-archetypes/photo-booth.hsx +37 -0
- package/examples/03-diagnostics/README.md +68 -0
- package/examples/03-diagnostics/corner-shop-fixed.hsx +22 -0
- package/examples/03-diagnostics/corner-shop.hsx +19 -0
- package/examples/04-complete-product/README.md +87 -0
- package/examples/04-complete-product/study-hall.hsx +67 -0
- package/examples/05-watch-club/README.md +9 -0
- package/examples/05-watch-club/watch-club.hsx +124 -0
- package/examples/README.md +18 -0
- package/examples/advance/README.md +3 -0
- package/examples/advance/advance.hsx +13 -0
- package/examples/advance/advance.udl +339 -0
- package/examples/cancellable_booking/README.md +3 -0
- package/examples/cancellable_booking/cancellable_booking.hsx +14 -0
- package/examples/cancellable_booking/cancellable_booking.udl +391 -0
- package/examples/captured_payment/README.md +3 -0
- package/examples/captured_payment/captured_payment.hsx +21 -0
- package/examples/captured_payment/captured_payment.udl +677 -0
- package/examples/conditional_disbursement/README.md +3 -0
- package/examples/conditional_disbursement/conditional_disbursement.hsx +17 -0
- package/examples/conditional_disbursement/conditional_disbursement.udl +412 -0
- package/examples/cost-table.json +386 -0
- package/examples/credit_facility/README.md +3 -0
- package/examples/credit_facility/credit_facility.hsx +27 -0
- package/examples/credit_facility/credit_facility.udl +1373 -0
- package/examples/held_payment/README.md +3 -0
- package/examples/held_payment/held_payment.hsx +13 -0
- package/examples/held_payment/held_payment.udl +507 -0
- package/examples/instant_transfer/README.md +3 -0
- package/examples/instant_transfer/instant_transfer.hsx +16 -0
- package/examples/instant_transfer/instant_transfer.udl +364 -0
- package/examples/metered/README.md +3 -0
- package/examples/metered/metered.hsx +13 -0
- package/examples/metered/metered.udl +247 -0
- package/examples/pooled_split/README.md +3 -0
- package/examples/pooled_split/pooled_split.hsx +15 -0
- package/examples/pooled_split/pooled_split.udl +425 -0
- package/examples/premium_forward/README.md +3 -0
- package/examples/premium_forward/premium_forward.hsx +19 -0
- package/examples/premium_forward/premium_forward.udl +594 -0
- package/examples/reconciled_payout/README.md +3 -0
- package/examples/reconciled_payout/reconciled_payout.hsx +13 -0
- package/examples/reconciled_payout/reconciled_payout.udl +303 -0
- package/examples/recurring_collection/README.md +3 -0
- package/examples/recurring_collection/recurring_collection.hsx +21 -0
- package/examples/recurring_collection/recurring_collection.udl +1130 -0
- package/examples/rotating_pool/README.md +3 -0
- package/examples/rotating_pool/rotating_pool.hsx +18 -0
- package/examples/rotating_pool/rotating_pool.udl +4352 -0
- package/examples/scheduled/README.md +3 -0
- package/examples/scheduled/scheduled.hsx +12 -0
- package/examples/scheduled/scheduled.udl +335 -0
- package/examples/security_deposit/README.md +3 -0
- package/examples/security_deposit/security_deposit.hsx +21 -0
- package/examples/security_deposit/security_deposit.udl +293 -0
- package/examples/settlement_batch/README.md +3 -0
- package/examples/settlement_batch/settlement_batch.hsx +19 -0
- package/examples/settlement_batch/settlement_batch.udl +753 -0
- package/examples/swap/README.md +3 -0
- package/examples/swap/swap.hsx +19 -0
- package/examples/swap/swap.udl +876 -0
- package/examples/threshold_pool/README.md +3 -0
- package/examples/threshold_pool/threshold_pool.hsx +16 -0
- package/examples/threshold_pool/threshold_pool.udl +667 -0
- package/examples/weighted_distribution/README.md +3 -0
- package/examples/weighted_distribution/weighted_distribution.hsx +20 -0
- package/examples/weighted_distribution/weighted_distribution.udl +337 -0
- package/package.json +19 -6
- package/skills/hsx/SKILL.md +483 -0
- package/src/ast.ts +163 -9
- package/src/cli.ts +164 -12
- package/src/compile.ts +160 -20
- package/src/cost.ts +579 -0
- package/src/diagnostics.ts +442 -0
- package/src/emit.ts +447 -0
- package/src/entry-overrides.ts +263 -48
- package/src/format.ts +261 -0
- package/src/index.ts +32 -4
- package/src/ir.ts +99 -0
- package/src/lex.ts +59 -4
- package/src/limits.ts +2 -3
- package/src/modules.ts +444 -0
- package/src/parse.ts +655 -21
- package/src/typecheck.ts +3876 -0
- package/src/version.ts +4 -16
- package/std/SEMANTICS.md +130 -0
- package/std/settlements/advance.hsx +177 -0
- package/std/settlements/cancellable_booking.hsx +87 -0
- package/std/settlements/captured_payment.hsx +144 -0
- package/std/settlements/conditional_disbursement.hsx +185 -0
- package/std/settlements/credit_facility.hsx +167 -0
- package/std/settlements/held_payment.hsx +578 -0
- package/std/settlements/index.hsx +3 -0
- package/std/settlements/instant_transfer.hsx +190 -0
- package/std/settlements/metered.hsx +67 -0
- package/std/settlements/pooled_split.hsx +68 -0
- package/std/settlements/premium_forward.hsx +257 -0
- package/std/settlements/reconciled_payout.hsx +77 -0
- package/std/settlements/recurring_collection.hsx +27 -0
- package/std/settlements/rotating_pool.hsx +252 -0
- package/std/settlements/scheduled.hsx +641 -0
- package/std/settlements/security_deposit.hsx +166 -0
- package/std/settlements/settlement_batch.hsx +122 -0
- package/std/settlements/swap.hsx +1114 -0
- package/std/settlements/threshold_pool.hsx +221 -0
- package/std/settlements/weighted_distribution.hsx +141 -0
- package/dist/src/archetypes.d.ts +0 -17
- package/dist/src/archetypes.d.ts.map +0 -1
- package/dist/src/archetypes.js +0 -327
- package/dist/src/archetypes.js.map +0 -1
- package/dist/src/check.d.ts +0 -12
- package/dist/src/check.d.ts.map +0 -1
- package/dist/src/check.js +0 -1910
- package/dist/src/check.js.map +0 -1
- package/dist/src/lower.d.ts +0 -146
- package/dist/src/lower.d.ts.map +0 -1
- package/dist/src/lower.js +0 -4570
- package/dist/src/lower.js.map +0 -1
- package/dist/src/model.d.ts +0 -467
- package/dist/src/model.d.ts.map +0 -1
- package/dist/src/model.js +0 -15
- package/dist/src/model.js.map +0 -1
- package/spec/hsx-ir.schema.json +0 -920
- package/src/archetypes.ts +0 -340
- package/src/check.ts +0 -2938
- package/src/lower.ts +0 -5416
- package/src/model.ts +0 -519
package/CHANGELOG.md
CHANGED
|
@@ -11,12 +11,48 @@ listed here.
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [1.0.0-rc.1] - 2026-09-02
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Added the repository guide, generated compiler reference, `llms.txt`, and
|
|
19
|
+
`llms-full.txt`. Tests compile every guide program and compare generated
|
|
20
|
+
files byte for byte.
|
|
21
|
+
- Added one compiled example and pinned canonical UDL file for every standard
|
|
22
|
+
library module.
|
|
23
|
+
- Added the public HSX agent skill and moved language examples into it.
|
|
24
|
+
- Added `hsx explain` for the stable diagnostics catalog.
|
|
25
|
+
- Added a generated VS Code grammar, standard-library snippets, and a CI-built
|
|
26
|
+
`hsx.vsix` artifact.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- `hsx cost` now prints a versioned effect table by default. `--json` prints the
|
|
31
|
+
complete manifest, and `--out <file.json>` writes that JSON. Basis-point rows
|
|
32
|
+
label their total as amount-dependent because the compiler has no priced
|
|
33
|
+
runtime amount. No cost flags were removed.
|
|
34
|
+
- The npm package now includes `docs/` and `skills/`. It no longer lists the
|
|
35
|
+
deleted `spec/` directory.
|
|
36
|
+
- The package exports its shipped standard-library files through `./std/*`.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- Diagnostics raised from an imported module now name that module and its own
|
|
41
|
+
source coordinates.
|
|
42
|
+
- `premium_forward` now reports `HSX1011` when endorsement selects a path that
|
|
43
|
+
needs `renewal_due`. It no longer reaches an internal lowering refusal.
|
|
44
|
+
|
|
45
|
+
## [1.0.0-beta.1] - 2026-08-29
|
|
46
|
+
|
|
47
|
+
- This is the first beta and has no package behavior changes from
|
|
48
|
+
1.0.0-alpha.6.
|
|
49
|
+
|
|
14
50
|
## [1.0.0-alpha.6] - 2026-08-29
|
|
15
51
|
|
|
16
52
|
### Fixed
|
|
17
53
|
|
|
18
54
|
- Alpha.6 carries a `held_payment` or `premium_forward` release port's actor
|
|
19
|
-
allowlist and declared input fields into the generated release
|
|
55
|
+
allowlist and declared input fields into the generated release action. Alpha.5
|
|
20
56
|
kept those constraints in the checked program and Business Frame but dropped
|
|
21
57
|
them from HSX-JSON IR, so a runtime consuming the IR could admit the release
|
|
22
58
|
without the declared actor or evidence. Recompile affected programs with
|
|
@@ -26,7 +62,7 @@ listed here.
|
|
|
26
62
|
|
|
27
63
|
### Added
|
|
28
64
|
|
|
29
|
-
- Six settlement archetypes now compile and lower. `
|
|
65
|
+
- Six settlement archetypes now compile and lower. `threshold_pool` caps locked
|
|
30
66
|
commitments and contributor count, then collects or refunds each commitment
|
|
31
67
|
whole. `weighted_distribution` freezes evidence-backed weights and pays by
|
|
32
68
|
deterministic largest remainder. `credit_facility` owns draw capacity while
|
|
@@ -70,7 +106,7 @@ listed here.
|
|
|
70
106
|
### Changed
|
|
71
107
|
|
|
72
108
|
- `scheduled` accepts `mode: obligation` for installment obligations. It emits
|
|
73
|
-
one payment
|
|
109
|
+
one payment instrument per anchor, binds each payment to its obligation and anchor,
|
|
74
110
|
allows partial and early payments, and refunds one stored paid row whole.
|
|
75
111
|
Obligation mode accepts 2 through 7 anchors and refuses rescheduling. Use the
|
|
76
112
|
original transfer schedule without `mode`, or declare the debtor and every
|
|
@@ -78,13 +114,13 @@ listed here.
|
|
|
78
114
|
- The program money-event budget is 20 instead of 14, and every settlement has
|
|
79
115
|
its own event cap. Advance carves now validate their amount field, currency,
|
|
80
116
|
recourse, and fee rules. Settlement references resolve through
|
|
81
|
-
archetype-declared exits, and lowering binds referenced
|
|
117
|
+
archetype-declared exits, and lowering binds referenced instrument identity,
|
|
82
118
|
statuses, amounts, and currency before movement. Recompile programs that
|
|
83
119
|
previously sat near the budget or used an advance carve. The stricter checker
|
|
84
120
|
may refuse a carve or reference that alpha.4 accepted.
|
|
85
|
-
- HSX-JSON IR version 1 grew new
|
|
121
|
+
- HSX-JSON IR version 1 grew new instrument fields for generated-child prefixes,
|
|
86
122
|
aggregate invariants, derived amounts, typed references, beneficiary IDs,
|
|
87
|
-
currency, text, counts, and constants.
|
|
123
|
+
currency, text, counts, and constants. Actions gained public actions, reference
|
|
88
124
|
bindings, captured input, payout instructions, signed sums, deterministic
|
|
89
125
|
distribution, aggregate and exposure checks, and durable-settlement gates.
|
|
90
126
|
Money events gained fixed, remaining-balance, and runtime-bounded amount
|
|
@@ -138,7 +174,7 @@ listed here.
|
|
|
138
174
|
The depth budget counts nested expressions and blocks, which is not the same
|
|
139
175
|
number as source levels: `key { … }` spends one per level and `key: { … }`
|
|
140
176
|
spends two, so the budget buys 63 levels of the first and 31 of the second.
|
|
141
|
-
|
|
177
|
+
The release reference carried the conversion for every shape. Both refusals are
|
|
142
178
|
ordinary parse diagnostics, not exceptions.
|
|
143
179
|
|
|
144
180
|
## [1.0.0-alpha.2] - 2026-08-23
|
|
@@ -159,7 +195,7 @@ listed here.
|
|
|
159
195
|
|
|
160
196
|
## [1.0.0-alpha.1] - 2026-08-22
|
|
161
197
|
|
|
162
|
-
First public release.
|
|
198
|
+
First public release.
|
|
163
199
|
This is the first version published as a package anyone can install.
|
|
164
200
|
|
|
165
201
|
### Added
|
|
@@ -178,7 +214,7 @@ This is the first version published as a package anyone can install.
|
|
|
178
214
|
- `spec/hsx-ir.schema.json`, JSON Schema 2020-12 for the HSX-JSON IR document
|
|
179
215
|
and the Business Frame. Every `.hsx` file in the repository is validated
|
|
180
216
|
against it in CI.
|
|
181
|
-
-
|
|
217
|
+
- The release reference: the lexical grammar, the EBNF the parser accepts, what
|
|
182
218
|
each stage does, the diagnostic model, and all nine `settlement` archetypes
|
|
183
219
|
with their parameters and constraints.
|
|
184
220
|
- `examples/`, four teaching programs compiled by the test suite.
|
|
@@ -195,7 +231,9 @@ This is the first version published as a package anyone can install.
|
|
|
195
231
|
program that needs more is refused with a diagnostic saying so.
|
|
196
232
|
- **`party` takes no attribute block yet**, though the grammar parses one.
|
|
197
233
|
|
|
198
|
-
[Unreleased]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-
|
|
234
|
+
[Unreleased]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-rc.1...HEAD
|
|
235
|
+
[1.0.0-rc.1]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-beta.1...v1.0.0-rc.1
|
|
236
|
+
[1.0.0-beta.1]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-alpha.6...v1.0.0-beta.1
|
|
199
237
|
[1.0.0-alpha.6]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-alpha.5...v1.0.0-alpha.6
|
|
200
238
|
[1.0.0-alpha.5]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-alpha.4...v1.0.0-alpha.5
|
|
201
239
|
[1.0.0-alpha.4]: https://github.com/hyperscale0/hyperscale-hsx/compare/v1.0.0-alpha.3...v1.0.0-alpha.4
|
package/LICENSING.md
CHANGED
|
@@ -39,9 +39,9 @@ says nothing about trademarks in either direction, so
|
|
|
39
39
|
|
|
40
40
|
## The language is not the compiler
|
|
41
41
|
|
|
42
|
-
HSX the language and
|
|
43
|
-
schema
|
|
44
|
-
are data describing a language, and anyone may write their own compiler,
|
|
42
|
+
HSX the language and its output contract are separate from this compiler. The
|
|
43
|
+
canonical UDL schema published by the UDL repository and the fixtures under
|
|
44
|
+
[`examples/`](./examples) are data describing a language, and anyone may write their own compiler,
|
|
45
45
|
formatter, or runtime against them, in any language, under any license, without
|
|
46
46
|
touching this code.
|
|
47
47
|
|
package/README.md
CHANGED
|
@@ -1,170 +1,58 @@
|
|
|
1
1
|
# HSX
|
|
2
2
|
|
|
3
|
-
HSX is
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Seventeen lines of HSX ([`car-escrow.hsx`](./test/fixtures/car-escrow.hsx)) are
|
|
9
|
-
a used-car escrow: the buyer's money is held, the buyer's own backend confirms
|
|
10
|
-
the handover, the platform takes asymmetric fees, and a cancellation splits the
|
|
11
|
-
held amount to the basis point. There is no account provisioning in it, no
|
|
12
|
-
lifecycle table, no transfer plumbing. That is the point: those are consequences
|
|
13
|
-
of the settlement you named, so the compiler derives them instead of asking you
|
|
14
|
-
to hand-write them and get them right.
|
|
15
|
-
|
|
16
|
-
The line here is the one HCL draws with Terraform. **The language is open.**
|
|
17
|
-
The lexer, the parser, the typechecker, the lowering, the diagnostics, the IR
|
|
18
|
-
schema, and this compiler are AGPL-3.0-only and live in this repository. **The
|
|
19
|
-
runtime that executes the IR is the product**, and it is not open. HSX targets
|
|
20
|
-
it the way HCL targets a provider: you can read every rule the compiler
|
|
21
|
-
enforces, compile any program, and inspect the exact document that gets
|
|
22
|
-
executed.
|
|
23
|
-
|
|
24
|
-
## Install
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
npm install @hyperscale0/hsx
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Every release before 1.0.0 is an alpha, and `latest` follows the newest one, so
|
|
31
|
-
a bare install gets it. Pin an exact version if you need one: until 1.0.0 a
|
|
32
|
-
change to the surface ships as a minor bump, not a major.
|
|
33
|
-
|
|
34
|
-
## A program
|
|
35
|
-
|
|
36
|
-
[`photo-booth.hsx`](./examples/02-imports-and-archetypes/photo-booth.hsx), a
|
|
37
|
-
booth rental company, whole apart from its comments:
|
|
3
|
+
HSX is the typed language for money on the Hyperscale operating system. It
|
|
4
|
+
defines general instruments, composes a standard library, checks
|
|
5
|
+
currency-indexed linear money, and calculates cost at compile time.
|
|
6
|
+
HSX compiles each accepted program to canonical UDL.
|
|
38
7
|
|
|
39
8
|
```hsx
|
|
40
|
-
program
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
settlement booking = held_payment {
|
|
50
|
-
payer: renter
|
|
51
|
-
payee: company
|
|
52
|
-
amount: bookingFee: money(SAR)
|
|
53
|
-
fees { renter: 1%, company: 3% }
|
|
54
|
-
release: port confirm_delivery
|
|
55
|
-
on_cancel(funded) { renter: 90%, company: 10% }
|
|
9
|
+
program held_sale "Held sale"
|
|
10
|
+
import { held_payment } from "std/settlements"
|
|
11
|
+
party buyer: person
|
|
12
|
+
party seller: business
|
|
13
|
+
settlement sale = held_payment {
|
|
14
|
+
payer: buyer
|
|
15
|
+
payee: seller
|
|
16
|
+
amount: price: money(SAR)
|
|
17
|
+
release: port accept_delivery
|
|
56
18
|
}
|
|
57
19
|
|
|
58
|
-
port
|
|
59
|
-
allowed: [company]
|
|
60
|
-
shape {
|
|
61
|
-
boothId: id(booth)
|
|
62
|
-
deliveredOn: date
|
|
63
|
-
}
|
|
64
|
-
}
|
|
20
|
+
port accept_delivery { allowed: [buyer] }
|
|
65
21
|
```
|
|
66
22
|
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const result = compile(await Bun.file("photo-booth.hsx").text());
|
|
71
|
-
|
|
72
|
-
result.verdict; // "valid" | "warning" | "invalid"
|
|
73
|
-
result.diagnostics; // [{ line, column, severity, stage, message }]
|
|
74
|
-
result.artifacts; // present unless the verdict is "invalid"
|
|
23
|
+
```sh
|
|
24
|
+
npm install @hyperscale0/hsx @hyperscale0/udl
|
|
25
|
+
npx hsx check product.hsx
|
|
75
26
|
```
|
|
76
27
|
|
|
77
|
-
|
|
78
|
-
escrow noun, `booking`, carrying:
|
|
79
|
-
|
|
80
|
-
- **five money fields**: `bookingFee`, the three pieces it partitions into
|
|
81
|
-
(90%, 7%, 3%: the finest split that every exit agrees on, since release pays
|
|
82
|
-
97/3 to company and platform while cancellation pays 90/10 to renter and
|
|
83
|
-
company), and `serviceFeeAmount` for the renter's 1% charged on top;
|
|
84
|
-
- **a `partitions` clause** proving those pieces sum to `bookingFee` exactly,
|
|
85
|
-
checked at create admission before any money moves;
|
|
86
|
-
- **fifteen verbs**: the funding chain, the fee collection, the port itself,
|
|
87
|
-
the release payout, the cancellation unwind, and the abandonment refunds,
|
|
88
|
-
each with its `from` states, its `to` state, and its ledger moves.
|
|
89
|
-
|
|
90
|
-
`result.artifacts.frame` is the congruent Business Frame: the same product as
|
|
91
|
-
actors, money events, rules, and fees, for the surfaces people read rather
|
|
92
|
-
than the runtime that executes.
|
|
28
|
+
After installing dependencies in a repository checkout, run `bun run bin/hsx.ts check product.hsx`.
|
|
93
29
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
## The command
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
hsx check photo-booth.hsx # diagnostics, nothing else
|
|
103
|
-
hsx check photo-booth.hsx --strict # warnings fail too
|
|
104
|
-
hsx build photo-booth.hsx # artifacts to stdout
|
|
105
|
-
hsx build photo-booth.hsx --out ir.json
|
|
30
|
+
```ts
|
|
31
|
+
import { compile } from "@hyperscale0/hsx";
|
|
32
|
+
const result = compile(source, { costTable });
|
|
33
|
+
const { document, frame, originMap, costManifest } = result.artifacts!;
|
|
106
34
|
```
|
|
107
35
|
|
|
108
|
-
|
|
109
|
-
or the input file could not be used. A refused program and a mistyped command
|
|
110
|
-
are different failures, so they get different codes.
|
|
111
|
-
|
|
112
|
-
There is no `hsx fmt`. This package ships no formatter, and shipping a bad one
|
|
113
|
-
is worse than shipping none.
|
|
114
|
-
|
|
115
|
-
## Learn it
|
|
116
|
-
|
|
117
|
-
- [`examples/`](./examples/) has four programs, in order: the smallest one that
|
|
118
|
-
moves money, archetypes and ports, a walk through the diagnostics, and a
|
|
119
|
-
complete small product. Each has its own README, and each is compiled by the
|
|
120
|
-
test suite so they cannot rot.
|
|
121
|
-
- [`docs/reference.md`](./docs/reference.md) is the language reference: lexical
|
|
122
|
-
grammar, EBNF, what each stage does, the diagnostic model, and every
|
|
123
|
-
archetype in the `settlement` standard library with its parameters and
|
|
124
|
-
constraints.
|
|
125
|
-
- [`editors/vscode/`](./editors/vscode/) carries the syntax highlighting.
|
|
126
|
-
|
|
127
|
-
## Versioning
|
|
128
|
-
|
|
129
|
-
Two numbers move independently.
|
|
130
|
-
|
|
131
|
-
**IR version** is the literal `"hsx": 1` stamped into every compiled document.
|
|
132
|
-
A consumer reads that one integer off the document to decide whether it
|
|
133
|
-
understands it. It moves only when the emitted IR shape changes in a way a
|
|
134
|
-
consumer must notice.
|
|
36
|
+
The compiler returns four artifacts named `document`, `frame`, `originMap`, and `costManifest`.
|
|
135
37
|
|
|
136
|
-
|
|
137
|
-
whenever the compiler changes, including changes that only affect a
|
|
138
|
-
diagnostic's wording.
|
|
38
|
+
`document` is the canonical UDL value.
|
|
139
39
|
|
|
140
|
-
|
|
141
|
-
release may change what the compiler emits, and every such change is listed in
|
|
142
|
-
[`CHANGELOG.md`](./CHANGELOG.md). After 1.0.0, an incompatible IR change bumps
|
|
143
|
-
the literal to `2`.
|
|
40
|
+
The built-in module resolver reads every settlement module in `std/settlements`.
|
|
144
41
|
|
|
145
|
-
|
|
42
|
+
The CLI exits 0 for an accepted program, 1 for a refused program, and 2 when it cannot use the command line or input file.
|
|
146
43
|
|
|
147
|
-
|
|
148
|
-
production use; the surface is settled enough to build on and the version
|
|
149
|
-
number is honest about the rest. What is most likely to move: diagnostic
|
|
150
|
-
wording (there are no stable diagnostic codes yet), and the archetype
|
|
151
|
-
parameter surfaces as more products land.
|
|
44
|
+
Every compiler diagnostic code appears in the generated diagnostics catalog.
|
|
152
45
|
|
|
153
|
-
|
|
46
|
+
Start with the [first program](./docs/guide/01-first-program.md), then read the
|
|
47
|
+
[guide in order](./docs/README.md). The generated [grammar](./docs/reference/grammar.md),
|
|
48
|
+
[standard library pages](./docs/reference/std/), and
|
|
49
|
+
[diagnostics catalog](./docs/reference/diagnostics.md) track the compiler.
|
|
154
50
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
fixture the change would add. [`CONTRIBUTING.md`](./CONTRIBUTING.md) has that
|
|
158
|
-
model in full, plus the setup, the test commands, and the one hard rule: a
|
|
159
|
-
grammar change without a fixture is not a grammar change. Conduct:
|
|
160
|
-
[`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md). Vulnerabilities:
|
|
161
|
-
[`SECURITY.md`](./SECURITY.md).
|
|
51
|
+
HSX is like Terraform for a financial product: the program declares the
|
|
52
|
+
contract, and the compiler refuses an invalid plan before a runtime reads it.
|
|
162
53
|
|
|
163
|
-
|
|
54
|
+
The VS Code extension is built as `hsx.vsix` in CI. Download the workflow
|
|
55
|
+
artifact, then run `code --install-extension hsx.vsix`.
|
|
164
56
|
|
|
165
|
-
AGPL-3.0-only
|
|
166
|
-
|
|
167
|
-
text and [`LICENSING.md`](./LICENSING.md) for which one you want and how to ask
|
|
168
|
-
for the commercial one. The marks are not covered by either; see
|
|
169
|
-
[`TRADEMARKS.md`](./TRADEMARKS.md), which also carries the rule for claiming
|
|
170
|
-
HSX compatibility.
|
|
57
|
+
HSX is licensed under AGPL-3.0-only. See [LICENSE](./LICENSE) and
|
|
58
|
+
[LICENSING.md](./LICENSING.md).
|
package/TRADEMARKS.md
CHANGED
|
@@ -9,7 +9,7 @@ has to guess where it sits.
|
|
|
9
9
|
|
|
10
10
|
What that means in practice:
|
|
11
11
|
|
|
12
|
-
- **Yes.** Say your project uses HSX, compiles HSX, or reads
|
|
12
|
+
- **Yes.** Say your project uses HSX, compiles HSX, or reads its internal lowering record.
|
|
13
13
|
Say it in your README, your docs, your talk, and your package description.
|
|
14
14
|
Fork this repository and keep the notices intact.
|
|
15
15
|
- **Yes.** Publish an HSX implementation or tool in another language, and name
|
|
@@ -23,9 +23,9 @@ What that means in practice:
|
|
|
23
23
|
## Claiming compatibility
|
|
24
24
|
|
|
25
25
|
An independent implementation may say it "implements HSX IR version X" only
|
|
26
|
-
while it emits
|
|
27
|
-
from the published example programs, unmodified. The
|
|
28
|
-
|
|
26
|
+
while it emits canonical UDL that validates against the UDL schema published
|
|
27
|
+
for that version, from the published example programs, unmodified. The UDL
|
|
28
|
+
schema and the programs in [`examples/`](./examples) are the whole
|
|
29
29
|
test: no edited fixture, no local relaxation of the schema.
|
|
30
30
|
|
|
31
31
|
That claim is a statement about your implementation, so keep the marks out of
|
package/dist/src/ast.d.ts
CHANGED
|
@@ -42,6 +42,8 @@ export declare function lineColIn(index: LineIndex, offset: number): LineCol;
|
|
|
42
42
|
export interface IdentExpr {
|
|
43
43
|
readonly kind: "ident";
|
|
44
44
|
readonly name: string;
|
|
45
|
+
/** A literal quoted block key keeps its exact spelling during JSON lowering. */
|
|
46
|
+
readonly quoted?: boolean;
|
|
45
47
|
readonly span: Span;
|
|
46
48
|
}
|
|
47
49
|
export interface StringExpr {
|
|
@@ -49,12 +51,45 @@ export interface StringExpr {
|
|
|
49
51
|
readonly span: Span;
|
|
50
52
|
readonly value: string;
|
|
51
53
|
}
|
|
52
|
-
interface NumberExpr {
|
|
54
|
+
export interface NumberExpr {
|
|
53
55
|
readonly kind: "number";
|
|
54
56
|
/** The literal exactly as written, e.g. "99.5". Interpretation is typed later. */
|
|
55
57
|
readonly raw: string;
|
|
56
58
|
readonly span: Span;
|
|
57
59
|
}
|
|
60
|
+
export interface BooleanExpr {
|
|
61
|
+
readonly kind: "boolean";
|
|
62
|
+
readonly span: Span;
|
|
63
|
+
readonly value: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** A currency-indexed literal. The checker converts it to integer minor units. */
|
|
66
|
+
export interface MoneyExpr {
|
|
67
|
+
readonly currency: IdentExpr;
|
|
68
|
+
readonly kind: "money";
|
|
69
|
+
readonly raw: string;
|
|
70
|
+
readonly span: Span;
|
|
71
|
+
}
|
|
72
|
+
/** A dotted name used for modules, UDL operations, and field paths. */
|
|
73
|
+
export interface PathExpr {
|
|
74
|
+
readonly kind: "path";
|
|
75
|
+
readonly parts: readonly IdentExpr[];
|
|
76
|
+
readonly span: Span;
|
|
77
|
+
}
|
|
78
|
+
/** A nominal type application such as `money<SAR>` or `ref<invoice>`. */
|
|
79
|
+
export interface TypeApplyExpr {
|
|
80
|
+
readonly args: readonly Expr[];
|
|
81
|
+
readonly callee: IdentExpr;
|
|
82
|
+
readonly kind: "type_apply";
|
|
83
|
+
readonly span: Span;
|
|
84
|
+
}
|
|
85
|
+
/** A general instrument or constant application, with optional type arguments. */
|
|
86
|
+
export interface ApplyExpr {
|
|
87
|
+
readonly args: readonly Expr[];
|
|
88
|
+
readonly callee: PathExpr;
|
|
89
|
+
readonly kind: "apply";
|
|
90
|
+
readonly span: Span;
|
|
91
|
+
readonly typeArgs: readonly Expr[];
|
|
92
|
+
}
|
|
58
93
|
export interface PercentExpr {
|
|
59
94
|
/** Exact basis points: 99.5% is 9950. Percents never round. */
|
|
60
95
|
readonly bps: number;
|
|
@@ -69,6 +104,15 @@ export interface CallExpr {
|
|
|
69
104
|
readonly kind: "call";
|
|
70
105
|
readonly span: Span;
|
|
71
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* An exit amount chosen by a decision port and bounded by stored money:
|
|
109
|
+
* `decided { field: damageAmount, bound: depositAmount, remainder: return }`.
|
|
110
|
+
*/
|
|
111
|
+
export interface DecidedAmountExpr {
|
|
112
|
+
readonly body: BlockExpr;
|
|
113
|
+
readonly kind: "decided_amount";
|
|
114
|
+
readonly span: Span;
|
|
115
|
+
}
|
|
72
116
|
/**
|
|
73
117
|
* A reference to a decision port, optionally bounded (`port dispute within
|
|
74
118
|
* P14D`) or carrying the date that decides when the port has not
|
|
@@ -110,19 +154,24 @@ export interface BlockExpr {
|
|
|
110
154
|
* `amount: price: money(SAR)` binds the field name `price` to type
|
|
111
155
|
* `money(SAR)`: the entry key is `amount`, the value is this binding.
|
|
112
156
|
*/
|
|
113
|
-
interface BindingExpr {
|
|
157
|
+
export interface BindingExpr {
|
|
114
158
|
readonly kind: "binding";
|
|
115
159
|
readonly name: IdentExpr;
|
|
116
160
|
readonly span: Span;
|
|
117
161
|
readonly type: Expr;
|
|
118
162
|
}
|
|
119
|
-
export type Expr = BindingExpr | BlockExpr | CallExpr | IdentExpr | ListExpr | NumberExpr | PercentExpr | PortRefExpr | SettlementRefExpr | StringExpr;
|
|
163
|
+
export type Expr = ApplyExpr | BindingExpr | BlockExpr | BooleanExpr | CallExpr | DecidedAmountExpr | IdentExpr | ListExpr | MoneyExpr | NumberExpr | PathExpr | PercentExpr | PortRefExpr | SettlementRefExpr | StringExpr | TypeApplyExpr;
|
|
120
164
|
/**
|
|
121
165
|
* One keyed entry inside a declaration body. Three surface shapes normalize
|
|
122
166
|
* here: `payer: buyer` (key + value), `fees { ... }` (key + block value),
|
|
123
167
|
* and `on_cancel(funded) { ... }` (key + qualifiers + block value).
|
|
124
168
|
*/
|
|
125
169
|
export interface Entry {
|
|
170
|
+
/** `for item in bound { ... }`, expanded before binding or UDL lowering. */
|
|
171
|
+
readonly iteration?: {
|
|
172
|
+
readonly binding: IdentExpr;
|
|
173
|
+
readonly bound: Expr;
|
|
174
|
+
};
|
|
126
175
|
readonly key: IdentExpr;
|
|
127
176
|
readonly qualifiers: readonly IdentExpr[];
|
|
128
177
|
readonly span: Span;
|
|
@@ -135,7 +184,21 @@ export interface ProgramDecl {
|
|
|
135
184
|
readonly span: Span;
|
|
136
185
|
readonly title?: StringExpr;
|
|
137
186
|
}
|
|
138
|
-
/** `
|
|
187
|
+
/** `use held_settlement` selects one published catalog instrument. */
|
|
188
|
+
export interface UseDecl {
|
|
189
|
+
readonly instrument: IdentExpr;
|
|
190
|
+
readonly kind: "use";
|
|
191
|
+
readonly span: Span;
|
|
192
|
+
}
|
|
193
|
+
/** `expose held_settlement.release as releaseFunds` names a public action. */
|
|
194
|
+
export interface ExposeDecl {
|
|
195
|
+
readonly action: IdentExpr;
|
|
196
|
+
readonly instrument: IdentExpr;
|
|
197
|
+
readonly kind: "expose";
|
|
198
|
+
readonly publicName: IdentExpr;
|
|
199
|
+
readonly span: Span;
|
|
200
|
+
}
|
|
201
|
+
/** `import { held_payment } from "std/settlements"`. */
|
|
139
202
|
export interface ImportDecl {
|
|
140
203
|
readonly from: StringExpr;
|
|
141
204
|
readonly kind: "import";
|
|
@@ -158,11 +221,10 @@ export interface AssetDecl {
|
|
|
158
221
|
readonly name: IdentExpr;
|
|
159
222
|
readonly span: Span;
|
|
160
223
|
}
|
|
161
|
-
/**
|
|
162
|
-
export interface
|
|
163
|
-
readonly archetype: IdentExpr;
|
|
224
|
+
/** A full UDL subject-kind declaration. `asset` remains shorthand for this form. */
|
|
225
|
+
export interface SubjectDecl {
|
|
164
226
|
readonly body: BlockExpr;
|
|
165
|
-
readonly kind: "
|
|
227
|
+
readonly kind: "subject";
|
|
166
228
|
readonly name: IdentExpr;
|
|
167
229
|
readonly span: Span;
|
|
168
230
|
}
|
|
@@ -173,7 +235,63 @@ export interface PortDecl {
|
|
|
173
235
|
readonly name: IdentExpr;
|
|
174
236
|
readonly span: Span;
|
|
175
237
|
}
|
|
176
|
-
|
|
238
|
+
/** `module std.settlements` gives a file its importable module name. */
|
|
239
|
+
export interface ModuleDecl {
|
|
240
|
+
readonly kind: "module";
|
|
241
|
+
readonly name: PathExpr;
|
|
242
|
+
readonly span: Span;
|
|
243
|
+
}
|
|
244
|
+
export interface TypeParameter {
|
|
245
|
+
readonly name: IdentExpr;
|
|
246
|
+
readonly span: Span;
|
|
247
|
+
}
|
|
248
|
+
export interface Parameter {
|
|
249
|
+
readonly name: IdentExpr;
|
|
250
|
+
readonly span: Span;
|
|
251
|
+
readonly type: Expr;
|
|
252
|
+
}
|
|
253
|
+
/** The single general instrument definition form. */
|
|
254
|
+
export interface InstrumentDecl {
|
|
255
|
+
readonly body: BlockExpr;
|
|
256
|
+
/** Module-local declarations carried only while this template is bound. */
|
|
257
|
+
readonly declarationScope?: readonly ApplicationScopeDecl[];
|
|
258
|
+
readonly exported: boolean;
|
|
259
|
+
/** True when the source declared a parameter list, including an empty `()`. */
|
|
260
|
+
readonly hasParameterList: boolean;
|
|
261
|
+
readonly kind: "instrument";
|
|
262
|
+
readonly name: IdentExpr;
|
|
263
|
+
readonly parameters: readonly Parameter[];
|
|
264
|
+
readonly span: Span;
|
|
265
|
+
readonly typeParameters: readonly TypeParameter[];
|
|
266
|
+
}
|
|
267
|
+
/** Instantiation of an exported parameterized instrument. */
|
|
268
|
+
export interface InstrumentApplyDecl {
|
|
269
|
+
readonly application: ApplyExpr;
|
|
270
|
+
/** Module-local declarations carried only while this application is bound. */
|
|
271
|
+
readonly declarationScope?: readonly ApplicationScopeDecl[];
|
|
272
|
+
readonly exported: boolean;
|
|
273
|
+
readonly kind: "instrument_apply";
|
|
274
|
+
readonly metadata?: BlockExpr;
|
|
275
|
+
readonly name: IdentExpr;
|
|
276
|
+
readonly span: Span;
|
|
277
|
+
}
|
|
278
|
+
export interface TypeDecl {
|
|
279
|
+
readonly exported: boolean;
|
|
280
|
+
readonly kind: "type";
|
|
281
|
+
readonly name: IdentExpr;
|
|
282
|
+
readonly span: Span;
|
|
283
|
+
readonly value: Expr;
|
|
284
|
+
}
|
|
285
|
+
export interface ConstDecl {
|
|
286
|
+
readonly exported: boolean;
|
|
287
|
+
readonly kind: "const";
|
|
288
|
+
readonly name: IdentExpr;
|
|
289
|
+
readonly span: Span;
|
|
290
|
+
readonly type?: Expr;
|
|
291
|
+
readonly value: Expr;
|
|
292
|
+
}
|
|
293
|
+
export type ApplicationScopeDecl = ConstDecl | InstrumentDecl | PartyDecl | PortDecl | TypeDecl;
|
|
294
|
+
export type Decl = AssetDecl | ConstDecl | ExposeDecl | ImportDecl | InstrumentApplyDecl | InstrumentDecl | ModuleDecl | PartyDecl | PortDecl | ProgramDecl | SubjectDecl | TypeDecl | UseDecl;
|
|
177
295
|
export interface Program {
|
|
178
296
|
readonly decls: readonly Decl[];
|
|
179
297
|
readonly span: Span;
|
|
@@ -183,8 +301,9 @@ export interface Program {
|
|
|
183
301
|
* it never throws, it returns the best-effort tree plus these.
|
|
184
302
|
*/
|
|
185
303
|
export interface Diagnostic {
|
|
304
|
+
readonly code?: string;
|
|
305
|
+
readonly fix?: string;
|
|
186
306
|
readonly message: string;
|
|
187
307
|
readonly span: Span;
|
|
188
308
|
}
|
|
189
|
-
export {};
|
|
190
309
|
//# sourceMappingURL=ast.d.ts.map
|
package/dist/src/ast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,IAAI;IACnB,wDAAwD;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sDAAsD;IACtD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,OAAO;IACtB,sBAAsB;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,iEAAiE;AACjE,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAWjE;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,wEAAwE;IACxE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAMnD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAUnE;AAID,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC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W,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;CACtB;AAED,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,cAAc,GACd,SAAS,GACT,QAAQ,GACR,QAAQ,CAAC;AAEb,MAAM,MAAM,IAAI,GACZ,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,mBAAmB,GACnB,cAAc,GACd,UAAU,GACV,SAAS,GACT,QAAQ,GACR,WAAW,GACX,WAAW,GACX,QAAQ,GACR,OAAO,CAAC;AAIZ,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB;AAID;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB"}
|
package/dist/src/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `hsx` command line
|
|
2
|
+
* The `hsx` command line over the one compiler entry point and catalog.
|
|
3
3
|
*
|
|
4
4
|
* `check` prints diagnostics and says nothing else; `build` writes the
|
|
5
5
|
* compiled artifacts as JSON. Neither reads the environment, neither touches
|
|
@@ -16,5 +16,6 @@ export interface Io {
|
|
|
16
16
|
readonly readFile: (path: string) => Promise<string>;
|
|
17
17
|
readonly writeFile: (path: string, contents: string) => Promise<void>;
|
|
18
18
|
}
|
|
19
|
+
export declare const USAGE_TEXT = "hsx 1.0.0-rc.1, the HSX compiler\n\nUsage:\n hsx check <file.hsx> [--strict]\n hsx build <file.hsx> [--out <file.json>] [--strict]\n hsx cost <file.hsx> [--json] [--out <file.json>] [--strict]\n hsx explain <HSX####>\n hsx format <file.hsx>\n hsx --version\n hsx --help\n\nCommands:\n check Compile and report diagnostics. Prints nothing when the program is clean.\n build Compile and write canonical UDL and its Business Frame as JSON.\n cost Compile and print the version-pinned cost manifest as a table or JSON.\n explain Print one diagnostic title, fix, and source example.\n format Print the source in the one canonical HSX style.\n\nOptions:\n --json Print the cost manifest as JSON instead of a table.\n --out <file> Write build or cost JSON to this path instead of stdout.\n --strict Treat warning-severity diagnostics as failures.\n\nExit codes:\n 0 the program compiled (verdict valid, or warning without --strict)\n 1 the program was refused (verdict invalid, or warning with --strict)\n 2 the command line or the input file could not be used";
|
|
19
20
|
export declare function runCli(argv: readonly string[], io: Io): Promise<number>;
|
|
20
21
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/src/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,kEAAkE;AAClE,MAAM,WAAW,EAAE;IACjB,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAUD,eAAO,MAAM,UAAU,4kCA0BmC,CAAC;AAE3D,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAoG7E"}
|