Skip to content
Sarj Workspace Sync

execution/workspace-receipt

@sarj-ai/workspace-sync/execution/workspace-receipt ยท Source

import type { D1Database } from "@cloudflare/workers-types";
import { z } from "zod";
import { type IdentityWriteBudget } from "../identity-provisioning/identity-budget-contracts.ts";
import type { ActiveResourceLease } from "../identity-sync/resource-lease.ts";
import { D1TrycompMutationStore, type TrycompMutationStore } from "../trycomp/safety.ts";
export declare const WorkspaceTrycompReceiptSchema: z.ZodObject<{
announcementDigest: z.ZodString;
changeKey: z.ZodString;
channelId: z.ZodString;
parentPlanHash: z.ZodString;
requestedBy: z.ZodLiteral<"scheduled:workspace-directory">;
reviewedPlan: z.ZodObject<{
plan: z.ZodObject<{
errors: z.ZodArray<z.ZodString>;
planHash: z.ZodString;
stats: z.ZodObject<{
activeGoogleEmployees: z.ZodNumber;
contractorGoogleUsers: z.ZodNumber;
trycompMembers: z.ZodNumber;
}, z.core.$strip>;
warnings: z.ZodArray<z.ZodString>;
actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
deactivationAuthority: z.ZodOptional<z.ZodEnum<{
contractor_group: "contractor_group";
inactive_google: "inactive_google";
}>>;
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
memberId: z.ZodString;
providerEmail: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodEmail>>;
type: z.ZodLiteral<"deactivate">;
}, z.core.$strip>, z.ZodObject<{
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
memberId: z.ZodString;
providerEmail: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodEmail>>;
type: z.ZodLiteral<"reactivate">;
}, z.core.$strip>, z.ZodObject<{
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
type: z.ZodLiteral<"invite">;
}, z.core.$strip>], "type">>;
}, z.core.$strip>;
schemaVersion: z.ZodLiteral<"trycomp-reviewed/v1">;
deactivationMode: z.ZodOptional<z.ZodEnum<{
"device-free-membership-revocation": "device-free-membership-revocation";
"membership-revocation": "membership-revocation";
}>>;
sourceFingerprint: z.ZodString;
targetBefore: z.ZodArray<z.ZodObject<{
fleetDmLabelId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
platformRole: z.ZodOptional<z.ZodNullable<z.ZodString>>;
deactivated: z.ZodBoolean;
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
id: z.ZodString;
isActive: z.ZodBoolean;
role: z.ZodString;
}, z.core.$strict>>;
selectedIdentity: z.ZodOptional<z.ZodObject<{
googleUserId: z.core.$ZodBranded<z.ZodString, "GoogleUserId", "out">;
provider: z.ZodDiscriminatedUnion<[z.ZodObject<{
kind: z.ZodLiteral<"member">;
memberId: z.ZodString;
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
}, z.core.$strict>, z.ZodObject<{
kind: z.ZodLiteral<"pending-invitation">;
email: z.ZodPipe<z.ZodString, z.ZodEmail>;
}, z.core.$strict>], "kind">;
}, z.core.$strict>>;
}, z.core.$strict>;
timestamp: z.ZodString;
}, z.core.$strict>;
export type WorkspaceTrycompReceipt = z.output<typeof WorkspaceTrycompReceiptSchema>;
/** Consumes a freshly verified Workspace ledger receipt; never creates a Slack notification. */
export declare class D1WorkspaceTrycompMutationStore extends D1TrycompMutationStore implements TrycompMutationStore {
#private;
constructor(db: D1Database, receipt: WorkspaceTrycompReceipt, clock?: () => number, identityBudget?: IdentityWriteBudget);
markAttempted(input: {
actionIndex: number;
lease: ActiveResourceLease;
runId: string;
}): Promise<void>;
recordPreannouncement(input: {
runId: string;
lease: ActiveResourceLease;
intentKey: string;
slackTimestamp: string;
}): Promise<void>;
}