@xemahq/kernel-contracts 0.49.2 → 0.49.3
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/dist/app-definition/index.d.ts +1 -0
- package/dist/app-definition/index.d.ts.map +1 -1
- package/dist/app-definition/index.js +1 -0
- package/dist/app-definition/index.js.map +1 -1
- package/dist/app-definition/lib/component.d.ts +8 -0
- package/dist/app-definition/lib/component.d.ts.map +1 -0
- package/dist/app-definition/lib/component.js +8 -0
- package/dist/app-definition/lib/component.js.map +1 -0
- package/dist/app-definition/lib/definition.d.ts +2 -0
- package/dist/app-definition/lib/definition.d.ts.map +1 -1
- package/dist/app-definition/lib/widget.d.ts +2 -0
- package/dist/app-definition/lib/widget.d.ts.map +1 -1
- package/dist/app-definition/lib/widget.js.map +1 -1
- package/package.json +1 -1
- package/src/app-definition/index.ts +1 -0
- package/src/app-definition/lib/component.ts +48 -0
- package/src/app-definition/lib/definition.ts +8 -0
- package/src/app-definition/lib/widget.ts +8 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app-definition/index.ts"],"names":[],"mappings":"AAMA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app-definition/index.ts"],"names":[],"mappings":"AAMA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./lib/field-type"), exports);
|
|
18
18
|
__exportStar(require("./lib/page-kind"), exports);
|
|
19
|
+
__exportStar(require("./lib/component"), exports);
|
|
19
20
|
__exportStar(require("./lib/widget"), exports);
|
|
20
21
|
__exportStar(require("./lib/action"), exports);
|
|
21
22
|
__exportStar(require("./lib/automation"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app-definition/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAMA,mDAAiC;AACjC,kDAAgC;AAChC,+CAA6B;AAC7B,+CAA6B;AAC7B,mDAAiC;AACjC,sDAAoC;AACpC,kDAAgC;AAChC,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app-definition/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAMA,mDAAiC;AACjC,kDAAgC;AAChC,kDAAgC;AAChC,+CAA6B;AAC7B,+CAA6B;AAC7B,mDAAiC;AACjC,sDAAoC;AACpC,kDAAgC;AAChC,mDAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/app-definition/lib/component.ts"],"names":[],"mappings":"AA+BA,oBAAY,gBAAgB;IAE1B,IAAI,SAAS;CACd;AASD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAErC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppComponentKind = void 0;
|
|
4
|
+
var AppComponentKind;
|
|
5
|
+
(function (AppComponentKind) {
|
|
6
|
+
AppComponentKind["Code"] = "code";
|
|
7
|
+
})(AppComponentKind || (exports.AppComponentKind = AppComponentKind = {}));
|
|
8
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/app-definition/lib/component.ts"],"names":[],"mappings":";;;AA+BA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAE1B,iCAAa,CAAA;AACf,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B"}
|
|
@@ -3,6 +3,7 @@ import { AppPageKind } from './page-kind';
|
|
|
3
3
|
import { AppAction } from './action';
|
|
4
4
|
import { AppAutomation } from './automation';
|
|
5
5
|
import { AppWidget } from './widget';
|
|
6
|
+
import { AppCodeComponent } from './component';
|
|
6
7
|
export interface AppField {
|
|
7
8
|
key: string;
|
|
8
9
|
label: string;
|
|
@@ -36,6 +37,7 @@ export interface AppPage {
|
|
|
36
37
|
widgets?: AppWidget[];
|
|
37
38
|
dateField?: string;
|
|
38
39
|
linkKey?: string;
|
|
40
|
+
component?: AppCodeComponent;
|
|
39
41
|
}
|
|
40
42
|
export interface AppLink {
|
|
41
43
|
key: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../src/app-definition/lib/definition.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../../src/app-definition/lib/definition.ts"],"names":[],"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AO,CAAC,EAAE,SAAS,EAAE,CAAC;IAEtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAOjB,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AASD,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,KAAK,EAAE,OAAO,EAAE,CAAC;IAEjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;IAE9B,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;CACnB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AppCodeComponent } from './component';
|
|
1
2
|
export declare enum AppWidgetKind {
|
|
2
3
|
Stat = "stat",
|
|
3
4
|
Table = "table",
|
|
@@ -39,5 +40,6 @@ export interface AppWidget {
|
|
|
39
40
|
aggregate?: AppWidgetAggregate;
|
|
40
41
|
filter?: Record<string, string | number | boolean>;
|
|
41
42
|
series?: AppWidgetSeriesSource;
|
|
43
|
+
component?: AppCodeComponent;
|
|
42
44
|
}
|
|
43
45
|
//# sourceMappingURL=widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../src/app-definition/lib/widget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../src/app-definition/lib/widget.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,KAAK,UAAU;IAMf,KAAK,UAAU;CAChB;AAQD,oBAAY,mBAAmB;IAC7B,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;CAClB;AAGD,oBAAY,kBAAkB;IAC5B,KAAK,UAAU;CAChB;AAOD,oBAAY,YAAY;IACtB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAMD,oBAAY,sBAAsB;IAChC,KAAK,UAAU;IACf,GAAG,QAAQ;CACZ;AAMD,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,sBAAsB,CAAC,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAOxD,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,SAAS,EAAE,YAAY,CAAC;CACzB;AAQD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IAKd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAE/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IAEnD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAO/B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../src/app-definition/lib/widget.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../src/app-definition/lib/widget.ts"],"names":[],"mappings":";;;AASA,IAAY,aASX;AATD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,gCAAe,CAAA;IAMf,gCAAe,CAAA;AACjB,CAAC,EATW,aAAa,6BAAb,aAAa,QASxB;AAQD,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,wCAAiB,CAAA;IACjB,gDAAyB,CAAA;IACzB,wCAAiB,CAAA;AACnB,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B;AAGD,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;AACjB,CAAC,EAFW,kBAAkB,kCAAlB,kBAAkB,QAE7B;AAOD,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,2BAAW,CAAA;IACX,6BAAa,CAAA;IACb,+BAAe,CAAA;AACjB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAMD,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,qCAAW,CAAA;AACb,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/kernel-contracts",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.3",
|
|
4
4
|
"description": "Consolidated Xema OS kernel wire contracts — pure types + zod schemas for the kernel protocol surfaces. One package, one npm scope, wildcard per-surface subpath exports. No framework/runtime deps.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Neuralchowder Inc. <developer@xema.dev> (https://xema.dev)",
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// the richer zod-inferred `*Def` types stay in the app-forge server.
|
|
7
7
|
export * from './lib/field-type';
|
|
8
8
|
export * from './lib/page-kind';
|
|
9
|
+
export * from './lib/component';
|
|
9
10
|
export * from './lib/widget';
|
|
10
11
|
export * from './lib/action';
|
|
11
12
|
export * from './lib/automation';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom-UI code component — the ADDITIVE Wave-12 extension to the App Forge
|
|
3
|
+
* declarative definition (plan `runtime-app-platform.md` Wave 12 / D19). A page
|
|
4
|
+
* or widget MAY carry a `component: { kind: 'code', source }` to render an
|
|
5
|
+
* author-written UI component INSTEAD of the generic declarative renderer.
|
|
6
|
+
*
|
|
7
|
+
* This surface is the SHAPE contract only — the closed `AppComponentKind` enum
|
|
8
|
+
* plus the plain {@link AppCodeComponent} interface shared, byte-identically,
|
|
9
|
+
* by the app-forge server (whose zod schema validates it) and the App Forge web
|
|
10
|
+
* renderer (which draws it). The COMPILE step (server-side esbuild against a
|
|
11
|
+
* pinned `@xemahq/app-ui`, the SRI'd ESM chunk, and the opaque-origin iframe
|
|
12
|
+
* runtime) is NOT part of this contract — it is the large multi-wave runtime the
|
|
13
|
+
* plan defers. Declaring a code component is additive: an absent `component`
|
|
14
|
+
* (the default on every page/widget today) preserves the current declarative
|
|
15
|
+
* behavior exactly.
|
|
16
|
+
*
|
|
17
|
+
* **Cost is not free and the platform must say so.** The moment a definition
|
|
18
|
+
* carries a code component, publishing it means COMPILING it, and the app stops
|
|
19
|
+
* being live-on-keystroke (plan Wave 12). Until the compiler + iframe runtime
|
|
20
|
+
* ship, the app-forge publish path FAILS CLOSED on any definition containing a
|
|
21
|
+
* code component (`APP_CUSTOM_UI_NOT_YET_AVAILABLE`) — it never silently accepts
|
|
22
|
+
* or ignores one.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Closed set of custom-UI component kinds. Only `code` exists — a
|
|
27
|
+
* server-compiled, author-authored component. A future non-code kind (e.g. a
|
|
28
|
+
* pinned marketplace component) is a one-line addition here plus a matching
|
|
29
|
+
* discriminated variant. Stable wire string; never compare against a free-form
|
|
30
|
+
* string.
|
|
31
|
+
*/
|
|
32
|
+
export enum AppComponentKind {
|
|
33
|
+
/** An author-written UI component, compiled server-side against `@xemahq/app-ui`. */
|
|
34
|
+
Code = 'code',
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A `kind: 'code'` custom-UI component authored against the pinned
|
|
39
|
+
* `@xemahq/app-ui` surface. `source` is the raw component module text; it is
|
|
40
|
+
* validated (length-bounded) and — once the compiler ships — type-checked and
|
|
41
|
+
* responsive-linted at PUBLISH time, never at author-keystroke time. Carried
|
|
42
|
+
* inside the opaque app-definition JSON on a page or widget.
|
|
43
|
+
*/
|
|
44
|
+
export interface AppCodeComponent {
|
|
45
|
+
readonly kind: AppComponentKind.Code;
|
|
46
|
+
/** The raw component module source authored against `@xemahq/app-ui`. */
|
|
47
|
+
readonly source: string;
|
|
48
|
+
}
|
|
@@ -14,6 +14,7 @@ import { AppPageKind } from './page-kind';
|
|
|
14
14
|
import { AppAction } from './action';
|
|
15
15
|
import { AppAutomation } from './automation';
|
|
16
16
|
import { AppWidget } from './widget';
|
|
17
|
+
import { AppCodeComponent } from './component';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* One entity field. `object`/`list` fields carry a recursive nested `fields[]`
|
|
@@ -76,6 +77,13 @@ export interface AppPage {
|
|
|
76
77
|
dateField?: string;
|
|
77
78
|
/** related: key of the {@link AppLink} this page reverse-looks-up. */
|
|
78
79
|
linkKey?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Custom-UI (Wave 12): an author-written code component that renders this page
|
|
82
|
+
* INSTEAD of the generic declarative renderer. Additive — absent ⇒ the page
|
|
83
|
+
* renders declaratively (today's behavior). A definition carrying any code
|
|
84
|
+
* component is compile-gated at publish (see {@link AppCodeComponent}).
|
|
85
|
+
*/
|
|
86
|
+
component?: AppCodeComponent;
|
|
79
87
|
}
|
|
80
88
|
|
|
81
89
|
/**
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* app-forge server's zod schema and the web renderer. All values are stable
|
|
5
5
|
* wire strings — never compare against a free-form string.
|
|
6
6
|
*/
|
|
7
|
+
import { AppCodeComponent } from './component';
|
|
7
8
|
|
|
8
9
|
/** Closed set of dashboard widget kinds. */
|
|
9
10
|
export enum AppWidgetKind {
|
|
@@ -94,4 +95,11 @@ export interface AppWidget {
|
|
|
94
95
|
filter?: Record<string, string | number | boolean>;
|
|
95
96
|
/** Series (chart) source — present iff `kind === AppWidgetKind.Chart`. */
|
|
96
97
|
series?: AppWidgetSeriesSource;
|
|
98
|
+
/**
|
|
99
|
+
* Custom-UI (Wave 12): an author-written code component that renders this
|
|
100
|
+
* widget INSTEAD of the generic declarative widget renderer. Additive — absent
|
|
101
|
+
* ⇒ the widget renders declaratively (today's behavior). Compile-gated at
|
|
102
|
+
* publish (see {@link AppCodeComponent}).
|
|
103
|
+
*/
|
|
104
|
+
component?: AppCodeComponent;
|
|
97
105
|
}
|