Skip to content
Sarj Workspace Sync

execution/trycomp-adapter

@sarj-ai/workspace-sync/execution/trycomp-adapter ยท Source

import type { TrycompReviewedPlan, TrycompReviewedSlice } from "../trycomp/model.ts";
import type { WorkspaceDirectoryBranchPlan } from "./contracts.ts";
import type { TrycompPeopleSyncRuntime } from "./provider-runtime-ports.ts";
import type { WorkspaceRuntimeConfiguration as ValidatedEnv } from "./runtime-configuration.ts";
type TrycompPeopleBranchPlan = Extract<WorkspaceDirectoryBranchPlan, {
branchId: "trycomp-people";
}>;
interface ITrycompAdapter {
apply(reviewedPlan: TrycompReviewedPlan): Promise<string>;
capture(): Promise<TrycompPeopleBranchPlan>;
readSlice(reviewedPlan: TrycompReviewedPlan): Promise<TrycompReviewedSlice>;
sourceFingerprint(): Promise<null | string>;
}
export declare class TrycompAdapter implements ITrycompAdapter {
#private;
constructor(env: ValidatedEnv, runtime: () => TrycompPeopleSyncRuntime, applyReviewed?: (plan: TrycompReviewedPlan) => Promise<string>, readVerifiedInvitation?: (plan: TrycompReviewedPlan) => Promise<null | string>);
capture(): Promise<TrycompPeopleBranchPlan>;
sourceFingerprint(): Promise<null | string>;
readSlice(reviewedPlan: TrycompReviewedPlan): Promise<{
state: "converged" | "drifted" | "pending";
selectedIdentity?: {
googleUserId: string & import("zod").$brand<"GoogleUserId">;
provider: {
kind: "member";
memberId: string;
email: string;
} | {
kind: "pending-invitation";
email: string;
};
} | undefined;
}>;
apply(reviewedPlan: TrycompReviewedPlan): Promise<string>;
}
export declare function projectTrycompDiagnostics(reviewedPlan: TrycompReviewedPlan): {
code: string;
message: string;
scope: {
actionId: "workspace-directory.trycomp-people";
kind: "action";
};
severity: "blocker";
}[];
export declare function captureTrycompAuthority(runtime: TrycompPeopleSyncRuntime): Promise<{
activeGoogleUserCount: number;
contractorGroup: {
email: string;
id: string;
members: ({
id: string;
role: "MANAGER" | "MEMBER" | "OWNER";
status: "ACTIVE" | "ARCHIVED" | "SUSPENDED" | "UNKNOWN";
email: string;
type: "USER";
} | {
id: string;
role: "MANAGER" | "MEMBER" | "OWNER";
status: "ACTIVE" | "ARCHIVED" | "SUSPENDED" | "UNKNOWN";
email: string;
type: "GROUP";
} | {
id: string;
role: "MANAGER" | "MEMBER" | "OWNER";
status: "ACTIVE" | "ARCHIVED" | "SUSPENDED" | "UNKNOWN";
email: string;
type: "CUSTOMER";
})[];
};
googleUsers: import("../org-sync/model.ts").GoogleDirectoryUser[];
}>;
export {};