@parcha/pi-durable-disk 0.0.0-stage → 0.1.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +184 -0
- package/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +522 -2
- package/bin/archil-scoped +165 -0
- package/dist/app.d.ts +35 -0
- package/dist/app.js +46 -0
- package/dist/claim.d.ts +195 -0
- package/dist/claim.js +651 -0
- package/dist/cli.d.ts +64 -0
- package/dist/cli.js +663 -0
- package/dist/confine.d.ts +80 -0
- package/dist/confine.js +319 -0
- package/dist/env.d.ts +123 -0
- package/dist/env.js +568 -0
- package/dist/errors.d.ts +46 -0
- package/dist/errors.js +55 -0
- package/dist/fork.d.ts +41 -0
- package/dist/fork.js +181 -0
- package/dist/hosts/daytona-launch.d.ts +52 -0
- package/dist/hosts/daytona-launch.js +268 -0
- package/dist/hosts/daytona.d.ts +147 -0
- package/dist/hosts/daytona.js +368 -0
- package/dist/hosts/docker.d.ts +103 -0
- package/dist/hosts/docker.js +362 -0
- package/dist/hosts/local-host.d.ts +71 -0
- package/dist/hosts/local-host.js +351 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +16 -0
- package/dist/lease.d.ts +7 -0
- package/dist/lease.js +6 -0
- package/dist/park.d.ts +91 -0
- package/dist/park.js +228 -0
- package/dist/run.d.ts +258 -0
- package/dist/run.js +753 -0
- package/dist/serve.d.ts +101 -0
- package/dist/serve.js +393 -0
- package/dist/status.d.ts +123 -0
- package/dist/status.js +264 -0
- package/dist/store.d.ts +103 -0
- package/dist/store.js +217 -0
- package/dist/supervise.d.ts +340 -0
- package/dist/supervise.js +526 -0
- package/dist/watchdog.d.ts +39 -0
- package/dist/watchdog.js +135 -0
- package/package.json +87 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0-beta.12, 2026-10-09
|
|
4
|
+
|
|
5
|
+
Renamed from `@parcha/pi-durable-archil`. The package is now `@parcha/pi-durable-disk` and its command is `pi-durable-disk`, for branding:
|
|
6
|
+
other disks may follow, and none is promised. It supports Archil only, because Archil gives a run's directory an exclusive claim and fences
|
|
7
|
+
the old holder's writes on takeover; a disk without both cannot carry the package's guarantees. The entries below name the package as it was
|
|
8
|
+
published.
|
|
9
|
+
|
|
10
|
+
- Moved with the name: the Docker image (`pi-durable-disk:local`), the tarball name (`parcha-pi-durable-disk-<version>.tgz`), the install
|
|
11
|
+
paths `/usr/local/lib/pi-durable-disk/archil-scoped` and `/etc/sudoers.d/pi-durable-disk`, the token directory `/run/pi-durable-disk`, and the
|
|
12
|
+
`X-Daytona-Source` header. An existing host's sudoers drop-in and wrapper copy need the new paths.
|
|
13
|
+
- Unchanged, because they name the Archil disk: `bin/archil-scoped` (and the `./bin/archil-scoped` export), `ARCHIL_API_KEY`, `archilEnv`,
|
|
14
|
+
`ArchilCodingTools`, the claim's internals and the `archil` client it runs.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
**A holder the control API lists without a path**
|
|
18
|
+
- Archil's control API resolves a delegation's path best-effort and can list one with no path, live or orphaned, even on a
|
|
19
|
+
run id used once. `findDelegations` matched by path only, so such a holder read as none everywhere it is used
|
|
20
|
+
(`ensureRunning`, `revoke`, `takeOver`, `deleteRunTree`, `fork`): the supervisor started a second instance into a live
|
|
21
|
+
holder (refused, exit 76), kept starting into a dead holder's refused mount, and S3 kept refusing the run's deletes.
|
|
22
|
+
`sweepTokens` judged such a run unheld too, so it could remove a live mount's token user once `run.json` said released.
|
|
23
|
+
- When nothing matches by path and some delegation has none, the pathless delegations are attributed by inode: one
|
|
24
|
+
`Disk.exec` (`find runs -inum`, whose inode numbers are the control API's inode ids) maps their inodes to run
|
|
25
|
+
directories, and those on the inode `runs/<id>` names now are the run's. A listing, a supervisor pass and a token sweep
|
|
26
|
+
each share one resolver (`pathlessResolver`), so one costs at most one exec however many runs it decides. Nothing is
|
|
27
|
+
recorded, so a deleted and recreated run directory matches as it is now. An inode on no run directory is no run's and
|
|
28
|
+
is reported once on stderr.
|
|
29
|
+
- `ControlApi` gains an optional `exec(command)`; an SDK `Disk` has it and the CLI passes it. Without it, when the exec
|
|
30
|
+
fails, or when the disk root or `runs/` cannot be read, a pathless delegation that could be the run's fails
|
|
31
|
+
`CONTROL_API_FAILED` instead of reading as none: the supervisor's pass starts nothing, `takeOver` falls back to
|
|
32
|
+
`mount --force`, and the token sweep keeps the run's users.
|
|
33
|
+
|
|
34
|
+
## 0.1.0-beta.11, 2026-10-08
|
|
35
|
+
|
|
36
|
+
**Serve, sleep parking and fork**
|
|
37
|
+
- `run --serve PORT` puts an HTTP front on the open run: `POST /submit` (pi's submit with the caller's `requestId`, which pi
|
|
38
|
+
deduplicates per conversation in the run's store, so a retry that reaches the next incarnation, even on another host, gets
|
|
39
|
+
the same submission and, with `wait: true`, its answer), `POST /abort`, `GET /events` (pi's agent events as server-sent
|
|
40
|
+
events) and `GET /status`. The instance listens before it opens and writes its address into `run.json`'s holder
|
|
41
|
+
(`holder.serve`); it answers 503 `OPENING`, `PARKING` or `RELEASED` while it opens, parks or is gone.
|
|
42
|
+
- A bearer token: optional on 127.0.0.1, required on any other `--serve-host` (`SERVE_TOKEN_REQUIRED` before anything binds).
|
|
43
|
+
It is read from a file of mode 0600 (`--serve-token-file`, never argv or the environment) and compared in constant time
|
|
44
|
+
on every route. A wildcard bind (0.0.0.0, ::) also needs `--serve-url`, the address clients reach, which is what
|
|
45
|
+
`run.json` carries (`SERVE_URL_REQUIRED`).
|
|
46
|
+
- `requestRun(ref, request, { host, ensure, token })`, the client: it finds the instance through `run.json`, sends while the
|
|
47
|
+
holder's lease is fresh (a request is dropped when the lease lapses under it), and otherwise calls `ensureRunning` with
|
|
48
|
+
demand. After a start, its own or one the supervisor reports `starting`, it waits for that generation instead of asking
|
|
49
|
+
again, so one cold request makes one start.
|
|
50
|
+
- Sleep parking (`run --park-threshold`; the local driver passes 60 s, `supervise --park-threshold 0` turns it off): after
|
|
51
|
+
every commit the instance classifies pi's tasks; when everything that could run only sleeps in a retry or deferred-poll wait
|
|
52
|
+
longer than the threshold, it writes `run.json` `sleeping` with `wakeAt` (the deadline), releases and exits 0, and the
|
|
53
|
+
supervisor starts it at `wakeAt`. With `--serve`, a run with no live work parks after `--park-idle` with `wakeAt` null (a
|
|
54
|
+
request wakes it). Open requests and event streams keep the instance up; a blocked task does not. The deadline is read from
|
|
55
|
+
pi's retry and poll checkpoint in one function; any other shape counts as busy.
|
|
56
|
+
- The app module's `wake` hook replaces how the wake is recorded: a refusal keeps the instance up through the wait, while a
|
|
57
|
+
failed `run.json` write is a fence (exit 75; the lease path resumes the run and pi sleeps out the remainder). `root` gives
|
|
58
|
+
the options for the root conversation serve creates.
|
|
59
|
+
- A drain on SIGTERM: no new submissions, then up to `--drain-timeout` (the local driver: its stop timeout minus the smaller
|
|
60
|
+
of 5 s and half of it) for running work; the wake it writes is now, the wait's deadline, or null when idle. Work cut at the
|
|
61
|
+
deadline resumes on the next open (safe tools rerun, unsafe ones report the interruption). The app's work rejecting when a
|
|
62
|
+
park's release closes the Harness under it does not end the instance before its release, as for a drain.
|
|
63
|
+
- `leaseParkTarget(lease, harness)`: parking for a Harness a host opened over `openRunLease` (the wake through the lease's
|
|
64
|
+
`setStatus`; the release closes the host's Harness, then the lease).
|
|
65
|
+
- `fork --id A --new-id B` (`fork(ref, newId, { control, mountRoot })`): copies a released, sealed run (paused, sleeping, done
|
|
66
|
+
or failed, with no delegation) under two short exclusive mounts of its own into a new run that starts `paused` at
|
|
67
|
+
generation 0 with the source's `sealedSeq`, so its first open is generation 1 and a lossy copy is refused
|
|
68
|
+
(`STORE_BEHIND_SEAL`). The source is only read. `run.json`, `owner.lock`, the start mark and `tmp/` are not copied. A fork
|
|
69
|
+
owns the new run's directory only while it holds that directory's mount: one that fails after that empties it through
|
|
70
|
+
its own mount and removes it; one that lost the directory to another fork or start leaves it alone.
|
|
71
|
+
|
|
72
|
+
**The Docker host driver**
|
|
73
|
+
- `dockerHost` (`supervise --host docker --image IMAGE`): one container per instance, from the image `docker/Dockerfile`
|
|
74
|
+
builds (Node 24, the archil client 0.8.42 checked by sha256 per architecture, FUSE, tini, the run user `pda`, this
|
|
75
|
+
package). Nothing on the machine that runs the supervisor needs root, FUSE or the archil client.
|
|
76
|
+
- `docker create` named `pda-<run>-<disk key>-g<attempt>` (the disk key is 8 hex digits of the disk and region) and
|
|
77
|
+
labeled `pda.fleet`, `pda.run`, `pda.disk`, `pda.region`: a retry of the same attempt adopts a running container that
|
|
78
|
+
carries all four labels, and the supervisor removes the token it minted for that start; a dead one is replaced, and a
|
|
79
|
+
container by that name with other labels is refused. `--device /dev/fuse --cap-add SYS_ADMIN`, `--security-opt
|
|
80
|
+
no-new-privileges`, no restart policy, and `--security-opt apparmor=unconfined` only where the daemon applies
|
|
81
|
+
AppArmor (Docker's default profile denies mount(2); `apparmor: "auto"`, the default, decides from `docker info` and
|
|
82
|
+
reports why once through `note`).
|
|
83
|
+
- The mount token is copied into the created container as a root-only file (`docker cp -` of a tar built in memory),
|
|
84
|
+
which the entrypoint makes the instance's stdin and removes before the instance starts. It is never in `docker
|
|
85
|
+
inspect`, argv or an environment variable.
|
|
86
|
+
- Status from `docker inspect` (exit 0 stopped, any other exit failed, paused running), `describe` with the exit code,
|
|
87
|
+
stop as `docker stop` (drain) then `docker rm`. A dead container takes its mount with it: nothing is left on the host.
|
|
88
|
+
- The app's directory (`--app-root`) is bind-mounted read-only with its `node_modules` hidden, so the app shares the
|
|
89
|
+
image's single pi-durable.
|
|
90
|
+
- Docker instances park and drain like local ones (`--park-threshold` 60 s by default, the drain from the stop timeout),
|
|
91
|
+
and a `--restart` policy other than `no` in `dockerArgs` is refused, so a parked container stays exited until the
|
|
92
|
+
supervisor starts the next.
|
|
93
|
+
- `archilEnv(claim, { runAs })` and `run --run-as USER`: for an instance that runs as root (in a container), every command
|
|
94
|
+
runs as `runAs` with every capability set empty and no_new_privs, and `work/` plus every entry pi's in-process write,
|
|
95
|
+
append and mkdir create under it are handed to that user (`lchown` through the confinement's pinned directory). The
|
|
96
|
+
run's root, store and `run.json` stay root's; a command can neither change them nor read the archil daemon's environment.
|
|
97
|
+
- `HostDriver.start(ref, token, { attempt })`: the supervisor passes the generation the instance will open, so a driver can
|
|
98
|
+
key its start on it. Drivers that ignore it are unchanged.
|
|
99
|
+
- The image installs one version of this package: the checkout's `package.json` version, from a tarball `npm pack` wrote
|
|
100
|
+
into `docker/package` (which must be that version) or else from npm; `--build-arg PDA_VERSION` names another version or
|
|
101
|
+
a dist-tag, never by default. A package without the Docker path (a release from before it) is refused.
|
|
102
|
+
- `examples/docker-quickstart.sh`, and `--host docker` for both examples' demos. It reuses an image only when the image was
|
|
103
|
+
built from this checkout's package version, and rebuilds it otherwise.
|
|
104
|
+
- Measured with Docker Engine 29 on Ubuntu 24.04: a killed container is replaced in about 1 s and the run resumes about
|
|
105
|
+
2 s after the kill; a frozen one is replaced 7 to 8 s after the freeze (6 s test lease) and exits 75 within 0.5 s of its
|
|
106
|
+
thaw; a commit from a container costs what it costs from the host. macOS is not verified.
|
|
107
|
+
|
|
108
|
+
**Fixes**
|
|
109
|
+
- Known issue in 0.1.0-beta.10, fixed here: an idle `run` instance (no `--serve`, nothing running) exited without draining or
|
|
110
|
+
releasing once its work finished; the supervisor then revoked and restarted it. It now stays up until it parks, drains or fails.
|
|
111
|
+
|
|
112
|
+
## 0.1.0-beta.10, 2026-10-08
|
|
113
|
+
|
|
114
|
+
First release of `@parcha/pi-durable-archil`, versioned with the other packages in this repository. It is the package developed
|
|
115
|
+
as `pi-durable-archil` 0.2.0 before it was imported; its notes follow, and its earlier history is not here.
|
|
116
|
+
|
|
117
|
+
Not in this release: `serve` (wake a released run on a request, `requestRun`), sleep parking (an instance that only waits
|
|
118
|
+
releases its host and is started again at the deadline), `fork` of a sealed run, a Docker host driver and a Docker
|
|
119
|
+
quickstart.
|
|
120
|
+
|
|
121
|
+
First release: a pi-durable host on an Archil disk. Each run is the subtree `runs/<id>/`, which holds pi's store and the
|
|
122
|
+
agent's workspace.
|
|
123
|
+
|
|
124
|
+
**The claim and the fence**
|
|
125
|
+
- One exclusive mount of `runs/<id>/` per run, verified by the delegation and an fsynced probe write. A second mount is
|
|
126
|
+
refused (exit 76). The supervisor revokes a stale holder through the control API; the old holder's next fsync fails and its
|
|
127
|
+
instance exits 75.
|
|
128
|
+
- Mount tokens are reusable, 24 h, one per start attempt, passed on the root-owned wrapper's stdin
|
|
129
|
+
(`bin/archil-scoped`), never in argv or in an environment `sudo` sees; swept when no live mount needs them.
|
|
130
|
+
- Release: barrier, seal, unmount; a dead mount is cleaned, and where the kernel refuses every unmount (a Sysbox box) the
|
|
131
|
+
mount is checked in, moved aside and its daemon killed (`archil-scoped retire`).
|
|
132
|
+
- Acquire deals with a dirty mountpoint. A non-empty mountpoint with no mount on it (files written by path after a mount
|
|
133
|
+
vanished) is moved aside to `<mountRoot>/.stray/<run>-<tag>` before mounting, because archil refuses to mount over
|
|
134
|
+
entries; the error is `MOUNTPOINT_NOT_EMPTY` when it cannot. An archil daemon left on the mountpoint with no mount (a client
|
|
135
|
+
that dropped its mount after an authentication failure keeps its process and its control socket) is killed first
|
|
136
|
+
(`archil-scoped stale`; it needs `/proc` to show root's processes). archil's "an older Archil process is still running" and
|
|
137
|
+
"Failed to bind control socket" refusals are `MOUNT_FAILED` (exit 1), no longer `CLAIM_HELD` (exit 76); 76 now means a live or
|
|
138
|
+
orphaned delegation.
|
|
139
|
+
|
|
140
|
+
**The store, the environment, the run**
|
|
141
|
+
- pi's `SqliteStorage` at `synchronous = FULL` in two profiles (exclusive, shared) behind a fence-aware facade: an I/O-class
|
|
142
|
+
error marks the claim fenced and nothing is retried on it.
|
|
143
|
+
- The execution environment: pi's `NodeExecutionEnv` rooted at `work/`, commands under `no_new_privs`, the in-process
|
|
144
|
+
`read`, `write` and `edit` confined to `work/` (resolved real paths, no-follow opens from a pinned directory), `read`
|
|
145
|
+
declared replay-safe.
|
|
146
|
+
- `openDurableRun`: claim, owner lock, `run.json` (status, generation, holder, heartbeat, seal), the store, the seal check
|
|
147
|
+
(`STORE_BEHIND_SEAL`, exit 65), pi's Harness, resume. The lease self-fence runs on a worker thread, so a main thread stuck in
|
|
148
|
+
a FUSE request cannot keep a zombie's commands alive. The lease writes `run.json` and creates its directories through the
|
|
149
|
+
claim directory opened at acquire, checked against the mount table, never by path: a mount that leaves the table under a
|
|
150
|
+
live instance fences it (`CLAIM_UNMOUNTED`, exit 75) at the next heartbeat, and nothing lands under the bare mountpoint.
|
|
151
|
+
An open that fails after the lease is up, including an environment factory that throws (`setpriv` missing), releases the
|
|
152
|
+
claim and the owner lock and stops the heartbeat before it throws.
|
|
153
|
+
- `openRunLease`, the same lifecycle without a store or a Harness, and the `@parcha/pi-durable-archil/lease` entry for a host that
|
|
154
|
+
owns its Harness (`"sideEffects": false`: a bundle of that entry is about 52 KB against 493 KB for the whole package).
|
|
155
|
+
|
|
156
|
+
**The supervisor and the hosts**
|
|
157
|
+
- `ensureRunning` (orphaned, lease fresh, lease expired with best-effort stop of the holder, revoke, start) and the CLI:
|
|
158
|
+
`run --app MODULE`, `supervise` (`--every`, `--check`, `--create`, `--app`, `--sweep-tokens`), `status`, `release`. Exit
|
|
159
|
+
codes 65, 70, 75 and 76 are terminal for the host's process supervisor.
|
|
160
|
+
- `run` drains on SIGTERM: release closes the Harness, then seals and unmounts, and the drain's outcome is the exit code.
|
|
161
|
+
An app's work that rejects when the Harness closes under it ("Session is closed") does not end the instance before its
|
|
162
|
+
release, so no delegation is left orphaned where the FUSE daemon dies with the instance (a container).
|
|
163
|
+
- The start grace: every start writes `runs/<id>/start.json` (the generation the new instance will write, and when) before
|
|
164
|
+
the host driver runs. Until `run.json` reaches that generation or the grace passes (`startGraceMs`,
|
|
165
|
+
`supervise --start-grace`; default the lease expiry, 0 off), a tick reports `starting` and neither revokes nor starts,
|
|
166
|
+
so a short tick never fences the instance it just started.
|
|
167
|
+
- The start backoff: a start that ends before its first `run.json` write (76, `MOUNT_FAILED`) is counted in the
|
|
168
|
+
next start's mark (`failures`, `lastExit`), and that start's grace is doubled per consecutive failure up to
|
|
169
|
+
`startBackoffMaxMs` (`supervise --start-backoff-max`, default 10 min). One `start-backoff` line per step; the first
|
|
170
|
+
`run.json` write resets the count.
|
|
171
|
+
- `localHost`: systemd transient units (`KillMode=control-group`, restart in place), or a detached child for development.
|
|
172
|
+
Its `stop` kills the unit's FUSE scope while it is active, whatever the mount table says: a client whose filesystem
|
|
173
|
+
failed at a token refresh drops its mount but keeps the mountpoint's control socket, which refuses the next mount.
|
|
174
|
+
- `daytonaHost`: a Daytona sandbox per instance with an in-box launcher; power-off, freeze and partition takeovers measured
|
|
175
|
+
live.
|
|
176
|
+
- `deleteRunTree`: revoke, delete, and require an empty prefix.
|
|
177
|
+
|
|
178
|
+
**Package and docs**
|
|
179
|
+
- Compiled `dist/` with declarations (Node 22.19 or later), `exports` for `.` and `./lease`, a `bin`, peer ranges
|
|
180
|
+
`@earendil-works/pi-durable` and `@earendil-works/chord` `~1.0.4`.
|
|
181
|
+
- README (the Durable Object mapping, the failure table, the security model), `examples/01-durable-chat`,
|
|
182
|
+
`examples/02-paid-effect` (a charge cut in flight is never sent twice, across a kill and a freeze) and
|
|
183
|
+
`examples/verify-production-path.sh`.
|
|
184
|
+
- Live suites against a scratch disk (`test/live/`), an acceptance suite on two hosts, and `npm run verify:tarball`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED