@parallax-rn/protocol 0.0.0-stage → 0.1.0-beta.2
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/LICENSE +72 -0
- package/README.md +34 -2
- package/contract.snapshot.json +1142 -0
- package/dist/contract.d.ts +517 -0
- package/dist/contract.js +264 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +37 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +62 -0
- package/dist/metro-requests.d.ts +2 -0
- package/dist/metro-requests.js +15 -0
- package/dist/names.d.ts +5 -0
- package/dist/names.js +9 -0
- package/dist/registration.d.ts +3 -0
- package/dist/registration.js +24 -0
- package/dist/rules.d.ts +37 -0
- package/dist/rules.js +113 -0
- package/dist/schema.d.ts +85 -0
- package/dist/schema.js +167 -0
- package/dist/source-id.d.ts +7 -0
- package/dist/source-id.js +25 -0
- package/dist/sources.d.ts +9 -0
- package/dist/sources.js +22 -0
- package/dist/version.d.ts +17 -0
- package/dist/version.js +30 -0
- package/package.json +20 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
PARALLAX LICENSE (BETA TERMS, VERSION 1, 2026-10-28)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Valiantsin Tsikhamirau. All rights reserved.
|
|
4
|
+
Contact: zemantservices@gmail.com, https://parallax-rn.dev
|
|
5
|
+
|
|
6
|
+
1. Definitions
|
|
7
|
+
"Software" means this package of Parallax for React Native, including its code, documentation and any updates the Licensor supplies. "You" means the person or
|
|
8
|
+
organization that installs or uses the Software. "Licensor" means Valiantsin Tsikhamirau, the author of the Software. "Your Applications" means software that You
|
|
9
|
+
develop or maintain.
|
|
10
|
+
|
|
11
|
+
2. Grant of license
|
|
12
|
+
The Licensor grants You a worldwide, non-exclusive, non-transferable, revocable, royalty-free license, free of charge, to install and use the Software
|
|
13
|
+
for Your own personal or internal business purposes, including the commercial development, testing and debugging of Your Applications. This includes:
|
|
14
|
+
(a) adding the in-app SDK and the Babel plugin of the Software to Your Applications as development dependencies;
|
|
15
|
+
(b) building, distributing and selling Your Applications, even when a build of Your Application contains code of the SDK or of the Babel plugin, as long
|
|
16
|
+
as that code stays a part of Your Application and is not offered on its own;
|
|
17
|
+
(c) keeping copies of the Software in Your organization's internal package mirrors, registries, caches, continuous integration systems, lock files and
|
|
18
|
+
vendored dependency folders, for use under this license by Your own staff and contractors;
|
|
19
|
+
(d) installing it on any number of machines used by You, Your staff or Your contractors working on Your Applications.
|
|
20
|
+
|
|
21
|
+
3. Restrictions
|
|
22
|
+
Except as this license expressly allows or as mandatory law allows despite this limit, You may not:
|
|
23
|
+
(a) modify, adapt, translate or create derivative works of the Software;
|
|
24
|
+
(b) distribute, sublicense, sell, rent, lease, lend, host as a service or otherwise make the Software or any part of it available to others outside Your
|
|
25
|
+
organization, including by publishing it to a public package registry or repository, except as section 2 allows;
|
|
26
|
+
(c) reverse engineer, decompile or disassemble the Software, or try to obtain its source code;
|
|
27
|
+
(d) use the Software, its output or its documentation to build, train or benchmark a product or service that competes with the Software, or give the
|
|
28
|
+
Software to a person for that purpose;
|
|
29
|
+
(e) remove or change any copyright, license or other notice in the Software.
|
|
30
|
+
|
|
31
|
+
4. Third-party components
|
|
32
|
+
The Software contains third-party components under their own licenses, listed in the file THIRD_PARTY_NOTICES where the package contains one. Those licenses,
|
|
33
|
+
not this one, govern those components.
|
|
34
|
+
|
|
35
|
+
5. Ownership
|
|
36
|
+
The Software is licensed, not sold. The Licensor keeps all rights not expressly granted. This license grants no right to the Licensor's name or marks.
|
|
37
|
+
Your Applications, their data and the output of Your agents stay Yours.
|
|
38
|
+
|
|
39
|
+
6. Data
|
|
40
|
+
The Software runs on Your machine. It has no account, no telemetry and no analytics, and it does not send data to the Licensor. What it reads from Your
|
|
41
|
+
application and simulator or emulator (the screen, the component tree, logs, errors, network requests, state and navigation) is returned to the AI agent
|
|
42
|
+
You connect to it, such as Claude Code or Codex, and that agent sends what it receives to its own provider under that provider's terms. The Licensor does
|
|
43
|
+
not control that. The Software removes known secrets from network and state data before an agent receives them; logs and errors are passed on as Your
|
|
44
|
+
application wrote them.
|
|
45
|
+
|
|
46
|
+
7. Beta software
|
|
47
|
+
The Software is a beta. It may change, stop working or be withdrawn at any time, and later versions may come under different terms, including paid terms
|
|
48
|
+
for some parts. A version You received under this license stays under this license.
|
|
49
|
+
|
|
50
|
+
8. Termination
|
|
51
|
+
This license ends automatically if You breach it. Then You must stop using the Software and delete all copies, except copies inside builds of Your
|
|
52
|
+
Applications that section 2(b) allows. You may end it at any time by deleting the Software. Sections 3, 5, 9, 10 and 11 survive.
|
|
53
|
+
|
|
54
|
+
9. No warranty
|
|
55
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
56
|
+
PURPOSE AND NON-INFRINGEMENT.
|
|
57
|
+
|
|
58
|
+
10. Limitation of liability
|
|
59
|
+
TO THE EXTENT THE LAW ALLOWS, THE LICENSOR IS NOT LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES, OR FOR LOST PROFITS OR DATA,
|
|
60
|
+
ARISING FROM THE SOFTWARE OR ITS USE, AND THE LICENSOR'S TOTAL LIABILITY IS LIMITED TO THE AMOUNT YOU PAID FOR THE SOFTWARE (ZERO FOR THE FREE LICENSE).
|
|
61
|
+
NOTHING IN THIS LICENSE LIMITS LIABILITY FOR INTENT OR GROSS NEGLIGENCE, OR ANY LIABILITY THAT CANNOT BE LIMITED BY LAW.
|
|
62
|
+
|
|
63
|
+
11. General
|
|
64
|
+
(a) Governing law and courts. This license is governed by the law of the Republic of Belarus, without regard to its conflict of laws rules. The courts of
|
|
65
|
+
Minsk, Belarus, have jurisdiction over any dispute about it. If You are a consumer, nothing in this license takes away a protection that the law of the
|
|
66
|
+
country where You live gives You and that cannot be waived by agreement, including Your right to bring a claim in Your own courts.
|
|
67
|
+
(b) Severability. If a court finds a part of this license invalid, that part is limited to the minimum extent needed and the rest stays in force.
|
|
68
|
+
(c) Entire agreement. This license is the entire agreement between You and the Licensor about the Software and replaces any earlier statement about it.
|
|
69
|
+
A paid tier, if one is offered later, comes with its own terms.
|
|
70
|
+
(d) Export. You must comply with the export control and sanctions laws that apply to You when You use or move the Software.
|
|
71
|
+
(e) No waiver. If the Licensor does not enforce a term, the Licensor keeps the right to enforce it later.
|
|
72
|
+
(f) Language. This license is written in English; a translation is for convenience only.
|
package/README.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @parallax-rn/protocol
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The shared contract between the app (`@parallax-rn/sdk`, `@parallax-rn/babel-plugin`) and the server: wire shapes with validators, error codes, the names of the documented globals and the protocol version rules. It has **no dependencies of any kind** and no side effects when imported (decisions 0007 and 0012); the workspace check enforces both.
|
|
4
|
+
|
|
5
|
+
## Documented globals
|
|
6
|
+
- `globalThis.__PARALLAX_RN__` (`GLOBAL_NAME`): the container the app exposes. Field names are fixed and only ever added.
|
|
7
|
+
- `sources`: source tables written by the build plugin, keyed by project-relative file.
|
|
8
|
+
- `sdk`: the SDK's API object (`handshake`, `drain`, `commands`, `call`). Every method takes zero or one JSON string and returns a JSON string (`call` returns a promise of one), because binding payloads must be strings.
|
|
9
|
+
- `globalThis.__PARALLAX_RN_PUSH__` (`PUSH_BINDING_NAME`): the CDP binding used for push. It does not exist in a fresh process until a session adds it, so callers check `typeof` first (decision 0010).
|
|
10
|
+
- Code the plugin emits into the app comes from `registrationSource(table)`: plain ES2015-parsable code guarded by `__DEV__`.
|
|
11
|
+
|
|
12
|
+
## Protocol version
|
|
13
|
+
`PROTOCOL_VERSION` is `[major, minor]`, currently `[0, 3]` (0.2 added the optional `plugin` field of a source table: the version of the build plugin that wrote it; 0.3 the optional `root` field: the plugin root relative to the directory Babel ran in), independent of the package versions.
|
|
14
|
+
| Local | Remote | Result |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| major differs | | mismatch |
|
|
17
|
+
| major 0, minor differs | | mismatch (compatibility holds only within one `0.minor`) |
|
|
18
|
+
| major 1 or later, minor differs | | compatible; the server only notes which side is newer |
|
|
19
|
+
| same | | compatible |
|
|
20
|
+
A mismatch is a warning, never a stop. `compareProtocol(local, remote)` returns the relation and a message. Messages from the app are validated with the `parse*` functions; invalid ones are dropped and counted by the caller.
|
|
21
|
+
|
|
22
|
+
## What is in the contract
|
|
23
|
+
Handshake, log and error entries with ring-buffer cursors (`seq` starts at 1; `0` means none yet), drain request and result, the push batch, the command registry and call result, error shapes and codes, and the source table (one row per JSX element). Each shape is defined once in `src/contract.ts` with a small schema language (`src/schema.ts`), which gives the TypeScript type, the validator and the canonical description at once. Validators are tolerant readers: extra fields on objects and extra trailing items in tuples are accepted, so a newer peer that adds optional fields does not break an older reader. Source-table paths must be project-relative (no absolute paths, no `..`). Log and error entries carry an optional `truncated` flag set when the SDK cut a message (or a stack) to its per-entry size cap, and a command may describe its arguments in an optional `argsHint` text (for example `{ id: string }`) so an agent knows what to pass.
|
|
24
|
+
|
|
25
|
+
## Changing the contract
|
|
26
|
+
1. Edit the contract.
|
|
27
|
+
2. Bump `PROTOCOL_VERSION` in `src/version.ts`: minor for adding optional fields, commands or events; major for removing, renaming or changing the meaning of anything.
|
|
28
|
+
3. `npm run build`, then `npm run contract:update -w @parallax-rn/protocol`. The script refuses to record a changed contract under an unchanged version; the flag `-- --allow-unchanged-version` overrides that for a deliberate exception and must be called out in the commit message.
|
|
29
|
+
4. Commit `contract.snapshot.json` with the change. A test fails whenever the committed snapshot differs from the contract in the code.
|
|
30
|
+
|
|
31
|
+
## Who may depend on it
|
|
32
|
+
`sdk`, `babel-plugin`, `connection` and `mcp`, at the exact lockstep version. The built output may import only relative files.
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
Proprietary and free to use (decision 0014): see `LICENSE` in the package. The text is the beta terms, version 1. Tested on React Native 0.87.1.
|