@saturn-universe/core 0.1.2-dev.7 → 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 +4 -0
- package/dist/team.d.ts +2 -1
- package/dist/team.js +7 -5
- package/package.json +1 -1
package/dist/contracts.d.ts
CHANGED
|
@@ -196,7 +196,9 @@ export interface ModeTeamConfig {
|
|
|
196
196
|
readonly coordinatorPollIntervalMs?: number;
|
|
197
197
|
readonly workerSoftCheckpointMs?: number;
|
|
198
198
|
readonly maxActiveDepth1?: number;
|
|
199
|
+
readonly defaultConcurrency?: number;
|
|
199
200
|
readonly maxConcurrency?: number;
|
|
201
|
+
readonly defaultPreset?: string;
|
|
200
202
|
}
|
|
201
203
|
export interface ModeLimitsConfig {
|
|
202
204
|
readonly maxModelAttempts?: number;
|
|
@@ -234,6 +236,7 @@ export interface RunConfig {
|
|
|
234
236
|
readonly coordinatorPollIntervalMs?: number;
|
|
235
237
|
readonly workerSoftCheckpointMs?: number;
|
|
236
238
|
readonly teamMaxActiveDepth1?: number;
|
|
239
|
+
readonly teamDefaultConcurrency?: number;
|
|
237
240
|
readonly teamMaxConcurrency?: number;
|
|
238
241
|
readonly teamHint?: TeamHintConfig;
|
|
239
242
|
readonly planner?: PlannerConfig;
|
|
@@ -414,6 +417,7 @@ export interface TeamMemberConfig {
|
|
|
414
417
|
readonly task: string;
|
|
415
418
|
readonly sandboxProfile?: WorkerSandboxProfile;
|
|
416
419
|
readonly workSubpath?: string;
|
|
420
|
+
readonly modeRef?: string;
|
|
417
421
|
}
|
|
418
422
|
export interface TeamState {
|
|
419
423
|
readonly runId: RunId;
|
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
|
}
|