execution/scheduled
@sarj-ai/workspace-sync/execution/scheduled ยท Source
import type { OperationKernel } from "../operations/kernel.ts";import type { SignedOperationPlan } from "../operations/schemas.ts";import type { WorkspaceAlertPort as IAlertsClient } from "./alert-port.ts";import { type WorkspaceDirectoryPlan } from "./contracts.ts";import type { IReviewedSlackLifecycleIntentClaims } from "./reviewed-slack-lifecycle-intent.ts";import type { WorkspaceScheduleBlockedReason, WorkspaceScheduleReceipt, WorkspaceScheduleStart, WorkspaceScheduleTick } from "./schedule-health-contracts.ts";import { type WorkspaceDirectoryWorkflowBinding } from "./workflow.ts";import type { IWorkspaceScheduleHealthRepository } from "./workspace-schedule-health-repository.ts";type SlackProfilePlan = WorkspaceDirectoryPlan["branches"][0];type SlackAccessPlan = WorkspaceDirectoryPlan["branches"][2];export type ScheduledWorkspaceDirectoryResult = { githubIdentityUpdates: number; kind: "review-required"; linearSuspensions: number; planHash: string;} | { instanceId: string; kind: "launched"; planHash: string; reviewPlanHash?: string;} | { kind: "blocked"; planHash: string; reason: "diagnostics" | "safety-policy"; blockedReason?: WorkspaceScheduleBlockedReason; reviewPlanHash?: string;} | { kind: "converged"; planHash: string;} | { kind: "receipts-recovered"; outcome: Extract<WorkspaceScheduleTick, { phase: "terminal"; }>["outcome"]; planHash: null | string; tickId: string;};export interface ScheduledWorkspaceDirectoryDependencies { announcePlan: (signedPlan: SignedOperationPlan) => Promise<void>; kernel: Pick<OperationKernel, "plan" | "prepareApply">; linearSuspensionsEnabled?: boolean; parentEnabled: boolean; reportAccessIssues?: (plan: WorkspaceDirectoryPlan) => Promise<void>; reviewedLifecycleIntents?: IReviewedSlackLifecycleIntentClaims; scheduleHealth?: { repository: Pick<IWorkspaceScheduleHealthRepository, "attachVerifiedReceipt" | "complete" | "completeFailedBeforePlan" | "completeFailedNoDispatch" | "launch" | "listStaleNoDispatchRecoveryCandidates" | "read" | "recordPlan" | "start">; verifyTerminalReceipt?: (terminal: Extract<WorkspaceScheduleTick, { phase: "terminal"; }>) => Promise<null | WorkspaceScheduleReceipt>; }; trycompEnabled?: boolean; workflow: WorkspaceDirectoryWorkflowBinding;}export declare function runIndependentWorkspaceDirectoryReports(reports: readonly (() => Promise<unknown>)[]): Promise<void>;export declare function reportScheduledSlackDrift(profiles: SlackProfilePlan, access: SlackAccessPlan, alerts: IAlertsClient): Promise<void>;export declare function runScheduledWorkspaceDirectory(dependencies: ScheduledWorkspaceDirectoryDependencies, context?: WorkspaceScheduleStart): Promise<ScheduledWorkspaceDirectoryResult>;export declare function isScheduledSlackProfiles(signedPlan: SignedOperationPlan, directoryPlan: WorkspaceDirectoryPlan, enabled: boolean): boolean;export declare function isScheduledPosthogMemberships(signedPlan: SignedOperationPlan, directoryPlan: WorkspaceDirectoryPlan, enabled: boolean): boolean;export declare function isScheduledSentryMemberships(signedPlan: SignedOperationPlan, directoryPlan: WorkspaceDirectoryPlan, enabled: boolean): boolean;export declare function isScheduledPagerDutyTeams(signedPlan: SignedOperationPlan, directoryPlan: WorkspaceDirectoryPlan, enabled: boolean): boolean;export declare function isScheduledGoogleGroupCleanup(signedPlan: SignedOperationPlan, directoryPlan: WorkspaceDirectoryPlan, enabled: boolean): boolean;export {};