@niscorp/moss 0.6.0 → 0.8.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 +144 -0
- package/DESIGN.md +77 -40
- package/DOCS.md +673 -78
- package/README.md +2 -2
- package/dist/chunk-3DCTQKPQ.cjs +943 -0
- package/dist/chunk-3DCTQKPQ.cjs.map +1 -0
- package/dist/{chunk-WKBH3UMB.js → chunk-3T422CCN.js} +9 -3
- package/dist/chunk-3T422CCN.js.map +1 -0
- package/dist/chunk-6XC2MD7S.js +906 -0
- package/dist/chunk-6XC2MD7S.js.map +1 -0
- package/dist/{chunk-D3YZIAYV.cjs → chunk-I4UOWER3.cjs} +11 -5
- package/dist/chunk-I4UOWER3.cjs.map +1 -0
- package/dist/{chunk-VBWNHF4H.cjs → chunk-PVZMCEBX.cjs} +4 -3
- package/dist/chunk-PVZMCEBX.cjs.map +1 -0
- package/dist/{chunk-NSK7QSSG.js → chunk-QAHDSRPK.js} +4 -3
- package/dist/chunk-QAHDSRPK.js.map +1 -0
- package/dist/{chunk-R66WUKGC.cjs → chunk-TMDKNZYL.cjs} +2169 -1319
- package/dist/chunk-TMDKNZYL.cjs.map +1 -0
- package/dist/{chunk-V5YMJL7Z.js → chunk-YZILOVCR.js} +2147 -1295
- package/dist/chunk-YZILOVCR.js.map +1 -0
- package/dist/document-BYAY-Qle.d.ts +381 -0
- package/dist/document-DAE71J27.d.cts +381 -0
- package/dist/{index-B411sK9M.d.cts → index-CSEo7Tys.d.cts} +5 -0
- package/dist/{index-B411sK9M.d.ts → index-CSEo7Tys.d.ts} +5 -0
- package/dist/index.cjs +17 -17
- package/dist/index.d.cts +8 -10
- package/dist/index.d.ts +8 -10
- 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-CUnDcXQu.d.ts +0 -143
- package/dist/app-CdANzi2q.d.cts +0 -143
- package/dist/chunk-D3YZIAYV.cjs.map +0 -1
- package/dist/chunk-NSK7QSSG.js.map +0 -1
- package/dist/chunk-PWUO4RET.js +0 -374
- package/dist/chunk-PWUO4RET.js.map +0 -1
- package/dist/chunk-R2YPQHQH.cjs +0 -383
- package/dist/chunk-R2YPQHQH.cjs.map +0 -1
- package/dist/chunk-R66WUKGC.cjs.map +0 -1
- package/dist/chunk-V5YMJL7Z.js.map +0 -1
- package/dist/chunk-VBWNHF4H.cjs.map +0 -1
- package/dist/chunk-WKBH3UMB.js.map +0 -1
- package/dist/document-D7nroBww.d.cts +0 -169
- package/dist/document-DeTPGBil.d.ts +0 -169
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { Charter, VerifyReport } from '@niscorp/charter';
|
|
3
|
+
import { Shell, FetchFn, LayoutNode, ActionDefinition, CanvasConfig, ActionFragment, FunctionDefinition, FunctionHandler, RenderNode } from '@niscorp/nova';
|
|
4
|
+
import { GenerateDsl, MapToShape, QueryResponse, ScopeBehaviors, SeedEntry, SeedMutation, ScopePolicy } from '@niscorp/vex';
|
|
5
|
+
import { Sequence } from '@niscorp/strata';
|
|
6
|
+
import { Phrasebook, PhraseKeys } from '@niscorp/nova/i18n';
|
|
7
|
+
import { F as Feature } from './index-CSEo7Tys.cjs';
|
|
8
|
+
import { S as SocketAccept } from './socket-D90h1xSV.cjs';
|
|
9
|
+
import { ScreenHead } from '@niscorp/nova/document';
|
|
10
|
+
|
|
11
|
+
type IdentityReport = {
|
|
12
|
+
principal: string;
|
|
13
|
+
since: number;
|
|
14
|
+
lastSeen: number;
|
|
15
|
+
};
|
|
16
|
+
type IdentityRecord = {
|
|
17
|
+
roles: readonly string[];
|
|
18
|
+
scope: Record<string, unknown>;
|
|
19
|
+
installed?: readonly string[];
|
|
20
|
+
tag?: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type ResolvedIdentity = {
|
|
24
|
+
roles: readonly string[];
|
|
25
|
+
scope: Record<string, unknown>;
|
|
26
|
+
installed: readonly string[] | undefined;
|
|
27
|
+
memoKey: string;
|
|
28
|
+
record?: IdentityRecord;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type LayoutVariant = {
|
|
32
|
+
action: string;
|
|
33
|
+
layout: LayoutNode;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
type WrittenFunctions = readonly FunctionDefinition[] | Record<string, FunctionHandler>;
|
|
37
|
+
type NiscApp = {
|
|
38
|
+
charter: Charter;
|
|
39
|
+
assignments?: Record<string, readonly string[]>;
|
|
40
|
+
wearable?: readonly (readonly string[])[];
|
|
41
|
+
actions: Record<string, ActionDefinition>;
|
|
42
|
+
layouts?: Record<string, LayoutVariant>;
|
|
43
|
+
behaviors?: ScopeBehaviors;
|
|
44
|
+
scope?: (principal: string | null, identity?: IdentityRecord) => Record<string, unknown>;
|
|
45
|
+
identity?: {
|
|
46
|
+
as?: string;
|
|
47
|
+
resolve: (principal: string, read: (fingerprint: string, scope: Record<string, unknown>) => Promise<unknown>) => Promise<IdentityRecord>;
|
|
48
|
+
};
|
|
49
|
+
phrases?: (session: {
|
|
50
|
+
principal: string | null;
|
|
51
|
+
identity: Record<string, unknown>;
|
|
52
|
+
wire: FetchFn;
|
|
53
|
+
}) => Phrasebook | undefined | Promise<Phrasebook | undefined>;
|
|
54
|
+
phraseKeys?: PhraseKeys;
|
|
55
|
+
features?: readonly Feature[];
|
|
56
|
+
entries?: readonly (SeedEntry | SeedMutation)[];
|
|
57
|
+
resources?: Record<string, readonly string[] | {
|
|
58
|
+
entities: readonly string[];
|
|
59
|
+
}>;
|
|
60
|
+
shell?: ShellManifest;
|
|
61
|
+
pages?: Record<string, PageManifest>;
|
|
62
|
+
grammars?: readonly Sequence[];
|
|
63
|
+
functions?: (session: FunctionSession) => WrittenFunctions;
|
|
64
|
+
onSession?: (session: FunctionSession) => void;
|
|
65
|
+
runs?: RunSink;
|
|
66
|
+
reactions?: readonly {
|
|
67
|
+
table: string;
|
|
68
|
+
op?: 'insert' | 'update' | 'delete';
|
|
69
|
+
run: (event: {
|
|
70
|
+
fingerprint: string;
|
|
71
|
+
table: string;
|
|
72
|
+
op: 'insert' | 'update' | 'delete';
|
|
73
|
+
count: number;
|
|
74
|
+
scope: Record<string, unknown>;
|
|
75
|
+
}, tools: {
|
|
76
|
+
deliver: (principal: string, channel: string, payload?: unknown) => boolean;
|
|
77
|
+
}) => void;
|
|
78
|
+
}[];
|
|
79
|
+
};
|
|
80
|
+
type RunTurn = {
|
|
81
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
82
|
+
content: string;
|
|
83
|
+
calls?: ReadonlyArray<{
|
|
84
|
+
name: string;
|
|
85
|
+
args: string;
|
|
86
|
+
}>;
|
|
87
|
+
name?: string;
|
|
88
|
+
};
|
|
89
|
+
type RunRecord = {
|
|
90
|
+
at: number;
|
|
91
|
+
principal: string | null;
|
|
92
|
+
shellId: string;
|
|
93
|
+
agentId: string;
|
|
94
|
+
agentPath: readonly string[];
|
|
95
|
+
label: string;
|
|
96
|
+
provider: string;
|
|
97
|
+
model: string;
|
|
98
|
+
inputTokens: number;
|
|
99
|
+
outputTokens: number;
|
|
100
|
+
totalTokens: number;
|
|
101
|
+
reported: boolean;
|
|
102
|
+
steps: number;
|
|
103
|
+
elapsedMs: number;
|
|
104
|
+
turns?: readonly RunTurn[];
|
|
105
|
+
response?: string;
|
|
106
|
+
outcome: 'ok' | 'failed';
|
|
107
|
+
};
|
|
108
|
+
type RunSink = (record: RunRecord, session: FunctionSession) => void;
|
|
109
|
+
type ArtifactKind = 'layout' | 'action' | 'fragment' | 'read';
|
|
110
|
+
type ArtifactVersion = {
|
|
111
|
+
kind: ArtifactKind;
|
|
112
|
+
id: string;
|
|
113
|
+
save: string;
|
|
114
|
+
createdAt: string;
|
|
115
|
+
copiedFrom: string | null;
|
|
116
|
+
body: unknown;
|
|
117
|
+
};
|
|
118
|
+
type SessionArtifacts = {
|
|
119
|
+
save: (artifacts: readonly {
|
|
120
|
+
kind: ArtifactKind;
|
|
121
|
+
id?: string;
|
|
122
|
+
body: unknown;
|
|
123
|
+
}[]) => Promise<{
|
|
124
|
+
save: string;
|
|
125
|
+
artifacts: readonly {
|
|
126
|
+
kind: ArtifactKind;
|
|
127
|
+
id: string;
|
|
128
|
+
}[];
|
|
129
|
+
}>;
|
|
130
|
+
list: (kind?: ArtifactKind) => Promise<readonly ArtifactVersion[]>;
|
|
131
|
+
history: (kind: ArtifactKind, id: string) => Promise<readonly ArtifactVersion[]>;
|
|
132
|
+
restore: (kind: ArtifactKind, id: string, save: string) => Promise<{
|
|
133
|
+
save: string;
|
|
134
|
+
}>;
|
|
135
|
+
reset: (kind: ArtifactKind, id: string) => Promise<{
|
|
136
|
+
save: string;
|
|
137
|
+
}>;
|
|
138
|
+
};
|
|
139
|
+
type DraftArtifact = {
|
|
140
|
+
kind: ArtifactKind;
|
|
141
|
+
id: string;
|
|
142
|
+
body: unknown;
|
|
143
|
+
};
|
|
144
|
+
type SessionDraft = {
|
|
145
|
+
add: (artifacts: readonly {
|
|
146
|
+
kind: ArtifactKind;
|
|
147
|
+
id?: string;
|
|
148
|
+
body: unknown;
|
|
149
|
+
}[]) => Promise<{
|
|
150
|
+
step: number;
|
|
151
|
+
artifacts: readonly {
|
|
152
|
+
kind: ArtifactKind;
|
|
153
|
+
id: string;
|
|
154
|
+
}[];
|
|
155
|
+
}>;
|
|
156
|
+
list: () => readonly DraftArtifact[];
|
|
157
|
+
remove: (kind: ArtifactKind, id: string) => Promise<{
|
|
158
|
+
step: number;
|
|
159
|
+
}>;
|
|
160
|
+
show: (step: number) => Promise<void>;
|
|
161
|
+
discard: () => Promise<void>;
|
|
162
|
+
save: () => Promise<{
|
|
163
|
+
save: string;
|
|
164
|
+
artifacts: readonly {
|
|
165
|
+
kind: ArtifactKind;
|
|
166
|
+
id: string;
|
|
167
|
+
}[];
|
|
168
|
+
}>;
|
|
169
|
+
};
|
|
170
|
+
type FunctionSession = {
|
|
171
|
+
shell: Shell;
|
|
172
|
+
artifacts: SessionArtifacts;
|
|
173
|
+
draft: SessionDraft;
|
|
174
|
+
principal: string | null;
|
|
175
|
+
roles: readonly string[];
|
|
176
|
+
identity: Record<string, unknown>;
|
|
177
|
+
actions: readonly string[];
|
|
178
|
+
wire: FetchFn;
|
|
179
|
+
grant: (token: string) => void;
|
|
180
|
+
revoke: () => Promise<void>;
|
|
181
|
+
answerIntent: (writers: {
|
|
182
|
+
generateDsl: GenerateDsl;
|
|
183
|
+
mapToShape: MapToShape;
|
|
184
|
+
}, asked: {
|
|
185
|
+
intent: string;
|
|
186
|
+
shape: unknown;
|
|
187
|
+
context?: Record<string, unknown>;
|
|
188
|
+
} | {
|
|
189
|
+
fingerprint: string;
|
|
190
|
+
context?: Record<string, unknown>;
|
|
191
|
+
}) => Promise<QueryResponse>;
|
|
192
|
+
recordRun: (run: Omit<RunRecord, 'at' | 'principal' | 'shellId'>) => void;
|
|
193
|
+
functions: () => readonly {
|
|
194
|
+
id: string;
|
|
195
|
+
description?: string;
|
|
196
|
+
}[];
|
|
197
|
+
};
|
|
198
|
+
type CanvasSeed = string | {
|
|
199
|
+
action: string;
|
|
200
|
+
input?: Record<string, unknown>;
|
|
201
|
+
with?: string[];
|
|
202
|
+
};
|
|
203
|
+
type ShellCanvas = Omit<CanvasConfig, 'initial'> & {
|
|
204
|
+
initial?: CanvasSeed | CanvasSeed[];
|
|
205
|
+
};
|
|
206
|
+
type ShellManifest = {
|
|
207
|
+
canvases: ShellCanvas[];
|
|
208
|
+
layout?: LayoutNode;
|
|
209
|
+
layoutStore?: Record<string, LayoutNode>;
|
|
210
|
+
fragments?: Record<string, ActionFragment>;
|
|
211
|
+
seeds?: (session: {
|
|
212
|
+
principal: string | null;
|
|
213
|
+
actions: readonly string[];
|
|
214
|
+
roles: readonly string[];
|
|
215
|
+
wire: FetchFn;
|
|
216
|
+
}) => Promise<Record<string, CanvasSeed[]>> | Record<string, CanvasSeed[]>;
|
|
217
|
+
components?: Record<string, {
|
|
218
|
+
meta?: {
|
|
219
|
+
description?: string;
|
|
220
|
+
propsSchema?: unknown;
|
|
221
|
+
};
|
|
222
|
+
}>;
|
|
223
|
+
inputs?: (session: {
|
|
224
|
+
principal: string | null;
|
|
225
|
+
actions: readonly string[];
|
|
226
|
+
roles: readonly string[];
|
|
227
|
+
identity: Record<string, unknown>;
|
|
228
|
+
wire: FetchFn;
|
|
229
|
+
}) => Record<string, Record<string, unknown>> | Promise<Record<string, Record<string, unknown>>>;
|
|
230
|
+
};
|
|
231
|
+
type PageManifest = ShellManifest & {
|
|
232
|
+
path: string;
|
|
233
|
+
params?: string;
|
|
234
|
+
};
|
|
235
|
+
declare const defineApp: (app: NiscApp) => NiscApp;
|
|
236
|
+
|
|
237
|
+
type ExecuteAs = (role: string, fingerprint: string, context: Record<string, unknown>, scope?: Record<string, unknown>) => Promise<unknown>;
|
|
238
|
+
|
|
239
|
+
type Catalog = {
|
|
240
|
+
ids: readonly string[];
|
|
241
|
+
hash: string;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
type ShellConnection = {
|
|
245
|
+
send: (text: string) => void;
|
|
246
|
+
close: (code?: number, reason?: string) => void;
|
|
247
|
+
seal?: (token: string) => Promise<string>;
|
|
248
|
+
};
|
|
249
|
+
type ShellSession = {
|
|
250
|
+
readonly shell: Shell;
|
|
251
|
+
attach: (connection: ShellConnection, options?: {
|
|
252
|
+
delta?: boolean;
|
|
253
|
+
}) => void;
|
|
254
|
+
detach: (connection: ShellConnection) => void;
|
|
255
|
+
resync: (connection: ShellConnection) => void;
|
|
256
|
+
dispatch: (canvas: string, event: Record<string, unknown>) => void;
|
|
257
|
+
publish: (channel: string, payload?: unknown) => void;
|
|
258
|
+
back: () => boolean;
|
|
259
|
+
popTo: (canvas: string, instance: string) => void;
|
|
260
|
+
reset: () => void;
|
|
261
|
+
};
|
|
262
|
+
type ShellReport = {
|
|
263
|
+
principal: string;
|
|
264
|
+
connections: number;
|
|
265
|
+
since: number;
|
|
266
|
+
idleSince: number | null;
|
|
267
|
+
canvases: {
|
|
268
|
+
id: string;
|
|
269
|
+
actions: readonly string[];
|
|
270
|
+
}[];
|
|
271
|
+
};
|
|
272
|
+
type ShellSnapshot = {
|
|
273
|
+
frame: RenderNode[];
|
|
274
|
+
trees: Record<string, RenderNode[]>;
|
|
275
|
+
seed?: string;
|
|
276
|
+
settled: boolean;
|
|
277
|
+
live: boolean;
|
|
278
|
+
why: string[];
|
|
279
|
+
drawnWith: string[];
|
|
280
|
+
};
|
|
281
|
+
type ShellOpening = {
|
|
282
|
+
seed?: string;
|
|
283
|
+
inputs?: Record<string, Record<string, unknown>>;
|
|
284
|
+
};
|
|
285
|
+
type ShellHost = {
|
|
286
|
+
session: (token: string | null, principal: string | null, options?: ShellOpening) => Promise<ShellSession>;
|
|
287
|
+
snapshot: (token: string | null, principal: string | null, options?: {
|
|
288
|
+
waitMs?: number;
|
|
289
|
+
inputs?: ShellOpening['inputs'];
|
|
290
|
+
}) => Promise<ShellSnapshot>;
|
|
291
|
+
deliver: (principal: string, channel: string, payload?: unknown) => boolean;
|
|
292
|
+
list: () => ShellReport[];
|
|
293
|
+
reset: (principal: string) => boolean;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
type Env = {
|
|
297
|
+
Variables: {
|
|
298
|
+
principal: string | null;
|
|
299
|
+
resolved: ResolvedIdentity;
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
type MossServer = Hono<Env> & {
|
|
303
|
+
socket: SocketAccept;
|
|
304
|
+
shells?: ShellHost;
|
|
305
|
+
principalOf: (token: string) => Promise<string | null>;
|
|
306
|
+
page: (path: string) => {
|
|
307
|
+
name: string;
|
|
308
|
+
host: ShellHost;
|
|
309
|
+
inputs: Record<string, Record<string, unknown>>;
|
|
310
|
+
} | undefined;
|
|
311
|
+
pages: readonly {
|
|
312
|
+
name: string;
|
|
313
|
+
path: string;
|
|
314
|
+
}[];
|
|
315
|
+
checkFunctions: () => Promise<void>;
|
|
316
|
+
refresh: () => void;
|
|
317
|
+
replaceActions: (source: string, actions: Record<string, ActionDefinition>) => void;
|
|
318
|
+
replaceEntries: (source: string, entries: readonly (SeedEntry | SeedMutation)[]) => Promise<void>;
|
|
319
|
+
actions: () => Readonly<Record<string, ActionDefinition>>;
|
|
320
|
+
defaults: (publisher: string) => SessionArtifacts;
|
|
321
|
+
catalogOf: (principal: string | null) => Promise<Catalog>;
|
|
322
|
+
policyForRoles: (roles: readonly string[]) => ScopePolicy;
|
|
323
|
+
charterReport: () => VerifyReport;
|
|
324
|
+
invalidateIdentity: (principal: string) => boolean;
|
|
325
|
+
identity: (principal: string | null) => Promise<IdentityRecord>;
|
|
326
|
+
executeAs: ExecuteAs;
|
|
327
|
+
invalidateTag: (tag: string) => number;
|
|
328
|
+
nudge: (principal: string, channel: string) => void;
|
|
329
|
+
close: () => void;
|
|
330
|
+
identities?: {
|
|
331
|
+
list: () => IdentityReport[];
|
|
332
|
+
meter: () => {
|
|
333
|
+
size: number;
|
|
334
|
+
max: number;
|
|
335
|
+
resolved: number;
|
|
336
|
+
evicted: number;
|
|
337
|
+
expired: number;
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
type DocumentHost = Pick<ShellHost, 'snapshot'>;
|
|
343
|
+
type DocumentSource = {
|
|
344
|
+
principalOf: (token: string) => Promise<string | null>;
|
|
345
|
+
page: (path: string) => {
|
|
346
|
+
name: string;
|
|
347
|
+
host: DocumentHost;
|
|
348
|
+
inputs: Record<string, Record<string, unknown>>;
|
|
349
|
+
} | undefined;
|
|
350
|
+
shells?: DocumentHost;
|
|
351
|
+
};
|
|
352
|
+
type DocumentConfig = {
|
|
353
|
+
server: DocumentSource;
|
|
354
|
+
template: string;
|
|
355
|
+
request: {
|
|
356
|
+
path: string;
|
|
357
|
+
cookie?: string | null;
|
|
358
|
+
host?: string | null;
|
|
359
|
+
};
|
|
360
|
+
draw: (snapshot: ShellSnapshot) => string | Promise<string>;
|
|
361
|
+
htmlAttributes?: (snapshot: ShellSnapshot) => Record<string, string>;
|
|
362
|
+
site?: string;
|
|
363
|
+
tokenKey?: string;
|
|
364
|
+
waitMs?: number;
|
|
365
|
+
root?: string;
|
|
366
|
+
};
|
|
367
|
+
type DrawnDocument = {
|
|
368
|
+
html: string;
|
|
369
|
+
headers: Record<string, string>;
|
|
370
|
+
drawn: boolean;
|
|
371
|
+
principal: string | null;
|
|
372
|
+
page?: string;
|
|
373
|
+
head?: ScreenHead;
|
|
374
|
+
live?: boolean;
|
|
375
|
+
why?: string[];
|
|
376
|
+
drawnWith?: string[];
|
|
377
|
+
settled?: boolean;
|
|
378
|
+
};
|
|
379
|
+
declare const renderDocument: (config: DocumentConfig) => Promise<DrawnDocument>;
|
|
380
|
+
|
|
381
|
+
export { type DocumentConfig as D, type ExecuteAs as E, type FunctionSession as F, type IdentityRecord as I, type LayoutVariant as L, type MossServer as M, type NiscApp as N, type PageManifest as P, type RunRecord as R, type ShellHost as S, type DrawnDocument as a, type RunSink as b, type RunTurn as c, type ShellManifest as d, type ShellSnapshot as e, defineApp as f, renderDocument as r };
|
|
@@ -17,6 +17,7 @@ type NiscRuntime = {
|
|
|
17
17
|
migrations?: 'apply' | 'verify';
|
|
18
18
|
tables?: readonly Sequence[];
|
|
19
19
|
shellIdleMs?: number;
|
|
20
|
+
artifactsUnusedMs?: number;
|
|
20
21
|
anonymousShellMax?: number;
|
|
21
22
|
endpointTimeoutMs?: number;
|
|
22
23
|
sessionRevalidateMs?: number;
|
|
@@ -56,6 +57,10 @@ declare const FabricMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
56
57
|
kind: z.ZodLiteral<"nudge">;
|
|
57
58
|
principal: z.ZodString;
|
|
58
59
|
channel: z.ZodString;
|
|
60
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
61
|
+
origin: z.ZodString;
|
|
62
|
+
kind: z.ZodLiteral<"adopt">;
|
|
63
|
+
principal: z.ZodString;
|
|
59
64
|
}, z.core.$strict>], "kind">;
|
|
60
65
|
type FabricMessage = z.infer<typeof FabricMessageSchema>;
|
|
61
66
|
type Fabric = {
|
|
@@ -17,6 +17,7 @@ type NiscRuntime = {
|
|
|
17
17
|
migrations?: 'apply' | 'verify';
|
|
18
18
|
tables?: readonly Sequence[];
|
|
19
19
|
shellIdleMs?: number;
|
|
20
|
+
artifactsUnusedMs?: number;
|
|
20
21
|
anonymousShellMax?: number;
|
|
21
22
|
endpointTimeoutMs?: number;
|
|
22
23
|
sessionRevalidateMs?: number;
|
|
@@ -56,6 +57,10 @@ declare const FabricMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
56
57
|
kind: z.ZodLiteral<"nudge">;
|
|
57
58
|
principal: z.ZodString;
|
|
58
59
|
channel: z.ZodString;
|
|
60
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
61
|
+
origin: z.ZodString;
|
|
62
|
+
kind: z.ZodLiteral<"adopt">;
|
|
63
|
+
principal: z.ZodString;
|
|
59
64
|
}, z.core.$strict>], "kind">;
|
|
60
65
|
type FabricMessage = z.infer<typeof FabricMessageSchema>;
|
|
61
66
|
type Fabric = {
|
package/dist/index.cjs
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkTMDKNZYL_cjs = require('./chunk-TMDKNZYL.cjs');
|
|
4
|
+
var chunk3DCTQKPQ_cjs = require('./chunk-3DCTQKPQ.cjs');
|
|
5
|
+
require('./chunk-PVZMCEBX.cjs');
|
|
6
6
|
require('./chunk-3RIWTXGI.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "MOSS_SEQUENCE", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkTMDKNZYL_cjs.MOSS_SEQUENCE; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "createServer", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "defineApp", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () { return chunkR66WUKGC_cjs.defineApp; }
|
|
16
|
+
get: function () { return chunkTMDKNZYL_cjs.createServer; }
|
|
21
17
|
});
|
|
22
18
|
Object.defineProperty(exports, "exportDocuments", {
|
|
23
19
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkTMDKNZYL_cjs.exportDocuments; }
|
|
25
21
|
});
|
|
26
22
|
Object.defineProperty(exports, "migrateTables", {
|
|
27
23
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkTMDKNZYL_cjs.migrateTables; }
|
|
29
25
|
});
|
|
30
26
|
Object.defineProperty(exports, "mintDevToken", {
|
|
31
27
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkTMDKNZYL_cjs.mintDevToken; }
|
|
33
29
|
});
|
|
34
30
|
Object.defineProperty(exports, "mintSession", {
|
|
35
31
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkTMDKNZYL_cjs.mintSession; }
|
|
37
33
|
});
|
|
38
34
|
Object.defineProperty(exports, "renderDocument", {
|
|
39
35
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkTMDKNZYL_cjs.renderDocument; }
|
|
41
37
|
});
|
|
42
38
|
Object.defineProperty(exports, "revokeAllFor", {
|
|
43
39
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkTMDKNZYL_cjs.revokeAllFor; }
|
|
45
41
|
});
|
|
46
42
|
Object.defineProperty(exports, "sessionCookies", {
|
|
47
43
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunkTMDKNZYL_cjs.sessionCookies; }
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, "defineApp", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () { return chunk3DCTQKPQ_cjs.defineApp; }
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "verifyApp", {
|
|
51
51
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunk3DCTQKPQ_cjs.verifyApp; }
|
|
53
53
|
});
|
|
54
54
|
//# sourceMappingURL=index.cjs.map
|
|
55
55
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { N as NiscApp } from './
|
|
2
|
-
export { F as FunctionSession, L as LayoutVariant, P as PageManifest, R as RunRecord,
|
|
1
|
+
import { N as NiscApp, M as MossServer, D as DocumentConfig } from './document-DAE71J27.cjs';
|
|
2
|
+
export { a as DrawnDocument, E as ExecuteAs, F as FunctionSession, I as IdentityRecord, L as LayoutVariant, P as PageManifest, R as RunRecord, b as RunSink, c as RunTurn, S as ShellHost, d as ShellManifest, e as ShellSnapshot, f as defineApp, r as renderDocument } from './document-DAE71J27.cjs';
|
|
3
3
|
import { VerifyReport } from '@niscorp/charter';
|
|
4
|
-
import { M as MossServer, D as DocumentConfig } from './document-D7nroBww.cjs';
|
|
5
|
-
export { a as DrawnDocument, E as ExecuteAs, I as IdentityRecord, S as ShellHost, b as ShellSnapshot, r as renderDocument } from './document-D7nroBww.cjs';
|
|
6
4
|
import { PgPool } from '@niscorp/vex';
|
|
7
|
-
import { N as NiscRuntime } from './index-
|
|
8
|
-
export { T as Telemetry, a as TelemetrySpan } from './index-
|
|
5
|
+
import { N as NiscRuntime } from './index-CSEo7Tys.cjs';
|
|
6
|
+
export { T as Telemetry, a as TelemetrySpan } from './index-CSEo7Tys.cjs';
|
|
9
7
|
import { MigrateReport } from '@niscorp/strata/postgres';
|
|
8
|
+
export { FunctionDefinition } from '@niscorp/nova';
|
|
10
9
|
import { Sequence } from '@niscorp/strata';
|
|
11
10
|
import { ScreenHead } from '@niscorp/nova/document';
|
|
12
|
-
import '@niscorp/nova';
|
|
13
|
-
import '@niscorp/nova/i18n';
|
|
14
11
|
import 'hono';
|
|
12
|
+
import '@niscorp/nova/i18n';
|
|
15
13
|
import './socket-D90h1xSV.cjs';
|
|
16
14
|
import 'zod';
|
|
17
15
|
|
|
@@ -24,8 +22,8 @@ declare const mintSession: (pool: PgPool, principal: string, ttlMs: number) => P
|
|
|
24
22
|
declare const revokeAllFor: (pool: PgPool, principal: string) => Promise<void>;
|
|
25
23
|
declare const mintDevToken: (sub: string, claims?: Record<string, unknown>) => string;
|
|
26
24
|
|
|
27
|
-
type ShippedManifest = Pick<NiscApp, 'charter' | 'actions' | 'layouts' | 'wearable' | 'assignments' | 'entries' | 'behaviors'>;
|
|
28
|
-
type ManifestCheck = 'actions' | 'charter' | 'reach' | 'variants';
|
|
25
|
+
type ShippedManifest = Pick<NiscApp, 'charter' | 'actions' | 'layouts' | 'wearable' | 'assignments' | 'entries' | 'behaviors' | 'shell' | 'pages'>;
|
|
26
|
+
type ManifestCheck = 'actions' | 'charter' | 'functions' | 'reach' | 'variants';
|
|
29
27
|
type ManifestReport = {
|
|
30
28
|
errors: readonly {
|
|
31
29
|
check: ManifestCheck;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { N as NiscApp } from './
|
|
2
|
-
export { F as FunctionSession, L as LayoutVariant, P as PageManifest, R as RunRecord,
|
|
1
|
+
import { N as NiscApp, M as MossServer, D as DocumentConfig } from './document-BYAY-Qle.js';
|
|
2
|
+
export { a as DrawnDocument, E as ExecuteAs, F as FunctionSession, I as IdentityRecord, L as LayoutVariant, P as PageManifest, R as RunRecord, b as RunSink, c as RunTurn, S as ShellHost, d as ShellManifest, e as ShellSnapshot, f as defineApp, r as renderDocument } from './document-BYAY-Qle.js';
|
|
3
3
|
import { VerifyReport } from '@niscorp/charter';
|
|
4
|
-
import { M as MossServer, D as DocumentConfig } from './document-DeTPGBil.js';
|
|
5
|
-
export { a as DrawnDocument, E as ExecuteAs, I as IdentityRecord, S as ShellHost, b as ShellSnapshot, r as renderDocument } from './document-DeTPGBil.js';
|
|
6
4
|
import { PgPool } from '@niscorp/vex';
|
|
7
|
-
import { N as NiscRuntime } from './index-
|
|
8
|
-
export { T as Telemetry, a as TelemetrySpan } from './index-
|
|
5
|
+
import { N as NiscRuntime } from './index-CSEo7Tys.js';
|
|
6
|
+
export { T as Telemetry, a as TelemetrySpan } from './index-CSEo7Tys.js';
|
|
9
7
|
import { MigrateReport } from '@niscorp/strata/postgres';
|
|
8
|
+
export { FunctionDefinition } from '@niscorp/nova';
|
|
10
9
|
import { Sequence } from '@niscorp/strata';
|
|
11
10
|
import { ScreenHead } from '@niscorp/nova/document';
|
|
12
|
-
import '@niscorp/nova';
|
|
13
|
-
import '@niscorp/nova/i18n';
|
|
14
11
|
import 'hono';
|
|
12
|
+
import '@niscorp/nova/i18n';
|
|
15
13
|
import './socket-D90h1xSV.js';
|
|
16
14
|
import 'zod';
|
|
17
15
|
|
|
@@ -24,8 +22,8 @@ declare const mintSession: (pool: PgPool, principal: string, ttlMs: number) => P
|
|
|
24
22
|
declare const revokeAllFor: (pool: PgPool, principal: string) => Promise<void>;
|
|
25
23
|
declare const mintDevToken: (sub: string, claims?: Record<string, unknown>) => string;
|
|
26
24
|
|
|
27
|
-
type ShippedManifest = Pick<NiscApp, 'charter' | 'actions' | 'layouts' | 'wearable' | 'assignments' | 'entries' | 'behaviors'>;
|
|
28
|
-
type ManifestCheck = 'actions' | 'charter' | 'reach' | 'variants';
|
|
25
|
+
type ShippedManifest = Pick<NiscApp, 'charter' | 'actions' | 'layouts' | 'wearable' | 'assignments' | 'entries' | 'behaviors' | 'shell' | 'pages'>;
|
|
26
|
+
type ManifestCheck = 'actions' | 'charter' | 'functions' | 'reach' | 'variants';
|
|
29
27
|
type ManifestReport = {
|
|
30
28
|
errors: readonly {
|
|
31
29
|
check: ManifestCheck;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { MOSS_SEQUENCE, createServer,
|
|
2
|
-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { MOSS_SEQUENCE, createServer, exportDocuments, migrateTables, mintDevToken, mintSession, renderDocument, revokeAllFor, sessionCookies } from './chunk-YZILOVCR.js';
|
|
2
|
+
export { defineApp, verifyApp } from './chunk-6XC2MD7S.js';
|
|
3
|
+
import './chunk-QAHDSRPK.js';
|
|
4
4
|
import './chunk-4ZGAFZGS.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/integrations.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkPVZMCEBX_cjs = require('./chunk-PVZMCEBX.cjs');
|
|
4
4
|
var crypto = require('crypto');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
var hono = require('hono');
|
|
@@ -331,9 +331,9 @@ var proxyRoutes = (deps) => {
|
|
|
331
331
|
return routes;
|
|
332
332
|
};
|
|
333
333
|
var callIntegrationWith = (deps) => {
|
|
334
|
-
const emit =
|
|
334
|
+
const emit = chunkPVZMCEBX_cjs.emitterOf(deps.telemetry);
|
|
335
335
|
return async (id, path, init) => {
|
|
336
|
-
const clock = emit === void 0 ? void 0 :
|
|
336
|
+
const clock = emit === void 0 ? void 0 : chunkPVZMCEBX_cjs.spanClock();
|
|
337
337
|
const done = (status, httpStatus) => {
|
|
338
338
|
if (emit === void 0 || clock === void 0) return;
|
|
339
339
|
emit({
|
package/dist/integrations.d.cts
CHANGED
package/dist/integrations.d.ts
CHANGED
package/dist/integrations.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { emitterOf, spanClock } from './chunk-
|
|
1
|
+
import { emitterOf, spanClock } from './chunk-QAHDSRPK.js';
|
|
2
2
|
import { generateKeyPairSync, sign, createPrivateKey, createPublicKey, createHash, randomBytes } from 'crypto';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { Hono } from 'hono';
|
package/dist/node.cjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var chunkI4UOWER3_cjs = require('./chunk-I4UOWER3.cjs');
|
|
4
|
+
require('./chunk-TMDKNZYL.cjs');
|
|
5
|
+
require('./chunk-3DCTQKPQ.cjs');
|
|
6
|
+
require('./chunk-PVZMCEBX.cjs');
|
|
7
7
|
require('./chunk-3RIWTXGI.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "MOSS_PATHS", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkI4UOWER3_cjs.MOSS_PATHS; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "attachSocket", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkI4UOWER3_cjs.attachSocket; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "mountSite", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkI4UOWER3_cjs.mountSite; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "serve", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkI4UOWER3_cjs.serve; }
|
|
26
26
|
});
|
|
27
27
|
//# sourceMappingURL=node.cjs.map
|
|
28
28
|
//# sourceMappingURL=node.cjs.map
|
package/dist/node.d.cts
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-B411sK9M.cjs';
|
|
1
|
+
import { D as DocumentConfig, M as MossServer, N as NiscApp } from './document-DAE71J27.cjs';
|
|
2
|
+
import { N as NiscRuntime } from './index-CSEo7Tys.cjs';
|
|
4
3
|
import { S as SocketAccept, T as TransportSettings } from './socket-D90h1xSV.cjs';
|
|
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
|
|