@app-vitals/agent-admin 1.4.0 → 1.5.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 CHANGED
@@ -2808,6 +2808,12 @@
2808
2808
  "$ref": "#/components/schemas/AgentConfigPlugin"
2809
2809
  }
2810
2810
  },
2811
+ "marketplaces": {
2812
+ "type": "array",
2813
+ "items": {
2814
+ "$ref": "#/components/schemas/AgentConfigMarketplace"
2815
+ }
2816
+ },
2811
2817
  "repos": {
2812
2818
  "type": "array",
2813
2819
  "items": {
@@ -3362,6 +3368,128 @@
3362
3368
  "transcriptUpload",
3363
3369
  "repoAccessCheck"
3364
3370
  ]
3371
+ },
3372
+ "AgentMarketplace": {
3373
+ "type": "object",
3374
+ "properties": {
3375
+ "id": {
3376
+ "type": "string",
3377
+ "example": "clx1234567890"
3378
+ },
3379
+ "agentId": {
3380
+ "type": "string",
3381
+ "example": "clx1234567890"
3382
+ },
3383
+ "name": {
3384
+ "type": "string",
3385
+ "example": "shipwright"
3386
+ },
3387
+ "source": {
3388
+ "type": "string",
3389
+ "example": "app-vitals/shipwright"
3390
+ },
3391
+ "ref": {
3392
+ "type": [
3393
+ "string",
3394
+ "null"
3395
+ ],
3396
+ "example": "main"
3397
+ },
3398
+ "createdAt": {
3399
+ "type": "string",
3400
+ "format": "date-time",
3401
+ "example": "2026-01-01T00:00:00.000Z"
3402
+ },
3403
+ "updatedAt": {
3404
+ "type": "string",
3405
+ "format": "date-time",
3406
+ "example": "2026-01-01T00:00:00.000Z"
3407
+ }
3408
+ },
3409
+ "required": [
3410
+ "id",
3411
+ "agentId",
3412
+ "name",
3413
+ "source",
3414
+ "ref",
3415
+ "createdAt",
3416
+ "updatedAt"
3417
+ ]
3418
+ },
3419
+ "UpsertAgentMarketplaceBody": {
3420
+ "type": "object",
3421
+ "properties": {
3422
+ "name": {
3423
+ "type": "string",
3424
+ "example": "shipwright"
3425
+ },
3426
+ "source": {
3427
+ "type": "string",
3428
+ "description": "GitHub `owner/repo` or an https git URL",
3429
+ "example": "app-vitals/shipwright"
3430
+ },
3431
+ "ref": {
3432
+ "type": [
3433
+ "string",
3434
+ "null"
3435
+ ],
3436
+ "example": "main"
3437
+ }
3438
+ },
3439
+ "required": [
3440
+ "name",
3441
+ "source"
3442
+ ]
3443
+ },
3444
+ "MarketplaceWrapper": {
3445
+ "type": "object",
3446
+ "properties": {
3447
+ "marketplace": {
3448
+ "$ref": "#/components/schemas/AgentMarketplace"
3449
+ }
3450
+ },
3451
+ "required": [
3452
+ "marketplace"
3453
+ ]
3454
+ },
3455
+ "MarketplacesWrapper": {
3456
+ "type": "object",
3457
+ "properties": {
3458
+ "marketplaces": {
3459
+ "type": "array",
3460
+ "items": {
3461
+ "$ref": "#/components/schemas/AgentMarketplace"
3462
+ }
3463
+ }
3464
+ },
3465
+ "required": [
3466
+ "marketplaces"
3467
+ ]
3468
+ },
3469
+ "AgentConfigMarketplace": {
3470
+ "type": "object",
3471
+ "properties": {
3472
+ "name": {
3473
+ "type": "string",
3474
+ "example": "shipwright"
3475
+ },
3476
+ "source": {
3477
+ "type": "string",
3478
+ "example": "app-vitals/shipwright"
3479
+ },
3480
+ "ref": {
3481
+ "type": [
3482
+ "string",
3483
+ "null"
3484
+ ],
3485
+ "example": "main"
3486
+ }
3487
+ },
3488
+ "required": [
3489
+ "name",
3490
+ "source",
3491
+ "ref"
3492
+ ]
3365
3493
  }
3366
3494
  },
3367
3495
  "parameters": {}
@@ -6497,6 +6625,132 @@
6497
6625
  }
6498
6626
  }
6499
6627
  }
6628
+ },
6629
+ "/agents/{id}/marketplaces": {
6630
+ "get": {
6631
+ "summary": "List marketplaces",
6632
+ "description": "Returns every remote plugin marketplace configured for the agent.",
6633
+ "parameters": [
6634
+ {
6635
+ "schema": {
6636
+ "type": "string",
6637
+ "example": "clx1234567890"
6638
+ },
6639
+ "required": true,
6640
+ "name": "id",
6641
+ "in": "path"
6642
+ }
6643
+ ],
6644
+ "responses": {
6645
+ "200": {
6646
+ "description": "List of marketplaces",
6647
+ "content": {
6648
+ "application/json": {
6649
+ "schema": {
6650
+ "$ref": "#/components/schemas/MarketplacesWrapper"
6651
+ }
6652
+ }
6653
+ }
6654
+ }
6655
+ }
6656
+ },
6657
+ "post": {
6658
+ "summary": "Add or update a marketplace",
6659
+ "description": "Upserts a remote plugin marketplace by `name`. `source` must be a GitHub `owner/repo` or an https git URL (no credentials); `ref` optionally pins a branch, tag or sha. 422 on an invalid `name`, `source` or `ref`.",
6660
+ "parameters": [
6661
+ {
6662
+ "schema": {
6663
+ "type": "string",
6664
+ "example": "clx1234567890"
6665
+ },
6666
+ "required": true,
6667
+ "name": "id",
6668
+ "in": "path"
6669
+ }
6670
+ ],
6671
+ "requestBody": {
6672
+ "content": {
6673
+ "application/json": {
6674
+ "schema": {
6675
+ "$ref": "#/components/schemas/UpsertAgentMarketplaceBody"
6676
+ }
6677
+ }
6678
+ }
6679
+ },
6680
+ "responses": {
6681
+ "201": {
6682
+ "description": "Marketplace added or updated",
6683
+ "content": {
6684
+ "application/json": {
6685
+ "schema": {
6686
+ "$ref": "#/components/schemas/MarketplaceWrapper"
6687
+ }
6688
+ }
6689
+ }
6690
+ },
6691
+ "400": {
6692
+ "description": "Bad request",
6693
+ "content": {
6694
+ "application/json": {
6695
+ "schema": {
6696
+ "$ref": "#/components/schemas/Error"
6697
+ }
6698
+ }
6699
+ }
6700
+ },
6701
+ "422": {
6702
+ "description": "Invalid name, source or ref",
6703
+ "content": {
6704
+ "application/json": {
6705
+ "schema": {
6706
+ "$ref": "#/components/schemas/Error"
6707
+ }
6708
+ }
6709
+ }
6710
+ }
6711
+ }
6712
+ }
6713
+ },
6714
+ "/agents/{id}/marketplaces/{marketplaceId}": {
6715
+ "delete": {
6716
+ "summary": "Remove a marketplace",
6717
+ "description": "Removes the marketplace row by id. 404 when the id does not exist or belongs to a different agent.",
6718
+ "parameters": [
6719
+ {
6720
+ "schema": {
6721
+ "type": "string",
6722
+ "example": "clx1234567890"
6723
+ },
6724
+ "required": true,
6725
+ "name": "id",
6726
+ "in": "path"
6727
+ },
6728
+ {
6729
+ "schema": {
6730
+ "type": "string",
6731
+ "example": "clx0987654321"
6732
+ },
6733
+ "required": true,
6734
+ "name": "marketplaceId",
6735
+ "in": "path"
6736
+ }
6737
+ ],
6738
+ "responses": {
6739
+ "204": {
6740
+ "description": "Marketplace removed"
6741
+ },
6742
+ "404": {
6743
+ "description": "Marketplace not found",
6744
+ "content": {
6745
+ "application/json": {
6746
+ "schema": {
6747
+ "$ref": "#/components/schemas/Error"
6748
+ }
6749
+ }
6750
+ }
6751
+ }
6752
+ }
6753
+ }
6500
6754
  }
6501
6755
  },
6502
6756
  "webhooks": {}
@@ -2249,6 +2249,103 @@
2249
2249
  }
2250
2250
  }
2251
2251
  },
2252
+ "MarketplacesWrapper": {
2253
+ "type": "object",
2254
+ "properties": {
2255
+ "marketplaces": {
2256
+ "type": "array",
2257
+ "items": {
2258
+ "$ref": "#/components/schemas/AgentMarketplace"
2259
+ }
2260
+ }
2261
+ },
2262
+ "required": [
2263
+ "marketplaces"
2264
+ ]
2265
+ },
2266
+ "AgentMarketplace": {
2267
+ "type": "object",
2268
+ "properties": {
2269
+ "id": {
2270
+ "type": "string",
2271
+ "example": "clx1234567890"
2272
+ },
2273
+ "agentId": {
2274
+ "type": "string",
2275
+ "example": "clx1234567890"
2276
+ },
2277
+ "name": {
2278
+ "type": "string",
2279
+ "example": "shipwright"
2280
+ },
2281
+ "source": {
2282
+ "type": "string",
2283
+ "example": "app-vitals/shipwright"
2284
+ },
2285
+ "ref": {
2286
+ "type": [
2287
+ "string",
2288
+ "null"
2289
+ ],
2290
+ "example": "main"
2291
+ },
2292
+ "createdAt": {
2293
+ "type": "string",
2294
+ "format": "date-time",
2295
+ "example": "2026-01-01T00:00:00.000Z"
2296
+ },
2297
+ "updatedAt": {
2298
+ "type": "string",
2299
+ "format": "date-time",
2300
+ "example": "2026-01-01T00:00:00.000Z"
2301
+ }
2302
+ },
2303
+ "required": [
2304
+ "id",
2305
+ "agentId",
2306
+ "name",
2307
+ "source",
2308
+ "ref",
2309
+ "createdAt",
2310
+ "updatedAt"
2311
+ ]
2312
+ },
2313
+ "MarketplaceWrapper": {
2314
+ "type": "object",
2315
+ "properties": {
2316
+ "marketplace": {
2317
+ "$ref": "#/components/schemas/AgentMarketplace"
2318
+ }
2319
+ },
2320
+ "required": [
2321
+ "marketplace"
2322
+ ]
2323
+ },
2324
+ "UpsertAgentMarketplaceBody": {
2325
+ "type": "object",
2326
+ "properties": {
2327
+ "name": {
2328
+ "type": "string",
2329
+ "example": "shipwright"
2330
+ },
2331
+ "source": {
2332
+ "type": "string",
2333
+ "description": "GitHub `owner/repo` or an https git URL",
2334
+ "example": "app-vitals/shipwright"
2335
+ },
2336
+ "ref": {
2337
+ "type": [
2338
+ "string",
2339
+ "null"
2340
+ ],
2341
+ "example": "main"
2342
+ }
2343
+ },
2344
+ "required": [
2345
+ "name",
2346
+ "source"
2347
+ ]
2348
+ },
2252
2349
  "CronRunTokenStats": {
2253
2350
  "type": "object",
2254
2351
  "properties": {
@@ -3014,6 +3111,12 @@
3014
3111
  "$ref": "#/components/schemas/AgentConfigPlugin"
3015
3112
  }
3016
3113
  },
3114
+ "marketplaces": {
3115
+ "type": "array",
3116
+ "items": {
3117
+ "$ref": "#/components/schemas/AgentConfigMarketplace"
3118
+ }
3119
+ },
3017
3120
  "repos": {
3018
3121
  "type": "array",
3019
3122
  "items": {
@@ -3160,6 +3263,31 @@
3160
3263
  "plugin"
3161
3264
  ]
3162
3265
  },
3266
+ "AgentConfigMarketplace": {
3267
+ "type": "object",
3268
+ "properties": {
3269
+ "name": {
3270
+ "type": "string",
3271
+ "example": "shipwright"
3272
+ },
3273
+ "source": {
3274
+ "type": "string",
3275
+ "example": "app-vitals/shipwright"
3276
+ },
3277
+ "ref": {
3278
+ "type": [
3279
+ "string",
3280
+ "null"
3281
+ ],
3282
+ "example": "main"
3283
+ }
3284
+ },
3285
+ "required": [
3286
+ "name",
3287
+ "source",
3288
+ "ref"
3289
+ ]
3290
+ },
3163
3291
  "AgentConfigFeatures": {
3164
3292
  "type": "object",
3165
3293
  "properties": {
@@ -5426,6 +5554,132 @@
5426
5554
  }
5427
5555
  }
5428
5556
  },
5557
+ "/agents/{id}/marketplaces": {
5558
+ "get": {
5559
+ "summary": "List marketplaces",
5560
+ "description": "Returns every remote plugin marketplace configured for the agent.",
5561
+ "parameters": [
5562
+ {
5563
+ "schema": {
5564
+ "type": "string",
5565
+ "example": "clx1234567890"
5566
+ },
5567
+ "required": true,
5568
+ "name": "id",
5569
+ "in": "path"
5570
+ }
5571
+ ],
5572
+ "responses": {
5573
+ "200": {
5574
+ "description": "List of marketplaces",
5575
+ "content": {
5576
+ "application/json": {
5577
+ "schema": {
5578
+ "$ref": "#/components/schemas/MarketplacesWrapper"
5579
+ }
5580
+ }
5581
+ }
5582
+ }
5583
+ }
5584
+ },
5585
+ "post": {
5586
+ "summary": "Add or update a marketplace",
5587
+ "description": "Upserts a remote plugin marketplace by `name`. `source` must be a GitHub `owner/repo` or an https git URL (no credentials); `ref` optionally pins a branch, tag or sha. 422 on an invalid `name`, `source` or `ref`.",
5588
+ "parameters": [
5589
+ {
5590
+ "schema": {
5591
+ "type": "string",
5592
+ "example": "clx1234567890"
5593
+ },
5594
+ "required": true,
5595
+ "name": "id",
5596
+ "in": "path"
5597
+ }
5598
+ ],
5599
+ "requestBody": {
5600
+ "content": {
5601
+ "application/json": {
5602
+ "schema": {
5603
+ "$ref": "#/components/schemas/UpsertAgentMarketplaceBody"
5604
+ }
5605
+ }
5606
+ }
5607
+ },
5608
+ "responses": {
5609
+ "201": {
5610
+ "description": "Marketplace added or updated",
5611
+ "content": {
5612
+ "application/json": {
5613
+ "schema": {
5614
+ "$ref": "#/components/schemas/MarketplaceWrapper"
5615
+ }
5616
+ }
5617
+ }
5618
+ },
5619
+ "400": {
5620
+ "description": "Bad request",
5621
+ "content": {
5622
+ "application/json": {
5623
+ "schema": {
5624
+ "$ref": "#/components/schemas/Error"
5625
+ }
5626
+ }
5627
+ }
5628
+ },
5629
+ "422": {
5630
+ "description": "Invalid name, source or ref",
5631
+ "content": {
5632
+ "application/json": {
5633
+ "schema": {
5634
+ "$ref": "#/components/schemas/Error"
5635
+ }
5636
+ }
5637
+ }
5638
+ }
5639
+ }
5640
+ }
5641
+ },
5642
+ "/agents/{id}/marketplaces/{marketplaceId}": {
5643
+ "delete": {
5644
+ "summary": "Remove a marketplace",
5645
+ "description": "Removes the marketplace row by id. 404 when the id does not exist or belongs to a different agent.",
5646
+ "parameters": [
5647
+ {
5648
+ "schema": {
5649
+ "type": "string",
5650
+ "example": "clx1234567890"
5651
+ },
5652
+ "required": true,
5653
+ "name": "id",
5654
+ "in": "path"
5655
+ },
5656
+ {
5657
+ "schema": {
5658
+ "type": "string",
5659
+ "example": "clx0987654321"
5660
+ },
5661
+ "required": true,
5662
+ "name": "marketplaceId",
5663
+ "in": "path"
5664
+ }
5665
+ ],
5666
+ "responses": {
5667
+ "204": {
5668
+ "description": "Marketplace removed"
5669
+ },
5670
+ "404": {
5671
+ "description": "Marketplace not found",
5672
+ "content": {
5673
+ "application/json": {
5674
+ "schema": {
5675
+ "$ref": "#/components/schemas/Error"
5676
+ }
5677
+ }
5678
+ }
5679
+ }
5680
+ }
5681
+ }
5682
+ },
5429
5683
  "/agents/all/cron-runs/stats": {
5430
5684
  "get": {
5431
5685
  "summary": "Get aggregated cron-run token stats",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-vitals/agent-admin",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/app-vitals/agent.git",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@anthropic-ai/sdk": "0.135.0",
45
- "@app-vitals/agent-lib": "1.4.0",
45
+ "@app-vitals/agent-lib": "1.5.0",
46
46
  "@hono/zod-openapi": "^1.0.0",
47
47
  "@prisma/adapter-pg": "^7.10.0",
48
48
  "@prisma/client": "^7.10.0",
package/src/admin-boot.ts CHANGED
@@ -23,7 +23,7 @@
23
23
  * They use non-overlapping sub-paths so Hono resolves them correctly:
24
24
  * runtime → GET /agents/:id/config, GET /agents/:id/crons
25
25
  * admin → GET /agents/:id/crons/summary (enriched with run stats)
26
- * POST/PATCH/DELETE /agents/:id/envs, /crons, /tools, /tokens, /plugins
26
+ * POST/PATCH/DELETE /agents/:id/envs, /crons, /tools, /tokens, /plugins, /marketplaces
27
27
  *
28
28
  * This file must not import any coding module — main.ts is the only file
29
29
  * that wires a concrete extension in.
@@ -80,6 +80,7 @@ import { AgentCronRunStatsService } from "./agent-cron-run-stats.ts";
80
80
  import { AgentCronRunService } from "./agent-cron-runs.ts";
81
81
  import { AgentEnvService } from "./agent-envs.ts";
82
82
  import { AgentGitHubInstallationsService } from "./agent-github-installations.ts";
83
+ import { AgentMarketplaceService } from "./agent-marketplaces.ts";
83
84
  import { AgentMemberService } from "./agent-members.ts";
84
85
  import { AgentPluginService } from "./agent-plugins.ts";
85
86
  import { AgentTokenService } from "./agent-tokens.ts";
@@ -197,6 +198,7 @@ export async function startAdmin(
197
198
  const agentToolService = new AgentToolService(prisma);
198
199
  const agentTokenService = new AgentTokenService(prisma);
199
200
  const agentPluginService = new AgentPluginService(prisma);
201
+ const agentMarketplaceService = new AgentMarketplaceService(prisma);
200
202
  const agentMemberService = new AgentMemberService(prisma);
201
203
  // Account-aware caller scope (SSP-2.1). Account membership contributes
202
204
  // agents only when the self-serve flag is on; off → AgentMember-only.
@@ -433,6 +435,7 @@ export async function startAdmin(
433
435
  agentCronJobService,
434
436
  agentService,
435
437
  agentPluginService,
438
+ agentMarketplaceService,
436
439
  ...(resolvedExtensions.agentPhaseMethodologyService
437
440
  ? {
438
441
  agentPhaseMethodologyService:
@@ -461,6 +464,7 @@ export async function startAdmin(
461
464
  agentToolService,
462
465
  agentTokenService,
463
466
  agentPluginService,
467
+ agentMarketplaceService,
464
468
  agentMemberService,
465
469
  callerScopeResolver,
466
470
  specialtyRegistry,