@galaxyproject/jupyterlite 0.0.28 → 0.0.30
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/package.json +1 -2
- package/static/dist/_output/config-utils.js +64 -21
- package/static/dist/_output/extensions/jl-galaxy/extension.js +1 -1
- package/static/dist/_output/jupyter-lite.json +2 -2
- package/static/dist/_output/pypi/gxy-0.0.0-py3-none-any.whl +0 -0
- package/static/dist/_output/pypi/{jsonschema-4.25.1-py3-none-any.whl → jsonschema-4.26.0-py3-none-any.whl} +0 -0
- package/static/dist/_output/pypi/{narwhals-2.14.0-py3-none-any.whl → narwhals-2.15.0-py3-none-any.whl} +0 -0
- package/static/dist/index.js +8 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galaxyproject/jupyterlite",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"static"
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@playwright/test": "^1.52.0",
|
|
21
|
-
"axios": "^1.9.0",
|
|
22
21
|
"cpx": "^1.5.0",
|
|
23
22
|
"node-fetch": "^3.3.2",
|
|
24
23
|
"playwright": "^1.52.0",
|
|
@@ -248,28 +248,71 @@ function addFavicon(config) {
|
|
|
248
248
|
async function main() {
|
|
249
249
|
const config = await jupyterConfigData();
|
|
250
250
|
//__GXY__INJECTION__
|
|
251
|
+
const AI_SETTINGS = "@jupyterlite/ai:settings-model";
|
|
252
|
+
const PYODIDE_KERNEL = "@jupyterlite/pyodide-kernel-extension:kernel";
|
|
253
|
+
const searchParams = Object.fromEntries(new URL(window.location.href).searchParams.entries());
|
|
254
|
+
const galaxyRoot = searchParams.root || "/";
|
|
255
|
+
const galaxyApiBase = galaxyRoot + "api/plugins/jupyterlite";
|
|
256
|
+
|
|
257
|
+
// Intercept fetch to strip Authorization header for Galaxy API requests
|
|
258
|
+
const originalFetch = window.fetch;
|
|
259
|
+
const galaxyApiPath = galaxyApiBase.startsWith("http") ? new URL(galaxyApiBase).pathname : galaxyApiBase;
|
|
260
|
+
window.fetch = async function (url, init) {
|
|
261
|
+
// Normalize URL to pathname for comparison
|
|
262
|
+
let pathname;
|
|
263
|
+
if (typeof url === "string") {
|
|
264
|
+
pathname = url.startsWith("http") ? new URL(url).pathname : url;
|
|
265
|
+
} else if (url instanceof URL) {
|
|
266
|
+
pathname = url.pathname;
|
|
267
|
+
} else if (url instanceof Request) {
|
|
268
|
+
pathname = new URL(url.url).pathname;
|
|
269
|
+
} else {
|
|
270
|
+
pathname = String(url);
|
|
271
|
+
}
|
|
251
272
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
+
// Check if this is a Galaxy API request
|
|
274
|
+
if (pathname.startsWith(galaxyApiPath)) {
|
|
275
|
+
// Handle Request objects with built-in headers
|
|
276
|
+
if (url instanceof Request) {
|
|
277
|
+
const headers = new Headers(url.headers);
|
|
278
|
+
headers.delete("Authorization");
|
|
279
|
+
url = new Request(url, { headers });
|
|
280
|
+
}
|
|
281
|
+
// Handle headers in init options
|
|
282
|
+
if (init?.headers) {
|
|
283
|
+
const headers = new Headers(init.headers);
|
|
284
|
+
headers.delete("Authorization");
|
|
285
|
+
init = { ...init, headers };
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return originalFetch.call(this, url, init);
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
// Ensure nested config structure exists
|
|
292
|
+
config.litePluginSettings = config.litePluginSettings || {};
|
|
293
|
+
config.litePluginSettings[PYODIDE_KERNEL] = config.litePluginSettings[PYODIDE_KERNEL] || {};
|
|
294
|
+
config.litePluginSettings[PYODIDE_KERNEL].loadPyodideOptions =
|
|
295
|
+
config.litePluginSettings[PYODIDE_KERNEL].loadPyodideOptions || {};
|
|
296
|
+
config.litePluginSettings[PYODIDE_KERNEL].loadPyodideOptions.env = {
|
|
297
|
+
__gxy__: JSON.stringify(searchParams),
|
|
298
|
+
};
|
|
299
|
+
config.settingsOverrides = {};
|
|
300
|
+
config.settingsOverrides[AI_SETTINGS] = {
|
|
301
|
+
defaultProvider: "jnaut",
|
|
302
|
+
useSameProviderForChatAndCompleter: false,
|
|
303
|
+
providers: [
|
|
304
|
+
{
|
|
305
|
+
id: "jnaut",
|
|
306
|
+
name: "jnaut",
|
|
307
|
+
provider: "generic",
|
|
308
|
+
model: "jnaut",
|
|
309
|
+
baseURL: galaxyApiBase,
|
|
310
|
+
parameters: {
|
|
311
|
+
maxTokens: 4096,
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
],
|
|
315
|
+
};
|
|
273
316
|
|
|
274
317
|
//__GXY__INJECTION__
|
|
275
318
|
if (config.baseUrl === new URL(here()).pathname) {
|