@saturn-universe/runtime 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,46 @@
1
+ import type { AgentLoop, AgentResult, AgentSessionId, CommandId, ExecutionEnvironmentReader, RunConfig, RunId, RunScope, RunState, RuntimeJournal, RuntimeStateReader, SessionSurface, SurfaceReader, TeamConfig, Turn, TurnId, WorkerSandboxProfile } from '@saturn-universe/core';
2
+ interface Dependencies {
3
+ agent: AgentLoop;
4
+ environment: ExecutionEnvironmentReader;
5
+ state: RuntimeStateReader;
6
+ journal: RuntimeJournal;
7
+ surface?: SurfaceReader;
8
+ resumeAutomatically(runId: RunState['runId'], commandId: CommandId): Promise<boolean>;
9
+ freezeWorkerConfig?: (mainConfig: RunConfig, team: TeamConfig, id: AgentSessionId, options?: {
10
+ readonly depth?: number;
11
+ }) => Promise<RunConfig>;
12
+ pendingSteers?: Map<CommandId, {
13
+ readonly commandId: CommandId;
14
+ readonly content: string;
15
+ }>;
16
+ onWorkerStart?: (input: {
17
+ readonly runId: RunId;
18
+ readonly memberId: string;
19
+ readonly agentSessionId: AgentSessionId;
20
+ readonly parentMemberId?: string;
21
+ readonly parentAgentSessionId?: AgentSessionId;
22
+ readonly sandboxProfile?: WorkerSandboxProfile;
23
+ readonly workSubpath?: string;
24
+ }) => Promise<void>;
25
+ onWorkerComplete?: (input: {
26
+ readonly runId: RunId;
27
+ readonly memberId: string;
28
+ readonly agentSessionId: AgentSessionId;
29
+ readonly parentMemberId?: string;
30
+ readonly workSubpath?: string;
31
+ readonly status: 'completed' | 'failed' | 'interrupted';
32
+ }) => Promise<void>;
33
+ now(): string;
34
+ id(): string;
35
+ }
36
+ export interface TeamWake {
37
+ readonly target: EventTarget;
38
+ readonly waiters: Set<() => void>;
39
+ }
40
+ export declare function driveTeam(d: Dependencies, scope: RunScope, parentSignal: AbortSignal, wake: TeamWake): Promise<AgentResult | undefined>;
41
+ export declare function extractSpawnTeamCall(surface: SessionSurface, turnId: TurnId): {
42
+ readonly reason: string;
43
+ readonly team: TeamConfig;
44
+ } | undefined;
45
+ export declare function approvalResumeDeadline(turn: Turn, run: RunState, now: string): string | undefined;
46
+ export {};