@ultrst-armada/kloks 1.4.2 → 1.4.4
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/package.json +8 -20
- package/packages/audio-midi/dist/index.d.ts +23 -14
- package/packages/audio-midi/dist/index.js +170 -45
- package/packages/audio-midi/kloks.manifest.json +8 -8
- package/packages/audio-midi/package.json +1 -1
- package/packages/backend/dist/{WebSocketTransport-CxUzUfwl.d.ts → WebSocketTransport-CHmkJ0tj.d.ts} +109 -2
- package/packages/backend/dist/auth/index.js +6 -6
- package/packages/backend/dist/chunk-5336MTXD.js +597 -0
- package/packages/backend/dist/{chunk-T3NYNBDC.js → chunk-5E6JRFUH.js} +201 -3
- package/packages/backend/dist/{chunk-XTWHEZWS.js → chunk-7B24ZWB3.js} +16 -1
- package/packages/backend/dist/{chunk-DZ4ZGIZM.js → chunk-JXUSBKJ2.js} +91 -654
- package/packages/backend/dist/{chunk-FO6WYLW4.js → chunk-KI3LHMUN.js} +133 -46
- package/packages/backend/dist/{chunk-4ZFXEFOE.js → chunk-MPYASJ5A.js} +2 -87
- package/packages/backend/dist/{chunk-KX3OTBQ3.js → chunk-OZDYAEH4.js} +0 -114
- package/packages/backend/dist/chunk-TY32TUNI.js +376 -0
- package/packages/backend/dist/chunk-VDROUXFT.js +116 -0
- package/packages/backend/dist/chunk-ZDH4XI7W.js +140 -0
- package/packages/backend/dist/client/index.d.ts +2 -3
- package/packages/backend/dist/connectivity/index.d.ts +18 -6
- package/packages/backend/dist/connectivity/index.js +3 -7
- package/packages/backend/dist/index.d.ts +3 -6
- package/packages/backend/dist/index.js +101 -91
- package/packages/backend/dist/krnl-services.d.ts +84 -7
- package/packages/backend/dist/krnl-services.js +40 -12
- package/packages/backend/dist/services/index.d.ts +4 -6
- package/packages/backend/dist/services/index.js +2 -2
- package/packages/backend/dist/srkl/index.js +6 -4
- package/packages/backend/dist/storage/index.js +7 -7
- package/packages/backend/dist/workspace/index.js +2 -2
- package/packages/backend/kloks.manifest.json +47 -45
- package/packages/backend/package.json +3 -8
- package/packages/client/package.json +1 -1
- package/packages/contracts/dist/index.js +5 -10
- package/packages/contracts/package.json +1 -1
- package/packages/functions/dist/index.d.ts +12 -1
- package/packages/functions/dist/index.js +132 -24
- package/packages/functions/package.json +1 -1
- package/packages/orchestrations/dist/index.d.ts +33 -31
- package/packages/orchestrations/dist/index.js +81 -203
- package/packages/orchestrations/kloks.manifest.json +10 -2
- package/packages/orchestrations/package.json +2 -2
- package/packages/services/dist/index.d.ts +51 -1
- package/packages/services/dist/index.js +249 -51
- package/packages/services/kloks.manifest.json +69 -33
- package/packages/services/package.json +1 -1
- package/packages/state-graph/dist/{BaseGraph-BvkSYOTw.d.ts → BaseGraph-Bd5F1NMP.d.ts} +1 -1
- package/packages/state-graph/dist/{BaseNode-DTcd3K1B.d.ts → BaseNode-DKpGXMy8.d.ts} +6 -0
- package/packages/state-graph/dist/{CompatibilityMatrix-Dj-tCWUA.d.ts → CompatibilityMatrix-TiEJ3j3_.d.ts} +1 -1
- package/packages/state-graph/dist/domain/index.d.ts +3 -3
- package/packages/state-graph/dist/domain/index.js +0 -1
- package/packages/state-graph/dist/index.d.ts +40 -8
- package/packages/state-graph/dist/index.js +193 -44
- package/packages/state-graph/dist/rules/index.d.ts +3 -3
- package/packages/state-graph/dist/rules/index.js +0 -1
- package/packages/state-graph/dist/spatial/index.d.ts +4 -4
- package/packages/state-graph/dist/spatial/index.js +0 -1
- package/packages/state-graph/dist/state/index.js +1 -3
- package/packages/state-graph/dist/store/index.d.ts +4 -4
- package/packages/state-graph/dist/store/index.js +0 -1
- package/packages/state-graph/dist/{types-VDoc4FIc.d.ts → types-D5kQSa65.d.ts} +2 -2
- package/packages/state-graph/kloks.manifest.json +26 -10
- package/packages/state-graph/package.json +2 -8
- package/packages/backend/dist/IdempotencyManager-B5MjK871.d.ts +0 -16
- package/packages/backend/dist/chunk-25Y7AVTP.js +0 -55
- package/packages/backend/dist/chunk-3EPY34R6.js +0 -67
- package/packages/backend/dist/chunk-7KNGX522.js +0 -220
- package/packages/backend/dist/chunk-FZKBTF34.js +0 -15
- package/packages/backend/dist/chunk-QGHDJGYS.js +0 -92
- package/packages/backend/dist/chunk-UPFKBBQI.js +0 -138
- package/packages/backend/dist/chunk-VQEFULWT.js +0 -88
- package/packages/backend/dist/execution/index.d.ts +0 -124
- package/packages/backend/dist/execution/index.js +0 -20
- package/packages/backend/dist/types-BERZJ93O.d.ts +0 -110
- package/packages/state-graph/dist/chunk-3RG5ZIWI.js +0 -10
- package/packages/state-graph/dist/chunk-Q5I42UX7.js +0 -0
- package/packages/state-graph/dist/chunk-ZTHBPV24.js +0 -267
- package/packages/state-graph/dist/execution/index.d.ts +0 -152
- package/packages/state-graph/dist/execution/index.js +0 -16
- /package/packages/state-graph/dist/{chunk-SHIBCPGQ.js → chunk-EW4ACSZB.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/@ultrst-armada+krnl@1.0.
|
|
1
|
+
// ../../node_modules/.pnpm/@ultrst-armada+krnl@1.0.3/node_modules/@ultrst-armada/krnl/packages/core/dist/index.js
|
|
2
2
|
import http from "http";
|
|
3
3
|
var ServiceStateStore = class {
|
|
4
4
|
state;
|
|
@@ -53,17 +53,37 @@ var ServiceEventBus = class {
|
|
|
53
53
|
this.handlers.clear();
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
+
var TRANSITIONS = {
|
|
57
|
+
uninitialized: ["initializing"],
|
|
58
|
+
initializing: ["ready", "uninitialized"],
|
|
59
|
+
ready: ["starting"],
|
|
60
|
+
starting: ["running", "ready"],
|
|
61
|
+
running: ["stopping"],
|
|
62
|
+
stopping: ["stopped", "running"],
|
|
63
|
+
stopped: ["starting"]
|
|
64
|
+
};
|
|
56
65
|
var LifecycleManager = class {
|
|
57
66
|
status = "uninitialized";
|
|
58
67
|
getStatus() {
|
|
59
68
|
return this.status;
|
|
60
69
|
}
|
|
61
|
-
|
|
70
|
+
canTransitionTo(next) {
|
|
71
|
+
return TRANSITIONS[this.status].includes(next);
|
|
72
|
+
}
|
|
73
|
+
transitionTo(next) {
|
|
74
|
+
if (!this.canTransitionTo(next)) {
|
|
75
|
+
throw new Error("[Lifecycle] Invalid transition '" + this.status + "' -> '" + next + "'.");
|
|
76
|
+
}
|
|
62
77
|
this.status = next;
|
|
63
78
|
}
|
|
79
|
+
setStatus(next) {
|
|
80
|
+
this.transitionTo(next);
|
|
81
|
+
}
|
|
64
82
|
assertRunning(serviceName) {
|
|
65
83
|
if (this.status !== "running") {
|
|
66
|
-
throw new Error(
|
|
84
|
+
throw new Error(
|
|
85
|
+
"[Service:" + serviceName + "] Cannot invoke operation while status is '" + this.status + "' (expected 'running')."
|
|
86
|
+
);
|
|
67
87
|
}
|
|
68
88
|
}
|
|
69
89
|
};
|
|
@@ -75,7 +95,7 @@ var ServiceInstance = class {
|
|
|
75
95
|
this.version = definition.version;
|
|
76
96
|
this.lifecycle = new LifecycleManager();
|
|
77
97
|
this.eventBus = new ServiceEventBus();
|
|
78
|
-
if (definition.state
|
|
98
|
+
if (definition.state) {
|
|
79
99
|
this.stateStore = new ServiceStateStore(definition.state.initial);
|
|
80
100
|
}
|
|
81
101
|
}
|
|
@@ -86,46 +106,76 @@ var ServiceInstance = class {
|
|
|
86
106
|
stateStore;
|
|
87
107
|
eventBus;
|
|
88
108
|
lifecycle;
|
|
109
|
+
initialized = false;
|
|
110
|
+
disposed = false;
|
|
89
111
|
getDefinition() {
|
|
90
112
|
return this.definition;
|
|
91
113
|
}
|
|
114
|
+
getStatus() {
|
|
115
|
+
return this.lifecycle.getStatus();
|
|
116
|
+
}
|
|
92
117
|
async start() {
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
|
|
118
|
+
if (this.disposed) throw new Error("[Service:" + this.name + "] Cannot start a disposed service.");
|
|
119
|
+
const current = this.lifecycle.getStatus();
|
|
120
|
+
if (current === "running") return;
|
|
121
|
+
if (current === "initializing" || current === "starting" || current === "stopping") {
|
|
122
|
+
throw new Error("[Service:" + this.name + "] Cannot start while status is '" + current + "'.");
|
|
123
|
+
}
|
|
124
|
+
if (!this.initialized) {
|
|
125
|
+
this.lifecycle.transitionTo("initializing");
|
|
126
|
+
try {
|
|
127
|
+
await this.definition.lifecycle?.onInit?.();
|
|
128
|
+
this.initialized = true;
|
|
129
|
+
this.lifecycle.transitionTo("ready");
|
|
130
|
+
} catch (error) {
|
|
131
|
+
this.lifecycle.transitionTo("uninitialized");
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
96
134
|
}
|
|
97
|
-
|
|
98
|
-
|
|
135
|
+
this.lifecycle.transitionTo("starting");
|
|
136
|
+
try {
|
|
137
|
+
await this.definition.lifecycle?.onStart?.();
|
|
138
|
+
this.lifecycle.transitionTo("running");
|
|
139
|
+
} catch (error) {
|
|
140
|
+
this.lifecycle.transitionTo("ready");
|
|
141
|
+
throw error;
|
|
99
142
|
}
|
|
100
|
-
this.lifecycle.setStatus("running");
|
|
101
143
|
}
|
|
102
144
|
async stop() {
|
|
103
|
-
this.lifecycle.
|
|
104
|
-
if (
|
|
105
|
-
|
|
145
|
+
const current = this.lifecycle.getStatus();
|
|
146
|
+
if (current === "stopped") return;
|
|
147
|
+
if (current !== "running") {
|
|
148
|
+
throw new Error("[Service:" + this.name + "] Cannot stop while status is '" + current + "'.");
|
|
106
149
|
}
|
|
107
|
-
|
|
108
|
-
|
|
150
|
+
this.lifecycle.transitionTo("stopping");
|
|
151
|
+
try {
|
|
152
|
+
await this.definition.lifecycle?.onStop?.();
|
|
153
|
+
this.lifecycle.transitionTo("stopped");
|
|
154
|
+
} catch (error) {
|
|
155
|
+
this.lifecycle.transitionTo("running");
|
|
156
|
+
throw error;
|
|
109
157
|
}
|
|
110
|
-
|
|
158
|
+
}
|
|
159
|
+
async dispose() {
|
|
160
|
+
if (this.disposed) return;
|
|
161
|
+
if (this.lifecycle.getStatus() === "running") await this.stop();
|
|
162
|
+
await this.definition.lifecycle?.onDispose?.();
|
|
163
|
+
this.disposed = true;
|
|
111
164
|
}
|
|
112
165
|
async call(op, input, ctx = {}) {
|
|
113
166
|
this.lifecycle.assertRunning(this.name);
|
|
114
167
|
const operation = this.definition.operations[op];
|
|
115
168
|
if (!operation) {
|
|
116
|
-
throw new Error(
|
|
169
|
+
throw new Error("[Service:" + this.name + "] Operation '" + op + "' not found.");
|
|
117
170
|
}
|
|
118
171
|
return await operation.handler(input, ctx);
|
|
119
172
|
}
|
|
120
173
|
getState() {
|
|
121
|
-
|
|
122
|
-
return Object.freeze({});
|
|
123
|
-
}
|
|
124
|
-
return this.stateStore.getState();
|
|
174
|
+
return this.stateStore?.getState() ?? Object.freeze({});
|
|
125
175
|
}
|
|
126
176
|
setState(mutation) {
|
|
127
177
|
if (!this.stateStore) {
|
|
128
|
-
this.stateStore = new ServiceStateStore(mutation);
|
|
178
|
+
this.stateStore = new ServiceStateStore({ ...mutation });
|
|
129
179
|
return;
|
|
130
180
|
}
|
|
131
181
|
this.stateStore.setState(mutation);
|
|
@@ -142,10 +192,19 @@ var ServiceProxy = class {
|
|
|
142
192
|
this.definition = definition;
|
|
143
193
|
this.adapter = adapter;
|
|
144
194
|
this.endpoint = endpoint;
|
|
195
|
+
if (!definition) {
|
|
196
|
+
throw new Error("[ServiceProxy] Missing service definition.");
|
|
197
|
+
}
|
|
198
|
+
if (!adapter || typeof adapter.send !== "function") {
|
|
199
|
+
throw new Error("[ServiceProxy:" + (definition.name || "unknown") + "] Missing or invalid protocol adapter.");
|
|
200
|
+
}
|
|
201
|
+
if (!endpoint || typeof endpoint.address !== "string" || endpoint.address.length === 0) {
|
|
202
|
+
throw new Error("[ServiceProxy:" + (definition.name || "unknown") + "] Missing or invalid endpoint descriptor.");
|
|
203
|
+
}
|
|
145
204
|
this.id = definition.id;
|
|
146
205
|
this.name = definition.name;
|
|
147
206
|
this.version = definition.version;
|
|
148
|
-
this.stateCache = definition.state?.initial
|
|
207
|
+
this.stateCache = { ...definition.state?.initial ?? {} };
|
|
149
208
|
}
|
|
150
209
|
definition;
|
|
151
210
|
adapter;
|
|
@@ -155,19 +214,56 @@ var ServiceProxy = class {
|
|
|
155
214
|
version;
|
|
156
215
|
stateCache;
|
|
157
216
|
eventHandlers = /* @__PURE__ */ new Map();
|
|
217
|
+
lifecycle = new LifecycleManager();
|
|
218
|
+
disposed = false;
|
|
158
219
|
getDefinition() {
|
|
159
220
|
return this.definition;
|
|
160
221
|
}
|
|
222
|
+
getStatus() {
|
|
223
|
+
return this.lifecycle.getStatus();
|
|
224
|
+
}
|
|
161
225
|
async start() {
|
|
226
|
+
if (this.disposed) {
|
|
227
|
+
throw new Error("[ServiceProxy:" + this.name + "] Cannot start a disposed service proxy.");
|
|
228
|
+
}
|
|
229
|
+
const status = this.lifecycle.getStatus();
|
|
230
|
+
if (status === "running") return;
|
|
231
|
+
if (status === "stopping" || status === "starting" || status === "initializing") {
|
|
232
|
+
throw new Error("[ServiceProxy:" + this.name + "] Cannot start while status is '" + status + "'.");
|
|
233
|
+
}
|
|
234
|
+
if (status === "uninitialized") {
|
|
235
|
+
this.lifecycle.transitionTo("initializing");
|
|
236
|
+
this.lifecycle.transitionTo("ready");
|
|
237
|
+
}
|
|
238
|
+
this.lifecycle.transitionTo("starting");
|
|
239
|
+
this.lifecycle.transitionTo("running");
|
|
162
240
|
}
|
|
163
241
|
async stop() {
|
|
242
|
+
const status = this.lifecycle.getStatus();
|
|
243
|
+
if (status === "stopped") return;
|
|
244
|
+
if (status !== "running") {
|
|
245
|
+
throw new Error("[ServiceProxy:" + this.name + "] Cannot stop while status is '" + status + "'.");
|
|
246
|
+
}
|
|
247
|
+
this.lifecycle.transitionTo("stopping");
|
|
248
|
+
this.lifecycle.transitionTo("stopped");
|
|
249
|
+
}
|
|
250
|
+
async dispose() {
|
|
251
|
+
if (this.disposed) return;
|
|
252
|
+
if (this.lifecycle.getStatus() === "running") await this.stop();
|
|
253
|
+
this.disposed = true;
|
|
164
254
|
}
|
|
165
255
|
async call(op, input, ctx = {}) {
|
|
256
|
+
if (!this.definition.operations[op]) {
|
|
257
|
+
throw new Error("[ServiceProxy:" + this.name + "] Operation '" + op + "' not found.");
|
|
258
|
+
}
|
|
259
|
+
if (this.lifecycle.getStatus() !== "running") {
|
|
260
|
+
await this.start();
|
|
261
|
+
}
|
|
166
262
|
if (!this.adapter.send) {
|
|
167
|
-
throw new Error(
|
|
263
|
+
throw new Error("[ServiceProxy:" + this.name + "] Adapter does not support send().");
|
|
168
264
|
}
|
|
169
265
|
const envelope = {
|
|
170
|
-
id:
|
|
266
|
+
id: "req-" + Date.now() + "-" + Math.random().toString(36).slice(2, 7),
|
|
171
267
|
type: "request",
|
|
172
268
|
operation: op,
|
|
173
269
|
payload: input,
|
|
@@ -175,7 +271,7 @@ var ServiceProxy = class {
|
|
|
175
271
|
};
|
|
176
272
|
const response = await this.adapter.send(this.endpoint, envelope);
|
|
177
273
|
if (response.error) {
|
|
178
|
-
throw new Error(
|
|
274
|
+
throw new Error("[ServiceProxy:" + this.name + "] Remote error: " + response.error);
|
|
179
275
|
}
|
|
180
276
|
return response.payload;
|
|
181
277
|
}
|
|
@@ -186,33 +282,93 @@ var ServiceProxy = class {
|
|
|
186
282
|
this.stateCache = { ...this.stateCache, ...mutation };
|
|
187
283
|
}
|
|
188
284
|
on(event, handler) {
|
|
189
|
-
if (!this.eventHandlers.has(event))
|
|
190
|
-
this.eventHandlers.set(event, /* @__PURE__ */ new Set());
|
|
191
|
-
}
|
|
285
|
+
if (!this.eventHandlers.has(event)) this.eventHandlers.set(event, /* @__PURE__ */ new Set());
|
|
192
286
|
const handlers = this.eventHandlers.get(event);
|
|
193
287
|
handlers.add(handler);
|
|
194
|
-
return () =>
|
|
195
|
-
handlers.delete(handler);
|
|
196
|
-
};
|
|
288
|
+
return () => handlers.delete(handler);
|
|
197
289
|
}
|
|
198
290
|
emit(event, payload) {
|
|
199
291
|
const handlers = this.eventHandlers.get(event);
|
|
200
|
-
if (handlers)
|
|
201
|
-
|
|
292
|
+
if (!handlers) return;
|
|
293
|
+
for (const handler of Array.from(handlers)) {
|
|
294
|
+
try {
|
|
202
295
|
handler(payload);
|
|
296
|
+
} catch (error) {
|
|
297
|
+
console.error("[ServiceProxy:" + this.name + "] Event handler error for '" + event + "':", error);
|
|
203
298
|
}
|
|
204
299
|
}
|
|
205
300
|
}
|
|
206
301
|
};
|
|
207
|
-
function
|
|
302
|
+
function assertRecord(value, field) {
|
|
303
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
304
|
+
throw new Error("[KrnlTS] Invalid service definition: '" + field + "' must be an object.");
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function assertNonEmptyString(value, field) {
|
|
308
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
309
|
+
throw new Error("[KrnlTS] Invalid service definition: '" + field + "' must be a non-empty string.");
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
function validateServiceDefinition(definition) {
|
|
313
|
+
if (!definition || typeof definition !== "object") {
|
|
314
|
+
throw new Error("[KrnlTS] Invalid service definition: expected an object.");
|
|
315
|
+
}
|
|
316
|
+
assertNonEmptyString(definition.id, "id");
|
|
317
|
+
assertNonEmptyString(definition.name, "name");
|
|
318
|
+
assertNonEmptyString(definition.version, "version");
|
|
319
|
+
if (!definition.operations || typeof definition.operations !== "object") {
|
|
320
|
+
throw new Error("[Service:" + definition.name + "] Invalid operations: expected an object.");
|
|
321
|
+
}
|
|
322
|
+
for (const [key, operation] of Object.entries(definition.operations)) {
|
|
323
|
+
if (!operation || typeof operation !== "object") {
|
|
324
|
+
throw new Error("[Service:" + definition.name + "] Invalid operation '" + key + "'.");
|
|
325
|
+
}
|
|
326
|
+
assertNonEmptyString(operation.id, "operations." + key + ".id");
|
|
327
|
+
assertNonEmptyString(operation.name, "operations." + key + ".name");
|
|
328
|
+
if (operation.inputSchema !== void 0) assertRecord(operation.inputSchema, "operations." + key + ".inputSchema");
|
|
329
|
+
if (operation.outputSchema !== void 0) assertRecord(operation.outputSchema, "operations." + key + ".outputSchema");
|
|
330
|
+
if (typeof operation.handler !== "function") {
|
|
331
|
+
throw new Error("[Service:" + definition.name + "] Operation '" + key + "' must define a handler.");
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
for (const [key, event] of Object.entries(definition.events ?? {})) {
|
|
335
|
+
if (!event || typeof event !== "object") {
|
|
336
|
+
throw new Error("[Service:" + definition.name + "] Invalid event '" + key + "'.");
|
|
337
|
+
}
|
|
338
|
+
assertNonEmptyString(event.name, "events." + key + ".name");
|
|
339
|
+
}
|
|
340
|
+
for (const [key, schema] of Object.entries(definition.inputs ?? {})) assertRecord(schema, "inputs." + key);
|
|
341
|
+
for (const [key, schema] of Object.entries(definition.outputs ?? {})) assertRecord(schema, "outputs." + key);
|
|
342
|
+
if (definition.state?.schema !== void 0) assertRecord(definition.state.schema, "state.schema");
|
|
343
|
+
for (const capability of definition.capabilities ?? []) {
|
|
344
|
+
assertNonEmptyString(capability.id, "capability.id");
|
|
345
|
+
assertNonEmptyString(capability.name, "capability.name");
|
|
346
|
+
if (!Array.isArray(capability.protocols)) {
|
|
347
|
+
throw new Error("[Service:" + definition.name + "] Capability '" + capability.name + "' protocols must be an array.");
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
for (const dependency of definition.dependencies ?? []) {
|
|
351
|
+
assertNonEmptyString(dependency.serviceId, "dependency.serviceId");
|
|
352
|
+
}
|
|
208
353
|
return definition;
|
|
209
354
|
}
|
|
355
|
+
function createServiceDefinition(definition) {
|
|
356
|
+
return validateServiceDefinition(definition);
|
|
357
|
+
}
|
|
210
358
|
function createService(definition) {
|
|
211
|
-
return new ServiceInstance(definition);
|
|
359
|
+
return new ServiceInstance(validateServiceDefinition(definition));
|
|
212
360
|
}
|
|
213
361
|
function createServiceProxy(definition, adapter, endpoint) {
|
|
362
|
+
validateServiceDefinition(definition);
|
|
363
|
+
if (!adapter || typeof adapter.send !== "function") {
|
|
364
|
+
throw new Error("[ServiceProxy:" + definition.name + "] Adapter must implement send().");
|
|
365
|
+
}
|
|
366
|
+
if (!endpoint || typeof endpoint.address !== "string" || endpoint.address.length === 0) {
|
|
367
|
+
throw new Error("[ServiceProxy:" + definition.name + "] Endpoint must have an address.");
|
|
368
|
+
}
|
|
214
369
|
return new ServiceProxy(definition, adapter, endpoint);
|
|
215
370
|
}
|
|
371
|
+
var asyncHooks = globalThis.process?.getBuiltinModule?.("node:async_hooks");
|
|
216
372
|
var HttpProtocolAdapter = class {
|
|
217
373
|
protocol = "http";
|
|
218
374
|
capabilities = {
|
|
@@ -760,7 +916,7 @@ var AuthServiceUISchema = {
|
|
|
760
916
|
description: "Login and registration section backed by canonical FLOKS AuthPage",
|
|
761
917
|
assetRef: {
|
|
762
918
|
packageId: "@ultrst-armada/floks",
|
|
763
|
-
packageVersion: "^1.2.
|
|
919
|
+
packageVersion: "^1.2.4",
|
|
764
920
|
exportPath: "ui",
|
|
765
921
|
assetId: "AuthPage",
|
|
766
922
|
assetVersion: "1.0.0"
|
|
@@ -770,7 +926,7 @@ var AuthServiceUISchema = {
|
|
|
770
926
|
name: "Auth.ui.LoginSection.AuthPage",
|
|
771
927
|
assetRef: {
|
|
772
928
|
packageId: "@ultrst-armada/floks",
|
|
773
|
-
packageVersion: "^1.2.
|
|
929
|
+
packageVersion: "^1.2.4",
|
|
774
930
|
exportPath: "ui",
|
|
775
931
|
assetId: "AuthPage",
|
|
776
932
|
assetVersion: "1.0.0"
|
|
@@ -780,7 +936,7 @@ var AuthServiceUISchema = {
|
|
|
780
936
|
name: "Auth.ui.LoginSection.LoginModal",
|
|
781
937
|
assetRef: {
|
|
782
938
|
packageId: "@ultrst-armada/floks",
|
|
783
|
-
packageVersion: "^1.2.
|
|
939
|
+
packageVersion: "^1.2.4",
|
|
784
940
|
exportPath: "ui",
|
|
785
941
|
assetId: "LoginModal",
|
|
786
942
|
assetVersion: "1.0.0"
|
|
@@ -796,7 +952,7 @@ var AuthServiceUISchema = {
|
|
|
796
952
|
name: "Auth.ui.LoginSection",
|
|
797
953
|
assetRef: {
|
|
798
954
|
packageId: "@ultrst-armada/floks",
|
|
799
|
-
packageVersion: "^1.2.
|
|
955
|
+
packageVersion: "^1.2.4",
|
|
800
956
|
exportPath: "ui",
|
|
801
957
|
assetId: "AuthPage",
|
|
802
958
|
assetVersion: "1.0.0"
|
|
@@ -806,7 +962,7 @@ var AuthServiceUISchema = {
|
|
|
806
962
|
name: "Auth.ui.LoginSection.AuthPage",
|
|
807
963
|
assetRef: {
|
|
808
964
|
packageId: "@ultrst-armada/floks",
|
|
809
|
-
packageVersion: "^1.2.
|
|
965
|
+
packageVersion: "^1.2.4",
|
|
810
966
|
exportPath: "ui",
|
|
811
967
|
assetId: "AuthPage",
|
|
812
968
|
assetVersion: "1.0.0"
|
|
@@ -820,7 +976,7 @@ var AuthServiceUISchema = {
|
|
|
820
976
|
name: "AuthPage",
|
|
821
977
|
assetRef: {
|
|
822
978
|
packageId: "@ultrst-armada/floks",
|
|
823
|
-
packageVersion: "^1.2.
|
|
979
|
+
packageVersion: "^1.2.4",
|
|
824
980
|
exportPath: "ui",
|
|
825
981
|
assetId: "AuthPage",
|
|
826
982
|
assetVersion: "1.0.0"
|
|
@@ -830,7 +986,7 @@ var AuthServiceUISchema = {
|
|
|
830
986
|
name: "LoginModal",
|
|
831
987
|
assetRef: {
|
|
832
988
|
packageId: "@ultrst-armada/floks",
|
|
833
|
-
packageVersion: "^1.2.
|
|
989
|
+
packageVersion: "^1.2.4",
|
|
834
990
|
exportPath: "ui",
|
|
835
991
|
assetId: "LoginModal",
|
|
836
992
|
assetVersion: "1.0.0"
|
|
@@ -840,14 +996,14 @@ var AuthServiceUISchema = {
|
|
|
840
996
|
assetRefs: [
|
|
841
997
|
{
|
|
842
998
|
packageId: "@ultrst-armada/floks",
|
|
843
|
-
packageVersion: "^1.2.
|
|
999
|
+
packageVersion: "^1.2.4",
|
|
844
1000
|
exportPath: "ui",
|
|
845
1001
|
assetId: "AuthPage",
|
|
846
1002
|
assetVersion: "1.0.0"
|
|
847
1003
|
},
|
|
848
1004
|
{
|
|
849
1005
|
packageId: "@ultrst-armada/floks",
|
|
850
|
-
packageVersion: "^1.2.
|
|
1006
|
+
packageVersion: "^1.2.4",
|
|
851
1007
|
exportPath: "ui",
|
|
852
1008
|
assetId: "LoginModal",
|
|
853
1009
|
assetVersion: "1.0.0"
|
|
@@ -1201,7 +1357,7 @@ var StorageServiceUISchema = {
|
|
|
1201
1357
|
description: "Workspace isolation and storage tiles menu",
|
|
1202
1358
|
assetRef: {
|
|
1203
1359
|
packageId: "@ultrst-armada/floks",
|
|
1204
|
-
packageVersion: "^1.2.
|
|
1360
|
+
packageVersion: "^1.2.4",
|
|
1205
1361
|
exportPath: "ui",
|
|
1206
1362
|
assetId: "WorkspaceTilesMenu",
|
|
1207
1363
|
assetVersion: "1.0.0"
|
|
@@ -1211,7 +1367,7 @@ var StorageServiceUISchema = {
|
|
|
1211
1367
|
name: "Storage.ui.TilesSection.WorkspaceTilesMenu",
|
|
1212
1368
|
assetRef: {
|
|
1213
1369
|
packageId: "@ultrst-armada/floks",
|
|
1214
|
-
packageVersion: "^1.2.
|
|
1370
|
+
packageVersion: "^1.2.4",
|
|
1215
1371
|
exportPath: "ui",
|
|
1216
1372
|
assetId: "WorkspaceTilesMenu",
|
|
1217
1373
|
assetVersion: "1.0.0"
|
|
@@ -1227,7 +1383,7 @@ var StorageServiceUISchema = {
|
|
|
1227
1383
|
name: "Storage.ui.TilesSection",
|
|
1228
1384
|
assetRef: {
|
|
1229
1385
|
packageId: "@ultrst-armada/floks",
|
|
1230
|
-
packageVersion: "^1.2.
|
|
1386
|
+
packageVersion: "^1.2.4",
|
|
1231
1387
|
exportPath: "ui",
|
|
1232
1388
|
assetId: "WorkspaceTilesMenu",
|
|
1233
1389
|
assetVersion: "1.0.0"
|
|
@@ -1237,7 +1393,7 @@ var StorageServiceUISchema = {
|
|
|
1237
1393
|
name: "Storage.ui.TilesSection.WorkspaceTilesMenu",
|
|
1238
1394
|
assetRef: {
|
|
1239
1395
|
packageId: "@ultrst-armada/floks",
|
|
1240
|
-
packageVersion: "^1.2.
|
|
1396
|
+
packageVersion: "^1.2.4",
|
|
1241
1397
|
exportPath: "ui",
|
|
1242
1398
|
assetId: "WorkspaceTilesMenu",
|
|
1243
1399
|
assetVersion: "1.0.0"
|
|
@@ -1251,7 +1407,7 @@ var StorageServiceUISchema = {
|
|
|
1251
1407
|
name: "WorkspaceTilesMenu",
|
|
1252
1408
|
assetRef: {
|
|
1253
1409
|
packageId: "@ultrst-armada/floks",
|
|
1254
|
-
packageVersion: "^1.2.
|
|
1410
|
+
packageVersion: "^1.2.4",
|
|
1255
1411
|
exportPath: "ui",
|
|
1256
1412
|
assetId: "WorkspaceTilesMenu",
|
|
1257
1413
|
assetVersion: "1.0.0"
|
|
@@ -1261,7 +1417,7 @@ var StorageServiceUISchema = {
|
|
|
1261
1417
|
assetRefs: [
|
|
1262
1418
|
{
|
|
1263
1419
|
packageId: "@ultrst-armada/floks",
|
|
1264
|
-
packageVersion: "^1.2.
|
|
1420
|
+
packageVersion: "^1.2.4",
|
|
1265
1421
|
exportPath: "ui",
|
|
1266
1422
|
assetId: "WorkspaceTilesMenu",
|
|
1267
1423
|
assetVersion: "1.0.0"
|
|
@@ -1585,6 +1741,12 @@ var SystemDbClientServiceFacade = {
|
|
|
1585
1741
|
return systemDbClientInstance.call(op, input);
|
|
1586
1742
|
}
|
|
1587
1743
|
};
|
|
1744
|
+
var krnlAuthClientServiceDefinition = AuthClientServiceDefinition;
|
|
1745
|
+
var krnlAuthClientServiceFacade = AuthClientServiceFacade;
|
|
1746
|
+
var krnlStorageClientServiceDefinition = StorageClientServiceDefinition;
|
|
1747
|
+
var krnlStorageClientServiceFacade = StorageClientServiceFacade;
|
|
1748
|
+
var krnlSystemDbClientServiceDefinition = SystemDbClientServiceDefinition;
|
|
1749
|
+
var krnlSystemDbClientServiceFacade = SystemDbClientServiceFacade;
|
|
1588
1750
|
|
|
1589
1751
|
// src/index.ts
|
|
1590
1752
|
var ServiceADefinition = createServiceDefinition({
|
|
@@ -1747,6 +1909,14 @@ var ServiceDDefinition = createServiceDefinition({
|
|
|
1747
1909
|
protocol: ctx.protocol ?? "memory",
|
|
1748
1910
|
timestamp: Date.now()
|
|
1749
1911
|
})
|
|
1912
|
+
},
|
|
1913
|
+
uppercase: {
|
|
1914
|
+
id: "ServiceD.uppercase",
|
|
1915
|
+
name: "uppercase",
|
|
1916
|
+
protocols: ["http", "ws", "udp", "p2p"],
|
|
1917
|
+
handler: async (input) => ({
|
|
1918
|
+
result: (typeof input === "string" ? input : input?.text ?? "").toUpperCase()
|
|
1919
|
+
})
|
|
1750
1920
|
}
|
|
1751
1921
|
}
|
|
1752
1922
|
});
|
|
@@ -1785,6 +1955,17 @@ var ServiceDFacade = {
|
|
|
1785
1955
|
return defaultServiceD.call(op, input);
|
|
1786
1956
|
}
|
|
1787
1957
|
};
|
|
1958
|
+
var krnlServiceADefinition = ServiceADefinition;
|
|
1959
|
+
var krnlServiceAFacade = ServiceAFacade;
|
|
1960
|
+
var krnlServiceBDefinition = ServiceBDefinition;
|
|
1961
|
+
var krnlServiceBFacade = ServiceBFacade;
|
|
1962
|
+
var krnlCreateServiceB = createServiceB;
|
|
1963
|
+
var krnlServiceCDefinition = ServiceCDefinition;
|
|
1964
|
+
var krnlServiceCFacade = ServiceCFacade;
|
|
1965
|
+
var krnlCreateServiceC = createServiceC;
|
|
1966
|
+
var krnlServiceDDefinition = ServiceDDefinition;
|
|
1967
|
+
var krnlServiceDFacade = ServiceDFacade;
|
|
1968
|
+
var krnlExposeServiceD = exposeServiceD;
|
|
1788
1969
|
export {
|
|
1789
1970
|
AuthClientServiceDefinition,
|
|
1790
1971
|
AuthClientServiceFacade,
|
|
@@ -1817,6 +1998,23 @@ export {
|
|
|
1817
1998
|
deleteWorkspace,
|
|
1818
1999
|
exposeServiceD,
|
|
1819
2000
|
fetchWorkspaces,
|
|
2001
|
+
krnlAuthClientServiceDefinition,
|
|
2002
|
+
krnlAuthClientServiceFacade,
|
|
2003
|
+
krnlCreateServiceB,
|
|
2004
|
+
krnlCreateServiceC,
|
|
2005
|
+
krnlExposeServiceD,
|
|
2006
|
+
krnlServiceADefinition,
|
|
2007
|
+
krnlServiceAFacade,
|
|
2008
|
+
krnlServiceBDefinition,
|
|
2009
|
+
krnlServiceBFacade,
|
|
2010
|
+
krnlServiceCDefinition,
|
|
2011
|
+
krnlServiceCFacade,
|
|
2012
|
+
krnlServiceDDefinition,
|
|
2013
|
+
krnlServiceDFacade,
|
|
2014
|
+
krnlStorageClientServiceDefinition,
|
|
2015
|
+
krnlStorageClientServiceFacade,
|
|
2016
|
+
krnlSystemDbClientServiceDefinition,
|
|
2017
|
+
krnlSystemDbClientServiceFacade,
|
|
1820
2018
|
loadDatabase,
|
|
1821
2019
|
loginAdmin,
|
|
1822
2020
|
loginUser,
|