mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-21 09:01:23 +00:00
28 lines
771 B
TypeScript
28 lines
771 B
TypeScript
import { actor, queue } from "rivetkit";
|
|
import { workflow } from "rivetkit/workflow";
|
|
import { repoDb } from "./db/db.js";
|
|
import { REPO_QUEUE_NAMES, repoActions, runRepoWorkflow } from "./actions.js";
|
|
|
|
export interface RepoInput {
|
|
workspaceId: string;
|
|
repoId: string;
|
|
remoteUrl: string;
|
|
}
|
|
|
|
export const repo = actor({
|
|
db: repoDb,
|
|
queues: Object.fromEntries(REPO_QUEUE_NAMES.map((name) => [name, queue()])),
|
|
options: {
|
|
actionTimeout: 5 * 60_000,
|
|
},
|
|
createState: (_c, input: RepoInput) => ({
|
|
workspaceId: input.workspaceId,
|
|
repoId: input.repoId,
|
|
remoteUrl: input.remoteUrl,
|
|
localPath: null as string | null,
|
|
syncActorsStarted: false,
|
|
taskIndexHydrated: false
|
|
}),
|
|
actions: repoActions,
|
|
run: workflow(runRepoWorkflow),
|
|
});
|