@ultrst-armada/krnl 1.0.0 โ 1.0.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/README.md +35 -24
- package/package.json +11 -11
- package/packages/cli/package.json +2 -2
- package/packages/core/dist/index.cjs +6 -3
- package/packages/core/dist/index.d.cts +1 -1
- package/packages/core/dist/index.d.ts +1 -1
- package/packages/core/dist/index.js +5 -2
- package/packages/core/package.json +2 -2
- package/packages/create-krnl/package.json +2 -2
- package/packages/eslint-plugin/package.json +2 -2
- package/packages/validate/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Krnl Framework
|
|
2
2
|
|
|
3
|
-
> **Krnl**:
|
|
3
|
+
> **Krnl**: Backend Service Framework for Skipo โ a modular TypeScript framework for authoring, composing, executing, and validating backend services, facades, protocols, and workflows.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ๐ Overview
|
|
8
|
+
|
|
9
|
+
In the **Skipo** ecosystem, services are the foundational backend modules. **Krnl** provides the kernel architecture, lifecycle hooks, transport gateways, protocol decoders, and validation engine for building robust, decoupled backend services.
|
|
10
|
+
|
|
11
|
+
- **Modular Service Architecture**: Define pure, stateful, and protocol-enabled backend service facades.
|
|
12
|
+
- **Workflow & Flow Execution**: Compose multi-service pipelines and background execution boundaries.
|
|
13
|
+
- **AST Purity & Validation**: Enforce 4-layer function purity, contract standards, and architecture rules via `ts-morph`.
|
|
14
|
+
- **Protocol & Network Ingress**: Support REST, WebSocket, RPC, and MCP protocol bindings out of the box.
|
|
15
|
+
- **Universal Backend Readiness**: Run seamlessly across Local FS, Local-Hosted, and Serverless environments.
|
|
4
16
|
|
|
5
17
|
---
|
|
6
18
|
|
|
@@ -11,44 +23,45 @@ Run the official interactive project generator:
|
|
|
11
23
|
|
|
12
24
|
```bash
|
|
13
25
|
# Using npm
|
|
14
|
-
npm create krnl my-app
|
|
26
|
+
npm create krnl my-service-app
|
|
15
27
|
|
|
16
28
|
# Using npx
|
|
17
|
-
npx create-krnl my-app
|
|
29
|
+
npx create-krnl my-service-app
|
|
18
30
|
|
|
19
31
|
# Using pnpm
|
|
20
|
-
pnpm dlx create-krnl my-app
|
|
32
|
+
pnpm dlx create-krnl my-service-app
|
|
21
33
|
```
|
|
22
34
|
|
|
23
|
-
This generates a fully configured Krnl workspace:
|
|
35
|
+
This generates a fully configured Krnl backend workspace:
|
|
24
36
|
- `krnl.json` (Workspace manifest & provider bindings)
|
|
25
37
|
- `package.json` & `tsconfig.json`
|
|
26
|
-
- `src/
|
|
27
|
-
- `src/
|
|
28
|
-
- `src/libraries/AppConcepts.ts` (Layer 0 pure concept library)
|
|
38
|
+
- `src/services/` (Backend service definitions & facades)
|
|
39
|
+
- `src/libraries/` (Layer 0 pure concept libraries)
|
|
29
40
|
- `docs/HISTORY.md` (Project intent & architectural memory)
|
|
30
41
|
|
|
31
42
|
---
|
|
32
43
|
|
|
33
|
-
### 2.
|
|
44
|
+
### 2. Run and Validate Services
|
|
34
45
|
|
|
35
46
|
```bash
|
|
36
|
-
cd my-app
|
|
47
|
+
cd my-service-app
|
|
48
|
+
|
|
49
|
+
# Start Krnl service dev server
|
|
37
50
|
krnl dev
|
|
38
|
-
```
|
|
39
|
-
Open **`http://localhost:8080`** in your browser (Brave, Chrome, Safari).
|
|
40
51
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
# Run deep AST 4-layer service purity validation
|
|
53
|
+
krnl validate
|
|
54
|
+
|
|
55
|
+
# Build production bundle
|
|
56
|
+
krnl build
|
|
57
|
+
```
|
|
45
58
|
|
|
46
59
|
---
|
|
47
60
|
|
|
48
61
|
### 3. CLI Commands Reference
|
|
49
62
|
|
|
50
63
|
```bash
|
|
51
|
-
# Start
|
|
64
|
+
# Start Krnl service dev server & boot service entrypoint
|
|
52
65
|
krnl dev
|
|
53
66
|
|
|
54
67
|
# Run deep AST 4-layer function purity audit
|
|
@@ -71,13 +84,11 @@ krnl generate subapp OrderEngine
|
|
|
71
84
|
|
|
72
85
|
## ๐๏ธ Monorepo Framework Packages
|
|
73
86
|
|
|
74
|
-
- **[`@
|
|
75
|
-
- **[`@dinilmusick/krnl-
|
|
76
|
-
- **[`@dinilmusick/krnl
|
|
77
|
-
- **[`@dinilmusick/
|
|
78
|
-
- **[
|
|
79
|
-
- **[`@dinilmusick/krnl-cli`](packages/cli)**: Unified `krnl` binary.
|
|
80
|
-
- **[`create-krnl`](packages/create-krnl)**: Interactive project scaffolder.
|
|
87
|
+
- **[`@ultrst-armada/krnl`](packages/core)**: Core runtime engine, Service facades, Protocols, Transports, Registry, Lifecycle, and Execution flows.
|
|
88
|
+
- **[`@dinilmusick/krnl-validate`](packages/validate)**: `ts-morph` AST engine enforcing 4-layer function purity, backend contracts, and line limits.
|
|
89
|
+
- **[`@dinilmusick/eslint-plugin-krnl`](packages/eslint-plugin)**: ESLint rules with auto-fixers for Krnl backend service standards.
|
|
90
|
+
- **[`@dinilmusick/krnl-cli`](packages/cli)**: Unified `krnl` binary for running, building, and validating backend services.
|
|
91
|
+
- **[`create-krnl`](packages/create-krnl)**: Interactive project scaffolder for Krnl backend service modules.
|
|
81
92
|
|
|
82
93
|
---
|
|
83
94
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultrst-armada/krnl",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "Krnl:
|
|
5
|
+
"description": "Krnl: Backend Service Framework for Skipo โ authoring, executing, and validating modular backend services, facades, and workflows",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./packages/core/dist/index.js",
|
|
8
8
|
"module": "./packages/core/dist/index.js",
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"krnl",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
52
|
+
"skipo",
|
|
53
|
+
"service-framework",
|
|
54
|
+
"backend",
|
|
55
|
+
"backend-modules",
|
|
56
|
+
"services",
|
|
57
|
+
"service-facades",
|
|
58
|
+
"protocols",
|
|
59
|
+
"workflows",
|
|
60
|
+
"ast-purity"
|
|
61
61
|
],
|
|
62
62
|
"author": "Dinil Palackal",
|
|
63
63
|
"license": "MIT",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dinilmusick/krnl-cli",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Unified CLI for the Krnl Framework",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Unified CLI for the Krnl Backend Service Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -383,7 +383,6 @@ var HttpProtocolAdapter = class {
|
|
|
383
383
|
|
|
384
384
|
// src/protocols/WebSocketProtocolAdapter.ts
|
|
385
385
|
var import_http2 = __toESM(require("http"), 1);
|
|
386
|
-
var import_ws = require("ws");
|
|
387
386
|
var WebSocketProtocolAdapter = class {
|
|
388
387
|
protocol = "ws";
|
|
389
388
|
capabilities = {
|
|
@@ -399,8 +398,10 @@ var WebSocketProtocolAdapter = class {
|
|
|
399
398
|
wss;
|
|
400
399
|
port;
|
|
401
400
|
async expose(service, port = 0) {
|
|
401
|
+
const wsMod = await import("ws");
|
|
402
|
+
const WebSocketServer = wsMod.WebSocketServer || wsMod.default?.WebSocketServer || wsMod.Server;
|
|
402
403
|
this.server = import_http2.default.createServer();
|
|
403
|
-
this.wss = new
|
|
404
|
+
this.wss = new WebSocketServer({ server: this.server });
|
|
404
405
|
this.wss.on("connection", (ws) => {
|
|
405
406
|
ws.on("message", async (raw) => {
|
|
406
407
|
try {
|
|
@@ -445,8 +446,10 @@ var WebSocketProtocolAdapter = class {
|
|
|
445
446
|
};
|
|
446
447
|
}
|
|
447
448
|
async send(endpoint, envelope) {
|
|
449
|
+
const wsMod = await import("ws");
|
|
450
|
+
const WS = wsMod.WebSocket || wsMod.default || globalThis.WebSocket;
|
|
448
451
|
return new Promise((resolve, reject) => {
|
|
449
|
-
const ws = new
|
|
452
|
+
const ws = new WS(`ws://${endpoint.address}:${endpoint.port}`);
|
|
450
453
|
ws.on("open", () => {
|
|
451
454
|
ws.send(JSON.stringify(envelope));
|
|
452
455
|
});
|
|
@@ -203,7 +203,7 @@ declare class HttpProtocolAdapter implements ProtocolAdapter {
|
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* @file WebSocketProtocolAdapter.ts
|
|
206
|
-
* @description WebSocket full-duplex protocol adapter for services.
|
|
206
|
+
* @description WebSocket full-duplex protocol adapter for services (browser + Node safe).
|
|
207
207
|
*/
|
|
208
208
|
|
|
209
209
|
declare class WebSocketProtocolAdapter implements ProtocolAdapter {
|
|
@@ -203,7 +203,7 @@ declare class HttpProtocolAdapter implements ProtocolAdapter {
|
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* @file WebSocketProtocolAdapter.ts
|
|
206
|
-
* @description WebSocket full-duplex protocol adapter for services.
|
|
206
|
+
* @description WebSocket full-duplex protocol adapter for services (browser + Node safe).
|
|
207
207
|
*/
|
|
208
208
|
|
|
209
209
|
declare class WebSocketProtocolAdapter implements ProtocolAdapter {
|
|
@@ -331,7 +331,6 @@ var HttpProtocolAdapter = class {
|
|
|
331
331
|
|
|
332
332
|
// src/protocols/WebSocketProtocolAdapter.ts
|
|
333
333
|
import http2 from "http";
|
|
334
|
-
import { WebSocketServer, WebSocket } from "ws";
|
|
335
334
|
var WebSocketProtocolAdapter = class {
|
|
336
335
|
protocol = "ws";
|
|
337
336
|
capabilities = {
|
|
@@ -347,6 +346,8 @@ var WebSocketProtocolAdapter = class {
|
|
|
347
346
|
wss;
|
|
348
347
|
port;
|
|
349
348
|
async expose(service, port = 0) {
|
|
349
|
+
const wsMod = await import("ws");
|
|
350
|
+
const WebSocketServer = wsMod.WebSocketServer || wsMod.default?.WebSocketServer || wsMod.Server;
|
|
350
351
|
this.server = http2.createServer();
|
|
351
352
|
this.wss = new WebSocketServer({ server: this.server });
|
|
352
353
|
this.wss.on("connection", (ws) => {
|
|
@@ -393,8 +394,10 @@ var WebSocketProtocolAdapter = class {
|
|
|
393
394
|
};
|
|
394
395
|
}
|
|
395
396
|
async send(endpoint, envelope) {
|
|
397
|
+
const wsMod = await import("ws");
|
|
398
|
+
const WS = wsMod.WebSocket || wsMod.default || globalThis.WebSocket;
|
|
396
399
|
return new Promise((resolve, reject) => {
|
|
397
|
-
const ws = new
|
|
400
|
+
const ws = new WS(`ws://${endpoint.address}:${endpoint.port}`);
|
|
398
401
|
ws.on("open", () => {
|
|
399
402
|
ws.send(JSON.stringify(envelope));
|
|
400
403
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dinilmusick/krnl-core",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Core runtime engine,
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Core runtime engine, Service facades, Protocols, Transports, and Execution flows for Krnl backend services",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-krnl",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Interactive project scaffolder for
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Interactive project scaffolder for Krnl backend service projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dinilmusick/eslint-plugin-krnl",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "ESLint plugin enforcing Krnl
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "ESLint plugin enforcing Krnl backend service purity, 4-layer architecture, and backend standards",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dinilmusick/krnl-validate",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Deep AST
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Deep AST validation and 4-layer function purity engine for Krnl backend services",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|