diff --git a/patches/sagemaker/fix-port-forwarding.diff b/patches/sagemaker/fix-port-forwarding.diff index 6d6f803..f531ec6 100644 --- a/patches/sagemaker/fix-port-forwarding.diff +++ b/patches/sagemaker/fix-port-forwarding.diff @@ -1,7 +1,7 @@ -Index: third-party-src/src/vs/code/browser/workbench/workbench.ts +Index: code-editor-src/src/vs/code/browser/workbench/workbench.ts =================================================================== ---- third-party-src.orig/src/vs/code/browser/workbench/workbench.ts -+++ third-party-src/src/vs/code/browser/workbench/workbench.ts +--- code-editor-src.orig/src/vs/code/browser/workbench/workbench.ts ++++ code-editor-src/src/vs/code/browser/workbench/workbench.ts @@ -635,7 +635,7 @@ function readCookie(name: string): strin const localhostMatch = extractLocalHostUriMetaDataForPortMapping(resolvedUri) if (localhostMatch && resolvedUri.authority !== location.host) { diff --git a/patches/sagemaker/post-startup-notifications.diff b/patches/sagemaker/post-startup-notifications.diff index 482661b..168b6e6 100644 --- a/patches/sagemaker/post-startup-notifications.diff +++ b/patches/sagemaker/post-startup-notifications.diff @@ -1,17 +1,17 @@ -Index: third-party-src/extensions/post-startup-notifications/.vscode/extensions.json +Index: code-editor-src/extensions/post-startup-notifications/.vscode/extensions.json =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/.vscode/extensions.json ++++ code-editor-src/extensions/post-startup-notifications/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher", "ms-vscode.extension-test-runner"] +} -Index: third-party-src/extensions/post-startup-notifications/.vscode/launch.json +Index: code-editor-src/extensions/post-startup-notifications/.vscode/launch.json =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/.vscode/launch.json ++++ code-editor-src/extensions/post-startup-notifications/.vscode/launch.json @@ -0,0 +1,21 @@ +// A launch configuration that compiles the extension and then opens it inside a new window +// Use IntelliSense to learn about possible attributes. @@ -35,10 +35,10 @@ Index: third-party-src/extensions/post-startup-notifications/.vscode/launch.json + ] +} \ No newline at end of file -Index: third-party-src/extensions/post-startup-notifications/.vscode/settings.json +Index: code-editor-src/extensions/post-startup-notifications/.vscode/settings.json =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/.vscode/settings.json ++++ code-editor-src/extensions/post-startup-notifications/.vscode/settings.json @@ -0,0 +1,13 @@ +// Place your settings in this file to overwrite default and user settings. +{ @@ -54,10 +54,10 @@ Index: third-party-src/extensions/post-startup-notifications/.vscode/settings.js + "typescript.tsc.autoDetect": "off" +} \ No newline at end of file -Index: third-party-src/extensions/post-startup-notifications/.vscode/tasks.json +Index: code-editor-src/extensions/post-startup-notifications/.vscode/tasks.json =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/.vscode/tasks.json ++++ code-editor-src/extensions/post-startup-notifications/.vscode/tasks.json @@ -0,0 +1,40 @@ +// See https://go.microsoft.com/fwlink/?LinkId=733558 +// for the documentation about the tasks.json format @@ -100,10 +100,10 @@ Index: third-party-src/extensions/post-startup-notifications/.vscode/tasks.json + ] +} \ No newline at end of file -Index: third-party-src/extensions/post-startup-notifications/.vscodeignore +Index: code-editor-src/extensions/post-startup-notifications/.vscodeignore =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/.vscodeignore ++++ code-editor-src/extensions/post-startup-notifications/.vscodeignore @@ -0,0 +1,14 @@ +.vscode/** +.vscode-test/** @@ -119,10 +119,10 @@ Index: third-party-src/extensions/post-startup-notifications/.vscodeignore +**/*.map +**/*.ts +**/.vscode-test.* -Index: third-party-src/extensions/post-startup-notifications/CHANGELOG.md +Index: code-editor-src/extensions/post-startup-notifications/CHANGELOG.md =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/CHANGELOG.md ++++ code-editor-src/extensions/post-startup-notifications/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change Log + @@ -134,19 +134,19 @@ Index: third-party-src/extensions/post-startup-notifications/CHANGELOG.md + +- Initial release \ No newline at end of file -Index: third-party-src/extensions/post-startup-notifications/README.md +Index: code-editor-src/extensions/post-startup-notifications/README.md =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/README.md ++++ code-editor-src/extensions/post-startup-notifications/README.md @@ -0,0 +1,4 @@ +# post-startup-notifications README + +This extension monitors post startup script execution and notifies users on success/failure. + -Index: third-party-src/extensions/post-startup-notifications/eslint.config.mjs +Index: code-editor-src/extensions/post-startup-notifications/eslint.config.mjs =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/eslint.config.mjs ++++ code-editor-src/extensions/post-startup-notifications/eslint.config.mjs @@ -0,0 +1,28 @@ +import typescriptEslint from "@typescript-eslint/eslint-plugin"; +import tsParser from "@typescript-eslint/parser"; @@ -177,10 +177,10 @@ Index: third-party-src/extensions/post-startup-notifications/eslint.config.mjs + }, +}]; \ No newline at end of file -Index: third-party-src/extensions/post-startup-notifications/package.json +Index: code-editor-src/extensions/post-startup-notifications/package.json =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/package.json ++++ code-editor-src/extensions/post-startup-notifications/package.json @@ -0,0 +1,57 @@ +{ + "name": "post-startup-notifications", @@ -240,19 +240,19 @@ Index: third-party-src/extensions/post-startup-notifications/package.json + } +} \ No newline at end of file -Index: third-party-src/extensions/post-startup-notifications/src/constant.ts +Index: code-editor-src/extensions/post-startup-notifications/src/constant.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/src/constant.ts ++++ code-editor-src/extensions/post-startup-notifications/src/constant.ts @@ -0,0 +1,3 @@ +export const POST_START_UP_STATUS_FILE = '/tmp/.post-startup-status.json'; +export const SERVICE_NAME_ENV_VALUE = 'SageMakerUnifiedStudio'; +export const SERVICE_NAME_ENV_KEY = 'SERVICE_NAME'; \ No newline at end of file -Index: third-party-src/extensions/post-startup-notifications/src/extension.ts +Index: code-editor-src/extensions/post-startup-notifications/src/extension.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/src/extension.ts ++++ code-editor-src/extensions/post-startup-notifications/src/extension.ts @@ -0,0 +1,117 @@ +import * as vscode from 'vscode'; +import * as fs from 'fs'; @@ -371,10 +371,10 @@ Index: third-party-src/extensions/post-startup-notifications/src/extension.ts + outputChannel.dispose(); + } +} -Index: third-party-src/extensions/post-startup-notifications/src/test/extension.test.ts +Index: code-editor-src/extensions/post-startup-notifications/src/test/extension.test.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/src/test/extension.test.ts ++++ code-editor-src/extensions/post-startup-notifications/src/test/extension.test.ts @@ -0,0 +1,267 @@ +import * as vscode from 'vscode'; +import * as fs from 'fs'; @@ -643,10 +643,10 @@ Index: third-party-src/extensions/post-startup-notifications/src/test/extension. + }); +}); + -Index: third-party-src/extensions/post-startup-notifications/src/types.ts +Index: code-editor-src/extensions/post-startup-notifications/src/types.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/src/types.ts ++++ code-editor-src/extensions/post-startup-notifications/src/types.ts @@ -0,0 +1,6 @@ +export interface StatusFile { + status: string; @@ -655,10 +655,10 @@ Index: third-party-src/extensions/post-startup-notifications/src/types.ts + label: string; +} \ No newline at end of file -Index: third-party-src/extensions/post-startup-notifications/tsconfig.json +Index: code-editor-src/extensions/post-startup-notifications/tsconfig.json =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/tsconfig.json ++++ code-editor-src/extensions/post-startup-notifications/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { @@ -678,10 +678,10 @@ Index: third-party-src/extensions/post-startup-notifications/tsconfig.json + } +} \ No newline at end of file -Index: third-party-src/extensions/post-startup-notifications/webpack.config.js +Index: code-editor-src/extensions/post-startup-notifications/webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/webpack.config.js ++++ code-editor-src/extensions/post-startup-notifications/webpack.config.js @@ -0,0 +1,48 @@ +//@ts-check + @@ -732,11 +732,11 @@ Index: third-party-src/extensions/post-startup-notifications/webpack.config.js +}; +module.exports = [extensionConfig]; \ No newline at end of file -Index: third-party-src/build/npm/dirs.js +Index: code-editor-src/build/npm/dirs.js =================================================================== ---- third-party-src.orig/build/npm/dirs.js -+++ third-party-src/build/npm/dirs.js -@@ -42,6 +42,7 @@ const dirs = [ +--- code-editor-src.orig/build/npm/dirs.js ++++ code-editor-src/build/npm/dirs.js +@@ -43,6 +43,7 @@ const dirs = [ 'extensions/sagemaker-terminal-crash-mitigation', 'extensions/sagemaker-open-notebook-extension', 'extensions/sagemaker-ui-dark-theme', @@ -744,11 +744,11 @@ Index: third-party-src/build/npm/dirs.js 'extensions/search-result', 'extensions/simple-browser', 'extensions/tunnel-forwarding', -Index: third-party-src/build/gulpfile.extensions.js +Index: code-editor-src/build/gulpfile.extensions.js =================================================================== ---- third-party-src.orig/build/gulpfile.extensions.js -+++ third-party-src/build/gulpfile.extensions.js -@@ -64,6 +64,7 @@ const compilations = [ +--- code-editor-src.orig/build/gulpfile.extensions.js ++++ code-editor-src/build/gulpfile.extensions.js +@@ -65,6 +65,7 @@ const compilations = [ 'extensions/sagemaker-terminal-crash-mitigation/tsconfig.json', 'extensions/sagemaker-open-notebook-extension/tsconfig.json', 'extensions/sagemaker-ui-dark-theme/tsconfig.json', @@ -756,10 +756,10 @@ Index: third-party-src/build/gulpfile.extensions.js 'extensions/tunnel-forwarding/tsconfig.json', 'extensions/typescript-language-features/test-workspace/tsconfig.json', 'extensions/typescript-language-features/web/tsconfig.json', -Index: third-party-src/extensions/post-startup-notifications/extension-browser.webpack.config.js +Index: code-editor-src/extensions/post-startup-notifications/extension-browser.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/extension-browser.webpack.config.js ++++ code-editor-src/extensions/post-startup-notifications/extension-browser.webpack.config.js @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. @@ -778,10 +778,10 @@ Index: third-party-src/extensions/post-startup-notifications/extension-browser.w + extension: './src/extension.ts' + }, +}); -Index: third-party-src/extensions/post-startup-notifications/extension.webpack.config.js +Index: code-editor-src/extensions/post-startup-notifications/extension.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/post-startup-notifications/extension.webpack.config.js ++++ code-editor-src/extensions/post-startup-notifications/extension.webpack.config.js @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. diff --git a/patches/sagemaker/sagemaker-extension-smus-support.diff b/patches/sagemaker/sagemaker-extension-smus-support.diff index 0cff797..275acf9 100644 --- a/patches/sagemaker/sagemaker-extension-smus-support.diff +++ b/patches/sagemaker/sagemaker-extension-smus-support.diff @@ -1,7 +1,7 @@ -Index: third-party-src/extensions/sagemaker-extension/src/constant.ts +Index: code-editor-src/extensions/sagemaker-extension/src/constant.ts =================================================================== ---- third-party-src.orig/extensions/sagemaker-extension/src/constant.ts -+++ third-party-src/extensions/sagemaker-extension/src/constant.ts +--- code-editor-src.orig/extensions/sagemaker-extension/src/constant.ts ++++ code-editor-src/extensions/sagemaker-extension/src/constant.ts @@ -27,6 +27,10 @@ export const FIVE_MINUTES_INTERVAL_MILLI export const SAGEMAKER_METADATA_PATH = '/opt/ml/metadata/resource-metadata.json'; @@ -63,10 +63,10 @@ Index: third-party-src/extensions/sagemaker-extension/src/constant.ts + + return `https://${DataZoneDomainId}.sagemaker.${DataZoneDomainRegion}.on.aws/projects/${DataZoneProjectId}/overview`; +} -Index: third-party-src/extensions/sagemaker-extension/src/extension.ts +Index: code-editor-src/extensions/sagemaker-extension/src/extension.ts =================================================================== ---- third-party-src.orig/extensions/sagemaker-extension/src/extension.ts -+++ third-party-src/extensions/sagemaker-extension/src/extension.ts +--- code-editor-src.orig/extensions/sagemaker-extension/src/extension.ts ++++ code-editor-src/extensions/sagemaker-extension/src/extension.ts @@ -11,7 +11,8 @@ import { WARNING_BUTTON_SAVE_AND_RENEW_SESSION, SagemakerCookie, diff --git a/patches/sagemaker/sagemaker-extensions-sync.diff b/patches/sagemaker/sagemaker-extensions-sync.diff index 599587f..819b5bd 100644 --- a/patches/sagemaker/sagemaker-extensions-sync.diff +++ b/patches/sagemaker/sagemaker-extensions-sync.diff @@ -1,7 +1,7 @@ -Index: third-party-src/build/gulpfile.extensions.js +Index: code-editor-src/build/gulpfile.extensions.js =================================================================== ---- third-party-src.orig/build/gulpfile.extensions.js -+++ third-party-src/build/gulpfile.extensions.js +--- code-editor-src.orig/build/gulpfile.extensions.js ++++ code-editor-src/build/gulpfile.extensions.js @@ -63,6 +63,7 @@ const compilations = [ 'extensions/sagemaker-extension/tsconfig.json', 'extensions/sagemaker-idle-extension/tsconfig.json', @@ -10,10 +10,10 @@ Index: third-party-src/build/gulpfile.extensions.js 'extensions/sagemaker-open-notebook-extension/tsconfig.json', 'extensions/sagemaker-ui-dark-theme/tsconfig.json', 'extensions/post-startup-notifications/tsconfig.json', -Index: third-party-src/build/npm/dirs.js +Index: code-editor-src/build/npm/dirs.js =================================================================== ---- third-party-src.orig/build/npm/dirs.js -+++ third-party-src/build/npm/dirs.js +--- code-editor-src.orig/build/npm/dirs.js ++++ code-editor-src/build/npm/dirs.js @@ -41,6 +41,7 @@ const dirs = [ 'extensions/sagemaker-extension', 'extensions/sagemaker-idle-extension', @@ -22,10 +22,10 @@ Index: third-party-src/build/npm/dirs.js 'extensions/sagemaker-open-notebook-extension', 'extensions/sagemaker-ui-dark-theme', 'extensions/post-startup-notifications', -Index: third-party-src/extensions/sagemaker-extensions-sync/.vscodeignore +Index: code-editor-src/extensions/sagemaker-extensions-sync/.vscodeignore =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-extensions-sync/.vscodeignore ++++ code-editor-src/extensions/sagemaker-extensions-sync/.vscodeignore @@ -0,0 +1,11 @@ +.vscode/** +.vscode-test/** @@ -38,19 +38,19 @@ Index: third-party-src/extensions/sagemaker-extensions-sync/.vscodeignore +out/** +cgmanifest.json +preview-src/** -Index: third-party-src/extensions/sagemaker-extensions-sync/README.md +Index: code-editor-src/extensions/sagemaker-extensions-sync/README.md =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-extensions-sync/README.md ++++ code-editor-src/extensions/sagemaker-extensions-sync/README.md @@ -0,0 +1,3 @@ +# SageMaker Code Editor Extensions Sync + +Notifies users if the extensions directory is missing pre-packaged extensions from SageMaker Distribution and give them the option to sync them. \ No newline at end of file -Index: third-party-src/extensions/sagemaker-extensions-sync/extension-browser.webpack.config.js +Index: code-editor-src/extensions/sagemaker-extensions-sync/extension-browser.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-extensions-sync/extension-browser.webpack.config.js ++++ code-editor-src/extensions/sagemaker-extensions-sync/extension-browser.webpack.config.js @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. @@ -69,10 +69,10 @@ Index: third-party-src/extensions/sagemaker-extensions-sync/extension-browser.we + extension: './src/extension.ts' + }, +}); -Index: third-party-src/extensions/sagemaker-extensions-sync/extension.webpack.config.js +Index: code-editor-src/extensions/sagemaker-extensions-sync/extension.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-extensions-sync/extension.webpack.config.js ++++ code-editor-src/extensions/sagemaker-extensions-sync/extension.webpack.config.js @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. @@ -94,10 +94,10 @@ Index: third-party-src/extensions/sagemaker-extensions-sync/extension.webpack.co + extension: './src/extension.ts', + } +}); -Index: third-party-src/extensions/sagemaker-extensions-sync/package.json +Index: code-editor-src/extensions/sagemaker-extensions-sync/package.json =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-extensions-sync/package.json ++++ code-editor-src/extensions/sagemaker-extensions-sync/package.json @@ -0,0 +1,44 @@ +{ + "name": "sagemaker-extensions-sync", @@ -143,10 +143,10 @@ Index: third-party-src/extensions/sagemaker-extensions-sync/package.json + "dependencies": {}, + "repository": {} +} -Index: third-party-src/extensions/sagemaker-extensions-sync/src/constants.ts +Index: code-editor-src/extensions/sagemaker-extensions-sync/src/constants.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-extensions-sync/src/constants.ts ++++ code-editor-src/extensions/sagemaker-extensions-sync/src/constants.ts @@ -0,0 +1,21 @@ +// constants +export const PERSISTENT_VOLUME_EXTENSIONS_DIR = "/home/sagemaker-user/sagemaker-code-editor-server-data/extensions"; @@ -169,10 +169,10 @@ Index: third-party-src/extensions/sagemaker-extensions-sync/src/constants.ts + return `ExtensionInfo: ${this.identifier} (${this.path})`; + } +} -Index: third-party-src/extensions/sagemaker-extensions-sync/src/extension.ts +Index: code-editor-src/extensions/sagemaker-extensions-sync/src/extension.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-extensions-sync/src/extension.ts ++++ code-editor-src/extensions/sagemaker-extensions-sync/src/extension.ts @@ -0,0 +1,100 @@ +import * as process from "process"; +import * as vscode from 'vscode'; @@ -275,10 +275,10 @@ Index: third-party-src/extensions/sagemaker-extensions-sync/src/extension.ts + } +} \ No newline at end of file -Index: third-party-src/extensions/sagemaker-extensions-sync/tsconfig.json +Index: code-editor-src/extensions/sagemaker-extensions-sync/tsconfig.json =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-extensions-sync/tsconfig.json ++++ code-editor-src/extensions/sagemaker-extensions-sync/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.base.json", @@ -290,10 +290,10 @@ Index: third-party-src/extensions/sagemaker-extensions-sync/tsconfig.json + "../../src/vscode-dts/vscode.d.ts" + ] +} -Index: third-party-src/extensions/sagemaker-extensions-sync/src/utils.ts +Index: code-editor-src/extensions/sagemaker-extensions-sync/src/utils.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-extensions-sync/src/utils.ts ++++ code-editor-src/extensions/sagemaker-extensions-sync/src/utils.ts @@ -0,0 +1,168 @@ +import * as fs from "fs/promises"; +import * as path from "path"; @@ -463,4 +463,4 @@ Index: third-party-src/extensions/sagemaker-extensions-sync/src/utils.ts + console.error(`${LOG_PREFIX} ${error}`); + } +} -\ No newline at end of file \ No newline at end of file +\ No newline at end of file diff --git a/patches/sagemaker/sagemaker-idle-extension.diff b/patches/sagemaker/sagemaker-idle-extension.diff index d6950a2..05560d9 100644 --- a/patches/sagemaker/sagemaker-idle-extension.diff +++ b/patches/sagemaker/sagemaker-idle-extension.diff @@ -1,16 +1,16 @@ -Index: third-party-src/extensions/sagemaker-idle-extension/README.md +Index: code-editor-src/extensions/sagemaker-idle-extension/README.md =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-idle-extension/README.md ++++ code-editor-src/extensions/sagemaker-idle-extension/README.md @@ -0,0 +1,3 @@ +# Code Editor Idle Extension + +The Code Editor Idle Extension tracks user activity and logs the last active timestamp (in UTC) to a local file. User activities monitored include file changes, text editor selection changes, and terminal interactions. Additionally, it provides an API endpoint `/api/idle` that returns the lastActiveTimestamp. \ No newline at end of file -Index: third-party-src/extensions/sagemaker-idle-extension/extension-browser.webpack.config.js +Index: code-editor-src/extensions/sagemaker-idle-extension/extension-browser.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-idle-extension/extension-browser.webpack.config.js ++++ code-editor-src/extensions/sagemaker-idle-extension/extension-browser.webpack.config.js @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. @@ -29,10 +29,10 @@ Index: third-party-src/extensions/sagemaker-idle-extension/extension-browser.web + extension: './src/extension.ts' + }, +}); -Index: third-party-src/extensions/sagemaker-idle-extension/extension.webpack.config.js +Index: code-editor-src/extensions/sagemaker-idle-extension/extension.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-idle-extension/extension.webpack.config.js ++++ code-editor-src/extensions/sagemaker-idle-extension/extension.webpack.config.js @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. @@ -54,10 +54,10 @@ Index: third-party-src/extensions/sagemaker-idle-extension/extension.webpack.con + extension: './src/extension.ts', + } +}); -Index: third-party-src/extensions/sagemaker-idle-extension/package.json +Index: code-editor-src/extensions/sagemaker-idle-extension/package.json =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-idle-extension/package.json ++++ code-editor-src/extensions/sagemaker-idle-extension/package.json @@ -0,0 +1,43 @@ +{ + "name": "sagemaker-idle-extension", @@ -102,10 +102,10 @@ Index: third-party-src/extensions/sagemaker-idle-extension/package.json + "dependencies": {}, + "repository": {} +} -Index: third-party-src/extensions/sagemaker-idle-extension/tsconfig.json +Index: code-editor-src/extensions/sagemaker-idle-extension/tsconfig.json =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-idle-extension/tsconfig.json ++++ code-editor-src/extensions/sagemaker-idle-extension/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.base.json", @@ -117,10 +117,10 @@ Index: third-party-src/extensions/sagemaker-idle-extension/tsconfig.json + "../../src/vscode-dts/vscode.d.ts" + ] +} -Index: third-party-src/extensions/sagemaker-idle-extension/.vscodeignore +Index: code-editor-src/extensions/sagemaker-idle-extension/.vscodeignore =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-idle-extension/.vscodeignore ++++ code-editor-src/extensions/sagemaker-idle-extension/.vscodeignore @@ -0,0 +1,11 @@ +.vscode/** +.vscode-test/** @@ -133,42 +133,34 @@ Index: third-party-src/extensions/sagemaker-idle-extension/.vscodeignore +out/** +cgmanifest.json +preview-src/** -Index: third-party-src/extensions/sagemaker-idle-extension/src/extension.ts +Index: code-editor-src/extensions/sagemaker-idle-extension/src/extension.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-idle-extension/src/extension.ts -@@ -0,0 +1,112 @@ ++++ code-editor-src/extensions/sagemaker-idle-extension/src/extension.ts +@@ -0,0 +1,58 @@ +import * as vscode from "vscode"; +import * as fs from "fs"; +import * as path from "path"; + -+let idleFilePath: string -+let terminalActivityInterval: NodeJS.Timeout | undefined -+const LOG_PREFIX = "[sagemaker-idle-extension]" -+const CHECK_INTERVAL = 60000; // 60 seconds interval ++let idleFilePath: string; + +export function activate(context: vscode.ExtensionContext) { + initializeIdleFilePath(); + registerEventListeners(context); -+ startMonitoringTerminalActivity(); +} + -+export function deactivate() { -+ if(terminalActivityInterval) { -+ clearInterval(terminalActivityInterval) -+ } -+} ++export function deactivate() {} + +/** + * Initializes the file path where the idle timestamp will be stored. + * It sets the path to a hidden file in the /tmp/ directory. + */ +function initializeIdleFilePath() { -+ const tmpDirectory = "/tmp/"; ++ const tmpDirectory = "/tmp/"; + idleFilePath = path.join(tmpDirectory, ".sagemaker-last-active-timestamp"); + + // Set initial lastActivetimestamp -+ updateLastActivityTimestamp() ++ updateLastActivityTimestamp(); +} + +/** @@ -197,52 +189,6 @@ Index: third-party-src/extensions/sagemaker-idle-extension/src/extension.ts +} + +/** -+ * Starts monitoring terminal activity by setting an interval to check for activity in the /dev/pts directory. -+ */ -+const startMonitoringTerminalActivity = () => { -+ terminalActivityInterval = setInterval(checkTerminalActivity, CHECK_INTERVAL); -+}; -+ -+ -+/** -+ * Checks for terminal activity by reading the /dev/pts directory and comparing modification times of the files. -+ * -+ * The /dev/pts directory is used in Unix-like operating systems to represent pseudo-terminal (PTY) devices. -+ * Each active terminal session is assigned a PTY device. These devices are represented as files within the /dev/pts directory. -+ * When a terminal session has activity, such as when a user inputs commands or output is written to the terminal, -+ * the modification time (mtime) of the corresponding PTY device file is updated. By monitoring the modification -+ * times of the files in the /dev/pts directory, we can detect terminal activity. -+ * -+ * If activity is detected (i.e., if any PTY device file was modified within the CHECK_INTERVAL), this function -+ * updates the last activity timestamp. -+ */ -+const checkTerminalActivity = () => { -+ fs.readdir("/dev/pts", (err, files) => { -+ if (err) { -+ console.error(`${LOG_PREFIX} Error reading /dev/pts directory:`, err); -+ return; -+ } -+ -+ const now = Date.now(); -+ const activityDetected = files.some((file) => { -+ const filePath = path.join("/dev/pts", file); -+ try { -+ const stats = fs.statSync(filePath); -+ const mtime = new Date(stats.mtime).getTime(); -+ return now - mtime < CHECK_INTERVAL; -+ } catch (error) { -+ console.error(`${LOG_PREFIX} Error reading file stats:`, error); -+ return false; -+ } -+ }); -+ -+ if (activityDetected) { -+ updateLastActivityTimestamp(); -+ } -+ }); -+}; -+ -+/** + * Updates the last activity timestamp by recording the current timestamp in the idle file and + * refreshing the status bar. The timestamp should be in ISO 8601 format and set to the UTC timezone. + */ @@ -251,10 +197,10 @@ Index: third-party-src/extensions/sagemaker-idle-extension/src/extension.ts + fs.writeFileSync(idleFilePath, timestamp); +} \ No newline at end of file -Index: third-party-src/build/gulpfile.extensions.js +Index: code-editor-src/build/gulpfile.extensions.js =================================================================== ---- third-party-src.orig/build/gulpfile.extensions.js -+++ third-party-src/build/gulpfile.extensions.js +--- code-editor-src.orig/build/gulpfile.extensions.js ++++ code-editor-src/build/gulpfile.extensions.js @@ -61,6 +61,7 @@ const compilations = [ 'extensions/search-result/tsconfig.json', 'extensions/simple-browser/tsconfig.json', @@ -263,10 +209,10 @@ Index: third-party-src/build/gulpfile.extensions.js 'extensions/tunnel-forwarding/tsconfig.json', 'extensions/typescript-language-features/test-workspace/tsconfig.json', 'extensions/typescript-language-features/web/tsconfig.json', -Index: third-party-src/build/npm/dirs.js +Index: code-editor-src/build/npm/dirs.js =================================================================== ---- third-party-src.orig/build/npm/dirs.js -+++ third-party-src/build/npm/dirs.js +--- code-editor-src.orig/build/npm/dirs.js ++++ code-editor-src/build/npm/dirs.js @@ -39,6 +39,7 @@ const dirs = [ 'extensions/php-language-features', 'extensions/references-view', @@ -275,28 +221,69 @@ Index: third-party-src/build/npm/dirs.js 'extensions/search-result', 'extensions/simple-browser', 'extensions/tunnel-forwarding', -Index: third-party-src/src/vs/server/node/webClientServer.ts +Index: code-editor-src/src/vs/server/node/webClientServer.ts =================================================================== ---- third-party-src.orig/src/vs/server/node/webClientServer.ts -+++ third-party-src/src/vs/server/node/webClientServer.ts -@@ -3,7 +3,7 @@ +--- code-editor-src.orig/src/vs/server/node/webClientServer.ts ++++ code-editor-src/src/vs/server/node/webClientServer.ts +@@ -3,8 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createReadStream, promises } from 'fs'; +import { createReadStream, promises, existsSync, writeFileSync } from 'fs'; ++import * as fs from 'fs'; import * as http from 'http'; ++import * as path from 'path'; import * as url from 'url'; import * as cookie from 'cookie'; -@@ -96,6 +96,7 @@ const APP_ROOT = dirname(FileAccess.asFi + import * as crypto from 'crypto'; +@@ -91,11 +93,45 @@ export async function serveFile(filePath + } + } + ++const CHECK_INTERVAL = 60000; // 60 seconds interval + const APP_ROOT = dirname(FileAccess.asFileUri('').fsPath); + const STATIC_PATH = `/static`; const CALLBACK_PATH = `/callback`; const WEB_EXTENSION_PATH = `/web-extension-resource`; +const IDLE_EXTENSION_PATH = `/api/idle`; ++ ++/** ++ * Checks for terminal activity by reading the /dev/pts directory and comparing modification times of the files. ++ * ++ * The /dev/pts directory is used in Unix-like operating systems to represent pseudo-terminal (PTY) devices. ++ * Each active terminal session is assigned a PTY device. These devices are represented as files within the /dev/pts directory. ++ * When a terminal session has activity, such as when a user inputs commands or output is written to the terminal, ++ * the modification time (mtime) of the corresponding PTY device file is updated. By monitoring the modification ++ * times of the files in the /dev/pts directory, we can detect terminal activity. ++ * ++ * If activity is detected (i.e., if any PTY device file was modified within the CHECK_INTERVAL), this function ++ * updates the last activity timestamp. ++ */ ++function checkTerminalActivity(idleFilePath: string) { ++ try { ++ const files: string[] = fs.readdirSync('/dev/pts'); ++ const now = new Date(); ++ ++ const activityDetected = files.some((file: string) => { ++ const filePath = path.join('/dev/pts', file); ++ const stats = fs.statSync(filePath); ++ const mtime = new Date(stats.mtime).getTime(); ++ return now.getTime() - mtime < CHECK_INTERVAL; ++ }); ++ ++ if (activityDetected) { ++ fs.writeFileSync(idleFilePath, now.toISOString()); ++ } ++ } catch (err) { ++ console.error('Error checking terminal activity:', err); ++ } ++} export class WebClientServer { -@@ -133,6 +134,9 @@ export class WebClientServer { +@@ -133,6 +169,9 @@ export class WebClientServer { // callback support return this._handleCallback(res); } @@ -306,7 +293,7 @@ Index: third-party-src/src/vs/server/node/webClientServer.ts if (pathname.startsWith(WEB_EXTENSION_PATH) && pathname.charCodeAt(WEB_EXTENSION_PATH.length) === CharCode.Slash) { // extension resource support return this._handleWebExtensionResource(req, res, pathname.substring(WEB_EXTENSION_PATH.length)); -@@ -505,6 +509,31 @@ export class WebClientServer { +@@ -505,6 +544,33 @@ export class WebClientServer { }); return void res.end(data); } @@ -318,16 +305,18 @@ Index: third-party-src/src/vs/server/node/webClientServer.ts + try { + const tmpDirectory = '/tmp/' + const idleFilePath = join(tmpDirectory, '.sagemaker-last-active-timestamp'); -+ ++ + // If idle shutdown file does not exist, this indicates the app UI may never been opened + // Create the initial metadata file + if (!existsSync(idleFilePath)) { + const timestamp = new Date().toISOString(); + writeFileSync(idleFilePath, timestamp); + } -+ ++ ++ checkTerminalActivity(idleFilePath); ++ + const data = await promises.readFile(idleFilePath, 'utf8'); -+ ++ + res.statusCode = 200; + res.setHeader('Content-Type', 'application/json'); + res.end(JSON.stringify({ lastActiveTimestamp: data })); @@ -336,3 +325,5 @@ Index: third-party-src/src/vs/server/node/webClientServer.ts + } + } } + + diff --git a/patches/sagemaker/sagemaker-open-notebook-extension.diff b/patches/sagemaker/sagemaker-open-notebook-extension.diff index 19e932c..0b22b87 100644 --- a/patches/sagemaker/sagemaker-open-notebook-extension.diff +++ b/patches/sagemaker/sagemaker-open-notebook-extension.diff @@ -1,37 +1,35 @@ -Index: third-party-src/build/gulpfile.extensions.js +Index: code-editor-src/build/gulpfile.extensions.js =================================================================== ---- third-party-src.orig/build/gulpfile.extensions.js -+++ third-party-src/build/gulpfile.extensions.js -@@ -61,6 +61,7 @@ const compilations = [ - 'extensions/simple-browser/tsconfig.json', +--- code-editor-src.orig/build/gulpfile.extensions.js ++++ code-editor-src/build/gulpfile.extensions.js +@@ -63,6 +63,7 @@ const compilations = [ 'extensions/sagemaker-extension/tsconfig.json', + 'extensions/sagemaker-idle-extension/tsconfig.json', 'extensions/sagemaker-terminal-crash-mitigation/tsconfig.json', + 'extensions/sagemaker-open-notebook-extension/tsconfig.json', 'extensions/tunnel-forwarding/tsconfig.json', 'extensions/typescript-language-features/test-workspace/tsconfig.json', 'extensions/typescript-language-features/web/tsconfig.json', -Index: third-party-src/build/npm/dirs.js +Index: code-editor-src/build/npm/dirs.js =================================================================== ---- third-party-src.orig/build/npm/dirs.js -+++ third-party-src/build/npm/dirs.js -@@ -39,6 +39,7 @@ const dirs = [ - 'extensions/references-view', +--- code-editor-src.orig/build/npm/dirs.js ++++ code-editor-src/build/npm/dirs.js +@@ -41,6 +41,7 @@ const dirs = [ 'extensions/sagemaker-extension', + 'extensions/sagemaker-idle-extension', 'extensions/sagemaker-terminal-crash-mitigation', + 'extensions/sagemaker-open-notebook-extension', 'extensions/search-result', 'extensions/simple-browser', 'extensions/tunnel-forwarding', -Index: third-party-src/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts +Index: code-editor-src/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts =================================================================== ---- third-party-src.orig/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts -+++ third-party-src/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts -@@ -262,7 +262,12 @@ Registry.as(Conf - type: 'boolean', +--- code-editor-src.orig/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts ++++ code-editor-src/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts +@@ -263,6 +263,11 @@ Registry.as(Conf description: localize('extensionsInQuickAccess', "When enabled, extensions can be searched for via Quick Access and report issues from there."), default: true -- }, -+ }, + }, + 'extensions.openNotebookData': { + type: 'object', + scope: ConfigurationScope.APPLICATION, @@ -40,10 +38,10 @@ Index: third-party-src/src/vs/workbench/contrib/extensions/browser/extensions.co [VerifyExtensionSignatureConfigKey]: { type: 'boolean', description: localize('extensions.verifySignature', "When enabled, extensions are verified to be signed before getting installed."), -Index: third-party-src/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +Index: code-editor-src/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts =================================================================== ---- third-party-src.orig/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts -+++ third-party-src/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +--- code-editor-src.orig/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts ++++ code-editor-src/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -1084,6 +1084,17 @@ export class ExtensionsWorkbenchService urlService.registerHandler(this); @@ -62,10 +60,10 @@ Index: third-party-src/src/vs/workbench/contrib/extensions/browser/extensionsWor } private async initialize(): Promise { -Index: third-party-src/extensions/sagemaker-open-notebook-extension/extension-browser.webpack.config.js +Index: code-editor-src/extensions/sagemaker-open-notebook-extension/extension-browser.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-open-notebook-extension/extension-browser.webpack.config.js ++++ code-editor-src/extensions/sagemaker-open-notebook-extension/extension-browser.webpack.config.js @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. @@ -84,10 +82,10 @@ Index: third-party-src/extensions/sagemaker-open-notebook-extension/extension-br + extension: './src/extension.ts' + }, +}); -Index: third-party-src/extensions/sagemaker-open-notebook-extension/extension.webpack.config.js +Index: code-editor-src/extensions/sagemaker-open-notebook-extension/extension.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-open-notebook-extension/extension.webpack.config.js ++++ code-editor-src/extensions/sagemaker-open-notebook-extension/extension.webpack.config.js @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. @@ -109,10 +107,10 @@ Index: third-party-src/extensions/sagemaker-open-notebook-extension/extension.we + extension: './src/extension.ts', + } +}); -Index: third-party-src/extensions/sagemaker-open-notebook-extension/package.json +Index: code-editor-src/extensions/sagemaker-open-notebook-extension/package.json =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-open-notebook-extension/package.json ++++ code-editor-src/extensions/sagemaker-open-notebook-extension/package.json @@ -0,0 +1,44 @@ +{ + "name": "sagemaker-open-notebook-extension", @@ -158,10 +156,10 @@ Index: third-party-src/extensions/sagemaker-open-notebook-extension/package.json + "dependencies": {}, + "repository": {} +} -Index: third-party-src/extensions/sagemaker-open-notebook-extension/src/extension.ts +Index: code-editor-src/extensions/sagemaker-open-notebook-extension/src/extension.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-open-notebook-extension/src/extension.ts ++++ code-editor-src/extensions/sagemaker-open-notebook-extension/src/extension.ts @@ -0,0 +1,100 @@ + +import * as vscode from 'vscode'; @@ -263,10 +261,10 @@ Index: third-party-src/extensions/sagemaker-open-notebook-extension/src/extensio + }); +} +export function deactivate() {} -Index: third-party-src/extensions/sagemaker-open-notebook-extension/tsconfig.json +Index: code-editor-src/extensions/sagemaker-open-notebook-extension/tsconfig.json =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-open-notebook-extension/tsconfig.json ++++ code-editor-src/extensions/sagemaker-open-notebook-extension/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.base.json", @@ -278,10 +276,10 @@ Index: third-party-src/extensions/sagemaker-open-notebook-extension/tsconfig.jso + "../../src/vscode-dts/vscode.d.ts" + ] +} -Index: third-party-src/extensions/sagemaker-open-notebook-extension/.vscodeignore +Index: code-editor-src/extensions/sagemaker-open-notebook-extension/.vscodeignore =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-open-notebook-extension/.vscodeignore ++++ code-editor-src/extensions/sagemaker-open-notebook-extension/.vscodeignore @@ -0,0 +1,11 @@ +.vscode/** +.vscode-test/** @@ -294,10 +292,10 @@ Index: third-party-src/extensions/sagemaker-open-notebook-extension/.vscodeignor +out/** +cgmanifest.json +preview-src/** -Index: third-party-src/extensions/sagemaker-open-notebook-extension/README.md +Index: code-editor-src/extensions/sagemaker-open-notebook-extension/README.md =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-open-notebook-extension/README.md ++++ code-editor-src/extensions/sagemaker-open-notebook-extension/README.md @@ -0,0 +1,18 @@ +# Code Editor Open Notebook Extension + diff --git a/patches/sagemaker/sagemaker-ui-dark-theme.diff b/patches/sagemaker/sagemaker-ui-dark-theme.diff index 58c4f50..4ab2f57 100644 --- a/patches/sagemaker/sagemaker-ui-dark-theme.diff +++ b/patches/sagemaker/sagemaker-ui-dark-theme.diff @@ -1,7 +1,7 @@ -Index: third-party-src/extensions/sagemaker-ui-dark-theme/.vscodeignore +Index: code-editor-src/extensions/sagemaker-ui-dark-theme/.vscodeignore =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-ui-dark-theme/.vscodeignore ++++ code-editor-src/extensions/sagemaker-ui-dark-theme/.vscodeignore @@ -0,0 +1,11 @@ +.vscode/** +.vscode-test/** @@ -14,16 +14,16 @@ Index: third-party-src/extensions/sagemaker-ui-dark-theme/.vscodeignore +out/** +cgmanifest.json +preview-src/** -Index: third-party-src/extensions/sagemaker-ui-dark-theme/README.md +Index: code-editor-src/extensions/sagemaker-ui-dark-theme/README.md =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-ui-dark-theme/README.md ++++ code-editor-src/extensions/sagemaker-ui-dark-theme/README.md @@ -0,0 +1 @@ +# SageMaker UI Dark Theme -Index: third-party-src/extensions/sagemaker-ui-dark-theme/extension-browser.webpack.config.js +Index: code-editor-src/extensions/sagemaker-ui-dark-theme/extension-browser.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-ui-dark-theme/extension-browser.webpack.config.js ++++ code-editor-src/extensions/sagemaker-ui-dark-theme/extension-browser.webpack.config.js @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. @@ -42,10 +42,10 @@ Index: third-party-src/extensions/sagemaker-ui-dark-theme/extension-browser.webp + extension: './src/extension.ts' + }, +}); -Index: third-party-src/extensions/sagemaker-ui-dark-theme/extension.webpack.config.js +Index: code-editor-src/extensions/sagemaker-ui-dark-theme/extension.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-ui-dark-theme/extension.webpack.config.js ++++ code-editor-src/extensions/sagemaker-ui-dark-theme/extension.webpack.config.js @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. @@ -67,10 +67,10 @@ Index: third-party-src/extensions/sagemaker-ui-dark-theme/extension.webpack.conf + extension: './src/extension.ts', + } +}); -Index: third-party-src/extensions/sagemaker-ui-dark-theme/src/extension.ts +Index: code-editor-src/extensions/sagemaker-ui-dark-theme/src/extension.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-ui-dark-theme/src/extension.ts ++++ code-editor-src/extensions/sagemaker-ui-dark-theme/src/extension.ts @@ -0,0 +1,51 @@ +import * as vscode from 'vscode'; + @@ -123,10 +123,10 @@ Index: third-party-src/extensions/sagemaker-ui-dark-theme/src/extension.ts + outputChannel.dispose(); + } +} -Index: third-party-src/extensions/sagemaker-ui-dark-theme/tsconfig.json +Index: code-editor-src/extensions/sagemaker-ui-dark-theme/tsconfig.json =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-ui-dark-theme/tsconfig.json ++++ code-editor-src/extensions/sagemaker-ui-dark-theme/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.base.json", @@ -138,11 +138,11 @@ Index: third-party-src/extensions/sagemaker-ui-dark-theme/tsconfig.json + "../../src/vscode-dts/vscode.d.ts" + ] +} -Index: third-party-src/build/gulpfile.extensions.js +Index: code-editor-src/build/gulpfile.extensions.js =================================================================== ---- third-party-src.orig/build/gulpfile.extensions.js -+++ third-party-src/build/gulpfile.extensions.js -@@ -63,6 +63,7 @@ const compilations = [ +--- code-editor-src.orig/build/gulpfile.extensions.js ++++ code-editor-src/build/gulpfile.extensions.js +@@ -64,6 +64,7 @@ const compilations = [ 'extensions/sagemaker-idle-extension/tsconfig.json', 'extensions/sagemaker-terminal-crash-mitigation/tsconfig.json', 'extensions/sagemaker-open-notebook-extension/tsconfig.json', @@ -150,11 +150,11 @@ Index: third-party-src/build/gulpfile.extensions.js 'extensions/tunnel-forwarding/tsconfig.json', 'extensions/typescript-language-features/test-workspace/tsconfig.json', 'extensions/typescript-language-features/web/tsconfig.json', -Index: third-party-src/build/npm/dirs.js +Index: code-editor-src/build/npm/dirs.js =================================================================== ---- third-party-src.orig/build/npm/dirs.js -+++ third-party-src/build/npm/dirs.js -@@ -41,6 +41,7 @@ const dirs = [ +--- code-editor-src.orig/build/npm/dirs.js ++++ code-editor-src/build/npm/dirs.js +@@ -42,6 +42,7 @@ const dirs = [ 'extensions/sagemaker-idle-extension', 'extensions/sagemaker-terminal-crash-mitigation', 'extensions/sagemaker-open-notebook-extension', @@ -162,10 +162,10 @@ Index: third-party-src/build/npm/dirs.js 'extensions/search-result', 'extensions/simple-browser', 'extensions/tunnel-forwarding', -Index: third-party-src/extensions/sagemaker-ui-dark-theme/package.json +Index: code-editor-src/extensions/sagemaker-ui-dark-theme/package.json =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-ui-dark-theme/package.json ++++ code-editor-src/extensions/sagemaker-ui-dark-theme/package.json @@ -0,0 +1,46 @@ +{ + "name": "sagemaker-ui-dark-theme", @@ -213,10 +213,10 @@ Index: third-party-src/extensions/sagemaker-ui-dark-theme/package.json + "repository": { + } +} -Index: third-party-src/.vscode-test.js +Index: code-editor-src/.vscode-test.js =================================================================== ---- third-party-src.orig/.vscode-test.js -+++ third-party-src/.vscode-test.js +--- code-editor-src.orig/.vscode-test.js ++++ code-editor-src/.vscode-test.js @@ -63,6 +63,11 @@ const extensions = [ mocha: { timeout: 60_000 } }, @@ -229,11 +229,10 @@ Index: third-party-src/.vscode-test.js label: 'microsoft-authentication', mocha: { timeout: 60_000 } }, - -Index: third-party-src/extensions/sagemaker-ui-dark-theme/src/test/extension.test.ts +Index: code-editor-src/extensions/sagemaker-ui-dark-theme/src/test/extension.test.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-ui-dark-theme/src/test/extension.test.ts ++++ code-editor-src/extensions/sagemaker-ui-dark-theme/src/test/extension.test.ts @@ -0,0 +1,123 @@ +import * as assert from 'assert'; +import * as vscode from 'vscode'; @@ -358,10 +357,10 @@ Index: third-party-src/extensions/sagemaker-ui-dark-theme/src/test/extension.tes + assert.strictEqual(theme?.globalValue, undefined, 'Global theme should not be set'); + }); +}); -Index: third-party-src/extensions/sagemaker-ui-dark-theme/src/test/index.ts +Index: code-editor-src/extensions/sagemaker-ui-dark-theme/src/test/index.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-ui-dark-theme/src/test/index.ts ++++ code-editor-src/extensions/sagemaker-ui-dark-theme/src/test/index.ts @@ -0,0 +1,33 @@ +import * as path from 'path'; +import * as testRunner from '../../../../test/integration/electron/testrunner'; diff --git a/patches/sagemaker/sagemaker-ui-post-startup.diff b/patches/sagemaker/sagemaker-ui-post-startup.diff index 3e22397..ed06db9 100644 --- a/patches/sagemaker/sagemaker-ui-post-startup.diff +++ b/patches/sagemaker/sagemaker-ui-post-startup.diff @@ -1,17 +1,16 @@ -Index: third-party-src/src/vs/server/node/webClientServer.ts +Index: code-editor-src/src/vs/server/node/webClientServer.ts =================================================================== ---- third-party-src.orig/src/vs/server/node/webClientServer.ts -+++ third-party-src/src/vs/server/node/webClientServer.ts -@@ -5,6 +5,8 @@ - - import { createReadStream, promises, existsSync, writeFileSync } from 'fs'; - import * as http from 'http'; -+import { spawn } from 'child_process'; -+import * as fs from 'fs'; +--- code-editor-src.orig/src/vs/server/node/webClientServer.ts ++++ code-editor-src/src/vs/server/node/webClientServer.ts +@@ -10,6 +10,7 @@ import * as path from 'path'; import * as url from 'url'; import * as cookie from 'cookie'; import * as crypto from 'crypto'; -@@ -38,6 +40,10 @@ const textMimeType: { [ext: string]: str ++import { spawn } from 'child_process'; + import { isEqualOrParent } from '../../base/common/extpath.js'; + import { getMediaMime } from '../../base/common/mime.js'; + import { isLinux } from '../../base/common/platform.js'; +@@ -40,6 +41,10 @@ const textMimeType: { [ext: string]: str '.svg': 'image/svg+xml', }; @@ -22,15 +21,15 @@ Index: third-party-src/src/vs/server/node/webClientServer.ts /** * Return an error to the client. */ -@@ -97,6 +103,7 @@ const STATIC_PATH = `/static`; +@@ -100,6 +105,7 @@ const STATIC_PATH = `/static`; const CALLBACK_PATH = `/callback`; const WEB_EXTENSION_PATH = `/web-extension-resource`; const IDLE_EXTENSION_PATH = `/api/idle`; +const POST_STARTUP_SCRIPT_PATH = `/api/poststartup`; - export class WebClientServer { - -@@ -137,6 +144,9 @@ export class WebClientServer { + /** + * Checks for terminal activity by reading the /dev/pts directory and comparing modification times of the files. +@@ -172,6 +178,9 @@ export class WebClientServer { if (pathname === IDLE_EXTENSION_PATH) { return this._handleIdle(req, res); } @@ -40,7 +39,7 @@ Index: third-party-src/src/vs/server/node/webClientServer.ts if (pathname.startsWith(WEB_EXTENSION_PATH) && pathname.charCodeAt(WEB_EXTENSION_PATH.length) === CharCode.Slash) { // extension resource support return this._handleWebExtensionResource(req, res, pathname.substring(WEB_EXTENSION_PATH.length)); -@@ -534,6 +544,41 @@ export class WebClientServer { +@@ -571,6 +580,41 @@ export class WebClientServer { serveError(req, res, 500, error.message) } } @@ -80,3 +79,5 @@ Index: third-party-src/src/vs/server/node/webClientServer.ts + } + } } + + diff --git a/patches/sagemaker/terminal-crash-mitigation.diff b/patches/sagemaker/terminal-crash-mitigation.diff index a936399..6ab4fed 100644 --- a/patches/sagemaker/terminal-crash-mitigation.diff +++ b/patches/sagemaker/terminal-crash-mitigation.diff @@ -1,7 +1,7 @@ -Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/.vscodeignore +Index: code-editor-src/extensions/sagemaker-terminal-crash-mitigation/.vscodeignore =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-terminal-crash-mitigation/.vscodeignore ++++ code-editor-src/extensions/sagemaker-terminal-crash-mitigation/.vscodeignore @@ -0,0 +1,11 @@ +.vscode/** +.vscode-test/** @@ -14,10 +14,10 @@ Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/.vscodeign +out/** +cgmanifest.json +preview-src/** -Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/extension-browser.webpack.config.js +Index: code-editor-src/extensions/sagemaker-terminal-crash-mitigation/extension-browser.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-terminal-crash-mitigation/extension-browser.webpack.config.js ++++ code-editor-src/extensions/sagemaker-terminal-crash-mitigation/extension-browser.webpack.config.js @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. @@ -36,10 +36,10 @@ Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/extension- + extension: './src/extension.ts' + }, +}); -Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/extension.webpack.config.js +Index: code-editor-src/extensions/sagemaker-terminal-crash-mitigation/extension.webpack.config.js =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-terminal-crash-mitigation/extension.webpack.config.js ++++ code-editor-src/extensions/sagemaker-terminal-crash-mitigation/extension.webpack.config.js @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright Amazon.com Inc. or its affiliates. All rights reserved. @@ -61,18 +61,18 @@ Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/extension. + extension: './src/extension.ts', + } +}); -Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/README.md +Index: code-editor-src/extensions/sagemaker-terminal-crash-mitigation/README.md =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-terminal-crash-mitigation/README.md ++++ code-editor-src/extensions/sagemaker-terminal-crash-mitigation/README.md @@ -0,0 +1,2 @@ +# Terminal Crash Mitigation +This extension addresses a critical issue where terminals fail to open. As of August 9, 2024, the root cause remains unidentified. The extension works by monitoring the creation of new terminals and detects if a terminal closes within 1 second of being opened. When this condition is met, it assumes the issue has occurred and attempts to mitigate it by terminating any background terminal processes. However, it will not terminate any terminal processes if there is an active terminal in the UI. \ No newline at end of file -Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/package.json +Index: code-editor-src/extensions/sagemaker-terminal-crash-mitigation/package.json =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-terminal-crash-mitigation/package.json ++++ code-editor-src/extensions/sagemaker-terminal-crash-mitigation/package.json @@ -0,0 +1,43 @@ +{ + "name": "sagemaker-terminal-crash-mitigation", @@ -117,10 +117,10 @@ Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/package.js + "dependencies": {}, + "repository": {} +} -Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/src/extension.ts +Index: code-editor-src/extensions/sagemaker-terminal-crash-mitigation/src/extension.ts =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-terminal-crash-mitigation/src/extension.ts ++++ code-editor-src/extensions/sagemaker-terminal-crash-mitigation/src/extension.ts @@ -0,0 +1,103 @@ +import * as vscode from 'vscode'; +import { exec } from 'child_process'; @@ -225,10 +225,10 @@ Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/src/extens +} + +export function deactivate() {} -Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/tsconfig.json +Index: code-editor-src/extensions/sagemaker-terminal-crash-mitigation/tsconfig.json =================================================================== --- /dev/null -+++ third-party-src/extensions/sagemaker-terminal-crash-mitigation/tsconfig.json ++++ code-editor-src/extensions/sagemaker-terminal-crash-mitigation/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.base.json", @@ -240,10 +240,10 @@ Index: third-party-src/extensions/sagemaker-terminal-crash-mitigation/tsconfig.j + "../../src/vscode-dts/vscode.d.ts" + ] +} -Index: third-party-src/build/gulpfile.extensions.js +Index: code-editor-src/build/gulpfile.extensions.js =================================================================== ---- third-party-src.orig/build/gulpfile.extensions.js -+++ third-party-src/build/gulpfile.extensions.js +--- code-editor-src.orig/build/gulpfile.extensions.js ++++ code-editor-src/build/gulpfile.extensions.js @@ -62,6 +62,7 @@ const compilations = [ 'extensions/simple-browser/tsconfig.json', 'extensions/sagemaker-extension/tsconfig.json', @@ -252,10 +252,10 @@ Index: third-party-src/build/gulpfile.extensions.js 'extensions/tunnel-forwarding/tsconfig.json', 'extensions/typescript-language-features/test-workspace/tsconfig.json', 'extensions/typescript-language-features/web/tsconfig.json', -Index: third-party-src/build/npm/dirs.js +Index: code-editor-src/build/npm/dirs.js =================================================================== ---- third-party-src.orig/build/npm/dirs.js -+++ third-party-src/build/npm/dirs.js +--- code-editor-src.orig/build/npm/dirs.js ++++ code-editor-src/build/npm/dirs.js @@ -40,6 +40,7 @@ const dirs = [ 'extensions/references-view', 'extensions/sagemaker-extension',