@app-vitals/agent-admin 1.39.0 → 1.41.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 +584 -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 +184 -2
- package/prisma/client/internal/prismaNamespaceBrowser.ts +33 -1
- package/prisma/client/models/Account.ts +148 -0
- package/prisma/client/models/Agent.ts +80 -1
- package/prisma/client/models/AgentCronJob.ts +54 -1
- package/prisma/client/models/AgentEnv.ts +36 -1
- package/prisma/client/models/AgentPlugin.ts +36 -1
- package/prisma/client/models/AgentTemplate.ts +1501 -0
- package/prisma/client/models/AgentTemplateItem.ts +1416 -0
- package/prisma/client/models/AgentTool.ts +71 -1
- package/prisma/client/models.ts +2 -0
- package/prisma/migrations/20261113000000_add_agent_templates/migration.sql +71 -0
- package/prisma/schema/schema.prisma +61 -4
- package/src/admin-boot.ts +18 -0
- package/src/admin-local-agent.smoke.test.ts +2 -0
- package/src/admin-spec.ts +18 -0
- package/src/admin-ui.fixtures.ts +3 -0
- package/src/admin-ui.smoke.test.ts +2 -0
- package/src/agent-cron-run-stats.smoke.test.ts +10 -0
- package/src/agent-plugins.unit.test.ts +1 -0
- package/src/agent-template-items.ts +82 -0
- package/src/agent-template-items.unit.test.ts +70 -0
- package/src/agent-templates-api.integration.test.ts +428 -0
- package/src/agent-templates-api.smoke.test.ts +135 -0
- package/src/agent-templates-api.ts +293 -0
- package/src/agent-templates.integration.test.ts +200 -0
- package/src/agent-templates.ts +432 -0
- package/src/agents-api.smoke.test.ts +17 -0
- package/src/api-auth.ts +3 -0
- package/src/api.smoke.test.ts +13 -0
- package/src/chat.smoke.test.ts +2 -0
- package/src/openapi-schemas.ts +84 -0
package/src/openapi-schemas.ts
CHANGED
|
@@ -1544,3 +1544,87 @@ export const PatchAccountBodySchema = z
|
|
|
1544
1544
|
trialExpiresAt: z.string().datetime().nullable().optional(),
|
|
1545
1545
|
})
|
|
1546
1546
|
.openapi("PatchAccountBody");
|
|
1547
|
+
|
|
1548
|
+
// ─── Agent templates (ATP-1.3) ────────────────────────────────────────────────
|
|
1549
|
+
|
|
1550
|
+
export const TemplateItemKindSchema = z
|
|
1551
|
+
.enum(["env", "tool", "plugin", "cron"])
|
|
1552
|
+
.openapi("TemplateItemKind");
|
|
1553
|
+
|
|
1554
|
+
const TemplateItemBaseSchema = z.object({
|
|
1555
|
+
kind: TemplateItemKindSchema,
|
|
1556
|
+
key: z.string().openapi({
|
|
1557
|
+
description:
|
|
1558
|
+
"Env var name, tool pattern, plugin name or cron name (cron items need a stable, non-empty name).",
|
|
1559
|
+
example: "LINEAR_API_KEY",
|
|
1560
|
+
}),
|
|
1561
|
+
payload: z
|
|
1562
|
+
.record(z.string(), z.unknown())
|
|
1563
|
+
.optional()
|
|
1564
|
+
.openapi({
|
|
1565
|
+
description:
|
|
1566
|
+
"Kind-specific fields. env: {value, secret?}; tool: {enabled?}; plugin: {version?, enabled?}; cron: {schedule, prompt, channel?, user?, silent?, enabled?, preCheck?}.",
|
|
1567
|
+
example: { value: "lin_abc", secret: true },
|
|
1568
|
+
}),
|
|
1569
|
+
});
|
|
1570
|
+
|
|
1571
|
+
export const TemplateItemInputSchema =
|
|
1572
|
+
TemplateItemBaseSchema.openapi("TemplateItemInput");
|
|
1573
|
+
|
|
1574
|
+
export const TemplateItemSchema = TemplateItemBaseSchema.extend({
|
|
1575
|
+
payload: z.record(z.string(), z.unknown()).openapi({
|
|
1576
|
+
description: 'Secret env values are returned masked as "***".',
|
|
1577
|
+
}),
|
|
1578
|
+
updatedAt: z
|
|
1579
|
+
.string()
|
|
1580
|
+
.datetime()
|
|
1581
|
+
.openapi({ example: "2026-01-01T00:00:00.000Z" }),
|
|
1582
|
+
}).openapi("TemplateItem");
|
|
1583
|
+
|
|
1584
|
+
export const AgentTemplateSchema = z
|
|
1585
|
+
.object({
|
|
1586
|
+
id: z.string().openapi({ example: "clx1234567890" }),
|
|
1587
|
+
accountId: z.string().nullable().openapi({ example: null }),
|
|
1588
|
+
specialty: z.string().nullable().openapi({ example: "specialist" }),
|
|
1589
|
+
items: z.array(TemplateItemSchema),
|
|
1590
|
+
createdAt: z
|
|
1591
|
+
.string()
|
|
1592
|
+
.datetime()
|
|
1593
|
+
.openapi({ example: "2026-01-01T00:00:00.000Z" }),
|
|
1594
|
+
updatedAt: z
|
|
1595
|
+
.string()
|
|
1596
|
+
.datetime()
|
|
1597
|
+
.openapi({ example: "2026-01-01T00:00:00.000Z" }),
|
|
1598
|
+
})
|
|
1599
|
+
.openapi("AgentTemplate");
|
|
1600
|
+
|
|
1601
|
+
export const AgentTemplatesListSchema = z
|
|
1602
|
+
.object({ templates: z.array(AgentTemplateSchema) })
|
|
1603
|
+
.openapi("AgentTemplatesList");
|
|
1604
|
+
|
|
1605
|
+
export const ListTemplatesQuerySchema = z.object({
|
|
1606
|
+
accountId: z.string().optional().openapi({ example: "clx1234567890" }),
|
|
1607
|
+
specialty: z.string().optional().openapi({ example: "specialist" }),
|
|
1608
|
+
});
|
|
1609
|
+
|
|
1610
|
+
export const PutTemplateBodySchema = z
|
|
1611
|
+
.object({
|
|
1612
|
+
accountId: z.string().nullable().optional().openapi({
|
|
1613
|
+
description:
|
|
1614
|
+
"Owning account; null or omitted = deployment-wide (platform admins only). Account callers may omit it or send their own account.",
|
|
1615
|
+
}),
|
|
1616
|
+
specialty: z.string().nullable().optional().openapi({
|
|
1617
|
+
description: "Specialty the template applies to; null = every specialty.",
|
|
1618
|
+
}),
|
|
1619
|
+
items: z.array(TemplateItemInputSchema),
|
|
1620
|
+
})
|
|
1621
|
+
.openapi("PutTemplateBody");
|
|
1622
|
+
|
|
1623
|
+
export const TemplateIdParamSchema = z.object({
|
|
1624
|
+
id: z.string().openapi({ param: { name: "id", in: "path" } }),
|
|
1625
|
+
});
|
|
1626
|
+
|
|
1627
|
+
export const TemplateItemKeyQuerySchema = z.object({
|
|
1628
|
+
kind: TemplateItemKindSchema,
|
|
1629
|
+
key: z.string().min(1),
|
|
1630
|
+
});
|