@codingame/monaco-vscode-workbench-service-override 37.6.0 → 37.6.1
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/index.js +2 -2
- package/package.json +10 -10
- package/session.js +2 -2
- package/vscode/src/vs/sessions/contrib/editor/browser/addTabActions.js +5 -3
- package/vscode/src/vs/sessions/contrib/layout/browser/baseSessionLayoutController.js +3 -22
- package/vscode/src/vs/sessions/contrib/layout/browser/sessions.layout.contribution.js +2 -2
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneExistingSessionStrategy.js +1 -1
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV3Prompt.js +19 -19
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionTour.js +4 -4
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTour.js +6 -6
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTourShared.js +2 -2
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV2Tour.js +4 -4
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.js +24 -24
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostClaudePermissionModePicker.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostCodexApprovalsPicker.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.js +2 -2
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerDelegate.js +8 -8
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.js +32 -32
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentMergeActions.js +29 -29
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/exportDebugLogsAction.js +1 -1
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatInputConfigPicker.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerAgentHostService.js +6 -6
- package/vscode/src/vs/sessions/contrib/search/browser/search.contribution.js +3 -3
- package/vscode/src/vs/sessions/contrib/search/browser/searchEditorEmptyState.contribution.js +1 -1
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsIndicatorModel.js +4 -4
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsList.js +5 -5
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionDetailsAction.js +2 -2
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessions.contribution.js +8 -8
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsActions.js +58 -58
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.js +8 -8
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsWindowNotifier.js +5 -5
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationTemplates.js +10 -10
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.js +38 -38
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsView.js +118 -118
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.js +53 -53
- package/vscode/src/vs/sessions/contrib/terminal/browser/agentHostSessionTaskRunner.js +1 -1
- package/vscode/src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.js +2 -2
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsManagementService.js +2 -2
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsService.js +2 -2
- package/vscode/src/vs/workbench/browser/layout.d.ts +46 -70
- package/vscode/src/vs/workbench/browser/layout.js +243 -44
- package/vscode/src/vs/workbench/browser/workbench.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/workbench.js +3 -4
|
@@ -239,9 +239,9 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
239
239
|
dropIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.cloudUpload));
|
|
240
240
|
dropIcon.setAttribute("aria-hidden", "true");
|
|
241
241
|
const dropTitle = append(this.dropOverlay, $("span.automations-drop-overlay-title"));
|
|
242
|
-
dropTitle.textContent = ( localize(
|
|
242
|
+
dropTitle.textContent = ( localize(4778, "Drop to import automation"));
|
|
243
243
|
const dropDescription = append(this.dropOverlay, $("span.automations-drop-overlay-description"));
|
|
244
|
-
dropDescription.textContent = ( localize(
|
|
244
|
+
dropDescription.textContent = ( localize(4779, "You can review the Automation before creating it."));
|
|
245
245
|
this._register(new DragAndDropObserver(this.focusRoot, {
|
|
246
246
|
onDragEnter: event => this.updateDropOverlay(event),
|
|
247
247
|
onDragOver: event => this.updateDropOverlay(event),
|
|
@@ -298,8 +298,8 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
298
298
|
}
|
|
299
299
|
EventHelper.stop(event, true);
|
|
300
300
|
if (dropData.kind === "invalid") {
|
|
301
|
-
const detail = dropData.reason === "multiple" ? ( localize(
|
|
302
|
-
void this.dialogService.error(( localize(
|
|
301
|
+
const detail = dropData.reason === "multiple" ? ( localize(4780, "Drop one Automation blueprint file at a time.")) : ( localize(4781, "Only .automation.md files can be imported."));
|
|
302
|
+
void this.dialogService.error(( localize(4782, "Unable to import automation.")), detail);
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
305
|
const readContent = dropData.kind === "resource" ? async () => ( (await this.fileService.readFile(dropData.resource)).value.toString()) : async () => ( VSBuffer.wrap(( new Uint8Array(await dropData.file.arrayBuffer()))).toString());
|
|
@@ -427,7 +427,7 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
427
427
|
const nameRow = append(main, $(".automations-card-name"));
|
|
428
428
|
const nameTextEl = append(nameRow, $("span.automations-card-name-text"));
|
|
429
429
|
const disabledBadge = append(nameRow, $("span.automations-card-disabled-badge"));
|
|
430
|
-
disabledBadge.textContent = ( localize(
|
|
430
|
+
disabledBadge.textContent = ( localize(4783, "Disabled"));
|
|
431
431
|
const metaEl = append(main, $(".automations-card-meta"));
|
|
432
432
|
const scheduleEl = append(metaEl, $("span.automations-card-meta-item.automations-card-schedule"));
|
|
433
433
|
const folderEl = append(metaEl, $("span.automations-card-meta-item.automations-card-folder"));
|
|
@@ -436,8 +436,8 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
436
436
|
const actions = append(card, $(".automations-card-actions"));
|
|
437
437
|
actions.setAttribute("role", "group");
|
|
438
438
|
const buttonBar = disposables.add(( new ButtonBar(actions)));
|
|
439
|
-
const runNowLabel = ( localize(
|
|
440
|
-
const runningLabel = ( localize(
|
|
439
|
+
const runNowLabel = ( localize(4784, "Run now"));
|
|
440
|
+
const runningLabel = ( localize(4785, "Running"));
|
|
441
441
|
const runBtn = this.createIconButton(
|
|
442
442
|
buttonBar,
|
|
443
443
|
Codicon.play,
|
|
@@ -461,7 +461,7 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
461
461
|
}, 10_000, disposables);
|
|
462
462
|
void this.runNow(currentAutomation);
|
|
463
463
|
}));
|
|
464
|
-
const moreActionsButton = this.createIconButton(buttonBar, Codicon.kebabVertical, ( localize(
|
|
464
|
+
const moreActionsButton = this.createIconButton(buttonBar, Codicon.kebabVertical, ( localize(4786, "More Actions for {0}", automation.name)), false);
|
|
465
465
|
moreActionsButton.element.classList.add("automations-card-more-actions-button");
|
|
466
466
|
moreActionsButton.element.setAttribute("aria-haspopup", "menu");
|
|
467
467
|
moreActionsButton.element.setAttribute("aria-expanded", "false");
|
|
@@ -531,12 +531,12 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
531
531
|
const scheduleChanged = !previous || formatSchedule(previous.schedule) !== schedule;
|
|
532
532
|
const nameChanged = !previous || previous.name !== automation.name;
|
|
533
533
|
if (nameChanged || scheduleChanged) {
|
|
534
|
-
card.card.setAttribute("aria-label", ( localize(
|
|
534
|
+
card.card.setAttribute("aria-label", ( localize(4787, "{0} — {1}", automation.name, schedule)));
|
|
535
535
|
}
|
|
536
536
|
if (nameChanged) {
|
|
537
|
-
card.main.setAttribute("aria-label", ( localize(
|
|
538
|
-
card.actions.setAttribute("aria-label", ( localize(
|
|
539
|
-
const moreActionsLabel = ( localize(
|
|
537
|
+
card.main.setAttribute("aria-label", ( localize(4788, "Edit automation {0}", automation.name)));
|
|
538
|
+
card.actions.setAttribute("aria-label", ( localize(4789, "Actions for {0}", automation.name)));
|
|
539
|
+
const moreActionsLabel = ( localize(4786, "More Actions for {0}", automation.name));
|
|
540
540
|
card.moreActionsButton.setAriaLabel(moreActionsLabel);
|
|
541
541
|
card.moreActionsButton.setTitle(moreActionsLabel);
|
|
542
542
|
card.nameText.textContent = automation.name;
|
|
@@ -577,35 +577,35 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
577
577
|
const dispatch = await operation.whenDispatched;
|
|
578
578
|
switch (dispatch.kind) {
|
|
579
579
|
case "started":
|
|
580
|
-
status(( localize(
|
|
580
|
+
status(( localize(4790, "Started automation {0}", automation.name)));
|
|
581
581
|
break;
|
|
582
582
|
case "alreadyRunning":
|
|
583
|
-
status(( localize(
|
|
583
|
+
status(( localize(4791, "Automation {0} is already running", automation.name)));
|
|
584
584
|
break;
|
|
585
585
|
case "notStarted":
|
|
586
|
-
status(( localize(
|
|
586
|
+
status(( localize(4792, "Automation {0} did not start", automation.name)));
|
|
587
587
|
break;
|
|
588
588
|
}
|
|
589
589
|
await operation.whenCompleted;
|
|
590
590
|
} catch (error) {
|
|
591
591
|
this.logService.error("[AutomationsCards] Failed to run automation", error);
|
|
592
|
-
await this.dialogService.error(( localize(
|
|
592
|
+
await this.dialogService.error(( localize(4793, "Failed to run automation.")), getErrorMessage(error));
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
595
|
renderEmptyState() {
|
|
596
596
|
const title = append(this.emptyContainer, $("h3.automations-cards-empty-title"));
|
|
597
|
-
title.textContent = ( localize(
|
|
597
|
+
title.textContent = ( localize(4794, "No automations yet"));
|
|
598
598
|
const desc = append(this.emptyContainer, $("p.automations-cards-empty-description"));
|
|
599
599
|
desc.textContent = ( localize(
|
|
600
|
-
|
|
600
|
+
4795,
|
|
601
601
|
"Create an automation to schedule an agent session to run on a cadence you choose."
|
|
602
602
|
));
|
|
603
603
|
const createButton = this.emptyStateDisposables.add(( new Button(this.emptyContainer, {
|
|
604
604
|
...defaultButtonStyles,
|
|
605
|
-
title: ( localize(
|
|
605
|
+
title: ( localize(4796, "Create Automation"))
|
|
606
606
|
})));
|
|
607
607
|
this.emptyCreateButton = createButton;
|
|
608
|
-
createButton.label = ( localize(
|
|
608
|
+
createButton.label = ( localize(4796, "Create Automation"));
|
|
609
609
|
createButton.element.classList.add("automations-cards-create-button");
|
|
610
610
|
this.emptyStateDisposables.add(createButton.onDidClick(() => this.openCreateDialog()));
|
|
611
611
|
}
|
|
@@ -620,9 +620,9 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
620
620
|
this.pluginTemplatesUnreadIndicator = undefined;
|
|
621
621
|
this.builtInTemplatesSection = this.renderTemplateSection({
|
|
622
622
|
className: "automations-built-in-templates",
|
|
623
|
-
title: ( localize(
|
|
623
|
+
title: ( localize(4797, "Built-in Templates")),
|
|
624
624
|
description: ( localize(
|
|
625
|
-
|
|
625
|
+
4798,
|
|
626
626
|
"Choose a starting point, then review and customize it before creating."
|
|
627
627
|
)),
|
|
628
628
|
templates: builtInTemplates,
|
|
@@ -637,8 +637,8 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
637
637
|
if (pluginTemplates.length > 0) {
|
|
638
638
|
const rendered = this.renderTemplateSection({
|
|
639
639
|
className: "automations-plugin-templates",
|
|
640
|
-
title: ( localize(
|
|
641
|
-
description: ( localize(
|
|
640
|
+
title: ( localize(4799, "Templates from Plugins")),
|
|
641
|
+
description: ( localize(4800, "Templates provided by enabled plugins start disabled.")),
|
|
642
642
|
templates: pluginTemplates,
|
|
643
643
|
expanded: this.pluginTemplatesExpanded ?? false,
|
|
644
644
|
showUnreadIndicator: true,
|
|
@@ -701,7 +701,7 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
701
701
|
if (unreadCount === 0) {
|
|
702
702
|
this.pluginTemplatesSummary.removeAttribute("aria-label");
|
|
703
703
|
} else {
|
|
704
|
-
this.pluginTemplatesSummary.setAttribute("aria-label", unreadCount === 1 ? ( localize(
|
|
704
|
+
this.pluginTemplatesSummary.setAttribute("aria-label", unreadCount === 1 ? ( localize(4801, "Templates from Plugins, 1 new template")) : ( localize(4802, "Templates from Plugins, {0} new templates", unreadCount)));
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
707
|
markCurrentPluginTemplatesSeen() {
|
|
@@ -739,9 +739,9 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
739
739
|
icon.classList.add(...ThemeIcon.asClassNameArray(Codicon.loading), "codicon-modifier-spin");
|
|
740
740
|
icon.setAttribute("aria-hidden", "true");
|
|
741
741
|
const title = append(this.loadingContainer, $("h3.automations-cards-state-title"));
|
|
742
|
-
title.textContent = ( localize(
|
|
742
|
+
title.textContent = ( localize(4803, "Loading automations..."));
|
|
743
743
|
const description = append(this.loadingContainer, $("p.automations-cards-state-description"));
|
|
744
|
-
description.textContent = ( localize(
|
|
744
|
+
description.textContent = ( localize(4804, "You can create a new automation while existing automations load."));
|
|
745
745
|
return this.renderStateCreateButton(this.loadingContainer);
|
|
746
746
|
}
|
|
747
747
|
renderUnavailableState() {
|
|
@@ -749,10 +749,10 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
749
749
|
icon.classList.add(...ThemeIcon.asClassNameArray(Codicon.debugDisconnect));
|
|
750
750
|
icon.setAttribute("aria-hidden", "true");
|
|
751
751
|
const title = append(this.unavailableContainer, $("h3.automations-cards-state-title"));
|
|
752
|
-
title.textContent = ( localize(
|
|
752
|
+
title.textContent = ( localize(4805, "Some automations are unavailable"));
|
|
753
753
|
const description = append(this.unavailableContainer, $("p.automations-cards-state-description"));
|
|
754
754
|
description.textContent = ( localize(
|
|
755
|
-
|
|
755
|
+
4806,
|
|
756
756
|
"One or more providers are disconnected, disabled, or do not support automations."
|
|
757
757
|
));
|
|
758
758
|
return this.renderStateCreateButton(this.unavailableContainer);
|
|
@@ -763,17 +763,17 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
763
763
|
icon.classList.add(...ThemeIcon.asClassNameArray(Codicon.error));
|
|
764
764
|
icon.setAttribute("aria-hidden", "true");
|
|
765
765
|
const title = append(this.errorContainer, $("h3.automations-cards-state-title"));
|
|
766
|
-
title.textContent = ( localize(
|
|
766
|
+
title.textContent = ( localize(4807, "Unable to load automations"));
|
|
767
767
|
const description = append(this.errorContainer, $("p.automations-cards-state-description"));
|
|
768
|
-
description.textContent = ( localize(
|
|
768
|
+
description.textContent = ( localize(4808, "The complete automation catalogue could not be read."));
|
|
769
769
|
return this.renderStateCreateButton(this.errorContainer);
|
|
770
770
|
}
|
|
771
771
|
renderStateCreateButton(container) {
|
|
772
772
|
const createButton = this.stateDisposables.add(( new Button(container, {
|
|
773
773
|
...defaultButtonStyles,
|
|
774
|
-
title: ( localize(
|
|
774
|
+
title: ( localize(4796, "Create Automation"))
|
|
775
775
|
})));
|
|
776
|
-
createButton.label = ( localize(
|
|
776
|
+
createButton.label = ( localize(4796, "Create Automation"));
|
|
777
777
|
createButton.element.classList.add("automations-cards-state-create-button");
|
|
778
778
|
this.stateDisposables.add(createButton.onDidClick(() => this.openCreateDialog()));
|
|
779
779
|
return createButton;
|
|
@@ -793,7 +793,7 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
793
793
|
this.partialStateContainer.classList.toggle("automations-cards-partial-state-error", isError);
|
|
794
794
|
this.partialLoadingIcon.style.display = isLoading ? "" : "none";
|
|
795
795
|
this.partialErrorIcon.style.display = isLoading ? "none" : "";
|
|
796
|
-
this.partialStateMessage.textContent = isError ? ( localize(
|
|
796
|
+
this.partialStateMessage.textContent = isError ? ( localize(4809, "Some automations could not be loaded.")) : catalogueState === "unavailable" ? ( localize(4810, "Some automations are unavailable.")) : ( localize(4811, "Loading additional automations..."));
|
|
797
797
|
}
|
|
798
798
|
renderTemplateCard(container, template) {
|
|
799
799
|
const card = append(container, $("button.automations-template-card", {
|
|
@@ -801,12 +801,12 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
801
801
|
}));
|
|
802
802
|
const schedule = formatSchedule(template.schedule);
|
|
803
803
|
card.setAttribute("aria-label", template.source ? ( localize(
|
|
804
|
-
|
|
804
|
+
4812,
|
|
805
805
|
"Use template: {0}, {1}, from {2}",
|
|
806
806
|
template.name,
|
|
807
807
|
schedule,
|
|
808
808
|
template.source.label
|
|
809
|
-
)) : ( localize(
|
|
809
|
+
)) : ( localize(4813, "Use template: {0}, {1}", template.name, schedule)));
|
|
810
810
|
const nameRow = append(card, $(".automations-template-card-name"));
|
|
811
811
|
const name = append(nameRow, $("span.automations-template-card-name-text"));
|
|
812
812
|
name.textContent = template.name;
|
|
@@ -814,11 +814,11 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
814
814
|
content: template.name
|
|
815
815
|
}));
|
|
816
816
|
const badge = append(nameRow, $("span.automations-template-card-badge"));
|
|
817
|
-
badge.textContent = template.source ? ( localize(
|
|
817
|
+
badge.textContent = template.source ? ( localize(4814, "Plugin")) : ( localize(4815, "Template"));
|
|
818
818
|
badge.setAttribute("aria-hidden", "true");
|
|
819
819
|
if (template.source) {
|
|
820
820
|
const source = append(card, $("span.automations-template-card-source"));
|
|
821
|
-
source.textContent = ( localize(
|
|
821
|
+
source.textContent = ( localize(4816, "From {0}", template.source.label));
|
|
822
822
|
this.templateDisposables.add(this.hoverService.setupDelayedHover(source, {
|
|
823
823
|
content: template.source.label
|
|
824
824
|
}));
|
|
@@ -865,10 +865,10 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
865
865
|
this.pendingFocusAutomationId = created.id;
|
|
866
866
|
this.focusPendingAutomation();
|
|
867
867
|
}
|
|
868
|
-
status(( localize(
|
|
868
|
+
status(( localize(4817, "Created automation {0}", created.name)));
|
|
869
869
|
} catch (err) {
|
|
870
870
|
this.logService.error("[AutomationsCards] Failed to create automation", err);
|
|
871
|
-
await this.dialogService.error(( localize(
|
|
871
|
+
await this.dialogService.error(( localize(4818, "Failed to create automation.")), getErrorMessage(err));
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
874
|
clearPendingFocus() {
|
|
@@ -927,14 +927,14 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
927
927
|
const updateResult = await this.automationService.updateAutomationIfUnchanged(result.id, result.value, automation, () => this.throwIfDisabled());
|
|
928
928
|
if (updateResult.kind === "conflict") {
|
|
929
929
|
throw ( new Error(updateResult.current ? ( localize(
|
|
930
|
-
|
|
930
|
+
4819,
|
|
931
931
|
"This automation changed while the dialog was open. Reopen it to review the latest values."
|
|
932
|
-
)) : ( localize(
|
|
932
|
+
)) : ( localize(4820, "This automation was deleted while the dialog was open."))));
|
|
933
933
|
}
|
|
934
|
-
status(( localize(
|
|
934
|
+
status(( localize(4821, "Updated automation {0}", automation.name)));
|
|
935
935
|
} catch (err) {
|
|
936
936
|
this.logService.error("[AutomationsCards] Failed to update automation", err);
|
|
937
|
-
await this.dialogService.error(( localize(
|
|
937
|
+
await this.dialogService.error(( localize(4822, "Failed to update automation.")), getErrorMessage(err));
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
940
|
isEnabled() {
|
|
@@ -949,7 +949,7 @@ let AutomationCardsSection = class AutomationCardsSection extends Disposable {
|
|
|
949
949
|
}
|
|
950
950
|
throwIfDisabled() {
|
|
951
951
|
if (!this.isEnabled()) {
|
|
952
|
-
throw ( new Error(( localize(
|
|
952
|
+
throw ( new Error(( localize(4823, "Automations were disabled before the change could be saved."))));
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
};
|
|
@@ -1066,13 +1066,13 @@ let AutomationHistorySection = class AutomationHistorySection extends Disposable
|
|
|
1066
1066
|
this.headerRow = $$1(".automations-history-header");
|
|
1067
1067
|
this.container.insertBefore(this.headerRow, this.groupsContainer);
|
|
1068
1068
|
const headerLabel = append(this.headerRow, $("span"));
|
|
1069
|
-
headerLabel.textContent = ( localize(
|
|
1069
|
+
headerLabel.textContent = ( localize(4824, "History"));
|
|
1070
1070
|
this.markAllButton = this.headerDisposables.add(( new Button(this.headerRow, {
|
|
1071
1071
|
...defaultButtonStyles,
|
|
1072
1072
|
secondary: true,
|
|
1073
|
-
title: ( localize(
|
|
1073
|
+
title: ( localize(4825, "Mark all as read"))
|
|
1074
1074
|
})));
|
|
1075
|
-
this.markAllButton.label = ( localize(
|
|
1075
|
+
this.markAllButton.label = ( localize(4825, "Mark all as read"));
|
|
1076
1076
|
this.markAllButton.element.classList.add("automations-mark-all-read");
|
|
1077
1077
|
this.headerDisposables.add(this.markAllButton.onDidClick(() => {
|
|
1078
1078
|
void this.markAllRunsRead(this.currentRuns.get());
|
|
@@ -1167,7 +1167,7 @@ let AutomationHistorySection = class AutomationHistorySection extends Disposable
|
|
|
1167
1167
|
entry.temporaryRows.set(run.id, row);
|
|
1168
1168
|
} else if (row.title.textContent !== title) {
|
|
1169
1169
|
row.title.textContent = title;
|
|
1170
|
-
row.element.setAttribute("aria-label", ( localize(
|
|
1170
|
+
row.element.setAttribute("aria-label", ( localize(4826, "{0}, Working...", title)));
|
|
1171
1171
|
}
|
|
1172
1172
|
const currentElement = entry.temporaryRowsContainer.children.item(index);
|
|
1173
1173
|
if (currentElement !== row.element) {
|
|
@@ -1180,7 +1180,7 @@ let AutomationHistorySection = class AutomationHistorySection extends Disposable
|
|
|
1180
1180
|
const disposables = ( new DisposableStore());
|
|
1181
1181
|
const element = $(".automations-temporary-run.session-item");
|
|
1182
1182
|
element.setAttribute("role", "group");
|
|
1183
|
-
element.setAttribute("aria-label", ( localize(
|
|
1183
|
+
element.setAttribute("aria-label", ( localize(4826, "{0}, Working...", title)));
|
|
1184
1184
|
const icon = append(element, $(".session-icon"));
|
|
1185
1185
|
const statusIcon = disposables.add(this.instantiationService.createInstance(SessionStatusIcon, icon));
|
|
1186
1186
|
statusIcon.setStatus(SessionStatus.InProgress, true, false);
|
|
@@ -1189,7 +1189,7 @@ let AutomationHistorySection = class AutomationHistorySection extends Disposable
|
|
|
1189
1189
|
const titleElement = append(titleRow, $("span.session-title"));
|
|
1190
1190
|
titleElement.textContent = title;
|
|
1191
1191
|
const detailsRow = append(main, $(".session-details-row"));
|
|
1192
|
-
append(detailsRow, $("span.session-description")).textContent = ( localize(
|
|
1192
|
+
append(detailsRow, $("span.session-description")).textContent = ( localize(4827, "Working..."));
|
|
1193
1193
|
return {
|
|
1194
1194
|
element,
|
|
1195
1195
|
title: titleElement,
|
|
@@ -1257,7 +1257,7 @@ let AutomationHistorySection = class AutomationHistorySection extends Disposable
|
|
|
1257
1257
|
}
|
|
1258
1258
|
}
|
|
1259
1259
|
getAutomationName(run) {
|
|
1260
|
-
return this.automationService.automations.get().find(automation => automation.id === run.automationId)?.name ?? ( localize(
|
|
1260
|
+
return this.automationService.automations.get().find(automation => automation.id === run.automationId)?.name ?? ( localize(4828, "Unknown"));
|
|
1261
1261
|
}
|
|
1262
1262
|
async openRunSession(resource) {
|
|
1263
1263
|
if (!this.sessionsManagementService.getSession(resource)) {
|
|
@@ -1270,17 +1270,17 @@ let AutomationHistorySection = class AutomationHistorySection extends Disposable
|
|
|
1270
1270
|
});
|
|
1271
1271
|
} catch (error) {
|
|
1272
1272
|
this.logService.error("[AutomationsCards] Failed to open automation run", error);
|
|
1273
|
-
await this.dialogService.error(( localize(
|
|
1273
|
+
await this.dialogService.error(( localize(4829, "Failed to open automation run.")), getErrorMessage(error));
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
1276
|
async stopRunSession(session, automationName, action) {
|
|
1277
1277
|
try {
|
|
1278
1278
|
await this.sessionsManagementService.cancelCurrentRequest(session);
|
|
1279
|
-
status(( localize(
|
|
1279
|
+
status(( localize(4830, "Stopped the session for {0}", automationName)));
|
|
1280
1280
|
} catch (error) {
|
|
1281
1281
|
action.enabled = true;
|
|
1282
1282
|
this.logService.error("[AutomationsCards] Failed to stop automation run session", error);
|
|
1283
|
-
await this.dialogService.error(( localize(
|
|
1283
|
+
await this.dialogService.error(( localize(4831, "Failed to stop the automation run session.")), getErrorMessage(error));
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
1286
|
restoreFocusAfterRender() {
|
|
@@ -1314,7 +1314,7 @@ let AutomationHistorySection = class AutomationHistorySection extends Disposable
|
|
|
1314
1314
|
await this.sessionsManagementService.markAllRead([...( sessions.values())]);
|
|
1315
1315
|
} catch (error) {
|
|
1316
1316
|
this.logService.error("[AutomationsCards] Failed to mark automation runs read", error);
|
|
1317
|
-
await this.dialogService.error(( localize(
|
|
1317
|
+
await this.dialogService.error(( localize(4832, "Failed to mark automation runs as read.")), getErrorMessage(error));
|
|
1318
1318
|
} finally {
|
|
1319
1319
|
this.isMarkingAllRead.set(false, undefined);
|
|
1320
1320
|
}
|
|
@@ -1336,18 +1336,18 @@ function formatSchedule(schedule) {
|
|
|
1336
1336
|
const time = formatHourMinute(scheduleHour, scheduleMinute);
|
|
1337
1337
|
switch (interval) {
|
|
1338
1338
|
case "hourly":
|
|
1339
|
-
return localize(
|
|
1339
|
+
return localize(4833, "Hourly");
|
|
1340
1340
|
case "daily":
|
|
1341
|
-
return localize(
|
|
1341
|
+
return localize(4834, "Daily at {0}", time);
|
|
1342
1342
|
case "weekly":
|
|
1343
1343
|
{
|
|
1344
1344
|
const day = DAYS_OF_WEEK[((schedule.scheduleDay % 7) + 7) % 7];
|
|
1345
|
-
return localize(
|
|
1345
|
+
return localize(4835, "{0} at {1}", day, time);
|
|
1346
1346
|
}
|
|
1347
1347
|
case "manual":
|
|
1348
|
-
return localize(
|
|
1348
|
+
return localize(4836, "Manual");
|
|
1349
1349
|
default:
|
|
1350
|
-
return localize(
|
|
1350
|
+
return localize(4836, "Manual");
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
1353
|
function formatHourMinute(hour, minute) {
|
|
@@ -1365,7 +1365,7 @@ function formatHourMinute(hour, minute) {
|
|
|
1365
1365
|
});
|
|
1366
1366
|
}
|
|
1367
1367
|
function getAutomationTargetLabel(target) {
|
|
1368
|
-
return target.kind === "workspace" ? basename(target.folderUri) : ( localize(
|
|
1368
|
+
return target.kind === "workspace" ? basename(target.folderUri) : ( localize(4837, "No workspace"));
|
|
1369
1369
|
}
|
|
1370
1370
|
function groupRunsByDate(runs) {
|
|
1371
1371
|
const now = ( new Date());
|
|
@@ -1404,21 +1404,21 @@ function getDateBucket(date, today, yesterday, lastWeekStart) {
|
|
|
1404
1404
|
if (date >= today) {
|
|
1405
1405
|
return {
|
|
1406
1406
|
key: "today",
|
|
1407
|
-
label: ( localize(
|
|
1407
|
+
label: ( localize(4838, "Today")),
|
|
1408
1408
|
order: 0
|
|
1409
1409
|
};
|
|
1410
1410
|
}
|
|
1411
1411
|
if (date >= yesterday) {
|
|
1412
1412
|
return {
|
|
1413
1413
|
key: "yesterday",
|
|
1414
|
-
label: ( localize(
|
|
1414
|
+
label: ( localize(4839, "Yesterday")),
|
|
1415
1415
|
order: 1
|
|
1416
1416
|
};
|
|
1417
1417
|
}
|
|
1418
1418
|
if (date >= lastWeekStart) {
|
|
1419
1419
|
return {
|
|
1420
1420
|
key: "week",
|
|
1421
|
-
label: ( localize(
|
|
1421
|
+
label: ( localize(4840, "Last week")),
|
|
1422
1422
|
order: 2
|
|
1423
1423
|
};
|
|
1424
1424
|
}
|
|
@@ -1443,33 +1443,33 @@ function getAutomationBlueprintErrorMessage(error) {
|
|
|
1443
1443
|
}
|
|
1444
1444
|
switch (error.code) {
|
|
1445
1445
|
case "invalidFrontmatter":
|
|
1446
|
-
return localize(
|
|
1446
|
+
return localize(4841, "The file must start with valid YAML frontmatter.");
|
|
1447
1447
|
case "unknownProperty":
|
|
1448
|
-
return localize(
|
|
1448
|
+
return localize(4842, "The property '{0}' is not supported.", error.property ?? "");
|
|
1449
1449
|
case "invalidField":
|
|
1450
|
-
return localize(
|
|
1450
|
+
return localize(4843, "The property '{0}' is missing or invalid.", error.property ?? "");
|
|
1451
1451
|
case "unsupportedVersion":
|
|
1452
1452
|
return localize(
|
|
1453
|
-
|
|
1453
|
+
4844,
|
|
1454
1454
|
"Automation blueprint version {0} is not supported.",
|
|
1455
1455
|
error.property ?? ""
|
|
1456
1456
|
);
|
|
1457
1457
|
case "invalidId":
|
|
1458
|
-
return localize(
|
|
1458
|
+
return localize(4845, "The blueprint id '{0}' is invalid.", error.property ?? "");
|
|
1459
1459
|
case "unsupportedSchedule":
|
|
1460
1460
|
return localize(
|
|
1461
|
-
|
|
1461
|
+
4846,
|
|
1462
1462
|
"The cron expression '{0}' cannot be represented by the current Automation editor.",
|
|
1463
1463
|
error.property ?? ""
|
|
1464
1464
|
);
|
|
1465
1465
|
case "unsupportedTimeZone":
|
|
1466
1466
|
return localize(
|
|
1467
|
-
|
|
1467
|
+
4847,
|
|
1468
1468
|
"The time zone '{0}' is not supported. Use 'local' so the schedule follows the importing user's time zone.",
|
|
1469
1469
|
error.property ?? ""
|
|
1470
1470
|
);
|
|
1471
1471
|
case "missingPrompt":
|
|
1472
|
-
return localize(
|
|
1472
|
+
return localize(4848, "The Automation prompt must follow the frontmatter.");
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
1475
1475
|
function normalizeAutomationBlueprintResource(resource) {
|
|
@@ -1551,7 +1551,7 @@ async function importAutomationBlueprint(
|
|
|
1551
1551
|
blueprint = parseAutomationBlueprint(await readContent());
|
|
1552
1552
|
} catch (error) {
|
|
1553
1553
|
logService.error("[Automations] Failed to read Automation blueprint", error);
|
|
1554
|
-
await dialogService.error(( localize(
|
|
1554
|
+
await dialogService.error(( localize(4849, "Failed to import automation.")), getAutomationBlueprintErrorMessage(error));
|
|
1555
1555
|
return;
|
|
1556
1556
|
}
|
|
1557
1557
|
const result = await automationDialogService.showAutomationDialog({
|
|
@@ -1573,19 +1573,19 @@ async function importAutomationBlueprint(
|
|
|
1573
1573
|
const automation = await automationService.createAutomation(result.value, () => {
|
|
1574
1574
|
if (!isEnabled()) {
|
|
1575
1575
|
throw ( new Error(( localize(
|
|
1576
|
-
|
|
1576
|
+
4850,
|
|
1577
1577
|
"Automations were disabled before the imported automation could be saved."
|
|
1578
1578
|
))));
|
|
1579
1579
|
}
|
|
1580
1580
|
});
|
|
1581
|
-
status(( localize(
|
|
1581
|
+
status(( localize(4851, "Imported automation {0}", automation.name)));
|
|
1582
1582
|
} catch (error) {
|
|
1583
1583
|
logService.error("[Automations] Failed to import Automation blueprint", error);
|
|
1584
|
-
await dialogService.error(( localize(
|
|
1584
|
+
await dialogService.error(( localize(4852, "Failed to import automation.")), getErrorMessage(error));
|
|
1585
1585
|
}
|
|
1586
1586
|
}
|
|
1587
1587
|
async function showAutomationsDisabled(dialogService) {
|
|
1588
|
-
await dialogService.info(( localize(
|
|
1588
|
+
await dialogService.info(( localize(4853, "Automations are disabled.")), ( localize(4854, "Enable “{0}” to make changes.", CHAT_AUTOMATIONS_ENABLED_SETTING)));
|
|
1589
1589
|
}
|
|
1590
1590
|
async function confirmAndDeleteAutomation(
|
|
1591
1591
|
automation,
|
|
@@ -1603,9 +1603,9 @@ async function confirmAndDeleteAutomation(
|
|
|
1603
1603
|
return;
|
|
1604
1604
|
}
|
|
1605
1605
|
const confirmed = await dialogService.confirm({
|
|
1606
|
-
message: ( localize(
|
|
1607
|
-
detail: ( localize(
|
|
1608
|
-
primaryButton: ( localize(
|
|
1606
|
+
message: ( localize(4855, "Delete automation \"{0}\"?", automation.name)),
|
|
1607
|
+
detail: ( localize(4856, "This will permanently delete the automation and its run history.")),
|
|
1608
|
+
primaryButton: ( localize(4857, "Delete"))
|
|
1609
1609
|
});
|
|
1610
1610
|
if (!confirmed.confirmed) {
|
|
1611
1611
|
return;
|
|
@@ -1617,22 +1617,22 @@ async function confirmAndDeleteAutomation(
|
|
|
1617
1617
|
try {
|
|
1618
1618
|
await automationService.deleteAutomation(automation.id, () => {
|
|
1619
1619
|
if (!isEnabled()) {
|
|
1620
|
-
throw ( new Error(( localize(
|
|
1620
|
+
throw ( new Error(( localize(4858, "Automations were disabled before the automation could be deleted."))));
|
|
1621
1621
|
}
|
|
1622
1622
|
});
|
|
1623
|
-
status(( localize(
|
|
1623
|
+
status(( localize(4859, "Deleted automation {0}", automation.name)));
|
|
1624
1624
|
} catch (error) {
|
|
1625
1625
|
logService.error("[AutomationsCards] Failed to delete automation", error);
|
|
1626
|
-
await dialogService.error(( localize(
|
|
1626
|
+
await dialogService.error(( localize(4860, "Failed to delete automation.")), getErrorMessage(error));
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
1629
1629
|
let AutomationsCustomView = class AutomationsCustomView extends AbstractCustomView {
|
|
1630
1630
|
constructor(instantiationService) {
|
|
1631
1631
|
super();
|
|
1632
1632
|
this.instantiationService = instantiationService;
|
|
1633
|
-
this.title = constObservable(( localize(
|
|
1633
|
+
this.title = constObservable(( localize(4861, "Automations")));
|
|
1634
1634
|
this.description = constObservable(( localize(
|
|
1635
|
-
|
|
1635
|
+
4862,
|
|
1636
1636
|
"Schedule agent sessions to run automatically on a cadence you choose."
|
|
1637
1637
|
)));
|
|
1638
1638
|
}
|
|
@@ -1719,7 +1719,7 @@ function registerAutomationHistoryItemActions(archiveWording) {
|
|
|
1719
1719
|
return combinedDisposable(MenuRegistry.appendMenuItem(Menus.AutomationsHistoryItem, {
|
|
1720
1720
|
command: {
|
|
1721
1721
|
id: STOP_AUTOMATION_RUN_SESSION_COMMAND_ID,
|
|
1722
|
-
title: ( localize(
|
|
1722
|
+
title: ( localize(4863, "Stop")),
|
|
1723
1723
|
icon: Codicon.stopCircle
|
|
1724
1724
|
},
|
|
1725
1725
|
group: "navigation",
|
|
@@ -1728,7 +1728,7 @@ function registerAutomationHistoryItemActions(archiveWording) {
|
|
|
1728
1728
|
}), MenuRegistry.appendMenuItem(Menus.AutomationsHistoryItemContext, {
|
|
1729
1729
|
command: {
|
|
1730
1730
|
id: MARK_SESSION_READ_COMMAND_ID,
|
|
1731
|
-
title: ( localize(
|
|
1731
|
+
title: ( localize(4864, "Mark as Read"))
|
|
1732
1732
|
},
|
|
1733
1733
|
group: "0_read",
|
|
1734
1734
|
order: 1,
|
|
@@ -1736,7 +1736,7 @@ function registerAutomationHistoryItemActions(archiveWording) {
|
|
|
1736
1736
|
}), MenuRegistry.appendMenuItem(Menus.AutomationsHistoryItemContext, {
|
|
1737
1737
|
command: {
|
|
1738
1738
|
id: MARK_SESSION_UNREAD_COMMAND_ID,
|
|
1739
|
-
title: ( localize(
|
|
1739
|
+
title: ( localize(4865, "Mark as Unread"))
|
|
1740
1740
|
},
|
|
1741
1741
|
group: "0_read",
|
|
1742
1742
|
order: 1,
|
|
@@ -1744,7 +1744,7 @@ function registerAutomationHistoryItemActions(archiveWording) {
|
|
|
1744
1744
|
}), MenuRegistry.appendMenuItem(Menus.AutomationsHistoryItemContext, {
|
|
1745
1745
|
command: {
|
|
1746
1746
|
id: RENAME_SESSION_COMMAND_ID,
|
|
1747
|
-
title: ( localize(
|
|
1747
|
+
title: ( localize(4866, "Rename..."))
|
|
1748
1748
|
},
|
|
1749
1749
|
group: "1_edit",
|
|
1750
1750
|
order: 1,
|
|
@@ -1821,7 +1821,7 @@ registerAction2(class NewAutomationAction extends Action2 {
|
|
|
1821
1821
|
constructor() {
|
|
1822
1822
|
super({
|
|
1823
1823
|
id: "sessionsView.newAutomation",
|
|
1824
|
-
title: ( localize2(
|
|
1824
|
+
title: ( localize2(4867, "New Automation")),
|
|
1825
1825
|
precondition: ChatAutomationsEnabledContext,
|
|
1826
1826
|
menu: [{
|
|
1827
1827
|
id: Menus.CustomViewAutomations,
|
|
@@ -1853,12 +1853,12 @@ registerAction2(class NewAutomationAction extends Action2 {
|
|
|
1853
1853
|
try {
|
|
1854
1854
|
await automationService.createAutomation(result.value, () => {
|
|
1855
1855
|
if (!isEnabled()) {
|
|
1856
|
-
throw ( new Error(( localize(
|
|
1856
|
+
throw ( new Error(( localize(4823, "Automations were disabled before the change could be saved."))));
|
|
1857
1857
|
}
|
|
1858
1858
|
});
|
|
1859
1859
|
} catch (err) {
|
|
1860
1860
|
logService.error("[Automations] Failed to create automation", err);
|
|
1861
|
-
await dialogService.error(( localize(
|
|
1861
|
+
await dialogService.error(( localize(4818, "Failed to create automation.")), getErrorMessage(err));
|
|
1862
1862
|
}
|
|
1863
1863
|
}
|
|
1864
1864
|
});
|
|
@@ -1866,7 +1866,7 @@ registerAction2(class ImportAutomationAction extends Action2 {
|
|
|
1866
1866
|
constructor() {
|
|
1867
1867
|
super({
|
|
1868
1868
|
id: "sessions.automations.import",
|
|
1869
|
-
title: ( localize2(
|
|
1869
|
+
title: ( localize2(4868, "Import Automation")),
|
|
1870
1870
|
precondition: ChatAutomationsEnabledContext,
|
|
1871
1871
|
menu: [{
|
|
1872
1872
|
id: Menus.CustomViewAutomations,
|
|
@@ -1890,13 +1890,13 @@ registerAction2(class ImportAutomationAction extends Action2 {
|
|
|
1890
1890
|
return;
|
|
1891
1891
|
}
|
|
1892
1892
|
const resources = await fileDialogService.showOpenDialog({
|
|
1893
|
-
title: ( localize(
|
|
1894
|
-
openLabel: ( localize(
|
|
1893
|
+
title: ( localize(4869, "Import Automation")),
|
|
1894
|
+
openLabel: ( localize(4870, "Import")),
|
|
1895
1895
|
canSelectFiles: true,
|
|
1896
1896
|
canSelectFolders: false,
|
|
1897
1897
|
canSelectMany: false,
|
|
1898
1898
|
filters: [{
|
|
1899
|
-
name: ( localize(
|
|
1899
|
+
name: ( localize(4871, "Automation Blueprint")),
|
|
1900
1900
|
extensions: ["automation.md"]
|
|
1901
1901
|
}]
|
|
1902
1902
|
});
|
|
@@ -1905,7 +1905,7 @@ registerAction2(class ImportAutomationAction extends Action2 {
|
|
|
1905
1905
|
return;
|
|
1906
1906
|
}
|
|
1907
1907
|
if (!isAutomationBlueprintResource(resource)) {
|
|
1908
|
-
await dialogService.error(( localize(
|
|
1908
|
+
await dialogService.error(( localize(4782, "Unable to import automation.")), ( localize(4781, "Only .automation.md files can be imported.")));
|
|
1909
1909
|
return;
|
|
1910
1910
|
}
|
|
1911
1911
|
await importAutomationBlueprint(async () => ( (await fileService.readFile(resource)).value.toString()), automationDialogService, automationService, configurationService, dialogService, logService);
|
|
@@ -1915,7 +1915,7 @@ registerAction2(class DuplicateAutomationAction extends Action2 {
|
|
|
1915
1915
|
constructor() {
|
|
1916
1916
|
super({
|
|
1917
1917
|
id: "sessions.automations.duplicate",
|
|
1918
|
-
title: ( localize2(
|
|
1918
|
+
title: ( localize2(4872, "Duplicate")),
|
|
1919
1919
|
precondition: ChatAutomationsEnabledContext,
|
|
1920
1920
|
menu: [{
|
|
1921
1921
|
id: Menus.AutomationCardContext,
|
|
@@ -1963,13 +1963,13 @@ registerAction2(class DuplicateAutomationAction extends Action2 {
|
|
|
1963
1963
|
}
|
|
1964
1964
|
const duplicate = await automationService.createAutomation(result.value, () => {
|
|
1965
1965
|
if (!isEnabled()) {
|
|
1966
|
-
throw ( new Error(( localize(
|
|
1966
|
+
throw ( new Error(( localize(4873, "Automations were disabled before the duplicate could be saved."))));
|
|
1967
1967
|
}
|
|
1968
1968
|
});
|
|
1969
|
-
status(( localize(
|
|
1969
|
+
status(( localize(4874, "Created duplicate automation {0}", duplicate.name)));
|
|
1970
1970
|
} catch (error) {
|
|
1971
1971
|
logService.error("[Automations] Failed to duplicate automation", error);
|
|
1972
|
-
await dialogService.error(( localize(
|
|
1972
|
+
await dialogService.error(( localize(4875, "Failed to duplicate automation.")), getErrorMessage(error));
|
|
1973
1973
|
}
|
|
1974
1974
|
}
|
|
1975
1975
|
});
|
|
@@ -1977,7 +1977,7 @@ registerAction2(class ExportAutomationAction extends Action2 {
|
|
|
1977
1977
|
constructor() {
|
|
1978
1978
|
super({
|
|
1979
1979
|
id: "sessions.automations.export",
|
|
1980
|
-
title: ( localize2(
|
|
1980
|
+
title: ( localize2(4876, "Export")),
|
|
1981
1981
|
precondition: ChatAutomationsEnabledContext,
|
|
1982
1982
|
menu: [{
|
|
1983
1983
|
id: Menus.AutomationCardContext,
|
|
@@ -2004,11 +2004,11 @@ registerAction2(class ExportAutomationAction extends Action2 {
|
|
|
2004
2004
|
let resource;
|
|
2005
2005
|
while (true) {
|
|
2006
2006
|
const selectedResource = await fileDialogService.showSaveDialog({
|
|
2007
|
-
title: ( localize(
|
|
2008
|
-
saveLabel: ( localize(
|
|
2007
|
+
title: ( localize(4877, "Export Automation")),
|
|
2008
|
+
saveLabel: ( localize(4878, "Export")),
|
|
2009
2009
|
defaultUri,
|
|
2010
2010
|
filters: [{
|
|
2011
|
-
name: ( localize(
|
|
2011
|
+
name: ( localize(4871, "Automation Blueprint")),
|
|
2012
2012
|
extensions: ["md"]
|
|
2013
2013
|
}]
|
|
2014
2014
|
});
|
|
@@ -2020,16 +2020,16 @@ registerAction2(class ExportAutomationAction extends Action2 {
|
|
|
2020
2020
|
resource = selectedResource;
|
|
2021
2021
|
break;
|
|
2022
2022
|
}
|
|
2023
|
-
await dialogService.error(( localize(
|
|
2023
|
+
await dialogService.error(( localize(4879, "Unable to export automation.")), ( localize(4880, "Use a file name ending in exactly one .automation.md suffix.")));
|
|
2024
2024
|
defaultUri = normalizedResource;
|
|
2025
2025
|
}
|
|
2026
2026
|
try {
|
|
2027
2027
|
const content = serializeAutomationBlueprint(automationToBlueprint(automation));
|
|
2028
2028
|
await fileService.writeFile(resource, VSBuffer.fromString(content));
|
|
2029
|
-
status(( localize(
|
|
2029
|
+
status(( localize(4881, "Exported automation {0}", automation.name)));
|
|
2030
2030
|
} catch (error) {
|
|
2031
2031
|
logService.error("[Automations] Failed to export Automation blueprint", error);
|
|
2032
|
-
await dialogService.error(( localize(
|
|
2032
|
+
await dialogService.error(( localize(4882, "Failed to export automation.")), getErrorMessage(error));
|
|
2033
2033
|
}
|
|
2034
2034
|
}
|
|
2035
2035
|
});
|
|
@@ -2037,7 +2037,7 @@ registerAction2(class DeleteAutomationAction extends Action2 {
|
|
|
2037
2037
|
constructor() {
|
|
2038
2038
|
super({
|
|
2039
2039
|
id: "sessions.automations.delete",
|
|
2040
|
-
title: ( localize2(
|
|
2040
|
+
title: ( localize2(4883, "Delete")),
|
|
2041
2041
|
precondition: ( ContextKeyExpr.and(ChatAutomationsEnabledContext, AutomationCardCanDeleteContext)),
|
|
2042
2042
|
menu: [{
|
|
2043
2043
|
id: Menus.AutomationCardContext,
|
|
@@ -2061,7 +2061,7 @@ registerAction2(class DisableAutomationAction extends Action2 {
|
|
|
2061
2061
|
constructor() {
|
|
2062
2062
|
super({
|
|
2063
2063
|
id: "sessions.automations.disable",
|
|
2064
|
-
title: ( localize2(
|
|
2064
|
+
title: ( localize2(4884, "Disable")),
|
|
2065
2065
|
precondition: ( ContextKeyExpr.and(ChatAutomationsEnabledContext, AutomationCardCanUpdateContext)),
|
|
2066
2066
|
menu: [{
|
|
2067
2067
|
id: Menus.AutomationCardContext,
|
|
@@ -2079,7 +2079,7 @@ registerAction2(class EnableAutomationAction extends Action2 {
|
|
|
2079
2079
|
constructor() {
|
|
2080
2080
|
super({
|
|
2081
2081
|
id: "sessions.automations.enable",
|
|
2082
|
-
title: ( localize2(
|
|
2082
|
+
title: ( localize2(4885, "Enable")),
|
|
2083
2083
|
precondition: ( ContextKeyExpr.and(ChatAutomationsEnabledContext, AutomationCardCanUpdateContext)),
|
|
2084
2084
|
menu: [{
|
|
2085
2085
|
id: Menus.AutomationCardContext,
|
|
@@ -2111,29 +2111,29 @@ async function setAutomationEnabled(accessor, automation, enabled) {
|
|
|
2111
2111
|
enabled
|
|
2112
2112
|
}, automation, () => {
|
|
2113
2113
|
if (!automationsEnabled()) {
|
|
2114
|
-
throw ( new Error(enabled ? ( localize(
|
|
2114
|
+
throw ( new Error(enabled ? ( localize(4886, "Automations were disabled before the automation could be enabled.")) : ( localize(4887, "Automations were disabled before the automation could be updated."))));
|
|
2115
2115
|
}
|
|
2116
2116
|
});
|
|
2117
2117
|
if (result.kind === "conflict") {
|
|
2118
|
-
throw ( new Error(result.current ? (enabled ? ( localize(
|
|
2118
|
+
throw ( new Error(result.current ? (enabled ? ( localize(4888, "This automation changed before it could be enabled. Try again.")) : ( localize(4889, "This automation changed before it could be disabled. Try again."))) : (enabled ? ( localize(4890, "This automation was deleted before it could be enabled.")) : ( localize(4891, "This automation was deleted before it could be disabled.")))));
|
|
2119
2119
|
}
|
|
2120
|
-
status(enabled ? ( localize(
|
|
2120
|
+
status(enabled ? ( localize(4892, "Enabled automation {0}", automation.name)) : ( localize(4893, "Disabled automation {0}", automation.name)));
|
|
2121
2121
|
} catch (error) {
|
|
2122
2122
|
logService.error(
|
|
2123
2123
|
enabled ? "[Automations] Failed to enable automation" : "[Automations] Failed to disable automation",
|
|
2124
2124
|
error
|
|
2125
2125
|
);
|
|
2126
|
-
await dialogService.error(enabled ? ( localize(
|
|
2126
|
+
await dialogService.error(enabled ? ( localize(4894, "Failed to enable automation.")) : ( localize(4895, "Failed to disable automation.")), getErrorMessage(error));
|
|
2127
2127
|
}
|
|
2128
2128
|
}
|
|
2129
2129
|
function getDuplicateAutomationName(name, automations) {
|
|
2130
2130
|
const existingNames = ( new Set(automations.map(automation => automation.name)));
|
|
2131
|
-
const copyName = ( localize(
|
|
2131
|
+
const copyName = ( localize(4896, "{0} Copy", name));
|
|
2132
2132
|
if (!( existingNames.has(copyName))) {
|
|
2133
2133
|
return copyName;
|
|
2134
2134
|
}
|
|
2135
2135
|
for (let index = 2; ; index++) {
|
|
2136
|
-
const indexedCopyName = ( localize(
|
|
2136
|
+
const indexedCopyName = ( localize(4897, "{0} Copy {1}", name, index));
|
|
2137
2137
|
if (!( existingNames.has(indexedCopyName))) {
|
|
2138
2138
|
return indexedCopyName;
|
|
2139
2139
|
}
|