@app-vitals/agent-admin 1.55.0 → 1.57.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/openapi.json +12 -0
- package/openapi.platform.json +20 -5
- package/package.json +2 -2
- package/prisma/client/internal/class.ts +4 -4
- package/prisma/client/internal/prismaNamespace.ts +2 -0
- package/prisma/client/internal/prismaNamespaceBrowser.ts +2 -0
- package/prisma/client/models/AgentMarketplace.ts +71 -1
- package/prisma/migrations/20261116100000_add_agent_marketplace_row_source/migration.sql +5 -0
- package/prisma/schema/schema.prisma +2 -0
- package/src/admin-ui-templates-pages.ts +11 -3
- package/src/admin-ui-templates.ts +9 -0
- package/src/agent-marketplaces-api.integration.test.ts +112 -0
- package/src/agent-marketplaces.integration.test.ts +9 -0
- package/src/agent-marketplaces.ts +52 -2
- package/src/agent-template-items.ts +20 -0
- package/src/agent-template-items.unit.test.ts +53 -0
- package/src/agent-template-merge.ts +1 -0
- package/src/agent-template-merge.unit.test.ts +50 -0
- package/src/agent-template-reconcile.ts +7 -1
- package/src/agent-templates-api.integration.test.ts +80 -0
- package/src/agent-templates-api.ts +1 -1
- package/src/agent-templates.ts +11 -0
- package/src/agents-api.ts +6 -2
- package/src/api.ts +16 -8
- package/src/openapi-schemas.ts +8 -2
|
@@ -30,6 +30,8 @@ export type AgentMarketplaceMinAggregateOutputType = {
|
|
|
30
30
|
name: string | null
|
|
31
31
|
source: string | null
|
|
32
32
|
ref: string | null
|
|
33
|
+
rowSource: string | null
|
|
34
|
+
enabled: boolean | null
|
|
33
35
|
createdAt: Date | null
|
|
34
36
|
updatedAt: Date | null
|
|
35
37
|
}
|
|
@@ -40,6 +42,8 @@ export type AgentMarketplaceMaxAggregateOutputType = {
|
|
|
40
42
|
name: string | null
|
|
41
43
|
source: string | null
|
|
42
44
|
ref: string | null
|
|
45
|
+
rowSource: string | null
|
|
46
|
+
enabled: boolean | null
|
|
43
47
|
createdAt: Date | null
|
|
44
48
|
updatedAt: Date | null
|
|
45
49
|
}
|
|
@@ -50,6 +54,8 @@ export type AgentMarketplaceCountAggregateOutputType = {
|
|
|
50
54
|
name: number
|
|
51
55
|
source: number
|
|
52
56
|
ref: number
|
|
57
|
+
rowSource: number
|
|
58
|
+
enabled: number
|
|
53
59
|
createdAt: number
|
|
54
60
|
updatedAt: number
|
|
55
61
|
_all: number
|
|
@@ -62,6 +68,8 @@ export type AgentMarketplaceMinAggregateInputType = {
|
|
|
62
68
|
name?: true
|
|
63
69
|
source?: true
|
|
64
70
|
ref?: true
|
|
71
|
+
rowSource?: true
|
|
72
|
+
enabled?: true
|
|
65
73
|
createdAt?: true
|
|
66
74
|
updatedAt?: true
|
|
67
75
|
}
|
|
@@ -72,6 +80,8 @@ export type AgentMarketplaceMaxAggregateInputType = {
|
|
|
72
80
|
name?: true
|
|
73
81
|
source?: true
|
|
74
82
|
ref?: true
|
|
83
|
+
rowSource?: true
|
|
84
|
+
enabled?: true
|
|
75
85
|
createdAt?: true
|
|
76
86
|
updatedAt?: true
|
|
77
87
|
}
|
|
@@ -82,6 +92,8 @@ export type AgentMarketplaceCountAggregateInputType = {
|
|
|
82
92
|
name?: true
|
|
83
93
|
source?: true
|
|
84
94
|
ref?: true
|
|
95
|
+
rowSource?: true
|
|
96
|
+
enabled?: true
|
|
85
97
|
createdAt?: true
|
|
86
98
|
updatedAt?: true
|
|
87
99
|
_all?: true
|
|
@@ -165,6 +177,8 @@ export type AgentMarketplaceGroupByOutputType = {
|
|
|
165
177
|
name: string
|
|
166
178
|
source: string
|
|
167
179
|
ref: string | null
|
|
180
|
+
rowSource: string
|
|
181
|
+
enabled: boolean
|
|
168
182
|
createdAt: Date
|
|
169
183
|
updatedAt: Date
|
|
170
184
|
_count: AgentMarketplaceCountAggregateOutputType | null
|
|
@@ -196,6 +210,8 @@ export type AgentMarketplaceWhereInput = {
|
|
|
196
210
|
name?: Prisma.StringFilter<"AgentMarketplace"> | string
|
|
197
211
|
source?: Prisma.StringFilter<"AgentMarketplace"> | string
|
|
198
212
|
ref?: Prisma.StringNullableFilter<"AgentMarketplace"> | string | null
|
|
213
|
+
rowSource?: Prisma.StringFilter<"AgentMarketplace"> | string
|
|
214
|
+
enabled?: Prisma.BoolFilter<"AgentMarketplace"> | boolean
|
|
199
215
|
createdAt?: Prisma.DateTimeFilter<"AgentMarketplace"> | Date | string
|
|
200
216
|
updatedAt?: Prisma.DateTimeFilter<"AgentMarketplace"> | Date | string
|
|
201
217
|
agent?: Prisma.XOR<Prisma.AgentScalarRelationFilter, Prisma.AgentWhereInput>
|
|
@@ -207,6 +223,8 @@ export type AgentMarketplaceOrderByWithRelationInput = {
|
|
|
207
223
|
name?: Prisma.SortOrder
|
|
208
224
|
source?: Prisma.SortOrder
|
|
209
225
|
ref?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
226
|
+
rowSource?: Prisma.SortOrder
|
|
227
|
+
enabled?: Prisma.SortOrder
|
|
210
228
|
createdAt?: Prisma.SortOrder
|
|
211
229
|
updatedAt?: Prisma.SortOrder
|
|
212
230
|
agent?: Prisma.AgentOrderByWithRelationInput
|
|
@@ -222,6 +240,8 @@ export type AgentMarketplaceWhereUniqueInput = Prisma.AtLeast<{
|
|
|
222
240
|
name?: Prisma.StringFilter<"AgentMarketplace"> | string
|
|
223
241
|
source?: Prisma.StringFilter<"AgentMarketplace"> | string
|
|
224
242
|
ref?: Prisma.StringNullableFilter<"AgentMarketplace"> | string | null
|
|
243
|
+
rowSource?: Prisma.StringFilter<"AgentMarketplace"> | string
|
|
244
|
+
enabled?: Prisma.BoolFilter<"AgentMarketplace"> | boolean
|
|
225
245
|
createdAt?: Prisma.DateTimeFilter<"AgentMarketplace"> | Date | string
|
|
226
246
|
updatedAt?: Prisma.DateTimeFilter<"AgentMarketplace"> | Date | string
|
|
227
247
|
agent?: Prisma.XOR<Prisma.AgentScalarRelationFilter, Prisma.AgentWhereInput>
|
|
@@ -233,6 +253,8 @@ export type AgentMarketplaceOrderByWithAggregationInput = {
|
|
|
233
253
|
name?: Prisma.SortOrder
|
|
234
254
|
source?: Prisma.SortOrder
|
|
235
255
|
ref?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
256
|
+
rowSource?: Prisma.SortOrder
|
|
257
|
+
enabled?: Prisma.SortOrder
|
|
236
258
|
createdAt?: Prisma.SortOrder
|
|
237
259
|
updatedAt?: Prisma.SortOrder
|
|
238
260
|
_count?: Prisma.AgentMarketplaceCountOrderByAggregateInput
|
|
@@ -249,6 +271,8 @@ export type AgentMarketplaceScalarWhereWithAggregatesInput = {
|
|
|
249
271
|
name?: Prisma.StringWithAggregatesFilter<"AgentMarketplace"> | string
|
|
250
272
|
source?: Prisma.StringWithAggregatesFilter<"AgentMarketplace"> | string
|
|
251
273
|
ref?: Prisma.StringNullableWithAggregatesFilter<"AgentMarketplace"> | string | null
|
|
274
|
+
rowSource?: Prisma.StringWithAggregatesFilter<"AgentMarketplace"> | string
|
|
275
|
+
enabled?: Prisma.BoolWithAggregatesFilter<"AgentMarketplace"> | boolean
|
|
252
276
|
createdAt?: Prisma.DateTimeWithAggregatesFilter<"AgentMarketplace"> | Date | string
|
|
253
277
|
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"AgentMarketplace"> | Date | string
|
|
254
278
|
}
|
|
@@ -258,6 +282,8 @@ export type AgentMarketplaceCreateInput = {
|
|
|
258
282
|
name: string
|
|
259
283
|
source: string
|
|
260
284
|
ref?: string | null
|
|
285
|
+
rowSource?: string
|
|
286
|
+
enabled?: boolean
|
|
261
287
|
createdAt?: Date | string
|
|
262
288
|
updatedAt?: Date | string
|
|
263
289
|
agent: Prisma.AgentCreateNestedOneWithoutMarketplacesInput
|
|
@@ -269,6 +295,8 @@ export type AgentMarketplaceUncheckedCreateInput = {
|
|
|
269
295
|
name: string
|
|
270
296
|
source: string
|
|
271
297
|
ref?: string | null
|
|
298
|
+
rowSource?: string
|
|
299
|
+
enabled?: boolean
|
|
272
300
|
createdAt?: Date | string
|
|
273
301
|
updatedAt?: Date | string
|
|
274
302
|
}
|
|
@@ -278,6 +306,8 @@ export type AgentMarketplaceUpdateInput = {
|
|
|
278
306
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
|
279
307
|
source?: Prisma.StringFieldUpdateOperationsInput | string
|
|
280
308
|
ref?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
309
|
+
rowSource?: Prisma.StringFieldUpdateOperationsInput | string
|
|
310
|
+
enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
281
311
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
282
312
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
283
313
|
agent?: Prisma.AgentUpdateOneRequiredWithoutMarketplacesNestedInput
|
|
@@ -289,6 +319,8 @@ export type AgentMarketplaceUncheckedUpdateInput = {
|
|
|
289
319
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
|
290
320
|
source?: Prisma.StringFieldUpdateOperationsInput | string
|
|
291
321
|
ref?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
322
|
+
rowSource?: Prisma.StringFieldUpdateOperationsInput | string
|
|
323
|
+
enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
292
324
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
293
325
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
294
326
|
}
|
|
@@ -299,6 +331,8 @@ export type AgentMarketplaceCreateManyInput = {
|
|
|
299
331
|
name: string
|
|
300
332
|
source: string
|
|
301
333
|
ref?: string | null
|
|
334
|
+
rowSource?: string
|
|
335
|
+
enabled?: boolean
|
|
302
336
|
createdAt?: Date | string
|
|
303
337
|
updatedAt?: Date | string
|
|
304
338
|
}
|
|
@@ -308,6 +342,8 @@ export type AgentMarketplaceUpdateManyMutationInput = {
|
|
|
308
342
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
|
309
343
|
source?: Prisma.StringFieldUpdateOperationsInput | string
|
|
310
344
|
ref?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
345
|
+
rowSource?: Prisma.StringFieldUpdateOperationsInput | string
|
|
346
|
+
enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
311
347
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
312
348
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
313
349
|
}
|
|
@@ -318,6 +354,8 @@ export type AgentMarketplaceUncheckedUpdateManyInput = {
|
|
|
318
354
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
|
319
355
|
source?: Prisma.StringFieldUpdateOperationsInput | string
|
|
320
356
|
ref?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
357
|
+
rowSource?: Prisma.StringFieldUpdateOperationsInput | string
|
|
358
|
+
enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
321
359
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
322
360
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
323
361
|
}
|
|
@@ -343,6 +381,8 @@ export type AgentMarketplaceCountOrderByAggregateInput = {
|
|
|
343
381
|
name?: Prisma.SortOrder
|
|
344
382
|
source?: Prisma.SortOrder
|
|
345
383
|
ref?: Prisma.SortOrder
|
|
384
|
+
rowSource?: Prisma.SortOrder
|
|
385
|
+
enabled?: Prisma.SortOrder
|
|
346
386
|
createdAt?: Prisma.SortOrder
|
|
347
387
|
updatedAt?: Prisma.SortOrder
|
|
348
388
|
}
|
|
@@ -353,6 +393,8 @@ export type AgentMarketplaceMaxOrderByAggregateInput = {
|
|
|
353
393
|
name?: Prisma.SortOrder
|
|
354
394
|
source?: Prisma.SortOrder
|
|
355
395
|
ref?: Prisma.SortOrder
|
|
396
|
+
rowSource?: Prisma.SortOrder
|
|
397
|
+
enabled?: Prisma.SortOrder
|
|
356
398
|
createdAt?: Prisma.SortOrder
|
|
357
399
|
updatedAt?: Prisma.SortOrder
|
|
358
400
|
}
|
|
@@ -363,6 +405,8 @@ export type AgentMarketplaceMinOrderByAggregateInput = {
|
|
|
363
405
|
name?: Prisma.SortOrder
|
|
364
406
|
source?: Prisma.SortOrder
|
|
365
407
|
ref?: Prisma.SortOrder
|
|
408
|
+
rowSource?: Prisma.SortOrder
|
|
409
|
+
enabled?: Prisma.SortOrder
|
|
366
410
|
createdAt?: Prisma.SortOrder
|
|
367
411
|
updatedAt?: Prisma.SortOrder
|
|
368
412
|
}
|
|
@@ -414,6 +458,8 @@ export type AgentMarketplaceCreateWithoutAgentInput = {
|
|
|
414
458
|
name: string
|
|
415
459
|
source: string
|
|
416
460
|
ref?: string | null
|
|
461
|
+
rowSource?: string
|
|
462
|
+
enabled?: boolean
|
|
417
463
|
createdAt?: Date | string
|
|
418
464
|
updatedAt?: Date | string
|
|
419
465
|
}
|
|
@@ -423,6 +469,8 @@ export type AgentMarketplaceUncheckedCreateWithoutAgentInput = {
|
|
|
423
469
|
name: string
|
|
424
470
|
source: string
|
|
425
471
|
ref?: string | null
|
|
472
|
+
rowSource?: string
|
|
473
|
+
enabled?: boolean
|
|
426
474
|
createdAt?: Date | string
|
|
427
475
|
updatedAt?: Date | string
|
|
428
476
|
}
|
|
@@ -462,6 +510,8 @@ export type AgentMarketplaceScalarWhereInput = {
|
|
|
462
510
|
name?: Prisma.StringFilter<"AgentMarketplace"> | string
|
|
463
511
|
source?: Prisma.StringFilter<"AgentMarketplace"> | string
|
|
464
512
|
ref?: Prisma.StringNullableFilter<"AgentMarketplace"> | string | null
|
|
513
|
+
rowSource?: Prisma.StringFilter<"AgentMarketplace"> | string
|
|
514
|
+
enabled?: Prisma.BoolFilter<"AgentMarketplace"> | boolean
|
|
465
515
|
createdAt?: Prisma.DateTimeFilter<"AgentMarketplace"> | Date | string
|
|
466
516
|
updatedAt?: Prisma.DateTimeFilter<"AgentMarketplace"> | Date | string
|
|
467
517
|
}
|
|
@@ -471,6 +521,8 @@ export type AgentMarketplaceCreateManyAgentInput = {
|
|
|
471
521
|
name: string
|
|
472
522
|
source: string
|
|
473
523
|
ref?: string | null
|
|
524
|
+
rowSource?: string
|
|
525
|
+
enabled?: boolean
|
|
474
526
|
createdAt?: Date | string
|
|
475
527
|
updatedAt?: Date | string
|
|
476
528
|
}
|
|
@@ -480,6 +532,8 @@ export type AgentMarketplaceUpdateWithoutAgentInput = {
|
|
|
480
532
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
|
481
533
|
source?: Prisma.StringFieldUpdateOperationsInput | string
|
|
482
534
|
ref?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
535
|
+
rowSource?: Prisma.StringFieldUpdateOperationsInput | string
|
|
536
|
+
enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
483
537
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
484
538
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
485
539
|
}
|
|
@@ -489,6 +543,8 @@ export type AgentMarketplaceUncheckedUpdateWithoutAgentInput = {
|
|
|
489
543
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
|
490
544
|
source?: Prisma.StringFieldUpdateOperationsInput | string
|
|
491
545
|
ref?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
546
|
+
rowSource?: Prisma.StringFieldUpdateOperationsInput | string
|
|
547
|
+
enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
492
548
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
493
549
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
494
550
|
}
|
|
@@ -498,6 +554,8 @@ export type AgentMarketplaceUncheckedUpdateManyWithoutAgentInput = {
|
|
|
498
554
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
|
499
555
|
source?: Prisma.StringFieldUpdateOperationsInput | string
|
|
500
556
|
ref?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
557
|
+
rowSource?: Prisma.StringFieldUpdateOperationsInput | string
|
|
558
|
+
enabled?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
501
559
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
502
560
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
503
561
|
}
|
|
@@ -510,6 +568,8 @@ export type AgentMarketplaceSelect<ExtArgs extends runtime.Types.Extensions.Inte
|
|
|
510
568
|
name?: boolean
|
|
511
569
|
source?: boolean
|
|
512
570
|
ref?: boolean
|
|
571
|
+
rowSource?: boolean
|
|
572
|
+
enabled?: boolean
|
|
513
573
|
createdAt?: boolean
|
|
514
574
|
updatedAt?: boolean
|
|
515
575
|
agent?: boolean | Prisma.AgentDefaultArgs<ExtArgs>
|
|
@@ -521,6 +581,8 @@ export type AgentMarketplaceSelectCreateManyAndReturn<ExtArgs extends runtime.Ty
|
|
|
521
581
|
name?: boolean
|
|
522
582
|
source?: boolean
|
|
523
583
|
ref?: boolean
|
|
584
|
+
rowSource?: boolean
|
|
585
|
+
enabled?: boolean
|
|
524
586
|
createdAt?: boolean
|
|
525
587
|
updatedAt?: boolean
|
|
526
588
|
agent?: boolean | Prisma.AgentDefaultArgs<ExtArgs>
|
|
@@ -532,6 +594,8 @@ export type AgentMarketplaceSelectUpdateManyAndReturn<ExtArgs extends runtime.Ty
|
|
|
532
594
|
name?: boolean
|
|
533
595
|
source?: boolean
|
|
534
596
|
ref?: boolean
|
|
597
|
+
rowSource?: boolean
|
|
598
|
+
enabled?: boolean
|
|
535
599
|
createdAt?: boolean
|
|
536
600
|
updatedAt?: boolean
|
|
537
601
|
agent?: boolean | Prisma.AgentDefaultArgs<ExtArgs>
|
|
@@ -543,11 +607,13 @@ export type AgentMarketplaceSelectScalar = {
|
|
|
543
607
|
name?: boolean
|
|
544
608
|
source?: boolean
|
|
545
609
|
ref?: boolean
|
|
610
|
+
rowSource?: boolean
|
|
611
|
+
enabled?: boolean
|
|
546
612
|
createdAt?: boolean
|
|
547
613
|
updatedAt?: boolean
|
|
548
614
|
}
|
|
549
615
|
|
|
550
|
-
export type AgentMarketplaceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "agentId" | "name" | "source" | "ref" | "createdAt" | "updatedAt", ExtArgs["result"]["agentMarketplace"]>
|
|
616
|
+
export type AgentMarketplaceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "agentId" | "name" | "source" | "ref" | "rowSource" | "enabled" | "createdAt" | "updatedAt", ExtArgs["result"]["agentMarketplace"]>
|
|
551
617
|
export type AgentMarketplaceInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
|
552
618
|
agent?: boolean | Prisma.AgentDefaultArgs<ExtArgs>
|
|
553
619
|
}
|
|
@@ -569,6 +635,8 @@ export type $AgentMarketplacePayload<ExtArgs extends runtime.Types.Extensions.In
|
|
|
569
635
|
name: string
|
|
570
636
|
source: string
|
|
571
637
|
ref: string | null
|
|
638
|
+
rowSource: string
|
|
639
|
+
enabled: boolean
|
|
572
640
|
createdAt: Date
|
|
573
641
|
updatedAt: Date
|
|
574
642
|
}, ExtArgs["result"]["agentMarketplace"]>
|
|
@@ -1000,6 +1068,8 @@ export interface AgentMarketplaceFieldRefs {
|
|
|
1000
1068
|
readonly name: Prisma.FieldRef<"AgentMarketplace", 'String'>
|
|
1001
1069
|
readonly source: Prisma.FieldRef<"AgentMarketplace", 'String'>
|
|
1002
1070
|
readonly ref: Prisma.FieldRef<"AgentMarketplace", 'String'>
|
|
1071
|
+
readonly rowSource: Prisma.FieldRef<"AgentMarketplace", 'String'>
|
|
1072
|
+
readonly enabled: Prisma.FieldRef<"AgentMarketplace", 'Boolean'>
|
|
1003
1073
|
readonly createdAt: Prisma.FieldRef<"AgentMarketplace", 'DateTime'>
|
|
1004
1074
|
readonly updatedAt: Prisma.FieldRef<"AgentMarketplace", 'DateTime'>
|
|
1005
1075
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
-- TMK-2.1: AgentMarketplace provenance and tombstones. Additive only: existing
|
|
2
|
+
-- rows get rowSource = 'custom' and enabled = true.
|
|
3
|
+
-- AlterTable
|
|
4
|
+
ALTER TABLE "AgentMarketplace" ADD COLUMN "enabled" BOOLEAN NOT NULL DEFAULT true,
|
|
5
|
+
ADD COLUMN "rowSource" TEXT NOT NULL DEFAULT 'custom';
|
|
@@ -681,6 +681,8 @@ model AgentMarketplace {
|
|
|
681
681
|
name String
|
|
682
682
|
source String
|
|
683
683
|
ref String?
|
|
684
|
+
rowSource String @default("custom") // TMK-2.1: 'template' | 'custom'; named rowSource because source is the git URL
|
|
685
|
+
enabled Boolean @default(true) // TMK-2.1: false = tombstone of a deleted template row; hidden from the config bundle
|
|
684
686
|
createdAt DateTime @default(now())
|
|
685
687
|
updatedAt DateTime @updatedAt
|
|
686
688
|
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
import { renderAdminPage } from "./admin-ui-layout.ts";
|
|
12
12
|
import { escapeHtml } from "./admin-ui-styles.ts";
|
|
13
|
+
import {
|
|
14
|
+
AGENT_TEMPLATE_ITEM_KINDS,
|
|
15
|
+
type AgentTemplateItemKind,
|
|
16
|
+
} from "./agent-template-items.ts";
|
|
13
17
|
import {
|
|
14
18
|
buildSettingsNav,
|
|
15
19
|
renderSettingsLayout,
|
|
@@ -26,7 +30,7 @@ export interface TemplateScopeOption {
|
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
export interface TemplateItemRow {
|
|
29
|
-
kind:
|
|
33
|
+
kind: AgentTemplateItemKind;
|
|
30
34
|
key: string;
|
|
31
35
|
payload: Record<string, unknown>;
|
|
32
36
|
}
|
|
@@ -90,6 +94,9 @@ function itemFields(
|
|
|
90
94
|
case "plugin":
|
|
91
95
|
return `<label>Version <input name="version" class="form-input" value="${escapeHtml(str(p.version))}" placeholder="latest" /></label>
|
|
92
96
|
<label><input type="checkbox" name="enabled" value="1"${checked(p.enabled)} /> Enabled</label>`;
|
|
97
|
+
case "marketplace":
|
|
98
|
+
return `<label>Source <input name="source" class="form-input" value="${escapeHtml(str(p.source))}" placeholder="owner/repo" /></label>
|
|
99
|
+
<label>Ref <input name="ref" class="form-input" value="${escapeHtml(str(p.ref))}" placeholder="default branch" /></label>`;
|
|
93
100
|
case "cron":
|
|
94
101
|
return `<label>Schedule <input name="schedule" class="form-input" value="${escapeHtml(str(p.schedule))}" placeholder="0 9 * * 1-5" /></label>
|
|
95
102
|
<label>Prompt <textarea name="prompt" class="form-input" rows="2">${escapeHtml(str(p.prompt))}</textarea></label>
|
|
@@ -106,6 +113,7 @@ const KIND_COPY = {
|
|
|
106
113
|
tool: { title: "Tools", key: "Tool pattern", ph: "Bash(git *)" },
|
|
107
114
|
plugin: { title: "Plugins", key: "Plugin", ph: "shipwright@shipwright" },
|
|
108
115
|
cron: { title: "Crons", key: "Name", ph: "daily-digest" },
|
|
116
|
+
marketplace: { title: "Marketplaces", key: "Name", ph: "example-plugins" },
|
|
109
117
|
} as const;
|
|
110
118
|
|
|
111
119
|
function kindCard(o: TemplatesPageOpts, kind: TemplateItemRow["kind"]): string {
|
|
@@ -158,11 +166,11 @@ export function renderTemplatesPage(o: TemplatesPageOpts): string {
|
|
|
158
166
|
isAdmin: o.isAdmin ?? false,
|
|
159
167
|
body: `${error}${notice}
|
|
160
168
|
<div class="card">
|
|
161
|
-
<p class="help-text">Default env vars, tools, plugins and
|
|
169
|
+
<p class="help-text">Default env vars, tools, plugins, crons and plugin marketplaces for new agents in a scope. Secret values are masked after saving; leave <code>***</code> to keep the stored value.</p>
|
|
162
170
|
${scopePicker(o)}
|
|
163
171
|
${del}
|
|
164
172
|
</div>
|
|
165
|
-
${
|
|
173
|
+
${AGENT_TEMPLATE_ITEM_KINDS.map((k) => kindCard(o, k)).join("\n")}`,
|
|
166
174
|
}),
|
|
167
175
|
});
|
|
168
176
|
}
|
|
@@ -190,6 +190,15 @@ export function registerAdminTemplatesRoutes(
|
|
|
190
190
|
enabled: flag(form, "enabled"),
|
|
191
191
|
},
|
|
192
192
|
};
|
|
193
|
+
case "marketplace":
|
|
194
|
+
return {
|
|
195
|
+
kind,
|
|
196
|
+
key,
|
|
197
|
+
payload: {
|
|
198
|
+
source: field(form, "source"),
|
|
199
|
+
ref: orNull(field(form, "ref")),
|
|
200
|
+
},
|
|
201
|
+
};
|
|
193
202
|
case "cron":
|
|
194
203
|
return {
|
|
195
204
|
kind,
|
|
@@ -238,6 +238,118 @@ describeOrSkip("AgentMarketplaceService + routes (integration)", () => {
|
|
|
238
238
|
});
|
|
239
239
|
});
|
|
240
240
|
|
|
241
|
+
describe("row source and tombstones (TMK-2.1)", () => {
|
|
242
|
+
const seedTemplate = (agentId: string, name = "tpl") =>
|
|
243
|
+
prisma.agentMarketplace.create({
|
|
244
|
+
data: {
|
|
245
|
+
agentId,
|
|
246
|
+
name,
|
|
247
|
+
source: "o/r",
|
|
248
|
+
rowSource: "template",
|
|
249
|
+
enabled: true,
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
it("upsert writes custom/enabled and overrides a template row", async () => {
|
|
254
|
+
const tpl = await seedTemplate(agentA);
|
|
255
|
+
const res = await adminApp.request(
|
|
256
|
+
`/agents/${agentA}/marketplaces`,
|
|
257
|
+
json(tokenA, { name: "tpl", source: "o/other" }),
|
|
258
|
+
);
|
|
259
|
+
expect(res.status).toBe(201);
|
|
260
|
+
const body = (await res.json()).marketplace;
|
|
261
|
+
expect(body.rowSource).toBe("custom");
|
|
262
|
+
expect(body.enabled).toBe(true);
|
|
263
|
+
const row = await prisma.agentMarketplace.findUnique({
|
|
264
|
+
where: { id: tpl.id },
|
|
265
|
+
});
|
|
266
|
+
expect(row?.rowSource).toBe("custom");
|
|
267
|
+
expect(row?.source).toBe("o/other");
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
it("DELETE tombstones a template row and removes a custom row", async () => {
|
|
271
|
+
const tpl = await seedTemplate(agentA);
|
|
272
|
+
const custom = await service.upsert(agentA, {
|
|
273
|
+
name: "mine",
|
|
274
|
+
source: "o/m",
|
|
275
|
+
});
|
|
276
|
+
for (const id of [tpl.id, custom.id]) {
|
|
277
|
+
const res = await adminApp.request(
|
|
278
|
+
`/agents/${agentA}/marketplaces/${id}`,
|
|
279
|
+
json(tokenA, undefined, "DELETE"),
|
|
280
|
+
);
|
|
281
|
+
expect(res.status).toBe(204);
|
|
282
|
+
}
|
|
283
|
+
const tomb = await prisma.agentMarketplace.findUnique({
|
|
284
|
+
where: { id: tpl.id },
|
|
285
|
+
});
|
|
286
|
+
expect(tomb?.enabled).toBe(false);
|
|
287
|
+
expect(tomb?.rowSource).toBe("custom");
|
|
288
|
+
expect(
|
|
289
|
+
await prisma.agentMarketplace.findUnique({ where: { id: custom.id } }),
|
|
290
|
+
).toBeNull();
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it("addFromTemplate creates a template row, refreshes it, and leaves custom rows alone", async () => {
|
|
294
|
+
const created = await service.addFromTemplate(agentA, {
|
|
295
|
+
name: "tpl",
|
|
296
|
+
source: "o/r",
|
|
297
|
+
ref: "v1",
|
|
298
|
+
});
|
|
299
|
+
expect(created.rowSource).toBe("template");
|
|
300
|
+
expect(created.enabled).toBe(true);
|
|
301
|
+
const refreshed = await service.addFromTemplate(agentA, {
|
|
302
|
+
name: "tpl",
|
|
303
|
+
source: "o/r2",
|
|
304
|
+
ref: null,
|
|
305
|
+
});
|
|
306
|
+
expect(refreshed.id).toBe(created.id);
|
|
307
|
+
expect(refreshed.source).toBe("o/r2");
|
|
308
|
+
expect(refreshed.rowSource).toBe("template");
|
|
309
|
+
|
|
310
|
+
const custom = await service.upsert(agentA, {
|
|
311
|
+
name: "mine",
|
|
312
|
+
source: "o/m",
|
|
313
|
+
});
|
|
314
|
+
const untouched = await service.addFromTemplate(agentA, {
|
|
315
|
+
name: "mine",
|
|
316
|
+
source: "o/x",
|
|
317
|
+
});
|
|
318
|
+
expect(untouched.source).toBe("o/m");
|
|
319
|
+
expect(untouched.rowSource).toBe("custom");
|
|
320
|
+
expect(untouched.id).toBe(custom.id);
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
it("addFromTemplate validates input like upsert", async () => {
|
|
324
|
+
await expect(
|
|
325
|
+
(async () =>
|
|
326
|
+
service.addFromTemplate(agentA, { name: "m", source: "../etc" }))(),
|
|
327
|
+
).rejects.toThrow(UnprocessableEntityError);
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
it("GET lists rowSource/enabled and the config bundle omits tombstones", async () => {
|
|
331
|
+
const tpl = await seedTemplate(agentA, "gone");
|
|
332
|
+
await service.upsert(agentA, { name: "kept", source: "o/k" });
|
|
333
|
+
await adminApp.request(
|
|
334
|
+
`/agents/${agentA}/marketplaces/${tpl.id}`,
|
|
335
|
+
json(tokenA, undefined, "DELETE"),
|
|
336
|
+
);
|
|
337
|
+
const list = await adminApp.request(
|
|
338
|
+
`/agents/${agentA}/marketplaces`,
|
|
339
|
+
get(tokenA),
|
|
340
|
+
);
|
|
341
|
+
const rows = (await list.json()).marketplaces;
|
|
342
|
+
expect(rows.map((r: { enabled: boolean }) => r.enabled).sort()).toEqual([
|
|
343
|
+
false,
|
|
344
|
+
true,
|
|
345
|
+
]);
|
|
346
|
+
const cfg = await runtimeApp.request(`/${agentA}/config`, get(tokenA));
|
|
347
|
+
expect((await cfg.json()).marketplaces).toEqual([
|
|
348
|
+
{ name: "kept", source: "o/k", ref: null },
|
|
349
|
+
]);
|
|
350
|
+
});
|
|
351
|
+
});
|
|
352
|
+
|
|
241
353
|
describe("GET /agents/:id/config", () => {
|
|
242
354
|
it("includes marketplaces: [] when none", async () => {
|
|
243
355
|
const res = await runtimeApp.request(`/${agentA}/config`, get(tokenA));
|
|
@@ -79,4 +79,13 @@ describeOrSkip("AgentMarketplace (integration)", () => {
|
|
|
79
79
|
await prisma.agent.delete({ where: { id: agentId } });
|
|
80
80
|
expect(await prisma.agentMarketplace.count({ where: { agentId } })).toBe(0);
|
|
81
81
|
});
|
|
82
|
+
|
|
83
|
+
it("defaults rowSource to custom and enabled to true", async () => {
|
|
84
|
+
const agentId = await createAgent();
|
|
85
|
+
const row = await prisma.agentMarketplace.create({
|
|
86
|
+
data: { agentId, name: "d", source: "o/r" },
|
|
87
|
+
});
|
|
88
|
+
expect(row.rowSource).toBe("custom");
|
|
89
|
+
expect(row.enabled).toBe(true);
|
|
90
|
+
});
|
|
82
91
|
});
|
|
@@ -20,6 +20,7 @@ import type {
|
|
|
20
20
|
PrismaClient,
|
|
21
21
|
} from "../prisma/client/client.ts";
|
|
22
22
|
import { NotFoundError, UnprocessableEntityError } from "./errors.ts";
|
|
23
|
+
import type { PrismaTransactionClient } from "./prisma-tx.ts";
|
|
23
24
|
|
|
24
25
|
export type { AgentMarketplace };
|
|
25
26
|
|
|
@@ -99,8 +100,49 @@ export class AgentMarketplaceService {
|
|
|
99
100
|
validateMarketplaceRef(ref);
|
|
100
101
|
return this.prisma.agentMarketplace.upsert({
|
|
101
102
|
where: { agentId_name: { agentId, name } },
|
|
102
|
-
create: {
|
|
103
|
-
|
|
103
|
+
create: {
|
|
104
|
+
agentId,
|
|
105
|
+
name,
|
|
106
|
+
source,
|
|
107
|
+
ref,
|
|
108
|
+
rowSource: "custom",
|
|
109
|
+
enabled: true,
|
|
110
|
+
},
|
|
111
|
+
update: { source, ref, rowSource: "custom", enabled: true },
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Internal reconcile write path (TMK-2.1); never exposed over HTTP.
|
|
117
|
+
* Creates a template-owned marketplace, or refreshes one that is still
|
|
118
|
+
* template-owned. A custom row (user edit or tombstone) is returned
|
|
119
|
+
* untouched. Validates input as upsert() does.
|
|
120
|
+
*/
|
|
121
|
+
async addFromTemplate(
|
|
122
|
+
agentId: string,
|
|
123
|
+
input: { name: string; source: string; ref?: string | null },
|
|
124
|
+
client: PrismaTransactionClient = this.prisma,
|
|
125
|
+
): Promise<AgentMarketplace> {
|
|
126
|
+
const { name, source } = input;
|
|
127
|
+
const ref = input.ref ?? null;
|
|
128
|
+
validateMarketplaceName(name);
|
|
129
|
+
validateMarketplaceSource(source);
|
|
130
|
+
validateMarketplaceRef(ref);
|
|
131
|
+
const existing = await client.agentMarketplace.findUnique({
|
|
132
|
+
where: { agentId_name: { agentId, name } },
|
|
133
|
+
});
|
|
134
|
+
if (existing?.rowSource === "custom") return existing;
|
|
135
|
+
return client.agentMarketplace.upsert({
|
|
136
|
+
where: { agentId_name: { agentId, name } },
|
|
137
|
+
create: {
|
|
138
|
+
agentId,
|
|
139
|
+
name,
|
|
140
|
+
source,
|
|
141
|
+
ref,
|
|
142
|
+
rowSource: "template",
|
|
143
|
+
enabled: true,
|
|
144
|
+
},
|
|
145
|
+
update: { source, ref, rowSource: "template", enabled: true },
|
|
104
146
|
});
|
|
105
147
|
}
|
|
106
148
|
|
|
@@ -115,6 +157,14 @@ export class AgentMarketplaceService {
|
|
|
115
157
|
if (!existing || existing.agentId !== agentId) {
|
|
116
158
|
throw new NotFoundError(`marketplace ${marketplaceId} not found`);
|
|
117
159
|
}
|
|
160
|
+
if (existing.rowSource === "template") {
|
|
161
|
+
// Tombstone so a later reconcile does not re-add the row.
|
|
162
|
+
await this.prisma.agentMarketplace.update({
|
|
163
|
+
where: { id: marketplaceId },
|
|
164
|
+
data: { enabled: false, rowSource: "custom" },
|
|
165
|
+
});
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
118
168
|
await this.prisma.agentMarketplace.delete({ where: { id: marketplaceId } });
|
|
119
169
|
}
|
|
120
170
|
}
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
import type { Prisma } from "../prisma/client/client.ts";
|
|
14
14
|
import { ANTHROPIC_CREDENTIAL_KEYS } from "./anthropic-credential-guard.ts";
|
|
15
|
+
import {
|
|
16
|
+
validateMarketplaceName,
|
|
17
|
+
validateMarketplaceRef,
|
|
18
|
+
validateMarketplaceSource,
|
|
19
|
+
} from "./agent-marketplaces.ts";
|
|
15
20
|
import { UnprocessableEntityError } from "./errors.ts";
|
|
16
21
|
import type { TokenCrypto } from "./token-crypto.ts";
|
|
17
22
|
|
|
@@ -20,6 +25,7 @@ export const AGENT_TEMPLATE_ITEM_KINDS = [
|
|
|
20
25
|
"tool",
|
|
21
26
|
"plugin",
|
|
22
27
|
"cron",
|
|
28
|
+
"marketplace",
|
|
23
29
|
] as const;
|
|
24
30
|
export type AgentTemplateItemKind = (typeof AGENT_TEMPLATE_ITEM_KINDS)[number];
|
|
25
31
|
|
|
@@ -55,6 +61,20 @@ export function openTemplateItemPayload(
|
|
|
55
61
|
return { ...payload, value: crypto.decrypt(payload.value) };
|
|
56
62
|
}
|
|
57
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Throws UnprocessableEntityError (422) unless a marketplace item's key (the
|
|
66
|
+
* marketplace name) and payload ({source, ref?}) pass the same validators as
|
|
67
|
+
* POST /agents/:id/marketplaces.
|
|
68
|
+
*/
|
|
69
|
+
export function assertMarketplaceTemplateItem(
|
|
70
|
+
key: string,
|
|
71
|
+
payload: { source: string; ref?: string | null },
|
|
72
|
+
): void {
|
|
73
|
+
validateMarketplaceName(key);
|
|
74
|
+
validateMarketplaceSource(payload.source);
|
|
75
|
+
validateMarketplaceRef(payload.ref);
|
|
76
|
+
}
|
|
77
|
+
|
|
58
78
|
/**
|
|
59
79
|
* Env keys a template may never carry (ATP-1.3): per-agent credentials that
|
|
60
80
|
* are minted for, or provisioned onto, one specific agent. Copying them from a
|