@@ -624,7 +624,8 @@ import { createSchedulerWebviewTransientState } from "./cockpitWebviewTransientS
624624 defaultModelSelect,
625625 executionDefaultsSaveBtn,
626626 executionDefaultsNote,
627- openPermissionPickerBtn,
627+ approvalModeSelect,
628+ approvalModeNote,
628629 needsBotReviewCommentTemplateInput,
629630 needsBotReviewPromptTemplateInput,
630631 needsBotReviewAgentSelect,
@@ -649,6 +650,7 @@ import { createSchedulerWebviewTransientState } from "./cockpitWebviewTransientS
649650 settingsVersionValue,
650651 settingsMcpStatusValue,
651652 settingsMcpUpdatedValue,
653+ settingsSkillsStatusValue,
652654 settingsSkillsUpdatedValue,
653655 settingsAgentsUpdatedValue,
654656 settingsLogLevelSelect,
@@ -661,7 +663,8 @@ import { createSchedulerWebviewTransientState } from "./cockpitWebviewTransientS
661663 settingsUpdateStatusRow,
662664 settingsUpdateStatusText,
663665 settingsCheckUpdatesBtn,
664- settingsDownloadLatestBtn,
666+ settingsDownloadStableBtn,
667+ settingsDownloadEdgeBtn,
665668 boardAddSectionBtn,
666669 boardSectionInlineForm,
667670 boardSectionNameInput,
@@ -1171,6 +1174,21 @@ import { createSchedulerWebviewTransientState } from "./cockpitWebviewTransientS
11711174 }
11721175 }
11731176
1177+ function getBundledSkillsStatusLabel ( status ) {
1178+ switch ( status ) {
1179+ case "up-to-date" :
1180+ return strings . settingsStorageSkillsStatusUpToDate || "Up to date" ;
1181+ case "update-available" :
1182+ return strings . settingsStorageSkillsStatusUpdateAvailable || "Update available" ;
1183+ case "customized" :
1184+ return strings . settingsStorageSkillsStatusCustomized || "Customized" ;
1185+ case "missing" :
1186+ return strings . settingsStorageSkillsStatusMissing || "Missing" ;
1187+ default :
1188+ return strings . settingsStorageSkillsStatusWorkspaceRequired || "Open a workspace to inspect" ;
1189+ }
1190+ }
1191+
11741192 function clearGitHubIntegrationFeedback ( ) {
11751193 if ( ! githubIntegrationFeedback ) return ;
11761194 githubIntegrationFeedback . textContent = "" ;
@@ -1860,6 +1878,48 @@ import { createSchedulerWebviewTransientState } from "./cockpitWebviewTransientS
18601878 }
18611879 }
18621880
1881+ function getApprovalModeLabel ( approvalMode ) {
1882+ switch ( approvalMode ) {
1883+ case "auto-approve" :
1884+ return strings . approvalModeAutoApprove || "Bypass Approvals" ;
1885+ case "autopilot" :
1886+ return strings . approvalModeAutopilot || "Autopilot" ;
1887+ case "yolo" :
1888+ return strings . approvalModeYolo || "YOLO (Legacy)" ;
1889+ default :
1890+ return strings . approvalModeDefault || "Default Approvals" ;
1891+ }
1892+ }
1893+
1894+ function buildApprovalModeNoteText ( approvalMode ) {
1895+ return ( strings . approvalModeActiveLabel || "Active mode:" )
1896+ + " "
1897+ + getApprovalModeLabel ( approvalMode ) ;
1898+ }
1899+
1900+ function renderApprovalModeControls ( ) {
1901+ var approvalModeSelectEl = approvalModeSelect || document . getElementById ( "settings-approval-mode-select" ) ;
1902+ var approvalModeNoteEl = approvalModeNote || document . getElementById ( "settings-approval-mode-note" ) ;
1903+ var nextApprovalMode = approvalModeSelectEl && selectHasOptionValue ( approvalModeSelectEl , initialData . approvalMode )
1904+ ? initialData . approvalMode
1905+ : approvalModeSelectEl && approvalModeSelectEl . value
1906+ ? approvalModeSelectEl . value
1907+ : "default" ;
1908+
1909+ if ( approvalModeSelectEl ) {
1910+ if ( ! selectHasOptionValue ( approvalModeSelectEl , nextApprovalMode ) ) {
1911+ nextApprovalMode = "default" ;
1912+ }
1913+ approvalModeSelectEl . value = nextApprovalMode ;
1914+ }
1915+
1916+ initialData . approvalMode = nextApprovalMode ;
1917+
1918+ if ( approvalModeNoteEl ) {
1919+ approvalModeNoteEl . textContent = buildApprovalModeNoteText ( nextApprovalMode ) ;
1920+ }
1921+ }
1922+
18631923 function renderReviewDefaultsControls ( ) {
18641924 if ( needsBotReviewCommentTemplateInput ) {
18651925 needsBotReviewCommentTemplateInput . value = reviewDefaults
@@ -1984,6 +2044,9 @@ import { createSchedulerWebviewTransientState } from "./cockpitWebviewTransientS
19842044 if ( settingsMcpUpdatedValue ) {
19852045 settingsMcpUpdatedValue . textContent = formatSettingsTimestamp ( storageSettings . lastMcpSupportUpdateAt ) ;
19862046 }
2047+ if ( settingsSkillsStatusValue ) {
2048+ settingsSkillsStatusValue . textContent = getBundledSkillsStatusLabel ( storageSettings . bundledSkillsStatus ) ;
2049+ }
19872050 if ( settingsSkillsUpdatedValue ) {
19882051 settingsSkillsUpdatedValue . textContent = formatSettingsTimestamp ( storageSettings . lastBundledSkillsSyncAt ) ;
19892052 }
@@ -2019,41 +2082,65 @@ import { createSchedulerWebviewTransientState } from "./cockpitWebviewTransientS
20192082 }
20202083
20212084 function renderVersionUpdateInfo ( view ) {
2085+ var selectedTrack = view && view . track === "edge" ? "edge" : "stable" ;
2086+ var selectedVersion = selectedTrack === "edge"
2087+ ? view && view . latestEdgeVersion
2088+ : view && view . latestStableVersion ;
2089+ var selectedHasNewVersion = selectedTrack === "edge"
2090+ ? ! ! ( view && view . edgeHasNewVersion )
2091+ : ! ! ( view && view . stableHasNewVersion ) ;
20222092 if ( ! view ) {
20232093 if ( refs . settingsCurrentVersionValue ) refs . settingsCurrentVersionValue . textContent = "-" ;
20242094 if ( refs . settingsLatestStableValue ) refs . settingsLatestStableValue . textContent = "-" ;
20252095 if ( refs . settingsLatestEdgeValue ) refs . settingsLatestEdgeValue . textContent = "-" ;
20262096 if ( refs . settingsUpdateStatusRow ) refs . settingsUpdateStatusRow . style . display = "none" ;
2027- if ( refs . settingsDownloadLatestBtn ) refs . settingsDownloadLatestBtn . style . display = "none" ;
2097+ if ( refs . settingsDownloadStableBtn ) refs . settingsDownloadStableBtn . style . display = "none" ;
2098+ if ( refs . settingsDownloadEdgeBtn ) refs . settingsDownloadEdgeBtn . style . display = "none" ;
20282099 return ;
20292100 }
20302101 if ( refs . settingsCurrentVersionValue ) refs . settingsCurrentVersionValue . textContent = view . currentVersion || "-" ;
20312102 if ( refs . settingsLatestStableValue ) refs . settingsLatestStableValue . textContent = view . latestStableVersion || "-" ;
20322103 if ( refs . settingsLatestEdgeValue ) refs . settingsLatestEdgeValue . textContent = view . latestEdgeVersion || "-" ;
2033- if ( refs . settingsUpdateStatusRow ) {
2034- if ( view . hasNewVersion ) {
2035- refs . settingsUpdateStatusRow . style . display = "" ;
2036- if ( refs . settingsUpdateStatusText ) {
2037- refs . settingsUpdateStatusText . textContent = strings . settingsUpdateAvailable
2038- ? strings . settingsUpdateAvailable + " (" + view . latestStableVersion + ")"
2039- : "Update available (" + view . latestStableVersion + ")" ;
2040- refs . settingsUpdateStatusText . style . color = "#4caf50" ;
2104+ if ( refs . settingsDownloadStableBtn ) {
2105+ refs . settingsDownloadStableBtn . style . display = view . stableDownloadUrl ? "" : "none" ;
2106+ refs . settingsDownloadStableBtn . onclick = view . stableDownloadUrl
2107+ ? function ( ) {
2108+ vscode . postMessage ( {
2109+ type : "openReleasePage" ,
2110+ track : "stable" ,
2111+ url : view . stableDownloadUrl ,
2112+ } ) ;
20412113 }
2042- if ( refs . settingsDownloadLatestBtn ) {
2043- refs . settingsDownloadLatestBtn . style . display = "" ;
2044- bindClickAction ( refs . settingsDownloadLatestBtn , function ( ) {
2045- if ( view . downloadUrl ) {
2046- window . open ( view . downloadUrl , "_blank" ) ;
2047- }
2114+ : null ;
2115+ }
2116+ if ( refs . settingsDownloadEdgeBtn ) {
2117+ refs . settingsDownloadEdgeBtn . style . display = view . edgeDownloadUrl ? "" : "none" ;
2118+ refs . settingsDownloadEdgeBtn . onclick = view . edgeDownloadUrl
2119+ ? function ( ) {
2120+ vscode . postMessage ( {
2121+ type : "openReleasePage" ,
2122+ track : "edge" ,
2123+ url : view . edgeDownloadUrl ,
20482124 } ) ;
20492125 }
2050- } else {
2051- refs . settingsUpdateStatusRow . style . display = "" ;
2052- if ( refs . settingsUpdateStatusText ) {
2126+ : null ;
2127+ }
2128+ if ( refs . settingsUpdateStatusRow ) {
2129+ refs . settingsUpdateStatusRow . style . display = "" ;
2130+ if ( refs . settingsUpdateStatusText ) {
2131+ if ( ! selectedVersion ) {
2132+ refs . settingsUpdateStatusText . textContent = strings . settingsUpdateUnavailable
2133+ || "Unable to determine update status right now." ;
2134+ refs . settingsUpdateStatusText . style . color = "" ;
2135+ } else if ( selectedHasNewVersion ) {
2136+ refs . settingsUpdateStatusText . textContent = strings . settingsUpdateAvailable
2137+ ? strings . settingsUpdateAvailable + " (" + selectedVersion + ")"
2138+ : "Update available (" + selectedVersion + ")" ;
2139+ refs . settingsUpdateStatusText . style . color = "#4caf50" ;
2140+ } else {
20532141 refs . settingsUpdateStatusText . textContent = strings . settingsUpToDate || "You are up to date!" ;
20542142 refs . settingsUpdateStatusText . style . color = "" ;
20552143 }
2056- if ( refs . settingsDownloadLatestBtn ) refs . settingsDownloadLatestBtn . style . display = "none" ;
20572144 }
20582145 }
20592146 }
@@ -2788,6 +2875,7 @@ import { createSchedulerWebviewTransientState } from "./cockpitWebviewTransientS
27882875 runStartupRenderStep ( "renderCockpitBoard" , renderCockpitBoard ) ;
27892876 runStartupRenderStep ( "renderExecutionDefaultsControls" , renderExecutionDefaultsControls ) ;
27902877 runStartupRenderStep ( "renderReviewDefaultsControls" , renderReviewDefaultsControls ) ;
2878+ runStartupRenderStep ( "renderApprovalModeControls" , renderApprovalModeControls ) ;
27912879 runStartupRenderStep ( "renderStorageSettingsControls" , renderStorageSettingsControls ) ;
27922880 runStartupRenderStep ( "renderLoggingControls" , renderLoggingControls ) ;
27932881
@@ -6241,8 +6329,11 @@ syncTodoLabelSuggestions();
62416329 data : collectStorageSettingsFormData ( ) ,
62426330 } ) ;
62436331 } ) ;
6244- bindClickAction ( openPermissionPickerBtn , function ( ) {
6245- vscode . postMessage ( { type : "openChatPermissionPicker" } ) ;
6332+ bindSelectChange ( approvalModeSelect , function ( control ) {
6333+ var nextApprovalMode = control && control . value ? String ( control . value ) : "default" ;
6334+ initialData . approvalMode = nextApprovalMode ;
6335+ renderApprovalModeControls ( ) ;
6336+ vscode . postMessage ( { type : "setApprovalMode" , approvalMode : nextApprovalMode } ) ;
62466337 } ) ;
62476338 bindSelectChange ( settingsLogLevelSelect , function ( control ) {
62486339 currentLogLevel = control . value || "info" ;
@@ -8422,8 +8513,7 @@ syncTodoLabelSuggestions();
84228513 return strings . skillMetadataEmptyState || "" ;
84238514 }
84248515
8425- var template = strings . skillMetadataSummaryTemplate
8426- || "Type: {type}. Focus: {summary}. Tools: {tools}. Ready flags: {readyFlags}. Closeout flags: {closeoutFlags}. Approval: {approval}." ;
8516+ var template = strings . skillMetadataSummaryTemplate || "Type: {type}. Focus: {summary}. Tools: {tools}. Ready flags: {readyFlags}. Closeout flags: {closeoutFlags}. Approval: {approval}." ;
84278517 return template
84288518 . replace ( "{type}" , getSkillTypeLabel ( skill ) )
84298519 . replace ( "{summary}" , skill . promptSummary || skill . reference || skill . name || ( strings . skillMetadataNone || "none" ) )
@@ -9771,6 +9861,12 @@ syncTodoLabelSuggestions();
97719861 }
97729862 renderTaskList ( tasks ) ;
97739863 break ;
9864+ case "updateApprovalMode" :
9865+ initialData . approvalMode = typeof message . approvalMode === "string"
9866+ ? message . approvalMode
9867+ : "default" ;
9868+ renderApprovalModeControls ( ) ;
9869+ break ;
97749870 case "updateReviewDefaults" :
97759871 reviewDefaults = message . reviewDefaults || {
97769872 needsBotReviewCommentTemplate : "" ,
0 commit comments