@lunora/shard-engine 0.0.0 → 1.0.0-alpha.10
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 +122 -0
- package/README.md +10 -38
- package/dist/conformance/index.d.mts +24 -0
- package/dist/conformance/index.d.ts +24 -0
- package/dist/conformance/index.mjs +1 -0
- package/dist/index.d.mts +1998 -0
- package/dist/index.d.ts +1998 -0
- package/dist/index.mjs +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-vj2G8OR6.mjs +1 -0
- package/dist/packem_shared/AGGREGATE_SQL_FUNCTION-QYaiuty4.mjs +1 -0
- package/dist/packem_shared/AGG_COUNT-Bzd34FRk.mjs +1 -0
- package/dist/packem_shared/AUDIT_LOG_TABLE-CaA0jL0L.mjs +8 -0
- package/dist/packem_shared/CDC_LOG_TABLE-BYLRV7-q.mjs +8 -0
- package/dist/packem_shared/CLIENT_WATERMARK_TABLE-CXsSLU8D.mjs +7 -0
- package/dist/packem_shared/ConflictError-C8GtJmjS.mjs +1 -0
- package/dist/packem_shared/CountRlsUnsupportedError-B2WKJD9v.mjs +1 -0
- package/dist/packem_shared/DATA_MIGRATION_STATE_TABLE-BZMVrLcy.mjs +31 -0
- package/dist/packem_shared/DEFAULT_MAX_RELATION_KEYS-bq00btqV.mjs +1 -0
- package/dist/packem_shared/DEFAULT_MAX_RELAYS-Bql_LKaq.mjs +1 -0
- package/dist/packem_shared/DEFAULT_PROMOTION_THRESHOLDS-AgPry7WL.mjs +1 -0
- package/dist/packem_shared/DEFAULT_TRANSACTION_LIMITS-BH5q0Ror.mjs +1 -0
- package/dist/packem_shared/FTS_COUNT_COLUMN-D1gY3wwZ-CZHdaRrd.mjs +1 -0
- package/dist/packem_shared/GEO_DEFAULT_PRECISION-okRCkZ6r.mjs +1 -0
- package/dist/packem_shared/GLOBAL_SHAPE_SNAPSHOT_TABLE-DX-6-gBP.mjs +7 -0
- package/dist/packem_shared/IDEMPOTENCY_TABLE-DjkEMp6w.mjs +7 -0
- package/dist/packem_shared/MAIL_RETENTION-KmozO2NQ.mjs +18 -0
- package/dist/packem_shared/MAX_SQL_ROWS-nMwkxv5f.mjs +2 -0
- package/dist/packem_shared/NotFoundError-BhF7FeFr.mjs +1 -0
- package/dist/packem_shared/NotUniqueError-DCzs_EKE.mjs +1 -0
- package/dist/packem_shared/QUEUE_TABLE-DYCDvzTG.mjs +17 -0
- package/dist/packem_shared/RANK_TIEBREAK-9NU5s_mi.mjs +1 -0
- package/dist/packem_shared/RELATION_EXISTS_KEY-BaqSIFU1.mjs +1 -0
- package/dist/packem_shared/RLS_UNWRAP_SYMBOL-CBYPlYBb.mjs +1 -0
- package/dist/packem_shared/ReactiveCache-D7tpXME6.mjs +1 -0
- package/dist/packem_shared/SCAN_DEP-D_yR9EeV.mjs +1 -0
- package/dist/packem_shared/SCHEMA_HISTORY_MAX_VERSIONS-CHXz6p_z.mjs +6 -0
- package/dist/packem_shared/SEARCH_STATE_TABLE-eLN8U5tz.mjs +1 -0
- package/dist/packem_shared/ShardRunner-DIqVdWtk.mjs +1 -0
- package/dist/packem_shared/aggregateTableName-G-eXyjcz.mjs +1 -0
- package/dist/packem_shared/applyOnDelete-uFRC5p1d.mjs +1 -0
- package/dist/packem_shared/applySelect-B0CF8T7y.mjs +1 -0
- package/dist/packem_shared/armRestore-BNzdvQ_o.mjs +1 -0
- package/dist/packem_shared/awaitWsDrain-BO5x5HYv.mjs +1 -0
- package/dist/packem_shared/backfillAggregateIndexes-DSA1Pf3L.mjs +1 -0
- package/dist/packem_shared/buildIndexRange-DFsdtPjD.mjs +1 -0
- package/dist/packem_shared/buildPokeFrames-FXWhJFyr.mjs +1 -0
- package/dist/packem_shared/buildSettings-DT18_DkX.mjs +1 -0
- package/dist/packem_shared/compileWhereSql-BLcfs4QW.mjs +1 -0
- package/dist/packem_shared/computeRankPage-IUSS-zIB.mjs +1 -0
- package/dist/packem_shared/createCompanionSync-BU85IZPJ.mjs +1 -0
- package/dist/packem_shared/createReadFootprint-DIrrxRTE.mjs +1 -0
- package/dist/packem_shared/createSystemReader-DcDcrtM3.mjs +1 -0
- package/dist/packem_shared/defineEngineContractSuite-DA9Xajwm.mjs +1 -0
- package/dist/packem_shared/diffExternalSource-DMpkJta1.mjs +1 -0
- package/dist/packem_shared/estimate-bytes-DwQON1Ky.mjs +1 -0
- package/dist/packem_shared/exportShardRows-kt42wijd.mjs +1 -0
- package/dist/packem_shared/hasTrigger-CbkOHExZ.mjs +1 -0
- package/dist/packem_shared/isSoftDeleted-CbykrrSZ.mjs +9 -0
- package/dist/packem_shared/liftSourceId-DApAbu7Q.mjs +1 -0
- package/dist/packem_shared/materializeExternalRows-DgG38W3I.mjs +1 -0
- package/dist/packem_shared/mergeChangedKeys-BXtUgIPW.mjs +1 -0
- package/dist/packem_shared/param-B5lF5Jd9.mjs +1 -0
- package/dist/packem_shared/quote-identifier-CGiYFBvY.mjs +1 -0
- package/dist/packem_shared/runDrizzle-GKR3y97k.mjs +1 -0
- package/dist/packem_shared/runShardMigrations-CJ9Fkslb.mjs +5 -0
- package/dist/packem_shared/runSocketPool-DPQLVyWF.mjs +1 -0
- package/dist/packem_shared/selectExpiredIds-CFLRQUFO.mjs +1 -0
- package/dist/packem_shared/selectShapeMemberIds-DK74eAPs.mjs +1 -0
- package/dist/packem_shared/serializeSqlValue-DnpyaLcw.mjs +1 -0
- package/dist/packem_shared/stableStringify-BjLh4gvA.mjs +1 -0
- package/dist/packem_shared/stableWireKey-C2NzK-K_.mjs +1 -0
- package/dist/packem_shared/wire-codec-ivyqGF-j.mjs +1 -0
- package/package.json +55 -7
package/LICENSE.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
|
|
109
|
+
# Licenses of bundled dependencies
|
|
110
|
+
The published @lunora/shard-engine artifact additionally contains code with the following licenses:
|
|
111
|
+
Apache-2.0
|
|
112
|
+
|
|
113
|
+
# Bundled dependencies:
|
|
114
|
+
## drizzle-orm
|
|
115
|
+
License: Apache-2.0
|
|
116
|
+
By: Drizzle Team
|
|
117
|
+
Repository: git+https://github.com/drizzle-team/drizzle-orm.git
|
|
118
|
+
|
|
119
|
+
<!-- /DEPENDENCIES -->
|
|
120
|
+
|
|
121
|
+
<!-- TYPE_DEPENDENCIES -->
|
|
122
|
+
<!-- /TYPE_DEPENDENCIES -->
|
package/README.md
CHANGED
|
@@ -1,45 +1,17 @@
|
|
|
1
1
|
# @lunora/shard-engine
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Host-neutral reactive engine for Lunora.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package holds the per-shard state machine that powers Lunora's real-time features:
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- Optimistic concurrency control (OCC)
|
|
8
|
+
- Change-data-capture (`__cdc_log`) and reactive subscription fan-out
|
|
9
|
+
- Dependency tracking and the reactive cache
|
|
10
|
+
- Relations, aggregates, ranks, and search
|
|
11
|
+
- The `pokeStart`/`pokePart`/`pokeEnd` subscription protocol
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
It consumes the provider-neutral host contracts from `@lunora/platform` (`ShardHost`, `SocketHost`, `ShardDirectory`, `SchedulerHost`) and can be mounted on any platform host.
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@lunora/shard-engine`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
15
|
+
## Status
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
|
|
19
|
-
|
|
20
|
-
## Setup Instructions
|
|
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**
|
|
17
|
+
Phase 2 of plan 114. The engine is being extracted from `@lunora/do`; `@lunora/do` will shrink to the Cloudflare host binding that wires `ShardHost`/`SocketHost` to Durable Objects.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ShardHost, SocketHandle, SocketHost } from '@lunora/platform';
|
|
2
|
+
interface EngineVitestApi {
|
|
3
|
+
describe: (name: string, body: () => void) => void;
|
|
4
|
+
expect: (actual: unknown) => {
|
|
5
|
+
rejects: {
|
|
6
|
+
toBeInstanceOf: (ctor: unknown) => Promise<void>;
|
|
7
|
+
toThrow: (matcher?: unknown) => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
toBe: (expected: unknown) => void;
|
|
10
|
+
toBeInstanceOf: (ctor: unknown) => void;
|
|
11
|
+
toBeUndefined: () => void;
|
|
12
|
+
toStrictEqual: (expected: unknown) => void;
|
|
13
|
+
};
|
|
14
|
+
it: (name: string, body: () => Promise<void> | void) => void;
|
|
15
|
+
}
|
|
16
|
+
type EngineHostFactory = () => {
|
|
17
|
+
close?: () => void;
|
|
18
|
+
createSocket?: () => unknown;
|
|
19
|
+
host: ShardHost;
|
|
20
|
+
readFrames: (socket: SocketHandle) => Promise<string[]> | string[];
|
|
21
|
+
sockets: SocketHost;
|
|
22
|
+
};
|
|
23
|
+
declare const defineEngineContractSuite: (name: string, factory: EngineHostFactory, vitest: EngineVitestApi) => void;
|
|
24
|
+
export { type EngineHostFactory, type EngineVitestApi, defineEngineContractSuite };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ShardHost, SocketHandle, SocketHost } from '@lunora/platform';
|
|
2
|
+
interface EngineVitestApi {
|
|
3
|
+
describe: (name: string, body: () => void) => void;
|
|
4
|
+
expect: (actual: unknown) => {
|
|
5
|
+
rejects: {
|
|
6
|
+
toBeInstanceOf: (ctor: unknown) => Promise<void>;
|
|
7
|
+
toThrow: (matcher?: unknown) => Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
toBe: (expected: unknown) => void;
|
|
10
|
+
toBeInstanceOf: (ctor: unknown) => void;
|
|
11
|
+
toBeUndefined: () => void;
|
|
12
|
+
toStrictEqual: (expected: unknown) => void;
|
|
13
|
+
};
|
|
14
|
+
it: (name: string, body: () => Promise<void> | void) => void;
|
|
15
|
+
}
|
|
16
|
+
type EngineHostFactory = () => {
|
|
17
|
+
close?: () => void;
|
|
18
|
+
createSocket?: () => unknown;
|
|
19
|
+
host: ShardHost;
|
|
20
|
+
readFrames: (socket: SocketHandle) => Promise<string[]> | string[];
|
|
21
|
+
sockets: SocketHost;
|
|
22
|
+
};
|
|
23
|
+
declare const defineEngineContractSuite: (name: string, factory: EngineHostFactory, vitest: EngineVitestApi) => void;
|
|
24
|
+
export { type EngineHostFactory, type EngineVitestApi, defineEngineContractSuite };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineEngineContractSuite as t}from"../packem_shared/defineEngineContractSuite-DA9Xajwm.mjs";export{t as defineEngineContractSuite};
|