@mediadatafusion/pi-workflow-suite 0.0.11 → 0.0.12
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/CHANGELOG.md +36 -0
- package/README.md +26 -17
- package/VERSION +1 -1
- package/agents/codebase-research.md +7 -5
- package/agents/general-worker.md +9 -7
- package/agents/implementation-planning.md +5 -3
- package/agents/quality-validation.md +9 -8
- package/agents/workflow-orchestrator.md +9 -7
- package/config/prompts/execute-approved-plan.md +12 -2
- package/config/prompts/mission-final-validation.md +38 -5
- package/config/prompts/mission-plan.md +17 -1
- package/config/prompts/mission-repair.md +16 -2
- package/config/prompts/mission-review-prompt.md +19 -6
- package/config/prompts/mission-run.md +18 -5
- package/config/prompts/validate-approved-plan.md +57 -3
- package/config/prompts/workflow-plan-prompt.md +11 -1
- package/config/prompts/workflow-repair.md +18 -2
- package/config/prompts/workflow-reviewer-prompt.md +25 -9
- package/config/prompts/workflow-summary.md +1 -4
- package/config/workflow-settings.example.json +13 -11
- package/docs/assets/mediadatafusion-logo.png +0 -0
- package/docs/assets/pi-workflow-suite-demo.gif +0 -0
- package/docs/assets/pi-workflow-suite-demo.mp4 +0 -0
- package/docs/assets/pi-workflow-suite-header.png +0 -0
- package/docs/assets/pi-workflow-suite-video-thumb.png +0 -0
- package/docs/assets/readme-link-commands.svg +10 -0
- package/docs/assets/readme-link-install.svg +10 -0
- package/docs/assets/readme-link-quick-start.svg +10 -0
- package/docs/assets/readme-link-settings.svg +10 -0
- package/docs/assets/screenshots/.gitkeep +1 -0
- package/docs/assets/screenshots/00-mission-home.png +0 -0
- package/docs/assets/screenshots/01-startup-Logo.png +0 -0
- package/docs/assets/screenshots/02-theme-settings.png +0 -0
- package/docs/assets/screenshots/03-GlobalSafetySettings.png +0 -0
- package/docs/assets/screenshots/04-SharedSubAgentsSettings.png +0 -0
- package/docs/assets/screenshots/05-mission-mode.png +0 -0
- package/docs/assets/screenshots/06-diagram-mermaid.png +0 -0
- package/extensions/subagent/index.ts +41 -18
- package/extensions/subagent/repolock-guard.ts +224 -4
- package/extensions/subagent/runner.ts +136 -12
- package/extensions/workflow-model-router.ts +124 -41
- package/extensions/workflow-modes.ts +3791 -967
- package/extensions/workflow-settings-capabilities.ts +10 -0
- package/extensions/workflow-state.ts +77 -10
- package/extensions/workflow-subagent-policy.ts +13 -1
- package/extensions/workflow-summary.ts +8 -19
- package/extensions/workflow-tool-guard.ts +326 -35
- package/extensions/workflow-validation-classifier.ts +46 -4
- package/extensions/workflow-web-tools.ts +361 -1
- package/package.json +9 -5
- package/scripts/audit-live.sh +1 -1
- package/scripts/build-package-export.mjs +8 -13
- package/scripts/check-clean-release-tree.sh +3 -2
- package/scripts/check-package-media.mjs +78 -0
- package/scripts/install-to-live.sh +2 -0
- package/scripts/package-media-config.mjs +28 -0
- package/scripts/prepare-package-readme.mjs +19 -18
- package/scripts/quarantine-live-junk.sh +1 -1
- package/scripts/verify-live.sh +9 -1
- package/skills/implementation-planning/SKILL.md +1 -1
- package/skills/safe-execution/SKILL.md +1 -1
- package/skills/validation-review/SKILL.md +1 -1
|
@@ -37,6 +37,7 @@ export type WorkflowStartupLogo = "none" | "pi" | "custom";
|
|
|
37
37
|
export type WorkflowStartupLogoFont = "block" | "shadow" | "outline" | "wide" | "double" | "three_d" | "solid";
|
|
38
38
|
export type WorkflowStartupLogoShadowDirection = "down_right" | "down" | "up" | "left" | "right";
|
|
39
39
|
export type WorkflowStartupLogoColorStyle = "theme" | "primary" | "split";
|
|
40
|
+
export type WorkflowWidgetTextPreset = "normal" | "bold" | "light" | "rich" | "italic" | "underline" | "terminal" | "smallcaps" | "typewriter";
|
|
40
41
|
export type CustomBrandBaseVisual = "minimal" | "diagnostic_center" | "workflow_duo" | "mission_control" | "data_stream" | "neural_grid";
|
|
41
42
|
export type RepairRetryGateName = "review" | "validation" | "missionValidation" | "missionFinalValidation";
|
|
42
43
|
|
|
@@ -93,6 +94,7 @@ export interface WorkflowSubagentSettings {
|
|
|
93
94
|
planningOrchestrationPolicy?: PlanningOrchestrationPolicy;
|
|
94
95
|
subagentTimeoutMinutes?: number;
|
|
95
96
|
subagentStaleMinutes?: number;
|
|
97
|
+
allowBackgroundSubagents?: boolean;
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
export interface WorkflowSettings {
|
|
@@ -186,6 +188,7 @@ export interface WorkflowSettings {
|
|
|
186
188
|
progressWidgetEnabled?: boolean;
|
|
187
189
|
progressOutputMode?: "compact" | "detailed";
|
|
188
190
|
showProgressBar?: boolean;
|
|
191
|
+
missionHistoryLimit?: number;
|
|
189
192
|
heartbeatEnabled?: boolean;
|
|
190
193
|
watchdogEnabled?: boolean;
|
|
191
194
|
watchdogStaleMinutes?: number;
|
|
@@ -238,6 +241,8 @@ export interface WorkflowSettings {
|
|
|
238
241
|
showPresetShortcutHint?: boolean;
|
|
239
242
|
workflowTheme?: string;
|
|
240
243
|
workflowThemeOverrides?: Record<string, string>;
|
|
244
|
+
widgetTextStyle?: WorkflowWidgetTextPreset;
|
|
245
|
+
startupTextStyle?: WorkflowWidgetTextPreset;
|
|
241
246
|
startupVisual?: WorkflowStartupVisual;
|
|
242
247
|
startupLogo?: WorkflowStartupLogo;
|
|
243
248
|
startupLogoText?: string;
|
|
@@ -256,10 +261,10 @@ export interface WorkflowSettings {
|
|
|
256
261
|
compactionModelProvider: string;
|
|
257
262
|
compactionModel: string;
|
|
258
263
|
compactionAgent: string;
|
|
259
|
-
customCompactionEnabled
|
|
260
|
-
autoCompactionEnabled
|
|
261
|
-
compactionTriggerPercent
|
|
262
|
-
compactionCooldownMinutes
|
|
264
|
+
customCompactionEnabled?: boolean;
|
|
265
|
+
autoCompactionEnabled?: boolean;
|
|
266
|
+
compactionTriggerPercent?: number;
|
|
267
|
+
compactionCooldownMinutes?: number;
|
|
263
268
|
customCompactionReserveTokens?: number;
|
|
264
269
|
customCompactionKeepRecentTokens?: number;
|
|
265
270
|
workflowCompactionCheckMode?: WorkflowCompactionCheckMode;
|
|
@@ -446,6 +451,7 @@ const BUILTIN_DEFAULT_WORKFLOW_SETTINGS = {
|
|
|
446
451
|
"progressWidgetEnabled": true,
|
|
447
452
|
"progressOutputMode": "compact",
|
|
448
453
|
"showProgressBar": true,
|
|
454
|
+
"missionHistoryLimit": 50,
|
|
449
455
|
"heartbeatEnabled": true,
|
|
450
456
|
"watchdogEnabled": false,
|
|
451
457
|
"watchdogStaleMinutes": 30,
|
|
@@ -524,6 +530,8 @@ const BUILTIN_DEFAULT_WORKFLOW_SETTINGS = {
|
|
|
524
530
|
"showPresetShortcutHint": true,
|
|
525
531
|
"workflowTheme": "aurora",
|
|
526
532
|
"workflowThemeOverrides": {},
|
|
533
|
+
"widgetTextStyle": undefined,
|
|
534
|
+
"startupTextStyle": undefined,
|
|
527
535
|
"startupVisual": "mission_control",
|
|
528
536
|
"startupLogo": "pi",
|
|
529
537
|
"startupLogoText": "",
|
|
@@ -574,7 +582,8 @@ const BUILTIN_DEFAULT_WORKFLOW_SETTINGS = {
|
|
|
574
582
|
"requireParallelEditConflictProtection": true,
|
|
575
583
|
"planningOrchestrationPolicy": "orchestrator_first",
|
|
576
584
|
"subagentTimeoutMinutes": 20,
|
|
577
|
-
"subagentStaleMinutes": 8
|
|
585
|
+
"subagentStaleMinutes": 8,
|
|
586
|
+
"allowBackgroundSubagents": true
|
|
578
587
|
},
|
|
579
588
|
"planning": {
|
|
580
589
|
"clarificationMode": "auto",
|
|
@@ -594,8 +603,6 @@ const BUILTIN_DEFAULT_WORKFLOW_SETTINGS = {
|
|
|
594
603
|
"compactionModel": "",
|
|
595
604
|
"compactionAgent": "",
|
|
596
605
|
"customCompactionEnabled": false,
|
|
597
|
-
"autoCompactionEnabled": false,
|
|
598
|
-
"compactionTriggerPercent": 85,
|
|
599
606
|
"compactionCooldownMinutes": 5,
|
|
600
607
|
"customCompactionReserveTokens": 16384,
|
|
601
608
|
"customCompactionKeepRecentTokens": 20000,
|
|
@@ -790,6 +797,50 @@ export interface SettingsWriteResult {
|
|
|
790
797
|
file: string;
|
|
791
798
|
}
|
|
792
799
|
|
|
800
|
+
interface UpdateSettingsOptions {
|
|
801
|
+
preserveActivePreset?: boolean;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
export const WORKFLOW_MANUAL_PRESET = "custom";
|
|
805
|
+
|
|
806
|
+
function presetOwnedSettingsSignature(settings: WorkflowSettings): string {
|
|
807
|
+
const { models: _ignoredStandardModels, ...standardWithoutModels } = settings.standard;
|
|
808
|
+
const { models: _ignoredMissionModels, ...missionsWithoutModels } = settings.missions;
|
|
809
|
+
return JSON.stringify({
|
|
810
|
+
planning: settings.planning,
|
|
811
|
+
workflow: settings.workflow,
|
|
812
|
+
standard: standardWithoutModels,
|
|
813
|
+
missions: missionsWithoutModels,
|
|
814
|
+
subagents: settings.subagents,
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
function applyActivePresetOverlay(settings: WorkflowSettings): WorkflowSettings {
|
|
819
|
+
const active = settings.presets?.activePreset ?? WORKFLOW_MANUAL_PRESET;
|
|
820
|
+
if (active === WORKFLOW_MANUAL_PRESET) return settings;
|
|
821
|
+
const preset = workflowPresetCatalog(settings)[active];
|
|
822
|
+
if (!preset) return settings;
|
|
823
|
+
const defaults = defaultWorkflowSettings();
|
|
824
|
+
const normalized = normalizeWorkflowPresetBundle(preset);
|
|
825
|
+
const currentStandardModels = settings.standard.models;
|
|
826
|
+
const currentMissionModels = settings.missions.models;
|
|
827
|
+
return {
|
|
828
|
+
...settings,
|
|
829
|
+
planning: normalized.planning ? { ...settings.planning, ...normalized.planning } : settings.planning,
|
|
830
|
+
workflow: normalized.workflow ? { ...settings.workflow, ...normalized.workflow } : settings.workflow,
|
|
831
|
+
standard: {
|
|
832
|
+
...defaults.standard,
|
|
833
|
+
...settings.standard,
|
|
834
|
+
...normalized.standard,
|
|
835
|
+
subagents: { ...(defaults.standard.subagents ?? {}), ...(settings.standard.subagents ?? {}), ...(normalized.standard.subagents ?? {}) },
|
|
836
|
+
models: currentStandardModels,
|
|
837
|
+
},
|
|
838
|
+
missions: normalized.missions ? { ...settings.missions, ...normalized.missions, models: currentMissionModels } : settings.missions,
|
|
839
|
+
subagents: normalized.subagents ? { ...settings.subagents, ...normalized.subagents } : settings.subagents,
|
|
840
|
+
presets: settings.presets,
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
|
|
793
844
|
/** Load effective settings: project overrides merged over global. */
|
|
794
845
|
export function loadEffectiveSettings(cwd: string): EffectiveSettings {
|
|
795
846
|
const global = loadGlobalSettings();
|
|
@@ -797,7 +848,7 @@ export function loadEffectiveSettings(cwd: string): EffectiveSettings {
|
|
|
797
848
|
if (!projectPath) return { settings: global, projectOverridePath: undefined };
|
|
798
849
|
try {
|
|
799
850
|
const project = JSON.parse(readFileSync(projectPath, "utf8")) as Partial<WorkflowSettings>;
|
|
800
|
-
return { settings: mergeSettings(global, project), projectOverridePath: projectPath };
|
|
851
|
+
return { settings: applyActivePresetOverlay(mergeSettings(global, project)), projectOverridePath: projectPath };
|
|
801
852
|
} catch {
|
|
802
853
|
return { settings: global, projectOverridePath: projectPath };
|
|
803
854
|
}
|
|
@@ -811,7 +862,7 @@ export function loadGlobalSettings(): WorkflowSettings {
|
|
|
811
862
|
return defaults;
|
|
812
863
|
}
|
|
813
864
|
const parsed = parseWorkflowSettingsFile(WORKFLOW_SETTINGS_FILE, defaults, "global workflow settings") as Partial<WorkflowSettings>;
|
|
814
|
-
return mergeSettings(defaults, parsed);
|
|
865
|
+
return applyActivePresetOverlay(mergeSettings(defaults, parsed));
|
|
815
866
|
}
|
|
816
867
|
|
|
817
868
|
/** Backwards-compatible: loads effective settings for a given cwd. */
|
|
@@ -869,10 +920,16 @@ export function createProjectSettingsOverride(cwd: string): SettingsWriteResult
|
|
|
869
920
|
return { settings, scope: "project", file };
|
|
870
921
|
}
|
|
871
922
|
|
|
872
|
-
export function updateSettings(cwd: string, requestedScope: WorkflowSettingsScope | undefined, updater: (settings: WorkflowSettings) => void): SettingsWriteResult {
|
|
923
|
+
export function updateSettings(cwd: string, requestedScope: WorkflowSettingsScope | undefined, updater: (settings: WorkflowSettings) => void, options: UpdateSettingsOptions = {}): SettingsWriteResult {
|
|
873
924
|
const target = getWriteTarget(cwd, requestedScope);
|
|
874
925
|
const settings = target.scope === "global" ? loadGlobalSettings() : loadEffectiveSettings(cwd).settings;
|
|
926
|
+
const beforePreset = settings.presets?.activePreset ?? WORKFLOW_MANUAL_PRESET;
|
|
927
|
+
const beforePresetOwned = presetOwnedSettingsSignature(settings);
|
|
875
928
|
updater(settings);
|
|
929
|
+
const afterPresetOwned = presetOwnedSettingsSignature(settings);
|
|
930
|
+
if (!options.preserveActivePreset && beforePreset !== WORKFLOW_MANUAL_PRESET && settings.presets?.activePreset === beforePreset && beforePresetOwned !== afterPresetOwned) {
|
|
931
|
+
settings.presets = { ...(settings.presets ?? {}), activePreset: WORKFLOW_MANUAL_PRESET, items: { ...(settings.presets?.items ?? {}) } };
|
|
932
|
+
}
|
|
876
933
|
saveSettingsFile(target.file, settings);
|
|
877
934
|
return { settings, scope: target.scope, file: target.file };
|
|
878
935
|
}
|
|
@@ -885,8 +942,8 @@ export function builtInWorkflowPresets(): Record<string, WorkflowPresetBundle> {
|
|
|
885
942
|
planning: { depth: "fast", clarificationMode: "auto", maxClarificationQuestions: 2, interactiveClarificationEnabled: true, clarificationQualityGate: false, useSubagentsBeforeClarification: true },
|
|
886
943
|
workflow: { offerReviewerBeforeExecute: false, autoRunReviewerBeforeExecute: false, offerValidationAfterExecute: true, autoRunValidationAfterExecute: true, validateAfterExecution: true, requirePlanApprovalBeforeExecute: false, requireApprovalBeforeExecution: false, autoRepairReviewFailures: false, autoRepairValidationFailures: true, reviewRetryMode: "off", validationRetryMode: "safe_only", maxReviewRetriesPerPlan: 0, maxReviewRetriesPerWorkflow: 0, maxValidationRetriesPerPlan: 1, maxValidationRetriesPerWorkflow: 2, pauseAfterReviewFailure: true, pauseAfterValidationFailure: false, planProgressEnabled: true, planRuntimeEnabled: true, planShowProgressBar: true },
|
|
887
944
|
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 1, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: false, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: false, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "auto", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 1, minExecutionWorkersForMaximum: 1, minRepairWorkersForDeep: 1, minRepairWorkersForMaximum: 1, minReviewWorkersForDeep: 1, minReviewWorkersForMaximum: 1, minValidationWorkersForDeep: 1, minValidationWorkersForMaximum: 1 }, statusWidgetVisible: true, useSharedExecutorModel: true, useStandardSpecificModels: false, modelRole: "executor" },
|
|
888
|
-
missions: { defaultAutonomy: "approval_gated", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "auto", maxClarificationQuestions: 2, planningDepth: "fast", useSubagentsBeforeClarification: true, autoRepairValidationFailures: true, validationRetryMode: "safe_only", maxValidationRetriesPerMilestone: 1, maxValidationRetriesPerMission: 2, finalValidationEnabled: false, autoRepairFinalValidationFailures: false, maxFinalValidationRetries: 0, subagentPolicy: "forced", minWorkersForDeep: 1, minWorkersForMaximum: 1 },
|
|
889
|
-
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "auto", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 1, minExecutionWorkersForMaximum: 1, minRepairWorkersForDeep: 1, minRepairWorkersForMaximum: 1, minReviewWorkersForDeep: 1, minReviewWorkersForMaximum: 1, minValidationWorkersForDeep: 1, minValidationWorkersForMaximum: 1 },
|
|
945
|
+
missions: { defaultAutonomy: "approval_gated", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "auto", maxClarificationQuestions: 2, planningDepth: "fast", useSubagentsBeforeClarification: true, autoRepairReviewFailures: false, reviewRetryMode: "off", maxReviewRetriesPerMission: 0, autoRepairValidationFailures: true, validationRetryMode: "safe_only", maxValidationRetriesPerMilestone: 1, maxValidationRetriesPerMission: 2, finalValidationEnabled: false, autoRepairFinalValidationFailures: false, maxFinalValidationRetries: 0, subagentPolicy: "forced", minWorkersForDeep: 1, minWorkersForMaximum: 1 },
|
|
946
|
+
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "auto", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 1, minExecutionWorkersForMaximum: 1, minRepairWorkersForDeep: 1, minRepairWorkersForMaximum: 1, minReviewWorkersForDeep: 1, minReviewWorkersForMaximum: 1, minValidationWorkersForDeep: 1, minValidationWorkersForMaximum: 1, allowBackgroundSubagents: false },
|
|
890
947
|
},
|
|
891
948
|
standard: {
|
|
892
949
|
displayName: "Standard",
|
|
@@ -894,47 +951,60 @@ export function builtInWorkflowPresets(): Record<string, WorkflowPresetBundle> {
|
|
|
894
951
|
planning: { depth: "standard", clarificationMode: "auto", maxClarificationQuestions: 3, interactiveClarificationEnabled: true, clarificationQualityGate: true, useSubagentsBeforeClarification: true },
|
|
895
952
|
workflow: { offerReviewerBeforeExecute: false, autoRunReviewerBeforeExecute: false, offerValidationAfterExecute: true, autoRunValidationAfterExecute: true, validateAfterExecution: true, requirePlanApprovalBeforeExecute: false, requireApprovalBeforeExecution: false, autoRepairReviewFailures: true, autoRepairValidationFailures: true, reviewRetryMode: "safe_only", validationRetryMode: "safe_only", maxReviewRetriesPerPlan: 2, maxReviewRetriesPerWorkflow: 4, maxValidationRetriesPerPlan: 2, maxValidationRetriesPerWorkflow: 4, pauseAfterReviewFailure: false, pauseAfterValidationFailure: false, planProgressEnabled: true, planRuntimeEnabled: true, planShowProgressBar: true },
|
|
896
953
|
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 1, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: true, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: false, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 2, minExecutionWorkersForMaximum: 2, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 2, minReviewWorkersForMaximum: 2, minValidationWorkersForDeep: 2, minValidationWorkersForMaximum: 2 }, statusWidgetVisible: true, useSharedExecutorModel: true, useStandardSpecificModels: false, modelRole: "executor" },
|
|
897
|
-
missions: { defaultAutonomy: "approval_gated", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "auto", maxClarificationQuestions: 3, planningDepth: "standard", useSubagentsBeforeClarification: true, autoRepairValidationFailures: true, validationRetryMode: "safe_only", maxValidationRetriesPerMilestone: 2, maxValidationRetriesPerMission: 6, finalValidationEnabled: false, autoRepairFinalValidationFailures: false, maxFinalValidationRetries: 1, subagentPolicy: "forced", minWorkersForDeep: 1, minWorkersForMaximum: 1 },
|
|
898
|
-
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 2, minExecutionWorkersForMaximum: 2, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 2, minReviewWorkersForMaximum: 2, minValidationWorkersForDeep: 2, minValidationWorkersForMaximum: 2 },
|
|
954
|
+
missions: { defaultAutonomy: "approval_gated", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "auto", maxClarificationQuestions: 3, planningDepth: "standard", useSubagentsBeforeClarification: true, autoRepairReviewFailures: true, reviewRetryMode: "safe_only", maxReviewRetriesPerMission: 2, autoRepairValidationFailures: true, validationRetryMode: "safe_only", maxValidationRetriesPerMilestone: 2, maxValidationRetriesPerMission: 6, finalValidationEnabled: false, autoRepairFinalValidationFailures: false, maxFinalValidationRetries: 1, subagentPolicy: "forced", minWorkersForDeep: 1, minWorkersForMaximum: 1 },
|
|
955
|
+
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 1, minPlanningWorkersForMaximum: 1, minExecutionWorkersForDeep: 2, minExecutionWorkersForMaximum: 2, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 2, minReviewWorkersForMaximum: 2, minValidationWorkersForDeep: 2, minValidationWorkersForMaximum: 2, allowBackgroundSubagents: false },
|
|
899
956
|
},
|
|
900
957
|
deep: {
|
|
901
958
|
displayName: "Deep",
|
|
902
959
|
description: "Careful end-to-end workflow for risky or codebase-heavy work with stronger clarification, automatic review/validation, final mission validation, and larger worker teams.",
|
|
903
960
|
planning: { depth: "deep", clarificationMode: "always_for_nontrivial", maxClarificationQuestions: 5, interactiveClarificationEnabled: true, clarificationQualityGate: true, useSubagentsBeforeClarification: true },
|
|
904
961
|
workflow: { offerReviewerBeforeExecute: false, autoRunReviewerBeforeExecute: true, offerValidationAfterExecute: true, autoRunValidationAfterExecute: true, validateAfterExecution: true, requirePlanApprovalBeforeExecute: false, requireApprovalBeforeExecution: false, autoRepairReviewFailures: true, autoRepairValidationFailures: true, reviewRetryMode: "safe_only", validationRetryMode: "safe_only", maxReviewRetriesPerPlan: 3, maxReviewRetriesPerWorkflow: 6, maxValidationRetriesPerPlan: 3, maxValidationRetriesPerWorkflow: 6, pauseAfterReviewFailure: false, pauseAfterValidationFailure: false, planProgressEnabled: true, planRuntimeEnabled: true, planShowProgressBar: true },
|
|
905
|
-
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "
|
|
906
|
-
missions: { defaultAutonomy: "approval_gated", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "always_for_nontrivial", maxClarificationQuestions: 5, planningDepth: "deep", useSubagentsBeforeClarification: true, autoRepairValidationFailures: true, validationRetryMode: "safe_only", maxValidationRetriesPerMilestone: 3, maxValidationRetriesPerMission: 8, finalValidationEnabled: true, autoRepairFinalValidationFailures: true, maxFinalValidationRetries: 2, subagentPolicy: "forced", minWorkersForDeep: 3, minWorkersForMaximum: 3 },
|
|
907
|
-
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 3, minPlanningWorkersForMaximum: 3, minExecutionWorkersForDeep: 3, minExecutionWorkersForMaximum: 3, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 3, minReviewWorkersForMaximum: 3, minValidationWorkersForDeep: 3, minValidationWorkersForMaximum: 3 },
|
|
962
|
+
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 2, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: true, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: true, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 2, minPlanningWorkersForMaximum: 2, minExecutionWorkersForDeep: 3, minExecutionWorkersForMaximum: 3, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 3, minReviewWorkersForMaximum: 3, minValidationWorkersForDeep: 3, minValidationWorkersForMaximum: 3 }, statusWidgetVisible: true, useSharedExecutorModel: true, useStandardSpecificModels: false, modelRole: "executor" },
|
|
963
|
+
missions: { defaultAutonomy: "approval_gated", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "always_for_nontrivial", maxClarificationQuestions: 5, planningDepth: "deep", useSubagentsBeforeClarification: true, autoRepairReviewFailures: true, reviewRetryMode: "safe_only", maxReviewRetriesPerMission: 3, autoRepairValidationFailures: true, validationRetryMode: "safe_only", maxValidationRetriesPerMilestone: 3, maxValidationRetriesPerMission: 8, finalValidationEnabled: true, autoRepairFinalValidationFailures: true, maxFinalValidationRetries: 2, subagentPolicy: "forced", minWorkersForDeep: 3, minWorkersForMaximum: 3 },
|
|
964
|
+
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 3, minPlanningWorkersForMaximum: 3, minExecutionWorkersForDeep: 3, minExecutionWorkersForMaximum: 3, minRepairWorkersForDeep: 2, minRepairWorkersForMaximum: 2, minReviewWorkersForDeep: 3, minReviewWorkersForMaximum: 3, minValidationWorkersForDeep: 3, minValidationWorkersForMaximum: 3, allowBackgroundSubagents: true },
|
|
908
965
|
},
|
|
909
966
|
maximum: {
|
|
910
967
|
displayName: "Maximum",
|
|
911
968
|
description: "Highest-rigor end-to-end workflow with strongest clarification, automatic review/validation, final mission validation, aggressive in-scope repair, and maximum worker teams.",
|
|
912
969
|
planning: { depth: "maximum", clarificationMode: "always_for_nontrivial", maxClarificationQuestions: 5, interactiveClarificationEnabled: true, clarificationQualityGate: true, useSubagentsBeforeClarification: true },
|
|
913
970
|
workflow: { offerReviewerBeforeExecute: false, autoRunReviewerBeforeExecute: true, offerValidationAfterExecute: true, autoRunValidationAfterExecute: true, validateAfterExecution: true, requirePlanApprovalBeforeExecute: false, requireApprovalBeforeExecution: false, autoRepairReviewFailures: true, autoRepairValidationFailures: true, reviewRetryMode: "aggressive_within_scope", validationRetryMode: "aggressive_within_scope", maxReviewRetriesPerPlan: 5, maxReviewRetriesPerWorkflow: 8, maxValidationRetriesPerPlan: 5, maxValidationRetriesPerWorkflow: 8, pauseAfterReviewFailure: false, pauseAfterValidationFailure: false, planProgressEnabled: true, planRuntimeEnabled: true, planShowProgressBar: true },
|
|
914
|
-
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "
|
|
915
|
-
missions: { defaultAutonomy: "supervised_auto", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "always_for_nontrivial", maxClarificationQuestions: 6, planningDepth: "maximum", useSubagentsBeforeClarification: true, autoRepairValidationFailures: true, validationRetryMode: "aggressive_within_scope", maxValidationRetriesPerMilestone: 4, maxValidationRetriesPerMission: 12, finalValidationEnabled: true, autoRepairFinalValidationFailures: true, maxFinalValidationRetries: 4, subagentPolicy: "forced", minWorkersForDeep: 4, minWorkersForMaximum: 4 },
|
|
916
|
-
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 4, minPlanningWorkersForMaximum: 4, minExecutionWorkersForDeep: 4, minExecutionWorkersForMaximum: 4, minRepairWorkersForDeep: 3, minRepairWorkersForMaximum: 3, minReviewWorkersForDeep: 4, minReviewWorkersForMaximum: 4, minValidationWorkersForDeep: 4, minValidationWorkersForMaximum: 4 },
|
|
971
|
+
standard: { enabled: true, autoTodoEnabled: true, todoProgressVisible: true, todoTriggerMode: "auto", clarificationEnabled: true, clarificationMode: "auto", maxClarificationQuestions: 2, interactiveClarificationEnabled: true, clarificationTiming: "after_initial_analysis", clarificationQualityGate: true, allowClarificationWithoutAnalysis: false, useSubagentsBeforeClarification: true, allowSubagents: true, subagentScope: "user", subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 3, minPlanningWorkersForMaximum: 3, minExecutionWorkersForDeep: 4, minExecutionWorkersForMaximum: 4, minRepairWorkersForDeep: 3, minRepairWorkersForMaximum: 3, minReviewWorkersForDeep: 4, minReviewWorkersForMaximum: 4, minValidationWorkersForDeep: 4, minValidationWorkersForMaximum: 4 }, statusWidgetVisible: true, useSharedExecutorModel: true, useStandardSpecificModels: false, modelRole: "executor" },
|
|
972
|
+
missions: { defaultAutonomy: "supervised_auto", requireValidationPerMilestone: true, autoRunAfterApproval: true, continueAcrossMilestones: true, pauseBetweenMilestones: false, clarificationMode: "always_for_nontrivial", maxClarificationQuestions: 6, planningDepth: "maximum", useSubagentsBeforeClarification: true, autoRepairReviewFailures: true, reviewRetryMode: "aggressive_within_scope", maxReviewRetriesPerMission: 5, autoRepairValidationFailures: true, validationRetryMode: "aggressive_within_scope", maxValidationRetriesPerMilestone: 4, maxValidationRetriesPerMission: 12, finalValidationEnabled: true, autoRepairFinalValidationFailures: true, maxFinalValidationRetries: 4, subagentPolicy: "forced", minWorkersForDeep: 4, minWorkersForMaximum: 4 },
|
|
973
|
+
subagents: { planningPolicy: "forced", executionPolicy: "forced", repairPolicy: "forced", reviewPolicy: "forced", validationPolicy: "forced", autoUseDuringPlanning: true, autoUseDuringExecution: true, autoUseDuringRepair: true, autoUseDuringReview: true, autoUseDuringValidation: true, minPlanningWorkersForDeep: 4, minPlanningWorkersForMaximum: 4, minExecutionWorkersForDeep: 4, minExecutionWorkersForMaximum: 4, minRepairWorkersForDeep: 3, minRepairWorkersForMaximum: 3, minReviewWorkersForDeep: 4, minReviewWorkersForMaximum: 4, minValidationWorkersForDeep: 4, minValidationWorkersForMaximum: 4, allowBackgroundSubagents: true },
|
|
917
974
|
},
|
|
918
975
|
};
|
|
919
976
|
}
|
|
920
977
|
|
|
921
978
|
function normalizeWorkflowPresetBundle(preset: WorkflowPresetBundle): WorkflowPresetBundle & { standard: WorkflowSettings["standard"] } {
|
|
922
979
|
const defaults = defaultWorkflowSettings();
|
|
980
|
+
const { models: _ignoredPresetStandardModels, ...standardWithoutModels } = (preset.standard ?? {}) as Partial<WorkflowSettings["standard"]>;
|
|
923
981
|
return {
|
|
924
982
|
...preset,
|
|
925
983
|
// Legacy custom presets saved before Standard Mode do not contain a
|
|
926
984
|
// standard section. Hydrate it from safe defaults during apply so stale
|
|
927
985
|
// Standard settings from the previously active preset cannot leak forward.
|
|
928
|
-
standard: normalizeStandardSettings(defaults, defaults.standard,
|
|
986
|
+
standard: normalizeStandardSettings(defaults, defaults.standard, standardWithoutModels as Partial<WorkflowSettings>["standard"] | undefined),
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
function workflowPresetBundleWithoutUserOwnedSettings(preset: WorkflowPresetBundle): WorkflowPresetBundle {
|
|
991
|
+
const { context: _ignoredContext, ...presetWithoutContext } = preset as WorkflowPresetBundle & { context?: unknown };
|
|
992
|
+
const { models: _ignoredStandardModels, ...standardWithoutModels } = (preset.standard ?? {}) as Partial<WorkflowSettings["standard"]>;
|
|
993
|
+
const { models: _ignoredMissionModels, ...missionsWithoutModels } = (preset.missions ?? {}) as Partial<WorkflowSettings["missions"]>;
|
|
994
|
+
return {
|
|
995
|
+
...presetWithoutContext,
|
|
996
|
+
standard: { ...standardWithoutModels },
|
|
997
|
+
missions: { ...missionsWithoutModels },
|
|
929
998
|
};
|
|
930
999
|
}
|
|
931
1000
|
|
|
932
1001
|
function applyPresetBundle(settings: WorkflowSettings, preset: WorkflowPresetBundle, name: string): void {
|
|
933
1002
|
const defaults = defaultWorkflowSettings();
|
|
934
1003
|
const normalized = normalizeWorkflowPresetBundle(preset);
|
|
1004
|
+
const currentStandardModels = settings.standard.models;
|
|
935
1005
|
if (normalized.planning) settings.planning = { ...settings.planning, ...normalized.planning };
|
|
936
1006
|
if (normalized.workflow) settings.workflow = { ...settings.workflow, ...normalized.workflow };
|
|
937
|
-
settings.standard = { ...defaults.standard, ...normalized.standard, subagents: { ...(defaults.standard.subagents ?? {}), ...(normalized.standard?.subagents ?? {}) }, models:
|
|
1007
|
+
settings.standard = { ...defaults.standard, ...normalized.standard, subagents: { ...(defaults.standard.subagents ?? {}), ...(normalized.standard?.subagents ?? {}) }, models: currentStandardModels };
|
|
938
1008
|
if (normalized.missions) settings.missions = { ...settings.missions, ...normalized.missions, models: settings.missions.models };
|
|
939
1009
|
if (normalized.subagents) settings.subagents = { ...settings.subagents, ...normalized.subagents };
|
|
940
1010
|
if (normalized.ui) settings.ui = { ...settings.ui, ...normalized.ui };
|
|
@@ -945,8 +1015,6 @@ export function normalizeWorkflowPresetName(name: string): string {
|
|
|
945
1015
|
return name.trim().toLowerCase().replace(/[^A-Za-z0-9._-]+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
946
1016
|
}
|
|
947
1017
|
|
|
948
|
-
export const WORKFLOW_MANUAL_PRESET = "custom";
|
|
949
|
-
|
|
950
1018
|
export function workflowPresetCatalog(settings: WorkflowSettings = loadGlobalSettings()): Record<string, WorkflowPresetBundle> {
|
|
951
1019
|
const items = { ...(settings.presets?.items ?? {}) };
|
|
952
1020
|
delete items[WORKFLOW_MANUAL_PRESET];
|
|
@@ -1025,8 +1093,8 @@ export function workflowPresetMeaningLines(name: string, preset?: WorkflowPreset
|
|
|
1025
1093
|
"Mission Mode: uses the saved mission autonomy, approval, milestone continuation, validation, and retry settings.",
|
|
1026
1094
|
"Shared sub-agents: uses the saved planning, execution, repair, review, and validation worker policies.",
|
|
1027
1095
|
"Custom preset source: user workflow-settings.json, not package source.",
|
|
1028
|
-
"
|
|
1029
|
-
"Does not change: models/providers/API keys/auth/session/runtime state/compaction
|
|
1096
|
+
"Extension updates preserve workflow-settings.json and do not overwrite custom presets.",
|
|
1097
|
+
"Does not change: models/providers/API keys/auth/session/runtime state/shared compaction settings.",
|
|
1030
1098
|
];
|
|
1031
1099
|
const builtIn: Record<string, string[]> = {
|
|
1032
1100
|
simple: [
|
|
@@ -1037,7 +1105,7 @@ export function workflowPresetMeaningLines(name: string, preset?: WorkflowPreset
|
|
|
1037
1105
|
"Plan Mode: uses fast planning, avoids a second execution-approval stop after the initial approval, skips automatic review, runs lightweight validation, and allows a small safe repair retry budget.",
|
|
1038
1106
|
"Mission Mode: starts after approval, auto-runs after approval, continues milestones without pause, keeps milestone validation on, and leaves final comprehensive validation off by default.",
|
|
1039
1107
|
"Shared sub-agents: keeps planning, execution, repair, and validation lean with one-worker support; review remains available but is not forced automatically.",
|
|
1040
|
-
"Does not change: models/providers/API keys/auth/session/runtime state/compaction
|
|
1108
|
+
"Does not change: models/providers/API keys/auth/session/runtime state/shared compaction settings.",
|
|
1041
1109
|
],
|
|
1042
1110
|
standard: [
|
|
1043
1111
|
"Name: Standard — Balanced Autonomous",
|
|
@@ -1047,7 +1115,7 @@ export function workflowPresetMeaningLines(name: string, preset?: WorkflowPreset
|
|
|
1047
1115
|
"Plan Mode: uses standard planning, avoids a second execution-approval stop after the initial approval, leaves review manual/optional, runs validation automatically, and performs safe repair/revalidation.",
|
|
1048
1116
|
"Mission Mode: starts after approval, auto-runs after approval, continues milestones without pause, keeps milestone validation on, and leaves final comprehensive validation off by default.",
|
|
1049
1117
|
"Shared sub-agents: uses one-worker planning and two-worker execution, repair, review, and validation when those phases run.",
|
|
1050
|
-
"Does not change: models/providers/API keys/auth/session/runtime state/compaction
|
|
1118
|
+
"Does not change: models/providers/API keys/auth/session/runtime state/shared compaction settings.",
|
|
1051
1119
|
],
|
|
1052
1120
|
deep: [
|
|
1053
1121
|
"Name: Deep — Careful Autonomous",
|
|
@@ -1057,7 +1125,7 @@ export function workflowPresetMeaningLines(name: string, preset?: WorkflowPreset
|
|
|
1057
1125
|
"Plan Mode: uses deep planning, clarifies non-trivial work, avoids a second execution-approval stop after the initial approval, runs automatic review and validation, and retries safe repairs.",
|
|
1058
1126
|
"Mission Mode: starts after approval, auto-runs after approval, continues milestones without pause, keeps milestone validation on, and enables final comprehensive validation.",
|
|
1059
1127
|
"Shared sub-agents: forces larger teams across planning, execution, repair, review, and validation.",
|
|
1060
|
-
"Does not change: models/providers/API keys/auth/session/runtime state/compaction
|
|
1128
|
+
"Does not change: models/providers/API keys/auth/session/runtime state/shared compaction settings.",
|
|
1061
1129
|
],
|
|
1062
1130
|
maximum: [
|
|
1063
1131
|
"Name: Maximum — Thorough Autonomous",
|
|
@@ -1067,7 +1135,7 @@ export function workflowPresetMeaningLines(name: string, preset?: WorkflowPreset
|
|
|
1067
1135
|
"Plan Mode: uses maximum planning, avoids a second execution-approval stop after the initial approval, runs automatic review and validation, and uses the largest bounded in-scope repair budget.",
|
|
1068
1136
|
"Mission Mode: uses supervised-auto mission autonomy, auto-runs after approval, continues milestones without pause, keeps milestone and final validation on, and uses the highest bounded retry budget.",
|
|
1069
1137
|
"Shared sub-agents: forces maximum teams across planning, execution, repair, review, and validation.",
|
|
1070
|
-
"Does not change: models/providers/API keys/auth/session/runtime state/compaction
|
|
1138
|
+
"Does not change: models/providers/API keys/auth/session/runtime state/shared compaction settings.",
|
|
1071
1139
|
],
|
|
1072
1140
|
};
|
|
1073
1141
|
if (builtIn[name]) return builtIn[name];
|
|
@@ -1076,14 +1144,14 @@ export function workflowPresetMeaningLines(name: string, preset?: WorkflowPreset
|
|
|
1076
1144
|
`Purpose: ${preset?.description ?? "custom saved workflow preset."}`,
|
|
1077
1145
|
"Applies to: the Standard, Plan, Mission, and shared sub-agent sections stored in this custom preset.",
|
|
1078
1146
|
"Custom preset source: user workflow-settings.json, not package source.",
|
|
1079
|
-
"
|
|
1147
|
+
"Extension updates preserve workflow-settings.json and do not overwrite custom presets.",
|
|
1080
1148
|
...(!preset?.standard ? ["Legacy/Incomplete: missing Standard Mode section; safe Standard defaults are applied when this preset is used."] : []),
|
|
1081
1149
|
`Standard Mode: To Do ${preset?.standard?.todoTriggerMode ? standardTodoTriggerModeLabel(preset.standard.todoTriggerMode) : "safe defaults"}; clarification ${preset?.standard?.clarificationMode ?? "safe defaults"}; sub-agents ${preset?.standard?.allowSubagents === true ? "enabled" : preset?.standard?.allowSubagents === false ? "disabled" : "safe defaults"}.`,
|
|
1082
1150
|
`Plan Mode: ${preset?.planning?.depth ?? "uses current"} planning; clarification ${preset?.planning?.clarificationMode ?? "uses current"}; max questions ${preset?.planning?.maxClarificationQuestions ?? "uses current"}; validation ${(preset?.workflow?.validateAfterExecution ?? preset?.workflow?.autoRunValidationAfterExecute) === true ? "automatic" : (preset?.workflow?.validateAfterExecution ?? preset?.workflow?.autoRunValidationAfterExecute) === false ? "manual/optional" : "uses current setting"}.`,
|
|
1083
1151
|
`Mission Mode: autonomy ${preset?.missions?.defaultAutonomy ?? "uses current"}; auto-run after approval ${preset?.missions?.autoRunAfterApproval === true ? "enabled" : preset?.missions?.autoRunAfterApproval === false ? "disabled" : "uses current"}; milestone validation ${preset?.missions?.requireValidationPerMilestone === true ? "on" : preset?.missions?.requireValidationPerMilestone === false ? "off" : "uses current"}; final validation ${preset?.missions?.finalValidationEnabled === true ? "on" : preset?.missions?.finalValidationEnabled === false ? "off" : "uses current"}.`,
|
|
1084
1152
|
`Shared sub-agents: planning ${preset?.subagents?.planningPolicy ?? "uses current"}; execution ${preset?.subagents?.executionPolicy ?? "uses current"}; repair ${preset?.subagents?.repairPolicy ?? "uses current"}; review ${preset?.subagents?.reviewPolicy ?? "uses current"}; validation ${preset?.subagents?.validationPolicy ?? "uses current"}.`,
|
|
1085
1153
|
...workflowPresetDiagnostics(name, preset),
|
|
1086
|
-
"Does not change: models/providers/API keys/auth/session/runtime state/compaction
|
|
1154
|
+
"Does not change: models/providers/API keys/auth/session/runtime state/shared compaction settings.",
|
|
1087
1155
|
];
|
|
1088
1156
|
}
|
|
1089
1157
|
|
|
@@ -1119,7 +1187,7 @@ export function renderWorkflowPresets(settings: WorkflowSettings = loadGlobalSet
|
|
|
1119
1187
|
const active = settings.presets?.activePreset ?? WORKFLOW_MANUAL_PRESET;
|
|
1120
1188
|
const names = workflowPresetNames(settings);
|
|
1121
1189
|
const cards = [renderWorkflowPresetCard(WORKFLOW_MANUAL_PRESET, undefined, active === WORKFLOW_MANUAL_PRESET), ...names.map((name) => renderWorkflowPresetCard(name, catalog[name], name === active))];
|
|
1122
|
-
return `# Workflow Presets\n\nActive Preset: ${activeWorkflowPresetLabel(settings)}\nShortcut: Ctrl+Shift+U cycles saved presets while Plan/Mission/Standard Mode is active\nSelector: /workflow presets\n\n${cards.join("\n\n") || "No presets available."}\n\nQuick commands:\n- /workflow presets list\n- /workflow presets apply <name>\n- /workflow presets next\n- /workflow presets prev\n- /workflow presets manual\n- /workflow presets save <name>\n- /workflow presets create <name> from simple|standard|deep|maximum\n- /workflow presets edit <name>\n- /workflow presets rename <old> to <new>\n- /workflow presets delete <name>\n\nBuilt-in presets are package-defined and sync with the extension. User-named custom presets are saved entries in workflow-settings.json and stay in hotkey cycling. Manual settings is only the no-saved-preset-active marker;
|
|
1190
|
+
return `# Workflow Presets\n\nActive Preset: ${activeWorkflowPresetLabel(settings)}\nShortcut: Ctrl+Shift+U cycles saved presets while Plan/Mission/Standard Mode is active\nSelector: /workflow presets\n\n${cards.join("\n\n") || "No presets available."}\n\nQuick commands:\n- /workflow presets list\n- /workflow presets apply <name>\n- /workflow presets next\n- /workflow presets prev\n- /workflow presets manual\n- /workflow presets save <name>\n- /workflow presets create <name> from simple|standard|deep|maximum\n- /workflow presets edit <name>\n- /workflow presets rename <old> to <new>\n- /workflow presets delete <name>\n\nBuilt-in presets are package-defined and sync with the extension. User-named custom presets are saved entries in workflow-settings.json and stay in hotkey cycling. Manual settings is only the no-saved-preset-active marker; extension updates preserve workflow-settings.json and do not overwrite custom presets. Presets adjust workflow behavior only and preserve model/provider choices, API keys, auth/session files, runtime workflow state, and shared compaction settings.`;
|
|
1123
1191
|
}
|
|
1124
1192
|
|
|
1125
1193
|
export function applyWorkflowPreset(cwd: string, requestedScope: WorkflowSettingsScope | undefined, name: string): SettingsWriteResult {
|
|
@@ -1128,7 +1196,7 @@ export function applyWorkflowPreset(cwd: string, requestedScope: WorkflowSetting
|
|
|
1128
1196
|
const preset = resolved ? workflowPresetCatalog(settings)[resolved] : undefined;
|
|
1129
1197
|
if (!resolved || !preset) throw new Error(`Unknown workflow preset: ${name}`);
|
|
1130
1198
|
applyPresetBundle(settings, preset, resolved);
|
|
1131
|
-
});
|
|
1199
|
+
}, { preserveActivePreset: true });
|
|
1132
1200
|
}
|
|
1133
1201
|
|
|
1134
1202
|
export function saveCurrentWorkflowPreset(cwd: string, requestedScope: WorkflowSettingsScope | undefined, name: string): SettingsWriteResult {
|
|
@@ -1137,17 +1205,18 @@ export function saveCurrentWorkflowPreset(cwd: string, requestedScope: WorkflowS
|
|
|
1137
1205
|
assertValidCustomPresetName(name, safe);
|
|
1138
1206
|
return updateSettings(cwd, requestedScope, (settings) => {
|
|
1139
1207
|
settings.presets = { ...(settings.presets ?? {}), activePreset: safe, items: { ...(settings.presets?.items ?? {}) } };
|
|
1208
|
+
const { models: _ignoredStandardModels, ...standardPreset } = settings.standard;
|
|
1140
1209
|
settings.presets.items![safe] = {
|
|
1141
1210
|
displayName: name.trim(),
|
|
1142
1211
|
description: "Custom saved workflow preset.",
|
|
1143
1212
|
planning: { ...settings.planning },
|
|
1144
1213
|
workflow: { ...settings.workflow },
|
|
1145
|
-
standard: { ...
|
|
1214
|
+
standard: { ...standardPreset },
|
|
1146
1215
|
missions: { ...settings.missions, models: undefined } as WorkflowPresetBundle["missions"],
|
|
1147
1216
|
subagents: { ...settings.subagents },
|
|
1148
|
-
ui: { showWorkflowStatus: settings.ui.showWorkflowStatus, showPlanModeIndicator: settings.ui.showPlanModeIndicator, planTopWidgetVisible: settings.ui.planTopWidgetVisible, missionTopWidgetVisible: settings.ui.missionTopWidgetVisible, missionBottomWidgetVisible: settings.ui.missionBottomWidgetVisible, workflowTheme: settings.ui.workflowTheme, workflowThemeOverrides: settings.ui.workflowThemeOverrides, startupVisual: settings.ui.startupVisual, startupVisualOnSessionStart: settings.ui.startupVisualOnSessionStart, customBrandEnabled: settings.ui.customBrandEnabled, customBrandText: settings.ui.customBrandText },
|
|
1217
|
+
ui: { showWorkflowStatus: settings.ui.showWorkflowStatus, showPlanModeIndicator: settings.ui.showPlanModeIndicator, planTopWidgetVisible: settings.ui.planTopWidgetVisible, planBottomWidgetVisible: settings.ui.planBottomWidgetVisible, missionTopWidgetVisible: settings.ui.missionTopWidgetVisible, missionBottomWidgetVisible: settings.ui.missionBottomWidgetVisible, workflowTheme: settings.ui.workflowTheme, workflowThemeOverrides: settings.ui.workflowThemeOverrides, startupVisual: settings.ui.startupVisual, startupVisualOnSessionStart: settings.ui.startupVisualOnSessionStart, customBrandEnabled: settings.ui.customBrandEnabled, customBrandText: settings.ui.customBrandText },
|
|
1149
1218
|
};
|
|
1150
|
-
});
|
|
1219
|
+
}, { preserveActivePreset: true });
|
|
1151
1220
|
}
|
|
1152
1221
|
|
|
1153
1222
|
export function createWorkflowPreset(cwd: string, requestedScope: WorkflowSettingsScope | undefined, name: string, templateName?: string): SettingsWriteResult {
|
|
@@ -1159,8 +1228,8 @@ export function createWorkflowPreset(cwd: string, requestedScope: WorkflowSettin
|
|
|
1159
1228
|
const template = resolvedTemplate ? workflowPresetCatalog(settings)[resolvedTemplate] : undefined;
|
|
1160
1229
|
if (templateName && !template) throw new Error(`Unknown workflow preset template: ${templateName}`);
|
|
1161
1230
|
settings.presets = { ...(settings.presets ?? {}), items: { ...(settings.presets?.items ?? {}) } };
|
|
1162
|
-
settings.presets.items![safe] = template ? { ...template, displayName: name.trim(), description: `Custom preset created from ${resolvedTemplate}.` } : { displayName: name.trim(), description: "Custom workflow preset.", planning: {}, workflow: {}, standard: {}, missions: {}, subagents: {}, ui: {} };
|
|
1163
|
-
});
|
|
1231
|
+
settings.presets.items![safe] = template ? { ...workflowPresetBundleWithoutUserOwnedSettings(template), displayName: name.trim(), description: `Custom preset created from ${resolvedTemplate}.` } : { displayName: name.trim(), description: "Custom workflow preset.", planning: {}, workflow: {}, standard: {}, missions: {}, subagents: {}, ui: {} };
|
|
1232
|
+
}, { preserveActivePreset: true });
|
|
1164
1233
|
}
|
|
1165
1234
|
|
|
1166
1235
|
export function renameWorkflowPreset(cwd: string, requestedScope: WorkflowSettingsScope | undefined, oldName: string, newName: string): SettingsWriteResult {
|
|
@@ -1177,7 +1246,7 @@ export function renameWorkflowPreset(cwd: string, requestedScope: WorkflowSettin
|
|
|
1177
1246
|
delete items[resolved];
|
|
1178
1247
|
items[safe] = { ...existing, displayName: newName.trim() };
|
|
1179
1248
|
settings.presets = { ...(settings.presets ?? {}), activePreset: settings.presets?.activePreset === resolved ? safe : settings.presets?.activePreset, items };
|
|
1180
|
-
});
|
|
1249
|
+
}, { preserveActivePreset: true });
|
|
1181
1250
|
}
|
|
1182
1251
|
|
|
1183
1252
|
export function deleteWorkflowPreset(cwd: string, requestedScope: WorkflowSettingsScope | undefined, name: string): SettingsWriteResult {
|
|
@@ -1188,7 +1257,7 @@ export function deleteWorkflowPreset(cwd: string, requestedScope: WorkflowSettin
|
|
|
1188
1257
|
const items = { ...(settings.presets?.items ?? {}) };
|
|
1189
1258
|
delete items[resolved];
|
|
1190
1259
|
settings.presets = { ...(settings.presets ?? {}), activePreset: settings.presets?.activePreset === resolved ? "custom" : settings.presets?.activePreset, items };
|
|
1191
|
-
});
|
|
1260
|
+
}, { preserveActivePreset: true });
|
|
1192
1261
|
}
|
|
1193
1262
|
|
|
1194
1263
|
export function getModelForRole(role: WorkflowRole): RoleModelSettings {
|
|
@@ -1335,9 +1404,23 @@ export function workflowSettingsConsistencyDiagnostics(settings: WorkflowSetting
|
|
|
1335
1404
|
if (settings.context.compactionMode === "custom_model" && (!settings.context.compactionModelProvider || !settings.context.compactionModel)) {
|
|
1336
1405
|
diagnostics.push("custom compaction model mode is selected but compaction provider/model is incomplete");
|
|
1337
1406
|
}
|
|
1407
|
+
if (settings.context.compactionMode === "custom_model" && settings.context.customCompactionEnabled !== true) {
|
|
1408
|
+
diagnostics.push("custom compaction mode is selected but customCompactionEnabled is not set — custom compaction will not activate");
|
|
1409
|
+
}
|
|
1338
1410
|
if (settings.context.customCompactionEnabled === true && settings.context.compactionMode !== "custom_model") {
|
|
1339
1411
|
diagnostics.push(`customCompactionEnabled=true but compactionMode=${settings.context.compactionMode}`);
|
|
1340
1412
|
}
|
|
1413
|
+
if (settings.missions.autoRepairReviewFailures !== false && settings.missions.reviewRetryMode === "off") {
|
|
1414
|
+
diagnostics.push("mission review auto-repair is enabled but reviewRetryMode is off — override to safe_only will be applied at runtime; set reviewRetryMode explicitly to avoid confusion");
|
|
1415
|
+
}
|
|
1416
|
+
const activePreset = settings.presets?.activePreset ?? WORKFLOW_MANUAL_PRESET;
|
|
1417
|
+
if ((activePreset === "standard" || activePreset === "deep" || activePreset === "maximum")
|
|
1418
|
+
&& (settings.missions.autoRepairReviewFailures === false || settings.missions.reviewRetryMode === "off" || (settings.missions.maxReviewRetriesPerMission ?? 0) <= 0)) {
|
|
1419
|
+
diagnostics.push(`active preset ${activePreset} expects Mission review repair to be available, but effective Mission review repair is disabled/off/zero; reapply the preset or update missions.autoRepairReviewFailures, missions.reviewRetryMode, and missions.maxReviewRetriesPerMission`);
|
|
1420
|
+
}
|
|
1421
|
+
if (settings.missions.autoRepairValidationFailures !== false && settings.missions.validationRetryMode === "off") {
|
|
1422
|
+
diagnostics.push("mission validation auto-repair is enabled but validationRetryMode is off — override to safe_only will be applied at runtime; set validationRetryMode explicitly to avoid confusion");
|
|
1423
|
+
}
|
|
1341
1424
|
if (settings.missions.watchdogEnabled === true) {
|
|
1342
1425
|
diagnostics.push("mission watchdog is enabled but interval/watchdog enforcement is partial in the current MVP");
|
|
1343
1426
|
}
|