@danielsimonjr/sciengjs 0.0.0-stage → 0.1.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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +182 -3
  3. package/THIRD_PARTY_NOTICES.md +57 -0
  4. package/assets/fonts/LiberationSerif-Regular.LICENSE.txt +102 -0
  5. package/assets/fonts/LiberationSerif-Regular.ttf +0 -0
  6. package/assets/licenses/EPL-2.0.txt +278 -0
  7. package/assets/licenses/MPL-2.0.txt +374 -0
  8. package/dist/config.d.ts +28 -0
  9. package/dist/config.js +186 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/core.d.ts +10 -0
  12. package/dist/core.js +85 -0
  13. package/dist/core.js.map +1 -0
  14. package/dist/errors.d.ts +18 -0
  15. package/dist/errors.js +25 -0
  16. package/dist/errors.js.map +1 -0
  17. package/dist/graph/backend-png.d.ts +5 -0
  18. package/dist/graph/backend-png.js +57 -0
  19. package/dist/graph/backend-png.js.map +1 -0
  20. package/dist/graph/backend-svg.d.ts +3 -0
  21. package/dist/graph/backend-svg.js +12 -0
  22. package/dist/graph/backend-svg.js.map +1 -0
  23. package/dist/graph/dot.d.ts +12 -0
  24. package/dist/graph/dot.js +48 -0
  25. package/dist/graph/dot.js.map +1 -0
  26. package/dist/graph/image.d.ts +23 -0
  27. package/dist/graph/image.js +292 -0
  28. package/dist/graph/image.js.map +1 -0
  29. package/dist/graph/index.d.ts +3 -0
  30. package/dist/graph/index.js +3 -0
  31. package/dist/graph/index.js.map +1 -0
  32. package/dist/index.d.ts +9 -0
  33. package/dist/index.js +14 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/pairs.d.ts +11 -0
  36. package/dist/pairs.js +43 -0
  37. package/dist/pairs.js.map +1 -0
  38. package/dist/raster/index.d.ts +18 -0
  39. package/dist/raster/index.js +77 -0
  40. package/dist/raster/index.js.map +1 -0
  41. package/dist/raster/warnings.d.ts +12 -0
  42. package/dist/raster/warnings.js +175 -0
  43. package/dist/raster/warnings.js.map +1 -0
  44. package/dist/registry.d.ts +13 -0
  45. package/dist/registry.js +17 -0
  46. package/dist/registry.js.map +1 -0
  47. package/dist/types.d.ts +48 -0
  48. package/dist/types.js +19 -0
  49. package/dist/types.js.map +1 -0
  50. package/dist/worker/entry.d.ts +1 -0
  51. package/dist/worker/entry.js +38 -0
  52. package/dist/worker/entry.js.map +1 -0
  53. package/dist/worker/protocol.d.ts +37 -0
  54. package/dist/worker/protocol.js +2 -0
  55. package/dist/worker/protocol.js.map +1 -0
  56. package/dist/worker/run.d.ts +30 -0
  57. package/dist/worker/run.js +90 -0
  58. package/dist/worker/run.js.map +1 -0
  59. package/package.json +71 -6
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniel Simon Jr.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,182 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # sciengjs
2
+
3
+ > A local rendering engine for science and engineering diagrams, in TypeScript.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@danielsimonjr/sciengjs)](https://www.npmjs.com/package/@danielsimonjr/sciengjs)
6
+ [![CI](https://github.com/danielsimonjr/sciengjs/actions/workflows/ci.yml/badge.svg)](https://github.com/danielsimonjr/sciengjs/actions/workflows/ci.yml)
7
+ [![licence: MIT](https://img.shields.io/badge/licence-MIT-blue)](LICENSE)
8
+
9
+ sciengjs turns diagram source into images on your own machine. It sends no source to a web service. Each render runs in a worker thread with a time limit and a memory limit, so a bad input cannot hang or crash the caller.
10
+
11
+ ## What this release does
12
+
13
+ Release 0.1.0 holds the first input type: **Graphviz DOT**.
14
+
15
+ | Input | Output | Engine |
16
+ |---|---|---|
17
+ | DOT | SVG | Graphviz 16.1.0, compiled to WASM (`@viz-js/viz`) |
18
+ | DOT | PNG | Graphviz, then resvg compiled to WASM (`@resvg/resvg-wasm`), with a bundled font |
19
+
20
+ - **No network.** The DOT path makes no network request.
21
+ - **Unsafe attributes are removed.** The engine removes each `image` and `stylesheet` attribute before the layout and gives a warning for each one. A DOT file cannot make the engine or a browser fetch a file or a URL. A `URL` attribute stays as a link in the SVG.
22
+ - **The same text on every machine.** PNG text uses the bundled Liberation Serif font, not the fonts of the host. The engine gives a warning when the drawing asks for bold, italic or a character that the font does not have.
23
+ - **Limits.** Each render has a time limit, a source size limit and a heap limit. A PNG has a pixel limit of 1024 MB.
24
+ - **Typed errors.** A failed render rejects with a `RenderError` that has a code. The engine never falls back to another format.
25
+ - **Two runtime dependencies**, both pinned: `@viz-js/viz` and `@resvg/resvg-wasm`. No native module and no Python.
26
+
27
+ Each later release adds one input type. The [Roadmap](#roadmap) lists them.
28
+
29
+ ## Install
30
+
31
+ ```sh
32
+ npm install @danielsimonjr/sciengjs
33
+ ```
34
+
35
+ The package needs Node 22 or later. The package is an ES module.
36
+
37
+ ## Quick start
38
+
39
+ ```js
40
+ import { writeFile } from "node:fs/promises";
41
+ import { render } from "@danielsimonjr/sciengjs";
42
+
43
+ const source = `digraph G {
44
+ rankdir=LR;
45
+ sensor -> filter -> controller -> actuator;
46
+ controller -> sensor [label="feedback", style=dashed];
47
+ }`;
48
+
49
+ const svg = await render({ type: "dot", source, format: "svg" });
50
+ await writeFile("loop.svg", svg.bytes);
51
+
52
+ const png = await render({ type: "dot", source, format: "png", options: { scale: 2 } });
53
+ await writeFile("loop.png", png.bytes);
54
+
55
+ console.log(png.mime, png.backend, png.warnings);
56
+ // image/png graph/viz+raster/resvg []
57
+ ```
58
+
59
+ `render` returns a `RenderResult`:
60
+
61
+ | Field | Holds |
62
+ |---|---|
63
+ | `bytes` | the output, as a `Uint8Array` |
64
+ | `mime` | the media type, for example `image/svg+xml` |
65
+ | `backend` | the backend that rendered, for example `graph/viz` |
66
+ | `warnings` | one string for each thing that the engine removed or could not draw |
67
+
68
+ The `png` format takes one option, `scale` (a number greater than 0, default 1). Any other option rejects with `E_INPUT`.
69
+
70
+ ## Check what this machine can render
71
+
72
+ ```js
73
+ import { capabilities } from "@danielsimonjr/sciengjs";
74
+
75
+ for (const pair of await capabilities()) {
76
+ if (pair.ready) console.log(pair.type, "->", pair.format);
77
+ }
78
+ ```
79
+
80
+ `capabilities` reports each input and output pair of the design, the stage that the pair needs, and whether the stage is ready here. In this release only `dot -> svg` and `dot -> png` are ready.
81
+
82
+ ## Errors
83
+
84
+ ```js
85
+ import { render, RenderError } from "@danielsimonjr/sciengjs";
86
+
87
+ try {
88
+ await render({ type: "dot", source: "digraph { a -> }", format: "svg" });
89
+ } catch (err) {
90
+ if (err instanceof RenderError) console.log(err.code, err.message);
91
+ }
92
+ ```
93
+
94
+ | Code | Means |
95
+ |---|---|
96
+ | `E_INPUT` | the source or an option is not valid |
97
+ | `E_UNSUPPORTED` | this build has no backend for the pair, for example `math` to `svg` |
98
+ | `E_LIMIT` | the source, the heap or the PNG pixels are over a limit |
99
+ | `E_TIMEOUT` | the render took longer than `timeoutMs` |
100
+ | `E_STAGE_MISSING` | a file that a stage needs, for example the bundled font, is missing |
101
+ | `E_CONFIG` | a configuration value is not valid |
102
+ | `E_INTEGRITY` | a downloaded file does not have its expected hash |
103
+ | `E_INTERNAL` | a defect in the engine. Please report the defect |
104
+
105
+ ## Configuration
106
+
107
+ Each render takes an optional configuration as its second argument. An environment variable or a configuration file can also set each value.
108
+
109
+ | Key | Environment variable | Default |
110
+ |---|---|---|
111
+ | `timeoutMs` | `SCIENG_TIMEOUT_MS` | 60000 |
112
+ | `maxSourceBytes` | `SCIENG_MAX_SOURCE_BYTES` | 10485760 (10 MiB) |
113
+ | `maxMemoryMb` | `SCIENG_MAX_MEMORY_MB` | 2048 |
114
+ | `rasterFont` | `SCIENG_RASTER_FONT` | the bundled Liberation Serif |
115
+ | `allowNetwork` | `SCIENG_ALLOW_NETWORK` | `tex-bundles` (the DOT path makes no request) |
116
+
117
+ `SCIENG_CONFIG` names a JSON configuration file. `loadConfig` returns the resolved configuration.
118
+
119
+ ```js
120
+ await render({ type: "dot", source, format: "png" }, { timeoutMs: 10000, maxMemoryMb: 512 });
121
+ ```
122
+
123
+ The heap limit holds under Node. Bun runs the engine, but Bun does not enforce the heap limit of a worker.
124
+
125
+ ## Stage subpaths
126
+
127
+ A caller that needs only one stage can import the subpath of that stage:
128
+
129
+ ```js
130
+ import { dotToSvg } from "@danielsimonjr/sciengjs/graph";
131
+ import { svgToPng } from "@danielsimonjr/sciengjs/raster";
132
+
133
+ const { svg, warnings } = await dotToSvg("digraph { a -> b }");
134
+ const png = await svgToPng(svg, { scale: 1, maxMemoryMb: 512 });
135
+ ```
136
+
137
+ A subpath call runs in the calling thread, without the worker and its limits. Use `render` for input that you do not trust.
138
+
139
+ ## Roadmap
140
+
141
+ The [build plan](docs/superpowers/plans/2026-11-01-scieng-engine-build.md) gives the order of the increments. Each increment adds one input type, its tests and one release. The [design](docs/superpowers/specs/2026-11-01-scieng-engine-design.md) gives the API, the stages, the security controls and the licence of each engine.
142
+
143
+ | Input type | Stage | Status |
144
+ |---|---|---|
145
+ | DOT | graph, raster | released in 0.1.0 |
146
+ | Mermaid | mermaid, browser | planned |
147
+ | LaTeX math | math (MathJax) | planned |
148
+ | TikZ, circuitikz, LaTeX | tex (an own WASM build of `tex.web`) | trial builds pass |
149
+ | Plots | plot | planned |
150
+ | SysML v2 | sysml | planned |
151
+ | STEP, IGES, BREP | mesh (OpenCascade WASM) | trial build passes |
152
+ | HTML to PNG, PDF and Markdown | html, browser | planned |
153
+
154
+ ## Use from an agent
155
+
156
+ [`scieng-mcp`](https://github.com/danielsimonjr/scieng-mcp) gives the engine to an agent harness as MCP tools, slash commands and a skill. The engine itself knows nothing about MCP.
157
+
158
+ ## Development
159
+
160
+ Install Bun 1.4.4 and Node 22 or later. Then run `bun install --frozen-lockfile`.
161
+
162
+ | Command | Does |
163
+ |---|---|
164
+ | `bun test` | runs the full test suite |
165
+ | `bun run typecheck` | typechecks `src/` and `test/` |
166
+ | `bun run build` | writes the ESM package into `dist/` |
167
+ | `bun run smoke` | packs the build, installs it in a new folder and runs it under Node |
168
+
169
+ | Path | Holds |
170
+ |---|---|
171
+ | `src/` | the engine: the API, the configuration, the worker, the registry and the stages |
172
+ | `test/` | the unit tests, the corpus tests, the Node tests and the smoke test |
173
+ | `docs/superpowers/` | the design and the build plan |
174
+ | `docs/architecture/` | the architecture documents, gated by `repo-tools check` |
175
+ | `docs/analysis/` | the reports of the trial builds and the reviews |
176
+ | `trials/` | the trial builds of later stages. The package does not ship them |
177
+
178
+ See [`CONTRIBUTING.md`](CONTRIBUTING.md). Report a security problem as [`SECURITY.md`](SECURITY.md) tells you.
179
+
180
+ ## Licence
181
+
182
+ MIT. See [`LICENSE`](LICENSE). Each borrowed engine keeps its own licence. [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) lists them: Graphviz (EPL-2.0), resvg (MPL-2.0) and Liberation Serif (SIL Open Font License 1.1).
@@ -0,0 +1,57 @@
1
+ # Third-party notices
2
+
3
+ This file lists each engine that the engine borrows. It gives the licence of each engine.
4
+
5
+ The engine package ships this file. A borrowed engine keeps its own licence. The engine does not change the licence of any borrowed engine.
6
+
7
+ Version: each row gives the version that the engine pins.
8
+
9
+ ## Borrowed engines
10
+
11
+ | Stage | Engine | Licence | Status |
12
+ |---|---|---|---|
13
+ | graph | `@viz-js/viz` 3.31.0 (Graphviz 16.1.0 compiled to WASM) | Wrapper: MIT. Graphviz: EPL-2.0 | a dependency |
14
+ | math | `@mathjax/src` | Apache-2.0 | not yet a dependency |
15
+ | tex | The own WASM build of `tex.web` with `etex.ch` (trials T5 and T6) | The "tex" stage of the design gives the licence of each input | not yet a dependency |
16
+ | tex | TeX packages (bundles) | LPPL or public domain only. Each package keeps its own licence | not yet a dependency |
17
+ | mesh | `occt-import-js` (OpenCascade compiled to WASM) | LGPL-2.1 | not yet a dependency |
18
+ | mesh | `manifold-3d` | Apache-2.0 | not yet a dependency |
19
+ | mesh (viewer page) | `three` | MIT | not yet a dependency |
20
+ | raster | `@resvg/resvg-wasm` 2.6.2 | MPL-2.0 | a dependency |
21
+ | raster | Liberation Serif Regular 2.1.5 (font, in `assets/fonts/`) | SIL Open Font License 1.1 | bundled |
22
+ | html | `parse5` | MIT | not yet a dependency |
23
+ | browser | Chromium or Google Chrome | Installed by the user. The engine does not ship it | not a package dependency |
24
+
25
+ ## Notices
26
+
27
+ ### Graphviz (EPL-2.0)
28
+
29
+ The Eclipse Public License 2.0 applies to Graphviz. The wrapper `@viz-js/viz` is licensed under MIT. The package does not ship a Graphviz licence file. The licence text of Graphviz is in `assets/licenses/EPL-2.0.txt`. The source repository of the wrapper is https://github.com/mdaines/viz-js.
30
+
31
+ ### OpenCascade (LGPL-2.1)
32
+
33
+ `occt-import-js` is licensed under the GNU Lesser General Public License 2.1. The WASM file stays a separate, unmodified file.
34
+
35
+ ### resvg (MPL-2.0)
36
+
37
+ The Mozilla Public License 2.0 applies to `@resvg/resvg-wasm`. The WASM file stays a separate, unmodified file. The source code is in the repository https://github.com/yisibl/resvg-js, which builds the npm package. The licence text is in `assets/licenses/MPL-2.0.txt`.
38
+
39
+ ### Liberation Serif (SIL Open Font License 1.1)
40
+
41
+ The font `assets/fonts/LiberationSerif-Regular.ttf` is Liberation Serif Regular, version 2.1.5. The font is licensed under the SIL Open Font License, Version 1.1. The engine does not modify the font. The copyright line of the font is: Digitized data copyright (c) 2010 Google Corporation with Reserved Font Arimo, Tinos and Cousine. Copyright (c) 2012 Red Hat, Inc. The licence text is in `assets/fonts/LiberationSerif-Regular.LICENSE.txt`.
42
+
43
+ ### TeX toolchain and packages
44
+
45
+ This release does not ship the tex stage. The "tex" stage of the design gives the licence of each TeX input. A bundle holds only packages under the LPPL or in the public domain. Each package keeps its own licence.
46
+
47
+ ### Template method credit
48
+
49
+ The package detection of the `tex` stage follows the templater of the Upmath renderer (`parpalak/i.upmath.me`, MIT). The engine credits that project for the method.
50
+
51
+ ### Trial T2 sample files (LGPL-2.0-or-later, LGPL-2.1 and Apache-2.0)
52
+
53
+ The trial folder `trials/t2-mesh/samples/` holds three CAD test files from other projects. The engine package does not ship them. The licence texts are in `trials/t2-mesh/samples/LICENSES/`. The source, commit and SHA-256 of each file are in `trials/t2-mesh/samples/README.md`.
54
+
55
+ - `red_cube_blue_cylinder.step`, from CadQuery: Apache-2.0.
56
+ - `cube-10x10mm.igs`, from occt-import-js: LGPL-2.1.
57
+ - `cylinder1.brep`, from FreeCAD: LGPL-2.0-or-later.
@@ -0,0 +1,102 @@
1
+ Digitized data copyright (c) 2010 Google Corporation
2
+ with Reserved Font Arimo, Tinos and Cousine.
3
+ Copyright (c) 2012 Red Hat, Inc.
4
+ with Reserved Font Name Liberation.
5
+
6
+ This Font Software is licensed under the SIL Open Font License,
7
+ Version 1.1.
8
+
9
+ This license is copied below, and is also available with a FAQ at:
10
+ http://scripts.sil.org/OFL
11
+
12
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
13
+
14
+ PREAMBLE The goals of the Open Font License (OFL) are to stimulate
15
+ worldwide development of collaborative font projects, to support the font
16
+ creation efforts of academic and linguistic communities, and to provide
17
+ a free and open framework in which fonts may be shared and improved in
18
+ partnership with others.
19
+
20
+ The OFL allows the licensed fonts to be used, studied, modified and
21
+ redistributed freely as long as they are not sold by themselves.
22
+ The fonts, including any derivative works, can be bundled, embedded,
23
+ redistributed and/or sold with any software provided that any reserved
24
+ names are not used by derivative works. The fonts and derivatives,
25
+ however, cannot be released under any other type of license. The
26
+ requirement for fonts to remain under this license does not apply to
27
+ any document created using the fonts or their derivatives.
28
+
29
+
30
+
31
+ DEFINITIONS
32
+ "Font Software" refers to the set of files released by the Copyright
33
+ Holder(s) under this license and clearly marked as such.
34
+ This may include source files, build scripts and documentation.
35
+
36
+ "Reserved Font Name" refers to any names specified as such after the
37
+ copyright statement(s).
38
+
39
+ "Original Version" refers to the collection of Font Software components
40
+ as distributed by the Copyright Holder(s).
41
+
42
+ "Modified Version" refers to any derivative made by adding to, deleting,
43
+ or substituting ? in part or in whole ?
44
+ any of the components of the Original Version, by changing formats or
45
+ by porting the Font Software to a new environment.
46
+
47
+ "Author" refers to any designer, engineer, programmer, technical writer
48
+ or other person who contributed to the Font Software.
49
+
50
+
51
+ PERMISSION & CONDITIONS
52
+
53
+ Permission is hereby granted, free of charge, to any person obtaining a
54
+ copy of the Font Software, to use, study, copy, merge, embed, modify,
55
+ redistribute, and sell modified and unmodified copies of the Font
56
+ Software, subject to the following conditions:
57
+
58
+ 1) Neither the Font Software nor any of its individual components,in
59
+ Original or Modified Versions, may be sold by itself.
60
+
61
+ 2) Original or Modified Versions of the Font Software may be bundled,
62
+ redistributed and/or sold with any software, provided that each copy
63
+ contains the above copyright notice and this license. These can be
64
+ included either as stand-alone text files, human-readable headers or
65
+ in the appropriate machine-readable metadata fields within text or
66
+ binary files as long as those fields can be easily viewed by the user.
67
+
68
+ 3) No Modified Version of the Font Software may use the Reserved Font
69
+ Name(s) unless explicit written permission is granted by the
70
+ corresponding Copyright Holder. This restriction only applies to the
71
+ primary font name as presented to the users.
72
+
73
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
74
+ Software shall not be used to promote, endorse or advertise any
75
+ Modified Version, except to acknowledge the contribution(s) of the
76
+ Copyright Holder(s) and the Author(s) or with their explicit written
77
+ permission.
78
+
79
+ 5) The Font Software, modified or unmodified, in part or in whole, must
80
+ be distributed entirely under this license, and must not be distributed
81
+ under any other license. The requirement for fonts to remain under
82
+ this license does not apply to any document created using the Font
83
+ Software.
84
+
85
+
86
+
87
+ TERMINATION
88
+ This license becomes null and void if any of the above conditions are not met.
89
+
90
+
91
+
92
+ DISCLAIMER
93
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
94
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
95
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
96
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
97
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
98
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
99
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
100
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
101
+ DEALINGS IN THE FONT SOFTWARE.
102
+
@@ -0,0 +1,278 @@
1
+ Eclipse Public License - v 2.0
2
+
3
+ THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
4
+ PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
5
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
6
+
7
+ 1. DEFINITIONS
8
+
9
+ "Contribution" means:
10
+
11
+ a) in the case of the initial Contributor, the initial content
12
+ Distributed under this Agreement, and
13
+
14
+ b) in the case of each subsequent Contributor:
15
+ i) changes to the Program, and
16
+ ii) additions to the Program;
17
+ where such changes and/or additions to the Program originate from
18
+ and are Distributed by that particular Contributor. A Contribution
19
+ "originates" from a Contributor if it was added to the Program by
20
+ such Contributor itself or anyone acting on such Contributor's behalf.
21
+ Contributions do not include changes or additions to the Program that
22
+ are not Modified Works.
23
+
24
+ "Contributor" means any person or entity that Distributes the Program.
25
+
26
+ "Licensed Patents" mean patent claims licensable by a Contributor which
27
+ are necessarily infringed by the use or sale of its Contribution alone
28
+ or when combined with the Program.
29
+
30
+ "Program" means the Contributions Distributed in accordance with this
31
+ Agreement.
32
+
33
+ "Recipient" means anyone who receives the Program under this Agreement
34
+ or any Secondary License (as applicable), including Contributors.
35
+
36
+ "Derivative Works" shall mean any work, whether in Source Code or other
37
+ form, that is based on (or derived from) the Program and for which the
38
+ editorial revisions, annotations, elaborations, or other modifications
39
+ represent, as a whole, an original work of authorship.
40
+
41
+ "Modified Works" shall mean any work in Source Code or other form that
42
+ results from an addition to, deletion from, or modification of the
43
+ contents of the Program, including, for purposes of clarity any new file
44
+ in Source Code form that contains any contents of the Program. Modified
45
+ Works shall not include works that contain only declarations,
46
+ interfaces, types, classes, structures, or files of the Program solely
47
+ in each case in order to link to, bind by name, or subclass the Program
48
+ or Modified Works thereof.
49
+
50
+ "Distribute" means the acts of a) distributing or b) making available
51
+ in any manner that enables the transfer of a copy.
52
+
53
+ "Source Code" means the form of a Program preferred for making
54
+ modifications, including but not limited to software source code,
55
+ documentation source, and configuration files.
56
+
57
+ "Secondary License" means either the GNU General Public License,
58
+ Version 2.0, or any later versions of that license, including any
59
+ exceptions or additional permissions as identified by the initial
60
+ Contributor.
61
+
62
+ 2. GRANT OF RIGHTS
63
+
64
+ a) Subject to the terms of this Agreement, each Contributor hereby
65
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
66
+ license to reproduce, prepare Derivative Works of, publicly display,
67
+ publicly perform, Distribute and sublicense the Contribution of such
68
+ Contributor, if any, and such Derivative Works.
69
+
70
+ b) Subject to the terms of this Agreement, each Contributor hereby
71
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
72
+ license under Licensed Patents to make, use, sell, offer to sell,
73
+ import and otherwise transfer the Contribution of such Contributor,
74
+ if any, in Source Code or other form. This patent license shall
75
+ apply to the combination of the Contribution and the Program if, at
76
+ the time the Contribution is added by the Contributor, such addition
77
+ of the Contribution causes such combination to be covered by the
78
+ Licensed Patents. The patent license shall not apply to any other
79
+ combinations which include the Contribution. No hardware per se is
80
+ licensed hereunder.
81
+
82
+ c) Recipient understands that although each Contributor grants the
83
+ licenses to its Contributions set forth herein, no assurances are
84
+ provided by any Contributor that the Program does not infringe the
85
+ patent or other intellectual property rights of any other entity.
86
+ Each Contributor disclaims any liability to Recipient for claims
87
+ brought by any other entity based on infringement of intellectual
88
+ property rights or otherwise. As a condition to exercising the
89
+ rights and licenses granted hereunder, each Recipient hereby
90
+ assumes sole responsibility to secure any other intellectual
91
+ property rights needed, if any. For example, if a third party
92
+ patent license is required to allow Recipient to Distribute the
93
+ Program, it is Recipient's responsibility to acquire that license
94
+ before distributing the Program.
95
+
96
+ d) Each Contributor represents that to its knowledge it has
97
+ sufficient copyright rights in its Contribution, if any, to grant
98
+ the copyright license set forth in this Agreement.
99
+
100
+ e) Notwithstanding the terms of any Secondary License, no
101
+ Contributor makes additional grants to any Recipient (other than
102
+ those set forth in this Agreement) as a result of such Recipient's
103
+ receipt of the Program under the terms of a Secondary License
104
+ (if permitted under the terms of Section 3).
105
+
106
+ 3. REQUIREMENTS
107
+
108
+ 3.1 If a Contributor Distributes the Program in any form, then:
109
+
110
+ a) the Program must also be made available as Source Code, in
111
+ accordance with section 3.2, and the Contributor must accompany
112
+ the Program with a statement that the Source Code for the Program
113
+ is available under this Agreement, and informs Recipients how to
114
+ obtain it in a reasonable manner on or through a medium customarily
115
+ used for software exchange; and
116
+
117
+ b) the Contributor may Distribute the Program under a license
118
+ different than this Agreement, provided that such license:
119
+ i) effectively disclaims on behalf of all other Contributors all
120
+ warranties and conditions, express and implied, including
121
+ warranties or conditions of title and non-infringement, and
122
+ implied warranties or conditions of merchantability and fitness
123
+ for a particular purpose;
124
+
125
+ ii) effectively excludes on behalf of all other Contributors all
126
+ liability for damages, including direct, indirect, special,
127
+ incidental and consequential damages, such as lost profits;
128
+
129
+ iii) does not attempt to limit or alter the recipients' rights
130
+ in the Source Code under section 3.2; and
131
+
132
+ iv) requires any subsequent distribution of the Program by any
133
+ party to be under a license that satisfies the requirements
134
+ of this section 3.
135
+
136
+ 3.2 When the Program is Distributed as Source Code:
137
+
138
+ a) it must be made available under this Agreement, or if the
139
+ Program (i) is combined with other material in a separate file or
140
+ files made available under a Secondary License, and (ii) the initial
141
+ Contributor attached to the Source Code the notice described in
142
+ Exhibit A of this Agreement, then the Program may be made available
143
+ under the terms of such Secondary Licenses, and
144
+
145
+ b) a copy of this Agreement must be included with each copy of
146
+ the Program.
147
+
148
+ 3.3 Contributors may not remove or alter any copyright, patent,
149
+ trademark, attribution notices, disclaimers of warranty, or limitations
150
+ of liability ("notices") contained within the Program from any copy of
151
+ the Program which they Distribute, provided that Contributors may add
152
+ their own appropriate notices.
153
+
154
+ 4. COMMERCIAL DISTRIBUTION
155
+
156
+ Commercial distributors of software may accept certain responsibilities
157
+ with respect to end users, business partners and the like. While this
158
+ license is intended to facilitate the commercial use of the Program,
159
+ the Contributor who includes the Program in a commercial product
160
+ offering should do so in a manner which does not create potential
161
+ liability for other Contributors. Therefore, if a Contributor includes
162
+ the Program in a commercial product offering, such Contributor
163
+ ("Commercial Contributor") hereby agrees to defend and indemnify every
164
+ other Contributor ("Indemnified Contributor") against any losses,
165
+ damages and costs (collectively "Losses") arising from claims, lawsuits
166
+ and other legal actions brought by a third party against the Indemnified
167
+ Contributor to the extent caused by the acts or omissions of such
168
+ Commercial Contributor in connection with its distribution of the Program
169
+ in a commercial product offering. The obligations in this section do not
170
+ apply to any claims or Losses relating to any actual or alleged
171
+ intellectual property infringement. In order to qualify, an Indemnified
172
+ Contributor must: a) promptly notify the Commercial Contributor in
173
+ writing of such claim, and b) allow the Commercial Contributor to control,
174
+ and cooperate with the Commercial Contributor in, the defense and any
175
+ related settlement negotiations. The Indemnified Contributor may
176
+ participate in any such claim at its own expense.
177
+
178
+ For example, a Contributor might include the Program in a commercial
179
+ product offering, Product X. That Contributor is then a Commercial
180
+ Contributor. If that Commercial Contributor then makes performance
181
+ claims, or offers warranties related to Product X, those performance
182
+ claims and warranties are such Commercial Contributor's responsibility
183
+ alone. Under this section, the Commercial Contributor would have to
184
+ defend claims against the other Contributors related to those performance
185
+ claims and warranties, and if a court requires any other Contributor to
186
+ pay any damages as a result, the Commercial Contributor must pay
187
+ those damages.
188
+
189
+ 5. NO WARRANTY
190
+
191
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
192
+ PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS"
193
+ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
194
+ IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
195
+ TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
196
+ PURPOSE. Each Recipient is solely responsible for determining the
197
+ appropriateness of using and distributing the Program and assumes all
198
+ risks associated with its exercise of rights under this Agreement,
199
+ including but not limited to the risks and costs of program errors,
200
+ compliance with applicable laws, damage to or loss of data, programs
201
+ or equipment, and unavailability or interruption of operations.
202
+
203
+ 6. DISCLAIMER OF LIABILITY
204
+
205
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
206
+ PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
207
+ SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
208
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
209
+ PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
210
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
211
+ ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
212
+ EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
213
+ POSSIBILITY OF SUCH DAMAGES.
214
+
215
+ 7. GENERAL
216
+
217
+ If any provision of this Agreement is invalid or unenforceable under
218
+ applicable law, it shall not affect the validity or enforceability of
219
+ the remainder of the terms of this Agreement, and without further
220
+ action by the parties hereto, such provision shall be reformed to the
221
+ minimum extent necessary to make such provision valid and enforceable.
222
+
223
+ If Recipient institutes patent litigation against any entity
224
+ (including a cross-claim or counterclaim in a lawsuit) alleging that the
225
+ Program itself (excluding combinations of the Program with other software
226
+ or hardware) infringes such Recipient's patent(s), then such Recipient's
227
+ rights granted under Section 2(b) shall terminate as of the date such
228
+ litigation is filed.
229
+
230
+ All Recipient's rights under this Agreement shall terminate if it
231
+ fails to comply with any of the material terms or conditions of this
232
+ Agreement and does not cure such failure in a reasonable period of
233
+ time after becoming aware of such noncompliance. If all Recipient's
234
+ rights under this Agreement terminate, Recipient agrees to cease use
235
+ and distribution of the Program as soon as reasonably practicable.
236
+ However, Recipient's obligations under this Agreement and any licenses
237
+ granted by Recipient relating to the Program shall continue and survive.
238
+
239
+ Everyone is permitted to copy and distribute copies of this Agreement,
240
+ but in order to avoid inconsistency the Agreement is copyrighted and
241
+ may only be modified in the following manner. The Agreement Steward
242
+ reserves the right to publish new versions (including revisions) of
243
+ this Agreement from time to time. No one other than the Agreement
244
+ Steward has the right to modify this Agreement. The Eclipse Foundation
245
+ is the initial Agreement Steward. The Eclipse Foundation may assign the
246
+ responsibility to serve as the Agreement Steward to a suitable separate
247
+ entity. Each new version of the Agreement will be given a distinguishing
248
+ version number. The Program (including Contributions) may always be
249
+ Distributed subject to the version of the Agreement under which it was
250
+ received. In addition, after a new version of the Agreement is published,
251
+ Contributor may elect to Distribute the Program (including its
252
+ Contributions) under the new version.
253
+
254
+ Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
255
+ receives no rights or licenses to the intellectual property of any
256
+ Contributor under this Agreement, whether expressly, by implication,
257
+ estoppel or otherwise. All rights in the Program not expressly granted
258
+ under this Agreement are reserved. Nothing in this Agreement is intended
259
+ to be enforceable by any entity that is not a Contributor or Recipient.
260
+ No third-party beneficiary rights are created under this Agreement.
261
+
262
+ Exhibit A - Form of Secondary Licenses Notice
263
+
264
+ "This Source Code may also be made available under the following
265
+ Secondary Licenses when the conditions for such availability set forth
266
+ in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
267
+ version(s), and exceptions or additional permissions here}."
268
+
269
+ Simply including a copy of this Agreement, including this Exhibit A
270
+ is not sufficient to license the Source Code under Secondary Licenses.
271
+
272
+ If it is not possible or desirable to put the notice in a particular
273
+ file, then You may include the notice in a location (such as a LICENSE
274
+ file in a relevant directory) where a recipient would be likely to
275
+ look for such a notice.
276
+
277
+ You may add additional accurate notices of copyright ownership.
278
+