@lunora/platform-node 0.0.0 → 1.0.0-alpha.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/LICENSE.md +111 -0
- package/README.md +11 -37
- package/dist/conformance/index.d.mts +9 -0
- package/dist/conformance/index.d.ts +9 -0
- package/dist/conformance/index.mjs +1 -0
- package/dist/index.d.mts +517 -0
- package/dist/index.d.ts +517 -0
- package/dist/index.mjs +1 -0
- package/dist/packem_shared/createNodeGlobalStore-BvteXWRK.mjs +1 -0
- package/dist/packem_shared/createNodePlatform-BQimmgT9.mjs +1 -0
- package/dist/packem_shared/createNodeQueueHost-CLQ5hOBf.mjs +17 -0
- package/dist/packem_shared/createNodeR2Bucket-Wb8pyi2X.mjs +1 -0
- package/dist/packem_shared/createNodeSchedulerHost-DRjZhuxe.mjs +15 -0
- package/dist/packem_shared/createNodeShardHost-DEHe5Vcm.mjs +1 -0
- package/dist/packem_shared/createNodeShardKvStore-BfKCQTjE.mjs +1 -0
- package/dist/packem_shared/createNodeShardRegistry-0iSMdi9-.mjs +1 -0
- package/dist/packem_shared/createNodeShardState-DdOj9FzJ.mjs +1 -0
- package/dist/packem_shared/createNodeSocketHost-CytowrYN.mjs +2 -0
- package/dist/packem_shared/createNodeWorkflowHost-Dht_jgSv.mjs +1 -0
- package/dist/packem_shared/createNodeWorkflowStore-jlNR6Y3h.mjs +21 -0
- package/dist/packem_shared/to-array-buffer-CP4NlF-y.mjs +1 -0
- package/package.json +59 -7
package/LICENSE.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, Apache 2.0 Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 anolilab and contributors
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or service
|
|
34
|
+
that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software that
|
|
39
|
+
exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee using
|
|
52
|
+
the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to the
|
|
59
|
+
infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN
|
|
79
|
+
IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following will
|
|
93
|
+
apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
|
106
|
+
|
|
107
|
+
<!-- DEPENDENCIES -->
|
|
108
|
+
<!-- /DEPENDENCIES -->
|
|
109
|
+
|
|
110
|
+
<!-- TYPE_DEPENDENCIES -->
|
|
111
|
+
<!-- /TYPE_DEPENDENCIES -->
|
package/README.md
CHANGED
|
@@ -1,45 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@lunora/platform-node`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Spike (plan 234).** A Node implementation of the [`@lunora/platform`](../platform) host contracts — `ShardHost`, `SocketHost`, `ShardDirectory`, `ShardKvStore`, `SchedulerHost` — over `better-sqlite3` and an in-process socket/directory/scheduler registry.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`@lunora/platform` defines _what_ a host must provide; `@lunora/platform-cloudflare` provides it for Cloudflare. This package provides it for a plain Node process, promoted from `@lunora/platform`'s `node:sqlite` reference host (`src/conformance/reference-host.ts`) and hardened toward real persistence semantics (a real `better-sqlite3` file, `node:v8` structured-clone-fidelity serialization for KV).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```ts
|
|
8
|
+
import { createNodePlatform } from "@lunora/platform-node";
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
const platform = createNodePlatform({ path: "./shard.sqlite3" });
|
|
11
|
+
```
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@lunora/platform-node`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
13
|
+
## Why it exists
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
Portability was a claim, not a construction check — `PLATFORM_MATRICES` held exactly one entry (`cloudflare`), so nothing had exercised the contract against a second host. This package stands one up and runs the existing conformance TCK (`@lunora/platform/conformance`) against it; every place the engine or the TCK needed something the contract didn't promise is recorded in [`plans/234-node-host-findings.md`](../../plans/234-node-host-findings.md).
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
## Scope
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
To properly configure OIDC trusted publishing for this package:
|
|
23
|
-
|
|
24
|
-
1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
|
|
25
|
-
2. Configure the trusted publisher (e.g., GitHub Actions)
|
|
26
|
-
3. Specify the repository and workflow that should be allowed to publish
|
|
27
|
-
4. Use the configured workflow to publish your actual package
|
|
28
|
-
|
|
29
|
-
## DO NOT USE THIS PACKAGE
|
|
30
|
-
|
|
31
|
-
This package is a placeholder for OIDC configuration only. It:
|
|
32
|
-
- Contains no executable code
|
|
33
|
-
- Provides no functionality
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
36
|
-
|
|
37
|
-
## More Information
|
|
38
|
-
|
|
39
|
-
For more details about npm's trusted publishing feature, see:
|
|
40
|
-
- [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
|
|
41
|
-
- [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
**Maintained for OIDC setup purposes only**
|
|
19
|
+
This is a **spike**, not a production target: it is not wired into `lunora dev`, has no deploy driver, and several capabilities are honestly rated `emulated`/`unsupported` in its capability matrix entry (see `@lunora/platform`'s `NODE_CAPABILITIES`). Wiring it into the dev server is the payoff and a follow-up, not this change.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConformanceHost } from '@lunora/platform/conformance';
|
|
2
|
+
/**
|
|
3
|
+
* Build a fresh, isolated Node host for one TCK run, backed by an in-memory
|
|
4
|
+
* (`:memory:`) `better-sqlite3` database — every run gets a private database,
|
|
5
|
+
* the same isolation the reference host's fresh `node:sqlite` connection
|
|
6
|
+
* gives, and fast because there is no file I/O.
|
|
7
|
+
*/
|
|
8
|
+
declare const createNodeConformanceHost: () => ConformanceHost;
|
|
9
|
+
export { createNodeConformanceHost };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConformanceHost } from '@lunora/platform/conformance';
|
|
2
|
+
/**
|
|
3
|
+
* Build a fresh, isolated Node host for one TCK run, backed by an in-memory
|
|
4
|
+
* (`:memory:`) `better-sqlite3` database — every run gets a private database,
|
|
5
|
+
* the same isolation the reference host's fresh `node:sqlite` connection
|
|
6
|
+
* gives, and fast because there is no file I/O.
|
|
7
|
+
*/
|
|
8
|
+
declare const createNodeConformanceHost: () => ConformanceHost;
|
|
9
|
+
export { createNodeConformanceHost };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createNodeShardKvStore as f}from"../packem_shared/createNodeShardKvStore-BfKCQTjE.mjs";import{createNodeSchedulerHost as y}from"../packem_shared/createNodeSchedulerHost-DRjZhuxe.mjs";import{createNodeShardHost as k}from"../packem_shared/createNodeShardHost-DEHe5Vcm.mjs";import{createNodeShardRegistry as D}from"../packem_shared/createNodeShardRegistry-0iSMdi9-.mjs";import{createNodeSocketHost as N}from"../packem_shared/createNodeSocketHost-CytowrYN.mjs";const b=()=>{const{database:r,dispose:c,host:i}=k(),m=f(r),a=D(),{directory:n}=a,{readFrames:h,restoreSocket:l,simulateRecycle:u,socket:p}=N(r),s=new Set,{dispose:w,scheduler:d,simulateDeadLetter:S}=y(r,{onDispatch:(e,t,o)=>{s.add(o.id)}});return{awaitAlarmFired:async e=>{await new Promise(t=>{setTimeout(t,Math.max(0,e-Date.now())+30)})},awaitJobDispatched:async e=>{const t=(await d.list?.())?.find(o=>o.id===e);return t!==void 0&&await new Promise(o=>{setTimeout(o,Math.max(0,t.scheduledFor-Date.now())+30)}),s.has(e)},cleanup:()=>{w(),c(),a.close()},directory:n,kv:m,readFrames:h,restoreSocket:l,scheduler:d,shard:i,simulateDeadLetter:S,simulateRecycle:u,socket:p}};export{b as createNodeConformanceHost};
|