@lssm/example.agent-console 0.0.0-canary-20251221165922 → 0.0.0-canary-20251221185840
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/.turbo/turbo-build$colon$bundle.log +27 -22
- package/.turbo/turbo-build.log +39 -34
- package/CHANGELOG.md +6 -6
- package/dist/agent/agent.entity.d.ts +36 -36
- package/dist/agent/agent.entity.d.ts.map +1 -1
- package/dist/agent/agent.enum.d.ts +4 -4
- package/dist/agent/agent.enum.d.ts.map +1 -1
- package/dist/agent/agent.event.d.ts +30 -30
- package/dist/agent/agent.event.d.ts.map +1 -1
- package/dist/agent/agent.operation.d.ts +125 -125
- package/dist/agent/agent.schema.d.ts +95 -95
- package/dist/agent/agent.schema.d.ts.map +1 -1
- package/dist/libs/contracts/dist/data-views/data-views.js +7 -1
- package/dist/libs/contracts/dist/data-views/data-views.js.map +1 -0
- package/dist/libs/contracts/dist/features.js +7 -1
- package/dist/libs/contracts/dist/features.js.map +1 -0
- package/dist/libs/contracts/dist/operations/registry.js +7 -1
- package/dist/libs/contracts/dist/operations/registry.js.map +1 -0
- package/dist/libs/contracts/dist/presentations/presentations.js +7 -1
- package/dist/libs/contracts/dist/presentations/presentations.js.map +1 -0
- package/dist/libs/contracts/dist/workflow/spec.js +7 -1
- package/dist/libs/contracts/dist/workflow/spec.js.map +1 -0
- package/dist/run/run.event.d.ts +71 -71
- package/dist/run/run.operation.d.ts +175 -175
- package/dist/run/run.schema.d.ts +99 -99
- package/dist/tool/tool.handler.d.ts.map +1 -1
- package/package.json +8 -8
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,268 +1,268 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _lssm_lib_schema241 from "@lssm/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/agent/agent.schema.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* AI agent configuration schema.
|
|
6
6
|
*/
|
|
7
|
-
declare const AgentModel:
|
|
7
|
+
declare const AgentModel: _lssm_lib_schema241.SchemaModel<{
|
|
8
8
|
id: {
|
|
9
|
-
type:
|
|
9
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
10
10
|
isOptional: false;
|
|
11
11
|
};
|
|
12
12
|
organizationId: {
|
|
13
|
-
type:
|
|
13
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
14
14
|
isOptional: false;
|
|
15
15
|
};
|
|
16
16
|
name: {
|
|
17
|
-
type:
|
|
17
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
18
18
|
isOptional: false;
|
|
19
19
|
};
|
|
20
20
|
slug: {
|
|
21
|
-
type:
|
|
21
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
22
22
|
isOptional: false;
|
|
23
23
|
};
|
|
24
24
|
description: {
|
|
25
|
-
type:
|
|
25
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
26
26
|
isOptional: true;
|
|
27
27
|
};
|
|
28
28
|
status: {
|
|
29
|
-
type:
|
|
29
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string, string]>;
|
|
30
30
|
isOptional: false;
|
|
31
31
|
};
|
|
32
32
|
modelProvider: {
|
|
33
|
-
type:
|
|
33
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string, string, string]>;
|
|
34
34
|
isOptional: false;
|
|
35
35
|
};
|
|
36
36
|
modelName: {
|
|
37
|
-
type:
|
|
37
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
38
38
|
isOptional: false;
|
|
39
39
|
};
|
|
40
40
|
modelConfig: {
|
|
41
|
-
type:
|
|
41
|
+
type: _lssm_lib_schema241.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
42
42
|
isOptional: true;
|
|
43
43
|
};
|
|
44
44
|
systemPrompt: {
|
|
45
|
-
type:
|
|
45
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
46
46
|
isOptional: false;
|
|
47
47
|
};
|
|
48
48
|
userPromptTemplate: {
|
|
49
|
-
type:
|
|
49
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
50
50
|
isOptional: true;
|
|
51
51
|
};
|
|
52
52
|
toolIds: {
|
|
53
|
-
type:
|
|
53
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
54
54
|
isArray: true;
|
|
55
55
|
isOptional: true;
|
|
56
56
|
};
|
|
57
57
|
toolChoice: {
|
|
58
|
-
type:
|
|
58
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string]>;
|
|
59
59
|
isOptional: false;
|
|
60
60
|
defaultValue: string;
|
|
61
61
|
};
|
|
62
62
|
maxIterations: {
|
|
63
|
-
type:
|
|
63
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
64
64
|
isOptional: false;
|
|
65
65
|
defaultValue: number;
|
|
66
66
|
};
|
|
67
67
|
maxTokensPerRun: {
|
|
68
|
-
type:
|
|
68
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
69
69
|
isOptional: true;
|
|
70
70
|
};
|
|
71
71
|
timeoutMs: {
|
|
72
|
-
type:
|
|
72
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
73
73
|
isOptional: false;
|
|
74
74
|
defaultValue: number;
|
|
75
75
|
};
|
|
76
76
|
version: {
|
|
77
|
-
type:
|
|
77
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
78
78
|
isOptional: false;
|
|
79
79
|
};
|
|
80
80
|
tags: {
|
|
81
|
-
type:
|
|
81
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
82
82
|
isArray: true;
|
|
83
83
|
isOptional: true;
|
|
84
84
|
};
|
|
85
85
|
createdAt: {
|
|
86
|
-
type:
|
|
86
|
+
type: _lssm_lib_schema241.FieldType<Date, string>;
|
|
87
87
|
isOptional: false;
|
|
88
88
|
};
|
|
89
89
|
updatedAt: {
|
|
90
|
-
type:
|
|
90
|
+
type: _lssm_lib_schema241.FieldType<Date, string>;
|
|
91
91
|
isOptional: false;
|
|
92
92
|
};
|
|
93
93
|
}>;
|
|
94
94
|
/**
|
|
95
95
|
* Summary of an agent for list views.
|
|
96
96
|
*/
|
|
97
|
-
declare const AgentSummaryModel:
|
|
97
|
+
declare const AgentSummaryModel: _lssm_lib_schema241.SchemaModel<{
|
|
98
98
|
id: {
|
|
99
|
-
type:
|
|
99
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
100
100
|
isOptional: false;
|
|
101
101
|
};
|
|
102
102
|
name: {
|
|
103
|
-
type:
|
|
103
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
104
104
|
isOptional: false;
|
|
105
105
|
};
|
|
106
106
|
slug: {
|
|
107
|
-
type:
|
|
107
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
108
108
|
isOptional: false;
|
|
109
109
|
};
|
|
110
110
|
description: {
|
|
111
|
-
type:
|
|
111
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
112
112
|
isOptional: true;
|
|
113
113
|
};
|
|
114
114
|
status: {
|
|
115
|
-
type:
|
|
115
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string, string]>;
|
|
116
116
|
isOptional: false;
|
|
117
117
|
};
|
|
118
118
|
modelProvider: {
|
|
119
|
-
type:
|
|
119
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string, string, string]>;
|
|
120
120
|
isOptional: false;
|
|
121
121
|
};
|
|
122
122
|
modelName: {
|
|
123
|
-
type:
|
|
123
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
124
124
|
isOptional: false;
|
|
125
125
|
};
|
|
126
126
|
version: {
|
|
127
|
-
type:
|
|
127
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
128
128
|
isOptional: false;
|
|
129
129
|
};
|
|
130
130
|
createdAt: {
|
|
131
|
-
type:
|
|
131
|
+
type: _lssm_lib_schema241.FieldType<Date, string>;
|
|
132
132
|
isOptional: false;
|
|
133
133
|
};
|
|
134
134
|
}>;
|
|
135
135
|
/**
|
|
136
136
|
* Tool reference in agent context.
|
|
137
137
|
*/
|
|
138
|
-
declare const AgentToolRefModel:
|
|
138
|
+
declare const AgentToolRefModel: _lssm_lib_schema241.SchemaModel<{
|
|
139
139
|
id: {
|
|
140
|
-
type:
|
|
140
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
141
141
|
isOptional: false;
|
|
142
142
|
};
|
|
143
143
|
name: {
|
|
144
|
-
type:
|
|
144
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
145
145
|
isOptional: false;
|
|
146
146
|
};
|
|
147
147
|
slug: {
|
|
148
|
-
type:
|
|
148
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
149
149
|
isOptional: false;
|
|
150
150
|
};
|
|
151
151
|
description: {
|
|
152
|
-
type:
|
|
152
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
153
153
|
isOptional: false;
|
|
154
154
|
};
|
|
155
155
|
category: {
|
|
156
|
-
type:
|
|
156
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
157
157
|
isOptional: false;
|
|
158
158
|
};
|
|
159
159
|
}>;
|
|
160
160
|
/**
|
|
161
161
|
* Agent with associated tools.
|
|
162
162
|
*/
|
|
163
|
-
declare const AgentWithToolsModel:
|
|
163
|
+
declare const AgentWithToolsModel: _lssm_lib_schema241.SchemaModel<{
|
|
164
164
|
id: {
|
|
165
|
-
type:
|
|
165
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
166
166
|
isOptional: false;
|
|
167
167
|
};
|
|
168
168
|
organizationId: {
|
|
169
|
-
type:
|
|
169
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
170
170
|
isOptional: false;
|
|
171
171
|
};
|
|
172
172
|
name: {
|
|
173
|
-
type:
|
|
173
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
174
174
|
isOptional: false;
|
|
175
175
|
};
|
|
176
176
|
slug: {
|
|
177
|
-
type:
|
|
177
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
178
178
|
isOptional: false;
|
|
179
179
|
};
|
|
180
180
|
description: {
|
|
181
|
-
type:
|
|
181
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
182
182
|
isOptional: true;
|
|
183
183
|
};
|
|
184
184
|
status: {
|
|
185
|
-
type:
|
|
185
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string, string]>;
|
|
186
186
|
isOptional: false;
|
|
187
187
|
};
|
|
188
188
|
modelProvider: {
|
|
189
|
-
type:
|
|
189
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string, string, string]>;
|
|
190
190
|
isOptional: false;
|
|
191
191
|
};
|
|
192
192
|
modelName: {
|
|
193
|
-
type:
|
|
193
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
194
194
|
isOptional: false;
|
|
195
195
|
};
|
|
196
196
|
modelConfig: {
|
|
197
|
-
type:
|
|
197
|
+
type: _lssm_lib_schema241.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
198
198
|
isOptional: true;
|
|
199
199
|
};
|
|
200
200
|
systemPrompt: {
|
|
201
|
-
type:
|
|
201
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
202
202
|
isOptional: false;
|
|
203
203
|
};
|
|
204
204
|
userPromptTemplate: {
|
|
205
|
-
type:
|
|
205
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
206
206
|
isOptional: true;
|
|
207
207
|
};
|
|
208
208
|
toolIds: {
|
|
209
|
-
type:
|
|
209
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
210
210
|
isArray: true;
|
|
211
211
|
isOptional: true;
|
|
212
212
|
};
|
|
213
213
|
toolChoice: {
|
|
214
|
-
type:
|
|
214
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string]>;
|
|
215
215
|
isOptional: false;
|
|
216
216
|
};
|
|
217
217
|
maxIterations: {
|
|
218
|
-
type:
|
|
218
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
219
219
|
isOptional: false;
|
|
220
220
|
};
|
|
221
221
|
maxTokensPerRun: {
|
|
222
|
-
type:
|
|
222
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
223
223
|
isOptional: true;
|
|
224
224
|
};
|
|
225
225
|
timeoutMs: {
|
|
226
|
-
type:
|
|
226
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
227
227
|
isOptional: false;
|
|
228
228
|
};
|
|
229
229
|
version: {
|
|
230
|
-
type:
|
|
230
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
231
231
|
isOptional: false;
|
|
232
232
|
};
|
|
233
233
|
tags: {
|
|
234
|
-
type:
|
|
234
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
235
235
|
isArray: true;
|
|
236
236
|
isOptional: true;
|
|
237
237
|
};
|
|
238
238
|
createdAt: {
|
|
239
|
-
type:
|
|
239
|
+
type: _lssm_lib_schema241.FieldType<Date, string>;
|
|
240
240
|
isOptional: false;
|
|
241
241
|
};
|
|
242
242
|
updatedAt: {
|
|
243
|
-
type:
|
|
243
|
+
type: _lssm_lib_schema241.FieldType<Date, string>;
|
|
244
244
|
isOptional: false;
|
|
245
245
|
};
|
|
246
246
|
tools: {
|
|
247
|
-
type:
|
|
247
|
+
type: _lssm_lib_schema241.SchemaModel<{
|
|
248
248
|
id: {
|
|
249
|
-
type:
|
|
249
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
250
250
|
isOptional: false;
|
|
251
251
|
};
|
|
252
252
|
name: {
|
|
253
|
-
type:
|
|
253
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
254
254
|
isOptional: false;
|
|
255
255
|
};
|
|
256
256
|
slug: {
|
|
257
|
-
type:
|
|
257
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
258
258
|
isOptional: false;
|
|
259
259
|
};
|
|
260
260
|
description: {
|
|
261
|
-
type:
|
|
261
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
262
262
|
isOptional: false;
|
|
263
263
|
};
|
|
264
264
|
category: {
|
|
265
|
-
type:
|
|
265
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
266
266
|
isOptional: false;
|
|
267
267
|
};
|
|
268
268
|
}>;
|
|
@@ -273,66 +273,66 @@ declare const AgentWithToolsModel: _lssm_lib_schema50.SchemaModel<{
|
|
|
273
273
|
/**
|
|
274
274
|
* Input for creating an agent.
|
|
275
275
|
*/
|
|
276
|
-
declare const CreateAgentInputModel:
|
|
276
|
+
declare const CreateAgentInputModel: _lssm_lib_schema241.SchemaModel<{
|
|
277
277
|
organizationId: {
|
|
278
|
-
type:
|
|
278
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
279
279
|
isOptional: false;
|
|
280
280
|
};
|
|
281
281
|
name: {
|
|
282
|
-
type:
|
|
282
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
283
283
|
isOptional: false;
|
|
284
284
|
};
|
|
285
285
|
slug: {
|
|
286
|
-
type:
|
|
286
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
287
287
|
isOptional: false;
|
|
288
288
|
};
|
|
289
289
|
description: {
|
|
290
|
-
type:
|
|
290
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
291
291
|
isOptional: true;
|
|
292
292
|
};
|
|
293
293
|
modelProvider: {
|
|
294
|
-
type:
|
|
294
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string, string, string]>;
|
|
295
295
|
isOptional: false;
|
|
296
296
|
};
|
|
297
297
|
modelName: {
|
|
298
|
-
type:
|
|
298
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
299
299
|
isOptional: false;
|
|
300
300
|
};
|
|
301
301
|
modelConfig: {
|
|
302
|
-
type:
|
|
302
|
+
type: _lssm_lib_schema241.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
303
303
|
isOptional: true;
|
|
304
304
|
};
|
|
305
305
|
systemPrompt: {
|
|
306
|
-
type:
|
|
306
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
307
307
|
isOptional: false;
|
|
308
308
|
};
|
|
309
309
|
userPromptTemplate: {
|
|
310
|
-
type:
|
|
310
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
311
311
|
isOptional: true;
|
|
312
312
|
};
|
|
313
313
|
toolIds: {
|
|
314
|
-
type:
|
|
314
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
315
315
|
isArray: true;
|
|
316
316
|
isOptional: true;
|
|
317
317
|
};
|
|
318
318
|
toolChoice: {
|
|
319
|
-
type:
|
|
319
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string]>;
|
|
320
320
|
isOptional: true;
|
|
321
321
|
};
|
|
322
322
|
maxIterations: {
|
|
323
|
-
type:
|
|
323
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
324
324
|
isOptional: true;
|
|
325
325
|
};
|
|
326
326
|
maxTokensPerRun: {
|
|
327
|
-
type:
|
|
327
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
328
328
|
isOptional: true;
|
|
329
329
|
};
|
|
330
330
|
timeoutMs: {
|
|
331
|
-
type:
|
|
331
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
332
332
|
isOptional: true;
|
|
333
333
|
};
|
|
334
334
|
tags: {
|
|
335
|
-
type:
|
|
335
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
336
336
|
isArray: true;
|
|
337
337
|
isOptional: true;
|
|
338
338
|
};
|
|
@@ -340,58 +340,58 @@ declare const CreateAgentInputModel: _lssm_lib_schema50.SchemaModel<{
|
|
|
340
340
|
/**
|
|
341
341
|
* Input for updating an agent.
|
|
342
342
|
*/
|
|
343
|
-
declare const UpdateAgentInputModel:
|
|
343
|
+
declare const UpdateAgentInputModel: _lssm_lib_schema241.SchemaModel<{
|
|
344
344
|
agentId: {
|
|
345
|
-
type:
|
|
345
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
346
346
|
isOptional: false;
|
|
347
347
|
};
|
|
348
348
|
name: {
|
|
349
|
-
type:
|
|
349
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
350
350
|
isOptional: true;
|
|
351
351
|
};
|
|
352
352
|
description: {
|
|
353
|
-
type:
|
|
353
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
354
354
|
isOptional: true;
|
|
355
355
|
};
|
|
356
356
|
status: {
|
|
357
|
-
type:
|
|
357
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string, string]>;
|
|
358
358
|
isOptional: true;
|
|
359
359
|
};
|
|
360
360
|
modelConfig: {
|
|
361
|
-
type:
|
|
361
|
+
type: _lssm_lib_schema241.FieldType<Record<string, unknown>, Record<string, unknown>>;
|
|
362
362
|
isOptional: true;
|
|
363
363
|
};
|
|
364
364
|
systemPrompt: {
|
|
365
|
-
type:
|
|
365
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
366
366
|
isOptional: true;
|
|
367
367
|
};
|
|
368
368
|
userPromptTemplate: {
|
|
369
|
-
type:
|
|
369
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
370
370
|
isOptional: true;
|
|
371
371
|
};
|
|
372
372
|
toolIds: {
|
|
373
|
-
type:
|
|
373
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
374
374
|
isArray: true;
|
|
375
375
|
isOptional: true;
|
|
376
376
|
};
|
|
377
377
|
toolChoice: {
|
|
378
|
-
type:
|
|
378
|
+
type: _lssm_lib_schema241.EnumType<[string, string, string]>;
|
|
379
379
|
isOptional: true;
|
|
380
380
|
};
|
|
381
381
|
maxIterations: {
|
|
382
|
-
type:
|
|
382
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
383
383
|
isOptional: true;
|
|
384
384
|
};
|
|
385
385
|
maxTokensPerRun: {
|
|
386
|
-
type:
|
|
386
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
387
387
|
isOptional: true;
|
|
388
388
|
};
|
|
389
389
|
timeoutMs: {
|
|
390
|
-
type:
|
|
390
|
+
type: _lssm_lib_schema241.FieldType<number, number>;
|
|
391
391
|
isOptional: true;
|
|
392
392
|
};
|
|
393
393
|
tags: {
|
|
394
|
-
type:
|
|
394
|
+
type: _lssm_lib_schema241.FieldType<string, string>;
|
|
395
395
|
isArray: true;
|
|
396
396
|
isOptional: true;
|
|
397
397
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.schema.d.ts","names":[],"sources":["../../src/agent/agent.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAUa,cAAA,UAmDX,
|
|
1
|
+
{"version":3,"file":"agent.schema.d.ts","names":[],"sources":["../../src/agent/agent.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAUa,cAAA,UAmDX,sBAnDqB,WAmDrB,CAAA;EAAA,EAAA,EAAA;UAAA,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;IAnDqB,IAAA,8BAAA,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;IAwDV,UAAA,EAAA,KAcX;EAAA,CAAA;;;;;;;;;;uCAd4B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAmBjB,CAAA;EAUX,kBAAA,EAAA;;;;;uCAV4B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,OAAA,EAAA,IAAA;IAejB,UAAA,EAAA,IAAA;EAwCX,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAxC8B,KAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EA6CnB,CAAA;EAkCX,SAAA,EAAA;;;;;;;;cAjHW,uCAAiB;;UAc5B,mBAAA,CAAA;;;;;;;;IAiEgC,IAAA,+BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAuCrB,UAAA,EAAA,KAAA;EA6BX,CAAA;;;;;;;;;;;;;;;qBA7BgC;EAAA,CAAA;;;;;;;;;;;;;cAnGrB,uCAAiB;;UAU5B,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;cAKW,yCAAmB;;UAwC9B,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,2CAAqB;;UAkChC,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,2CAAqB;;UA6BhC,mBAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-views.js","names":[],"sources":["../../../../../../../libs/contracts/dist/data-views/data-views.js"],"sourcesContent":["import { filterBy, getUniqueTags, groupBy, init_registry_utils } from \"../registry-utils.js\";\n\n//#region src/data-views/data-views.ts\ninit_registry_utils();\nfunction keyOf(spec) {\n\treturn `${spec.meta.name}.v${spec.meta.version}`;\n}\nvar DataViewRegistry = class {\n\titems = /* @__PURE__ */ new Map();\n\tregister(spec) {\n\t\tconst key = keyOf(spec);\n\t\tif (this.items.has(key)) throw new Error(`Duplicate data view ${key}`);\n\t\tthis.items.set(key, spec);\n\t\treturn this;\n\t}\n\tlist() {\n\t\treturn [...this.items.values()];\n\t}\n\tget(name, version) {\n\t\tif (version != null) return this.items.get(`${name}.v${version}`);\n\t\tlet candidate;\n\t\tlet max = -Infinity;\n\t\tfor (const spec of this.items.values()) {\n\t\t\tif (spec.meta.name !== name) continue;\n\t\t\tif (spec.meta.version > max) {\n\t\t\t\tmax = spec.meta.version;\n\t\t\t\tcandidate = spec;\n\t\t\t}\n\t\t}\n\t\treturn candidate;\n\t}\n\t/** Filter data views by criteria. */\n\tfilter(criteria) {\n\t\treturn filterBy(this.list(), criteria);\n\t}\n\t/** List data views with specific tag. */\n\tlistByTag(tag) {\n\t\treturn this.list().filter((d) => d.meta.tags?.includes(tag));\n\t}\n\t/** List data views by owner. */\n\tlistByOwner(owner) {\n\t\treturn this.list().filter((d) => d.meta.owners?.includes(owner));\n\t}\n\t/** Group data views by key function. */\n\tgroupBy(keyFn) {\n\t\treturn groupBy(this.list(), keyFn);\n\t}\n\t/** Get unique tags from all data views. */\n\tgetUniqueTags() {\n\t\treturn getUniqueTags(this.list());\n\t}\n};\nfunction dataViewKey(spec) {\n\treturn keyOf(spec);\n}\n\n//#endregion\nexport { DataViewRegistry, dataViewKey };"],"mappings":";;;AAGA,qBAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.js","names":[],"sources":["../../../../../../libs/contracts/dist/features.js"],"sourcesContent":["import { filterBy, getUniqueTags, groupBy, init_registry_utils } from \"./registry-utils.js\";\n\n//#region src/features.ts\ninit_registry_utils();\nfunction keyOf(f) {\n\treturn f.meta.key;\n}\n/** In-memory registry for FeatureModuleSpec. */\nvar FeatureRegistry = class {\n\titems = /* @__PURE__ */ new Map();\n\t/** Register a feature module. Throws when the key already exists. */\n\tregister(f) {\n\t\tconst key = keyOf(f);\n\t\tif (this.items.has(key)) throw new Error(`Duplicate feature ${key}`);\n\t\tthis.items.set(key, f);\n\t\treturn this;\n\t}\n\t/** List all registered feature modules. */\n\tlist() {\n\t\treturn [...this.items.values()];\n\t}\n\t/** Get a feature by its key (slug). */\n\tget(key) {\n\t\treturn this.items.get(key);\n\t}\n\t/** Filter features by criteria. */\n\tfilter(criteria) {\n\t\treturn filterBy(this.list(), criteria);\n\t}\n\t/** List features with specific tag. */\n\tlistByTag(tag) {\n\t\treturn this.list().filter((f) => f.meta.tags?.includes(tag));\n\t}\n\t/** List features by owner. */\n\tlistByOwner(owner) {\n\t\treturn this.list().filter((f) => f.meta.owners?.includes(owner));\n\t}\n\t/** Group features by key function. */\n\tgroupBy(keyFn) {\n\t\treturn groupBy(this.list(), keyFn);\n\t}\n\t/** Get unique tags from all features. */\n\tgetUniqueTags() {\n\t\treturn getUniqueTags(this.list());\n\t}\n};\n/** Validate and register a feature against optional registries/descriptors. */\nfunction installFeature(feature, deps) {\n\tif (deps.ops && feature.operations) {\n\t\tfor (const o of feature.operations) if (!deps.ops.getSpec(o.name, o.version)) throw new Error(`installFeature: operation not found ${o.name}.v${o.version}`);\n\t}\n\tif (deps.presentations && feature.presentations) {\n\t\tfor (const p of feature.presentations) if (!deps.presentations.get(p.name, p.version)) throw new Error(`installFeature: presentation not found ${p.name}.v${p.version}`);\n\t}\n\tif (feature.presentationsTargets && deps.descriptorsV2) for (const req of feature.presentationsTargets) {\n\t\tconst d = deps.descriptorsV2.find((x) => x.meta.name === req.name && x.meta.version === req.version);\n\t\tif (!d) throw new Error(`installFeature: V2 descriptor not found ${req.name}.v${req.version}`);\n\t\tfor (const t of req.targets) if (!d.targets.includes(t)) throw new Error(`installFeature: descriptor ${req.name}.v${req.version} missing target ${t}`);\n\t}\n\tif (feature.opToPresentation && feature.opToPresentation.length > 0) for (const link of feature.opToPresentation) {\n\t\tif (deps.ops) {\n\t\t\tif (!deps.ops.getSpec(link.op.name, link.op.version)) throw new Error(`installFeature: linked op not found ${link.op.name}.v${link.op.version}`);\n\t\t}\n\t\tif (deps.presentations) {\n\t\t\tif (!deps.presentations.get(link.pres.name, link.pres.version)) throw new Error(`installFeature: linked presentation not found ${link.pres.name}.v${link.pres.version}`);\n\t\t}\n\t}\n\tif (deps.capabilities && feature.capabilities?.provides) {\n\t\tfor (const cap of feature.capabilities.provides) if (!deps.capabilities.get(cap.key, cap.version)) throw new Error(`installFeature: capability not registered ${cap.key}.v${cap.version}`);\n\t}\n\tif (feature.capabilities?.requires?.length) {\n\t\tif (!deps.capabilities) throw new Error(`installFeature: capability registry required to validate capability requirements for ${feature.meta.key}`);\n\t\tconst provided = feature.capabilities.provides ?? [];\n\t\tfor (const req of feature.capabilities.requires) if (!deps.capabilities.satisfies(req, provided)) throw new Error(`installFeature: capability requirement not satisfied ${req.key}${req.version ? `.v${req.version}` : \"\"}`);\n\t}\n\tdeps.features.register(feature);\n\treturn deps.features;\n}\n/** Ensure declared target requirements exist on the provided descriptors. */\nfunction validateFeatureTargetsV2(feature, descriptors) {\n\tif (!feature.presentationsTargets || feature.presentationsTargets.length === 0) return true;\n\tfor (const req of feature.presentationsTargets) {\n\t\tconst d = descriptors.find((x) => x.meta.name === req.name && x.meta.version === req.version);\n\t\tif (!d) throw new Error(`V2 descriptor not found ${req.name}.v${req.version}`);\n\t\tfor (const t of req.targets) if (!d.targets.includes(t)) throw new Error(`Descriptor ${req.name}.v${req.version} missing target ${t}`);\n\t}\n\treturn true;\n}\n\n//#endregion\nexport { FeatureRegistry, installFeature, validateFeatureTargetsV2 };"],"mappings":";;;AAGA,qBAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","names":[],"sources":["../../../../../../../libs/contracts/dist/operations/registry.js"],"sourcesContent":["import { eventKey } from \"../events.js\";\nimport { GroupingStrategies, filterBy, getUniqueOwners, getUniqueTags, groupBy, init_registry_utils } from \"../registry-utils.js\";\nimport { isEmitDeclRef } from \"./operation.js\";\n\n//#region src/operations/registry.ts\ninit_registry_utils();\nfunction opKey(name, version) {\n\treturn `${name}.v${version}`;\n}\n/**\n* In-memory registry for ContractSpecs and their bound handlers.\n* Provides validation, policy enforcement, and guarded event emission at execute time.\n*/\nvar OperationSpecRegistry = class {\n\tspecs = /* @__PURE__ */ new Map();\n\thandlers = /* @__PURE__ */ new Map();\n\t/**\n\t* Registers a OperationSpec definition.\n\t*\n\t* @param spec - The contract specification to register.\n\t* @returns The registry instance for chaining.\n\t* @throws If a spec with the same name and version is already registered.\n\t*/\n\tregister(spec) {\n\t\tconst key = opKey(spec.meta.name, spec.meta.version);\n\t\tif (this.specs.has(key)) throw new Error(`Duplicate spec ${key}`);\n\t\tthis.specs.set(key, spec);\n\t\treturn this;\n\t}\n\t/**\n\t* Binds a runtime handler implementation to a previously registered spec.\n\t*\n\t* @param spec - The spec to bind to.\n\t* @param handler - The async function implementing the business logic.\n\t* @returns The registry instance for chaining.\n\t* @throws If the spec is not found or a handler is already bound.\n\t*/\n\tbind(spec, handler) {\n\t\tconst key = opKey(spec.meta.name, spec.meta.version);\n\t\tif (!this.specs.has(key)) throw new Error(`Cannot bind; spec not found: ${key}`);\n\t\tif (this.handlers.has(key)) throw new Error(`Handler already bound for ${key}`);\n\t\tthis.handlers.set(key, handler);\n\t\treturn this;\n\t}\n\t/**\n\t* Retrieves a registered spec by name and version.\n\t* If version is omitted, returns the highest version found.\n\t*\n\t* @param name - Operation name.\n\t* @param version - (Optional) Specific version.\n\t*/\n\tgetSpec(name, version) {\n\t\tif (version != null) return this.specs.get(opKey(name, version));\n\t\tlet found;\n\t\tlet maxV = -Infinity;\n\t\tfor (const [k, s] of this.specs.entries()) {\n\t\t\tif (!k.startsWith(`${name}.v`)) continue;\n\t\t\tif (s.meta.version > maxV) {\n\t\t\t\tmaxV = s.meta.version;\n\t\t\t\tfound = s;\n\t\t\t}\n\t\t}\n\t\treturn found;\n\t}\n\t/**\n\t* Retrieves the bound handler for a spec.\n\t*/\n\tgetHandler(name, version) {\n\t\tconst spec = this.getSpec(name, version);\n\t\tif (!spec) return void 0;\n\t\treturn this.handlers.get(opKey(spec.meta.name, spec.meta.version));\n\t}\n\t/** Iterate all registered specs. */\n\tlistSpecs() {\n\t\treturn [...this.specs.values()];\n\t}\n\t/** Iterate all bound operations (spec+handler). */\n\tlistBound() {\n\t\tconst out = [];\n\t\tfor (const [k, spec] of this.specs.entries()) {\n\t\t\tconst h = this.handlers.get(k);\n\t\t\tif (h) out.push({\n\t\t\t\tspec,\n\t\t\t\thandler: h\n\t\t\t});\n\t\t}\n\t\treturn out;\n\t}\n\t/**\n\t* Filter specs by criteria.\n\t*/\n\tfilter(criteria) {\n\t\treturn filterBy(this.listSpecs(), criteria);\n\t}\n\t/**\n\t* List specs with specific tag.\n\t*/\n\tlistByTag(tag) {\n\t\treturn this.listSpecs().filter((s) => s.meta.tags?.includes(tag));\n\t}\n\t/**\n\t* List specs by owner.\n\t*/\n\tlistByOwner(owner) {\n\t\treturn this.listSpecs().filter((s) => s.meta.owners?.includes(owner));\n\t}\n\t/**\n\t* Group specs by key function.\n\t*/\n\tgroupBy(keyFn) {\n\t\treturn groupBy(this.listSpecs(), keyFn);\n\t}\n\t/**\n\t* Group by domain (first segment of name).\n\t*/\n\tgroupByDomain() {\n\t\treturn this.groupBy(GroupingStrategies.byDomain);\n\t}\n\t/**\n\t* Group by tag.\n\t*/\n\tgroupByTag() {\n\t\treturn this.groupBy(GroupingStrategies.byTag);\n\t}\n\t/**\n\t* Get unique tags from all specs.\n\t*/\n\tgetUniqueTags() {\n\t\treturn getUniqueTags(this.listSpecs());\n\t}\n\t/**\n\t* Get unique owners from all specs.\n\t*/\n\tgetUniqueOwners() {\n\t\treturn getUniqueOwners(this.listSpecs());\n\t}\n\t/**\n\t* Execute an operation by name/version with full runtime protections:\n\t* 1. Validates input against Zod schema.\n\t* 2. Enforces policy (Auth, RBAC, Rate Limits) via PDP.\n\t* 3. Guards event emission to ensure only declared events are sent.\n\t* 4. Validates output against Zod schema (if applicable).\n\t* 5. Tracks telemetry (success/failure).\n\t*\n\t* @param name - Operation name.\n\t* @param version - Operation version (optional, defaults to latest).\n\t* @param rawInput - The raw input payload (e.g. from JSON body).\n\t* @param ctx - The runtime context (actor, tenant, etc.).\n\t*/\n\tasync execute(name, version, rawInput, ctx) {\n\t\tconst baseSpec = this.getSpec(name, version);\n\t\tif (!baseSpec) throw new Error(`Spec not found for ${name}${version ? `.v${version}` : \"\"}`);\n\t\tconst spec = await ctx.specVariantResolver?.resolve({\n\t\t\tname: baseSpec.meta.name,\n\t\t\tversion: baseSpec.meta.version,\n\t\t\tkind: baseSpec.meta.kind\n\t\t}, ctx) ?? baseSpec;\n\t\tlet key = opKey(spec.meta.name, spec.meta.version);\n\t\tlet handler = this.handlers.get(key);\n\t\tif (!handler) {\n\t\t\tconst fallbackKey = opKey(baseSpec.meta.name, baseSpec.meta.version);\n\t\t\thandler = this.handlers.get(fallbackKey);\n\t\t\tkey = fallbackKey;\n\t\t}\n\t\tif (!handler) throw new Error(`No handler bound for ${key}`);\n\t\tconst parsedInput = spec.io.input?.getZod().parse(rawInput);\n\t\tif (ctx.decide) {\n\t\t\tconst [service, command] = spec.meta.name.split(\".\");\n\t\t\tif (!service || !command) throw new Error(`Invalid spec name: ${spec.meta.name}`);\n\t\t\tconst decision = await ctx.decide({\n\t\t\t\tservice,\n\t\t\t\tcommand,\n\t\t\t\tversion: spec.meta.version,\n\t\t\t\tactor: ctx.actor ?? \"anonymous\",\n\t\t\t\tchannel: ctx.channel,\n\t\t\t\troles: ctx.roles,\n\t\t\t\torganizationId: ctx.organizationId,\n\t\t\t\tuserId: ctx.userId,\n\t\t\t\tflags: []\n\t\t\t});\n\t\t\tif (decision.effect === \"deny\") throw new Error(`PolicyDenied: ${spec.meta.name}.v${spec.meta.version}`);\n\t\t\tif (decision.rateLimit && ctx.rateLimit) {\n\t\t\t\tconst key$1 = decision.rateLimit.key ?? \"default\";\n\t\t\t\tconst rpm = decision.rateLimit.rpm ?? 60;\n\t\t\t\tawait ctx.rateLimit(key$1, 1, rpm);\n\t\t\t}\n\t\t}\n\t\tconst allowedEvents = /* @__PURE__ */ new Map();\n\t\tif (spec.sideEffects?.emits) for (const e of spec.sideEffects.emits) if (isEmitDeclRef(e)) allowedEvents.set(`${e.ref.name}.v${e.ref.version}`, e.ref.payload);\n\t\telse allowedEvents.set(`${e.name}.v${e.version}`, e.payload);\n\t\tconst emitGuard = async (eventName, eventVersion, payload) => {\n\t\t\tconst key2 = eventKey(eventName, eventVersion);\n\t\t\tconst schema = allowedEvents.get(key2);\n\t\t\tif (!schema) throw new Error(`UndeclaredEvent: ${key2} not allowed by ${opKey(spec.meta.name, spec.meta.version)}`);\n\t\t\tconst parsed = schema.getZod().parse(payload);\n\t\t\tawait ctx.eventPublisher?.({\n\t\t\t\tname: eventName,\n\t\t\t\tversion: eventVersion,\n\t\t\t\tpayload: parsed,\n\t\t\t\ttraceId: ctx.traceId\n\t\t\t});\n\t\t};\n\t\tif (ctx.appConfig) {\n\t\t\tif (!ctx.branding) ctx.branding = ctx.appConfig.branding;\n\t\t\tif (!ctx.translation) ctx.translation = { config: ctx.appConfig.translation };\n\t\t\telse if (!ctx.translation.config) ctx.translation = {\n\t\t\t\t...ctx.translation,\n\t\t\t\tconfig: ctx.appConfig.translation\n\t\t\t};\n\t\t}\n\t\tconst telemetryContext = ctx.telemetry;\n\t\tconst trackTelemetry = async (trigger, details) => {\n\t\t\tif (!telemetryContext || !trigger?.event) return;\n\t\t\ttry {\n\t\t\t\tconst props = trigger.properties?.(details) ?? {};\n\t\t\t\tawait telemetryContext.track(trigger.event.name, trigger.event.version ?? 1, props, {\n\t\t\t\t\ttenantId: ctx.organizationId ?? void 0,\n\t\t\t\t\torganizationId: ctx.organizationId,\n\t\t\t\t\tuserId: ctx.userId,\n\t\t\t\t\tactor: ctx.actor,\n\t\t\t\t\tchannel: ctx.channel,\n\t\t\t\t\tmetadata: ctx.traceId ? { traceId: ctx.traceId } : void 0\n\t\t\t\t});\n\t\t\t} catch (_error) {}\n\t\t};\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await handler(parsedInput, {\n\t\t\t\t...ctx,\n\t\t\t\t__emitGuard__: emitGuard\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (spec.telemetry?.failure) await trackTelemetry(spec.telemetry.failure, {\n\t\t\t\tinput: parsedInput ?? rawInput,\n\t\t\t\terror\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t\tif (spec.telemetry?.success) await trackTelemetry(spec.telemetry.success, {\n\t\t\tinput: parsedInput ?? rawInput,\n\t\t\toutput: result\n\t\t});\n\t\tconst outputModel = spec.io.output;\n\t\tif (outputModel?.getZod) return outputModel.getZod().parse(result);\n\t\treturn result;\n\t}\n};\n\n//#endregion\nexport { OperationSpecRegistry, opKey };"],"mappings":";;;;AAKA,qBAAqB"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import "../registry-utils.js";
|
|
1
|
+
import { init_registry_utils } from "../registry-utils.js";
|
|
2
2
|
import z from "zod";
|
|
3
|
+
|
|
4
|
+
//#region ../../libs/contracts/dist/presentations/presentations.js
|
|
5
|
+
init_registry_utils();
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
//# sourceMappingURL=presentations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentations.js","names":[],"sources":["../../../../../../../libs/contracts/dist/presentations/presentations.js"],"sourcesContent":["import { filterBy, getUniqueTags, groupBy, init_registry_utils } from \"../registry-utils.js\";\nimport z from \"zod\";\n\n//#region src/presentations/presentations.ts\ninit_registry_utils();\nfunction keyOf(p) {\n\treturn `${p.meta.name}.v${p.meta.version}`;\n}\n/** In-memory registry for V1 PresentationSpec. */\nvar PresentationRegistry = class {\n\titems = /* @__PURE__ */ new Map();\n\tconstructor(items) {\n\t\tif (items) items.forEach((p) => this.register(p));\n\t}\n\tregister(p) {\n\t\tconst key = keyOf(p);\n\t\tif (this.items.has(key)) throw new Error(`Duplicate presentation ${key}`);\n\t\tthis.items.set(key, p);\n\t\treturn this;\n\t}\n\tlist() {\n\t\treturn [...this.items.values()];\n\t}\n\tget(name, version) {\n\t\tif (version != null) return this.items.get(`${name}.v${version}`);\n\t\tlet candidate;\n\t\tlet max = -Infinity;\n\t\tfor (const [k, p] of this.items.entries()) {\n\t\t\tif (!k.startsWith(`${name}.v`)) continue;\n\t\t\tif (p.meta.version > max) {\n\t\t\t\tmax = p.meta.version;\n\t\t\t\tcandidate = p;\n\t\t\t}\n\t\t}\n\t\treturn candidate;\n\t}\n\t/** Filter presentations by criteria. */\n\tfilter(criteria) {\n\t\treturn filterBy(this.list(), criteria);\n\t}\n\t/** List presentations with specific tag. */\n\tlistByTag(tag) {\n\t\treturn this.list().filter((p) => p.meta.tags?.includes(tag));\n\t}\n\t/** List presentations by owner. */\n\tlistByOwner(owner) {\n\t\treturn this.list().filter((p) => p.meta.owners?.includes(owner));\n\t}\n\t/** Group presentations by key function. */\n\tgroupBy(keyFn) {\n\t\treturn groupBy(this.list(), keyFn);\n\t}\n\t/** Get unique tags from all presentations. */\n\tgetUniqueTags() {\n\t\treturn getUniqueTags(this.list());\n\t}\n};\nfunction jsonSchemaForPresentation(p) {\n\tconst base = {\n\t\tmeta: {\n\t\t\tname: p.meta.name,\n\t\t\tversion: p.meta.version,\n\t\t\tstability: p.meta.stability ?? \"stable\",\n\t\t\ttags: p.meta.tags ?? [],\n\t\t\tdescription: p.meta.description ?? \"\"\n\t\t},\n\t\tkind: p.content.kind\n\t};\n\tif (p.content.kind === \"web_component\") return {\n\t\t...base,\n\t\tframework: p.content.framework,\n\t\tcomponentKey: p.content.componentKey,\n\t\tprops: z.toJSONSchema(p.content.props.getZod())\n\t};\n\tif (p.content.kind === \"markdown\") return {\n\t\t...base,\n\t\tcontent: p.content.content,\n\t\tresourceUri: p.content.resourceUri\n\t};\n\treturn {\n\t\t...base,\n\t\tmimeType: p.content.mimeType,\n\t\tmodel: z.toJSONSchema(p.content.model.getZod())\n\t};\n}\n\n//#endregion\nexport { PresentationRegistry, jsonSchemaForPresentation };"],"mappings":";;;;AAIA,qBAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec.js","names":[],"sources":["../../../../../../../libs/contracts/dist/workflow/spec.js"],"sourcesContent":["import { filterBy, getUniqueTags, groupBy, init_registry_utils } from \"../registry-utils.js\";\n\n//#region src/workflow/spec.ts\ninit_registry_utils();\nfunction workflowKey(meta) {\n\treturn `${meta.name}.v${meta.version}`;\n}\nvar WorkflowRegistry = class {\n\titems = /* @__PURE__ */ new Map();\n\tregister(spec) {\n\t\tconst key = workflowKey(spec.meta);\n\t\tif (this.items.has(key)) throw new Error(`Duplicate workflow ${key}`);\n\t\tthis.items.set(key, spec);\n\t\treturn this;\n\t}\n\tlist() {\n\t\treturn [...this.items.values()];\n\t}\n\tget(name, version) {\n\t\tif (version != null) return this.items.get(`${name}.v${version}`);\n\t\tlet candidate;\n\t\tlet max = -Infinity;\n\t\tfor (const spec of this.items.values()) {\n\t\t\tif (spec.meta.name !== name) continue;\n\t\t\tif (spec.meta.version > max) {\n\t\t\t\tmax = spec.meta.version;\n\t\t\t\tcandidate = spec;\n\t\t\t}\n\t\t}\n\t\treturn candidate;\n\t}\n\t/** Filter workflows by criteria. */\n\tfilter(criteria) {\n\t\treturn filterBy(this.list(), criteria);\n\t}\n\t/** List workflows with specific tag. */\n\tlistByTag(tag) {\n\t\treturn this.list().filter((w) => w.meta.tags?.includes(tag));\n\t}\n\t/** List workflows by owner. */\n\tlistByOwner(owner) {\n\t\treturn this.list().filter((w) => w.meta.owners?.includes(owner));\n\t}\n\t/** Group workflows by key function. */\n\tgroupBy(keyFn) {\n\t\treturn groupBy(this.list(), keyFn);\n\t}\n\t/** Get unique tags from all workflows. */\n\tgetUniqueTags() {\n\t\treturn getUniqueTags(this.list());\n\t}\n};\n\n//#endregion\nexport { WorkflowRegistry };"],"mappings":";;;AAGA,qBAAqB"}
|