Add shared types for agent hiring, config revisions, costs breakdown, and sidebar badges
Add AgentConfigRevision, CostByAgent, SidebarBadges types. Add createAgentHireSchema with source issue linking and linkIssueApprovalSchema. Extend approval validator with issueIds. Update cost summary to generic period naming. Add sidebar badges API path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,9 +25,18 @@ export const createAgentSchema = z.object({
|
||||
|
||||
export type CreateAgent = z.infer<typeof createAgentSchema>;
|
||||
|
||||
export const createAgentHireSchema = createAgentSchema.extend({
|
||||
sourceIssueId: z.string().uuid().optional().nullable(),
|
||||
sourceIssueIds: z.array(z.string().uuid()).optional(),
|
||||
});
|
||||
|
||||
export type CreateAgentHire = z.infer<typeof createAgentHireSchema>;
|
||||
|
||||
export const updateAgentSchema = createAgentSchema
|
||||
.omit({ permissions: true })
|
||||
.partial()
|
||||
.extend({
|
||||
permissions: z.never().optional(),
|
||||
status: z.enum(AGENT_STATUSES).optional(),
|
||||
spentMonthlyCents: z.number().int().nonnegative().optional(),
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ export const createApprovalSchema = z.object({
|
||||
type: z.enum(APPROVAL_TYPES),
|
||||
requestedByAgentId: z.string().uuid().optional().nullable(),
|
||||
payload: z.record(z.unknown()),
|
||||
issueIds: z.array(z.string().uuid()).optional(),
|
||||
});
|
||||
|
||||
export type CreateApproval = z.infer<typeof createApprovalSchema>;
|
||||
|
||||
@@ -7,12 +7,14 @@ export {
|
||||
|
||||
export {
|
||||
createAgentSchema,
|
||||
createAgentHireSchema,
|
||||
updateAgentSchema,
|
||||
createAgentKeySchema,
|
||||
wakeAgentSchema,
|
||||
agentPermissionsSchema,
|
||||
updateAgentPermissionsSchema,
|
||||
type CreateAgent,
|
||||
type CreateAgentHire,
|
||||
type UpdateAgent,
|
||||
type CreateAgentKey,
|
||||
type WakeAgent,
|
||||
@@ -31,10 +33,12 @@ export {
|
||||
updateIssueSchema,
|
||||
checkoutIssueSchema,
|
||||
addIssueCommentSchema,
|
||||
linkIssueApprovalSchema,
|
||||
type CreateIssue,
|
||||
type UpdateIssue,
|
||||
type CheckoutIssue,
|
||||
type AddIssueComment,
|
||||
type LinkIssueApproval,
|
||||
} from "./issue.js";
|
||||
|
||||
export {
|
||||
|
||||
@@ -35,3 +35,9 @@ export const addIssueCommentSchema = z.object({
|
||||
});
|
||||
|
||||
export type AddIssueComment = z.infer<typeof addIssueCommentSchema>;
|
||||
|
||||
export const linkIssueApprovalSchema = z.object({
|
||||
approvalId: z.string().uuid(),
|
||||
});
|
||||
|
||||
export type LinkIssueApproval = z.infer<typeof linkIssueApprovalSchema>;
|
||||
|
||||
Reference in New Issue
Block a user