@niscorp/moss 0.5.0 → 0.7.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/CHANGELOG.md +111 -0
- package/DESIGN.md +77 -40
- package/DOCS.md +639 -81
- package/README.md +2 -2
- package/dist/{chunk-JYBHJDT7.cjs → chunk-C2DNDIQX.cjs} +5 -4
- package/dist/chunk-C2DNDIQX.cjs.map +1 -0
- package/dist/{chunk-BZK37HR3.cjs → chunk-DSTHFSTO.cjs} +1996 -1336
- package/dist/chunk-DSTHFSTO.cjs.map +1 -0
- package/dist/chunk-F45SFR7W.cjs +903 -0
- package/dist/chunk-F45SFR7W.cjs.map +1 -0
- package/dist/{chunk-PCPQMC7A.js → chunk-IMZZB4JE.js} +5 -4
- package/dist/chunk-IMZZB4JE.js.map +1 -0
- package/dist/{chunk-BQRPR2F7.js → chunk-MTC46PGQ.js} +1979 -1317
- package/dist/chunk-MTC46PGQ.js.map +1 -0
- package/dist/chunk-MYGVHWS5.js +870 -0
- package/dist/chunk-MYGVHWS5.js.map +1 -0
- package/dist/{chunk-FTZ6NFKZ.js → chunk-X2Q546EB.js} +3 -3
- package/dist/{chunk-FTZ6NFKZ.js.map → chunk-X2Q546EB.js.map} +1 -1
- package/dist/{chunk-5U2ZZUI5.cjs → chunk-Z2VA6AOE.cjs} +5 -5
- package/dist/{chunk-5U2ZZUI5.cjs.map → chunk-Z2VA6AOE.cjs.map} +1 -1
- package/dist/document-AbQUbQaP.d.ts +381 -0
- package/dist/document-wHHxIXJz.d.cts +381 -0
- package/dist/{index-BuDuOSyx.d.cts → index-Dml1klpZ.d.cts} +5 -1
- package/dist/{index-BuDuOSyx.d.ts → index-Dml1klpZ.d.ts} +5 -1
- package/dist/index.cjs +17 -17
- package/dist/index.d.cts +7 -9
- package/dist/index.d.ts +7 -9
- package/dist/index.js +3 -3
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.cts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.js +1 -1
- package/dist/node.cjs +8 -8
- package/dist/node.d.cts +3 -4
- package/dist/node.d.ts +3 -4
- package/dist/node.js +4 -4
- package/dist/tide.d.cts +1 -1
- package/dist/tide.d.ts +1 -1
- package/dist/unverified.cjs +3 -3
- package/dist/unverified.js +2 -2
- package/dist/vite.cjs +9 -9
- package/dist/vite.d.cts +6 -1
- package/dist/vite.d.ts +6 -1
- package/dist/vite.js +4 -4
- package/package.json +13 -13
- package/dist/app-BoVB0_0j.d.ts +0 -143
- package/dist/app-Cc8VnOz8.d.cts +0 -143
- package/dist/chunk-BQRPR2F7.js.map +0 -1
- package/dist/chunk-BZK37HR3.cjs.map +0 -1
- package/dist/chunk-FTFME3HS.cjs +0 -383
- package/dist/chunk-FTFME3HS.cjs.map +0 -1
- package/dist/chunk-JYBHJDT7.cjs.map +0 -1
- package/dist/chunk-PCPQMC7A.js.map +0 -1
- package/dist/chunk-ZWB6QDGF.js +0 -374
- package/dist/chunk-ZWB6QDGF.js.map +0 -1
- package/dist/document-CU3muGbz.d.cts +0 -169
- package/dist/document-UFbAd-Ka.d.ts +0 -169
package/dist/node.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { D as DocumentConfig, M as MossServer } from './document-
|
|
2
|
-
import { N as
|
|
3
|
-
import { N as NiscRuntime } from './index-BuDuOSyx.js';
|
|
1
|
+
import { D as DocumentConfig, M as MossServer, N as NiscApp } from './document-AbQUbQaP.js';
|
|
2
|
+
import { N as NiscRuntime } from './index-Dml1klpZ.js';
|
|
4
3
|
import { S as SocketAccept, T as TransportSettings } from './socket-D90h1xSV.js';
|
|
5
4
|
import { IncomingMessage } from 'node:http';
|
|
6
5
|
import { Duplex } from 'node:stream';
|
|
@@ -8,9 +7,9 @@ import 'hono';
|
|
|
8
7
|
import '@niscorp/charter';
|
|
9
8
|
import '@niscorp/nova';
|
|
10
9
|
import '@niscorp/vex';
|
|
11
|
-
import '@niscorp/nova/document';
|
|
12
10
|
import '@niscorp/strata';
|
|
13
11
|
import '@niscorp/nova/i18n';
|
|
12
|
+
import '@niscorp/nova/document';
|
|
14
13
|
import '@niscorp/strata/postgres';
|
|
15
14
|
import 'zod';
|
|
16
15
|
|
package/dist/node.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { MOSS_PATHS, attachSocket, mountSite, serve } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
export { MOSS_PATHS, attachSocket, mountSite, serve } from './chunk-X2Q546EB.js';
|
|
2
|
+
import './chunk-MTC46PGQ.js';
|
|
3
|
+
import './chunk-MYGVHWS5.js';
|
|
4
|
+
import './chunk-IMZZB4JE.js';
|
|
5
5
|
import './chunk-4ZGAFZGS.js';
|
|
6
6
|
//# sourceMappingURL=node.js.map
|
|
7
7
|
//# sourceMappingURL=node.js.map
|
package/dist/tide.d.cts
CHANGED
package/dist/tide.d.ts
CHANGED
package/dist/unverified.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkF45SFR7W_cjs = require('./chunk-F45SFR7W.cjs');
|
|
4
|
+
require('./chunk-C2DNDIQX.cjs');
|
|
5
5
|
require('./chunk-3RIWTXGI.cjs');
|
|
6
6
|
|
|
7
7
|
// src/shells/unverified.ts
|
|
8
|
-
var unverifiedShell = (session) =>
|
|
8
|
+
var unverifiedShell = (session) => chunkF45SFR7W_cjs.wholeShellOf(session.shell);
|
|
9
9
|
|
|
10
10
|
exports.unverifiedShell = unverifiedShell;
|
|
11
11
|
//# sourceMappingURL=unverified.cjs.map
|
package/dist/unverified.js
CHANGED
package/dist/vite.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var chunkZ2VA6AOE_cjs = require('./chunk-Z2VA6AOE.cjs');
|
|
4
|
+
var chunkDSTHFSTO_cjs = require('./chunk-DSTHFSTO.cjs');
|
|
5
|
+
require('./chunk-F45SFR7W.cjs');
|
|
6
|
+
require('./chunk-C2DNDIQX.cjs');
|
|
7
7
|
require('./chunk-3RIWTXGI.cjs');
|
|
8
8
|
var promises = require('fs/promises');
|
|
9
9
|
var net = require('net');
|
|
@@ -57,7 +57,7 @@ var devMiddleware = (vite, options, owned, current) => (req, res, next) => {
|
|
|
57
57
|
}
|
|
58
58
|
const scheme = "encrypted" in req.socket && req.socket.encrypted === true ? "https" : "http";
|
|
59
59
|
res.statusCode = 302;
|
|
60
|
-
res.setHeader("set-cookie",
|
|
60
|
+
res.setHeader("set-cookie", chunkDSTHFSTO_cjs.sessionCookies(`${scheme}://${req.headers.host ?? "localhost"}`, token, app.tokenKey !== void 0 ? { key: app.tokenKey } : {}));
|
|
61
61
|
res.setHeader("location", "/");
|
|
62
62
|
res.end();
|
|
63
63
|
}).catch(() => {
|
|
@@ -83,7 +83,7 @@ var devMiddleware = (vite, options, owned, current) => (req, res, next) => {
|
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
85
|
const template = await vite.transformIndexHtml(url, await promises.readFile(path.resolve(vite.config.root, options.index ?? "index.html"), "utf8"));
|
|
86
|
-
const page = await
|
|
86
|
+
const page = await chunkDSTHFSTO_cjs.renderDocument({
|
|
87
87
|
server: app.server,
|
|
88
88
|
template,
|
|
89
89
|
request: { path: path$1 === "/index.html" ? "/" : path$1, cookie: req.headers.cookie ?? null, host: req.headers.host ?? null },
|
|
@@ -104,17 +104,17 @@ var mossDev = (options) => ({
|
|
|
104
104
|
configureServer: (vite) => {
|
|
105
105
|
const label = options.label ?? "moss";
|
|
106
106
|
const watch = options.watch ?? DEFAULT_WATCH;
|
|
107
|
-
const owned = options.owned ??
|
|
107
|
+
const owned = options.owned ?? chunkZ2VA6AOE_cjs.MOSS_PATHS;
|
|
108
108
|
const load = (id) => vite.ssrLoadModule(id);
|
|
109
109
|
const httpServer = vite.httpServer;
|
|
110
110
|
const boot = async () => {
|
|
111
111
|
const app = await options.app(load);
|
|
112
|
-
return { app, listener: nodeServer.getRequestListener(app.server.fetch), ...httpServer !== null ? { transport:
|
|
112
|
+
return { app, listener: nodeServer.getRequestListener(app.server.fetch), ...httpServer !== null ? { transport: chunkZ2VA6AOE_cjs.createTransport(app.server.socket) } : {} };
|
|
113
113
|
};
|
|
114
114
|
let current = boot();
|
|
115
115
|
current.catch((error) => vite.config.logger.error(`[${label}] the app did not boot: ${said(error)}`, { timestamp: true }));
|
|
116
116
|
if (httpServer !== null) {
|
|
117
|
-
|
|
117
|
+
chunkZ2VA6AOE_cjs.listenForUpgrades(httpServer, "/socket", (req, socket, head) => {
|
|
118
118
|
void current.then(
|
|
119
119
|
({ transport }) => transport?.upgrade(req, socket, head),
|
|
120
120
|
() => socket.end("HTTP/1.1 503 Service Unavailable\r\nConnection: close\r\nContent-Length: 0\r\n\r\n")
|
package/dist/vite.d.cts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { M as MossServer, D as DocumentConfig } from './document-
|
|
2
|
+
import { M as MossServer, D as DocumentConfig } from './document-wHHxIXJz.cjs';
|
|
3
3
|
import 'hono';
|
|
4
4
|
import '@niscorp/charter';
|
|
5
5
|
import '@niscorp/nova';
|
|
6
6
|
import '@niscorp/vex';
|
|
7
|
+
import '@niscorp/strata';
|
|
8
|
+
import '@niscorp/nova/i18n';
|
|
9
|
+
import './index-Dml1klpZ.cjs';
|
|
10
|
+
import '@niscorp/strata/postgres';
|
|
11
|
+
import 'zod';
|
|
7
12
|
import './socket-D90h1xSV.cjs';
|
|
8
13
|
import '@niscorp/nova/document';
|
|
9
14
|
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { M as MossServer, D as DocumentConfig } from './document-
|
|
2
|
+
import { M as MossServer, D as DocumentConfig } from './document-AbQUbQaP.js';
|
|
3
3
|
import 'hono';
|
|
4
4
|
import '@niscorp/charter';
|
|
5
5
|
import '@niscorp/nova';
|
|
6
6
|
import '@niscorp/vex';
|
|
7
|
+
import '@niscorp/strata';
|
|
8
|
+
import '@niscorp/nova/i18n';
|
|
9
|
+
import './index-Dml1klpZ.js';
|
|
10
|
+
import '@niscorp/strata/postgres';
|
|
11
|
+
import 'zod';
|
|
7
12
|
import './socket-D90h1xSV.js';
|
|
8
13
|
import '@niscorp/nova/document';
|
|
9
14
|
|
package/dist/vite.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MOSS_PATHS, listenForUpgrades, createTransport } from './chunk-
|
|
2
|
-
import { sessionCookies, renderDocument } from './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
import { MOSS_PATHS, listenForUpgrades, createTransport } from './chunk-X2Q546EB.js';
|
|
2
|
+
import { sessionCookies, renderDocument } from './chunk-MTC46PGQ.js';
|
|
3
|
+
import './chunk-MYGVHWS5.js';
|
|
4
|
+
import './chunk-IMZZB4JE.js';
|
|
5
5
|
import './chunk-4ZGAFZGS.js';
|
|
6
6
|
import { readFile } from 'fs/promises';
|
|
7
7
|
import { BlockList, isIPv4, isIPv6 } from 'net';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niscorp/moss",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "moss — the nisc app server: serves existence (catalog, scoped vex, the socket), derived from artifacts",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -212,12 +212,12 @@
|
|
|
212
212
|
"zod": "^4.2.0",
|
|
213
213
|
"vue": "^3.5.0",
|
|
214
214
|
"vite": ">=6",
|
|
215
|
-
"@niscorp/
|
|
216
|
-
"@niscorp/charter": "^0.1.
|
|
217
|
-
"@niscorp/
|
|
218
|
-
"@niscorp/
|
|
219
|
-
"@niscorp/vex": "^0.
|
|
220
|
-
"@niscorp/
|
|
215
|
+
"@niscorp/strata": "^0.1.7",
|
|
216
|
+
"@niscorp/charter": "^0.1.4",
|
|
217
|
+
"@niscorp/tide": "^0.1.7",
|
|
218
|
+
"@niscorp/nova": "^0.4.0",
|
|
219
|
+
"@niscorp/vex": "^0.4.0",
|
|
220
|
+
"@niscorp/prism": "^0.3.1"
|
|
221
221
|
},
|
|
222
222
|
"peerDependenciesMeta": {
|
|
223
223
|
"@niscorp/tide": {
|
|
@@ -255,12 +255,12 @@
|
|
|
255
255
|
"vitest": "^4.1.2",
|
|
256
256
|
"vue": "^3.5.43",
|
|
257
257
|
"zod": "^4.6.5",
|
|
258
|
-
"@niscorp/charter": "^0.1.
|
|
259
|
-
"@niscorp/nova": "^0.
|
|
260
|
-
"@niscorp/
|
|
261
|
-
"@niscorp/
|
|
262
|
-
"@niscorp/
|
|
263
|
-
"@niscorp/vex": "^0.
|
|
258
|
+
"@niscorp/charter": "^0.1.4",
|
|
259
|
+
"@niscorp/nova": "^0.4.0",
|
|
260
|
+
"@niscorp/strata": "^0.1.7",
|
|
261
|
+
"@niscorp/prism": "^0.3.1",
|
|
262
|
+
"@niscorp/tide": "^0.1.7",
|
|
263
|
+
"@niscorp/vex": "^0.4.0"
|
|
264
264
|
},
|
|
265
265
|
"scripts": {
|
|
266
266
|
"build": "node -e \"fs.rmSync('dist',{recursive:true,force:true})\" && tsup",
|
package/dist/app-BoVB0_0j.d.ts
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { Sequence } from '@niscorp/strata';
|
|
2
|
-
import { GenerateDsl, MapToShape, QueryResponse, ScopeBehaviors, SeedEntry, SeedMutation } from '@niscorp/vex';
|
|
3
|
-
import { Charter } from '@niscorp/charter';
|
|
4
|
-
import { Shell, FetchFn, LayoutNode, ActionDefinition, CanvasConfig, ActionFragment, FunctionHandler } from '@niscorp/nova';
|
|
5
|
-
import { Phrasebook, PhraseKeys } from '@niscorp/nova/i18n';
|
|
6
|
-
import { F as Feature } from './index-BuDuOSyx.js';
|
|
7
|
-
import { I as IdentityRecord } from './document-UFbAd-Ka.js';
|
|
8
|
-
|
|
9
|
-
type LayoutVariant = {
|
|
10
|
-
action: string;
|
|
11
|
-
layout: LayoutNode;
|
|
12
|
-
};
|
|
13
|
-
type NiscApp = {
|
|
14
|
-
charter: Charter;
|
|
15
|
-
assignments?: Record<string, readonly string[]>;
|
|
16
|
-
wearable?: readonly (readonly string[])[];
|
|
17
|
-
actions: Record<string, ActionDefinition>;
|
|
18
|
-
layouts?: Record<string, LayoutVariant>;
|
|
19
|
-
behaviors?: ScopeBehaviors;
|
|
20
|
-
scope?: (principal: string | null, identity?: IdentityRecord) => Record<string, unknown>;
|
|
21
|
-
identity?: {
|
|
22
|
-
as?: string;
|
|
23
|
-
resolve: (principal: string, read: (fingerprint: string, scope: Record<string, unknown>) => Promise<unknown>) => Promise<IdentityRecord>;
|
|
24
|
-
};
|
|
25
|
-
phrases?: (session: {
|
|
26
|
-
principal: string | null;
|
|
27
|
-
identity: Record<string, unknown>;
|
|
28
|
-
wire: FetchFn;
|
|
29
|
-
}) => Phrasebook | undefined | Promise<Phrasebook | undefined>;
|
|
30
|
-
phraseKeys?: PhraseKeys;
|
|
31
|
-
features?: readonly Feature[];
|
|
32
|
-
entries?: readonly (SeedEntry | SeedMutation)[];
|
|
33
|
-
resources?: Record<string, readonly string[] | {
|
|
34
|
-
entities: readonly string[];
|
|
35
|
-
}>;
|
|
36
|
-
shell?: ShellManifest;
|
|
37
|
-
pages?: Record<string, PageManifest>;
|
|
38
|
-
grammars?: readonly Sequence[];
|
|
39
|
-
functions?: (session: FunctionSession) => Record<string, FunctionHandler>;
|
|
40
|
-
onSession?: (session: FunctionSession) => void;
|
|
41
|
-
runs?: RunSink;
|
|
42
|
-
reactions?: readonly {
|
|
43
|
-
table: string;
|
|
44
|
-
op?: 'insert' | 'update' | 'delete';
|
|
45
|
-
run: (event: {
|
|
46
|
-
fingerprint: string;
|
|
47
|
-
table: string;
|
|
48
|
-
op: 'insert' | 'update' | 'delete';
|
|
49
|
-
count: number;
|
|
50
|
-
scope: Record<string, unknown>;
|
|
51
|
-
}, tools: {
|
|
52
|
-
deliver: (principal: string, channel: string, payload?: unknown) => boolean;
|
|
53
|
-
}) => void;
|
|
54
|
-
}[];
|
|
55
|
-
};
|
|
56
|
-
type RunTurn = {
|
|
57
|
-
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
58
|
-
content: string;
|
|
59
|
-
calls?: ReadonlyArray<{
|
|
60
|
-
name: string;
|
|
61
|
-
args: string;
|
|
62
|
-
}>;
|
|
63
|
-
name?: string;
|
|
64
|
-
};
|
|
65
|
-
type RunRecord = {
|
|
66
|
-
at: number;
|
|
67
|
-
principal: string | null;
|
|
68
|
-
shellId: string;
|
|
69
|
-
agentId: string;
|
|
70
|
-
agentPath: readonly string[];
|
|
71
|
-
label: string;
|
|
72
|
-
provider: string;
|
|
73
|
-
model: string;
|
|
74
|
-
inputTokens: number;
|
|
75
|
-
outputTokens: number;
|
|
76
|
-
totalTokens: number;
|
|
77
|
-
reported: boolean;
|
|
78
|
-
steps: number;
|
|
79
|
-
elapsedMs: number;
|
|
80
|
-
turns?: readonly RunTurn[];
|
|
81
|
-
response?: string;
|
|
82
|
-
outcome: 'ok' | 'failed';
|
|
83
|
-
};
|
|
84
|
-
type RunSink = (record: RunRecord, session: FunctionSession) => void;
|
|
85
|
-
type FunctionSession = {
|
|
86
|
-
shell: Shell;
|
|
87
|
-
principal: string | null;
|
|
88
|
-
roles: readonly string[];
|
|
89
|
-
identity: Record<string, unknown>;
|
|
90
|
-
actions: readonly string[];
|
|
91
|
-
wire: FetchFn;
|
|
92
|
-
grant: (token: string) => void;
|
|
93
|
-
revoke: () => Promise<void>;
|
|
94
|
-
answerIntent: (writers: {
|
|
95
|
-
generateDsl: GenerateDsl;
|
|
96
|
-
mapToShape: MapToShape;
|
|
97
|
-
}, asked: {
|
|
98
|
-
intent: string;
|
|
99
|
-
shape: unknown;
|
|
100
|
-
context?: Record<string, unknown>;
|
|
101
|
-
}) => Promise<QueryResponse>;
|
|
102
|
-
recordRun: (run: Omit<RunRecord, 'at' | 'principal' | 'shellId'>) => void;
|
|
103
|
-
};
|
|
104
|
-
type CanvasSeed = string | {
|
|
105
|
-
action: string;
|
|
106
|
-
input?: Record<string, unknown>;
|
|
107
|
-
with?: string[];
|
|
108
|
-
};
|
|
109
|
-
type ShellCanvas = Omit<CanvasConfig, 'initial'> & {
|
|
110
|
-
initial?: CanvasSeed | CanvasSeed[];
|
|
111
|
-
};
|
|
112
|
-
type ShellManifest = {
|
|
113
|
-
canvases: ShellCanvas[];
|
|
114
|
-
layout?: LayoutNode;
|
|
115
|
-
layoutStore?: Record<string, LayoutNode>;
|
|
116
|
-
fragments?: Record<string, ActionFragment>;
|
|
117
|
-
seeds?: (session: {
|
|
118
|
-
principal: string | null;
|
|
119
|
-
actions: readonly string[];
|
|
120
|
-
roles: readonly string[];
|
|
121
|
-
wire: FetchFn;
|
|
122
|
-
}) => Promise<Record<string, CanvasSeed[]>> | Record<string, CanvasSeed[]>;
|
|
123
|
-
components?: Record<string, {
|
|
124
|
-
meta?: {
|
|
125
|
-
description?: string;
|
|
126
|
-
propsSchema?: unknown;
|
|
127
|
-
};
|
|
128
|
-
}>;
|
|
129
|
-
inputs?: (session: {
|
|
130
|
-
principal: string | null;
|
|
131
|
-
actions: readonly string[];
|
|
132
|
-
roles: readonly string[];
|
|
133
|
-
identity: Record<string, unknown>;
|
|
134
|
-
wire: FetchFn;
|
|
135
|
-
}) => Record<string, Record<string, unknown>> | Promise<Record<string, Record<string, unknown>>>;
|
|
136
|
-
};
|
|
137
|
-
type PageManifest = ShellManifest & {
|
|
138
|
-
path: string;
|
|
139
|
-
params?: string;
|
|
140
|
-
};
|
|
141
|
-
declare const defineApp: (app: NiscApp) => NiscApp;
|
|
142
|
-
|
|
143
|
-
export { type FunctionSession as F, type LayoutVariant as L, type NiscApp as N, type PageManifest as P, type RunRecord as R, type ShellManifest as S, type RunSink as a, type RunTurn as b, defineApp as d };
|
package/dist/app-Cc8VnOz8.d.cts
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { Sequence } from '@niscorp/strata';
|
|
2
|
-
import { GenerateDsl, MapToShape, QueryResponse, ScopeBehaviors, SeedEntry, SeedMutation } from '@niscorp/vex';
|
|
3
|
-
import { Charter } from '@niscorp/charter';
|
|
4
|
-
import { Shell, FetchFn, LayoutNode, ActionDefinition, CanvasConfig, ActionFragment, FunctionHandler } from '@niscorp/nova';
|
|
5
|
-
import { Phrasebook, PhraseKeys } from '@niscorp/nova/i18n';
|
|
6
|
-
import { F as Feature } from './index-BuDuOSyx.cjs';
|
|
7
|
-
import { I as IdentityRecord } from './document-CU3muGbz.cjs';
|
|
8
|
-
|
|
9
|
-
type LayoutVariant = {
|
|
10
|
-
action: string;
|
|
11
|
-
layout: LayoutNode;
|
|
12
|
-
};
|
|
13
|
-
type NiscApp = {
|
|
14
|
-
charter: Charter;
|
|
15
|
-
assignments?: Record<string, readonly string[]>;
|
|
16
|
-
wearable?: readonly (readonly string[])[];
|
|
17
|
-
actions: Record<string, ActionDefinition>;
|
|
18
|
-
layouts?: Record<string, LayoutVariant>;
|
|
19
|
-
behaviors?: ScopeBehaviors;
|
|
20
|
-
scope?: (principal: string | null, identity?: IdentityRecord) => Record<string, unknown>;
|
|
21
|
-
identity?: {
|
|
22
|
-
as?: string;
|
|
23
|
-
resolve: (principal: string, read: (fingerprint: string, scope: Record<string, unknown>) => Promise<unknown>) => Promise<IdentityRecord>;
|
|
24
|
-
};
|
|
25
|
-
phrases?: (session: {
|
|
26
|
-
principal: string | null;
|
|
27
|
-
identity: Record<string, unknown>;
|
|
28
|
-
wire: FetchFn;
|
|
29
|
-
}) => Phrasebook | undefined | Promise<Phrasebook | undefined>;
|
|
30
|
-
phraseKeys?: PhraseKeys;
|
|
31
|
-
features?: readonly Feature[];
|
|
32
|
-
entries?: readonly (SeedEntry | SeedMutation)[];
|
|
33
|
-
resources?: Record<string, readonly string[] | {
|
|
34
|
-
entities: readonly string[];
|
|
35
|
-
}>;
|
|
36
|
-
shell?: ShellManifest;
|
|
37
|
-
pages?: Record<string, PageManifest>;
|
|
38
|
-
grammars?: readonly Sequence[];
|
|
39
|
-
functions?: (session: FunctionSession) => Record<string, FunctionHandler>;
|
|
40
|
-
onSession?: (session: FunctionSession) => void;
|
|
41
|
-
runs?: RunSink;
|
|
42
|
-
reactions?: readonly {
|
|
43
|
-
table: string;
|
|
44
|
-
op?: 'insert' | 'update' | 'delete';
|
|
45
|
-
run: (event: {
|
|
46
|
-
fingerprint: string;
|
|
47
|
-
table: string;
|
|
48
|
-
op: 'insert' | 'update' | 'delete';
|
|
49
|
-
count: number;
|
|
50
|
-
scope: Record<string, unknown>;
|
|
51
|
-
}, tools: {
|
|
52
|
-
deliver: (principal: string, channel: string, payload?: unknown) => boolean;
|
|
53
|
-
}) => void;
|
|
54
|
-
}[];
|
|
55
|
-
};
|
|
56
|
-
type RunTurn = {
|
|
57
|
-
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
58
|
-
content: string;
|
|
59
|
-
calls?: ReadonlyArray<{
|
|
60
|
-
name: string;
|
|
61
|
-
args: string;
|
|
62
|
-
}>;
|
|
63
|
-
name?: string;
|
|
64
|
-
};
|
|
65
|
-
type RunRecord = {
|
|
66
|
-
at: number;
|
|
67
|
-
principal: string | null;
|
|
68
|
-
shellId: string;
|
|
69
|
-
agentId: string;
|
|
70
|
-
agentPath: readonly string[];
|
|
71
|
-
label: string;
|
|
72
|
-
provider: string;
|
|
73
|
-
model: string;
|
|
74
|
-
inputTokens: number;
|
|
75
|
-
outputTokens: number;
|
|
76
|
-
totalTokens: number;
|
|
77
|
-
reported: boolean;
|
|
78
|
-
steps: number;
|
|
79
|
-
elapsedMs: number;
|
|
80
|
-
turns?: readonly RunTurn[];
|
|
81
|
-
response?: string;
|
|
82
|
-
outcome: 'ok' | 'failed';
|
|
83
|
-
};
|
|
84
|
-
type RunSink = (record: RunRecord, session: FunctionSession) => void;
|
|
85
|
-
type FunctionSession = {
|
|
86
|
-
shell: Shell;
|
|
87
|
-
principal: string | null;
|
|
88
|
-
roles: readonly string[];
|
|
89
|
-
identity: Record<string, unknown>;
|
|
90
|
-
actions: readonly string[];
|
|
91
|
-
wire: FetchFn;
|
|
92
|
-
grant: (token: string) => void;
|
|
93
|
-
revoke: () => Promise<void>;
|
|
94
|
-
answerIntent: (writers: {
|
|
95
|
-
generateDsl: GenerateDsl;
|
|
96
|
-
mapToShape: MapToShape;
|
|
97
|
-
}, asked: {
|
|
98
|
-
intent: string;
|
|
99
|
-
shape: unknown;
|
|
100
|
-
context?: Record<string, unknown>;
|
|
101
|
-
}) => Promise<QueryResponse>;
|
|
102
|
-
recordRun: (run: Omit<RunRecord, 'at' | 'principal' | 'shellId'>) => void;
|
|
103
|
-
};
|
|
104
|
-
type CanvasSeed = string | {
|
|
105
|
-
action: string;
|
|
106
|
-
input?: Record<string, unknown>;
|
|
107
|
-
with?: string[];
|
|
108
|
-
};
|
|
109
|
-
type ShellCanvas = Omit<CanvasConfig, 'initial'> & {
|
|
110
|
-
initial?: CanvasSeed | CanvasSeed[];
|
|
111
|
-
};
|
|
112
|
-
type ShellManifest = {
|
|
113
|
-
canvases: ShellCanvas[];
|
|
114
|
-
layout?: LayoutNode;
|
|
115
|
-
layoutStore?: Record<string, LayoutNode>;
|
|
116
|
-
fragments?: Record<string, ActionFragment>;
|
|
117
|
-
seeds?: (session: {
|
|
118
|
-
principal: string | null;
|
|
119
|
-
actions: readonly string[];
|
|
120
|
-
roles: readonly string[];
|
|
121
|
-
wire: FetchFn;
|
|
122
|
-
}) => Promise<Record<string, CanvasSeed[]>> | Record<string, CanvasSeed[]>;
|
|
123
|
-
components?: Record<string, {
|
|
124
|
-
meta?: {
|
|
125
|
-
description?: string;
|
|
126
|
-
propsSchema?: unknown;
|
|
127
|
-
};
|
|
128
|
-
}>;
|
|
129
|
-
inputs?: (session: {
|
|
130
|
-
principal: string | null;
|
|
131
|
-
actions: readonly string[];
|
|
132
|
-
roles: readonly string[];
|
|
133
|
-
identity: Record<string, unknown>;
|
|
134
|
-
wire: FetchFn;
|
|
135
|
-
}) => Record<string, Record<string, unknown>> | Promise<Record<string, Record<string, unknown>>>;
|
|
136
|
-
};
|
|
137
|
-
type PageManifest = ShellManifest & {
|
|
138
|
-
path: string;
|
|
139
|
-
params?: string;
|
|
140
|
-
};
|
|
141
|
-
declare const defineApp: (app: NiscApp) => NiscApp;
|
|
142
|
-
|
|
143
|
-
export { type FunctionSession as F, type LayoutVariant as L, type NiscApp as N, type PageManifest as P, type RunRecord as R, type ShellManifest as S, type RunSink as a, type RunTurn as b, defineApp as d };
|