@niscorp/moss 0.3.2 → 0.3.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/CHANGELOG.md +102 -0
- package/DESIGN.md +84 -19
- package/DOCS.md +170 -35
- package/README.md +2 -2
- package/dist/{chunk-J72N3EMJ.js → chunk-4T6KAXBP.js} +45 -27
- package/dist/chunk-4T6KAXBP.js.map +1 -0
- package/dist/{chunk-ZP3C53AC.js → chunk-AUZMT3GL.js} +739 -654
- package/dist/chunk-AUZMT3GL.js.map +1 -0
- package/dist/{chunk-ZOEUEMDX.js → chunk-HOZID4EM.js} +131 -16
- package/dist/chunk-HOZID4EM.js.map +1 -0
- package/dist/chunk-NE2EXMTO.js +103 -0
- package/dist/chunk-NE2EXMTO.js.map +1 -0
- package/dist/client/node.cjs +1 -1
- package/dist/client/node.cjs.map +1 -1
- package/dist/client/node.js +1 -1
- package/dist/client/node.js.map +1 -1
- package/dist/client.cjs +60 -26
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -1
- package/dist/client.d.ts +6 -1
- package/dist/client.js +2 -2
- package/dist/{document-D9khv9jI.d.cts → document-DhWxieUc.d.cts} +22 -3
- package/dist/{document-D9khv9jI.d.ts → document-DhWxieUc.d.ts} +22 -3
- package/dist/index.cjs +777 -572
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +2 -2
- package/dist/node.cjs +370 -219
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +2 -1
- package/dist/node.d.ts +2 -1
- package/dist/node.js +3 -3
- package/dist/terminal/index.cjs +60 -26
- package/dist/terminal/index.cjs.map +1 -1
- package/dist/terminal/index.js +2 -2
- package/dist/vite.cjs +103 -28
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +14 -9
- package/dist/vite.js.map +1 -1
- package/package.json +9 -9
- package/dist/chunk-J72N3EMJ.js.map +0 -1
- package/dist/chunk-SUVDISEG.js +0 -64
- package/dist/chunk-SUVDISEG.js.map +0 -1
- package/dist/chunk-ZOEUEMDX.js.map +0 -1
- package/dist/chunk-ZP3C53AC.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ScreenHead } from '@niscorp/nova/document';
|
|
2
2
|
import * as _niscorp_nova from '@niscorp/nova';
|
|
3
3
|
import { LayoutPaletteEntry, ActionDefinition, Shell, FetchFn, LayoutNode, CanvasConfig, ActionFragment, FunctionHandler, RenderNode } from '@niscorp/nova';
|
|
4
|
-
import { PgPool, MutationClient, CacheBackend, ScopePolicy, ScopeBehaviors, SeedEntry, SeedMutation } from '@niscorp/vex';
|
|
4
|
+
import { PgPool, MutationClient, CacheBackend, QueryEngineConfig, ScopePolicy, ScopeBehaviors, SeedEntry, SeedMutation } from '@niscorp/vex';
|
|
5
5
|
import * as _niscorp_tide from '@niscorp/tide';
|
|
6
6
|
import { Upgrader, Sequence } from '@niscorp/strata';
|
|
7
7
|
import { z } from 'zod';
|
|
@@ -517,8 +517,11 @@ type NiscRuntime = {
|
|
|
517
517
|
pool: PgPool;
|
|
518
518
|
db: MutationClient;
|
|
519
519
|
cache?: CacheBackend;
|
|
520
|
+
vexConfig?: QueryEngineConfig['config'];
|
|
520
521
|
session: SessionVerifier | 'sessions' | 'dev-open';
|
|
522
|
+
origins?: readonly string[];
|
|
521
523
|
migrations?: 'apply' | 'verify';
|
|
524
|
+
tables?: readonly Sequence[];
|
|
522
525
|
shellIdleMs?: number;
|
|
523
526
|
endpointTimeoutMs?: number;
|
|
524
527
|
sessionRevalidateMs?: number;
|
|
@@ -833,6 +836,14 @@ type Connection = {
|
|
|
833
836
|
close: (code?: number, reason?: string) => void;
|
|
834
837
|
onMessage: (fn: (text: string) => void) => void;
|
|
835
838
|
onClose: (fn: () => void) => void;
|
|
839
|
+
upgrade?: {
|
|
840
|
+
offered: readonly string[];
|
|
841
|
+
origin?: string | null;
|
|
842
|
+
host?: string | null;
|
|
843
|
+
cookie?: string | null;
|
|
844
|
+
answer?: (cookies: readonly string[]) => void;
|
|
845
|
+
};
|
|
846
|
+
seal?: (token: string) => Promise<string>;
|
|
836
847
|
};
|
|
837
848
|
type ServerMessage = {
|
|
838
849
|
type: 'hello';
|
|
@@ -861,6 +872,9 @@ type ServerMessage = {
|
|
|
861
872
|
} | {
|
|
862
873
|
type: 'session';
|
|
863
874
|
token: string;
|
|
875
|
+
} | {
|
|
876
|
+
type: 'session';
|
|
877
|
+
sealed: string;
|
|
864
878
|
} | {
|
|
865
879
|
type: 'error';
|
|
866
880
|
code: string;
|
|
@@ -886,6 +900,8 @@ type ClientMessage = {
|
|
|
886
900
|
} | {
|
|
887
901
|
type: 'reset';
|
|
888
902
|
};
|
|
903
|
+
declare const PROTOCOL = 2;
|
|
904
|
+
declare const offerToken: (token: string | null, sealed?: string | null) => string[];
|
|
889
905
|
declare const CLOSE_INVALID_TOKEN = 4401;
|
|
890
906
|
declare const CLOSE_SIGNED_OUT = 4403;
|
|
891
907
|
declare const CLOSE_SHELL_FAILED = 4500;
|
|
@@ -899,6 +915,8 @@ type SocketContext = {
|
|
|
899
915
|
} | undefined;
|
|
900
916
|
revalidateMs?: number;
|
|
901
917
|
telemetry?: Telemetry;
|
|
918
|
+
origins?: readonly string[];
|
|
919
|
+
sessionLastsMs?: (token: string) => number | null | Promise<number | null>;
|
|
902
920
|
};
|
|
903
921
|
declare const DEFAULT_REVALIDATE_MS: number;
|
|
904
922
|
type SocketAccept = ((url: string, connection: Connection) => Promise<void>) & {
|
|
@@ -957,7 +975,7 @@ type MossServer = Hono<Env> & {
|
|
|
957
975
|
declare const createServer: (app: NiscApp, runtime: NiscRuntime) => Promise<MossServer>;
|
|
958
976
|
|
|
959
977
|
declare const SNAPSHOT_ELEMENT_ID = "nisc-snapshot";
|
|
960
|
-
|
|
978
|
+
|
|
961
979
|
declare const embedSnapshot: (snapshot: ShellSnapshot, principal: string | null, path?: string) => string;
|
|
962
980
|
declare const documentHeaders: (principal: string | null) => Record<string, string>;
|
|
963
981
|
type DocumentConfig = {
|
|
@@ -966,6 +984,7 @@ type DocumentConfig = {
|
|
|
966
984
|
request: {
|
|
967
985
|
path: string;
|
|
968
986
|
cookie?: string | null;
|
|
987
|
+
host?: string | null;
|
|
969
988
|
};
|
|
970
989
|
draw: (snapshot: ShellSnapshot) => string | Promise<string>;
|
|
971
990
|
htmlAttributes?: (snapshot: ShellSnapshot) => Record<string, string>;
|
|
@@ -1002,4 +1021,4 @@ declare const exportDocuments: (config: Omit<DocumentConfig, "request"> & {
|
|
|
1002
1021
|
paths: readonly string[];
|
|
1003
1022
|
}) => Promise<ExportedDocument[]>;
|
|
1004
1023
|
|
|
1005
|
-
export { type
|
|
1024
|
+
export { type SocketContext as $, type MossServer as A, type Bundle as B, CLOSE_INVALID_TOKEN as C, DEFAULT_IDENTITY_IDLE_MS as D, type Emit as E, type Fabric as F, PROTOCOL as G, type PressResult as H, type IdentityCache as I, type RunSink as J, type RunTurn as K, type LayoutVariant as L, MOSS_SEQUENCE as M, type NiscRuntime as N, SNAPSHOT_ELEMENT_ID as O, type PageManifest as P, type ServerMessage as Q, type RunRecord as R, type SessionVerifier as S, type ShellHost as T, type ShellManifest as U, type ShellNeed as V, type ShellOpening as W, type ShellReport as X, type ShellSession as Y, type ShellSnapshot as Z, type SocketAccept as _, type NiscApp as a, type SpanClock as a0, type StorePress as a1, type Telemetry as a2, type TelemetrySpan as a3, buildContract as a4, callIntegrationWith as a5, contractAsMarkdown as a6, copyPress as a7, createIdentityCache as a8, createServer as a9, resolveRoles as aA, resolveVariants as aB, resolveVariantsForRoles as aC, runIntake as aD, shellNeedOf as aE, spanClock as aF, verifyVariants as aG, wearableOf as aH, wireFabric as aI, createShellHost as aa, createSocket as ab, defineApp as ac, describePlacements as ad, devSession as ae, documentHeaders as af, embedSnapshot as ag, emitterOf as ah, exportDocuments as ai, filterInstalled as aj, initIntegrations as ak, integrationByKey as al, integrationOfAction as am, listAttachments as an, listIntegrations as ao, listPlacements as ap, loadIntegrationActions as aq, memoKeyOf as ar, mintDevToken as as, offerToken as at, renderDocument as au, resolveCatalog as av, resolveCatalogForRoles as aw, resolvePolicy as ax, resolvePolicyAtReach as ay, resolvePolicyForRoles as az, CLOSE_SHELL_FAILED as b, CLOSE_SIGNED_OUT as c, type CallIntegration as d, type Catalog as e, type ClientMessage as f, type Connection as g, type Contract as h, DEFAULT_IDENTITY_MAX as i, DEFAULT_IDLE_MS as j, DEFAULT_REVALIDATE_MS as k, type DocumentConfig as l, type DrawnDocument as m, type ExecuteAs as n, type ExportedDocument as o, type FabricApply as p, type FabricMessage as q, type FabricSignal as r, type FactIntake as s, type FunctionSession as t, type IdentityCacheContext as u, type IdentityRecord as v, type IdentityReport as w, type IntakeContext as x, type IntakeResult as y, type IntegrationRow as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ScreenHead } from '@niscorp/nova/document';
|
|
2
2
|
import * as _niscorp_nova from '@niscorp/nova';
|
|
3
3
|
import { LayoutPaletteEntry, ActionDefinition, Shell, FetchFn, LayoutNode, CanvasConfig, ActionFragment, FunctionHandler, RenderNode } from '@niscorp/nova';
|
|
4
|
-
import { PgPool, MutationClient, CacheBackend, ScopePolicy, ScopeBehaviors, SeedEntry, SeedMutation } from '@niscorp/vex';
|
|
4
|
+
import { PgPool, MutationClient, CacheBackend, QueryEngineConfig, ScopePolicy, ScopeBehaviors, SeedEntry, SeedMutation } from '@niscorp/vex';
|
|
5
5
|
import * as _niscorp_tide from '@niscorp/tide';
|
|
6
6
|
import { Upgrader, Sequence } from '@niscorp/strata';
|
|
7
7
|
import { z } from 'zod';
|
|
@@ -517,8 +517,11 @@ type NiscRuntime = {
|
|
|
517
517
|
pool: PgPool;
|
|
518
518
|
db: MutationClient;
|
|
519
519
|
cache?: CacheBackend;
|
|
520
|
+
vexConfig?: QueryEngineConfig['config'];
|
|
520
521
|
session: SessionVerifier | 'sessions' | 'dev-open';
|
|
522
|
+
origins?: readonly string[];
|
|
521
523
|
migrations?: 'apply' | 'verify';
|
|
524
|
+
tables?: readonly Sequence[];
|
|
522
525
|
shellIdleMs?: number;
|
|
523
526
|
endpointTimeoutMs?: number;
|
|
524
527
|
sessionRevalidateMs?: number;
|
|
@@ -833,6 +836,14 @@ type Connection = {
|
|
|
833
836
|
close: (code?: number, reason?: string) => void;
|
|
834
837
|
onMessage: (fn: (text: string) => void) => void;
|
|
835
838
|
onClose: (fn: () => void) => void;
|
|
839
|
+
upgrade?: {
|
|
840
|
+
offered: readonly string[];
|
|
841
|
+
origin?: string | null;
|
|
842
|
+
host?: string | null;
|
|
843
|
+
cookie?: string | null;
|
|
844
|
+
answer?: (cookies: readonly string[]) => void;
|
|
845
|
+
};
|
|
846
|
+
seal?: (token: string) => Promise<string>;
|
|
836
847
|
};
|
|
837
848
|
type ServerMessage = {
|
|
838
849
|
type: 'hello';
|
|
@@ -861,6 +872,9 @@ type ServerMessage = {
|
|
|
861
872
|
} | {
|
|
862
873
|
type: 'session';
|
|
863
874
|
token: string;
|
|
875
|
+
} | {
|
|
876
|
+
type: 'session';
|
|
877
|
+
sealed: string;
|
|
864
878
|
} | {
|
|
865
879
|
type: 'error';
|
|
866
880
|
code: string;
|
|
@@ -886,6 +900,8 @@ type ClientMessage = {
|
|
|
886
900
|
} | {
|
|
887
901
|
type: 'reset';
|
|
888
902
|
};
|
|
903
|
+
declare const PROTOCOL = 2;
|
|
904
|
+
declare const offerToken: (token: string | null, sealed?: string | null) => string[];
|
|
889
905
|
declare const CLOSE_INVALID_TOKEN = 4401;
|
|
890
906
|
declare const CLOSE_SIGNED_OUT = 4403;
|
|
891
907
|
declare const CLOSE_SHELL_FAILED = 4500;
|
|
@@ -899,6 +915,8 @@ type SocketContext = {
|
|
|
899
915
|
} | undefined;
|
|
900
916
|
revalidateMs?: number;
|
|
901
917
|
telemetry?: Telemetry;
|
|
918
|
+
origins?: readonly string[];
|
|
919
|
+
sessionLastsMs?: (token: string) => number | null | Promise<number | null>;
|
|
902
920
|
};
|
|
903
921
|
declare const DEFAULT_REVALIDATE_MS: number;
|
|
904
922
|
type SocketAccept = ((url: string, connection: Connection) => Promise<void>) & {
|
|
@@ -957,7 +975,7 @@ type MossServer = Hono<Env> & {
|
|
|
957
975
|
declare const createServer: (app: NiscApp, runtime: NiscRuntime) => Promise<MossServer>;
|
|
958
976
|
|
|
959
977
|
declare const SNAPSHOT_ELEMENT_ID = "nisc-snapshot";
|
|
960
|
-
|
|
978
|
+
|
|
961
979
|
declare const embedSnapshot: (snapshot: ShellSnapshot, principal: string | null, path?: string) => string;
|
|
962
980
|
declare const documentHeaders: (principal: string | null) => Record<string, string>;
|
|
963
981
|
type DocumentConfig = {
|
|
@@ -966,6 +984,7 @@ type DocumentConfig = {
|
|
|
966
984
|
request: {
|
|
967
985
|
path: string;
|
|
968
986
|
cookie?: string | null;
|
|
987
|
+
host?: string | null;
|
|
969
988
|
};
|
|
970
989
|
draw: (snapshot: ShellSnapshot) => string | Promise<string>;
|
|
971
990
|
htmlAttributes?: (snapshot: ShellSnapshot) => Record<string, string>;
|
|
@@ -1002,4 +1021,4 @@ declare const exportDocuments: (config: Omit<DocumentConfig, "request"> & {
|
|
|
1002
1021
|
paths: readonly string[];
|
|
1003
1022
|
}) => Promise<ExportedDocument[]>;
|
|
1004
1023
|
|
|
1005
|
-
export { type
|
|
1024
|
+
export { type SocketContext as $, type MossServer as A, type Bundle as B, CLOSE_INVALID_TOKEN as C, DEFAULT_IDENTITY_IDLE_MS as D, type Emit as E, type Fabric as F, PROTOCOL as G, type PressResult as H, type IdentityCache as I, type RunSink as J, type RunTurn as K, type LayoutVariant as L, MOSS_SEQUENCE as M, type NiscRuntime as N, SNAPSHOT_ELEMENT_ID as O, type PageManifest as P, type ServerMessage as Q, type RunRecord as R, type SessionVerifier as S, type ShellHost as T, type ShellManifest as U, type ShellNeed as V, type ShellOpening as W, type ShellReport as X, type ShellSession as Y, type ShellSnapshot as Z, type SocketAccept as _, type NiscApp as a, type SpanClock as a0, type StorePress as a1, type Telemetry as a2, type TelemetrySpan as a3, buildContract as a4, callIntegrationWith as a5, contractAsMarkdown as a6, copyPress as a7, createIdentityCache as a8, createServer as a9, resolveRoles as aA, resolveVariants as aB, resolveVariantsForRoles as aC, runIntake as aD, shellNeedOf as aE, spanClock as aF, verifyVariants as aG, wearableOf as aH, wireFabric as aI, createShellHost as aa, createSocket as ab, defineApp as ac, describePlacements as ad, devSession as ae, documentHeaders as af, embedSnapshot as ag, emitterOf as ah, exportDocuments as ai, filterInstalled as aj, initIntegrations as ak, integrationByKey as al, integrationOfAction as am, listAttachments as an, listIntegrations as ao, listPlacements as ap, loadIntegrationActions as aq, memoKeyOf as ar, mintDevToken as as, offerToken as at, renderDocument as au, resolveCatalog as av, resolveCatalogForRoles as aw, resolvePolicy as ax, resolvePolicyAtReach as ay, resolvePolicyForRoles as az, CLOSE_SHELL_FAILED as b, CLOSE_SIGNED_OUT as c, type CallIntegration as d, type Catalog as e, type ClientMessage as f, type Connection as g, type Contract as h, DEFAULT_IDENTITY_MAX as i, DEFAULT_IDLE_MS as j, DEFAULT_REVALIDATE_MS as k, type DocumentConfig as l, type DrawnDocument as m, type ExecuteAs as n, type ExportedDocument as o, type FabricApply as p, type FabricMessage as q, type FabricSignal as r, type FactIntake as s, type FunctionSession as t, type IdentityCacheContext as u, type IdentityRecord as v, type IdentityReport as w, type IntakeContext as x, type IntakeResult as y, type IntegrationRow as z };
|