@eidos.space/eidos-file 0.1.0 → 2.0.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.
- package/DEVELOPER_PLATFORM.md +55 -53
- package/FIELD-CONVERSION.md +75 -0
- package/README.md +89 -106
- package/dist/adapter-contract-BRKKEulb.d.mts +1110 -0
- package/dist/adapter-contract-BRKKEulb.d.mts.map +1 -0
- package/dist/better-sqlite3.d.mts +64 -3
- package/dist/better-sqlite3.d.mts.map +1 -1
- package/dist/better-sqlite3.mjs +395 -14
- package/dist/better-sqlite3.mjs.map +1 -1
- package/dist/browser.d.mts +4 -3
- package/dist/browser.d.mts.map +1 -1
- package/dist/browser.mjs +30 -11
- package/dist/browser.mjs.map +1 -1
- package/dist/csv-BQPkzC5Y.mjs +386 -0
- package/dist/csv-BQPkzC5Y.mjs.map +1 -0
- package/dist/csv.d.mts +4 -2
- package/dist/csv.d.mts.map +1 -1
- package/dist/csv.mjs +1 -248
- package/dist/index.d.mts +327 -18
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3555 -4
- package/dist/index.mjs.map +1 -0
- package/dist/node-sqlite.d.mts +98 -0
- package/dist/node-sqlite.d.mts.map +1 -0
- package/dist/node-sqlite.mjs +684 -0
- package/dist/node-sqlite.mjs.map +1 -0
- package/dist/runtime-9_adwQ0y.mjs +5637 -0
- package/dist/runtime-9_adwQ0y.mjs.map +1 -0
- package/dist/runtime-C9IcEeTi.d.mts +728 -0
- package/dist/runtime-C9IcEeTi.d.mts.map +1 -0
- package/dist/select-options-CfNwfc_a.mjs +561 -0
- package/dist/select-options-CfNwfc_a.mjs.map +1 -0
- package/dist/sqlite-wasm-BM6hsxH8.mjs +2007 -0
- package/dist/sqlite-wasm-BM6hsxH8.mjs.map +1 -0
- package/dist/temporal-fyRCzJjy.d.mts +517 -0
- package/dist/temporal-fyRCzJjy.d.mts.map +1 -0
- package/package.json +11 -4
- package/dist/csv.mjs.map +0 -1
- package/dist/host-CqP1MeMK.d.mts +0 -213
- package/dist/host-CqP1MeMK.d.mts.map +0 -1
- package/dist/host-D5kZAhga.mjs +0 -478
- package/dist/host-D5kZAhga.mjs.map +0 -1
- package/dist/relation-values-B0JhHBjZ.mjs +0 -232
- package/dist/relation-values-B0JhHBjZ.mjs.map +0 -1
- package/dist/runtime-C3bstvB8.d.mts +0 -465
- package/dist/runtime-C3bstvB8.d.mts.map +0 -1
- package/dist/runtime-CWC5y95G.mjs +0 -2907
- package/dist/runtime-CWC5y95G.mjs.map +0 -1
package/DEVELOPER_PLATFORM.md
CHANGED
|
@@ -1,66 +1,68 @@
|
|
|
1
|
-
# Eidos
|
|
1
|
+
# Eidos 1.0 implementation boundary
|
|
2
2
|
|
|
3
|
-
This
|
|
4
|
-
|
|
3
|
+
This package implements the frozen four-layer Eidos 1.0 contract. The English
|
|
4
|
+
documents in [`docs/specs`](../../docs/specs/README.md) are normative; the
|
|
5
|
+
Chinese documents are item-by-item references.
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
| Layer | Implementation owner | May depend on | Must not own |
|
|
8
|
+
| ----------- | ----------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------ |
|
|
9
|
+
| File Format | canonical DDL, values and validation in this package | SQLite 3.45 baseline | Host lifecycle or presentation |
|
|
10
|
+
| Runtime | `Runtime` / `EidosRuntimeService` | `ConnectionPort`, Clock, Entropy, Cancellation | paths, handles, publication authority |
|
|
11
|
+
| Adapter | Connection ports, Adapter transport, product `HostServices` | Runtime factory/service | alternate File semantics |
|
|
12
|
+
| UI | `EidosUIKernel` and trusted renderers | `RuntimeClient`, `HostServices` | SQL, format decoding, local canonical undo |
|
|
7
13
|
|
|
8
|
-
|
|
9
|
-
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
10
|
-
| File-based Space | A folder is the source of truth; `@eidos.space/file-space` reads, writes, watches, previews, and indexes Markdown and binary files | Remains a Node/Desktop Space runtime. It is not part of the Eidos File SDK |
|
|
11
|
-
| File handlers | Installed extension contributions select editors for Markdown, code, media, and other paths | Remains the Eidos extension system. Public React views use a separate trusted registry |
|
|
12
|
-
| Eidos File | A `.eidos` SQLite database with portable tables, fields, views, relations, queries, and mutations | Owned by `@eidos.space/eidos-file` |
|
|
13
|
-
| Browser editor | File picker/import fallback, SQLite WASM, save state, conflict checks, and recovery | Reusable lifecycle moved behind `@eidos.space/eidos-file/browser` and `EidosFileSession` |
|
|
14
|
-
| Desktop editor | File Space services and Electron-owned filesystem access provide an app-specific data source | Stays behind the same public `EidosFileDataSource`; IPC is never public |
|
|
15
|
-
| React editor | Grid, Gallery, Kanban, view routing, selection, commands, and host theme | Owned by `@eidos.space/eidos-file-ui` |
|
|
14
|
+
## Connection conformance
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
The reference SQLite implementations expose EA-Connection-1.0 tagged values,
|
|
17
|
+
transactions, snapshots, cancellation profiles and limits:
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- Asset previews are host resolvers. Views receive URLs, never unrestricted
|
|
28
|
-
filesystem access.
|
|
19
|
+
- Browser: `SQLiteWasmConnectionPort`, hosted beside Runtime in a Dedicated
|
|
20
|
+
Worker and reached through Adapter transport.
|
|
21
|
+
- Desktop: `BetterSqlite3ConnectionPort`, kept behind the trusted main-process
|
|
22
|
+
composition.
|
|
23
|
+
- Electron 43: `NodeSqliteConnectionPort`, using Node 24's built-in
|
|
24
|
+
`node:sqlite` inside an Eidos Lite utility process. It snapshots with
|
|
25
|
+
`DatabaseSync.serialize()` and cancels by terminating the owning process
|
|
26
|
+
because Node does not expose `sqlite3_interrupt()`.
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
No port exposes SQLite to UI. All run the mandatory SQLite/JSON1/STRICT/
|
|
29
|
+
RETURNING/int64/scalar-function probes before Runtime opens a File.
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
EidosFileHandle ──read/write/CAS──> EidosFileSession
|
|
34
|
-
│
|
|
35
|
-
EidosFileRuntimeAdapter
|
|
36
|
-
│
|
|
37
|
-
EidosFileDataSource
|
|
38
|
-
│
|
|
39
|
-
React View Host
|
|
40
|
-
```
|
|
31
|
+
## Runtime conformance
|
|
41
32
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
`Runtime.open` verifies Adapter capabilities and File identity. A readwrite
|
|
34
|
+
binding additionally verifies Writer structural preconditions. `Runtime.create`
|
|
35
|
+
executes the exact File DDL in the Adapter-owned outer transaction and creates
|
|
36
|
+
no default Table.
|
|
46
37
|
|
|
47
|
-
|
|
38
|
+
The public service uses Field IDs and logical values only. Reads are columnar
|
|
39
|
+
and revision-bound. Cursors are authenticated, stateless keyset boundaries.
|
|
40
|
+
Aggregates and groups use exact typed equality/order and deterministic numeric
|
|
41
|
+
arithmetic. Writes validate the complete operation before mutation, increment
|
|
42
|
+
revision once only when canonical state changes, and report every affected
|
|
43
|
+
Table/Row. The prepared-commit transport barrier runs before the outer COMMIT.
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
Capabilities are truthful. Optional public methods are absent when their bit is
|
|
46
|
+
false; a disabled non-optional operation rejects `unsupported`.
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
- browser import, native picker, save, Save As, conflict, recovery, and cleanup;
|
|
53
|
-
- Node/Electron `better-sqlite3` entry;
|
|
54
|
-
- typed React provider, hooks, view host, Grid, optional Gallery/Kanban plugins,
|
|
55
|
-
and trusted custom view registration;
|
|
56
|
-
- light/dark theme tokens and precompiled standalone CSS.
|
|
48
|
+
## Host and UI composition
|
|
57
49
|
|
|
58
|
-
|
|
50
|
+
Product code implements `HostServices` with opaque source/destination/session
|
|
51
|
+
tokens. It owns permission, recovery, CAS publication, conflicts, assets and
|
|
52
|
+
Runtime replacement. UI bootstraps by Host negotiation, Runtime negotiation,
|
|
53
|
+
snapshot and revision-bound schema paging. It invalidates generated page state
|
|
54
|
+
on revision/epoch change and never interprets File storage.
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
File assets use the same boundary for relative, `https:`, and canonical inline
|
|
57
|
+
image Data URLs. Runtime validates the logical object; Host policy supplies the
|
|
58
|
+
session asset root, network permission, import placement, bounded lease, and
|
|
59
|
+
isolated presenter. UI passes entry IDs only and never fetches or navigates the
|
|
60
|
+
canonical URI.
|
|
61
|
+
|
|
62
|
+
## Interoperability verification
|
|
63
|
+
|
|
64
|
+
Conformance work must cover the same contract through Browser WASM, Desktop
|
|
65
|
+
better-sqlite3, and Electron 43 `node:sqlite`, plus Adapter transport and a mock
|
|
66
|
+
Host/UI harness. API reports, fixtures and implementation-facing docs are
|
|
67
|
+
generated from the same public surface. Frozen specifications are changed only
|
|
68
|
+
for a demonstrated normative defect, never to match an implementation shortcut.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Eidos File field conversion standard
|
|
2
|
+
|
|
3
|
+
Field conversion is an atomic schema operation. The Runtime preflights the
|
|
4
|
+
complete stored value domain, classifies the operation, and either commits the
|
|
5
|
+
entire conversion or leaves the Field, rows, and File revision unchanged.
|
|
6
|
+
|
|
7
|
+
## Editor conversion matrix
|
|
8
|
+
|
|
9
|
+
A check means the route is supported when every stored value satisfies the
|
|
10
|
+
target type. A dash means the editor must not offer or attempt that route.
|
|
11
|
+
`File`, `Relation`, `Formula`, and `Lookup` have dedicated creation/editing
|
|
12
|
+
flows and are not general conversion targets.
|
|
13
|
+
|
|
14
|
+
| From → To | Text | Number | Checkbox | Date | Date & time | Multi-select | Rating | Select | URL |
|
|
15
|
+
| ------------ | ---: | -----: | -------: | ---: | ----------: | -----------: | -----: | -----: | --: |
|
|
16
|
+
| Text | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
17
|
+
| Number | ✓ | ✓ | ✓ | — | — | — | ✓ | ✓ | — |
|
|
18
|
+
| Checkbox | ✓ | ✓ | ✓ | — | — | — | ✓ | ✓ | — |
|
|
19
|
+
| Date | ✓ | — | — | ✓ | ✓ | — | — | ✓ | ✓ |
|
|
20
|
+
| Date & time | ✓ | — | — | ✓ | ✓ | — | — | ✓ | ✓ |
|
|
21
|
+
| Multi-select | ✓ | — | — | — | — | ✓ | — | ✓ | — |
|
|
22
|
+
| Rating | ✓ | ✓ | ✓ | — | — | — | ✓ | ✓ | — |
|
|
23
|
+
| Select | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
24
|
+
| URL | ✓ | — | — | ✓ | ✓ | — | — | ✓ | ✓ |
|
|
25
|
+
|
|
26
|
+
## Classification and safety
|
|
27
|
+
|
|
28
|
+
- `metadata-only`: logical stored values do not change. Text, Select, and URL
|
|
29
|
+
share nullable SQLite `TEXT` column DDL; a compatible conversion reuses that
|
|
30
|
+
physical column. Converting into URL still validates every value first.
|
|
31
|
+
- `lossless-rewrite`: values or SQLite constraints change without losing
|
|
32
|
+
information. Examples include Text to Number, Date to Date & time, and
|
|
33
|
+
Select to Multi-select.
|
|
34
|
+
- `explicit-lossy`: the default product policy would discard or round
|
|
35
|
+
information. The UI must disclose this and send `confirmLossy: true` only
|
|
36
|
+
after the user confirms.
|
|
37
|
+
- `forbidden`: at least one value is invalid, the route is unsupported, or a
|
|
38
|
+
dependency blocks the change. No mutation or revision increment is allowed.
|
|
39
|
+
|
|
40
|
+
Default lossy policies are explicit and shared by Runtime adapters:
|
|
41
|
+
|
|
42
|
+
- Number to Rating/Integer uses round-to-nearest, ties-to-even.
|
|
43
|
+
- Integer/Rating to Number may round values outside exact binary64 range.
|
|
44
|
+
- Number/Rating to Checkbox maps zero to false and nonzero to true.
|
|
45
|
+
- Date & time to Date keeps the UTC calendar date and discards time.
|
|
46
|
+
- Multi-select to Select keeps the first option; an empty list becomes `NULL`.
|
|
47
|
+
- JSON literal `null` can become SQL `NULL`; scalar-to-list conversion maps SQL
|
|
48
|
+
`NULL` to an empty list.
|
|
49
|
+
|
|
50
|
+
Text-to-Number accepts only canonical inverse binary64 spellings: whitespace,
|
|
51
|
+
noncanonical leading zeroes, infinities, and partially numeric strings fail.
|
|
52
|
+
Text-to-Checkbox accepts lowercase `true` or `false`. Dates and instants must be
|
|
53
|
+
canonical, URLs must be valid URI-references, and Rating values must be within
|
|
54
|
+
0–5 before any approved rounding. Select option inference is bounded to 1,000
|
|
55
|
+
distinct choices.
|
|
56
|
+
|
|
57
|
+
## Performance contract
|
|
58
|
+
|
|
59
|
+
The Eidos Lite performance gate uses independent file copies so conversions do
|
|
60
|
+
not warm or mutate one another. It covers every editor algorithm family at
|
|
61
|
+
100,000 rows and representative million-row boundaries:
|
|
62
|
+
|
|
63
|
+
- Text/Select metadata conversion at 1m rows: at most 3 seconds.
|
|
64
|
+
- Text/Select/URL shared-column conversion: at most 3 seconds, including full
|
|
65
|
+
URL validation where required.
|
|
66
|
+
- Lossless 100k physical rewrite: at most 15 seconds.
|
|
67
|
+
- Confirmed lossy 100k physical rewrite: at most 20 seconds.
|
|
68
|
+
- Representative 1m physical rewrite: at most 60 seconds.
|
|
69
|
+
- Invalid 100k value domain rejection: at most 3 seconds.
|
|
70
|
+
- Unsupported File conversion guard: at most 200 milliseconds.
|
|
71
|
+
|
|
72
|
+
Fixture construction is excluded from user-visible timings. Every successful
|
|
73
|
+
case verifies the original row count and resulting Field type; every rejected
|
|
74
|
+
case verifies an error and relies on Runtime atomicity tests for unchanged data
|
|
75
|
+
and revision.
|
package/README.md
CHANGED
|
@@ -1,127 +1,110 @@
|
|
|
1
1
|
# `@eidos.space/eidos-file`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Portable Eidos File 1.0 contracts and the reference headless Runtime.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
The normative specifications are [`docs/specs`](../../docs/specs/README.md).
|
|
6
|
+
Implementations compose in one direction:
|
|
7
|
+
|
|
8
|
+
```text
|
|
9
|
+
Eidos File 1.0 → Eidos Runtime 1.0 → Eidos Adapter 1.0 → Eidos UI 1.0
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The File is an ordinary SQLite application file. Runtime alone owns format
|
|
13
|
+
semantics. Adapters own SQLite execution, transport, persistence and Host
|
|
14
|
+
authority. UI receives only `RuntimeClient` and `HostServices`; it never
|
|
15
|
+
receives SQL, a database, a path or a native file handle.
|
|
8
16
|
|
|
9
17
|
## Install
|
|
10
18
|
|
|
11
19
|
```bash
|
|
12
|
-
pnpm add @eidos.space/eidos-file@0.
|
|
20
|
+
pnpm add @eidos.space/eidos-file@2.0.0
|
|
13
21
|
```
|
|
14
22
|
|
|
15
|
-
Add `@eidos.space/eidos-file-ui
|
|
23
|
+
Add `@eidos.space/eidos-file-ui` for the React Viewer binding.
|
|
16
24
|
|
|
17
|
-
##
|
|
25
|
+
## Exact Runtime binding
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
`Runtime.create` initializes an empty `ConnectionPort`; `Runtime.open` validates
|
|
28
|
+
an existing one. Both return a public service plus a trusted Host-only bridge.
|
|
21
29
|
|
|
22
30
|
```ts
|
|
23
|
-
import { EidosFileSession } from "@eidos.space/eidos-file"
|
|
24
31
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
Runtime,
|
|
33
|
+
type ConnectionPort,
|
|
34
|
+
type RuntimeEnvironment,
|
|
35
|
+
} from "@eidos.space/eidos-file"
|
|
36
|
+
|
|
37
|
+
const binding = await Runtime.open(
|
|
38
|
+
connection satisfies ConnectionPort,
|
|
39
|
+
environment satisfies RuntimeEnvironment,
|
|
40
|
+
"readwrite",
|
|
41
|
+
{ cancellation, deadlineMilliseconds: 30_000 }
|
|
34
42
|
)
|
|
35
43
|
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const handle = direct ?? imported
|
|
41
|
-
|
|
42
|
-
if (handle) await session.open(handle)
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
SQLite WASM uses WebAssembly and top-level await. A Vite host should enable the
|
|
46
|
-
same two standard plugins:
|
|
47
|
-
|
|
48
|
-
```ts
|
|
49
|
-
import { defineConfig } from "vite"
|
|
50
|
-
import topLevelAwait from "vite-plugin-top-level-await"
|
|
51
|
-
import wasm from "vite-plugin-wasm"
|
|
52
|
-
|
|
53
|
-
export default defineConfig({
|
|
54
|
-
plugins: [wasm(), topLevelAwait()],
|
|
55
|
-
optimizeDeps: { exclude: ["@sqlite.org/sqlite-wasm"] },
|
|
56
|
-
})
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Call `session.markDirty()` after a committed mutation. `checkpoint()` stores a
|
|
60
|
-
recoverable working copy. `save()` exports an integrity-checked database and
|
|
61
|
-
performs a compare-and-swap write against the revision observed at open time.
|
|
62
|
-
|
|
63
|
-
```ts
|
|
64
|
-
import { EidosFileHostError } from "@eidos.space/eidos-file"
|
|
65
|
-
|
|
66
|
-
session.markDirty()
|
|
67
|
-
await session.checkpoint()
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
await session.save()
|
|
71
|
-
} catch (error) {
|
|
72
|
-
if (error instanceof EidosFileHostError && error.code === "conflict") {
|
|
73
|
-
// Offer reload, forced overwrite, or Save As. Do not silently choose.
|
|
74
|
-
}
|
|
75
|
-
}
|
|
44
|
+
const negotiated = await binding.service.negotiate(
|
|
45
|
+
{ protocol: "eidos-runtime", versions: ["1.0"] },
|
|
46
|
+
{ requestId: "negotiate" }
|
|
47
|
+
)
|
|
76
48
|
```
|
|
77
49
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
50
|
+
The service exposes the frozen columnar query, authenticated keyset cursor,
|
|
51
|
+
aggregate/group, validation and transactional mutation contracts. Integer
|
|
52
|
+
values are decimal strings at public boundaries; JSON Field values are RFC
|
|
53
|
+
8785 JCS text strings. Optional undo/events/CSV methods exist exactly when the
|
|
54
|
+
matching negotiated capability is true.
|
|
55
|
+
|
|
56
|
+
## Adapter profiles
|
|
57
|
+
|
|
58
|
+
- `NodeSqliteConnectionPort` in `@eidos.space/eidos-file/node-sqlite`
|
|
59
|
+
implements the Node 24.16+ EA-Connection binding without a native addon or a
|
|
60
|
+
Node/Electron ABI rebuild. Eidos Lite runs it in an Electron utility process.
|
|
61
|
+
- `BetterSqlite3ConnectionPort` in `@eidos.space/eidos-file/better-sqlite3`
|
|
62
|
+
remains available to Node Hosts that have chosen that driver; it is not the
|
|
63
|
+
Eidos Lite adapter.
|
|
64
|
+
- `SQLiteWasmConnectionPort` in `@eidos.space/eidos-file/browser` implements
|
|
65
|
+
the Browser Worker EA-Connection binding using the same conformance contract.
|
|
66
|
+
- `AdapterTransportServer` and `AdapterTransportRuntimeClient` implement the
|
|
67
|
+
Eidos Adapter 1.0 structured-clone transport, including sequence binding,
|
|
68
|
+
cancellation, attachment limits and the prepared-commit acknowledgement
|
|
69
|
+
barrier.
|
|
70
|
+
|
|
71
|
+
The browser-conforming composition keeps SQLite and Runtime in a Dedicated
|
|
72
|
+
Worker. Window receives only the transported `RuntimeClient`; SQLite, File
|
|
73
|
+
bytes, and trusted Host authority remain outside UI.
|
|
74
|
+
|
|
75
|
+
## File rules implemented here
|
|
76
|
+
|
|
77
|
+
- canonical File DDL, `STRICT` user tables and File-owned triggers;
|
|
78
|
+
- lowercase hyphenated UUIDv7 identity;
|
|
79
|
+
- exact physical naming, rename and conversion behavior;
|
|
80
|
+
- canonical date/datetime, JSON, list, File and Relation values;
|
|
81
|
+
- File entries limited to confined relative URI-references, absolute `https:`
|
|
82
|
+
URIs, or canonical inline image Data URLs; inline bytes are validated against
|
|
83
|
+
declared media type and size and are capped at 1 MiB;
|
|
84
|
+
- virtual Formula, Lookup and inverse-Relation projection;
|
|
85
|
+
- revision, no-op mutation, delete policy and cache invalidation semantics;
|
|
86
|
+
- cumulative identity/structural/content/semantic/full validation.
|
|
87
|
+
|
|
88
|
+
Unsupported pre-1.0 draft schemas are rejected rather than guessed or
|
|
89
|
+
silently migrated.
|
|
90
|
+
|
|
91
|
+
The supported editor matrix, lossy confirmation rules, canonical value
|
|
92
|
+
requirements, and load budgets are documented in
|
|
93
|
+
[`FIELD-CONVERSION.md`](./FIELD-CONVERSION.md).
|
|
94
|
+
|
|
95
|
+
Runtime validates File values but grants no fetch, render, filesystem, or
|
|
96
|
+
network authority. Relative/HTTPS bytes never enter a hidden SQLite attachment
|
|
97
|
+
store. A Host resolves them through session-scoped asset leases; the canonical
|
|
98
|
+
Data URL is the sole inline-byte exception and stores bytes once in `uri`.
|
|
99
|
+
|
|
100
|
+
## Verification
|
|
81
101
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
```ts
|
|
89
|
-
import { createEidosFile } from "@eidos.space/eidos-file/better-sqlite3"
|
|
90
|
-
|
|
91
|
-
const file = createEidosFile("tasks.eidos", {
|
|
92
|
-
title: "Tasks",
|
|
93
|
-
defaultTable: { name: "Tasks" },
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
file.insertRow(file.info().defaultTableId!, { title: "Ship Eidos File" })
|
|
97
|
-
file.close()
|
|
102
|
+
```bash
|
|
103
|
+
pnpm --filter @eidos.space/eidos-file typecheck
|
|
104
|
+
pnpm --filter @eidos.space/eidos-file typecheck:public
|
|
105
|
+
pnpm --filter @eidos.space/eidos-file build
|
|
106
|
+
pnpm --filter @eidos.space/eidos-file api:check
|
|
98
107
|
```
|
|
99
108
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
- `EidosFileDescriptor` is adapter-owned identity, metadata, size, and an
|
|
103
|
-
opaque revision token.
|
|
104
|
-
- `EidosFileHandle` owns reading, permissions, and optional verified writes.
|
|
105
|
-
- `EidosFileRuntimeAdapter` turns bytes into an `EidosFileDocument`.
|
|
106
|
-
- `EidosFileDataSource` is the async paging and mutation contract consumed by
|
|
107
|
-
views.
|
|
108
|
-
- `EidosFileSession` owns open, dirty, saving, conflict, error, recovery, and
|
|
109
|
-
cleanup states.
|
|
110
|
-
- `EidosFileHandlerRegistry` matches file types. It does not install or execute
|
|
111
|
-
extensions.
|
|
112
|
-
|
|
113
|
-
See [DEVELOPER_PLATFORM.md](./DEVELOPER_PLATFORM.md) for the audited product
|
|
114
|
-
boundary and first-release scope.
|
|
115
|
-
|
|
116
|
-
## Security
|
|
117
|
-
|
|
118
|
-
Adapters are the authority boundary. A view never receives SQLite, a native
|
|
119
|
-
file handle, the browser picker, Electron IPC, or host application state.
|
|
120
|
-
React views are trusted application code, not sandboxed extensions. A host must
|
|
121
|
-
review and statically import them just like any other dependency.
|
|
122
|
-
|
|
123
|
-
## Format notes
|
|
124
|
-
|
|
125
|
-
Files remain valid SQLite databases and can be inspected with ordinary SQLite
|
|
126
|
-
tools. Gallery and Kanban query indexes are disposable SQLite indexes maintained
|
|
127
|
-
by the runtime; they are not Eidos metadata or user data.
|
|
109
|
+
The package is framework-agnostic. React bindings live in
|
|
110
|
+
`@eidos.space/eidos-file-ui`.
|