@app-vitals/agent-admin 0.13.0 → 0.13.1
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/e2e/test-server.ts +5 -5
- package/openapi.json +12 -19
- package/openapi.platform.json +11 -18
- package/package.json +2 -2
- package/prisma/client/internal/class.ts +4 -4
- package/prisma/client/internal/prismaNamespace.ts +0 -1
- package/prisma/client/internal/prismaNamespaceBrowser.ts +0 -1
- package/prisma/client/models/Agent.ts +62 -137
- package/prisma/migrations/20261030000000_drop_agent_type_name/migration.sql +8 -0
- package/prisma/schema/schema.prisma +3 -4
- package/src/account-lifecycle.integration.test.ts +1 -1
- package/src/account-trial-warning-sweeper.integration.test.ts +1 -1
- package/src/admin-local-agent.smoke.test.ts +12 -12
- package/src/admin-ui-pages.ts +2 -2
- package/src/admin-ui-pages.unit.test.ts +2 -2
- package/src/admin-ui.fixtures.ts +6 -6
- package/src/admin-ui.smoke.test.ts +39 -39
- package/src/admin-ui.ts +8 -8
- package/src/agent-cron-jobs.integration.test.ts +8 -7
- package/src/agent-cron-jobs.ts +4 -5
- package/src/agent-cron-jobs.unit.test.ts +23 -23
- package/src/agent-patch-author-allowlist.integration.test.ts +4 -4
- package/src/agent-specialty-backfill.integration.test.ts +98 -53
- package/src/agents-api.integration.test.ts +20 -20
- package/src/agents-api.smoke.test.ts +76 -77
- package/src/agents-api.ts +9 -14
- package/src/agents.integration.test.ts +40 -53
- package/src/agents.ts +33 -46
- package/src/agents.unit.test.ts +28 -35
- package/src/api.smoke.test.ts +24 -2
- package/src/api.ts +15 -16
- package/src/openapi-schemas.ts +14 -7
- package/src/slack-provisioning-service.integration.test.ts +2 -2
- package/src/slack-provisioning.integration.test.ts +2 -2
- package/src/specialty-manifest-loader.ts +32 -32
- package/src/specialty-manifest-loader.unit.test.ts +8 -8
- package/src/startup-policy-reconcile.unit.test.ts +1 -1
- package/src/trial-expiry-sweeper.integration.test.ts +1 -1
- package/src/trial-expiry-warning-sweeper.integration.test.ts +1 -1
- package/src/agent-specialty.ts +0 -22
- package/src/agent-specialty.unit.test.ts +0 -43
package/e2e/test-server.ts
CHANGED
|
@@ -324,7 +324,7 @@ function buildMockDeps(chatClient: ChatClient | undefined): AdminUIDeps {
|
|
|
324
324
|
name: ADMIN_E2E_AGENT.name,
|
|
325
325
|
slackId: ADMIN_E2E_AGENT.slackId,
|
|
326
326
|
selfHosted: false,
|
|
327
|
-
|
|
327
|
+
specialty: "coding",
|
|
328
328
|
createdAt: new Date("2024-01-01"),
|
|
329
329
|
updatedAt: new Date("2024-01-01"),
|
|
330
330
|
},
|
|
@@ -334,12 +334,12 @@ function buildMockDeps(chatClient: ChatClient | undefined): AdminUIDeps {
|
|
|
334
334
|
listOptions: async () => [
|
|
335
335
|
{ id: ADMIN_E2E_AGENT.id, name: ADMIN_E2E_AGENT.name },
|
|
336
336
|
],
|
|
337
|
-
create: async (input: { name: string;
|
|
337
|
+
create: async (input: { name: string; specialty?: string }) => ({
|
|
338
338
|
id: ADMIN_E2E_AGENT.id,
|
|
339
339
|
name: input.name ?? ADMIN_E2E_AGENT.name,
|
|
340
340
|
slackId: ADMIN_E2E_AGENT.slackId,
|
|
341
341
|
selfHosted: false,
|
|
342
|
-
|
|
342
|
+
specialty: input.specialty ?? "coding",
|
|
343
343
|
createdAt: new Date("2024-01-01"),
|
|
344
344
|
updatedAt: new Date("2024-01-01"),
|
|
345
345
|
}),
|
|
@@ -349,7 +349,7 @@ function buildMockDeps(chatClient: ChatClient | undefined): AdminUIDeps {
|
|
|
349
349
|
name: ADMIN_E2E_AGENT.name,
|
|
350
350
|
slackId: ADMIN_E2E_AGENT.slackId,
|
|
351
351
|
selfHosted: false,
|
|
352
|
-
|
|
352
|
+
specialty: "coding",
|
|
353
353
|
createdAt: new Date("2024-01-01"),
|
|
354
354
|
updatedAt: new Date("2024-01-01"),
|
|
355
355
|
repos: [],
|
|
@@ -361,7 +361,7 @@ function buildMockDeps(chatClient: ChatClient | undefined): AdminUIDeps {
|
|
|
361
361
|
name: ADMIN_E2E_AGENT.name,
|
|
362
362
|
slackId: ADMIN_E2E_AGENT.slackId,
|
|
363
363
|
selfHosted: false,
|
|
364
|
-
|
|
364
|
+
specialty: "coding",
|
|
365
365
|
createdAt: new Date("2024-01-01"),
|
|
366
366
|
updatedAt: new Date("2024-01-01"),
|
|
367
367
|
repos: [],
|
package/openapi.json
CHANGED
|
@@ -201,9 +201,6 @@
|
|
|
201
201
|
"restrictSlackToMembers": {
|
|
202
202
|
"type": "boolean"
|
|
203
203
|
},
|
|
204
|
-
"typeName": {
|
|
205
|
-
"type": "string"
|
|
206
|
-
},
|
|
207
204
|
"specialty": {
|
|
208
205
|
"type": "string"
|
|
209
206
|
},
|
|
@@ -311,7 +308,6 @@
|
|
|
311
308
|
"reviewAuthorAllowlist",
|
|
312
309
|
"patchAuthorAllowlist",
|
|
313
310
|
"restrictSlackToMembers",
|
|
314
|
-
"typeName",
|
|
315
311
|
"specialty",
|
|
316
312
|
"podServiceAccountName",
|
|
317
313
|
"accountId",
|
|
@@ -522,10 +518,6 @@
|
|
|
522
518
|
"type": "boolean",
|
|
523
519
|
"example": false
|
|
524
520
|
},
|
|
525
|
-
"typeName": {
|
|
526
|
-
"type": "string",
|
|
527
|
-
"example": "coding"
|
|
528
|
-
},
|
|
529
521
|
"specialty": {
|
|
530
522
|
"type": "string",
|
|
531
523
|
"example": "coding"
|
|
@@ -535,7 +527,6 @@
|
|
|
535
527
|
"id",
|
|
536
528
|
"name",
|
|
537
529
|
"selfHosted",
|
|
538
|
-
"typeName",
|
|
539
530
|
"specialty"
|
|
540
531
|
]
|
|
541
532
|
},
|
|
@@ -547,7 +538,7 @@
|
|
|
547
538
|
"minLength": 1,
|
|
548
539
|
"example": "Bodhi"
|
|
549
540
|
},
|
|
550
|
-
"
|
|
541
|
+
"specialty": {
|
|
551
542
|
"type": "string",
|
|
552
543
|
"minLength": 1,
|
|
553
544
|
"example": "coding"
|
|
@@ -585,7 +576,7 @@
|
|
|
585
576
|
},
|
|
586
577
|
"required": [
|
|
587
578
|
"name",
|
|
588
|
-
"
|
|
579
|
+
"specialty"
|
|
589
580
|
]
|
|
590
581
|
},
|
|
591
582
|
"Ok": {
|
|
@@ -2892,13 +2883,14 @@
|
|
|
2892
2883
|
],
|
|
2893
2884
|
"example": "active"
|
|
2894
2885
|
},
|
|
2895
|
-
"
|
|
2886
|
+
"specialty": {
|
|
2896
2887
|
"type": "string",
|
|
2897
2888
|
"example": "coding"
|
|
2898
2889
|
},
|
|
2899
|
-
"
|
|
2890
|
+
"typeName": {
|
|
2900
2891
|
"type": "string",
|
|
2901
|
-
"example": "coding"
|
|
2892
|
+
"example": "coding",
|
|
2893
|
+
"deprecated": true
|
|
2902
2894
|
},
|
|
2903
2895
|
"phaseMethodology": {
|
|
2904
2896
|
"type": "object",
|
|
@@ -2936,7 +2928,8 @@
|
|
|
2936
2928
|
"cleanupAfterDays",
|
|
2937
2929
|
"restrictSlackToMembers",
|
|
2938
2930
|
"memberEmails",
|
|
2939
|
-
"phaseMethodology"
|
|
2931
|
+
"phaseMethodology",
|
|
2932
|
+
"specialty"
|
|
2940
2933
|
]
|
|
2941
2934
|
},
|
|
2942
2935
|
"AgentConfigPlugin": {
|
|
@@ -3528,7 +3521,7 @@
|
|
|
3528
3521
|
"/agents/{id}": {
|
|
3529
3522
|
"get": {
|
|
3530
3523
|
"summary": "Get an agent",
|
|
3531
|
-
"description": "Admin-only. Returns the full agent record including `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `
|
|
3524
|
+
"description": "Admin-only. Returns the full agent record including `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `specialty`, `accountId` (null for unassigned agents), and `missingRequiredEnv` — required env keys declared by the agent's type manifest with no corresponding AgentEnv row yet (informational only).",
|
|
3532
3525
|
"parameters": [
|
|
3533
3526
|
{
|
|
3534
3527
|
"schema": {
|
|
@@ -3575,7 +3568,7 @@
|
|
|
3575
3568
|
},
|
|
3576
3569
|
"patch": {
|
|
3577
3570
|
"summary": "Update an agent",
|
|
3578
|
-
"description": "Admin-only. Updates `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `slackId`, `trialExpiresAt`, `accountId` (platform admin only — 403 for session members; `null` clears it; reconciles the workload of in-cluster agents; does not move historical task-store rows), and/or `podServiceAccountName` (platform admin only — 403 otherwise; `null` clears it; 409 unless SHIPWRIGHT_K8S_AGENT_POD_SERVICE_ACCOUNT_ENABLED is on; 422 for agents with a per-agent federated identity; reconciles the workload so the pod is recreated under the new ServiceAccount). `
|
|
3571
|
+
"description": "Admin-only. Updates `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `slackId`, `trialExpiresAt`, `accountId` (platform admin only — 403 for session members; `null` clears it; reconciles the workload of in-cluster agents; does not move historical task-store rows), and/or `podServiceAccountName` (platform admin only — 403 otherwise; `null` clears it; 409 unless SHIPWRIGHT_K8S_AGENT_POD_SERVICE_ACCOUNT_ENABLED is on; 422 for agents with a per-agent federated identity; reconciles the workload so the pod is recreated under the new ServiceAccount). `specialty` and `trialExpiryWarnedAt` are not updatable via this route. `repos` here REPLACES the whole list; for incremental changes use `POST /agents/{id}/repos` (add) and `DELETE /agents/{id}/repos/{owner}/{name}` (remove). Returns the updated agent, including a `warning` field when `restrictSlackToMembers` is set true on an agent with zero members.",
|
|
3579
3572
|
"parameters": [
|
|
3580
3573
|
{
|
|
3581
3574
|
"schema": {
|
|
@@ -3720,7 +3713,7 @@
|
|
|
3720
3713
|
"/agents": {
|
|
3721
3714
|
"get": {
|
|
3722
3715
|
"summary": "List all agents",
|
|
3723
|
-
"description": "Admin-only. Returns every agent's `id`, `name`, `selfHosted`, and `
|
|
3716
|
+
"description": "Admin-only. Returns every agent's `id`, `name`, `selfHosted`, and `specialty` — used for metrics name resolution.",
|
|
3724
3717
|
"responses": {
|
|
3725
3718
|
"200": {
|
|
3726
3719
|
"description": "List of agents",
|
|
@@ -3749,7 +3742,7 @@
|
|
|
3749
3742
|
},
|
|
3750
3743
|
"post": {
|
|
3751
3744
|
"summary": "Create an agent",
|
|
3752
|
-
"description": "Admin-only. Validates name/
|
|
3745
|
+
"description": "Admin-only. Validates name/specialty, creates the Agent row, seeds AgentTool/AgentPlugin rows from the resolved type manifest, attaches repos/allowlists/members, patches Claude credentials, and provisions Kubernetes when `runtime` is \"in-cluster\" — the same createAgent() implementation (APA-1.1) the web UI form at /admin/agents/new uses. Transactional: on any failure zero rows persist, and this route never returns a partial-success 200. Returns the created agent in the same shape as GET /agents/:id.",
|
|
3753
3746
|
"requestBody": {
|
|
3754
3747
|
"content": {
|
|
3755
3748
|
"application/json": {
|
package/openapi.platform.json
CHANGED
|
@@ -201,9 +201,6 @@
|
|
|
201
201
|
"restrictSlackToMembers": {
|
|
202
202
|
"type": "boolean"
|
|
203
203
|
},
|
|
204
|
-
"typeName": {
|
|
205
|
-
"type": "string"
|
|
206
|
-
},
|
|
207
204
|
"specialty": {
|
|
208
205
|
"type": "string"
|
|
209
206
|
},
|
|
@@ -311,7 +308,6 @@
|
|
|
311
308
|
"reviewAuthorAllowlist",
|
|
312
309
|
"patchAuthorAllowlist",
|
|
313
310
|
"restrictSlackToMembers",
|
|
314
|
-
"typeName",
|
|
315
311
|
"specialty",
|
|
316
312
|
"podServiceAccountName",
|
|
317
313
|
"accountId",
|
|
@@ -539,10 +535,6 @@
|
|
|
539
535
|
"type": "boolean",
|
|
540
536
|
"example": false
|
|
541
537
|
},
|
|
542
|
-
"typeName": {
|
|
543
|
-
"type": "string",
|
|
544
|
-
"example": "coding"
|
|
545
|
-
},
|
|
546
538
|
"specialty": {
|
|
547
539
|
"type": "string",
|
|
548
540
|
"example": "coding"
|
|
@@ -552,7 +544,6 @@
|
|
|
552
544
|
"id",
|
|
553
545
|
"name",
|
|
554
546
|
"selfHosted",
|
|
555
|
-
"typeName",
|
|
556
547
|
"specialty"
|
|
557
548
|
]
|
|
558
549
|
},
|
|
@@ -564,7 +555,7 @@
|
|
|
564
555
|
"minLength": 1,
|
|
565
556
|
"example": "Bodhi"
|
|
566
557
|
},
|
|
567
|
-
"
|
|
558
|
+
"specialty": {
|
|
568
559
|
"type": "string",
|
|
569
560
|
"minLength": 1,
|
|
570
561
|
"example": "coding"
|
|
@@ -602,7 +593,7 @@
|
|
|
602
593
|
},
|
|
603
594
|
"required": [
|
|
604
595
|
"name",
|
|
605
|
-
"
|
|
596
|
+
"specialty"
|
|
606
597
|
]
|
|
607
598
|
},
|
|
608
599
|
"Ok": {
|
|
@@ -3098,13 +3089,14 @@
|
|
|
3098
3089
|
],
|
|
3099
3090
|
"example": "active"
|
|
3100
3091
|
},
|
|
3101
|
-
"
|
|
3092
|
+
"specialty": {
|
|
3102
3093
|
"type": "string",
|
|
3103
3094
|
"example": "coding"
|
|
3104
3095
|
},
|
|
3105
|
-
"
|
|
3096
|
+
"typeName": {
|
|
3106
3097
|
"type": "string",
|
|
3107
|
-
"example": "coding"
|
|
3098
|
+
"example": "coding",
|
|
3099
|
+
"deprecated": true
|
|
3108
3100
|
},
|
|
3109
3101
|
"phaseMethodology": {
|
|
3110
3102
|
"type": "object",
|
|
@@ -3142,6 +3134,7 @@
|
|
|
3142
3134
|
"cleanupAfterDays",
|
|
3143
3135
|
"restrictSlackToMembers",
|
|
3144
3136
|
"memberEmails",
|
|
3137
|
+
"specialty",
|
|
3145
3138
|
"phaseMethodology"
|
|
3146
3139
|
]
|
|
3147
3140
|
},
|
|
@@ -3356,7 +3349,7 @@
|
|
|
3356
3349
|
"/agents/{id}": {
|
|
3357
3350
|
"get": {
|
|
3358
3351
|
"summary": "Get an agent",
|
|
3359
|
-
"description": "Admin-only. Returns the full agent record including `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `
|
|
3352
|
+
"description": "Admin-only. Returns the full agent record including `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `specialty`, `accountId` (null for unassigned agents), and `missingRequiredEnv` — required env keys declared by the agent's type manifest with no corresponding AgentEnv row yet (informational only).",
|
|
3360
3353
|
"parameters": [
|
|
3361
3354
|
{
|
|
3362
3355
|
"schema": {
|
|
@@ -3403,7 +3396,7 @@
|
|
|
3403
3396
|
},
|
|
3404
3397
|
"patch": {
|
|
3405
3398
|
"summary": "Update an agent",
|
|
3406
|
-
"description": "Admin-only. Updates `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `slackId`, `trialExpiresAt`, `accountId` (platform admin only — 403 for session members; `null` clears it; reconciles the workload of in-cluster agents; does not move historical task-store rows), and/or `podServiceAccountName` (platform admin only — 403 otherwise; `null` clears it; 409 unless SHIPWRIGHT_K8S_AGENT_POD_SERVICE_ACCOUNT_ENABLED is on; 422 for agents with a per-agent federated identity; reconciles the workload so the pod is recreated under the new ServiceAccount). `
|
|
3399
|
+
"description": "Admin-only. Updates `selfHosted`, `repos`, `reviewAuthorAllowlist`, `patchAuthorAllowlist`, `restrictSlackToMembers`, `slackId`, `trialExpiresAt`, `accountId` (platform admin only — 403 for session members; `null` clears it; reconciles the workload of in-cluster agents; does not move historical task-store rows), and/or `podServiceAccountName` (platform admin only — 403 otherwise; `null` clears it; 409 unless SHIPWRIGHT_K8S_AGENT_POD_SERVICE_ACCOUNT_ENABLED is on; 422 for agents with a per-agent federated identity; reconciles the workload so the pod is recreated under the new ServiceAccount). `specialty` and `trialExpiryWarnedAt` are not updatable via this route. `repos` here REPLACES the whole list; for incremental changes use `POST /agents/{id}/repos` (add) and `DELETE /agents/{id}/repos/{owner}/{name}` (remove). Returns the updated agent, including a `warning` field when `restrictSlackToMembers` is set true on an agent with zero members.",
|
|
3407
3400
|
"parameters": [
|
|
3408
3401
|
{
|
|
3409
3402
|
"schema": {
|
|
@@ -3683,7 +3676,7 @@
|
|
|
3683
3676
|
"/agents": {
|
|
3684
3677
|
"get": {
|
|
3685
3678
|
"summary": "List all agents",
|
|
3686
|
-
"description": "Admin-only. Returns every agent's `id`, `name`, `selfHosted`, and `
|
|
3679
|
+
"description": "Admin-only. Returns every agent's `id`, `name`, `selfHosted`, and `specialty` — used for metrics name resolution.",
|
|
3687
3680
|
"responses": {
|
|
3688
3681
|
"200": {
|
|
3689
3682
|
"description": "List of agents",
|
|
@@ -3712,7 +3705,7 @@
|
|
|
3712
3705
|
},
|
|
3713
3706
|
"post": {
|
|
3714
3707
|
"summary": "Create an agent",
|
|
3715
|
-
"description": "Admin-only. Validates name/
|
|
3708
|
+
"description": "Admin-only. Validates name/specialty, creates the Agent row, seeds AgentTool/AgentPlugin rows from the resolved type manifest, attaches repos/allowlists/members, patches Claude credentials, and provisions Kubernetes when `runtime` is \"in-cluster\" — the same createAgent() implementation (APA-1.1) the web UI form at /admin/agents/new uses. Transactional: on any failure zero rows persist, and this route never returns a partial-success 200. Returns the created agent in the same shape as GET /agents/:id.",
|
|
3716
3709
|
"requestBody": {
|
|
3717
3710
|
"content": {
|
|
3718
3711
|
"application/json": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@app-vitals/agent-admin",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/app-vitals/agent.git",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@anthropic-ai/sdk": "0.135.0",
|
|
46
|
-
"@app-vitals/agent-lib": "0.13.
|
|
46
|
+
"@app-vitals/agent-lib": "0.13.1",
|
|
47
47
|
"@hono/zod-openapi": "^1.0.0",
|
|
48
48
|
"@prisma/adapter-pg": "^7.10.0",
|
|
49
49
|
"@prisma/client": "^7.10.0",
|