@galaxyproject/olit 0.0.0

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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +188 -0
  3. package/package.json +61 -0
  4. package/static/InterVariable-Italic.woff2 +0 -0
  5. package/static/InterVariable.woff2 +0 -0
  6. package/static/JetBrainsMono-Bold.woff2 +0 -0
  7. package/static/JetBrainsMono-BoldItalic.woff2 +0 -0
  8. package/static/JetBrainsMono-Italic.woff2 +0 -0
  9. package/static/JetBrainsMono-Regular.woff2 +0 -0
  10. package/static/index.css +1 -0
  11. package/static/index.html +13 -0
  12. package/static/index.js +4024 -0
  13. package/static/logo.svg +31 -0
  14. package/static/olit.xml +98 -0
  15. package/static/pyodide/README.md +62 -0
  16. package/static/pyodide/annotated_types-0.7.0-py3-none-any.whl +0 -0
  17. package/static/pyodide/attrs-25.2.0-py3-none-any.whl +0 -0
  18. package/static/pyodide/console-v2.html +393 -0
  19. package/static/pyodide/console.html +305 -0
  20. package/static/pyodide/ffi.d.ts +1130 -0
  21. package/static/pyodide/galaxy-charts-e7348f1e5617.js +38078 -0
  22. package/static/pyodide/galaxy-ops-6b6069501426.js +9476 -0
  23. package/static/pyodide/jsonschema-4.23.0-py3-none-any.whl +0 -0
  24. package/static/pyodide/jsonschema_specifications-2024.10.1-py3-none-any.whl +0 -0
  25. package/static/pyodide/llm-fetch.js +16 -0
  26. package/static/pyodide/micropip-0.11.1-py3-none-any.whl +0 -0
  27. package/static/pyodide/numpy-2.2.5-cp313-cp313-pyemscripten_2025_0_wasm32.whl +0 -0
  28. package/static/pyodide/olit-0.0.0-07b000ed515e9-py3-none-any.whl +0 -0
  29. package/static/pyodide/package.json +126 -0
  30. package/static/pyodide/pandas-2.3.3-cp313-cp313-pyemscripten_2025_0_wasm32.whl +0 -0
  31. package/static/pyodide/pydantic-2.12.5-py3-none-any.whl +0 -0
  32. package/static/pyodide/pydantic_core-2.41.5-cp313-cp313-pyemscripten_2025_0_wasm32.whl +0 -0
  33. package/static/pyodide/pyodide-lock.json +1 -0
  34. package/static/pyodide/pyodide-worker.js +120 -0
  35. package/static/pyodide/pyodide.asm.js +15 -0
  36. package/static/pyodide/pyodide.asm.wasm +0 -0
  37. package/static/pyodide/pyodide.d.ts +1699 -0
  38. package/static/pyodide/pyodide.js +6 -0
  39. package/static/pyodide/pyodide.js.map +7 -0
  40. package/static/pyodide/pyodide.mjs +4 -0
  41. package/static/pyodide/pyodide.mjs.map +7 -0
  42. package/static/pyodide/pyrsistent-0.20.0-cp313-cp313-pyemscripten_2025_0_wasm32.whl +0 -0
  43. package/static/pyodide/python_dateutil-2.9.0.post0-py2.py3-none-any.whl +0 -0
  44. package/static/pyodide/python_stdlib.zip +0 -0
  45. package/static/pyodide/pytz-2025.2-py2.py3-none-any.whl +0 -0
  46. package/static/pyodide/pyyaml-6.0.2-cp313-cp313-pyemscripten_2025_0_wasm32.whl +0 -0
  47. package/static/pyodide/referencing-0.36.2-py3-none-any.whl +0 -0
  48. package/static/pyodide/rpds_py-0.30.0-cp313-cp313-pyemscripten_2025_0_wasm32.whl +0 -0
  49. package/static/pyodide/six-1.17.0-py2.py3-none-any.whl +0 -0
  50. package/static/pyodide/typing_extensions-4.15.0-py3-none-any.whl +0 -0
  51. package/static/pyodide/typing_inspection-0.4.2-py3-none-any.whl +0 -0
@@ -0,0 +1,305 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta
6
+ http-equiv="origin-trial"
7
+ content="Aq6vv/4syIkcyMszFgCc9LlH0kX88jdE7SXfCFnh2RQN0nhhL8o6PCQ2oE3a7n3mC7+d9n89Repw5HYBtjarDw4AAAB3eyJvcmlnaW4iOiJodHRwczovL3B5b2RpZGUub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJBc3NlbWJseUpTUHJvbWlzZUludGVncmF0aW9uIiwiZXhwaXJ5IjoxNzMwMjQ2Mzk5LCJpc1N1YmRvbWFpbiI6dHJ1ZX0="
8
+ />
9
+ <meta
10
+ http-equiv="origin-trial"
11
+ content="Ai8IXb0XqedlM/Q2guWXFfBkKiYY9uaPZpdjHqc8y0ZvpAfK9SKzp/dIuFH+txG/HEKxt59uIkk39hhWrhNgbw4AAABieyJvcmlnaW4iOiJodHRwOi8vbG9jYWxob3N0OjgwMDAiLCJmZWF0dXJlIjoiV2ViQXNzZW1ibHlKU1Byb21pc2VJbnRlZ3JhdGlvbiIsImV4cGlyeSI6MTczMDI0NjM5OX0="
12
+ />
13
+ <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1"></script>
14
+ <script src="https://cdn.jsdelivr.net/npm/jquery.terminal@2.35.2/js/jquery.terminal.min.js"></script>
15
+ <script src="https://cdn.jsdelivr.net/npm/jquery.terminal@2.35.2/js/unix_formatting.min.js"></script>
16
+ <link
17
+ href="https://cdn.jsdelivr.net/npm/jquery.terminal@2.35.2/css/jquery.terminal.min.css"
18
+ rel="stylesheet"
19
+ />
20
+ <link
21
+ href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🐍</text></svg>"
22
+ rel="icon"
23
+ />
24
+ <style>
25
+ .terminal {
26
+ --size: 1.5;
27
+ --color: rgba(255, 255, 255, 0.8);
28
+ }
29
+ .noblink {
30
+ --animation: terminal-none;
31
+ }
32
+ body {
33
+ background-color: black;
34
+ }
35
+ #jquery-terminal-logo {
36
+ color: white;
37
+ border-color: white;
38
+ position: absolute;
39
+ top: 7px;
40
+ right: 18px;
41
+ z-index: 2;
42
+ }
43
+ #jquery-terminal-logo a {
44
+ color: gray;
45
+ text-decoration: none;
46
+ font-size: 0.7em;
47
+ }
48
+ #loading {
49
+ display: inline-block;
50
+ width: 50px;
51
+ height: 50px;
52
+ position: fixed;
53
+ top: 50%;
54
+ left: 50%;
55
+ border: 3px solid rgba(172, 237, 255, 0.5);
56
+ border-radius: 50%;
57
+ border-top-color: #fff;
58
+ animation: spin 1s ease-in-out infinite;
59
+ -webkit-animation: spin 1s ease-in-out infinite;
60
+ }
61
+
62
+ @keyframes spin {
63
+ to {
64
+ -webkit-transform: rotate(360deg);
65
+ }
66
+ }
67
+ @-webkit-keyframes spin {
68
+ to {
69
+ -webkit-transform: rotate(360deg);
70
+ }
71
+ }
72
+ </style>
73
+ </head>
74
+ <body>
75
+ <div id="jquery-terminal-logo">
76
+ <a href="https://terminal.jcubic.pl/">jQuery Terminal</a>
77
+ </div>
78
+ <div id="loading"></div>
79
+ <script>
80
+ "use strict";
81
+
82
+ function sleep(s) {
83
+ return new Promise((resolve) => setTimeout(resolve, s));
84
+ }
85
+
86
+ async function main() {
87
+ let indexURL = "./";
88
+ const urlParams = new URLSearchParams(window.location.search);
89
+ const buildParam = urlParams.get("build");
90
+ if (buildParam) {
91
+ if (["full", "debug", "pyc"].includes(buildParam)) {
92
+ indexURL = indexURL.replace(
93
+ "/full/",
94
+ "/" + urlParams.get("build") + "/",
95
+ );
96
+ } else {
97
+ console.warn(
98
+ 'Invalid URL parameter: build="' +
99
+ buildParam +
100
+ '". Using default "full".',
101
+ );
102
+ }
103
+ }
104
+ const { loadPyodide } = await import(indexURL + "pyodide.mjs");
105
+ // to facilitate debugging
106
+ globalThis.loadPyodide = loadPyodide;
107
+
108
+ let term;
109
+ globalThis.pyodide = await loadPyodide({
110
+ stdin: () => {
111
+ let result = prompt();
112
+ echo(result);
113
+ return result;
114
+ },
115
+ });
116
+ let { repr_shorten, BANNER, PyodideConsole } =
117
+ pyodide.pyimport("pyodide.console");
118
+ BANNER =
119
+ `Welcome to the Pyodide ${pyodide.version} terminal emulator 🐍\n` +
120
+ BANNER;
121
+ const pyconsole = PyodideConsole(pyodide.globals);
122
+
123
+ const namespace = pyodide.globals.get("dict")();
124
+ const await_fut = pyodide.runPython(
125
+ `
126
+ import builtins
127
+ from pyodide.ffi import to_js
128
+
129
+ async def await_fut(fut):
130
+ res = await fut
131
+ if res is not None:
132
+ builtins._ = res
133
+ return to_js([res], depth=1)
134
+
135
+ await_fut
136
+ `,
137
+ { globals: namespace },
138
+ );
139
+ namespace.destroy();
140
+
141
+ const echo = (msg, ...opts) =>
142
+ term.echo(
143
+ msg
144
+ .replaceAll("]]", "&rsqb;&rsqb;")
145
+ .replaceAll("[[", "&lsqb;&lsqb;"),
146
+ ...opts,
147
+ );
148
+
149
+ const ps1 = ">>> ";
150
+ const ps2 = "... ";
151
+
152
+ async function lock() {
153
+ let resolve;
154
+ const ready = term.ready;
155
+ term.ready = new Promise((res) => (resolve = res));
156
+ await ready;
157
+ return resolve;
158
+ }
159
+
160
+ async function interpreter(command) {
161
+ const unlock = await lock();
162
+ term.pause();
163
+ // multiline should be split (useful when pasting)
164
+ for (const c of command.split("\n")) {
165
+ const escaped = c.replaceAll(/\u00a0/g, " ");
166
+ const fut = pyconsole.push(escaped);
167
+ term.set_prompt(fut.syntax_check === "incomplete" ? ps2 : ps1);
168
+ switch (fut.syntax_check) {
169
+ case "syntax-error":
170
+ term.error(fut.formatted_error.trimEnd());
171
+ continue;
172
+ case "incomplete":
173
+ continue;
174
+ case "complete":
175
+ break;
176
+ default:
177
+ throw new Error(`Unexpected type ${ty}`);
178
+ }
179
+ // In JavaScript, await automatically also awaits any results of
180
+ // awaits, so if an async function returns a future, it will await
181
+ // the inner future too. This is not what we want so we
182
+ // temporarily put it into a list to protect it.
183
+ const wrapped = await_fut(fut);
184
+ // complete case, get result / error and print it.
185
+ try {
186
+ const [value] = await wrapped;
187
+ if (value !== undefined) {
188
+ echo(
189
+ repr_shorten.callKwargs(value, {
190
+ separator: "\n<long output truncated>\n",
191
+ }),
192
+ );
193
+ }
194
+ if (value instanceof pyodide.ffi.PyProxy) {
195
+ value.destroy();
196
+ }
197
+ } catch (e) {
198
+ if (e.constructor.name === "PythonError") {
199
+ const message = fut.formatted_error || e.message;
200
+ term.error(message.trimEnd());
201
+ } else {
202
+ throw e;
203
+ }
204
+ } finally {
205
+ fut.destroy();
206
+ wrapped.destroy();
207
+ }
208
+ }
209
+ term.resume();
210
+ await sleep(10);
211
+ unlock();
212
+ }
213
+
214
+ term = $("body").terminal(interpreter, {
215
+ greetings: BANNER,
216
+ prompt: ps1,
217
+ completionEscape: false,
218
+ completion: function (command, callback) {
219
+ callback(pyconsole.complete(command).toJs()[0]);
220
+ },
221
+ keymap: {
222
+ "CTRL+C": async function (event, original) {
223
+ pyconsole.buffer.clear();
224
+ term.enter();
225
+ echo("KeyboardInterrupt");
226
+ term.set_command("");
227
+ term.set_prompt(ps1);
228
+ },
229
+ TAB: (event, original) => {
230
+ const command = term.before_cursor();
231
+ // Disable completion for whitespaces.
232
+ if (command.trim() === "") {
233
+ term.insert("\t");
234
+ return false;
235
+ }
236
+ return original(event);
237
+ },
238
+ },
239
+ });
240
+ window.term = term;
241
+ pyconsole.stdout_callback = (s) => echo(s, { newline: false });
242
+ pyconsole.stderr_callback = (s) => {
243
+ term.error(s.trimEnd());
244
+ };
245
+ term.ready = Promise.resolve();
246
+ pyodide._api.on_fatal = async (e) => {
247
+ if (e.name === "Exit") {
248
+ term.error(e);
249
+ term.error("Pyodide exited and can no longer be used.");
250
+ } else {
251
+ term.error(
252
+ "Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.",
253
+ );
254
+ term.error("The cause of the fatal error was:");
255
+ term.error(e);
256
+ term.error("Look in the browser console for more details.");
257
+ }
258
+ await term.ready;
259
+ term.pause();
260
+ await sleep(15);
261
+ term.pause();
262
+ };
263
+
264
+ const searchParams = new URLSearchParams(window.location.search);
265
+ if (searchParams.has("noblink")) {
266
+ $(".cmd-cursor").addClass("noblink");
267
+ }
268
+
269
+ let idbkvPromise;
270
+ async function getIDBKV() {
271
+ if (!idbkvPromise) {
272
+ idbkvPromise = await import(
273
+ "https://unpkg.com/idb-keyval@5.0.2/dist/esm/index.js"
274
+ );
275
+ }
276
+ return idbkvPromise;
277
+ }
278
+
279
+ async function mountDirectory(pyodideDirectory, directoryKey) {
280
+ if (pyodide.FS.analyzePath(pyodideDirectory).exists) {
281
+ return;
282
+ }
283
+ const { get, set } = await getIDBKV();
284
+ const opts = {
285
+ id: "mountdirid",
286
+ mode: "readwrite",
287
+ };
288
+ let directoryHandle = await get(directoryKey);
289
+ if (!directoryHandle) {
290
+ directoryHandle = await showDirectoryPicker(opts);
291
+ await set(directoryKey, directoryHandle);
292
+ }
293
+ const permissionStatus =
294
+ await directoryHandle.requestPermission(opts);
295
+ if (permissionStatus !== "granted") {
296
+ throw new Error("readwrite access to directory not granted");
297
+ }
298
+ await pyodide.mountNativeFS(pyodideDirectory, directoryHandle);
299
+ }
300
+ globalThis.mountDirectory = mountDirectory;
301
+ }
302
+ window.console_ready = main();
303
+ </script>
304
+ </body>
305
+ </html>