Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 14 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"dependencies": {
"@clack/prompts": "^0.7.0",
"commander": "^12.0.0",
"zod": "^3.23.0"
"zod": "^4.4.3"
},
"devDependencies": {
"@agent-relay/sdk": "^4.0.4",
Expand Down
22 changes: 11 additions & 11 deletions src/core/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const TaskSourceSystemSchema = z.union([
export const TaskSourceSchema = z.object({
system: TaskSourceSystemSchema,
id: z.string().min(1, "Task ID is required"),
url: z.string().url().optional(),
url: z.url().optional(),
});

/**
Expand Down Expand Up @@ -124,8 +124,8 @@ export const DecisionSchema = z.object({
export const AgentParticipationSchema = z.object({
name: z.string().min(1, "Agent name is required"),
role: z.string().min(1, "Agent role is required"),
joinedAt: z.string().datetime(),
leftAt: z.string().datetime().optional(),
joinedAt: z.iso.datetime(),
leftAt: z.iso.datetime().optional(),
});

/**
Expand All @@ -135,8 +135,8 @@ export const ChapterSchema = z.object({
id: z.string().min(1),
title: z.string().min(1, "Chapter title is required"),
agentName: z.string().min(1, "Agent name is required"),
startedAt: z.string().datetime(),
endedAt: z.string().datetime().optional(),
startedAt: z.iso.datetime(),
endedAt: z.iso.datetime().optional(),
events: z.array(TrajectoryEventSchema),
});

Expand Down Expand Up @@ -196,7 +196,7 @@ export const TraceContributorSchema = z.object({
*/
export const TraceConversationSchema = z.object({
contributor: TraceContributorSchema,
url: z.string().url().optional(),
url: z.url().optional(),
ranges: z.array(TraceRangeSchema),
});

Expand All @@ -215,7 +215,7 @@ export const TraceFileSchema = z.object({
export const TraceRecordSchema = z.object({
version: z.string().min(1, "Version is required"),
id: z.string().min(1, "Trace ID is required"),
timestamp: z.string().datetime(),
timestamp: z.iso.datetime(),
trajectory: z.string().optional(),
files: z.array(TraceFileSchema),
});
Expand All @@ -237,8 +237,8 @@ export const TrajectorySchema = z.object({
version: z.literal(1),
task: TaskReferenceSchema,
status: TrajectoryStatusSchema,
startedAt: z.string().datetime(),
completedAt: z.string().datetime().optional(),
startedAt: z.iso.datetime(),
completedAt: z.iso.datetime().optional(),
agents: z.array(AgentParticipationSchema),
chapters: z.array(ChapterSchema),
retrospective: RetrospectiveSchema.optional(),
Expand Down Expand Up @@ -304,8 +304,8 @@ export const CompleteTrajectoryInputSchema = z.object({
*/
export const TrajectoryQuerySchema = z.object({
status: TrajectoryStatusSchema.optional(),
since: z.string().datetime().optional(),
until: z.string().datetime().optional(),
since: z.iso.datetime().optional(),
until: z.iso.datetime().optional(),
limit: z.number().int().positive().max(100).optional(),
offset: z.number().int().nonnegative().optional(),
sortBy: z.enum(["startedAt", "completedAt", "title"]).optional(),
Expand Down
4 changes: 2 additions & 2 deletions src/core/trajectory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function createTrajectory(input: CreateTrajectoryInput): Trajectory {
// Validate input
const validation = CreateTrajectoryInputSchema.safeParse(input);
if (!validation.success) {
const firstError = validation.error.errors[0];
const firstError = validation.error.issues[0];
throw new TrajectoryError(
firstError.message,
"VALIDATION_ERROR",
Expand Down Expand Up @@ -215,7 +215,7 @@ export function completeTrajectory(
// Validate input
const validation = CompleteTrajectoryInputSchema.safeParse(input);
if (!validation.success) {
const firstError = validation.error.errors[0];
const firstError = validation.error.issues[0];
throw new TrajectoryError(
firstError.message,
"VALIDATION_ERROR",
Expand Down
Loading