@app-vitals/agent-admin 0.2.1 → 0.3.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 +291 -0
- package/openapi.platform.json +291 -0
- package/package.json +2 -2
- package/prisma/client/browser.ts +10 -0
- package/prisma/client/client.ts +10 -0
- package/prisma/client/internal/class.ts +24 -4
- package/prisma/client/internal/prismaNamespace.ts +181 -1
- package/prisma/client/internal/prismaNamespaceBrowser.ts +30 -0
- package/prisma/client/models/AgentCronRunTranscript.ts +1339 -0
- package/prisma/client/models/AgentTranscriptRead.ts +1177 -0
- package/prisma/client/models.ts +2 -0
- package/prisma/migrations/20261027000000_add_cron_run_transcripts/migration.sql +37 -0
- package/prisma/schema/schema.prisma +34 -0
- package/src/admin-boot.ts +10 -0
- package/src/agents-api.ts +13 -0
- package/src/api.smoke.test.ts +27 -0
- package/src/api.ts +15 -0
- package/src/cron-run-transcripts.integration.test.ts +220 -0
- package/src/cron-run-transcripts.smoke.test.ts +286 -0
- package/src/cron-run-transcripts.ts +314 -0
- package/src/errors.ts +7 -0
- package/src/openapi-schemas.ts +64 -0
- package/src/transcript-config.ts +19 -0
- package/src/transcript-config.unit.test.ts +32 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* admin/src/transcript-config.ts
|
|
3
|
+
*
|
|
4
|
+
* Pure parser for the cron-run transcript API flag (COS-43.1). Takes an
|
|
5
|
+
* injected env object (no process.env reads) so it is deterministically
|
|
6
|
+
* unit-testable; admin-boot reads it once at startup and injects the result.
|
|
7
|
+
* Same "enabled" convention as agent-ask-config.ts.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
type TranscriptEnv = Readonly<Record<string, string | undefined>>;
|
|
11
|
+
|
|
12
|
+
export interface TranscriptConfig {
|
|
13
|
+
/** True only when SHIPWRIGHT_TRANSCRIPT_API_ENABLED === "enabled". */
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function parseTranscriptConfig(env: TranscriptEnv): TranscriptConfig {
|
|
18
|
+
return { enabled: env.SHIPWRIGHT_TRANSCRIPT_API_ENABLED === "enabled" };
|
|
19
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* admin/src/transcript-config.unit.test.ts
|
|
3
|
+
* Pure flag parser for the cron-run transcript API (COS-43.1).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "bun:test";
|
|
7
|
+
import { parseTranscriptConfig } from "./transcript-config.ts";
|
|
8
|
+
|
|
9
|
+
describe("parseTranscriptConfig", () => {
|
|
10
|
+
it('is on only for the literal "enabled"', () => {
|
|
11
|
+
expect(
|
|
12
|
+
parseTranscriptConfig({ SHIPWRIGHT_TRANSCRIPT_API_ENABLED: "enabled" })
|
|
13
|
+
.enabled,
|
|
14
|
+
).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("every other value is off", () => {
|
|
18
|
+
for (const v of [
|
|
19
|
+
"true",
|
|
20
|
+
"",
|
|
21
|
+
"Enabled",
|
|
22
|
+
" enabled",
|
|
23
|
+
"disabled",
|
|
24
|
+
undefined,
|
|
25
|
+
]) {
|
|
26
|
+
expect(
|
|
27
|
+
parseTranscriptConfig({ SHIPWRIGHT_TRANSCRIPT_API_ENABLED: v }).enabled,
|
|
28
|
+
).toBe(false);
|
|
29
|
+
}
|
|
30
|
+
expect(parseTranscriptConfig({}).enabled).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
});
|