basic-block

This commit is contained in:
Ramnique Singh 2026-04-10 15:51:39 +05:30
parent ab0147d475
commit 66dc065996
18 changed files with 1220 additions and 0 deletions

View file

@ -9,6 +9,7 @@ export * as agentScheduleState from './agent-schedule-state.js';
export * as serviceEvents from './service-events.js'
export * as inlineTask from './inline-task.js';
export * as blocks from './blocks.js';
export * as trackBlock from './track-block.js';
export * as frontmatter from './frontmatter.js';
export * as bases from './bases.js';
export { PrefixLogger };

View file

@ -6,6 +6,7 @@ import { LlmModelConfig } from './models.js';
import { AgentScheduleConfig, AgentScheduleEntry } from './agent-schedule.js';
import { AgentScheduleState } from './agent-schedule-state.js';
import { ServiceEvent } from './service-events.js';
import { TrackEvent } from './track-block.js';
import { UserMessageContent } from './message.js';
import { RowboatApiConfig } from './rowboat-account.js';
import { ZListToolkitsResponse } from './composio.js';
@ -193,6 +194,10 @@ const ipcSchemas = {
req: ServiceEvent,
res: z.null(),
},
'tracks:events': {
req: TrackEvent,
res: z.null(),
},
'models:list': {
req: z.null(),
res: z.object({
@ -560,6 +565,18 @@ const ipcSchemas = {
response: z.string().nullable(),
}),
},
// Track channels
'track:run': {
req: z.object({
trackId: z.string(),
filePath: z.string(),
}),
res: z.object({
success: z.boolean(),
summary: z.string().optional(),
error: z.string().optional(),
}),
},
// Billing channels
'billing:getInfo': {
req: z.null(),

View file

@ -0,0 +1,35 @@
import z from 'zod';
export const TrackBlockSchema = z.object({
trackId: z.string(),
instruction: z.string(),
matchCriteria: z.string().optional(),
active: z.boolean().default(true),
lastRunAt: z.string().optional(),
lastRunId: z.string().optional(),
lastRunSummary: z.string().optional(),
});
// Track bus events
export const TrackRunStartEvent = z.object({
type: z.literal('track_run_start'),
trackId: z.string(),
filePath: z.string(),
trigger: z.enum(['timed', 'manual', 'event']),
runId: z.string(),
});
export const TrackRunCompleteEvent = z.object({
type: z.literal('track_run_complete'),
trackId: z.string(),
filePath: z.string(),
runId: z.string(),
error: z.string().optional(),
summary: z.string().optional(),
});
export const TrackEvent = z.union([TrackRunStartEvent, TrackRunCompleteEvent]);
export type TrackBlock = z.infer<typeof TrackBlockSchema>;
export type TrackResult = z.infer<typeof TrackResultSchema>;
export type TrackEventType = z.infer<typeof TrackEvent>;