@app-vitals/agent-admin 0.3.0 → 0.4.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.platform.json +101 -0
- package/package.json +2 -2
- package/prisma/client/browser.ts +5 -0
- package/prisma/client/client.ts +5 -0
- package/prisma/client/internal/class.ts +14 -4
- package/prisma/client/internal/prismaNamespace.ts +93 -1
- package/prisma/client/internal/prismaNamespaceBrowser.ts +17 -0
- package/prisma/client/models/AgentCronJob.ts +107 -1
- package/prisma/client/models/AgentCronRunRequest.ts +1233 -0
- package/prisma/client/models.ts +1 -0
- package/prisma/migrations/20261028000000_add_cron_run_now/migration.sql +24 -0
- package/prisma/schema/schema.prisma +24 -0
- package/src/admin-boot.ts +8 -0
- package/src/admin-ui.fixtures.ts +2 -0
- package/src/admin-ui.smoke.test.ts +2 -0
- package/src/agent-cron-jobs.unit.test.ts +4 -0
- package/src/agent-cron-run-stats.smoke.test.ts +10 -0
- package/src/agent-cron-runs.integration.test.ts +93 -0
- package/src/agent-cron-runs.ts +47 -15
- package/src/agents-api.smoke.test.ts +18 -0
- package/src/agents-api.ts +17 -0
- package/src/api-auth.ts +1 -0
- package/src/api.smoke.test.ts +12 -0
- package/src/chat.smoke.test.ts +2 -0
- package/src/cron-run-now-config.ts +20 -0
- package/src/cron-run-now-config.unit.test.ts +26 -0
- package/src/cron-run-now.smoke.test.ts +218 -0
- package/src/cron-run-now.ts +207 -0
- package/src/openapi-schemas.ts +14 -0
- package/src/openapi-schemas.unit.test.ts +4 -0
package/openapi.platform.json
CHANGED
|
@@ -730,6 +730,15 @@
|
|
|
730
730
|
],
|
|
731
731
|
"example": null
|
|
732
732
|
},
|
|
733
|
+
"runRequestedAt": {
|
|
734
|
+
"type": [
|
|
735
|
+
"string",
|
|
736
|
+
"null"
|
|
737
|
+
],
|
|
738
|
+
"format": "date-time",
|
|
739
|
+
"example": null,
|
|
740
|
+
"description": "Set by POST .../run-now; the runtime honours it once while fresh (15 minutes) and run creation with commandVariant run-now clears it."
|
|
741
|
+
},
|
|
733
742
|
"createdAt": {
|
|
734
743
|
"type": "string",
|
|
735
744
|
"format": "date-time",
|
|
@@ -754,6 +763,7 @@
|
|
|
754
763
|
"name",
|
|
755
764
|
"system",
|
|
756
765
|
"parentCronId",
|
|
766
|
+
"runRequestedAt",
|
|
757
767
|
"createdAt",
|
|
758
768
|
"updatedAt"
|
|
759
769
|
]
|
|
@@ -1994,6 +2004,19 @@
|
|
|
1994
2004
|
"repliedAt"
|
|
1995
2005
|
]
|
|
1996
2006
|
},
|
|
2007
|
+
"CronRunNowResponse": {
|
|
2008
|
+
"type": "object",
|
|
2009
|
+
"properties": {
|
|
2010
|
+
"requestedAt": {
|
|
2011
|
+
"type": "string",
|
|
2012
|
+
"format": "date-time",
|
|
2013
|
+
"example": "2026-10-26T12:00:00.000Z"
|
|
2014
|
+
}
|
|
2015
|
+
},
|
|
2016
|
+
"required": [
|
|
2017
|
+
"requestedAt"
|
|
2018
|
+
]
|
|
2019
|
+
},
|
|
1997
2020
|
"CronRunTranscriptUploadResult": {
|
|
1998
2021
|
"type": "object",
|
|
1999
2022
|
"properties": {
|
|
@@ -4881,6 +4904,84 @@
|
|
|
4881
4904
|
}
|
|
4882
4905
|
}
|
|
4883
4906
|
},
|
|
4907
|
+
"/agents/{id}/crons/{cronId}/run-now": {
|
|
4908
|
+
"post": {
|
|
4909
|
+
"summary": "Request an immediate run of a cron job",
|
|
4910
|
+
"description": "Asks the agent's runtime to run the cron job once, now, with the job's own stored prompt. Takes no request body (any body is 400). Stamps `runRequestedAt` on the job and writes an AgentCronRunRequest audit row before returning 202; the runtime honours a fresh request (under 15 minutes old) once on its next cron sync. Callers: `*`, `platform.ops`, or the agent's own key. 404 unless SHIPWRIGHT_CRON_RUN_NOW_ENABLED is `enabled`; 409 when the trial-expiry lockdown disabled the cron.",
|
|
4911
|
+
"parameters": [
|
|
4912
|
+
{
|
|
4913
|
+
"schema": {
|
|
4914
|
+
"type": "string",
|
|
4915
|
+
"example": "clx1234567890"
|
|
4916
|
+
},
|
|
4917
|
+
"required": true,
|
|
4918
|
+
"name": "id",
|
|
4919
|
+
"in": "path"
|
|
4920
|
+
},
|
|
4921
|
+
{
|
|
4922
|
+
"schema": {
|
|
4923
|
+
"type": "string",
|
|
4924
|
+
"example": "clx0987654321"
|
|
4925
|
+
},
|
|
4926
|
+
"required": true,
|
|
4927
|
+
"name": "cronId",
|
|
4928
|
+
"in": "path"
|
|
4929
|
+
}
|
|
4930
|
+
],
|
|
4931
|
+
"responses": {
|
|
4932
|
+
"202": {
|
|
4933
|
+
"description": "Run requested",
|
|
4934
|
+
"content": {
|
|
4935
|
+
"application/json": {
|
|
4936
|
+
"schema": {
|
|
4937
|
+
"$ref": "#/components/schemas/CronRunNowResponse"
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4940
|
+
}
|
|
4941
|
+
},
|
|
4942
|
+
"400": {
|
|
4943
|
+
"description": "A request body was sent",
|
|
4944
|
+
"content": {
|
|
4945
|
+
"application/json": {
|
|
4946
|
+
"schema": {
|
|
4947
|
+
"$ref": "#/components/schemas/Error"
|
|
4948
|
+
}
|
|
4949
|
+
}
|
|
4950
|
+
}
|
|
4951
|
+
},
|
|
4952
|
+
"403": {
|
|
4953
|
+
"description": "Caller not allowed",
|
|
4954
|
+
"content": {
|
|
4955
|
+
"application/json": {
|
|
4956
|
+
"schema": {
|
|
4957
|
+
"$ref": "#/components/schemas/Error"
|
|
4958
|
+
}
|
|
4959
|
+
}
|
|
4960
|
+
}
|
|
4961
|
+
},
|
|
4962
|
+
"404": {
|
|
4963
|
+
"description": "Cron not found, or cron run-now disabled",
|
|
4964
|
+
"content": {
|
|
4965
|
+
"application/json": {
|
|
4966
|
+
"schema": {
|
|
4967
|
+
"$ref": "#/components/schemas/Error"
|
|
4968
|
+
}
|
|
4969
|
+
}
|
|
4970
|
+
}
|
|
4971
|
+
},
|
|
4972
|
+
"409": {
|
|
4973
|
+
"description": "Cron disabled by lockdown",
|
|
4974
|
+
"content": {
|
|
4975
|
+
"application/json": {
|
|
4976
|
+
"schema": {
|
|
4977
|
+
"$ref": "#/components/schemas/Error"
|
|
4978
|
+
}
|
|
4979
|
+
}
|
|
4980
|
+
}
|
|
4981
|
+
}
|
|
4982
|
+
}
|
|
4983
|
+
}
|
|
4984
|
+
},
|
|
4884
4985
|
"/agents/{id}/crons/{cronId}/runs/{runId}/transcript": {
|
|
4885
4986
|
"put": {
|
|
4886
4987
|
"summary": "Upload a cron run transcript",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@app-vitals/agent-admin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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.
|
|
46
|
+
"@app-vitals/agent-lib": "0.4.0",
|
|
47
47
|
"@hono/zod-openapi": "^1.0.0",
|
|
48
48
|
"@prisma/adapter-pg": "^7.10.0",
|
|
49
49
|
"@prisma/client": "^7.10.0",
|
package/prisma/client/browser.ts
CHANGED
|
@@ -112,6 +112,11 @@ export type AgentChatTokenUsageDailyByModel = Prisma.AgentChatTokenUsageDailyByM
|
|
|
112
112
|
*
|
|
113
113
|
*/
|
|
114
114
|
export type AgentAsk = Prisma.AgentAskModel
|
|
115
|
+
/**
|
|
116
|
+
* Model AgentCronRunRequest
|
|
117
|
+
*
|
|
118
|
+
*/
|
|
119
|
+
export type AgentCronRunRequest = Prisma.AgentCronRunRequestModel
|
|
115
120
|
/**
|
|
116
121
|
* Model AgentCronRunTranscript
|
|
117
122
|
*
|
package/prisma/client/client.ts
CHANGED
|
@@ -136,6 +136,11 @@ export type AgentChatTokenUsageDailyByModel = Prisma.AgentChatTokenUsageDailyByM
|
|
|
136
136
|
*
|
|
137
137
|
*/
|
|
138
138
|
export type AgentAsk = Prisma.AgentAskModel
|
|
139
|
+
/**
|
|
140
|
+
* Model AgentCronRunRequest
|
|
141
|
+
*
|
|
142
|
+
*/
|
|
143
|
+
export type AgentCronRunRequest = Prisma.AgentCronRunRequestModel
|
|
139
144
|
/**
|
|
140
145
|
* Model AgentCronRunTranscript
|
|
141
146
|
*
|