kireji 0.0.6 → 0.0.7

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/README.md CHANGED
@@ -1,100 +1,68 @@
1
- > ### NOTE
2
- > This node package is currently an empty placeholder for a web framework under development.
3
- >
4
- > Visit the working demo project [here](https://github.com/kireji-app/demo#readme).
5
- >
6
- > Read this documentation to get an idea of the framework's intent and features.
7
- >
8
- > Check back later to see if the package has been populated.
9
-
10
- # **kireji:**<br><sup><sub>Entropy-perfect web apps</sub></sup>
11
- kireji is a reactive full-stack web framework that uses minimal perfect hash functions (MPHFs) to achieve the information-theoretic lower bound of data compression.
12
-
13
- An MPFH is a collision-free, duplicate-free and gap-free hash function that provides a compression solution specialized for a given data model. It assigns a unique integer to every state in the model.
14
-
15
- Rich model data is recovered instantly from a hash and vice versa, with hashes compact enough to fit in URLs or DNS TXT records.
16
-
17
- Applications powered by kireji feature state-complete deep linking, enabling session bookmarking, peer-to-peer data sharing without a central server, and cross-origin communication via URL.
18
-
19
- ## MVC + MPHF Architecture
20
-
21
- kireji integrates minimal perfect hash functions (MPHFs) with the model-view-controller (MVC) paradigm by using hashes as a canonical data model.
22
-
23
- * Each controller is a stateful component (called a <strong>part</strong>) with a dedicated hash function.
24
- * Parts assemble like LEGO® bricks, each assembly producing a new hash function derived from its subparts.
25
- * JavaScript's prototype chain powers compositional inheritance between parts.
26
-
27
- ## DNS-Based Namespacing
28
-
29
- <h3><a href="https://www.ejaugust.com/0.131.3/4lbHaxsKnzRXOKxrM/"><img src="https://raw.githubusercontent.com/kireji-app/demo/refs/heads/main/src/com/ejaugust/note/part.png" style="width:1.25em" alt="part icon" />&nbsp;&nbsp;<sup>Why DNS?<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<sup>⟍&nbsp;</sup><sub>Further Reading</sub></sup></a></h3>
1
+ # Kireji - *Web Framework*
2
+ **Part of the Kireji Project**
3
+ > *An application is the state it's in.*
4
+ ## Overview
5
+ The Kireji Web Framework is a reactive full-stack web framework that uses the MPHF Coordinate System and the MVC paradigm to build multi-origin web app ecosystems. It offers a routing system that achieves the information-theoretic lower bound of data compression, enabling comprehensive deep linking, session bookmarking without user accounts or local storage, peer-to-peer data sharing without uploads or accounts, and cross-origin communication without cookies or CORS.
6
+ ## The Kireji Project
7
+ The Kireji Project poses a question: **What if we could treat all functional software as points in a single, mathematically mapped, and traversable space?**
8
+ | Repo | Purpose
9
+ | ---- | -------
10
+ | [MPHF](https://github.com/kireji-app/mphf#readme) | [Coordinate System<br><sub>Provides the bijective coordinate system</sub>](https://github.com/kireji-app/mphf#readme)
11
+ | **Kireji** | **Web Framework - You are here<br><sub>Uses MPHF to encode app state in URLs and manage cross-origin traversal</sub>**
12
+ | [Demo](https://github.com/kireji-app/demo#readme) | [App Ecosystem<br><sub>Demonstrates practical applications of the Kireji Project</sub>](https://github.com/kireji-app/demo#readme)
13
+ ## Implementation
14
+
15
+ > <sub>Note: This is currently an empty placeholder for the framework that powers the [Demo App Ecosystem](https://github.com/kireji-app/demo#readme). Check back later to see if the package has been populated.</sub>
16
+
17
+ This framework uses the **MPHF Coordinate System** to assign a unique, gap-free coordinate to every valid point in a space constrained by its component definitions. It uses the **MVC paradigm** to efficiently update the DOM. It uses a **packing mechanism** to create single-artifact builds. It provides a library of **premade components** including a **web server** and **service worker** to bootstrap the development process.
18
+
19
+ ### Components
20
+ Components act to refine the "Total Software Space" into a manageable set of **algebraically constrained, functional applications.**
21
+
22
+ This refinement is designed to provide:
23
+ - **Guaranteed Functionality:** Ensuring every coordinate represents a stable, working application (no "one sandal, one stiletto" combinations).
24
+ - **Comprehensive Deep Linking:** Allowing every coordinate to be bookmarked and shared, retaining a full, multi-origin session state in the most compressed URL possible without reliance on cookies, servers, or user tracking.
25
+ - **Component Encapsulation:** Defining all applications as assemblies of stateful components (called **parts**) built on the MPHF-MVC backbone. Parts then assemble like LEGO® bricks, each assembly representing its own configuration space.
26
+ - **Reactive Navigation:** Ensuring navigation from one coordinate to another changes only the page elements that need to change to reflect the new position.
27
+
28
+ ### Namespacing
30
29
 
31
30
  Parts in kireji are assigned unique names following DNS semantics, relating a web application's origin (e.g., www.ejaugust.com) to its individual components, for example:
32
31
 
33
32
  ```js
34
- _.com.ejaugust
35
- _.com.ejaugust.scroller
36
- _.com.ejaugust.www
37
- _.com.ejaugust.www.home
38
- _.com.ejaugust.www.notes
33
+ _.com.example
34
+ _.com.example.scroller
35
+ _.com.example.www.home
36
+ _.com.example.www.blog
39
37
  ```
40
38
 
41
- The root part, represented by `_`, is the only global object. This allows parts to reference each other without polluting the global namespace.
42
-
43
- The framework provides a set of premade parts like MVC abstracts and MPHF arithmetic under the domain "core.parts":
39
+ ### Premade Components
40
+ The framework provides MVC abstracts and MPHF arithmetic under the domain "core.parts":
44
41
 
45
42
  ```js
46
43
  _.parts.core.mix
47
44
  _.parts.core.match
48
45
  _.parts.core.clip
46
+ ...
49
47
  ```
50
48
 
51
- You can explore this organization in action by going to [www.kireji.app](https://www.kireji.app).
52
-
53
- ## Made with Vanilla JS
54
-
55
- kireji does not import any third-party libraries, frameworks, or packages so that it can be reasoned about end-to-end as a self-contained and self-descriptive system.
56
-
57
- ## Live Applications
58
-
59
- kireji is in alpha. To see the technology in action, check out the [demo](https://github.com/kireji-app/demo) repo.
60
- <!--
61
- ## **Current Status**
62
-
63
- The following milestones completed:
49
+ It provides bootstrapping and full-stack functionality under the domain "desktop.parts":
50
+ ```js
51
+ _.parts.desktop.server
52
+ _.parts.desktop.client
53
+ _.parts.desktop.worker
54
+ _.parts.desktop.addressBar
55
+ ...
56
+ ```
64
57
 
65
- * Core framework functionality
66
- * CI/CD pipeline
67
- * MPFH for stateless deep linking and data compression
68
- * Reactive front-end framework via MVC + MPFH
69
- * Domain-named architecture ready for DNS integration
70
- * In-platform part inspector
71
- * Node.js server built-in
72
- * Local debugging and development at localhost:3000
73
- * Desktop operating system preview
74
- * Ready-made stateful components with HTML and CSS, such as
75
- - Scroller with custom scroll-bar implementation (more customizable than the native scrollbar)
76
- - Color mode management that automatically computes shades from a given color palette
77
- - Additive parts for mutually exclusive variable assignments
78
- - Multiplicative parts for independent variables
79
- - Movie clip part for animating data models with a dedicated hash for every frame
80
- - Notebook - a blog template
58
+ ## Tech Stack
81
59
 
82
- ### **Roadmap**
60
+ The Kireji Web Framework does not import any third-party libraries, frameworks, or packages so that it can be reasoned about end-to-end as a self-contained and self-descriptive system.
83
61
 
84
- | Phase | Status |
85
- | ---------------------------------------- | ----------- |
86
- | **Minimal Perfect Hashing For Any Data** | Completed |
87
- | **Reacting MVC Framework** | Completed |
88
- | **CI/CD Pipeline** | Completed |
89
- | **Model LTS and Versioning Strategy** | Completed |
90
- | **NPM Packages and Project Generation** | In Progress |
91
- | **Debug Tools, Docs** | In Progress |
92
- | **Operating System Concept** | In Progress |
93
- | **Transfinite State Space** | Planned |
94
- | **Advanced DNS Integration** | Planned |
95
- | **Integrated Development Environment** | Planned |
96
- -->
97
62
  ## Status and License
63
+ The Kireji Web Framework is in **Alpha**.\
64
+ The Kireji Project is in **early research and development**.
65
+
98
66
  [![kireji on npm](https://img.shields.io/npm/v/kireji?style=for-the-badge&labelColor=CB3837&logo=npm&logoColor=white&label=NPM+package&color=212121)](https://www.npmjs.com/kireji)
99
67
  <br>[![Project Status: Alpha](https://img.shields.io/badge/status-alpha-212121?style=for-the-badge&labelColor=181717&logo=github&logoColor=white)](https://www.repostatus.org/#alpha)
100
68
  <br>[![Commits](https://img.shields.io/github/commit-activity/t/kireji-app/kireji?style=for-the-badge&labelColor=181717&color=212121&logo=github&logoColor=white)](https://github.com/kireji-app/demo/commits/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kireji",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "A web framework for stateful, entropy-perfect, multi-origin web applications. Currently in alpha. Expect breaking changes for version 0. Use with caution!",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -1,90 +0,0 @@
1
- # kireji – Architecture Overview
2
-
3
- This document provides a technical deep dive into the inner workings of kireji. It supplements the main README with details on the hashing model, URL compression strategy, and state representation.
4
-
5
- ---
6
-
7
- ## 1. Minimal Perfect Hashing
8
-
9
- kireji employs a piecewise-defined, recursive **minimal perfect hash function (MPHF)** to compress part state information into compact, shareable URLs. Each application state is represented as a natural number $`n`$, with the MPHF ensuring a 1:1 mapping between $`n`$ and its respective part state configuration.
10
-
11
- ### 1.1 Bijection Model
12
-
13
- The core mapping is:
14
-
15
- ```
16
- n <--> Part State
17
- ```
18
-
19
- Each part declares its cardinality $`k`$, which defines the number of possible states it can occupy. The system ensures that every part maps deterministically to a unique number $`0 < n < k`$ within its cardinality range.
20
-
21
- ### 1.2 URL Path Encoding
22
-
23
- Each full application state is encoded into a URL using variable-length base-64 segments. A typical path looks like:
24
-
25
- ```
26
- https://www.example.com/ghc3w_hi4-5g4w3/
27
- ```
28
-
29
- Each segment represents a portion of the application's state tree. Path segments can store \~1500 bits of entropy each, using the geometric series:
30
-
31
- $$
32
- k_{segment} = (64^{251} - 64)/63 ≈ 2^{1500}
33
- $$
34
-
35
- This provides extremely dense representation of state without relying on query parameters or local storage, making states sharable and deep-linkable by permanent URLs.
36
-
37
- ## 2. Part Model and State Composition
38
-
39
- ### 2.1 Mix and Match Parts
40
-
41
- kireji models state as a recursive tree:
42
-
43
- * `mix.core.parts` performs **multiplicative composition** (Cartesian product of independent subparts)
44
- * `match.core.parts` performs **additive composition** (exclusive options / partitioning)
45
-
46
- These two operations enable arbitrarily complex state spaces to be built from small, reusable parts.
47
-
48
- ### 2.2 Stateful Behavior
49
-
50
- Each part reads and writes its state as an integer. This state is derived from the states of its subparts or from local input, and any mutation automatically updates its hash value.
51
-
52
- Example mapping:
53
-
54
- ```
55
- https://two-digit.example.com/v123/0t
56
- -> [domain: two-digit.example.com, version: 123, state: 94]
57
- -> subpart mapping: [tensPlace.routeID = 9, onesPlace.routeID = 4]
58
- ```
59
-
60
- ## 3. State Propagation
61
-
62
- kireji supports rootward and leafward propagation of state changes. Any state mutation in a subpart triggers a full recalculation of parent route identifiers up to the DNS root. This model ensures full consistency across nested part hierarchies.
63
-
64
- The URL in the address bar always reflects the root part's state and is updated at throttled intervals (to align with browser frame rate limits and avoid DoS mitigation mechanisms).
65
-
66
- ## 4. Prototype Tree and Inheritance
67
-
68
- Each domain maps to a runtime object (called a part), and subdomains define subparts. These parts follow a prototype-based inheritance model:
69
-
70
- * Domains can extend other domains
71
- * Behaviors and cardinalities are inherited or overridden
72
- * The root prototype is `part.core.parts`
73
-
74
- This system enables reuse and modularity while preserving static determinism.
75
-
76
- ## 5. Current DNS Integration Status
77
-
78
- DNS-based behaviors are currently **modeled only**:
79
-
80
- * TXT record fetching is implemented in a commented-out form
81
- * No live production use of DNS records occurs yet
82
- * This modeling forms the basis for future decentralized architecture
83
-
84
- ---
85
-
86
- ## Summary
87
-
88
- kireji's architecture is defined by its emphasis on stateless, composable, mathematically rigorous component modeling. The hash function acts as the universal interface for state storage, navigation, and sharing, enabling a new paradigm for front-controlled applications without traditional backends.
89
-
90
- For build engineers, architects, and researchers, kireji offers a reproducible and self-contained environment to explore scalable UI logic, compressed state modeling, and reactive full-stack design.
@@ -1,89 +0,0 @@
1
- # kireji – Runtime Environment Model
2
-
3
- This document provides an overview of the three runtime environments supported by kireji. It outlines how the framework maintains consistency, reactivity, and optimal performance across the entire stack - from build time to client interaction.
4
-
5
- ---
6
-
7
- ## Overview of the Three Environments
8
-
9
- kireji is designed to operate identically across three distinct environments:
10
-
11
- 1. **`server` (Creates a backend via Node.js)**
12
- 2. **`worker` (Creates a local backend via Service Worker)**
13
- 3. **`client` (Creates the GUI in a browser window)**
14
-
15
- Each environment has unique responsibilities, but they all operate on the same static payload which bootstraps and renders hash-specific files identically across all three.
16
-
17
- ---
18
-
19
- ## 1. `server`
20
-
21
- ### Responsibilities:
22
-
23
- - **Execute unit tests at build time**
24
- - **Static analysis of source files**
25
- - **Hash tree construction and cardinality computation**
26
- - **Inline and archive versioned part definitions into `/${version}.js`**
27
- - **Respond to HTTP requests**
28
- - **Render full HTML snapshots for any valid hash**
29
- - **Serve the archived script**
30
-
31
- ### Features:
32
-
33
- - Resolves the entire application structure into a single build artifact
34
- - Serializes all parts into JavaScript literals
35
- - Sets default application state to be rendered server-side
36
- - Enables SEO by server-rendered HTML for any permalink
37
- - Outputs CSS-inlined, DOM-complete pages for fast first paint
38
- - Injects minimal bootstrap logic to register the service worker and transfer control to the client
39
- - Stateless; only computes a single frame of the app based on URL state
40
- - All logic is deterministic and derived from the hash tree
41
-
42
- ---
43
-
44
- ## 2. `worker`
45
-
46
- ### Responsibilities:
47
-
48
- - **Controls all client-side network requests after installation**
49
- - **Hydrates the static DOM rendered by the server**
50
-
51
- ### Features:
52
-
53
- - Ensures full offline support
54
- - Because all service workers are static and versioned, the app doesn't use network transactions
55
- - Manages asset caching and updates using browser-native SW APIs
56
- - Acts as the bridge between the server-rendered files and the client window
57
-
58
- ---
59
-
60
- ## 3. `client`
61
-
62
- ### Responsibilities:
63
-
64
- - **Hydrates server renders and handles all DOM updates**
65
- - **Listens for user interaction events** such as clicks, keypresses, and pointer movements
66
- - **Reacts performantly to user input** by updating application state with minimal recomputation
67
- - **Interprets the full application state**
68
-
69
- ### Features:
70
-
71
- - Presents the final local application
72
- - Manages user interaction, animations, and local rendering
73
- - Encodes new state changes back into the URL without needing a backend
74
- - Offers fast, smooth, and rich/stateful cross-origin navigation
75
- - Seamless rendering hand-off with no flash-of-unstyled-content (FOUC) on hydration.
76
-
77
- ---
78
-
79
- ## Shared Behavior Across Environments
80
-
81
- - **Immutable State Roots**: All environments operate on the same root hash model
82
- - **State Derivation**: Given a URL, all environments reconstruct the same system state
83
- - **Hydration Logic**: Service worker and client window bootstrap from the static state encoded in the URL
84
-
85
- ---
86
-
87
- ## Summary
88
-
89
- kireji achieves full-stack consistency by applying the same hash-based logic across three distinct environments. Each environment is stateless, reactive, and bound by a shared contract: the application's entire state must be fully described and derived from the URL alone. This approach eliminates backend dependency while enabling rich local state persistence and sharing, SEO, PWA functionality, real-time interaction and LTE version support.
@@ -1,87 +0,0 @@
1
- # kireji – Versioning and Long-Term Stability
2
-
3
- This document outlines the versioning strategy used by kireji to maintain consistency across application states and ensure long-term permalink stability.
4
-
5
- ---
6
-
7
- ## 1. Why Versioning Matters in kireji
8
-
9
- Unlike traditional applications that store state on the backend, kireji encodes all runtime state directly into the URL. This creates a permalink to any exact state but also a challenge: ensuring old links continue to work as the framework evolves.
10
-
11
- To solve this, kireji provides a **semantic versioning model** for its core hash function and handles archiving and importing single-file JavaScript files that represent previous versions of the application. These previous versions can be curated by simply removing or adding these JS artifacts into the archive.
12
-
13
- ---
14
-
15
- ## 2. Semantic Versioning Scheme
16
-
17
- The hash function that defines part behavior and layout is versioned using the standard **major.minor.patch** format:
18
-
19
- ```
20
- MAJOR.MINOR.PATCH
21
- ```
22
-
23
- | Level | When to Increment |
24
- | ----- | ------------------------------------------------------ |
25
- | Major | Breaking change to existing state mappings |
26
- | Minor | New routes added, existing links still work |
27
- | Patch | Bugfixes, small adjustments, no impact on URL behavior |
28
-
29
- ### Example:
30
-
31
- * `1.0.0`: First long-term stable version
32
- * `1.1.0`: Adds new application without changing old routes
33
- * `2.0.0`: Refactors match/mix behavior in a way that invalidates some previous URLs
34
-
35
- Until version `1.0.0`, kireji is in **alpha** and the hash tree may change without stability guarantees.
36
-
37
- ---
38
-
39
- ## 3. State Stability and Backward Compatibility
40
-
41
- Each version of the hash tree can be treated as its own schema for URL encoding and decoding. kireji sets aside a small reserved namespace for routing to a specific version of the tree.
42
-
43
- This allows developers to:
44
-
45
- * Pin content to a specific version
46
- * Maintain deep links in notes or docs
47
- * Add new routes or applications without breaking old ones
48
-
49
- Hashes can be translated across versions. This is achieved by allowing any previous version of the application to unpack a given hash into a serialized form that later versions can parse.
50
-
51
- ---
52
-
53
- ## 4. Archived Versions
54
-
55
- To preserve past behavior, all previously deployed versions of the hash tree are still available, archived and bundled according to their version number.
56
-
57
- This ensures that even if the project evolves rapidly, any link shared generated in a previous version of the application can still reconstruct its corresponding UI state.
58
-
59
- Archived versions include:
60
-
61
- * A frozen copy of the MPHF tree
62
- * Static copy of all content
63
- * Git metadata to link back to that version's commit
64
-
65
- ---
66
-
67
- ## 5. Planned Stability Milestone
68
-
69
- | Target Version | Purpose |
70
- | -------------- | ------------------------------------------------ |
71
- | `1.0.0` | First stable release with backward compatibility |
72
- | `1.x.x` | Non-breaking extensions |
73
- | `2.0.0` | First intentional breaking change |
74
-
75
- Developers working with the alpha version 0.x.x should treat permalinks as non-durable while the deployment strategy matures.
76
-
77
- ---
78
-
79
- ## 6. Automatic Versioning
80
-
81
- kireji includes an **automatic versioning system** built into its local development environment. At build time, if the environment is detected as local, the framework allows the developer to specify change severity (major, minor, or patch) and the system automatically increments and outputs the appropriate next version number in the console at build time. This ensures consistent version tracking and LTE backwards compatibility testing during feature implementation.
82
-
83
- ## Summary
84
-
85
- kireji treats the application state as a form of typed data and commits to preserving that data over time through semantic versioning. The versioning system ensures that every URL, once published, can remain a valid and functional entry point into the application—without requiring a database or server persistence.
86
-
87
- As the framework matures, this commitment to permalink durability will allow users and developers to build confidently on top of a stable foundation.
File without changes