Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

models.ts

42 lines1.0 KB

1import type {
2 EnvironmentId,
3 OrchestrationMessage,
4 OrchestrationProjectShell,
5 OrchestrationThread,
6 OrchestrationThreadShell,
7} from "@t3tools/contracts";
8​
9export interface EnvironmentProject extends OrchestrationProjectShell {
10 readonly environmentId: EnvironmentId;
12​
13export interface EnvironmentThreadShell extends OrchestrationThreadShell {
14 readonly environmentId: EnvironmentId;
16​
17export type EnvironmentMessage = OrchestrationMessage;
18​
19export interface EnvironmentThread extends OrchestrationThread {
20 readonly environmentId: EnvironmentId;
22​
23export function scopeProject(
24 environmentId: EnvironmentId,
25 project: OrchestrationProjectShell,
26): EnvironmentProject {
27 return { ...project, environmentId };
29​
30export function scopeThreadShell(
31 environmentId: EnvironmentId,
32 thread: OrchestrationThreadShell,
33): EnvironmentThreadShell {
34 return { ...thread, environmentId };
36​
37export function scopeThread(
38 environmentId: EnvironmentId,
39 thread: OrchestrationThread,
40): EnvironmentThread {
41 return { ...thread, environmentId };