@greenpandastudios/aug-cli 0.19.0 → 0.21.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/README.md +9 -6
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/bin/aug.mjs +12 -2
- package/docs/about.md +27 -0
- package/docs/api/crypto.md +103 -69
- package/docs/api/io.md +35 -33
- package/docs/api/json.md +3 -3
- package/docs/api/memory.md +23 -19
- package/docs/api/time.md +10 -9
- package/docs/api/web.md +33 -38
- package/docs/assets/benchmarks/execution.svg +774 -637
- package/docs/assets/benchmarks/http.svg +278 -249
- package/docs/assets/benchmarks/improvements.svg +66 -66
- package/docs/assets/benchmarks/kernels-mobile.svg +1 -0
- package/docs/assets/benchmarks/kernels.svg +1 -0
- package/docs/assets/benchmarks/memory.svg +153 -153
- package/docs/benchmark-results.json +227089 -90363
- package/docs/compatibility.md +8 -8
- package/docs/contributing-benchmarks.md +68 -0
- package/docs/dev-containers.md +88 -0
- package/docs/dgx-consumers.json +122 -0
- package/docs/dgx-gyms.json +784 -0
- package/docs/dgx-kernels.json +1170 -0
- package/docs/dgx-performance.json +227849 -0
- package/docs/dgx-spark.md +64 -0
- package/docs/diagnostics.md +15 -5
- package/docs/docker.md +173 -12
- package/docs/editor.md +35 -0
- package/docs/example-projects.json +238 -24
- package/docs/examples/approved-design/counters.md +34 -126
- package/docs/examples/approved-design/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/approved-design/domain/app.md +13 -77
- package/docs/examples/approved-design/domain/export.md +5 -19
- package/docs/examples/approved-design/domain/models.md +4 -23
- package/docs/examples/approved-design/domain/numbers.md +24 -114
- package/docs/examples/approved-design/index.md +16 -7
- package/docs/examples/approved-design/main.md +19 -96
- package/docs/examples/benchmark/index.md +6 -5
- package/docs/examples/benchmark/main.md +7 -35
- package/docs/examples/calls-benchmark/index.md +36 -0
- package/docs/examples/calls-benchmark/main.md +78 -0
- package/docs/examples/calls-benchmark/operations.md +60 -0
- package/docs/examples/cli-args/index.md +6 -5
- package/docs/examples/cli-args/main.md +6 -31
- package/docs/examples/collections/index.md +6 -5
- package/docs/examples/collections/main.md +7 -35
- package/docs/examples/collections-benchmark/index.md +6 -5
- package/docs/examples/collections-benchmark/main.md +7 -35
- package/docs/examples/cpu-benchmark/index.md +6 -5
- package/docs/examples/cpu-benchmark/main.md +5 -24
- package/docs/examples/developer-workflow/calculator.md +39 -186
- package/docs/examples/developer-workflow/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/developer-workflow/index.md +16 -7
- package/docs/examples/developer-workflow/logging/console.md +10 -56
- package/docs/examples/developer-workflow/logging/export.md +4 -14
- package/docs/examples/developer-workflow/logging/logger.md +7 -43
- package/docs/examples/developer-workflow/main.md +17 -69
- package/docs/examples/drop/index.md +6 -5
- package/docs/examples/drop/main.md +7 -27
- package/docs/examples/drop/resource.md +7 -30
- package/docs/examples/errors/errors.md +7 -27
- package/docs/examples/errors/index.md +6 -5
- package/docs/examples/errors/main.md +7 -28
- package/docs/examples/errors-benchmark/index.md +36 -0
- package/docs/examples/errors-benchmark/main.md +92 -0
- package/docs/examples/errors-benchmark/operations.md +65 -0
- package/docs/examples/ffi/index.md +6 -5
- package/docs/examples/ffi/main.md +6 -20
- package/docs/examples/ffi/native.md +8 -34
- package/docs/examples/float-benchmark/index.md +35 -0
- package/docs/examples/float-benchmark/main.md +75 -0
- package/docs/examples/generic-di/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/generic-di/index.md +6 -5
- package/docs/examples/generic-di/main.md +9 -39
- package/docs/examples/generic-di/types.md +23 -92
- package/docs/examples/generics/index.md +6 -5
- package/docs/examples/generics/main.md +10 -47
- package/docs/examples/generics/types.md +25 -100
- package/docs/examples/hello/app/export.md +4 -12
- package/docs/examples/hello/app/greeter.md +13 -91
- package/docs/examples/hello/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/hello/index.md +17 -6
- package/docs/examples/hello/logging/console.md +10 -54
- package/docs/examples/hello/logging/export.md +4 -14
- package/docs/examples/hello/logging/logger.md +7 -45
- package/docs/examples/hello/main.md +9 -39
- package/docs/examples/http-benchmark/index.md +6 -5
- package/docs/examples/http-benchmark/main.md +6 -20
- package/docs/examples/http-benchmark/routes.md +9 -31
- package/docs/examples/index.md +63 -29
- package/docs/examples/interceptors/app.md +20 -139
- package/docs/examples/interceptors/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/interceptors/index.md +6 -5
- package/docs/examples/interceptors/interceptors.md +24 -148
- package/docs/examples/interceptors/logging.md +13 -76
- package/docs/examples/interceptors/main.md +10 -65
- package/docs/examples/json-benchmark/data.md +4 -20
- package/docs/examples/json-benchmark/dependencies/packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +67 -0
- package/docs/examples/json-benchmark/index.md +7 -5
- package/docs/examples/json-benchmark/main-yaml.md +20 -0
- package/docs/examples/json-benchmark/main.md +10 -49
- package/docs/examples/list-benchmark/index.md +35 -0
- package/docs/examples/list-benchmark/main.md +78 -0
- package/docs/examples/map-churn-benchmark/index.md +35 -0
- package/docs/examples/map-churn-benchmark/main.md +106 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/api.md +104 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.md +54 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/native.abi-json.md +48 -0
- package/docs/examples/native-blake3/hashing.md +93 -0
- package/docs/examples/native-blake3/index.md +38 -0
- package/docs/examples/native-blake3/main.md +73 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/api.md +406 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.md +51 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.md +63 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/native.abi-json.md +161 -0
- package/docs/examples/native-pytorch/index.md +38 -0
- package/docs/examples/native-pytorch/main.md +73 -0
- package/docs/examples/native-pytorch/tensors.md +123 -0
- package/docs/examples/native-sqlite/database.md +116 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/api.md +284 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.md +51 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.md +75 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi-json.md +119 -0
- package/docs/examples/native-sqlite/index.md +38 -0
- package/docs/examples/native-sqlite/main.md +73 -0
- package/docs/examples/native-zlib/compression.md +99 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/api.md +153 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.md +54 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/native.abi-json.md +76 -0
- package/docs/examples/native-zlib/index.md +38 -0
- package/docs/examples/native-zlib/main.md +78 -0
- package/docs/examples/new-syntax/console.md +10 -52
- package/docs/examples/new-syntax/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/new-syntax/greeter.md +13 -71
- package/docs/examples/new-syntax/index.md +6 -5
- package/docs/examples/new-syntax/logger.md +7 -43
- package/docs/examples/new-syntax/main.md +10 -53
- package/docs/examples/new-syntax/math.md +6 -24
- package/docs/examples/oidc-login/client/contracts.md +10 -61
- package/docs/examples/oidc-login/client/endpoints.md +32 -154
- package/docs/examples/oidc-login/client/export.md +5 -23
- package/docs/examples/oidc-login/client/login.md +234 -344
- package/docs/examples/oidc-login/client/logout.md +38 -143
- package/docs/examples/oidc-login/client/protocol.md +183 -304
- package/docs/examples/oidc-login/client/session.md +41 -149
- package/docs/examples/oidc-login/client/views.md +13 -58
- package/docs/examples/oidc-login/common/export.md +6 -26
- package/docs/examples/oidc-login/common/headers.md +42 -72
- package/docs/examples/oidc-login/common/keys.md +40 -164
- package/docs/examples/oidc-login/common/settings.md +24 -40
- package/docs/examples/oidc-login/common/views.md +7 -28
- package/docs/examples/oidc-login/dependencies/packages/@git/url_0eb7c89453c87681ed15/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/store.md +205 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +67 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_897efafd565158fc4908/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +267 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/contracts.md +415 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/jose.md +271 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_c092cd151499c4e1d8a1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +89 -0
- package/docs/examples/oidc-login/index.md +8 -7
- package/docs/examples/oidc-login/main-yaml.md +7 -0
- package/docs/examples/oidc-login/main.md +26 -153
- package/docs/examples/oidc-login/provider/authorization.md +232 -275
- package/docs/examples/oidc-login/provider/contracts.md +24 -146
- package/docs/examples/oidc-login/provider/credentials.md +24 -57
- package/docs/examples/oidc-login/provider/discovery.md +48 -122
- package/docs/examples/oidc-login/provider/export.md +11 -37
- package/docs/examples/oidc-login/provider/token.md +159 -237
- package/docs/examples/oidc-login/provider/userinfo.md +47 -102
- package/docs/examples/oidc-login/provider/views.md +13 -53
- package/docs/examples/ownership/counter.md +17 -63
- package/docs/examples/ownership/index.md +6 -5
- package/docs/examples/ownership/main.md +7 -30
- package/docs/examples/ownership-transfer/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/ownership-transfer/index.md +6 -5
- package/docs/examples/ownership-transfer/main.md +10 -52
- package/docs/examples/ownership-transfer/resource.md +15 -67
- package/docs/examples/packages-app/dependencies/packages/@example/aug-math/0.1.0/arithmetic.md +12 -50
- package/docs/examples/packages-app/index.md +7 -6
- package/docs/examples/packages-app/main.md +7 -25
- package/docs/examples/packages-math/aug-package-json.md +1 -1
- package/docs/examples/packages-math/index.md +7 -6
- package/docs/examples/packages-math/src/arithmetic.md +12 -50
- package/docs/examples/packages-math/src/export.md +4 -12
- package/docs/examples/records-benchmark/data.md +55 -0
- package/docs/examples/records-benchmark/index.md +36 -0
- package/docs/examples/records-benchmark/main.md +85 -0
- package/docs/examples/startup-benchmark/index.md +6 -5
- package/docs/examples/startup-benchmark/main.md +5 -17
- package/docs/examples/strings-benchmark/index.md +35 -0
- package/docs/examples/strings-benchmark/main.md +76 -0
- package/docs/examples/tasks-benchmark/index.md +36 -0
- package/docs/examples/tasks-benchmark/main.md +89 -0
- package/docs/examples/tasks-benchmark/operations.md +58 -0
- package/docs/examples/visibility/counter.md +19 -67
- package/docs/examples/visibility/index.md +6 -5
- package/docs/examples/visibility/main.md +7 -31
- package/docs/examples/weather-api/forecasts.md +168 -0
- package/docs/examples/weather-api/index.md +42 -0
- package/docs/examples/weather-api/main-yaml.md +21 -0
- package/docs/examples/weather-api/main.md +65 -0
- package/docs/examples.json +10 -0
- package/docs/getting-started.md +105 -2
- package/docs/grammar.md +7 -5
- package/docs/guides/change-a-module.md +64 -0
- package/docs/guides/index.md +27 -0
- package/docs/gym-results.json +784 -0
- package/docs/implementation-map.md +6 -0
- package/docs/index.md +51 -29
- package/docs/kernel-results.json +1170 -0
- package/docs/language-conformance.md +7 -1
- package/docs/language-constructs.md +30 -22
- package/docs/language-design-audit.md +1 -1
- package/docs/learn/data-and-errors.md +77 -0
- package/docs/learn/index.md +30 -0
- package/docs/learn/modules-and-dependencies.md +73 -0
- package/docs/learn/state-and-tests.md +71 -0
- package/docs/learn/values-and-functions.md +62 -0
- package/docs/lesson-failures.json +8 -0
- package/docs/maintaining-docs.md +16 -4
- package/docs/native-implementation.md +276 -0
- package/docs/native-interop-llvm-plan.md +342 -0
- package/docs/native-package-examples.md +684 -0
- package/docs/native-packages.md +179 -0
- package/docs/packages.md +72 -126
- package/docs/performance.md +61 -68
- package/docs/production-readiness.md +16 -5
- package/docs/public/downloads/approved-design.zip +0 -0
- package/docs/public/downloads/benchmark.zip +0 -0
- package/docs/public/downloads/calls-benchmark.zip +0 -0
- package/docs/public/downloads/cli-args.zip +0 -0
- package/docs/public/downloads/collections-benchmark.zip +0 -0
- package/docs/public/downloads/collections.zip +0 -0
- package/docs/public/downloads/cpu-benchmark.zip +0 -0
- package/docs/public/downloads/developer-workflow.zip +0 -0
- package/docs/public/downloads/drop.zip +0 -0
- package/docs/public/downloads/errors-benchmark.zip +0 -0
- package/docs/public/downloads/errors.zip +0 -0
- package/docs/public/downloads/ffi.zip +0 -0
- package/docs/public/downloads/float-benchmark.zip +0 -0
- package/docs/public/downloads/generic-di.zip +0 -0
- package/docs/public/downloads/generics.zip +0 -0
- package/docs/public/downloads/hello.zip +0 -0
- package/docs/public/downloads/http-benchmark.zip +0 -0
- package/docs/public/downloads/interceptors.zip +0 -0
- package/docs/public/downloads/json-benchmark.zip +0 -0
- package/docs/public/downloads/list-benchmark.zip +0 -0
- package/docs/public/downloads/map-churn-benchmark.zip +0 -0
- package/docs/public/downloads/native-blake3.zip +0 -0
- package/docs/public/downloads/native-pytorch.zip +0 -0
- package/docs/public/downloads/native-sqlite.zip +0 -0
- package/docs/public/downloads/native-zlib.zip +0 -0
- package/docs/public/downloads/new-syntax.zip +0 -0
- package/docs/public/downloads/oidc-login.zip +0 -0
- package/docs/public/downloads/ownership-transfer.zip +0 -0
- package/docs/public/downloads/ownership.zip +0 -0
- package/docs/public/downloads/packages-app.zip +0 -0
- package/docs/public/downloads/packages-math.zip +0 -0
- package/docs/public/downloads/records-benchmark.zip +0 -0
- package/docs/public/downloads/startup-benchmark.zip +0 -0
- package/docs/public/downloads/strings-benchmark.zip +0 -0
- package/docs/public/downloads/tasks-benchmark.zip +0 -0
- package/docs/public/downloads/visibility.zip +0 -0
- package/docs/public/downloads/weather-api.zip +0 -0
- package/docs/qualification-results.md +66 -0
- package/docs/reference.md +47 -17
- package/docs/releasing.md +105 -16
- package/docs/research/code-to-natural-language.md +108 -0
- package/docs/research/ecosystem-workflow.md +41 -0
- package/docs/research/libtorch-native-qualification.md +115 -0
- package/docs/research/native-interop-llvm.md +197 -0
- package/docs/research/qualification-methods.md +15 -0
- package/docs/research/wiki-editorial-design.md +71 -0
- package/docs/roadmap.md +2 -1
- package/docs/safety-gyms.md +41 -0
- package/docs/specifications.md +27 -11
- package/docs/testing.md +19 -5
- package/docs/tooling.md +36 -22
- package/docs/weather-api.md +65 -0
- package/docs/web-library-gaps.md +1 -1
- package/docs/web.md +54 -18
- package/docs/writing-docs.md +49 -0
- package/examples/{hello/.aug-spec/august/0.19.0 → approved-design/.aug-spec/august/0.21.0}/io/contracts.aug +4 -3
- package/examples/approved-design/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/approved-design/.aug-spec/manifest.json +3 -3
- package/examples/approved-design/counters.aug +5 -4
- package/examples/approved-design/counters.aug.md +25 -132
- package/examples/approved-design/domain/app.aug +2 -1
- package/examples/approved-design/domain/app.aug.md +10 -80
- package/examples/approved-design/domain/export.aug +1 -0
- package/examples/approved-design/domain/export.aug.md +4 -20
- package/examples/approved-design/domain/models.aug +1 -0
- package/examples/approved-design/domain/models.aug.md +3 -25
- package/examples/approved-design/domain/numbers.aug +3 -2
- package/examples/approved-design/domain/numbers.aug.md +19 -116
- package/examples/approved-design/main.aug +1 -0
- package/examples/approved-design/main.aug.md +12 -95
- package/examples/benchmark/.aug-spec/manifest.json +1 -1
- package/examples/benchmark/main.aug +1 -0
- package/examples/benchmark/main.aug.md +6 -36
- package/examples/cli-args/.aug-spec/manifest.json +1 -1
- package/examples/cli-args/main.aug +1 -0
- package/examples/cli-args/main.aug.md +5 -32
- package/examples/collections/.aug-spec/manifest.json +1 -1
- package/examples/collections/main.aug +1 -0
- package/examples/collections/main.aug.md +6 -36
- package/examples/{generic-di/.aug-spec/august/0.19.0 → developer-workflow/.aug-spec/august/0.21.0}/io/contracts.aug +4 -3
- package/examples/developer-workflow/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/developer-workflow/.aug-spec/manifest.json +3 -3
- package/examples/developer-workflow/calculator.aug +3 -2
- package/examples/developer-workflow/calculator.aug.md +28 -189
- package/examples/developer-workflow/logging/console.aug +2 -1
- package/examples/developer-workflow/logging/console.aug.md +7 -57
- package/examples/developer-workflow/logging/export.aug +1 -0
- package/examples/developer-workflow/logging/export.aug.md +3 -15
- package/examples/developer-workflow/logging/logger.aug +1 -0
- package/examples/developer-workflow/logging/logger.aug.md +6 -46
- package/examples/developer-workflow/main.aug +1 -0
- package/examples/developer-workflow/main.aug.md +10 -68
- package/examples/drop/.aug-spec/manifest.json +1 -1
- package/examples/drop/main.aug +1 -0
- package/examples/drop/main.aug.md +6 -28
- package/examples/drop/resource.aug +1 -0
- package/examples/drop/resource.aug.md +6 -34
- package/examples/errors/.aug-spec/manifest.json +1 -1
- package/examples/errors/errors.aug +2 -1
- package/examples/errors/errors.aug.md +4 -27
- package/examples/errors/main.aug +1 -0
- package/examples/errors/main.aug.md +6 -29
- package/examples/ffi/.aug-spec/manifest.json +1 -1
- package/examples/ffi/main.aug +1 -0
- package/examples/ffi/main.aug.md +5 -21
- package/examples/ffi/native.aug +2 -1
- package/examples/ffi/native.aug.md +5 -35
- package/examples/{approved-design/.aug-spec/august/0.19.0 → generic-di/.aug-spec/august/0.21.0}/io/contracts.aug +4 -3
- package/examples/generic-di/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/generic-di/.aug-spec/manifest.json +3 -3
- package/examples/generic-di/main.aug +1 -0
- package/examples/generic-di/main.aug.md +8 -40
- package/examples/generic-di/types.aug +3 -2
- package/examples/generic-di/types.aug.md +18 -97
- package/examples/generics/.aug-spec/manifest.json +1 -1
- package/examples/generics/main.aug +1 -0
- package/examples/generics/main.aug.md +9 -48
- package/examples/generics/types.aug +4 -3
- package/examples/generics/types.aug.md +18 -104
- package/examples/{developer-workflow/.aug-spec/august/0.19.0 → hello/.aug-spec/august/0.21.0}/io/contracts.aug +4 -3
- package/examples/hello/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/hello/.aug-spec/manifest.json +3 -3
- package/examples/hello/app/export.aug +1 -0
- package/examples/hello/app/export.aug.md +3 -13
- package/examples/hello/app/greeter.aug +2 -1
- package/examples/hello/app/greeter.aug.md +10 -94
- package/examples/hello/logging/console.aug +2 -1
- package/examples/hello/logging/console.aug.md +7 -55
- package/examples/hello/logging/export.aug +1 -0
- package/examples/hello/logging/export.aug.md +3 -15
- package/examples/hello/logging/logger.aug +1 -0
- package/examples/hello/logging/logger.aug.md +6 -48
- package/examples/hello/main.aug +1 -0
- package/examples/hello/main.aug.md +8 -40
- package/examples/interceptors/.aug-spec/august/0.21.0/io/contracts.aug +37 -0
- package/examples/interceptors/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/interceptors/.aug-spec/manifest.json +3 -3
- package/examples/interceptors/app.aug +3 -2
- package/examples/interceptors/app.aug.md +15 -141
- package/examples/interceptors/interceptors.aug +3 -2
- package/examples/interceptors/interceptors.aug.md +19 -152
- package/examples/interceptors/logging.aug +2 -1
- package/examples/interceptors/logging.aug.md +10 -79
- package/examples/interceptors/main.aug +1 -0
- package/examples/interceptors/main.aug.md +9 -66
- package/examples/native-blake3/.aug-spec/manifest.json +16 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.1/native.abi.json +29 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/api.aug +14 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/api.aug.md +34 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.aug +4 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.aug.md +8 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/native.abi.json +29 -0
- package/examples/native-blake3/AGENTS.md +5 -0
- package/examples/native-blake3/aug.lock.json +253 -0
- package/examples/native-blake3/hashing.aug +11 -0
- package/examples/native-blake3/hashing.aug.md +25 -0
- package/examples/native-blake3/main.aug +8 -0
- package/examples/native-blake3/main.aug.md +13 -0
- package/examples/native-pytorch/.aug-spec/manifest.json +18 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.1/native.abi.json +142 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.3/native.abi.json +142 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug +101 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug.md +160 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.aug +3 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md +8 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.aug +6 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.aug.md +13 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/native.abi.json +142 -0
- package/examples/native-pytorch/AGENTS.md +5 -0
- package/examples/native-pytorch/aug.lock.json +309 -0
- package/examples/native-pytorch/main.aug +8 -0
- package/examples/native-pytorch/main.aug.md +13 -0
- package/examples/native-pytorch/tensors.aug +23 -0
- package/examples/native-pytorch/tensors.aug.md +35 -0
- package/examples/native-sqlite/.aug-spec/manifest.json +18 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.2/native.abi.json +100 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug +48 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug.md +91 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug +3 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug.md +8 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug +8 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug.md +22 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi.json +100 -0
- package/examples/native-sqlite/AGENTS.md +5 -0
- package/examples/native-sqlite/aug.lock.json +236 -0
- package/examples/native-sqlite/database.aug +15 -0
- package/examples/native-sqlite/database.aug.md +27 -0
- package/examples/native-sqlite/main.aug +8 -0
- package/examples/native-sqlite/main.aug.md +13 -0
- package/examples/native-zlib/.aug-spec/manifest.json +16 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.1/native.abi.json +57 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/api.aug +29 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/api.aug.md +54 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.aug +4 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.aug.md +8 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/native.abi.json +57 -0
- package/examples/native-zlib/AGENTS.md +5 -0
- package/examples/native-zlib/aug.lock.json +236 -0
- package/examples/native-zlib/compression.aug +15 -0
- package/examples/native-zlib/compression.aug.md +27 -0
- package/examples/native-zlib/main.aug +10 -0
- package/examples/native-zlib/main.aug.md +13 -0
- package/examples/new-syntax/.aug-spec/august/0.21.0/io/contracts.aug +37 -0
- package/examples/new-syntax/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/new-syntax/.aug-spec/manifest.json +3 -3
- package/examples/new-syntax/console.aug +2 -1
- package/examples/new-syntax/console.aug.md +7 -53
- package/examples/new-syntax/greeter.aug +2 -1
- package/examples/new-syntax/greeter.aug.md +10 -74
- package/examples/new-syntax/logger.aug +1 -0
- package/examples/new-syntax/logger.aug.md +6 -46
- package/examples/new-syntax/main.aug +1 -0
- package/examples/new-syntax/main.aug.md +9 -54
- package/examples/new-syntax/math.aug +2 -1
- package/examples/new-syntax/math.aug.md +3 -24
- package/examples/oidc-login/.aug-spec/manifest.json +13 -13
- package/examples/oidc-login/.aug-spec/packages/@git/url_0eb7c89453c87681ed15/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/store.aug.md +71 -0
- package/examples/oidc-login/.aug-spec/packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug.md +17 -0
- package/examples/oidc-login/.aug-spec/packages/@git/url_897efafd565158fc4908/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug.md +125 -0
- package/examples/oidc-login/.aug-spec/{august/0.19.0/crypto → packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40}/contracts.aug +12 -11
- package/examples/oidc-login/.aug-spec/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/contracts.aug.md +244 -0
- package/examples/oidc-login/.aug-spec/{august/0.19.0/crypto → packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40}/jose.aug +6 -5
- package/examples/oidc-login/.aug-spec/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/jose.aug.md +71 -0
- package/examples/oidc-login/.aug-spec/packages/@git/url_c092cd151499c4e1d8a1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug.md +30 -0
- package/examples/oidc-login/aug.lock.json +100 -0
- package/examples/oidc-login/client/contracts.aug +1 -0
- package/examples/oidc-login/client/contracts.aug.md +9 -66
- package/examples/oidc-login/client/endpoints.aug +6 -5
- package/examples/oidc-login/client/endpoints.aug.md +13 -145
- package/examples/oidc-login/client/export.aug +1 -0
- package/examples/oidc-login/client/export.aug.md +4 -24
- package/examples/oidc-login/client/login.aug +7 -6
- package/examples/oidc-login/client/login.aug.md +25 -303
- package/examples/oidc-login/client/logout.aug +5 -4
- package/examples/oidc-login/client/logout.aug.md +13 -135
- package/examples/oidc-login/client/protocol.aug +7 -6
- package/examples/oidc-login/client/protocol.aug.md +36 -283
- package/examples/oidc-login/client/session.aug +5 -4
- package/examples/oidc-login/client/session.aug.md +12 -139
- package/examples/oidc-login/client/views.aug +3 -2
- package/examples/oidc-login/client/views.aug.md +8 -57
- package/examples/oidc-login/common/export.aug +1 -0
- package/examples/oidc-login/common/export.aug.md +5 -27
- package/examples/oidc-login/common/headers.aug +4 -3
- package/examples/oidc-login/common/headers.aug.md +9 -67
- package/examples/oidc-login/common/keys.aug +6 -5
- package/examples/oidc-login/common/keys.aug.md +29 -165
- package/examples/oidc-login/common/settings.aug +2 -1
- package/examples/oidc-login/common/settings.aug.md +5 -39
- package/examples/oidc-login/common/views.aug +2 -1
- package/examples/oidc-login/common/views.aug.md +4 -28
- package/examples/oidc-login/main.aug +6 -16
- package/examples/oidc-login/main.aug.md +17 -146
- package/examples/oidc-login/main.yaml +7 -0
- package/examples/oidc-login/provider/authorization.aug +7 -6
- package/examples/oidc-login/provider/authorization.aug.md +23 -238
- package/examples/oidc-login/provider/contracts.aug +1 -0
- package/examples/oidc-login/provider/contracts.aug.md +23 -158
- package/examples/oidc-login/provider/credentials.aug +3 -2
- package/examples/oidc-login/provider/credentials.aug.md +9 -53
- package/examples/oidc-login/provider/discovery.aug +4 -3
- package/examples/oidc-login/provider/discovery.aug.md +11 -118
- package/examples/oidc-login/provider/export.aug +1 -0
- package/examples/oidc-login/provider/export.aug.md +6 -34
- package/examples/oidc-login/provider/token.aug +6 -5
- package/examples/oidc-login/provider/token.aug.md +16 -204
- package/examples/oidc-login/provider/userinfo.aug +4 -3
- package/examples/oidc-login/provider/userinfo.aug.md +10 -92
- package/examples/oidc-login/provider/views.aug +3 -2
- package/examples/oidc-login/provider/views.aug.md +8 -52
- package/examples/ownership/.aug-spec/manifest.json +1 -1
- package/examples/ownership/counter.aug +3 -2
- package/examples/ownership/counter.aug.md +12 -66
- package/examples/ownership/main.aug +1 -0
- package/examples/ownership/main.aug.md +6 -31
- package/examples/ownership-transfer/.aug-spec/august/0.21.0/io/contracts.aug +37 -0
- package/examples/ownership-transfer/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/ownership-transfer/.aug-spec/manifest.json +3 -3
- package/examples/ownership-transfer/main.aug +1 -0
- package/examples/ownership-transfer/main.aug.md +9 -53
- package/examples/ownership-transfer/resource.aug +2 -1
- package/examples/ownership-transfer/resource.aug.md +12 -71
- package/examples/packages/app/.aug-spec/manifest.json +1 -1
- package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug +2 -1
- package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug.md +9 -51
- package/examples/packages/app/main.aug +1 -0
- package/examples/packages/app/main.aug.md +6 -26
- package/examples/packages/math/.aug-spec/manifest.json +1 -1
- package/examples/packages/math/aug-package.json +1 -1
- package/examples/packages/math/src/arithmetic.aug +2 -1
- package/examples/packages/math/src/arithmetic.aug.md +9 -51
- package/examples/packages/math/src/export.aug +1 -0
- package/examples/packages/math/src/export.aug.md +3 -13
- package/examples/visibility/.aug-spec/manifest.json +1 -1
- package/examples/visibility/counter.aug +4 -3
- package/examples/visibility/counter.aug.md +12 -68
- package/examples/visibility/main.aug +1 -0
- package/examples/visibility/main.aug.md +6 -32
- package/examples/weather-api/.aug-spec/manifest.json +8 -0
- package/examples/weather-api/AGENTS.md +17 -0
- package/examples/weather-api/README.md +19 -0
- package/examples/weather-api/forecasts.aug +47 -0
- package/examples/weather-api/forecasts.aug.md +32 -0
- package/examples/weather-api/main.aug +4 -0
- package/examples/weather-api/main.aug.md +15 -0
- package/examples/weather-api/main.yaml +5 -0
- package/examples/weather-api/weather.http +5 -0
- package/native/compiler-packs.json +43 -0
- package/package.json +4 -4
- package/runtime/aug_http.c +48 -21
- package/runtime/aug_http_ir.c +30 -0
- package/runtime/aug_http_ir.h +18 -0
- package/runtime/aug_ir.c +209 -0
- package/runtime/aug_ir.h +89 -0
- package/runtime/aug_json.c +6 -1
- package/runtime/aug_runtime.c +82 -16
- package/runtime/aug_runtime.h +16 -2
- package/runtime/aug_tasks.c +38 -7
- package/runtime/aug_values.c +12 -6
- package/scripts/bootstrap-native.mjs +184 -106
- package/scripts/native-setup.mjs +98 -0
- package/scripts/native-toolchain.mjs +28 -0
- package/src/ast.js +1 -1
- package/src/builtins.js +1 -1
- package/src/checker.js +369 -100
- package/src/cli.js +198 -26
- package/src/codegen.js +32 -7
- package/src/compiler-packs.js +66 -0
- package/src/config.js +3 -3
- package/src/contracts.js +10 -0
- package/src/editor.js +86 -22
- package/src/fixes.js +90 -2
- package/src/formatter.js +23 -10
- package/src/git-http.js +137 -0
- package/src/git-packages.js +118 -0
- package/src/help.js +33 -24
- package/src/http-contracts.js +14 -0
- package/src/http-policies.js +5 -5
- package/src/ir-types.js +5 -0
- package/src/ir-verify.js +277 -0
- package/src/ir.js +962 -0
- package/src/libraries.js +1 -1
- package/src/llvm-debug.js +101 -0
- package/src/llvm-native.js +152 -0
- package/src/llvm-platform.js +20 -0
- package/src/llvm.js +781 -0
- package/src/lsp.js +14 -5
- package/src/native-artifacts.js +207 -0
- package/src/native-bindings.js +189 -0
- package/src/native-contracts.js +295 -0
- package/src/native-declarations.js +68 -0
- package/src/native-facts.js +63 -0
- package/src/native.js +19 -13
- package/src/navigation.js +4 -2
- package/src/openapi.js +5 -4
- package/src/package-locking.js +88 -0
- package/src/package-manager.js +267 -68
- package/src/parser.js +32 -6
- package/src/policies.js +3 -3
- package/src/project-init.js +78 -4
- package/src/project.js +11 -9
- package/src/runtime-abi.js +23 -0
- package/src/runtime-adapters.js +18 -0
- package/src/schemas.js +24 -17
- package/src/semantic.js +54 -5
- package/src/snippets.js +60 -0
- package/src/spec-hints.js +56 -0
- package/src/spec-tree.js +241 -0
- package/src/spec.js +669 -305
- package/docs/examples/approved-design/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/developer-workflow/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/generic-di/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/hello/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/interceptors/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/json-benchmark/dependencies/august/0.19.0/json/contracts.md +0 -103
- package/docs/examples/new-syntax/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/contracts.md +0 -925
- package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/jose.md +0 -434
- package/docs/examples/oidc-login/dependencies/august/0.19.0/json/contracts.md +0 -103
- package/docs/examples/oidc-login/dependencies/august/0.19.0/memory/store.md +0 -374
- package/docs/examples/oidc-login/dependencies/august/0.19.0/time/contracts.md +0 -150
- package/docs/examples/oidc-login/dependencies/august/0.19.0/web/contracts.md +0 -532
- package/docs/examples/ownership-transfer/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/examples/approved-design/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/developer-workflow/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/generic-di/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/hello/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug +0 -36
- package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug +0 -36
- package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/contracts.aug.md +0 -791
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/jose.aug.md +0 -266
- package/examples/oidc-login/.aug-spec/august/0.19.0/json/contracts.aug.md +0 -55
- package/examples/oidc-login/.aug-spec/august/0.19.0/memory/store.aug.md +0 -250
- package/examples/oidc-login/.aug-spec/august/0.19.0/time/contracts.aug.md +0 -96
- package/examples/oidc-login/.aug-spec/august/0.19.0/web/contracts.aug.md +0 -420
- package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug +0 -36
- package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/memory → packages/@git/url_0eb7c89453c87681ed15/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/store.aug +0 -0
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/json → packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/contracts.aug +0 -0
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/web → packages/@git/url_897efafd565158fc4908/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/contracts.aug +0 -0
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/time → packages/@git/url_c092cd151499c4e1d8a1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/contracts.aug +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!-- Generated by aug spec. Edit the August source, then regenerate. -->
|
|
2
|
+
|
|
3
|
+
# `forecasts.aug`
|
|
4
|
+
|
|
5
|
+
Plain handler results default to HTTP 200 unless another status is declared. HttpResponse values choose their own status. Unhandled request failures return HTTP 500 and cancel the request tasks.
|
|
6
|
+
|
|
7
|
+
<a id="symbol-WeatherForecast"></a>
|
|
8
|
+
## `WeatherForecast` · immutable record · [source](forecasts.aug#L3)
|
|
9
|
+
|
|
10
|
+
The JSON shape returned by the forecast endpoint. Temperatures use whole degrees. It takes `date` as a string, kept read-only, `temperatureC` and `temperatureF` as integers, kept read-only, and `summary` as a string, kept read-only.
|
|
11
|
+
|
|
12
|
+
<a id="symbol-weatherForecast"></a>
|
|
13
|
+
## `weatherForecast` · [source](forecasts.aug#L6)
|
|
14
|
+
|
|
15
|
+
`weatherForecast` handles `GET /weatherforecast`. Return five simulated forecasts. Fixed data keeps the example and its tests reproducible. It returns a list of 5 [`WeatherForecast`](forecasts.aug.md#symbol-WeatherForecast) records, with `(date, temperatureC, temperatureF, summary)` values of `("2026-01-01", 0, 32, "Freezing")`, `("2026-01-02", 10, 50, "Cool")`, `("2026-01-03", 20, 68, "Mild")`, `("2026-01-04", 30, 86, "Warm")`, and `("2026-01-05", 35, 95, "Hot")`, in that order.
|
|
16
|
+
|
|
17
|
+
<a id="symbol-test weatherForecast client"></a>
|
|
18
|
+
## `test weatherForecast client` · [source](forecasts.aug#L40)
|
|
19
|
+
|
|
20
|
+
Tests [`weatherForecast`](forecasts.aug.md#symbol-weatherForecast). Each case gets fresh setup and dependencies.
|
|
21
|
+
|
|
22
|
+
### `forecasts`
|
|
23
|
+
|
|
24
|
+
#### `returns_json` · [source](forecasts.aug#L42)
|
|
25
|
+
|
|
26
|
+
It sets `response` to `client.request` with `method` `"GET"` and `path` `"/weatherforecast"`. The test requires `response.status` equals `200`.
|
|
27
|
+
|
|
28
|
+
#### `rejects_other_methods` · [source](forecasts.aug#L45)
|
|
29
|
+
|
|
30
|
+
It sets `response` to `client.request` with `method` `"POST"` and `path` `"/weatherforecast"`. The test requires `response.status` equals `405`.
|
|
31
|
+
|
|
32
|
+
Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Generated by aug spec. Edit the August source, then regenerate. -->
|
|
2
|
+
|
|
3
|
+
# `main.aug`
|
|
4
|
+
|
|
5
|
+
## HTTP configuration
|
|
6
|
+
|
|
7
|
+
Listen on `127.0.0.1`. Limit request bodies to 1048576 bytes and buffered responses to 4194304 bytes. Serve OpenAPI at `/openapi.json` and API docs at `/docs`.
|
|
8
|
+
|
|
9
|
+
## Startup
|
|
10
|
+
|
|
11
|
+
It serves [`weatherForecast`](forecasts.aug.md#symbol-weatherForecast) on port `8787`.
|
|
12
|
+
|
|
13
|
+
## Dependencies
|
|
14
|
+
|
|
15
|
+
It uses [`weatherForecast`](forecasts.aug.md#symbol-weatherForecast) from `forecasts`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": 1,
|
|
3
|
+
"compiler": "0.21.0",
|
|
4
|
+
"llvm": "23.1.2",
|
|
5
|
+
"packs": [
|
|
6
|
+
{
|
|
7
|
+
"host": "darwin-arm64",
|
|
8
|
+
"target": "aarch64-apple-darwin",
|
|
9
|
+
"minimumOS": "14.0",
|
|
10
|
+
"archive": {
|
|
11
|
+
"url": "https://github.com/GreenPandaStudios/augscript/releases/download/v0.21.0/aug-llvm-macos-arm64.tar.gz",
|
|
12
|
+
"sha256": "9bece355945f9747325a8a8111c6feb8b9d7d5658893f7c0896c3d45afc3c97f",
|
|
13
|
+
"maximumDownloadBytes": 217020773,
|
|
14
|
+
"maximumUnpackedBytes": 578904183,
|
|
15
|
+
"fileManifest": "files.json"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"host": "linux-arm64",
|
|
20
|
+
"target": "aarch64-unknown-linux-gnu",
|
|
21
|
+
"minimumLibc": "2.36",
|
|
22
|
+
"archive": {
|
|
23
|
+
"url": "https://github.com/GreenPandaStudios/augscript/releases/download/v0.21.0/aug-llvm-linux-arm64.tar.gz",
|
|
24
|
+
"sha256": "8598fb964cab17fe7a8df76ac331e62ac8081211049f97434792275432d0460d",
|
|
25
|
+
"maximumDownloadBytes": 441560029,
|
|
26
|
+
"maximumUnpackedBytes": 876536211,
|
|
27
|
+
"fileManifest": "files.json"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"host": "linux-x64",
|
|
32
|
+
"target": "x86_64-unknown-linux-gnu",
|
|
33
|
+
"minimumLibc": "2.36",
|
|
34
|
+
"archive": {
|
|
35
|
+
"url": "https://github.com/GreenPandaStudios/augscript/releases/download/v0.21.0/aug-llvm-linux-x64.tar.gz",
|
|
36
|
+
"sha256": "c14f8dc9a69ca3fd05f1c2331e818ab7193011ee96076a7fb6b61b05d6580cbe",
|
|
37
|
+
"maximumDownloadBytes": 448569595,
|
|
38
|
+
"maximumUnpackedBytes": 910219790,
|
|
39
|
+
"fileManifest": "files.json"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@greenpandastudios/aug-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "August compiler, native build CLI, tests and language server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"bin",
|
|
17
17
|
"src",
|
|
18
18
|
"runtime",
|
|
19
|
+
"native",
|
|
19
20
|
"scripts",
|
|
20
21
|
"docs",
|
|
21
22
|
"examples",
|
|
@@ -23,9 +24,8 @@
|
|
|
23
24
|
"THIRD_PARTY_NOTICES.md"
|
|
24
25
|
],
|
|
25
26
|
"dependencies": {
|
|
26
|
-
"@greenpandastudios/aug-stdlib": "0.
|
|
27
|
-
"
|
|
28
|
-
"@greenpandastudios/aug-crypto": "0.19.0"
|
|
27
|
+
"@greenpandastudios/aug-stdlib": "0.21.0",
|
|
28
|
+
"tar": "7.5.22"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public",
|
package/runtime/aug_http.c
CHANGED
|
@@ -23,11 +23,17 @@ typedef struct {
|
|
|
23
23
|
} AugHttpSession;
|
|
24
24
|
struct AugHttpJob {
|
|
25
25
|
struct lws *wsi; AugHttpSession *session; AugValue task;
|
|
26
|
-
/* Request and
|
|
27
|
-
AugValue roots[
|
|
28
|
-
bool test, transport_complete, timed_out; int64_t started,deadline;
|
|
26
|
+
/* Request, loggers and the prepared HEAD response outlive transport cleanup. */
|
|
27
|
+
AugValue roots[3]; AugRetained retained;
|
|
28
|
+
bool test, transport_complete, timed_out, head_complete; int64_t started,deadline;
|
|
29
29
|
};
|
|
30
30
|
static const AugRoute *served_routes;
|
|
31
|
+
static AugValue route_call(const AugRoute *route,AugValue *args,int count) {
|
|
32
|
+
AugValue result=aug_null();
|
|
33
|
+
if(route->pointer_handler)route->pointer_handler(&result,NULL,args,count);
|
|
34
|
+
else result=route->handler(args,count);
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
31
37
|
static size_t served_count;
|
|
32
38
|
static size_t body_limit = 1024 * 1024;
|
|
33
39
|
static size_t response_limit = 4 * 1024 * 1024;
|
|
@@ -93,6 +99,14 @@ AugValue aug_headers_with(AugValue headers, AugValue name, AugValue value) {
|
|
|
93
99
|
header_add(result, name.as.object->text, name.as.object->text_length, value.as.object->text, value.as.object->text_length);
|
|
94
100
|
aug_freeze(result); aug_release(&retained); aug_frame_leave(&frame); return result;
|
|
95
101
|
}
|
|
102
|
+
static AugValue headers_with_name(AugValue headers, const char *name, AugValue value) {
|
|
103
|
+
/* Root the value before allocating the name: either allocation can collect. */
|
|
104
|
+
AugValue roots[3] = {headers, value, aug_null()};
|
|
105
|
+
AugFrame frame; aug_frame_enter(&frame, roots, 3);
|
|
106
|
+
roots[2] = aug_string(name);
|
|
107
|
+
AugValue result = aug_headers_with(roots[0], roots[2], roots[1]);
|
|
108
|
+
aug_frame_leave(&frame); return result;
|
|
109
|
+
}
|
|
96
110
|
AugValue aug_headers_get(AugValue headers, AugValue name) {AugValue value = header_get(headers, aug_cstring(name), false); return value.tag == AUG_NULL ? aug_null() : value;}
|
|
97
111
|
AugValue aug_headers_all(AugValue headers, AugValue name) {
|
|
98
112
|
AugValue result = aug_list_new(NULL, 0); AugFrame frame; aug_frame_enter(&frame, &result, 1); AugValue entries = aug_field(headers, 0);
|
|
@@ -165,7 +179,7 @@ static const AugRoute *select_route(AugValue request, const AugRoute *routes, si
|
|
|
165
179
|
for(size_t layer=0;layer<routes[i].policy_count;layer++)if(routes[i].policies[layer].kind==AUG_HTTP_POLICY_CORS){
|
|
166
180
|
AugValue headers=aug_headers_new();AugFrame frame;aug_frame_enter(&frame,&headers,1);
|
|
167
181
|
if(cors_apply(&routes[i].policies[layer],request,&headers,true)) {
|
|
168
|
-
headers=
|
|
182
|
+
headers=headers_with_name(headers,"access-control-allow-methods",requested);
|
|
169
183
|
*failure=aug_http_response_full(aug_null(),aug_int(204),headers);
|
|
170
184
|
}else {int status=aug_has_error?aug_http_error_status():403;if(aug_has_error)aug_take_error();*failure=aug_http_problem(status);}
|
|
171
185
|
aug_frame_leave(&frame);return NULL;
|
|
@@ -255,9 +269,9 @@ static bool cors_apply(const AugHttpPolicy *policy,AugValue request,AugValue *he
|
|
|
255
269
|
AugValue origin=header_get(aug_field(request,2),"origin",true);if(aug_has_error)return false;if(origin.tag==AUG_NULL)return !preflight;
|
|
256
270
|
const char *name=aug_cstring(origin);bool wildcard=listed(policy->origins,"*");
|
|
257
271
|
if(!wildcard&&!listed(policy->origins,name)){request_error("HttpForbidden");return false;}
|
|
258
|
-
*headers=
|
|
259
|
-
*headers=
|
|
260
|
-
if(policy->credentials)*headers=
|
|
272
|
+
*headers=headers_with_name(*headers,"access-control-allow-origin",wildcard?aug_string("*"):origin);
|
|
273
|
+
*headers=headers_with_name(*headers,"vary",aug_string("Origin"));
|
|
274
|
+
if(policy->credentials)*headers=headers_with_name(*headers,"access-control-allow-credentials",aug_string("true"));
|
|
261
275
|
if(preflight) {
|
|
262
276
|
AugValue asked=header_get(aug_field(request,2),"access-control-request-headers",true);if(aug_has_error)return false;
|
|
263
277
|
if(asked.tag==AUG_STRING){char *copy=strdup(aug_cstring(asked));if(!copy)abort();char *save=NULL;
|
|
@@ -265,7 +279,7 @@ static bool cors_apply(const AugHttpPolicy *policy,AugValue request,AugValue *he
|
|
|
265
279
|
bool found=false;const char *allowed=policy->headers;while(*allowed){const char *end=strchr(allowed,',');if(!end)end=allowed+strlen(allowed);if((size_t)(end-allowed)==size&&!strncasecmp(allowed,part,size))found=true;allowed=*end?end+1:end;while(*allowed==' ')allowed++;}
|
|
266
280
|
if(!size||!found){free(copy);request_error("HttpForbidden");return false;}}
|
|
267
281
|
free(copy);}
|
|
268
|
-
*headers=
|
|
282
|
+
*headers=headers_with_name(*headers,"access-control-allow-headers",aug_string(policy->headers));
|
|
269
283
|
}
|
|
270
284
|
return !aug_has_error;
|
|
271
285
|
}
|
|
@@ -317,7 +331,7 @@ static AugValue policy_response(AugHttpSession *session,AugValue response) {
|
|
|
317
331
|
if(session->roots[4].tag==AUG_NULL&&!session->compress)return response;
|
|
318
332
|
AugValue roots[2]={response,aug_field(response,2)};AugFrame frame;aug_frame_enter(&frame,roots,2);
|
|
319
333
|
if(session->roots[4].tag==AUG_OBJECT){AugValue entries=aug_field(session->roots[4],0);for(size_t i=0;i<entries.as.object->field_count;i++){AugValue pair=entries.as.object->fields[i];roots[1]=aug_headers_with(roots[1],aug_field(pair,0),aug_field(pair,1));}}
|
|
320
|
-
if(session->compress){roots[1]=
|
|
334
|
+
if(session->compress){roots[1]=headers_with_name(roots[1],"content-encoding",aug_string("gzip"));roots[1]=headers_with_name(roots[1],"vary",aug_string("Accept-Encoding"));}
|
|
321
335
|
AugValue result=aug_http_response_full(aug_field(roots[0],0),aug_field(roots[0],1),roots[1]);aug_frame_leave(&frame);return result;
|
|
322
336
|
}
|
|
323
337
|
AugValue _aug_http_log(AugValue method,AugValue path,AugValue status,AugValue milliseconds) {
|
|
@@ -353,9 +367,9 @@ AugValue aug_httptestclient_request(AugValue client,AugValue method,AugValue tar
|
|
|
353
367
|
if(aug_field(session.roots[0],3).as.object->text_length>body_limit){session.roots[1]=aug_http_problem(413);goto serialize;}
|
|
354
368
|
aug_freeze(session.roots[0]);
|
|
355
369
|
AugHttpJob job={.session=&session,.test=true,.roots={session.roots[0],aug_null()}};
|
|
356
|
-
aug_retain(&job.retained,job.roots,
|
|
370
|
+
aug_retain(&job.retained,job.roots,3);
|
|
357
371
|
void *previous=aug_execution_current()->http_job;bool previous_cancelled=aug_cancelled;aug_execution_current()->http_job=&job;
|
|
358
|
-
session.roots[1]=session.route
|
|
372
|
+
session.roots[1]=route_call(session.route,session.roots,1);aug_execution_current()->http_job=previous;aug_release(&job.retained);
|
|
359
373
|
if(job.timed_out)aug_cancelled=previous_cancelled;
|
|
360
374
|
if(aug_has_error){aug_report_error();aug_take_error();session.roots[1]=aug_http_problem(500);}
|
|
361
375
|
if(session.streaming&&aug_cint(aug_field(session.roots[1],1))>=400){aug_frame_leave(&frame);return request_error("HttpError");}
|
|
@@ -369,7 +383,7 @@ serialize:;
|
|
|
369
383
|
if(session.compress&&!session.streaming)session.roots[2]=gzip_bytes(session.roots[2]);
|
|
370
384
|
if(aug_has_error||session.roots[2].as.object->text_length>response_limit){if(aug_has_error)aug_take_error();session.roots[1]=aug_http_problem(500);status=500;session.roots[2]=aug_json_stringify(aug_field(session.roots[1],0));}
|
|
371
385
|
session.roots[3]=aug_field(session.roots[1],2);
|
|
372
|
-
if(header_get(session.roots[3],"content-type",false).tag==AUG_NULL)session.roots[3]=
|
|
386
|
+
if(header_get(session.roots[3],"content-type",false).tag==AUG_NULL)session.roots[3]=headers_with_name(session.roots[3],"content-type",aug_string(type));
|
|
373
387
|
if(!strcmp(aug_cstring(method),"HEAD")||status==204||status==304)session.roots[2]=aug_bytes("",0,AUG_BYTES_KIND);
|
|
374
388
|
session.roots[1]=aug_http_response_full(session.roots[2],aug_int(status),session.roots[3]);
|
|
375
389
|
AugValue result=session.roots[1];aug_frame_leave(&frame);return result;
|
|
@@ -431,7 +445,7 @@ AugValue aug_http_bind(AugValue request, const char *source, const char *name, c
|
|
|
431
445
|
bool known = false; for (size_t j = 0; j < schema->count; j++) if (!strcmp(aug_cstring(map.as.object->fields[i]), schema->names[j])) known = true;
|
|
432
446
|
if (!known) request_error("HttpBadRequest");
|
|
433
447
|
}
|
|
434
|
-
AugValue result = aug_has_error ? aug_null() : schema
|
|
448
|
+
AugValue result = aug_has_error ? aug_null() : aug_schema_make(schema,fields,(int)schema->count);
|
|
435
449
|
aug_frame_leave(&field_frame); free(fields); aug_frame_leave(&frame); return result;
|
|
436
450
|
}
|
|
437
451
|
if (!strcmp(source, "body")) {
|
|
@@ -484,7 +498,7 @@ static void cleanup(AugHttpSession *session) {
|
|
|
484
498
|
free(session->body); memset(session, 0, sizeof(*session));
|
|
485
499
|
}
|
|
486
500
|
static AugValue request_task(AugValue self, AugValue *args, int count) {
|
|
487
|
-
(void)self; (void)count; aug_execution_current()->http_job=(void *)(intptr_t)aug_cint(args[2]); size_t index = (size_t)aug_cint(args[1]); return served_routes[index]
|
|
501
|
+
(void)self; (void)count; aug_execution_current()->http_job=(void *)(intptr_t)aug_cint(args[2]); size_t index = (size_t)aug_cint(args[1]); return route_call(&served_routes[index],args,1);
|
|
488
502
|
}
|
|
489
503
|
AugValue aug_http_event(AugValue data, AugValue id, AugValue event, AugValue retry) {
|
|
490
504
|
AugValue values[]={data,id,event,retry};
|
|
@@ -522,18 +536,26 @@ void aug_http_yield(AugValue value) {
|
|
|
522
536
|
}
|
|
523
537
|
session->roots[1]=policy_response(session,aug_http_response(aug_null(),session->route->status));session->roots[3]=encoded;session->streaming=true;session->stream_pending=true;session->sent=0;
|
|
524
538
|
lws_callback_on_writable(job->wsi);
|
|
525
|
-
if(session->head){session->stream_pending=false;aug_cancelled=true;goto finished;}
|
|
539
|
+
if(session->head){session->stream_pending=false;job->roots[2]=session->roots[1];job->head_complete=true;aug_cancelled=true;goto finished;}
|
|
526
540
|
while(job->session&&job->session->stream_pending&&!aug_cancelled)aug_task_suspend();
|
|
527
541
|
finished:
|
|
528
542
|
aug_frame_leave(&frame);
|
|
529
543
|
}
|
|
544
|
+
bool aug_http_head_response(AugValue *response) {
|
|
545
|
+
AugHttpJob *job=aug_execution_current()->http_job;
|
|
546
|
+
if(!aug_cancelled||aug_has_error||!job||!job->head_complete||job->timed_out||(!job->session&&!job->transport_complete))return false;
|
|
547
|
+
/* The first yield already established this response. Cancellation stops the
|
|
548
|
+
producer and its children; it is not an error or a client disconnect. */
|
|
549
|
+
*response=job->roots[2];return response->tag==AUG_OBJECT;
|
|
550
|
+
}
|
|
530
551
|
AugValue aug_http_finish(AugValue response) {
|
|
531
552
|
AugHttpJob *job=aug_execution_current()->http_job;if(!job)return response;
|
|
532
553
|
AugHttpSession *session=job->session;AugValue roots[3]={response,job->roots[1],job->roots[0]};AugFrame frame;aug_frame_enter(&frame,roots,3);
|
|
533
554
|
if(job->timed_out)roots[0]=aug_http_problem(504);
|
|
534
555
|
else if(job->test&&job->deadline&&monotonic_ms()>=job->deadline)roots[0]=aug_http_problem(504);
|
|
535
556
|
if(session) {
|
|
536
|
-
roots[0]
|
|
557
|
+
bool prepared_head=job->head_complete&&roots[0].tag==AUG_OBJECT&&session->roots[1].tag==AUG_OBJECT&&roots[0].as.object==session->roots[1].as.object;
|
|
558
|
+
if(!prepared_head)roots[0]=policy_response(session,roots[0]);
|
|
537
559
|
bool stream_success=session->route->stream&&aug_cint(aug_field(roots[0],1))<400;
|
|
538
560
|
if(job->test&&stream_success&&!session->streaming) {
|
|
539
561
|
session->roots[2]=aug_bytes("",0,AUG_BYTES_KIND);
|
|
@@ -548,10 +570,12 @@ AugValue aug_http_finish(AugValue response) {
|
|
|
548
570
|
else session->streaming=false;
|
|
549
571
|
lws_callback_on_writable(job->wsi);
|
|
550
572
|
}
|
|
551
|
-
while(job->session&&!job->transport_complete&&!
|
|
573
|
+
while(job->session&&!job->transport_complete&&(!aug_cancelled||(job->head_complete&&!job->timed_out)))aug_task_suspend();
|
|
552
574
|
}
|
|
553
575
|
}
|
|
554
|
-
|
|
576
|
+
/* A deadline may have fired while finish was suspended on transport. */
|
|
577
|
+
if(job->timed_out)roots[0]=aug_http_problem(504);
|
|
578
|
+
int status=aug_cancelled&&!job->timed_out&&(!job->head_complete||!job->transport_complete)?499:(int)aug_cint(aug_field(roots[0],1));
|
|
555
579
|
bool cancelled=aug_cancelled;aug_cancelled=false;aug_execution_current()->http_job=NULL;
|
|
556
580
|
if(roots[1].tag==AUG_OBJECT)for(size_t i=roots[1].as.object->field_count;i>0;i--){
|
|
557
581
|
AugValue arguments[]={aug_field(roots[2],0),aug_field(roots[2],1),aug_int(status),aug_int(monotonic_ms()-job->started)};
|
|
@@ -582,7 +606,7 @@ static void dispatch(struct lws *wsi, AugHttpSession *session) {
|
|
|
582
606
|
if (!session->route) {session->roots[1] = aug_http_problem(404); lws_callback_on_writable(wsi); return;}
|
|
583
607
|
AugHttpJob *job = calloc(1, sizeof(*job)); if (!job) return;
|
|
584
608
|
job->wsi = wsi; job->session = session; session->job = job;job->started=monotonic_ms();
|
|
585
|
-
job->roots[0]=session->roots[0];aug_retain(&job->retained,job->roots,
|
|
609
|
+
job->roots[0]=session->roots[0];aug_retain(&job->retained,job->roots,3);
|
|
586
610
|
AugValue arguments[3] = {session->roots[0], aug_int(session->route - served_routes),aug_int((int64_t)(intptr_t)job)};
|
|
587
611
|
job->task = aug_task_spawn(request_task, aug_null(), arguments, 3, request_complete, job);
|
|
588
612
|
}
|
|
@@ -660,8 +684,11 @@ static int callback_http(struct lws *wsi, enum lws_callback_reasons reason, void
|
|
|
660
684
|
snprintf(name, sizeof(name), "%s:", label.as.object->text);
|
|
661
685
|
if (lws_add_http_header_by_name(wsi, (unsigned char *)name, (unsigned char *)value.as.object->text, (int)value.as.object->text_length, &next, end)) return -1;
|
|
662
686
|
}
|
|
663
|
-
|
|
664
|
-
|
|
687
|
+
enum lws_write_protocol flags=LWS_WRITE_HTTP_HEADERS|(session->head?LWS_WRITE_H2_STREAM_END:0);
|
|
688
|
+
if (lws_finalize_write_http_header_flags(wsi, start, &next, end, flags)) return -1;
|
|
689
|
+
session->headers_sent = true;
|
|
690
|
+
if(session->head){if(session->job)session->job->transport_complete=true;cleanup(session);return lws_http_transaction_completed(wsi)?-1:0;}
|
|
691
|
+
lws_callback_on_writable(wsi); return 0;
|
|
665
692
|
}
|
|
666
693
|
if(session->streaming&&!session->stream_pending&&!session->stream_done)return 0;
|
|
667
694
|
AugValue encoded = session->streaming&&session->stream_pending?session->roots[3]:session->roots[2]; size_t remaining = session->head ? 0 : encoded.as.object->text_length - session->sent;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#include "aug_http_ir.h"
|
|
2
|
+
void aug_ir_http_operation(AugValue *out,int op,AugValue *a,int count,const char *text,int64_t number) {
|
|
3
|
+
(void)number;*out=aug_null();
|
|
4
|
+
switch(op){
|
|
5
|
+
case AUG_IR_HTTP_HEADERS:*out=aug_headers_new();break;
|
|
6
|
+
case AUG_IR_HTTP_HEADERS_WITH:*out=aug_headers_with(a[0],a[1],a[2]);break;
|
|
7
|
+
case AUG_IR_HTTP_HEADERS_GET:*out=aug_headers_get(a[0],a[1]);break;
|
|
8
|
+
case AUG_IR_HTTP_HEADERS_ALL:*out=aug_headers_all(a[0],a[1]);break;
|
|
9
|
+
case AUG_IR_HTTP_RESPONSE:*out=aug_http_response_full(a[0],a[1],a[2]);break;
|
|
10
|
+
case AUG_IR_HTTP_RESPONSE_STATUS:*out=aug_http_response(a[0],(int)aug_cint(a[1]));break;
|
|
11
|
+
case AUG_IR_HTTP_FINISH:*out=aug_http_finish(a[0]);break;
|
|
12
|
+
case AUG_IR_HTTP_EVENT:*out=aug_http_event(a[0],a[1],a[2],a[3]);break;
|
|
13
|
+
case AUG_IR_HTTP_YIELD:aug_http_yield(a[0]);break;
|
|
14
|
+
case AUG_IR_HTTP_CLIENT_REQUEST:*out=aug_httptestclient_request(a[0],a[1],a[2],a[3],a[4]);break;
|
|
15
|
+
case AUG_IR_HTTP_ACTION:*out=aug_http_action(text,a,(size_t)count);break;
|
|
16
|
+
default:aug_error_named("NativeContractError");break;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
void aug_ir_http_bind(AugValue *out,const AugValue *request,const char *source,const char *name,const AugSchema *schema){*out=aug_http_bind(*request,source,name,schema);}
|
|
20
|
+
void aug_ir_http_form(AugValue *out,const AugValue *request,const AugSchema *schema){*out=aug_httprequest_form(*request,schema);}
|
|
21
|
+
void aug_ir_http_policy(const AugHttpPolicy *policy,AugValue *args){aug_http_policy(policy,args[0],args[1],args[2]);}
|
|
22
|
+
void aug_ir_http_failure(AugValue *out,const AugIrHttpError *errors,int count){
|
|
23
|
+
if(aug_http_head_response(out))return;
|
|
24
|
+
int status=aug_http_error_status();
|
|
25
|
+
for(int i=0;i<count;i++)if(aug_error_is(errors[i].type))status=errors[i].status;
|
|
26
|
+
if(status==500)aug_report_error();aug_take_error();*out=aug_http_problem(status);
|
|
27
|
+
}
|
|
28
|
+
void aug_ir_http_test_client(AugValue *out,const AugRoute *routes,int count){*out=aug_http_test_client(routes,(size_t)count);}
|
|
29
|
+
void aug_ir_http_serve(const AugRoute *routes,int count,const AugValue *port){aug_http_serve(routes,(size_t)count,aug_cint(*port));}
|
|
30
|
+
void aug_ir_html(AugValue *out,const char *tag,AugValue *attributes,int count,AugValue *children,int child_count){*out=aug_html_element(tag,attributes,(size_t)count,children,(size_t)child_count);}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#ifndef AUG_HTTP_IR_H
|
|
2
|
+
#define AUG_HTTP_IR_H
|
|
3
|
+
#include "aug_ir.h"
|
|
4
|
+
enum AugIrHttpOperation {
|
|
5
|
+
AUG_IR_HTTP_HEADERS=1,AUG_IR_HTTP_HEADERS_WITH,AUG_IR_HTTP_HEADERS_GET,AUG_IR_HTTP_HEADERS_ALL,
|
|
6
|
+
AUG_IR_HTTP_RESPONSE,AUG_IR_HTTP_RESPONSE_STATUS,AUG_IR_HTTP_FINISH,AUG_IR_HTTP_EVENT,
|
|
7
|
+
AUG_IR_HTTP_YIELD,AUG_IR_HTTP_CLIENT_REQUEST,AUG_IR_HTTP_ACTION
|
|
8
|
+
};
|
|
9
|
+
typedef struct {const char *type; int status;} AugIrHttpError;
|
|
10
|
+
void aug_ir_http_operation(AugValue *out,int op,AugValue *args,int count,const char *text,int64_t number);
|
|
11
|
+
void aug_ir_http_bind(AugValue *out,const AugValue *request,const char *source,const char *name,const AugSchema *schema);
|
|
12
|
+
void aug_ir_http_form(AugValue *out,const AugValue *request,const AugSchema *schema);
|
|
13
|
+
void aug_ir_http_policy(const AugHttpPolicy *policy,AugValue *args);
|
|
14
|
+
void aug_ir_http_failure(AugValue *out,const AugIrHttpError *errors,int count);
|
|
15
|
+
void aug_ir_http_test_client(AugValue *out,const AugRoute *routes,int count);
|
|
16
|
+
void aug_ir_http_serve(const AugRoute *routes,int count,const AugValue *port);
|
|
17
|
+
void aug_ir_html(AugValue *out,const char *tag,AugValue *attributes,int count,AugValue *children,int child_count);
|
|
18
|
+
#endif
|
package/runtime/aug_ir.c
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
#include "aug_ir.h"
|
|
2
|
+
#include <limits.h>
|
|
3
|
+
#include <stdlib.h>
|
|
4
|
+
#include <stdio.h>
|
|
5
|
+
|
|
6
|
+
_Static_assert(sizeof(AugValue)==16, "LLVM pack must record its actual AugValue layout");
|
|
7
|
+
_Static_assert(offsetof(AugValue,as)==8, "LLVM pack must record its actual payload offset");
|
|
8
|
+
|
|
9
|
+
void aug_ir_operation(AugValue *out,int op,AugValue *a,int count,const char *text,int64_t n) {
|
|
10
|
+
(void)count; *out=aug_null();
|
|
11
|
+
switch(op) {
|
|
12
|
+
case AUG_IR_PRINT: aug_print(a[0]); break;
|
|
13
|
+
case AUG_IR_BINARY: *out=aug_binary(text,a[0],a[1]); break;
|
|
14
|
+
case AUG_IR_UNARY: *out=aug_unary(text,a[0]); break;
|
|
15
|
+
case AUG_IR_FIELD: *out=aug_field(a[0],(size_t)n); break;
|
|
16
|
+
case AUG_IR_SET_FIELD: aug_set_field(a[0],(size_t)n,a[1]); break;
|
|
17
|
+
case AUG_IR_LIST: *out=aug_list_new(a,(size_t)count); break;
|
|
18
|
+
case AUG_IR_TUPLE: *out=aug_tuple_new(a,(size_t)count); break;
|
|
19
|
+
case AUG_IR_SET: *out=aug_set_new(a,(size_t)count); break;
|
|
20
|
+
case AUG_IR_MAP: *out=aug_map_new(); break;
|
|
21
|
+
case AUG_IR_MAP_SET: aug_map_set(a[0],a[1],a[2]); break;
|
|
22
|
+
case AUG_IR_LIST_LENGTH: *out=aug_int(aug_list_length(a[0])); break;
|
|
23
|
+
case AUG_IR_LIST_GET: *out=aug_list_get(a[0],aug_cint(a[1])); break;
|
|
24
|
+
case AUG_IR_LIST_AT: *out=aug_list_at(a[0],aug_cint(a[1])); break;
|
|
25
|
+
case AUG_IR_LIST_APPEND: aug_list_append(a[0],a[1]); break;
|
|
26
|
+
case AUG_IR_TUPLE_LENGTH: *out=aug_int(aug_tuple_length(a[0])); break;
|
|
27
|
+
case AUG_IR_TUPLE_GET: *out=aug_tuple_get(a[0],aug_cint(a[1])); break;
|
|
28
|
+
case AUG_IR_SET_LENGTH: *out=aug_int(aug_set_length(a[0])); break;
|
|
29
|
+
case AUG_IR_SET_ADD: aug_set_add(a[0],a[1]); break;
|
|
30
|
+
case AUG_IR_SET_CONTAINS: *out=aug_bool(aug_set_contains(a[0],a[1])); break;
|
|
31
|
+
case AUG_IR_MAP_LENGTH: *out=aug_int(aug_map_length(a[0])); break;
|
|
32
|
+
case AUG_IR_MAP_GET: *out=aug_map_get(a[0],a[1]); break;
|
|
33
|
+
case AUG_IR_MAP_TAKE: *out=aug_map_take(a[0],a[1]); break;
|
|
34
|
+
case AUG_IR_MAP_CONTAINS: *out=aug_bool(aug_map_contains(a[0],a[1])); break;
|
|
35
|
+
case AUG_IR_STRING_LENGTH: *out=aug_int(aug_string_length(a[0])); break;
|
|
36
|
+
case AUG_IR_STRING_BYTES: *out=aug_string_bytes(a[0]); break;
|
|
37
|
+
case AUG_IR_STRING_SPLIT: *out=aug_string_split(a[0],a[1]); break;
|
|
38
|
+
case AUG_IR_STRING_STARTS_WITH: *out=aug_bool(aug_string_starts_with(a[0],a[1])); break;
|
|
39
|
+
case AUG_IR_STRING_IS_TOKEN: *out=aug_bool(aug_string_is_token(a[0],aug_cint(a[1]),aug_cint(a[2]))); break;
|
|
40
|
+
case AUG_IR_BYTES_LENGTH: *out=aug_int(aug_bytes_length(a[0])); break;
|
|
41
|
+
case AUG_IR_BYTES_TEXT: *out=aug_bytes_text(a[0]); break;
|
|
42
|
+
case AUG_IR_BYTES_BASE64URL: *out=aug_bytes_base64url(a[0]); break;
|
|
43
|
+
case AUG_IR_BASE64URL_DECODE: *out=aug_base64url_decode(a[0]); break;
|
|
44
|
+
case AUG_IR_C_INT: *out=aug_to_c_int(a[0]); break;
|
|
45
|
+
case AUG_IR_READ_FILE: *out=aug_read_file(a[0]); break;
|
|
46
|
+
case AUG_IR_WRITE_FILE: *out=aug_write_file(a[0],a[1]); break;
|
|
47
|
+
case AUG_IR_ARGUMENTS: *out=aug_arguments(); break;
|
|
48
|
+
case AUG_IR_FREEZE: aug_freeze(a[0]); *out=a[0]; break;
|
|
49
|
+
case AUG_IR_ITER: *out=aug_iter_snapshot(a[0]); break;
|
|
50
|
+
case AUG_IR_MAP_ITER: *out=aug_map_entries_snapshot(a[0]); break;
|
|
51
|
+
case AUG_IR_IS_TYPE: *out=aug_bool(a[0].tag==AUG_OBJECT&&a[0].as.object&&!strcmp(a[0].as.object->type_name,text)); break;
|
|
52
|
+
case AUG_IR_SHARED: *out=aug_shared_new(a[0]); break;
|
|
53
|
+
case AUG_IR_SHARED_LOCK: *out=aug_shared_lock(a[0]); break;
|
|
54
|
+
case AUG_IR_JSON_WRAP: *out=aug_json_wrap(a[0]); break;
|
|
55
|
+
case AUG_IR_JSON_PARSE: *out=_aug_json_parse(a[0]); break;
|
|
56
|
+
case AUG_IR_JSON_STRINGIFY: *out=aug_json_stringify(a[0]); break;
|
|
57
|
+
case AUG_IR_JSON_GET: *out=aug_json_get(a[0],a[1]); break;
|
|
58
|
+
case AUG_IR_JSON_REQUIRE: *out=aug_json_require(a[0],a[1]); break;
|
|
59
|
+
case AUG_IR_JSON_STRING: *out=aug_json_string(a[0]); break;
|
|
60
|
+
case AUG_IR_JSON_INTEGER: *out=aug_int(aug_json_integer(a[0])); break;
|
|
61
|
+
case AUG_IR_JSON_BOOLEAN: *out=aug_bool(aug_json_boolean(a[0])); break;
|
|
62
|
+
case AUG_IR_JSON_ITEMS: *out=aug_json_items(a[0]); break;
|
|
63
|
+
case AUG_IR_TIME_NOW: *out=_aug_time_now(); break;
|
|
64
|
+
case AUG_IR_EXIT: {int64_t status=aug_cint(a[0]);aug_cancelled=true;aug_shutdown();exit(status>=0&&status<=255?(int)status:1);}
|
|
65
|
+
case AUG_IR_TEST_CASE: aug_test_assertions=0;break;
|
|
66
|
+
default: *out=aug_error_named("NativeContractError"); break;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
void aug_ir_json_decode(AugValue *out,const AugValue *value,const AugSchema *schema){*out=aug_json_decode(*value,schema);}
|
|
70
|
+
void aug_ir_print(const AugValue *value){aug_print(*value);}
|
|
71
|
+
void aug_ir_binary(AugValue *out,const char *operation,const AugValue *left,const AugValue *right){*out=aug_binary(operation,*left,*right);}
|
|
72
|
+
void aug_ir_unary(AugValue *out,const char *operation,const AugValue *value){*out=aug_unary(operation,*value);}
|
|
73
|
+
void aug_ir_list_new(AugValue *out,AugValue *items,int count){*out=aug_list_new(items,(size_t)count);}
|
|
74
|
+
void aug_ir_tuple_new(AugValue *out,AugValue *items,int count){*out=aug_tuple_new(items,(size_t)count);}
|
|
75
|
+
void aug_ir_set_new(AugValue *out,AugValue *items,int count){*out=aug_set_new(items,(size_t)count);}
|
|
76
|
+
void aug_ir_map(AugValue *out){*out=aug_map_new();}
|
|
77
|
+
void aug_ir_iter(AugValue *out,const AugValue *value){*out=aug_iter_snapshot(*value);}
|
|
78
|
+
void aug_ir_map_iter(AugValue *out,const AugValue *value){*out=aug_map_entries_snapshot(*value);}
|
|
79
|
+
void aug_ir_list_append(const AugValue *list,const AugValue *value){aug_list_append(*list,*value);}
|
|
80
|
+
int64_t aug_ir_tuple_length(const AugValue *tuple){return aug_tuple_length(*tuple);}
|
|
81
|
+
void aug_ir_tuple_get(AugValue *out,const AugValue *tuple,const AugValue *index){*out=aug_tuple_get(*tuple,aug_cint(*index));}
|
|
82
|
+
int64_t aug_ir_string_length(const AugValue *value){return aug_string_length(*value);}
|
|
83
|
+
void aug_ir_string_bytes(AugValue *out,const AugValue *value){*out=aug_string_bytes(*value);}
|
|
84
|
+
void aug_ir_string_split(AugValue *out,const AugValue *value,const AugValue *separator){*out=aug_string_split(*value,*separator);}
|
|
85
|
+
void aug_ir_map_set(const AugValue *map,const AugValue *key,const AugValue *value){aug_map_set(*map,*key,*value);}
|
|
86
|
+
void aug_ir_set_add(const AugValue *set,const AugValue *value){aug_set_add(*set,*value);}
|
|
87
|
+
uint8_t aug_ir_set_contains(const AugValue *set,const AugValue *value){return aug_set_contains(*set,*value)?1:0;}
|
|
88
|
+
uint8_t aug_ir_map_contains(const AugValue *map,const AugValue *key){return aug_map_contains(*map,*key)?1:0;}
|
|
89
|
+
int64_t aug_ir_list_length(const AugValue *list){return (int64_t)aug_list_length(*list);}
|
|
90
|
+
int64_t aug_ir_set_length(const AugValue *set){return (int64_t)aug_set_length(*set);}
|
|
91
|
+
int64_t aug_ir_map_length(const AugValue *map){return (int64_t)aug_map_length(*map);}
|
|
92
|
+
void aug_ir_list_get(AugValue *out,const AugValue *list,const AugValue *index){*out=aug_list_get(*list,aug_cint(*index));}
|
|
93
|
+
void aug_ir_list_at(AugValue *out,const AugValue *list,const AugValue *index){*out=aug_list_at(*list,aug_cint(*index));}
|
|
94
|
+
void aug_ir_map_get(AugValue *out,const AugValue *map,const AugValue *key){*out=aug_map_get(*map,*key);}
|
|
95
|
+
void aug_ir_map_take(AugValue *out,const AugValue *map,const AugValue *key){*out=aug_map_take(*map,*key);}
|
|
96
|
+
void aug_ir_string(AugValue *out,const void *text,uint64_t count){*out=aug_string_n(text,(size_t)count);}
|
|
97
|
+
void aug_ir_assert(const AugValue *condition,const char *expression,const char *file,int line){aug_assert(*condition,expression,file,line);}
|
|
98
|
+
void aug_ir_drop(AugValue *value){aug_drop(*value);*value=aug_null();}
|
|
99
|
+
void aug_ir_failed_result(AugValue *value){if(aug_has_error){aug_drop_partial(*value);*value=aug_null();}}
|
|
100
|
+
void aug_ir_constructor_result(AugValue *value,const AugValue *result){aug_constructor_result_cleanup(*value,*result);*value=aug_null();}
|
|
101
|
+
void aug_ir_throw(const AugValue *value){aug_throw(*value);}
|
|
102
|
+
void aug_ir_take_error(AugValue *out){*out=aug_take_error();}
|
|
103
|
+
void aug_ir_save_error_state(AugValue *error,AugValue *cancelled){
|
|
104
|
+
*error=aug_has_error?aug_take_error():aug_null();*cancelled=aug_bool(aug_cancelled);aug_cancelled=false;
|
|
105
|
+
}
|
|
106
|
+
void aug_ir_restore_error_state(const AugValue *error,const AugValue *cancelled){
|
|
107
|
+
aug_cancelled=aug_truthy(*cancelled);if(!aug_has_error&&error->tag!=AUG_NULL)aug_throw(*error);
|
|
108
|
+
}
|
|
109
|
+
bool aug_ir_has_error(void){return aug_has_error;}
|
|
110
|
+
void aug_ir_task_wait(AugValue *out,AugValue *tasks,int count){*out=aug_task_wait(tasks,count);}
|
|
111
|
+
bool aug_ir_cancelled(void){return aug_cancelled;}
|
|
112
|
+
uint8_t aug_ir_state(void){
|
|
113
|
+
AugExecution *execution=aug_execution_current();
|
|
114
|
+
return execution->cancelled?1:execution->has_error?2:0;
|
|
115
|
+
}
|
|
116
|
+
bool aug_ir_is_null(const AugValue *value){return value->tag==AUG_NULL;}
|
|
117
|
+
bool aug_ir_truthy(const AugValue *value){return aug_truthy(*value);}
|
|
118
|
+
int64_t aug_ir_integer(const AugValue *value){return aug_cint(*value);}
|
|
119
|
+
double aug_ir_float(const AugValue *value){return aug_cfloat(*value);}
|
|
120
|
+
void aug_ir_frame_enter(AugFrame *frame,AugValue *values,uint64_t count){aug_frame_enter(frame,values,(size_t)count);}
|
|
121
|
+
void aug_ir_method(AugValue *out,const AugValue *self,const char *name,AugValue *args,int count){*out=aug_call_method(*self,name,args,count);}
|
|
122
|
+
void aug_ir_object(AugValue *out,const char *type,uint64_t fields,const unsigned char *owned,const AugMethodEntry *methods,uint64_t method_count,const char *const *names,bool record){
|
|
123
|
+
*out=aug_new_object(type,(size_t)fields,owned,methods,(size_t)method_count);
|
|
124
|
+
out->as.object->field_names=names;if(record)out->as.object->kind=AUG_RECORD_KIND;
|
|
125
|
+
}
|
|
126
|
+
void aug_ir_binding_get(AugValue *out,uint64_t index){*out=aug_binding_get((size_t)index);}
|
|
127
|
+
void aug_ir_binding_set(uint64_t index,const AugValue *value){aug_binding_set((size_t)index,*value);}
|
|
128
|
+
int aug_ir_exit_status(bool test){
|
|
129
|
+
if(aug_has_error){aug_report_error();return 1;}
|
|
130
|
+
if(test&&!aug_test_assertions){fputs("Test executed no assertions\n",stderr);return 1;}
|
|
131
|
+
return aug_test_failed?1:0;
|
|
132
|
+
}
|
|
133
|
+
void *aug_ir_resource_pointer(const AugValue *value,const char *type){
|
|
134
|
+
if(value->tag!=AUG_OBJECT||!value->as.object||value->as.object->kind!=AUG_NATIVE_RESOURCE_KIND||value->as.object->dropped||!value->as.object->native||strcmp(value->as.object->type_name,type)){
|
|
135
|
+
aug_error_named("NativeContractError");return NULL;
|
|
136
|
+
}
|
|
137
|
+
return value->as.object->native;
|
|
138
|
+
}
|
|
139
|
+
void aug_ir_resource(AugValue *out,void *pointer,const char *type,void(*release)(void *)){
|
|
140
|
+
if(!pointer||!release){*out=aug_null();aug_error_named("NativeContractError");return;}
|
|
141
|
+
*out=aug_new_object(type,0,NULL,NULL,0);out->as.object->kind=AUG_NATIVE_RESOURCE_KIND;
|
|
142
|
+
out->as.object->native=pointer;out->as.object->finalize=release;
|
|
143
|
+
}
|
|
144
|
+
void aug_ir_resource_move(AugValue *value){
|
|
145
|
+
if(value->tag==AUG_OBJECT&&value->as.object&&value->as.object->kind==AUG_NATIVE_RESOURCE_KIND){
|
|
146
|
+
value->as.object->native=NULL;value->as.object->finalize=NULL;value->as.object->dropped=true;
|
|
147
|
+
}
|
|
148
|
+
*value=aug_null();
|
|
149
|
+
}
|
|
150
|
+
void aug_ir_contract_error(AugValue *out){*out=aug_null();if(!aug_has_error)aug_error_named("NativeContractError");}
|
|
151
|
+
void aug_ir_native_error(AugValue *out,AugPointerMethod factory,int32_t code,const void *text,uint64_t length){
|
|
152
|
+
if(aug_has_error)return;
|
|
153
|
+
if(!factory){aug_ir_contract_error(out);return;}
|
|
154
|
+
if(length>512||!aug_valid_utf8(text,(size_t)length)){text="Native library returned an invalid error message";length=strlen(text);}
|
|
155
|
+
if(!length){text="Native call rejected its input or supplied no error message";length=strlen(text);}
|
|
156
|
+
AugValue roots[3]={0};AugFrame frame;aug_frame_enter(&frame,roots,3);
|
|
157
|
+
roots[0]=aug_int(code);roots[1]=aug_string_n(text,(size_t)length);
|
|
158
|
+
factory(&roots[2],NULL,roots,2);
|
|
159
|
+
if(!aug_has_error)aug_throw(roots[2]);aug_frame_leave(&frame);
|
|
160
|
+
}
|
|
161
|
+
bool aug_ir_data(const AugValue *v,const void **data,uint64_t *count){
|
|
162
|
+
*data=NULL;*count=0;
|
|
163
|
+
if((v->tag!=AUG_STRING&&v->tag!=AUG_OBJECT)||!v->as.object||v->as.object->dropped||(v->tag==AUG_OBJECT&&v->as.object->kind!=AUG_BYTES_KIND)){
|
|
164
|
+
aug_error_named("NativeContractError");return false;
|
|
165
|
+
}
|
|
166
|
+
*data=v->as.object->text;*count=v->as.object->text_length;return true;
|
|
167
|
+
}
|
|
168
|
+
bool aug_ir_floats(const AugValue *v,double **data,uint64_t *count){
|
|
169
|
+
*data=NULL;*count=0;
|
|
170
|
+
if(v->tag!=AUG_OBJECT||!v->as.object||v->as.object->kind!=AUG_LIST_KIND||v->as.object->dropped||v->as.object->field_count>SIZE_MAX/sizeof(double)){
|
|
171
|
+
aug_error_named("NativeContractError");return false;
|
|
172
|
+
}
|
|
173
|
+
size_t n=v->as.object->field_count;double *items=malloc((n?n:1)*sizeof(double));
|
|
174
|
+
if(!items){aug_error_named("NativeContractError");return false;}
|
|
175
|
+
for(size_t i=0;i<n;i++){
|
|
176
|
+
AugValue item=v->as.object->fields[i];if(item.tag!=AUG_FLOAT&&item.tag!=AUG_INT){free(items);aug_error_named("NativeContractError");return false;}
|
|
177
|
+
items[i]=item.tag==AUG_FLOAT?item.as.floating:(double)item.as.integer;
|
|
178
|
+
}
|
|
179
|
+
*data=items;*count=n;return true;
|
|
180
|
+
}
|
|
181
|
+
bool aug_ir_strings(const AugValue *v,const void ***data,uint64_t **lengths,uint64_t *count){
|
|
182
|
+
*data=NULL;*lengths=NULL;*count=0;
|
|
183
|
+
if(v->tag!=AUG_OBJECT||!v->as.object||v->as.object->kind!=AUG_LIST_KIND||v->as.object->dropped||v->as.object->field_count>SIZE_MAX/sizeof(uint64_t)){
|
|
184
|
+
aug_error_named("NativeContractError");return false;
|
|
185
|
+
}
|
|
186
|
+
size_t n=v->as.object->field_count;const void **items=calloc(n?n:1,sizeof(void *));uint64_t *sizes=calloc(n?n:1,sizeof(uint64_t));
|
|
187
|
+
if(!items||!sizes){free(items);free(sizes);aug_error_named("NativeContractError");return false;}
|
|
188
|
+
for(size_t i=0;i<n;i++){
|
|
189
|
+
AugValue item=v->as.object->fields[i];if(item.tag!=AUG_STRING||!item.as.object||item.as.object->dropped){free(items);free(sizes);aug_error_named("NativeContractError");return false;}
|
|
190
|
+
items[i]=item.as.object->text;sizes[i]=item.as.object->text_length;
|
|
191
|
+
}
|
|
192
|
+
*data=items;*lengths=sizes;*count=n;return true;
|
|
193
|
+
}
|
|
194
|
+
void aug_ir_free(void *memory){free(memory);}
|
|
195
|
+
void aug_ir_copy_bytes(AugValue *out,const void *bytes,uint64_t count){
|
|
196
|
+
if(count>SIZE_MAX-1||(!bytes&&count)){*out=aug_error_named("NativeContractError");return;}
|
|
197
|
+
*out=aug_bytes(bytes,(size_t)count,AUG_BYTES_KIND);
|
|
198
|
+
}
|
|
199
|
+
void aug_ir_copy_utf8(AugValue *out,const void *text,uint64_t count){
|
|
200
|
+
if(count>SIZE_MAX-1||!aug_valid_utf8(text,(size_t)count)){*out=aug_error_named("NativeContractError");return;}
|
|
201
|
+
*out=aug_string_n(text,(size_t)count);
|
|
202
|
+
}
|
|
203
|
+
void aug_ir_copy_bool(AugValue *out,uint8_t value){*out=value>1?aug_error_named("NativeContractError"):aug_bool(value!=0);}
|
|
204
|
+
void aug_ir_copy_floats(AugValue *out,const double *values,uint64_t count){
|
|
205
|
+
if(count>SIZE_MAX/sizeof(AugValue)||(!values&&count)){*out=aug_error_named("NativeContractError");return;}
|
|
206
|
+
AugValue *items=malloc((count?count:1)*sizeof(AugValue));if(!items){*out=aug_error_named("NativeContractError");return;}
|
|
207
|
+
for(uint64_t i=0;i<count;i++)items[i]=aug_float(values[i]);
|
|
208
|
+
*out=aug_list_new(items,(size_t)count);free(items);
|
|
209
|
+
}
|