@nova-energy/openamx 0.0.0-stage → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMMERCIAL-LICENSE.md +74 -0
- package/LICENSE.md +660 -0
- package/README.md +513 -2
- package/dist/ast/types.js +2 -0
- package/dist/cli.js +186 -0
- package/dist/diagnostics/errors.js +94 -0
- package/dist/editor/completion.js +313 -0
- package/dist/editor/highlighting.js +224 -0
- package/dist/editor/moduleAnalysis.js +206 -0
- package/dist/editor/refactoring.js +46 -0
- package/dist/editor/sourceRanges.js +50 -0
- package/dist/editor/symbols.js +203 -0
- package/dist/formatter/formatAmx.js +79 -0
- package/dist/index.js +10 -0
- package/dist/parser/parseDocument.js +114 -0
- package/dist/parser/parseExpression.js +768 -0
- package/dist/parser/parseFor.js +53 -0
- package/dist/parser/parseFrontMatter.js +65 -0
- package/dist/parser/parseStatements.js +667 -0
- package/dist/parser/stringScanner.js +71 -0
- package/dist/renderer/chartModel.js +476 -0
- package/dist/renderer/renderHtml.js +383 -0
- package/dist/renderer/reportDocx.js +163 -0
- package/dist/renderer/reportPdf.js +202 -0
- package/dist/renderer/reportPreparation.js +208 -0
- package/dist/runtime/csvTextSerialization.js +8 -0
- package/dist/runtime/dataText.js +191 -0
- package/dist/runtime/docxDestination.js +55 -0
- package/dist/runtime/environment.js +105 -0
- package/dist/runtime/evaluateDocument.js +32 -0
- package/dist/runtime/evaluateExpression.js +888 -0
- package/dist/runtime/externalUnits.js +91 -0
- package/dist/runtime/inputData.js +508 -0
- package/dist/runtime/measurement.js +110 -0
- package/dist/runtime/moduleLoader.js +279 -0
- package/dist/runtime/outputData.js +303 -0
- package/dist/runtime/pdfDestination.js +57 -0
- package/dist/runtime/standardLibrary.js +145 -0
- package/dist/typechecker/checkDocument.js +1282 -0
- package/dist/typechecker/declarationRegistry.js +7 -0
- package/dist/typechecker/dimensionTypes.js +1 -0
- package/package.json +33 -4
package/README.md
CHANGED
|
@@ -1,3 +1,514 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OpenAMX
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
OpenAMX is a text-based format and toolset for **computable documents**. It
|
|
6
|
+
combines Markdown narrative with executable `amx` code blocks and inline
|
|
7
|
+
`{{ expressions }}` so a document can explain an analysis and calculate its
|
|
8
|
+
results in one readable, versionable file.
|
|
9
|
+
|
|
10
|
+
The core is domain-neutral: authors define calculations and data structures for
|
|
11
|
+
their own work. Optional libraries and examples demonstrate asset-management
|
|
12
|
+
workflows, but OpenAMX does not prescribe a risk model or certify domain rules.
|
|
13
|
+
|
|
14
|
+
## What You Can Do
|
|
15
|
+
|
|
16
|
+
- Write narrative reports with executable calculations, reusable local modules,
|
|
17
|
+
typed records and pure functions.
|
|
18
|
+
- Read local JSON and CSV data through declared logical inputs, validate it
|
|
19
|
+
against document types, and export named results as JSON or CSV.
|
|
20
|
+
- Add data tables and charts to a document, then render the narrative,
|
|
21
|
+
calculations and views together.
|
|
22
|
+
- Create standalone HTML reports, or export offline PDF and editable DOCX
|
|
23
|
+
reports.
|
|
24
|
+
- Author in the desktop workbench or use OpenAMX language features in VS Code.
|
|
25
|
+
- Run the TypeScript-based engine and command-line tools in local workflows.
|
|
26
|
+
|
|
27
|
+
## A Small Example
|
|
28
|
+
|
|
29
|
+
Save this as `analysis.amx`:
|
|
30
|
+
|
|
31
|
+
````markdown
|
|
32
|
+
# Review
|
|
33
|
+
|
|
34
|
+
The adjusted score is {{ score }}.
|
|
35
|
+
|
|
36
|
+
```amx
|
|
37
|
+
let score = 10
|
|
38
|
+
score += 5
|
|
39
|
+
```
|
|
40
|
+
````
|
|
41
|
+
|
|
42
|
+
Only exact, case-sensitive `amx` fenced blocks execute. Markdown remains
|
|
43
|
+
narrative, and inline expressions resolve using the document's evaluated
|
|
44
|
+
results.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
OpenAMX has three independent components. Install whichever you need; release
|
|
49
|
+
downloads are on the [GitHub releases page](https://github.com/NovaEnergyConsulting/openamx/releases).
|
|
50
|
+
Release builds are unsigned, so your operating system may show a warning before
|
|
51
|
+
installing them.
|
|
52
|
+
|
|
53
|
+
### Command-line tool (CLI)
|
|
54
|
+
|
|
55
|
+
The CLI is published to npm as `@nova-energy/openamx` and runs on
|
|
56
|
+
[Bun](https://bun.sh/) 1.0 or newer. Node.js and Deno are not supported.
|
|
57
|
+
|
|
58
|
+
1. Install Bun by following the instructions at [bun.sh](https://bun.sh/).
|
|
59
|
+
2. Install the CLI globally:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
bun add -g @nova-energy/openamx
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
3. Check the installation:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
openamx --version
|
|
69
|
+
openamx --help
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
To run it once without installing, use
|
|
73
|
+
`bunx @nova-energy/openamx render analysis.amx`. Installing with
|
|
74
|
+
`npm install -g @nova-energy/openamx` also works, provided Bun is on your
|
|
75
|
+
`PATH`. To remove it, run `bun remove -g @nova-energy/openamx`.
|
|
76
|
+
|
|
77
|
+
### Desktop application
|
|
78
|
+
|
|
79
|
+
Download the installer for your platform from the
|
|
80
|
+
[releases page](https://github.com/NovaEnergyConsulting/openamx/releases). The
|
|
81
|
+
installed application includes its own runtime; you do not need Bun or Node.js.
|
|
82
|
+
|
|
83
|
+
- **Linux (x64):** download `OpenAMX-Desktop-<version>-linux-x64.tar.gz`, then
|
|
84
|
+
extract it and run the installer:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
mkdir openamx-setup
|
|
88
|
+
tar -xzf OpenAMX-Desktop-<version>-linux-x64.tar.gz -C openamx-setup
|
|
89
|
+
cd openamx-setup && ./installer
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The application uses your system's WebKitGTK 4.1 and GTK libraries; install
|
|
93
|
+
them with your distribution's package manager if they are missing. To
|
|
94
|
+
uninstall, run `uninstall --quiet` from the application's data directory
|
|
95
|
+
(`~/.local/share/dev.openamx.desktop/stable/`). Your project documents are
|
|
96
|
+
not removed.
|
|
97
|
+
- **Windows:** download the Setup `.zip`, extract it, and run the Setup
|
|
98
|
+
program it contains.
|
|
99
|
+
- **macOS:** download the `.dmg`, open it, and follow the installer.
|
|
100
|
+
|
|
101
|
+
Windows and macOS builds have not yet been formally verified. See the
|
|
102
|
+
[desktop guide](desktop-app/README.md) for details.
|
|
103
|
+
|
|
104
|
+
### VS Code extension
|
|
105
|
+
|
|
106
|
+
The extension requires VS Code 1.85.0 or newer. It is not yet on the Visual
|
|
107
|
+
Studio Marketplace, so install it from the VSIX file:
|
|
108
|
+
|
|
109
|
+
1. Download `openamx-vscode-<version>.vsix` from the
|
|
110
|
+
[releases page](https://github.com/NovaEnergyConsulting/openamx/releases).
|
|
111
|
+
2. Install it from a terminal:
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
code --install-extension openamx-vscode-<version>.vsix
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Or, in VS Code, open the Extensions view, choose **...** >
|
|
118
|
+
**Install from VSIX...**, and select the downloaded file.
|
|
119
|
+
3. Open any `.amx` file to activate syntax highlighting, formatting,
|
|
120
|
+
completion and diagnostics.
|
|
121
|
+
|
|
122
|
+
To build any component from source instead, see [Get Started](#get-started)
|
|
123
|
+
and the [desktop](desktop-app/README.md) and [extension](vscode-extension/README.md)
|
|
124
|
+
guides.
|
|
125
|
+
|
|
126
|
+
## Get Started
|
|
127
|
+
|
|
128
|
+
Install [Bun](https://bun.sh/), then install dependencies and build from the
|
|
129
|
+
repository root:
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
bun install
|
|
133
|
+
bun run build
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Run a document, render it to standalone HTML, or export a report:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
bun run dist/cli.js run examples/hello-world.amx
|
|
140
|
+
bun run dist/cli.js render examples/hello-world.amx --out hello-world.html
|
|
141
|
+
bun run dist/cli.js export pdf examples/typed-asset-analysis.amx --out analysis.pdf \
|
|
142
|
+
--input asset=examples/typed-asset.json \
|
|
143
|
+
--input screenings=examples/typed-screenings.csv \
|
|
144
|
+
--input reviewedAt=examples/typed-reviewed-at.json
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The `run` command prints evaluated bindings as JSON. `render` produces a
|
|
148
|
+
standalone HTML document; `export` supports `pdf` and `docx`. Data inputs are
|
|
149
|
+
explicitly mapped with `--input name=path`. See `bun run dist/cli.js --help` for
|
|
150
|
+
the available commands and options.
|
|
151
|
+
|
|
152
|
+
Charts are interactive in standalone HTML and the desktop live preview; their
|
|
153
|
+
runtime is bundled, so reports work offline. PDF charts are static, and the
|
|
154
|
+
complete chart data remains in report tables. DOCX chart behavior is unchanged.
|
|
155
|
+
|
|
156
|
+
Run the test suite with:
|
|
157
|
+
|
|
158
|
+
```sh
|
|
159
|
+
bun test
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Tooling
|
|
163
|
+
|
|
164
|
+
- **Desktop workbench:** local project browsing, AMX editing and analysis, live
|
|
165
|
+
preview, structured JSON/CSV editing, input mapping, and HTML/PDF/DOCX export.
|
|
166
|
+
See the [desktop guide](desktop-app/README.md).
|
|
167
|
+
- **VS Code extension:** formatting, completion, diagnostics, hover, navigation,
|
|
168
|
+
symbols, references, and code actions. See the
|
|
169
|
+
[extension guide](vscode-extension/README.md).
|
|
170
|
+
- **CLI:** evaluate documents, render HTML, and export PDF or DOCX reports.
|
|
171
|
+
|
|
172
|
+
## Examples and Specifications
|
|
173
|
+
|
|
174
|
+
Start with [Hello OpenAMX](examples/hello-world.amx) for the document basics.
|
|
175
|
+
Other [examples](examples/) show calculations, tables and charts, typed JSON/CSV
|
|
176
|
+
inputs, local modules, and JSON/CSV outputs. The Asset Management schemas are
|
|
177
|
+
opt-in examples, not domain-certified standards.
|
|
178
|
+
|
|
179
|
+
The [V0.9 language specification](docs/language-spec-v0.9.md) documents the
|
|
180
|
+
current language and compatibility contract. See the [V0.9 migration guide](docs/migrating-to-v0.9.md)
|
|
181
|
+
for the three approved compatibility changes. Earlier specifications describe
|
|
182
|
+
the language's evolution: [V0.5](docs/language-spec-v0.5.md),
|
|
183
|
+
[V0.2](docs/language-spec-v0.2.md),
|
|
184
|
+
[V0.3](docs/language-spec-v0.3.md), and [V0.4](docs/language-spec-v0.4.md).
|
|
185
|
+
|
|
186
|
+
## Design Boundaries
|
|
187
|
+
|
|
188
|
+
OpenAMX is intended for local documents, local modules, and explicitly mapped
|
|
189
|
+
data files. It does not load remote packages or data. Hiding source in a report
|
|
190
|
+
is a presentation choice, not a confidentiality boundary; source files and
|
|
191
|
+
inputs should be protected independently. Report output is designed to work
|
|
192
|
+
offline, but exact visual parity across HTML, PDF, DOCX, and office applications
|
|
193
|
+
is not guaranteed.# OpenAMX
|
|
194
|
+
|
|
195
|
+
Status: V0.6 is COMPLETE and approved for release with Lead Developer-accepted
|
|
196
|
+
exceptions. The CLI, shared report identity, HTML/PDF/DOCX exports, desktop
|
|
197
|
+
workbench and VS Code productivity providers are present. Native macOS 14+,
|
|
198
|
+
Windows 11+, native Ubuntu 24.04+, Hutch packaging/launch, broad Office
|
|
199
|
+
compatibility, project licensing/Marketplace publication, formal accessibility,
|
|
200
|
+
V0.5 report-mobile overflow, and VS Code apply-time action safety were not
|
|
201
|
+
verified as passes; they are accepted release exceptions and follow-up
|
|
202
|
+
requirements for V0.7 planning. Release approval is not a claim that artifacts
|
|
203
|
+
have been published or that these certifications were completed. Root, desktop,
|
|
204
|
+
and extension package metadata are aligned to 0.6.0.
|
|
205
|
+
|
|
206
|
+
OpenAMX combines Markdown narrative, executable `amx` fences, and inline
|
|
207
|
+
`{{ expression }}` calculations in plain-text `.amx` documents. The TypeScript
|
|
208
|
+
core remains domain-neutral; asset-management examples use ordinary values.
|
|
209
|
+
See the [V0.2 language specification](docs/language-spec-v0.2.md) for the
|
|
210
|
+
historical contract, the [V0.3 language specification](docs/language-spec-v0.3.md)
|
|
211
|
+
for typed-data workflows, and the [V0.4 language specification](docs/language-spec-v0.4.md)
|
|
212
|
+
for typed visualizations and their historical export behavior. The
|
|
213
|
+
[V0.5 product and report contract](docs/language-spec-v0.5.md) defines additive
|
|
214
|
+
report identity, source visibility and product boundaries; it does not mean every
|
|
215
|
+
acceptance or release gate has passed.
|
|
216
|
+
|
|
217
|
+
## Install and verify
|
|
218
|
+
|
|
219
|
+
Install [Bun](https://bun.sh/), then from the repository root run:
|
|
220
|
+
|
|
221
|
+
```sh
|
|
222
|
+
bun install
|
|
223
|
+
bun run build
|
|
224
|
+
bun test
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Desktop Workbench
|
|
228
|
+
|
|
229
|
+
The repository includes an offline-first desktop authoring workbench with active-document preview, project recovery, AMX editor intelligence, structured CSV/JSON editing, logical inputs, report settings, and a unified export workflow. Sprint 043 is completing onboarding, migration, and integrated acceptance; native target certification and release readiness are not implied. See the [desktop development guide](desktop-app/README.md) for current workflows, privacy limits, and verification status.
|
|
230
|
+
|
|
231
|
+
## Write a document
|
|
232
|
+
|
|
233
|
+
An optional YAML front matter and a Markdown heading can precede executable
|
|
234
|
+
blocks. A narrative sentence such as `The final score is {{ score }}.` resolves
|
|
235
|
+
against the final environment, even when the following block appears later:
|
|
236
|
+
|
|
237
|
+
```amx
|
|
238
|
+
let score = 10
|
|
239
|
+
score += 5
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
The paragraph displays 15. Executable source is visible as escaped, canonically
|
|
243
|
+
formatted code in the standalone HTML. V0.2 supports mutable `let` bindings
|
|
244
|
+
(including repeated declarations), `=` and `+=`, arithmetic, comparisons,
|
|
245
|
+
logicals, single-line `if ... then ... else ...`, lists, inclusive integer
|
|
246
|
+
`[start to end]` ranges, statement loops, expression loops with one per-iteration
|
|
247
|
+
`return`, literal-case `match` with exactly one `default`, and the `sum`, `min`,
|
|
248
|
+
`max`, `mean`, `round`, `abs`, `sqrt`, and `pow` functions. Loops iterate over
|
|
249
|
+
lists or ranges; their iterator does not persist in the final environment.
|
|
250
|
+
|
|
251
|
+
V0.3 adds records, typed pure functions, local imports/exports, JSON and CSV
|
|
252
|
+
inputs, aggregate or fail-fast validation, and named JSON/CSV exports. The six
|
|
253
|
+
initial Asset Management schemas are an opt-in structural library, not
|
|
254
|
+
domain-certified standards.
|
|
255
|
+
|
|
256
|
+
**Migration from V0.1:** bare `let score = 10` lines outside exact, case-sensitive
|
|
257
|
+
`amx` backtick fences are narrative and do not execute. Move old declarations
|
|
258
|
+
into ` ```amx ` fences. Ordinary Markdown code fences also do not execute;
|
|
259
|
+
there is no V0.1 compatibility mode.
|
|
260
|
+
|
|
261
|
+
## VS Code Extension
|
|
262
|
+
|
|
263
|
+
The [VS Code extension](vscode-extension/README.md) requires VS Code 1.85.0 or
|
|
264
|
+
newer and runs in the Node extension host. The workspace implementation includes
|
|
265
|
+
formatting, completion, static diagnostics, hover, definition, outline,
|
|
266
|
+
references and a diagnostic-backed quick fix. Runtime CSV/JSON validation remains
|
|
267
|
+
a CLI concern. The quick fix is guarded when resolved; VS Code 1.85 cannot attach
|
|
268
|
+
an apply-time document-version precondition, and that limitation still requires a
|
|
269
|
+
Lead Developer disposition.
|
|
270
|
+
|
|
271
|
+
From the repository root, develop, test, package, and install a local VSIX:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
cd vscode-extension
|
|
275
|
+
bun install
|
|
276
|
+
bun run compile
|
|
277
|
+
bun run test
|
|
278
|
+
CI=1 bun run package
|
|
279
|
+
bun run install-local
|
|
280
|
+
code --list-extensions --show-versions
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
`bun run test` launches the VS Code 1.85.0 Extension Development Host; a display
|
|
284
|
+
or headless display server is required. For manual launch, open the extension
|
|
285
|
+
directory and select **Run OpenAMX Extension**. The locally installed package is
|
|
286
|
+
`engineerstools.openamx-vscode@0.4.0`. This repository has no license file;
|
|
287
|
+
Marketplace publication is deferred until the project chooses a license and adds
|
|
288
|
+
the corresponding file. Packaging may prompt about the missing license.
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## CLI usage
|
|
293
|
+
|
|
294
|
+
Build first. Render a document to standalone HTML (by default next to its source):
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
bun run dist/cli.js render examples/hello-world.amx --out examples/hello-world.html
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Or use the bundled script:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
bun run render:hello
|
|
304
|
+
bun run render:transformer
|
|
305
|
+
bun run render:fleet
|
|
306
|
+
bun run render:typed
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Run a document and print the evaluated context as JSON:
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
bun run dist/cli.js run examples/transformer-strategy.amx
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
The `run` command prints final variable bindings as JSON.
|
|
316
|
+
|
|
317
|
+
Typed documents accept repeated logical input mappings and named export mappings:
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
bun run dist/cli.js run examples/typed-asset-analysis.amx \
|
|
321
|
+
--input asset=examples/typed-asset.json \
|
|
322
|
+
--input screenings=examples/typed-screenings.csv \
|
|
323
|
+
--input reviewedAt=examples/typed-reviewed-at.json \
|
|
324
|
+
--output summary=out/summary.json \
|
|
325
|
+
--output resultRows=out/result-rows.csv
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Use `--validation fail-fast` to stop at the first ordered input diagnostic;
|
|
329
|
+
aggregate validation is the default. `render` accepts the same mappings and
|
|
330
|
+
adds `--out` for the HTML destination.
|
|
331
|
+
|
|
332
|
+
`render` and `export pdf|docx` accept `--project-root <dir>` to load report
|
|
333
|
+
identity defaults from that project's `.openamx/project.json`. This option does
|
|
334
|
+
not supply input mappings or change their process-working-directory path base;
|
|
335
|
+
`run` does not read project report configuration. Without the option, project
|
|
336
|
+
configuration is not discovered. Frontmatter identity without a logo remains
|
|
337
|
+
available.
|
|
338
|
+
|
|
339
|
+
Export an offline PDF or editable DOCX report. The commands analyze once, prepare
|
|
340
|
+
the complete report before writing, and require an existing parent:
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
bun run dist/cli.js export docx examples/typed-asset-analysis.amx --out out/analysis.docx \
|
|
344
|
+
--input asset=examples/typed-asset.json \
|
|
345
|
+
--input screenings=examples/typed-screenings.csv \
|
|
346
|
+
--input reviewedAt=examples/typed-reviewed-at.json
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
DOCX contains editable semantic headings, paragraphs, lists, tables, and
|
|
350
|
+
static chart images. Interactive charts, editable chart data, pixel parity,
|
|
351
|
+
and broad native Office compatibility are not promised.
|
|
352
|
+
|
|
353
|
+
Run the V0.5 typed example with its local imports, JSON/CSV inputs, table and
|
|
354
|
+
chart. Copy the sample project config into a temporary project because the CLI
|
|
355
|
+
intentionally does not discover parent projects:
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
review=$(mktemp -d)
|
|
359
|
+
mkdir -p "$review/.openamx"
|
|
360
|
+
cp examples/v05-asset-screening.amx "$review/"
|
|
361
|
+
cp -R examples/libraries "$review/"
|
|
362
|
+
cp examples/v05-project.json "$review/.openamx/project.json"
|
|
363
|
+
bun run dist/cli.js run "$review/v05-asset-screening.amx" \
|
|
364
|
+
--input asset=examples/typed-asset.json \
|
|
365
|
+
--input screenings=examples/typed-screenings.csv
|
|
366
|
+
bun run dist/cli.js render "$review/v05-asset-screening.amx" \
|
|
367
|
+
--out "$review/report.html" --project-root "$review" \
|
|
368
|
+
--input asset=examples/typed-asset.json \
|
|
369
|
+
--input screenings=examples/typed-screenings.csv
|
|
370
|
+
bun run dist/cli.js export pdf "$review/v05-asset-screening.amx" \
|
|
371
|
+
--out "$review/report.pdf" --project-root "$review" \
|
|
372
|
+
--input asset=examples/typed-asset.json \
|
|
373
|
+
--input screenings=examples/typed-screenings.csv
|
|
374
|
+
bun run dist/cli.js export docx "$review/v05-asset-screening.amx" \
|
|
375
|
+
--out "$review/report.docx" --project-root "$review" \
|
|
376
|
+
--input asset=examples/typed-asset.json \
|
|
377
|
+
--input screenings=examples/typed-screenings.csv
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
The example calculation is illustrative, not a domain-standard risk formula.
|
|
381
|
+
`sourceVisible` defaults to true; hiding source is a presentation choice, not a
|
|
382
|
+
confidentiality boundary. Logo assets must be contained local PNG/JPEG files and
|
|
383
|
+
are validated and re-encoded before report output is written.
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## Example files
|
|
388
|
+
|
|
389
|
+
The canonical examples are:
|
|
390
|
+
|
|
391
|
+
- [Hello OpenAMX](examples/hello-world.amx), with generated
|
|
392
|
+
[HTML](examples/hello-world.html), introduces executable fences and score 15.
|
|
393
|
+
- [Kitchen Sink](examples/kitchen-sink.amx), contains a comprehensive explanation of every construct in the AMX framework.
|
|
394
|
+
- [Power Transformer Failure Mode Analysis](examples/transformer-strategy.amx)
|
|
395
|
+
computes mode scores `[24, 18, 27]`, initial aggregate 69, then adjusted
|
|
396
|
+
aggregate 60. Its [HTML](examples/transformer-strategy.html) shows the final
|
|
397
|
+
value even in an earlier paragraph.
|
|
398
|
+
- [Asset Fleet Risk Analysis](examples/asset-fleet-risk-analysis.amx) computes
|
|
399
|
+
`[5, 10, 15]`, total 30, then 35 after an access adjustment. Its
|
|
400
|
+
[HTML](examples/asset-fleet-risk-analysis.html) displays the default decision
|
|
401
|
+
"Schedule review" and the final score 35; ordinary fences and bare
|
|
402
|
+
declarations are visible but never executed.
|
|
403
|
+
- [Typed Asset Screening Analysis](examples/typed-asset-analysis.amx) imports
|
|
404
|
+
opt-in Asset Management and screening schemas, consumes nested JSON and CSV,
|
|
405
|
+
computes scores with a typed pure function, and exports summary JSON plus
|
|
406
|
+
result CSV. Its [HTML](examples/typed-asset-analysis.html) is generated by
|
|
407
|
+
the production CLI.
|
|
408
|
+
- [Branded Asset Screening Snapshot](examples/v05-asset-screening.amx) reuses
|
|
409
|
+
typed inputs, local libraries and V0.4 table/chart constructs;
|
|
410
|
+
[project identity defaults](examples/v05-project.json) apply only when the
|
|
411
|
+
CLI receives an explicit `--project-root`.
|
|
412
|
+
|
|
413
|
+
```sh
|
|
414
|
+
bun run dist/cli.js run examples/transformer-strategy.amx
|
|
415
|
+
bun run dist/cli.js run examples/asset-fleet-risk-analysis.amx
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## Current limits
|
|
421
|
+
|
|
422
|
+
No nested loops, range steps, `break`/`continue`, match guards/destructuring,
|
|
423
|
+
or chained `else if`. A record constructor directly in a `match` arm remains a
|
|
424
|
+
known core parser limitation and is not claimed as supported. Editor
|
|
425
|
+
diagnostics cover parsing, static checks, and local module links, not CSV/JSON
|
|
426
|
+
runtime validation. Modules and data files are local and entry-root-contained;
|
|
427
|
+
there are no remote packages, units/currency, or broad multi-file workflows.
|
|
428
|
+
DOCX/PDF exports are local and offline; DOCX charts are static images and
|
|
429
|
+
office compatibility beyond package inspection remains open. The Asset
|
|
430
|
+
Management library remains provisional pending domain review.
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## OpenAMX Licensing
|
|
435
|
+
|
|
436
|
+
This project is dual licensed.
|
|
437
|
+
|
|
438
|
+
You may use this software under either:
|
|
439
|
+
|
|
440
|
+
1. The GNU Affero General Public License v3.0 (AGPLv3)
|
|
441
|
+
2. A Commercial License from Nova Energy Consulting Pty Ltd
|
|
442
|
+
|
|
443
|
+
By using this software, you agree to comply with the terms of one of these licences.
|
|
444
|
+
|
|
445
|
+
### Open Source Licence (AGPLv3)
|
|
446
|
+
|
|
447
|
+
The Community Edition of this software is licensed under the GNU Affero General Public License Version 3 (AGPLv3).
|
|
448
|
+
|
|
449
|
+
The AGPLv3 permits you to:
|
|
450
|
+
|
|
451
|
+
- Use the software for any purpose
|
|
452
|
+
- Study and modify the software
|
|
453
|
+
- Distribute original or modified versions
|
|
454
|
+
- Use the software within an organisation
|
|
455
|
+
- Deploy the software as a network service
|
|
456
|
+
|
|
457
|
+
Subject to the conditions of the AGPLv3, including making source code available where required by the licence.
|
|
458
|
+
|
|
459
|
+
See the LICENSE file for the full licence text.
|
|
460
|
+
|
|
461
|
+
### Commercial Licence
|
|
462
|
+
|
|
463
|
+
A commercial licence is available for organisations that wish to:
|
|
464
|
+
|
|
465
|
+
- Keep modifications proprietary
|
|
466
|
+
- Distribute the software as part of a closed-source product
|
|
467
|
+
- Embed the software within commercial solutions
|
|
468
|
+
- Avoid AGPLv3 source disclosure obligations
|
|
469
|
+
- Obtain commercial support arrangements
|
|
470
|
+
|
|
471
|
+
See COMMERCIAL-LICENSE.md for details.
|
|
472
|
+
|
|
473
|
+
### Which Licence Should I Choose?
|
|
474
|
+
|
|
475
|
+
#### Use AGPLv3 if:
|
|
476
|
+
|
|
477
|
+
- You are an individual user
|
|
478
|
+
- You are happy to comply with AGPL obligations
|
|
479
|
+
- You wish to participate in the open-source community
|
|
480
|
+
- Your project is also open source
|
|
481
|
+
|
|
482
|
+
#### Use a Commercial Licence if:
|
|
483
|
+
|
|
484
|
+
- You require proprietary use rights
|
|
485
|
+
- Your organisation cannot comply with AGPL obligations
|
|
486
|
+
- You wish to distribute closed-source derivative works
|
|
487
|
+
- You require contractual warranties, support or indemnities
|
|
488
|
+
|
|
489
|
+
### Commercial Enquiries
|
|
490
|
+
|
|
491
|
+
For commercial licensing and support enquiries:
|
|
492
|
+
|
|
493
|
+
**Nova Energy Consulting Pty Ltd**
|
|
494
|
+
|
|
495
|
+
Email: licensing@novaenergy.digital
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
## Contributing
|
|
500
|
+
|
|
501
|
+
By submitting a contribution to this project, you agree that your contribution may be distributed under both:
|
|
502
|
+
|
|
503
|
+
- AGPLv3
|
|
504
|
+
- The commercial licensing program for this project
|
|
505
|
+
|
|
506
|
+
See CONTRIBUTING.md and the contributor agreement (if applicable) for details.
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
510
|
+
## Disclaimer
|
|
511
|
+
|
|
512
|
+
This software is provided "as is" without warranty of any kind.
|
|
513
|
+
|
|
514
|
+
See the applicable licence for full terms and conditions.
|