@niscorp/moss 0.1.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/DESIGN.md +592 -0
- package/DOCS.md +943 -0
- package/LICENSE +202 -0
- package/README.md +155 -0
- package/dist/chunk-2AHJ6VDR.js +3314 -0
- package/dist/chunk-2AHJ6VDR.js.map +1 -0
- package/dist/chunk-EMRDIZLY.js +99 -0
- package/dist/chunk-EMRDIZLY.js.map +1 -0
- package/dist/chunk-HF6IGQ74.js +3342 -0
- package/dist/chunk-HF6IGQ74.js.map +1 -0
- package/dist/chunk-J72N3EMJ.js +238 -0
- package/dist/chunk-J72N3EMJ.js.map +1 -0
- package/dist/chunk-SK4PDGEE.js +55 -0
- package/dist/chunk-SK4PDGEE.js.map +1 -0
- package/dist/chunk-ZOEUEMDX.js +251 -0
- package/dist/chunk-ZOEUEMDX.js.map +1 -0
- package/dist/client/node.cjs +42 -0
- package/dist/client/node.cjs.map +1 -0
- package/dist/client/node.d.cts +9 -0
- package/dist/client/node.d.ts +9 -0
- package/dist/client/node.js +40 -0
- package/dist/client/node.js.map +1 -0
- package/dist/client.cjs +275 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +52 -0
- package/dist/client.d.ts +52 -0
- package/dist/client.js +4 -0
- package/dist/client.js.map +1 -0
- package/dist/document-BEn2zXah.d.cts +993 -0
- package/dist/document-BEn2zXah.d.ts +993 -0
- package/dist/index.cjs +3716 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +104 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -0
- package/dist/node.cjs +3309 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.cts +28 -0
- package/dist/node.d.ts +28 -0
- package/dist/node.js +64 -0
- package/dist/node.js.map +1 -0
- package/dist/slots-Do9ScG7v.d.cts +37 -0
- package/dist/slots-Do9ScG7v.d.ts +37 -0
- package/dist/terminal/dom/index.cjs +34 -0
- package/dist/terminal/dom/index.cjs.map +1 -0
- package/dist/terminal/dom/index.d.cts +11 -0
- package/dist/terminal/dom/index.d.ts +11 -0
- package/dist/terminal/dom/index.js +32 -0
- package/dist/terminal/dom/index.js.map +1 -0
- package/dist/terminal/dom/server.cjs +16 -0
- package/dist/terminal/dom/server.cjs.map +1 -0
- package/dist/terminal/dom/server.d.cts +14 -0
- package/dist/terminal/dom/server.d.ts +14 -0
- package/dist/terminal/dom/server.js +14 -0
- package/dist/terminal/dom/server.js.map +1 -0
- package/dist/terminal/index.cjs +346 -0
- package/dist/terminal/index.cjs.map +1 -0
- package/dist/terminal/index.d.cts +32 -0
- package/dist/terminal/index.d.ts +32 -0
- package/dist/terminal/index.js +100 -0
- package/dist/terminal/index.js.map +1 -0
- package/dist/terminal/ink/index.d.ts +33 -0
- package/dist/terminal/ink/index.js +189 -0
- package/dist/terminal/ink/index.js.map +1 -0
- package/dist/terminal/react/index.cjs +87 -0
- package/dist/terminal/react/index.cjs.map +1 -0
- package/dist/terminal/react/index.d.cts +15 -0
- package/dist/terminal/react/index.d.ts +15 -0
- package/dist/terminal/react/index.js +35 -0
- package/dist/terminal/react/index.js.map +1 -0
- package/dist/terminal/react/server.cjs +79 -0
- package/dist/terminal/react/server.cjs.map +1 -0
- package/dist/terminal/react/server.d.cts +16 -0
- package/dist/terminal/react/server.d.ts +16 -0
- package/dist/terminal/react/server.js +28 -0
- package/dist/terminal/react/server.js.map +1 -0
- package/dist/terminal/tty/index.cjs +201 -0
- package/dist/terminal/tty/index.cjs.map +1 -0
- package/dist/terminal/tty/index.d.cts +18 -0
- package/dist/terminal/tty/index.d.ts +18 -0
- package/dist/terminal/tty/index.js +199 -0
- package/dist/terminal/tty/index.js.map +1 -0
- package/dist/terminal/vue/index.cjs +104 -0
- package/dist/terminal/vue/index.cjs.map +1 -0
- package/dist/terminal/vue/index.d.cts +23 -0
- package/dist/terminal/vue/index.d.ts +23 -0
- package/dist/terminal/vue/index.js +3 -0
- package/dist/terminal/vue/index.js.map +1 -0
- package/dist/terminal/vue/server.cjs +88 -0
- package/dist/terminal/vue/server.cjs.map +1 -0
- package/dist/terminal/vue/server.d.cts +18 -0
- package/dist/terminal/vue/server.d.ts +18 -0
- package/dist/terminal/vue/server.js +21 -0
- package/dist/terminal/vue/server.js.map +1 -0
- package/package.json +213 -0
|
@@ -0,0 +1,993 @@
|
|
|
1
|
+
import * as _niscorp_nova from '@niscorp/nova';
|
|
2
|
+
import { LayoutPaletteEntry, ActionDefinition, Shell, FetchFn, LayoutNode, CanvasConfig, ActionFragment, FunctionHandler, RenderNode } from '@niscorp/nova';
|
|
3
|
+
import { PgPool, MutationClient, CacheBackend, ScopePolicy, ScopeBehaviors, SeedEntry, SeedMutation } from '@niscorp/vex';
|
|
4
|
+
import * as _niscorp_tide from '@niscorp/tide';
|
|
5
|
+
import { Upgrader, Sequence } from '@niscorp/strata';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { Charter } from '@niscorp/charter';
|
|
8
|
+
import { Phrasebook, PhraseKeys } from '@niscorp/nova/i18n';
|
|
9
|
+
import { Context, Next, Hono } from 'hono';
|
|
10
|
+
|
|
11
|
+
type TelemetrySpan = {
|
|
12
|
+
name: string;
|
|
13
|
+
startUnixNano: number;
|
|
14
|
+
endUnixNano: number;
|
|
15
|
+
status: 'ok' | 'error' | 'refused';
|
|
16
|
+
attributes: Record<string, string | number | boolean>;
|
|
17
|
+
traceId?: string;
|
|
18
|
+
spanId?: string;
|
|
19
|
+
parentSpanId?: string;
|
|
20
|
+
};
|
|
21
|
+
type Telemetry = {
|
|
22
|
+
emit: (span: TelemetrySpan) => void;
|
|
23
|
+
};
|
|
24
|
+
type Emit = (span: TelemetrySpan) => void;
|
|
25
|
+
declare const emitterOf: (telemetry: Telemetry | undefined) => Emit | undefined;
|
|
26
|
+
type SpanClock = {
|
|
27
|
+
startUnixNano: number;
|
|
28
|
+
endUnixNano: () => number;
|
|
29
|
+
};
|
|
30
|
+
declare const spanClock: () => SpanClock;
|
|
31
|
+
|
|
32
|
+
type IntegrationRow = {
|
|
33
|
+
id: string;
|
|
34
|
+
url: string;
|
|
35
|
+
status: 'pending' | 'approved' | 'revoked';
|
|
36
|
+
title: string;
|
|
37
|
+
tagline: string;
|
|
38
|
+
adds: string;
|
|
39
|
+
settingsAction: string;
|
|
40
|
+
requestedActions: readonly string[];
|
|
41
|
+
requestedData: readonly string[];
|
|
42
|
+
approvedData: readonly string[];
|
|
43
|
+
offers: readonly string[];
|
|
44
|
+
needs: readonly string[];
|
|
45
|
+
capabilities: readonly {
|
|
46
|
+
id: string;
|
|
47
|
+
title: string;
|
|
48
|
+
}[];
|
|
49
|
+
configuration: readonly ConfigurationField[];
|
|
50
|
+
documents: readonly DocumentDeclaration[];
|
|
51
|
+
assistants: readonly AssistantDeclaration[];
|
|
52
|
+
lastImportAt: number | null;
|
|
53
|
+
lastError: string | null;
|
|
54
|
+
actionCount: number;
|
|
55
|
+
};
|
|
56
|
+
declare const configurationSchema: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
57
|
+
kind: z.ZodLiteral<"toggle">;
|
|
58
|
+
default: z.ZodBoolean;
|
|
59
|
+
key: z.ZodString;
|
|
60
|
+
title: z.ZodString;
|
|
61
|
+
description: z.ZodDefault<z.ZodString>;
|
|
62
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
63
|
+
kind: z.ZodLiteral<"number">;
|
|
64
|
+
min: z.ZodNumber;
|
|
65
|
+
max: z.ZodNumber;
|
|
66
|
+
default: z.ZodNumber;
|
|
67
|
+
key: z.ZodString;
|
|
68
|
+
title: z.ZodString;
|
|
69
|
+
description: z.ZodDefault<z.ZodString>;
|
|
70
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
71
|
+
kind: z.ZodLiteral<"pick">;
|
|
72
|
+
options: z.ZodArray<z.ZodObject<{
|
|
73
|
+
value: z.ZodString;
|
|
74
|
+
label: z.ZodString;
|
|
75
|
+
}, z.core.$strict>>;
|
|
76
|
+
default: z.ZodString;
|
|
77
|
+
key: z.ZodString;
|
|
78
|
+
title: z.ZodString;
|
|
79
|
+
description: z.ZodDefault<z.ZodString>;
|
|
80
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
81
|
+
kind: z.ZodLiteral<"line">;
|
|
82
|
+
maxLength: z.ZodNumber;
|
|
83
|
+
default: z.ZodString;
|
|
84
|
+
key: z.ZodString;
|
|
85
|
+
title: z.ZodString;
|
|
86
|
+
description: z.ZodDefault<z.ZodString>;
|
|
87
|
+
}, z.core.$strict>], "kind">>>;
|
|
88
|
+
type ConfigurationField = z.infer<typeof configurationSchema>[number];
|
|
89
|
+
declare const documentDeclarationSchema: z.ZodObject<{
|
|
90
|
+
id: z.ZodString;
|
|
91
|
+
title: z.ZodString;
|
|
92
|
+
capability: z.ZodString;
|
|
93
|
+
registry: z.ZodArray<z.ZodObject<{
|
|
94
|
+
type: z.ZodString;
|
|
95
|
+
label: z.ZodString;
|
|
96
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
97
|
+
key: z.ZodString;
|
|
98
|
+
label: z.ZodString;
|
|
99
|
+
kind: z.ZodEnum<{
|
|
100
|
+
number: "number";
|
|
101
|
+
toggle: "toggle";
|
|
102
|
+
pick: "pick";
|
|
103
|
+
line: "line";
|
|
104
|
+
long: "long";
|
|
105
|
+
url: "url";
|
|
106
|
+
asset: "asset";
|
|
107
|
+
color: "color";
|
|
108
|
+
list: "list";
|
|
109
|
+
}>;
|
|
110
|
+
hint: z.ZodDefault<z.ZodString>;
|
|
111
|
+
placeholder: z.ZodDefault<z.ZodString>;
|
|
112
|
+
group: z.ZodDefault<z.ZodString>;
|
|
113
|
+
advanced: z.ZodDefault<z.ZodBoolean>;
|
|
114
|
+
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
115
|
+
value: z.ZodString;
|
|
116
|
+
label: z.ZodString;
|
|
117
|
+
}, z.core.$strict>>>;
|
|
118
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
}, z.core.$strict>>;
|
|
120
|
+
starter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
121
|
+
fragment: z.ZodType<_niscorp_nova.LayoutNode, unknown, z.core.$ZodTypeInternals<_niscorp_nova.LayoutNode, unknown>>;
|
|
122
|
+
}, z.core.$strict>>;
|
|
123
|
+
sections: z.ZodUnion<readonly [z.ZodObject<{
|
|
124
|
+
fixed: z.ZodArray<z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
type: z.ZodString;
|
|
127
|
+
label: z.ZodString;
|
|
128
|
+
extends: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strict>>;
|
|
130
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
131
|
+
open: z.ZodObject<{
|
|
132
|
+
max: z.ZodNumber;
|
|
133
|
+
}, z.core.$strict>;
|
|
134
|
+
}, z.core.$strict>]>;
|
|
135
|
+
regions: z.ZodDefault<z.ZodObject<{
|
|
136
|
+
bar: z.ZodOptional<z.ZodString>;
|
|
137
|
+
outline: z.ZodOptional<z.ZodString>;
|
|
138
|
+
stage: z.ZodOptional<z.ZodString>;
|
|
139
|
+
inspector: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strict>>;
|
|
141
|
+
checks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
142
|
+
publish: z.ZodObject<{
|
|
143
|
+
path: z.ZodString;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
}, z.core.$strict>;
|
|
146
|
+
type DocumentDeclaration = z.infer<typeof documentDeclarationSchema>;
|
|
147
|
+
declare const assistantDeclarationSchema: z.ZodObject<{
|
|
148
|
+
id: z.ZodString;
|
|
149
|
+
title: z.ZodString;
|
|
150
|
+
intro: z.ZodDefault<z.ZodString>;
|
|
151
|
+
instructions: z.ZodString;
|
|
152
|
+
grounding: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
153
|
+
as: z.ZodString;
|
|
154
|
+
fingerprint: z.ZodString;
|
|
155
|
+
context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
156
|
+
upfront: z.ZodDefault<z.ZodBoolean>;
|
|
157
|
+
}, z.core.$strict>>>;
|
|
158
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
159
|
+
blocks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
160
|
+
type: z.ZodString;
|
|
161
|
+
label: z.ZodString;
|
|
162
|
+
fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
163
|
+
key: z.ZodString;
|
|
164
|
+
label: z.ZodString;
|
|
165
|
+
kind: z.ZodEnum<{
|
|
166
|
+
number: "number";
|
|
167
|
+
toggle: "toggle";
|
|
168
|
+
pick: "pick";
|
|
169
|
+
line: "line";
|
|
170
|
+
long: "long";
|
|
171
|
+
url: "url";
|
|
172
|
+
asset: "asset";
|
|
173
|
+
color: "color";
|
|
174
|
+
list: "list";
|
|
175
|
+
}>;
|
|
176
|
+
hint: z.ZodDefault<z.ZodString>;
|
|
177
|
+
placeholder: z.ZodDefault<z.ZodString>;
|
|
178
|
+
group: z.ZodDefault<z.ZodString>;
|
|
179
|
+
advanced: z.ZodDefault<z.ZodBoolean>;
|
|
180
|
+
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
181
|
+
value: z.ZodString;
|
|
182
|
+
label: z.ZodString;
|
|
183
|
+
}, z.core.$strict>>>;
|
|
184
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
}, z.core.$strict>>>;
|
|
186
|
+
refs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
187
|
+
fragment: z.ZodType<_niscorp_nova.LayoutNode, unknown, z.core.$ZodTypeInternals<_niscorp_nova.LayoutNode, unknown>>;
|
|
188
|
+
}, z.core.$strict>>>;
|
|
189
|
+
starters: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
190
|
+
applies: z.ZodObject<{
|
|
191
|
+
document: z.ZodOptional<z.ZodString>;
|
|
192
|
+
screen: z.ZodOptional<z.ZodString>;
|
|
193
|
+
}, z.core.$strict>;
|
|
194
|
+
modelRole: z.ZodOptional<z.ZodString>;
|
|
195
|
+
subject: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
196
|
+
describe: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
197
|
+
}, z.core.$strict>;
|
|
198
|
+
type AssistantDeclaration = z.infer<typeof assistantDeclarationSchema>;
|
|
199
|
+
declare const BundleSchema: z.ZodObject<{
|
|
200
|
+
integration: z.ZodString;
|
|
201
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
202
|
+
title: z.ZodDefault<z.ZodString>;
|
|
203
|
+
tagline: z.ZodDefault<z.ZodString>;
|
|
204
|
+
description: z.ZodDefault<z.ZodString>;
|
|
205
|
+
story: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
206
|
+
heading: z.ZodString;
|
|
207
|
+
prose: z.ZodString;
|
|
208
|
+
}, z.core.$strict>>>;
|
|
209
|
+
highlights: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
210
|
+
press: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
211
|
+
}, z.core.$strict>>;
|
|
212
|
+
grants: z.ZodDefault<z.ZodObject<{
|
|
213
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
214
|
+
data: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
capabilities: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
217
|
+
id: z.ZodString;
|
|
218
|
+
title: z.ZodString;
|
|
219
|
+
}, z.core.$strict>>>;
|
|
220
|
+
offers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
221
|
+
needs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
222
|
+
grammar: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
223
|
+
actions: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
name: z.ZodOptional<z.ZodString>;
|
|
226
|
+
description: z.ZodOptional<z.ZodString>;
|
|
227
|
+
title: z.ZodOptional<z.ZodString>;
|
|
228
|
+
layout: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodType<_niscorp_nova.LayoutNode, unknown, z.core.$ZodTypeInternals<_niscorp_nova.LayoutNode, unknown>>]>>;
|
|
229
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
230
|
+
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
231
|
+
triggers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
232
|
+
event: z.ZodOptional<z.ZodString>;
|
|
233
|
+
message: z.ZodOptional<z.ZodString>;
|
|
234
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
235
|
+
key: z.ZodOptional<z.ZodString>;
|
|
236
|
+
do: z.ZodArray<z.ZodType<_niscorp_nova.Step, unknown, z.core.$ZodTypeInternals<_niscorp_nova.Step, unknown>>>;
|
|
237
|
+
}, z.core.$strict>>>;
|
|
238
|
+
endpoints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
239
|
+
url: z.ZodString;
|
|
240
|
+
method: z.ZodEnum<{
|
|
241
|
+
GET: "GET";
|
|
242
|
+
POST: "POST";
|
|
243
|
+
PUT: "PUT";
|
|
244
|
+
PATCH: "PATCH";
|
|
245
|
+
DELETE: "DELETE";
|
|
246
|
+
}>;
|
|
247
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
248
|
+
request: z.ZodOptional<z.ZodUnknown>;
|
|
249
|
+
response: z.ZodOptional<z.ZodUnknown>;
|
|
250
|
+
target: z.ZodOptional<z.ZodString>;
|
|
251
|
+
errorTarget: z.ZodOptional<z.ZodString>;
|
|
252
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
254
|
+
fn: z.ZodString;
|
|
255
|
+
target: z.ZodOptional<z.ZodString>;
|
|
256
|
+
errorTarget: z.ZodOptional<z.ZodString>;
|
|
257
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
}, z.core.$strict>]>>>;
|
|
259
|
+
lifecycle: z.ZodOptional<z.ZodObject<{
|
|
260
|
+
mount: z.ZodOptional<z.ZodArray<z.ZodType<_niscorp_nova.Step, unknown, z.core.$ZodTypeInternals<_niscorp_nova.Step, unknown>>>>;
|
|
261
|
+
unmount: z.ZodOptional<z.ZodArray<z.ZodType<_niscorp_nova.Step, unknown, z.core.$ZodTypeInternals<_niscorp_nova.Step, unknown>>>>;
|
|
262
|
+
suspend: z.ZodOptional<z.ZodArray<z.ZodType<_niscorp_nova.Step, unknown, z.core.$ZodTypeInternals<_niscorp_nova.Step, unknown>>>>;
|
|
263
|
+
resume: z.ZodOptional<z.ZodArray<z.ZodType<_niscorp_nova.Step, unknown, z.core.$ZodTypeInternals<_niscorp_nova.Step, unknown>>>>;
|
|
264
|
+
}, z.core.$strict>>;
|
|
265
|
+
}, z.core.$strict>>;
|
|
266
|
+
attachments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
267
|
+
to: z.ZodString;
|
|
268
|
+
preview: z.ZodDefault<z.ZodString>;
|
|
269
|
+
}, z.core.$strict>]>>>;
|
|
270
|
+
placements: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
271
|
+
frames: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
272
|
+
settings: z.ZodDefault<z.ZodString>;
|
|
273
|
+
phrasebook: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
274
|
+
configuration: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
275
|
+
kind: z.ZodLiteral<"toggle">;
|
|
276
|
+
default: z.ZodBoolean;
|
|
277
|
+
key: z.ZodString;
|
|
278
|
+
title: z.ZodString;
|
|
279
|
+
description: z.ZodDefault<z.ZodString>;
|
|
280
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
281
|
+
kind: z.ZodLiteral<"number">;
|
|
282
|
+
min: z.ZodNumber;
|
|
283
|
+
max: z.ZodNumber;
|
|
284
|
+
default: z.ZodNumber;
|
|
285
|
+
key: z.ZodString;
|
|
286
|
+
title: z.ZodString;
|
|
287
|
+
description: z.ZodDefault<z.ZodString>;
|
|
288
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
289
|
+
kind: z.ZodLiteral<"pick">;
|
|
290
|
+
options: z.ZodArray<z.ZodObject<{
|
|
291
|
+
value: z.ZodString;
|
|
292
|
+
label: z.ZodString;
|
|
293
|
+
}, z.core.$strict>>;
|
|
294
|
+
default: z.ZodString;
|
|
295
|
+
key: z.ZodString;
|
|
296
|
+
title: z.ZodString;
|
|
297
|
+
description: z.ZodDefault<z.ZodString>;
|
|
298
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
299
|
+
kind: z.ZodLiteral<"line">;
|
|
300
|
+
maxLength: z.ZodNumber;
|
|
301
|
+
default: z.ZodString;
|
|
302
|
+
key: z.ZodString;
|
|
303
|
+
title: z.ZodString;
|
|
304
|
+
description: z.ZodDefault<z.ZodString>;
|
|
305
|
+
}, z.core.$strict>], "kind">>>;
|
|
306
|
+
documents: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
307
|
+
id: z.ZodString;
|
|
308
|
+
title: z.ZodString;
|
|
309
|
+
capability: z.ZodString;
|
|
310
|
+
registry: z.ZodArray<z.ZodObject<{
|
|
311
|
+
type: z.ZodString;
|
|
312
|
+
label: z.ZodString;
|
|
313
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
314
|
+
key: z.ZodString;
|
|
315
|
+
label: z.ZodString;
|
|
316
|
+
kind: z.ZodEnum<{
|
|
317
|
+
number: "number";
|
|
318
|
+
toggle: "toggle";
|
|
319
|
+
pick: "pick";
|
|
320
|
+
line: "line";
|
|
321
|
+
long: "long";
|
|
322
|
+
url: "url";
|
|
323
|
+
asset: "asset";
|
|
324
|
+
color: "color";
|
|
325
|
+
list: "list";
|
|
326
|
+
}>;
|
|
327
|
+
hint: z.ZodDefault<z.ZodString>;
|
|
328
|
+
placeholder: z.ZodDefault<z.ZodString>;
|
|
329
|
+
group: z.ZodDefault<z.ZodString>;
|
|
330
|
+
advanced: z.ZodDefault<z.ZodBoolean>;
|
|
331
|
+
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
332
|
+
value: z.ZodString;
|
|
333
|
+
label: z.ZodString;
|
|
334
|
+
}, z.core.$strict>>>;
|
|
335
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
336
|
+
}, z.core.$strict>>;
|
|
337
|
+
starter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
338
|
+
fragment: z.ZodType<_niscorp_nova.LayoutNode, unknown, z.core.$ZodTypeInternals<_niscorp_nova.LayoutNode, unknown>>;
|
|
339
|
+
}, z.core.$strict>>;
|
|
340
|
+
sections: z.ZodUnion<readonly [z.ZodObject<{
|
|
341
|
+
fixed: z.ZodArray<z.ZodObject<{
|
|
342
|
+
id: z.ZodString;
|
|
343
|
+
type: z.ZodString;
|
|
344
|
+
label: z.ZodString;
|
|
345
|
+
extends: z.ZodOptional<z.ZodString>;
|
|
346
|
+
}, z.core.$strict>>;
|
|
347
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
348
|
+
open: z.ZodObject<{
|
|
349
|
+
max: z.ZodNumber;
|
|
350
|
+
}, z.core.$strict>;
|
|
351
|
+
}, z.core.$strict>]>;
|
|
352
|
+
regions: z.ZodDefault<z.ZodObject<{
|
|
353
|
+
bar: z.ZodOptional<z.ZodString>;
|
|
354
|
+
outline: z.ZodOptional<z.ZodString>;
|
|
355
|
+
stage: z.ZodOptional<z.ZodString>;
|
|
356
|
+
inspector: z.ZodOptional<z.ZodString>;
|
|
357
|
+
}, z.core.$strict>>;
|
|
358
|
+
checks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
359
|
+
publish: z.ZodObject<{
|
|
360
|
+
path: z.ZodString;
|
|
361
|
+
}, z.core.$strict>;
|
|
362
|
+
}, z.core.$strict>>>;
|
|
363
|
+
assistants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
364
|
+
id: z.ZodString;
|
|
365
|
+
title: z.ZodString;
|
|
366
|
+
intro: z.ZodDefault<z.ZodString>;
|
|
367
|
+
instructions: z.ZodString;
|
|
368
|
+
grounding: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
369
|
+
as: z.ZodString;
|
|
370
|
+
fingerprint: z.ZodString;
|
|
371
|
+
context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
372
|
+
upfront: z.ZodDefault<z.ZodBoolean>;
|
|
373
|
+
}, z.core.$strict>>>;
|
|
374
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
375
|
+
blocks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
376
|
+
type: z.ZodString;
|
|
377
|
+
label: z.ZodString;
|
|
378
|
+
fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
379
|
+
key: z.ZodString;
|
|
380
|
+
label: z.ZodString;
|
|
381
|
+
kind: z.ZodEnum<{
|
|
382
|
+
number: "number";
|
|
383
|
+
toggle: "toggle";
|
|
384
|
+
pick: "pick";
|
|
385
|
+
line: "line";
|
|
386
|
+
long: "long";
|
|
387
|
+
url: "url";
|
|
388
|
+
asset: "asset";
|
|
389
|
+
color: "color";
|
|
390
|
+
list: "list";
|
|
391
|
+
}>;
|
|
392
|
+
hint: z.ZodDefault<z.ZodString>;
|
|
393
|
+
placeholder: z.ZodDefault<z.ZodString>;
|
|
394
|
+
group: z.ZodDefault<z.ZodString>;
|
|
395
|
+
advanced: z.ZodDefault<z.ZodBoolean>;
|
|
396
|
+
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
397
|
+
value: z.ZodString;
|
|
398
|
+
label: z.ZodString;
|
|
399
|
+
}, z.core.$strict>>>;
|
|
400
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
401
|
+
}, z.core.$strict>>>;
|
|
402
|
+
refs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
403
|
+
fragment: z.ZodType<_niscorp_nova.LayoutNode, unknown, z.core.$ZodTypeInternals<_niscorp_nova.LayoutNode, unknown>>;
|
|
404
|
+
}, z.core.$strict>>>;
|
|
405
|
+
starters: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
406
|
+
applies: z.ZodObject<{
|
|
407
|
+
document: z.ZodOptional<z.ZodString>;
|
|
408
|
+
screen: z.ZodOptional<z.ZodString>;
|
|
409
|
+
}, z.core.$strict>;
|
|
410
|
+
modelRole: z.ZodOptional<z.ZodString>;
|
|
411
|
+
subject: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
412
|
+
describe: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
413
|
+
}, z.core.$strict>>>;
|
|
414
|
+
}, z.core.$strict>;
|
|
415
|
+
type Bundle = z.infer<typeof BundleSchema>;
|
|
416
|
+
type IntakeResult = {
|
|
417
|
+
ok: true;
|
|
418
|
+
bundle: Bundle;
|
|
419
|
+
} | {
|
|
420
|
+
ok: false;
|
|
421
|
+
reasons: string[];
|
|
422
|
+
};
|
|
423
|
+
type IntakeContext = {
|
|
424
|
+
integrationId: string;
|
|
425
|
+
components: ReadonlyMap<string, {
|
|
426
|
+
propsSchema?: unknown;
|
|
427
|
+
}>;
|
|
428
|
+
fingerprints: ReadonlySet<string>;
|
|
429
|
+
attachable: ReadonlySet<string>;
|
|
430
|
+
menuSlots: ReadonlySet<string>;
|
|
431
|
+
regions?: ReadonlySet<string>;
|
|
432
|
+
tools?: ReadonlySet<string>;
|
|
433
|
+
checks?: ReadonlySet<string>;
|
|
434
|
+
upgrader?: Upgrader;
|
|
435
|
+
hostActions?: Readonly<Record<string, ActionDefinition>>;
|
|
436
|
+
};
|
|
437
|
+
declare const runIntake: (payload: unknown, ctx: IntakeContext) => IntakeResult;
|
|
438
|
+
declare const describePlacements: (bundle: Bundle, names?: Readonly<Record<string, string>>) => string;
|
|
439
|
+
type StorePress = (integrationId: string, name: string, bytes: Uint8Array, contentType: string) => Promise<string>;
|
|
440
|
+
type PressResult = {
|
|
441
|
+
ok: true;
|
|
442
|
+
urls: string[];
|
|
443
|
+
} | {
|
|
444
|
+
ok: false;
|
|
445
|
+
reasons: string[];
|
|
446
|
+
};
|
|
447
|
+
declare const copyPress: (bundle: Bundle, integrationId: string, serviceUrl: string, store: StorePress | undefined, fetchImpl?: typeof fetch) => Promise<PressResult>;
|
|
448
|
+
type CallIntegration = (id: string, path: string, init: {
|
|
449
|
+
principal: string;
|
|
450
|
+
method?: string;
|
|
451
|
+
body?: unknown;
|
|
452
|
+
scope?: Record<string, unknown>;
|
|
453
|
+
}) => Promise<Response>;
|
|
454
|
+
declare const callIntegrationWith: (deps: {
|
|
455
|
+
pool: PgPool;
|
|
456
|
+
installedFor: (principal: string) => Promise<readonly string[] | undefined>;
|
|
457
|
+
scopeValuesFor: (principal: string) => Promise<Record<string, unknown>>;
|
|
458
|
+
mint: (claims: {
|
|
459
|
+
integration: string;
|
|
460
|
+
principal: string;
|
|
461
|
+
scope: Record<string, unknown>;
|
|
462
|
+
}) => string;
|
|
463
|
+
fetchImpl?: typeof fetch;
|
|
464
|
+
telemetry?: Telemetry;
|
|
465
|
+
}) => CallIntegration;
|
|
466
|
+
declare const MOSS_SEQUENCE: Sequence;
|
|
467
|
+
declare const initIntegrations: (pool: PgPool) => Promise<void>;
|
|
468
|
+
declare const listAttachments: (pool: PgPool, hostAction: string) => Promise<{
|
|
469
|
+
actionId: string;
|
|
470
|
+
preview: string;
|
|
471
|
+
}[]>;
|
|
472
|
+
declare const listPlacements: (pool: PgPool) => Promise<Record<string, string>>;
|
|
473
|
+
declare const integrationByKey: (pool: PgPool, key: string) => Promise<string | undefined>;
|
|
474
|
+
declare const listIntegrations: (pool: PgPool) => Promise<IntegrationRow[]>;
|
|
475
|
+
declare const loadIntegrationActions: (pool: PgPool, upgrader?: Upgrader) => Promise<Record<string, ActionDefinition>>;
|
|
476
|
+
declare const integrationOfAction: (id: string) => string | undefined;
|
|
477
|
+
declare const filterInstalled: (ids: readonly string[], installed: ReadonlySet<string> | undefined) => readonly string[];
|
|
478
|
+
type Contract = {
|
|
479
|
+
components: readonly LayoutPaletteEntry[];
|
|
480
|
+
audiences: readonly string[];
|
|
481
|
+
namespace: string;
|
|
482
|
+
actionSchema: string;
|
|
483
|
+
attachable: Record<string, readonly string[]>;
|
|
484
|
+
menuSlots: readonly string[];
|
|
485
|
+
};
|
|
486
|
+
declare const buildContract: (app: NiscApp, integrationId: string) => Contract;
|
|
487
|
+
declare const contractAsMarkdown: (contract: Contract, fingerprints: readonly string[]) => string;
|
|
488
|
+
|
|
489
|
+
type FabricSignal = {
|
|
490
|
+
kind: 'invalidate-identity';
|
|
491
|
+
principal: string;
|
|
492
|
+
} | {
|
|
493
|
+
kind: 'invalidate-tenant';
|
|
494
|
+
tag: string;
|
|
495
|
+
} | {
|
|
496
|
+
kind: 'nudge';
|
|
497
|
+
principal: string;
|
|
498
|
+
channel: string;
|
|
499
|
+
};
|
|
500
|
+
type FabricMessage = FabricSignal & {
|
|
501
|
+
origin: string;
|
|
502
|
+
};
|
|
503
|
+
type Fabric = {
|
|
504
|
+
publish: (message: FabricMessage) => void;
|
|
505
|
+
subscribe: (apply: (message: FabricMessage) => void) => void;
|
|
506
|
+
};
|
|
507
|
+
type FabricApply = {
|
|
508
|
+
invalidateIdentity: (principal: string) => void;
|
|
509
|
+
invalidateTenant: (tag: string) => void;
|
|
510
|
+
nudge: (principal: string, channel: string) => void;
|
|
511
|
+
};
|
|
512
|
+
declare const wireFabric: (fabric: Fabric | undefined, origin: string, apply: FabricApply) => ((signal: FabricSignal) => void);
|
|
513
|
+
|
|
514
|
+
type SessionVerifier = (token: string) => string | null | Promise<string | null>;
|
|
515
|
+
type NiscRuntime = {
|
|
516
|
+
pool: PgPool;
|
|
517
|
+
db: MutationClient;
|
|
518
|
+
cache?: CacheBackend;
|
|
519
|
+
session: SessionVerifier | 'sessions' | 'dev-open';
|
|
520
|
+
migrations?: 'apply' | 'verify';
|
|
521
|
+
shellIdleMs?: number;
|
|
522
|
+
endpointTimeoutMs?: number;
|
|
523
|
+
sessionRevalidateMs?: number;
|
|
524
|
+
identityMax?: number;
|
|
525
|
+
identityIdleMs?: number;
|
|
526
|
+
shellFrameDelta?: boolean;
|
|
527
|
+
socketCompression?: boolean | Record<string, unknown>;
|
|
528
|
+
operatorKey?: string;
|
|
529
|
+
operatorGate?: (c: Context, next: Next) => Response | void | Promise<Response | void>;
|
|
530
|
+
fabric?: Fabric;
|
|
531
|
+
telemetry?: Telemetry;
|
|
532
|
+
signingSeed?: string;
|
|
533
|
+
};
|
|
534
|
+
declare const mintDevToken: (sub: string, claims?: Record<string, unknown>) => string;
|
|
535
|
+
declare const devSession: (token: string) => string | null;
|
|
536
|
+
|
|
537
|
+
type IdentityRecord = {
|
|
538
|
+
roles: readonly string[];
|
|
539
|
+
scope: Record<string, unknown>;
|
|
540
|
+
installed?: readonly string[];
|
|
541
|
+
tag?: string;
|
|
542
|
+
};
|
|
543
|
+
type IdentityReport = {
|
|
544
|
+
principal: string;
|
|
545
|
+
since: number;
|
|
546
|
+
lastSeen: number;
|
|
547
|
+
};
|
|
548
|
+
type IdentityCache = {
|
|
549
|
+
get: (principal: string) => Promise<IdentityRecord>;
|
|
550
|
+
invalidate: (principal: string) => boolean;
|
|
551
|
+
invalidateAll: () => void;
|
|
552
|
+
invalidateTag: (tag: string) => readonly string[];
|
|
553
|
+
list: () => IdentityReport[];
|
|
554
|
+
meter: () => {
|
|
555
|
+
size: number;
|
|
556
|
+
max: number;
|
|
557
|
+
resolved: number;
|
|
558
|
+
evicted: number;
|
|
559
|
+
expired: number;
|
|
560
|
+
};
|
|
561
|
+
stop: () => void;
|
|
562
|
+
};
|
|
563
|
+
type IdentityCacheContext = {
|
|
564
|
+
resolve: (principal: string) => Promise<IdentityRecord>;
|
|
565
|
+
max?: number;
|
|
566
|
+
idleMs?: number;
|
|
567
|
+
revalidateMs?: number;
|
|
568
|
+
now?: () => number;
|
|
569
|
+
};
|
|
570
|
+
declare const DEFAULT_IDENTITY_MAX = 10000;
|
|
571
|
+
declare const DEFAULT_IDENTITY_IDLE_MS: number;
|
|
572
|
+
declare const createIdentityCache: (ctx: IdentityCacheContext) => IdentityCache;
|
|
573
|
+
|
|
574
|
+
type LayoutVariant = {
|
|
575
|
+
action: string;
|
|
576
|
+
layout: LayoutNode;
|
|
577
|
+
};
|
|
578
|
+
type NiscApp = {
|
|
579
|
+
charter: Charter;
|
|
580
|
+
assignments?: Record<string, readonly string[]>;
|
|
581
|
+
wearable?: readonly (readonly string[])[];
|
|
582
|
+
actions: Record<string, ActionDefinition>;
|
|
583
|
+
layouts?: Record<string, LayoutVariant>;
|
|
584
|
+
behaviors?: ScopeBehaviors;
|
|
585
|
+
scope?: (principal: string | null, identity?: IdentityRecord) => Record<string, unknown>;
|
|
586
|
+
identity?: {
|
|
587
|
+
as?: string;
|
|
588
|
+
resolve: (principal: string, read: (fingerprint: string, scope: Record<string, unknown>) => Promise<unknown>) => Promise<IdentityRecord>;
|
|
589
|
+
};
|
|
590
|
+
phrases?: (session: {
|
|
591
|
+
principal: string | null;
|
|
592
|
+
identity: Record<string, unknown>;
|
|
593
|
+
wire: FetchFn;
|
|
594
|
+
}) => Phrasebook | undefined | Promise<Phrasebook | undefined>;
|
|
595
|
+
phraseKeys?: PhraseKeys;
|
|
596
|
+
installedIntegrations?: (principal: string | null) => readonly string[] | Promise<readonly string[]>;
|
|
597
|
+
integrationActor?: (integration: string, actsFor: string) => string | null | Promise<string | null>;
|
|
598
|
+
attachable?: Record<string, Record<string, string>>;
|
|
599
|
+
menuSlots?: readonly string[];
|
|
600
|
+
assistantTools?: readonly string[];
|
|
601
|
+
publishChecks?: readonly string[];
|
|
602
|
+
editorRegions?: readonly string[];
|
|
603
|
+
placementNames?: Readonly<Record<string, string>>;
|
|
604
|
+
storePress?: StorePress;
|
|
605
|
+
entries?: readonly (SeedEntry | SeedMutation)[];
|
|
606
|
+
resources?: Record<string, readonly string[] | {
|
|
607
|
+
entities: readonly string[];
|
|
608
|
+
}>;
|
|
609
|
+
shell?: ShellManifest;
|
|
610
|
+
pages?: Record<string, PageManifest>;
|
|
611
|
+
grammars?: readonly Sequence[];
|
|
612
|
+
functions?: (session: FunctionSession) => Record<string, FunctionHandler>;
|
|
613
|
+
onSession?: (session: FunctionSession) => void;
|
|
614
|
+
runs?: RunSink;
|
|
615
|
+
reactions?: readonly {
|
|
616
|
+
table: string;
|
|
617
|
+
op?: 'insert' | 'update' | 'delete';
|
|
618
|
+
run: (event: {
|
|
619
|
+
fingerprint: string;
|
|
620
|
+
table: string;
|
|
621
|
+
op: 'insert' | 'update' | 'delete';
|
|
622
|
+
count: number;
|
|
623
|
+
scope: Record<string, unknown>;
|
|
624
|
+
}, tools: {
|
|
625
|
+
deliver: (principal: string, channel: string, payload?: unknown) => boolean;
|
|
626
|
+
}) => void;
|
|
627
|
+
}[];
|
|
628
|
+
facts?: {
|
|
629
|
+
tide: () => FactIntake | undefined;
|
|
630
|
+
identity: (scope: Record<string, unknown>) => string | undefined;
|
|
631
|
+
chain?: (scope: Record<string, unknown>, hints: {
|
|
632
|
+
cause: string;
|
|
633
|
+
depth: number;
|
|
634
|
+
}) => {
|
|
635
|
+
cause: string;
|
|
636
|
+
depth: number;
|
|
637
|
+
} | undefined;
|
|
638
|
+
};
|
|
639
|
+
};
|
|
640
|
+
type FactIntake = Pick<_niscorp_tide.Tide, 'ingest'>;
|
|
641
|
+
type RunTurn = {
|
|
642
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
643
|
+
content: string;
|
|
644
|
+
calls?: ReadonlyArray<{
|
|
645
|
+
name: string;
|
|
646
|
+
args: string;
|
|
647
|
+
}>;
|
|
648
|
+
name?: string;
|
|
649
|
+
};
|
|
650
|
+
type RunRecord = {
|
|
651
|
+
at: number;
|
|
652
|
+
principal: string | null;
|
|
653
|
+
shellId: string;
|
|
654
|
+
agentId: string;
|
|
655
|
+
agentPath: readonly string[];
|
|
656
|
+
label: string;
|
|
657
|
+
provider: string;
|
|
658
|
+
model: string;
|
|
659
|
+
inputTokens: number;
|
|
660
|
+
outputTokens: number;
|
|
661
|
+
totalTokens: number;
|
|
662
|
+
reported: boolean;
|
|
663
|
+
steps: number;
|
|
664
|
+
elapsedMs: number;
|
|
665
|
+
turns?: readonly RunTurn[];
|
|
666
|
+
response?: string;
|
|
667
|
+
outcome: 'ok' | 'failed';
|
|
668
|
+
};
|
|
669
|
+
type RunSink = (record: RunRecord, session: FunctionSession) => void;
|
|
670
|
+
type FunctionSession = {
|
|
671
|
+
shell: Shell;
|
|
672
|
+
principal: string | null;
|
|
673
|
+
roles: readonly string[];
|
|
674
|
+
identity: Record<string, unknown>;
|
|
675
|
+
actions: readonly string[];
|
|
676
|
+
wire: FetchFn;
|
|
677
|
+
runtime: NiscRuntime;
|
|
678
|
+
policy: ScopePolicy;
|
|
679
|
+
grant: (token: string) => void;
|
|
680
|
+
revoke: () => Promise<void>;
|
|
681
|
+
recordRun: (run: Omit<RunRecord, 'at' | 'principal' | 'shellId'>) => void;
|
|
682
|
+
};
|
|
683
|
+
type CanvasSeed = string | {
|
|
684
|
+
action: string;
|
|
685
|
+
input?: Record<string, unknown>;
|
|
686
|
+
with?: string[];
|
|
687
|
+
};
|
|
688
|
+
type ShellCanvas = Omit<CanvasConfig, 'initial'> & {
|
|
689
|
+
initial?: CanvasSeed | CanvasSeed[];
|
|
690
|
+
};
|
|
691
|
+
type ShellManifest = {
|
|
692
|
+
canvases: ShellCanvas[];
|
|
693
|
+
layout?: LayoutNode;
|
|
694
|
+
layoutStore?: Record<string, LayoutNode>;
|
|
695
|
+
fragments?: Record<string, ActionFragment>;
|
|
696
|
+
seeds?: (session: {
|
|
697
|
+
principal: string | null;
|
|
698
|
+
actions: readonly string[];
|
|
699
|
+
roles: readonly string[];
|
|
700
|
+
wire: FetchFn;
|
|
701
|
+
}) => Promise<Record<string, CanvasSeed[]>> | Record<string, CanvasSeed[]>;
|
|
702
|
+
components?: Record<string, {
|
|
703
|
+
meta?: {
|
|
704
|
+
description?: string;
|
|
705
|
+
propsSchema?: unknown;
|
|
706
|
+
};
|
|
707
|
+
}>;
|
|
708
|
+
inputs?: (session: {
|
|
709
|
+
principal: string | null;
|
|
710
|
+
actions: readonly string[];
|
|
711
|
+
roles: readonly string[];
|
|
712
|
+
identity: Record<string, unknown>;
|
|
713
|
+
wire: FetchFn;
|
|
714
|
+
}) => Record<string, Record<string, unknown>> | Promise<Record<string, Record<string, unknown>>>;
|
|
715
|
+
};
|
|
716
|
+
type PageManifest = ShellManifest & {
|
|
717
|
+
path: string;
|
|
718
|
+
params?: string;
|
|
719
|
+
};
|
|
720
|
+
declare const defineApp: (app: NiscApp) => NiscApp;
|
|
721
|
+
|
|
722
|
+
declare const resolveRoles: (app: NiscApp, principal: string | null) => readonly string[];
|
|
723
|
+
declare const wearableOf: (app: NiscApp) => readonly (readonly string[])[];
|
|
724
|
+
declare const memoKeyOf: (app: NiscApp, principal: string | null) => string;
|
|
725
|
+
declare const resolvePolicy: (app: NiscApp, grants: readonly string[], principal: string | null) => ScopePolicy;
|
|
726
|
+
declare const resolvePolicyForRoles: (app: NiscApp, grants: readonly string[], roles: readonly string[]) => ScopePolicy;
|
|
727
|
+
declare const resolvePolicyAtReach: (app: NiscApp, grants: readonly string[], principal: string | null, reach: string) => ScopePolicy;
|
|
728
|
+
type Catalog = {
|
|
729
|
+
ids: readonly string[];
|
|
730
|
+
hash: string;
|
|
731
|
+
};
|
|
732
|
+
declare const resolveCatalogForRoles: (app: NiscApp, roles: readonly string[], installed: readonly string[] | undefined) => Catalog;
|
|
733
|
+
declare const resolveVariantsForRoles: (app: NiscApp, roles: readonly string[]) => ReadonlyMap<string, LayoutNode>;
|
|
734
|
+
declare const resolveCatalog: (app: NiscApp, principal: string | null) => Catalog;
|
|
735
|
+
declare const resolveVariants: (app: NiscApp, principal: string | null) => ReadonlyMap<string, LayoutNode>;
|
|
736
|
+
declare const verifyVariants: (app: NiscApp) => string[];
|
|
737
|
+
|
|
738
|
+
/** A run copied from the base frame: offset, length. */
|
|
739
|
+
type Copy = [0, number, number];
|
|
740
|
+
/** Bytes that are not in the base at all. */
|
|
741
|
+
type Insert = [1, string];
|
|
742
|
+
type DeltaOp = Copy | Insert;
|
|
743
|
+
|
|
744
|
+
type ShellNeed = {
|
|
745
|
+
live: boolean;
|
|
746
|
+
why: string[];
|
|
747
|
+
drawnWith: string[];
|
|
748
|
+
};
|
|
749
|
+
declare const shellNeedOf: (definition: ActionDefinition, entries: ReadonlyMap<string, SeedEntry | SeedMutation>) => ShellNeed;
|
|
750
|
+
|
|
751
|
+
type ShellPrincipal = {
|
|
752
|
+
roles: readonly string[];
|
|
753
|
+
scope: Record<string, unknown>;
|
|
754
|
+
installed: readonly string[] | undefined;
|
|
755
|
+
catalog: Catalog;
|
|
756
|
+
variants: ReadonlyMap<string, LayoutNode>;
|
|
757
|
+
policy: ScopePolicy;
|
|
758
|
+
};
|
|
759
|
+
type ShellHostContext = {
|
|
760
|
+
app: NiscApp;
|
|
761
|
+
manifest?: ShellManifest;
|
|
762
|
+
kept?: boolean;
|
|
763
|
+
needOf?: (definition: ActionDefinition) => ShellNeed;
|
|
764
|
+
resolve: (principal: string | null) => Promise<ShellPrincipal>;
|
|
765
|
+
catalogFor: (roles: readonly string[], installed: readonly string[] | undefined) => Catalog;
|
|
766
|
+
variantsFor: (roles: readonly string[]) => ReadonlyMap<string, LayoutNode>;
|
|
767
|
+
wire: (token: string | null) => FetchFn;
|
|
768
|
+
runtime: NiscRuntime;
|
|
769
|
+
idleMs?: number;
|
|
770
|
+
delta?: boolean;
|
|
771
|
+
};
|
|
772
|
+
type ShellSession = {
|
|
773
|
+
readonly shell: Shell;
|
|
774
|
+
attach: (connection: Connection, options?: {
|
|
775
|
+
delta?: boolean;
|
|
776
|
+
}) => void;
|
|
777
|
+
detach: (connection: Connection) => void;
|
|
778
|
+
resync: (connection: Connection) => void;
|
|
779
|
+
dispatch: (canvas: string, event: Record<string, unknown>) => void;
|
|
780
|
+
publish: (channel: string, payload?: unknown) => void;
|
|
781
|
+
back: () => boolean;
|
|
782
|
+
popTo: (canvas: string, instance: string) => void;
|
|
783
|
+
reset: () => void;
|
|
784
|
+
};
|
|
785
|
+
type ShellReport = {
|
|
786
|
+
principal: string;
|
|
787
|
+
connections: number;
|
|
788
|
+
since: number;
|
|
789
|
+
idleSince: number | null;
|
|
790
|
+
canvases: {
|
|
791
|
+
id: string;
|
|
792
|
+
actions: readonly string[];
|
|
793
|
+
}[];
|
|
794
|
+
};
|
|
795
|
+
type ShellSnapshot = {
|
|
796
|
+
frame: RenderNode[];
|
|
797
|
+
trees: Record<string, RenderNode[]>;
|
|
798
|
+
seed?: string;
|
|
799
|
+
settled: boolean;
|
|
800
|
+
live: boolean;
|
|
801
|
+
why: string[];
|
|
802
|
+
drawnWith: string[];
|
|
803
|
+
};
|
|
804
|
+
type ShellOpening = {
|
|
805
|
+
seed?: string;
|
|
806
|
+
inputs?: Record<string, Record<string, unknown>>;
|
|
807
|
+
};
|
|
808
|
+
type ShellHost = {
|
|
809
|
+
session: (token: string | null, principal: string | null, options?: ShellOpening) => Promise<ShellSession>;
|
|
810
|
+
snapshot: (token: string | null, principal: string | null, options?: {
|
|
811
|
+
waitMs?: number;
|
|
812
|
+
inputs?: ShellOpening['inputs'];
|
|
813
|
+
}) => Promise<ShellSnapshot>;
|
|
814
|
+
adopt: () => void;
|
|
815
|
+
deliver: (principal: string, channel: string, payload?: unknown) => boolean;
|
|
816
|
+
list: () => ShellReport[];
|
|
817
|
+
reset: (principal: string) => boolean;
|
|
818
|
+
stop: () => void;
|
|
819
|
+
};
|
|
820
|
+
declare const DEFAULT_IDLE_MS: number;
|
|
821
|
+
declare const createShellHost: (ctx: ShellHostContext) => ShellHost;
|
|
822
|
+
|
|
823
|
+
type Connection = {
|
|
824
|
+
send: (text: string) => void;
|
|
825
|
+
close: (code?: number, reason?: string) => void;
|
|
826
|
+
onMessage: (fn: (text: string) => void) => void;
|
|
827
|
+
onClose: (fn: () => void) => void;
|
|
828
|
+
};
|
|
829
|
+
type ServerMessage = {
|
|
830
|
+
type: 'hello';
|
|
831
|
+
protocol: number;
|
|
832
|
+
principal: string | null;
|
|
833
|
+
catalog: {
|
|
834
|
+
actions: readonly string[];
|
|
835
|
+
hash: string;
|
|
836
|
+
};
|
|
837
|
+
} | {
|
|
838
|
+
type: 'catalog';
|
|
839
|
+
actions: readonly string[];
|
|
840
|
+
hash: string;
|
|
841
|
+
} | {
|
|
842
|
+
type: 'frame';
|
|
843
|
+
tree: RenderNode[];
|
|
844
|
+
} | {
|
|
845
|
+
type: 'render';
|
|
846
|
+
canvas: string;
|
|
847
|
+
tree: RenderNode[];
|
|
848
|
+
} | {
|
|
849
|
+
type: 'render-delta';
|
|
850
|
+
canvas: string;
|
|
851
|
+
ops: DeltaOp[];
|
|
852
|
+
hash: number;
|
|
853
|
+
} | {
|
|
854
|
+
type: 'session';
|
|
855
|
+
token: string;
|
|
856
|
+
} | {
|
|
857
|
+
type: 'error';
|
|
858
|
+
code: string;
|
|
859
|
+
message: string;
|
|
860
|
+
canvas?: string;
|
|
861
|
+
};
|
|
862
|
+
type ClientMessage = {
|
|
863
|
+
type: 'event';
|
|
864
|
+
canvas: string;
|
|
865
|
+
event: Record<string, unknown>;
|
|
866
|
+
} | {
|
|
867
|
+
type: 'publish';
|
|
868
|
+
channel: string;
|
|
869
|
+
payload?: unknown;
|
|
870
|
+
} | {
|
|
871
|
+
type: 'resync';
|
|
872
|
+
} | {
|
|
873
|
+
type: 'back';
|
|
874
|
+
} | {
|
|
875
|
+
type: 'popTo';
|
|
876
|
+
canvas: string;
|
|
877
|
+
instance: string;
|
|
878
|
+
} | {
|
|
879
|
+
type: 'reset';
|
|
880
|
+
};
|
|
881
|
+
declare const CLOSE_INVALID_TOKEN = 4401;
|
|
882
|
+
declare const CLOSE_SIGNED_OUT = 4403;
|
|
883
|
+
declare const CLOSE_SHELL_FAILED = 4500;
|
|
884
|
+
type SocketContext = {
|
|
885
|
+
session: (token: string) => string | null | Promise<string | null>;
|
|
886
|
+
catalog: (principal: string | null) => Catalog | Promise<Catalog>;
|
|
887
|
+
shells?: ShellHost;
|
|
888
|
+
page?: (path: string) => {
|
|
889
|
+
host: ShellHost;
|
|
890
|
+
inputs: Record<string, Record<string, unknown>>;
|
|
891
|
+
} | undefined;
|
|
892
|
+
revalidateMs?: number;
|
|
893
|
+
telemetry?: Telemetry;
|
|
894
|
+
};
|
|
895
|
+
declare const DEFAULT_REVALIDATE_MS: number;
|
|
896
|
+
type SocketAccept = ((url: string, connection: Connection) => Promise<void>) & {
|
|
897
|
+
stop: () => void;
|
|
898
|
+
};
|
|
899
|
+
declare const createSocket: (ctx: SocketContext) => SocketAccept;
|
|
900
|
+
|
|
901
|
+
type Resolved = {
|
|
902
|
+
roles: readonly string[];
|
|
903
|
+
scope: Record<string, unknown>;
|
|
904
|
+
installed: readonly string[] | undefined;
|
|
905
|
+
key: string;
|
|
906
|
+
record?: IdentityRecord;
|
|
907
|
+
};
|
|
908
|
+
type ExecuteAs = (role: string, fingerprint: string, context: Record<string, unknown>, scope?: Record<string, unknown>) => Promise<unknown>;
|
|
909
|
+
type Env = {
|
|
910
|
+
Variables: {
|
|
911
|
+
principal: string | null;
|
|
912
|
+
resolved: Resolved;
|
|
913
|
+
};
|
|
914
|
+
};
|
|
915
|
+
type MossServer = Hono<Env> & {
|
|
916
|
+
socket: SocketAccept;
|
|
917
|
+
shells?: ShellHost;
|
|
918
|
+
principalOf: (token: string) => Promise<string | null>;
|
|
919
|
+
page: (path: string) => {
|
|
920
|
+
name: string;
|
|
921
|
+
host: ShellHost;
|
|
922
|
+
inputs: Record<string, Record<string, unknown>>;
|
|
923
|
+
} | undefined;
|
|
924
|
+
pages: readonly {
|
|
925
|
+
name: string;
|
|
926
|
+
path: string;
|
|
927
|
+
}[];
|
|
928
|
+
refresh: () => void;
|
|
929
|
+
invalidateIdentity: (principal: string) => boolean;
|
|
930
|
+
identity: (principal: string | null) => Promise<IdentityRecord>;
|
|
931
|
+
executeAs: ExecuteAs;
|
|
932
|
+
callIntegration: CallIntegration;
|
|
933
|
+
invalidateTenant: (tag: string) => number;
|
|
934
|
+
nudge: (principal: string, channel: string) => void;
|
|
935
|
+
generation: () => number;
|
|
936
|
+
close: () => void;
|
|
937
|
+
identities?: {
|
|
938
|
+
list: () => IdentityReport[];
|
|
939
|
+
meter: () => {
|
|
940
|
+
size: number;
|
|
941
|
+
max: number;
|
|
942
|
+
resolved: number;
|
|
943
|
+
evicted: number;
|
|
944
|
+
expired: number;
|
|
945
|
+
};
|
|
946
|
+
};
|
|
947
|
+
};
|
|
948
|
+
declare const createServer: (app: NiscApp, runtime: NiscRuntime) => Promise<MossServer>;
|
|
949
|
+
|
|
950
|
+
declare const SNAPSHOT_ELEMENT_ID = "nisc-snapshot";
|
|
951
|
+
declare const tokenFromCookie: (header: string | null | undefined, tokenKey?: string) => string | null;
|
|
952
|
+
declare const embedSnapshot: (snapshot: ShellSnapshot, principal: string | null, path?: string) => string;
|
|
953
|
+
declare const documentHeaders: (principal: string | null) => Record<string, string>;
|
|
954
|
+
type DocumentConfig = {
|
|
955
|
+
server: MossServer;
|
|
956
|
+
template: string;
|
|
957
|
+
request: {
|
|
958
|
+
path: string;
|
|
959
|
+
cookie?: string | null;
|
|
960
|
+
};
|
|
961
|
+
draw: (snapshot: ShellSnapshot) => string | Promise<string>;
|
|
962
|
+
htmlAttributes?: (snapshot: ShellSnapshot) => Record<string, string>;
|
|
963
|
+
tokenKey?: string;
|
|
964
|
+
waitMs?: number;
|
|
965
|
+
root?: string;
|
|
966
|
+
};
|
|
967
|
+
type DrawnDocument = {
|
|
968
|
+
html: string;
|
|
969
|
+
headers: Record<string, string>;
|
|
970
|
+
drawn: boolean;
|
|
971
|
+
principal: string | null;
|
|
972
|
+
page?: string;
|
|
973
|
+
live?: boolean;
|
|
974
|
+
why?: string[];
|
|
975
|
+
drawnWith?: string[];
|
|
976
|
+
settled?: boolean;
|
|
977
|
+
};
|
|
978
|
+
declare const renderDocument: (config: DocumentConfig) => Promise<DrawnDocument>;
|
|
979
|
+
type ExportedDocument = {
|
|
980
|
+
path: string;
|
|
981
|
+
html: string;
|
|
982
|
+
page?: string;
|
|
983
|
+
drawn: boolean;
|
|
984
|
+
live: boolean;
|
|
985
|
+
why: string[];
|
|
986
|
+
drawnWith: string[];
|
|
987
|
+
settled: boolean;
|
|
988
|
+
};
|
|
989
|
+
declare const exportDocuments: (config: Omit<DocumentConfig, "request"> & {
|
|
990
|
+
paths: readonly string[];
|
|
991
|
+
}) => Promise<ExportedDocument[]>;
|
|
992
|
+
|
|
993
|
+
export { type SpanClock as $, type NiscApp 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, type PressResult as G, type RunSink as H, type IdentityCache as I, type RunTurn as J, SNAPSHOT_ELEMENT_ID as K, type LayoutVariant as L, MOSS_SEQUENCE as M, type NiscRuntime as N, type ServerMessage as O, type PageManifest as P, type ShellHost as Q, type RunRecord as R, type SessionVerifier as S, type ShellManifest as T, type ShellNeed as U, type ShellOpening as V, type ShellReport as W, type ShellSession as X, type ShellSnapshot as Y, type SocketAccept as Z, type SocketContext as _, CLOSE_SHELL_FAILED as a, type StorePress as a0, type Telemetry as a1, type TelemetrySpan as a2, buildContract as a3, callIntegrationWith as a4, contractAsMarkdown as a5, copyPress as a6, createIdentityCache as a7, createServer as a8, createShellHost as a9, resolveVariantsForRoles as aA, runIntake as aB, shellNeedOf as aC, spanClock as aD, tokenFromCookie as aE, verifyVariants as aF, wearableOf as aG, wireFabric as aH, createSocket as aa, defineApp as ab, describePlacements as ac, devSession as ad, documentHeaders as ae, embedSnapshot as af, emitterOf as ag, exportDocuments as ah, filterInstalled as ai, initIntegrations as aj, integrationByKey as ak, integrationOfAction as al, listAttachments as am, listIntegrations as an, listPlacements as ao, loadIntegrationActions as ap, memoKeyOf as aq, mintDevToken as ar, renderDocument as as, resolveCatalog as at, resolveCatalogForRoles as au, resolvePolicy as av, resolvePolicyAtReach as aw, resolvePolicyForRoles as ax, resolveRoles as ay, resolveVariants as az, CLOSE_SIGNED_OUT as b, type CallIntegration as c, type Catalog as d, type ClientMessage as e, type Connection as f, type Contract as g, DEFAULT_IDENTITY_MAX as h, DEFAULT_IDLE_MS as i, DEFAULT_REVALIDATE_MS as j, type DocumentConfig as k, type DrawnDocument as l, type ExecuteAs as m, type ExportedDocument as n, type FabricApply as o, type FabricMessage as p, type FabricSignal as q, type FactIntake as r, type FunctionSession as s, type IdentityCacheContext as t, type IdentityRecord as u, type IdentityReport as v, type IntakeContext as w, type IntakeResult as x, type IntegrationRow as y, type MossServer as z };
|