@hyperscale0/hsx 1.0.0-beta.1 → 1.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.
- package/CHANGELOG.md +58 -9
- package/LICENSING.md +3 -3
- package/README.md +39 -149
- package/TRADEMARKS.md +4 -4
- package/bin/hsx.ts +2 -0
- package/dist/bin/hsx.js +2 -0
- package/dist/bin/hsx.js.map +1 -1
- package/dist/src/ast.d.ts +135 -10
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/ast.js +24 -0
- package/dist/src/ast.js.map +1 -1
- package/dist/src/cli.d.ts +4 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +172 -16
- package/dist/src/cli.js.map +1 -1
- package/dist/src/compile.d.ts +42 -7
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +82 -16
- 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 +34 -0
- package/dist/src/emit.d.ts.map +1 -0
- package/dist/src/emit.js +137 -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 +11 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -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/lsp/server.d.ts +32 -0
- package/dist/src/lsp/server.d.ts.map +1 -0
- package/dist/src/lsp/server.js +391 -0
- package/dist/src/lsp/server.js.map +1 -0
- package/dist/src/modules.d.ts +38 -0
- package/dist/src/modules.d.ts.map +1 -0
- package/dist/src/modules.js +368 -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/std-bundle.d.ts +2 -0
- package/dist/src/std-bundle.d.ts.map +1 -0
- package/dist/src/std-bundle.js +88 -0
- package/dist/src/std-bundle.js.map +1 -0
- package/dist/src/std-library.d.ts +5 -0
- package/dist/src/std-library.d.ts.map +1 -0
- package/dist/src/std-library.js +9 -0
- package/dist/src/std-library.js.map +1 -0
- 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 +26 -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 +1739 -0
- package/docs/llms.txt +45 -0
- package/docs/playground.md +54 -0
- package/docs/reference/cli.md +35 -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 +13 -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 +96 -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 +84 -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 +27 -6
- package/skills/hsx/SKILL.md +483 -0
- package/src/ast.ts +193 -9
- package/src/cli.ts +191 -20
- package/src/compile.ts +160 -23
- package/src/cost.ts +579 -0
- package/src/diagnostics.ts +442 -0
- package/src/emit.ts +201 -0
- package/src/entry-overrides.ts +263 -48
- package/src/format.ts +261 -0
- package/src/index.ts +34 -4
- package/src/ir.ts +99 -0
- package/src/lex.ts +59 -4
- package/src/limits.ts +2 -3
- package/src/lsp/server.ts +460 -0
- package/src/modules.ts +446 -0
- package/src/parse.ts +655 -21
- package/src/std-bundle.ts +91 -0
- package/src/std-library.ts +12 -0
- 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/docs/llms.txt
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 1.0.0. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# HSX documentation
|
|
4
|
+
|
|
5
|
+
> Repository guide and generated compiler reference for HSX 1.0.0.
|
|
6
|
+
|
|
7
|
+
## Guide
|
|
8
|
+
|
|
9
|
+
[Your first program](guide/01-first-program.md): Hand-written chapter with compiler-checked programs.
|
|
10
|
+
[Money](guide/02-money.md): Hand-written chapter with compiler-checked programs.
|
|
11
|
+
[Instruments](guide/03-instruments.md): Hand-written chapter with compiler-checked programs.
|
|
12
|
+
[Lifecycles](guide/04-lifecycles.md): Hand-written chapter with compiler-checked programs.
|
|
13
|
+
[Fees and splits](guide/05-fees-and-splits.md): Hand-written chapter with compiler-checked programs.
|
|
14
|
+
[Schedules](guide/06-schedules.md): Hand-written chapter with compiler-checked programs.
|
|
15
|
+
[Composition](guide/07-composition.md): Hand-written chapter with compiler-checked programs.
|
|
16
|
+
[Writing a module](guide/08-writing-a-module.md): Hand-written chapter with compiler-checked programs.
|
|
17
|
+
[Cost](guide/09-cost.md): Hand-written chapter with compiler-checked programs.
|
|
18
|
+
[Diagnostics](guide/10-diagnostics.md): Hand-written chapter with compiler-checked programs.
|
|
19
|
+
|
|
20
|
+
## Reference
|
|
21
|
+
|
|
22
|
+
[Grammar](reference/grammar.md): Lexer, clause, and module vocabulary.
|
|
23
|
+
[Types](reference/types.md): HSX type kinds.
|
|
24
|
+
[Diagnostics](reference/diagnostics.md): Stable HSX diagnostic codes and fixes.
|
|
25
|
+
[CLI](reference/cli.md): Generated command usage.
|
|
26
|
+
[UDL output](reference/udl-output.md): Compile artifacts and canonical output.
|
|
27
|
+
[advance](reference/std/advance.md): Standard-library module.
|
|
28
|
+
[cancellable_booking](reference/std/cancellable_booking.md): Standard-library module.
|
|
29
|
+
[captured_payment](reference/std/captured_payment.md): Standard-library module.
|
|
30
|
+
[conditional_disbursement](reference/std/conditional_disbursement.md): Standard-library module.
|
|
31
|
+
[credit_facility](reference/std/credit_facility.md): Standard-library module.
|
|
32
|
+
[held_payment](reference/std/held_payment.md): Standard-library module.
|
|
33
|
+
[instant_transfer](reference/std/instant_transfer.md): Standard-library module.
|
|
34
|
+
[metered](reference/std/metered.md): Standard-library module.
|
|
35
|
+
[pooled_split](reference/std/pooled_split.md): Standard-library module.
|
|
36
|
+
[premium_forward](reference/std/premium_forward.md): Standard-library module.
|
|
37
|
+
[reconciled_payout](reference/std/reconciled_payout.md): Standard-library module.
|
|
38
|
+
[recurring_collection](reference/std/recurring_collection.md): Standard-library module.
|
|
39
|
+
[rotating_pool](reference/std/rotating_pool.md): Standard-library module.
|
|
40
|
+
[scheduled](reference/std/scheduled.md): Standard-library module.
|
|
41
|
+
[security_deposit](reference/std/security_deposit.md): Standard-library module.
|
|
42
|
+
[settlement_batch](reference/std/settlement_batch.md): Standard-library module.
|
|
43
|
+
[swap](reference/std/swap.md): Standard-library module.
|
|
44
|
+
[threshold_pool](reference/std/threshold_pool.md): Standard-library module.
|
|
45
|
+
[weighted_distribution](reference/std/weighted_distribution.md): Standard-library module.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Browser playground
|
|
2
|
+
|
|
3
|
+
The HSX playground is a static browser application for authoring, editing,
|
|
4
|
+
and inspecting HSX programs without a server. It runs the compiler directly
|
|
5
|
+
in the browser client.
|
|
6
|
+
|
|
7
|
+
## What it provides
|
|
8
|
+
|
|
9
|
+
- Source editor with line numbers and debounced compilation (200 ms).
|
|
10
|
+
- Verdict badge showing `valid`, `warning`, or `invalid`.
|
|
11
|
+
- Diagnostics panel with stage, code, line and column coordinates, message,
|
|
12
|
+
and suggested fix. Clicking any diagnostic focuses the editor and highlights
|
|
13
|
+
the exact source span.
|
|
14
|
+
- Tabbed output pane showing the lowered canonical UDL document as formatted
|
|
15
|
+
JSON and the UDL cost manifest.
|
|
16
|
+
- Built-in example selector containing the full corpus of test programs and
|
|
17
|
+
standard-library settlements.
|
|
18
|
+
- Pure client execution with no Node runtime dependencies.
|
|
19
|
+
|
|
20
|
+
## Build the playground
|
|
21
|
+
|
|
22
|
+
Generate the examples manifest, bundle the browser assets, and copy static
|
|
23
|
+
files to `open/hsx/playground/dist/`:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
bun run --cwd open/hsx playground:build
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Verify that the generated static bundle contains no Node specifiers or URL
|
|
30
|
+
resolution calls:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
bun run --cwd open/hsx playground:check
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Serve locally
|
|
37
|
+
|
|
38
|
+
The deliverable is the static directory under `open/hsx/playground/dist/`.
|
|
39
|
+
Hosting infrastructure is owner-owed. To run the playground locally, serve
|
|
40
|
+
the output directory with any local static file server.
|
|
41
|
+
|
|
42
|
+
Using Bun:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
bunx serve open/hsx/playground/dist
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Using Python:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
python3 -m http.server -d open/hsx/playground/dist 8000
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Open `http://localhost:8000` in a browser.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 1.0.0. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# CLI
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
hsx 1.0.0, the HSX compiler
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
hsx check <file.hsx> [--strict]
|
|
10
|
+
hsx build <file.hsx> [--out <file.json>] [--strict]
|
|
11
|
+
hsx cost <file.hsx> [--json] [--out <file.json>] [--strict]
|
|
12
|
+
hsx explain <HSX####>
|
|
13
|
+
hsx format <file.hsx>
|
|
14
|
+
hsx lsp
|
|
15
|
+
hsx --version
|
|
16
|
+
hsx --help
|
|
17
|
+
|
|
18
|
+
Commands:
|
|
19
|
+
check Compile and report diagnostics. Prints nothing when the program is clean.
|
|
20
|
+
build Compile and write canonical UDL as JSON.
|
|
21
|
+
cost Compile and print the version-pinned cost manifest as a table or JSON.
|
|
22
|
+
explain Print one diagnostic title, fix, and source example.
|
|
23
|
+
format Print the source in the one canonical HSX style.
|
|
24
|
+
lsp Run the language server over stdin and stdout.
|
|
25
|
+
|
|
26
|
+
Options:
|
|
27
|
+
--json Print the cost manifest as JSON instead of a table.
|
|
28
|
+
--out <file> Write build or cost JSON to this path instead of stdout.
|
|
29
|
+
--strict Treat warning-severity diagnostics as failures.
|
|
30
|
+
|
|
31
|
+
Exit codes:
|
|
32
|
+
0 the program compiled (verdict valid, or warning without --strict)
|
|
33
|
+
1 the program was refused (verdict invalid, or warning with --strict)
|
|
34
|
+
2 the command line or the input file could not be used
|
|
35
|
+
```
|