@saturn-universe/core 0.1.2-dev.6 → 0.1.2-dev.8
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.
- package/dist/contracts.d.ts +17 -1
- package/dist/team.d.ts +2 -1
- package/dist/team.js +7 -5
- package/package.json +1 -1
package/dist/contracts.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export interface Session {
|
|
|
39
39
|
readonly title: string;
|
|
40
40
|
readonly status: 'open' | 'archived';
|
|
41
41
|
readonly createdAt: ISODateTime;
|
|
42
|
+
readonly modeRef?: string;
|
|
42
43
|
}
|
|
43
44
|
export type AgentSessionScope = 'run' | 'session' | 'project';
|
|
44
45
|
export type AgentSessionOwner = {
|
|
@@ -195,7 +196,9 @@ export interface ModeTeamConfig {
|
|
|
195
196
|
readonly coordinatorPollIntervalMs?: number;
|
|
196
197
|
readonly workerSoftCheckpointMs?: number;
|
|
197
198
|
readonly maxActiveDepth1?: number;
|
|
199
|
+
readonly defaultConcurrency?: number;
|
|
198
200
|
readonly maxConcurrency?: number;
|
|
201
|
+
readonly defaultPreset?: string;
|
|
199
202
|
}
|
|
200
203
|
export interface ModeLimitsConfig {
|
|
201
204
|
readonly maxModelAttempts?: number;
|
|
@@ -233,6 +236,7 @@ export interface RunConfig {
|
|
|
233
236
|
readonly coordinatorPollIntervalMs?: number;
|
|
234
237
|
readonly workerSoftCheckpointMs?: number;
|
|
235
238
|
readonly teamMaxActiveDepth1?: number;
|
|
239
|
+
readonly teamDefaultConcurrency?: number;
|
|
236
240
|
readonly teamMaxConcurrency?: number;
|
|
237
241
|
readonly teamHint?: TeamHintConfig;
|
|
238
242
|
readonly planner?: PlannerConfig;
|
|
@@ -413,6 +417,7 @@ export interface TeamMemberConfig {
|
|
|
413
417
|
readonly task: string;
|
|
414
418
|
readonly sandboxProfile?: WorkerSandboxProfile;
|
|
415
419
|
readonly workSubpath?: string;
|
|
420
|
+
readonly modeRef?: string;
|
|
416
421
|
}
|
|
417
422
|
export interface TeamState {
|
|
418
423
|
readonly runId: RunId;
|
|
@@ -641,7 +646,7 @@ export interface StreamRef {
|
|
|
641
646
|
readonly id: string;
|
|
642
647
|
}
|
|
643
648
|
export type WorkspaceEventType = 'workspace.created' | 'workspace.archived' | 'agent.created';
|
|
644
|
-
export type SessionEventType = 'session.created' | 'session.archived' | 'session.agent.bound';
|
|
649
|
+
export type SessionEventType = 'session.created' | 'session.archived' | 'session.agent.bound' | 'session.mode.selected';
|
|
645
650
|
export declare const terminalRunEventTypes: readonly ("run.completed" | "run.failed" | "run.cancelled")[];
|
|
646
651
|
export type TerminalRunEventType = (typeof terminalRunEventTypes)[number];
|
|
647
652
|
export declare function isTerminalRunEventType(value: unknown): value is TerminalRunEventType;
|
|
@@ -699,6 +704,9 @@ export interface EventDataMap {
|
|
|
699
704
|
'session.archived': {
|
|
700
705
|
readonly reason: string;
|
|
701
706
|
};
|
|
707
|
+
'session.mode.selected': {
|
|
708
|
+
readonly modeRef: string;
|
|
709
|
+
};
|
|
702
710
|
'agent_session.created': {
|
|
703
711
|
readonly agentSession: AgentSession;
|
|
704
712
|
};
|
|
@@ -1171,6 +1179,7 @@ export interface PersistedResponsesHistoryPlan {
|
|
|
1171
1179
|
readonly initialSystemPrompt?: string;
|
|
1172
1180
|
readonly initialBackground?: readonly BackgroundHistoryMessage[];
|
|
1173
1181
|
readonly prunedToolResults?: boolean;
|
|
1182
|
+
readonly projectedToolHistory?: true;
|
|
1174
1183
|
readonly fullInputDigest: string;
|
|
1175
1184
|
readonly configurationDigest: string;
|
|
1176
1185
|
readonly backgroundDigest?: string;
|
|
@@ -1213,6 +1222,8 @@ export interface HistorySelection {
|
|
|
1213
1222
|
}
|
|
1214
1223
|
export interface HistoryBuildInput {
|
|
1215
1224
|
readonly surface: SessionSurface;
|
|
1225
|
+
readonly modeRef?: string;
|
|
1226
|
+
readonly historicalRunModes?: Readonly<Record<string, string>>;
|
|
1216
1227
|
readonly model: ModelRef;
|
|
1217
1228
|
readonly binding: ProviderBinding;
|
|
1218
1229
|
readonly capabilities: ModelCapabilities;
|
|
@@ -1836,6 +1847,7 @@ export interface ContextStateSnapshot {
|
|
|
1836
1847
|
readonly surface: SessionSurface;
|
|
1837
1848
|
readonly runState: RunState;
|
|
1838
1849
|
readonly activeRequest?: PersistedModelRequest;
|
|
1850
|
+
readonly historicalRunModes?: Readonly<Record<string, string>>;
|
|
1839
1851
|
readonly teamReports?: readonly {
|
|
1840
1852
|
readonly from: string;
|
|
1841
1853
|
readonly text: string;
|
|
@@ -2123,6 +2135,10 @@ export type HostSubmitInput = Omit<SubmitTask, 'commandId' | 'config' | 'planner
|
|
|
2123
2135
|
export type HostCommand = Exclude<RuntimeCommand, {
|
|
2124
2136
|
readonly type: 'run.submit' | 'tool.approval.resolve';
|
|
2125
2137
|
}> | {
|
|
2138
|
+
readonly type: 'session.mode.select';
|
|
2139
|
+
readonly sessionId: SessionId;
|
|
2140
|
+
readonly modeRef: string;
|
|
2141
|
+
} | {
|
|
2126
2142
|
readonly type: 'run.steer';
|
|
2127
2143
|
readonly runId: RunId;
|
|
2128
2144
|
readonly content: string;
|
package/dist/team.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const defaultTeamConcurrency = 4;
|
|
|
9
9
|
export declare const maxTeamDepth = 2;
|
|
10
10
|
export declare const maxTeamMembers = 16;
|
|
11
11
|
export declare const maxAsyncTeamMembers = 256;
|
|
12
|
+
export declare const teamModeSelectorPattern: RegExp;
|
|
12
13
|
export declare const teamMemberIdPattern: RegExp;
|
|
13
14
|
export declare const teamNotifyMessagePrefix = "notify:";
|
|
14
15
|
export declare const defaultCoordinatorPollIntervalMs = 600000;
|
|
@@ -16,7 +17,7 @@ export declare function teamConcurrency(team: TeamConfig): number;
|
|
|
16
17
|
export declare function isTeamNotifyMessageId(messageId: string): boolean;
|
|
17
18
|
export declare function isAsyncCoordinatorConfig(config: Pick<RunConfig, 'modeRef' | 'teamAsyncCoordinator'>): boolean;
|
|
18
19
|
/** Resolve the total concurrent non-root worker limit consistently across scheduler and projection. */
|
|
19
|
-
export declare function resolveEffectiveTeamConcurrency(
|
|
20
|
+
export declare function resolveEffectiveTeamConcurrency(requested: number | undefined, config?: Pick<RunConfig, 'teamDefaultConcurrency' | 'teamMaxConcurrency'>): number;
|
|
20
21
|
export declare function maxRunTeamWorkers(config: Pick<RunConfig, 'modeRef' | 'teamAsyncCoordinator' | 'teamHint'>): number;
|
|
21
22
|
export declare function coordinatorPollIntervalMs(config: Pick<RunConfig, 'coordinatorPollIntervalMs'>): number;
|
|
22
23
|
export declare function validateWorkSubpath(raw: string): string;
|
package/dist/team.js
CHANGED
|
@@ -5,6 +5,7 @@ export const defaultTeamConcurrency = 4;
|
|
|
5
5
|
export const maxTeamDepth = 2;
|
|
6
6
|
export const maxTeamMembers = 16;
|
|
7
7
|
export const maxAsyncTeamMembers = 256;
|
|
8
|
+
export const teamModeSelectorPattern = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}(?:@[A-Za-z0-9][A-Za-z0-9._-]{0,63})?$/;
|
|
8
9
|
export const teamMemberIdPattern = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
9
10
|
export const teamNotifyMessagePrefix = 'notify:';
|
|
10
11
|
export const defaultCoordinatorPollIntervalMs = 600_000;
|
|
@@ -20,11 +21,9 @@ export function isAsyncCoordinatorConfig(config) {
|
|
|
20
21
|
return config.modeRef === 'ctf@1' || config.modeRef.startsWith('ctf@');
|
|
21
22
|
}
|
|
22
23
|
/** Resolve the total concurrent non-root worker limit consistently across scheduler and projection. */
|
|
23
|
-
export function resolveEffectiveTeamConcurrency(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
return Math.max(1, Math.min(teamConcurrencyValue, config?.teamMaxConcurrency ?? teamConcurrencyValue));
|
|
24
|
+
export function resolveEffectiveTeamConcurrency(requested, config) {
|
|
25
|
+
const concurrency = requested ?? config?.teamDefaultConcurrency ?? defaultTeamConcurrency;
|
|
26
|
+
return Math.max(1, Math.min(concurrency, config?.teamMaxConcurrency ?? concurrency));
|
|
28
27
|
}
|
|
29
28
|
export function maxRunTeamWorkers(config) {
|
|
30
29
|
if (config.teamHint?.maxMembers !== undefined)
|
|
@@ -90,6 +89,9 @@ export function validateTeamConfig(value, options) {
|
|
|
90
89
|
member.sandboxProfile !== 'readonly' &&
|
|
91
90
|
member.sandboxProfile !== 'build')
|
|
92
91
|
invalid(`invalid sandboxProfile for team member ${member.id}`);
|
|
92
|
+
if (member.modeRef !== undefined &&
|
|
93
|
+
(typeof member.modeRef !== 'string' || !teamModeSelectorPattern.test(member.modeRef)))
|
|
94
|
+
invalid(`invalid modeRef for team member ${member.id}`);
|
|
93
95
|
if (member.workSubpath !== undefined) {
|
|
94
96
|
validateWorkSubpath(member.workSubpath);
|
|
95
97
|
}
|