@innovatorved/code-lab 0.7.1 → 0.7.2

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 (71) hide show
  1. package/ARCHITECTURE.md +2 -2
  2. package/CHANGELOG.md +10 -0
  3. package/README.md +5 -5
  4. package/dist/code-lab-sql.esm.js +2 -2
  5. package/dist/code-lab-sql.umd.js +3 -3
  6. package/dist/code-lab.css +1 -1
  7. package/dist/code-lab.d.ts +47 -38
  8. package/dist/code-lab.esm.js +918 -884
  9. package/dist/code-lab.js +917 -881
  10. package/dist/extensions/cpp.esm.js +33 -33
  11. package/dist/extensions/cpp.js +33 -33
  12. package/dist/extensions/python.esm.js +79 -49
  13. package/dist/extensions/python.js +79 -49
  14. package/dist/index.d.ts +1 -1
  15. package/dist/logger.d.ts +4 -20
  16. package/dist/modular-kernel.d.ts +0 -1
  17. package/dist/packages/core/src/errors.d.ts +5 -1
  18. package/dist/packages/fs/src/backends.d.ts +0 -27
  19. package/dist/packages/fs/src/index.d.ts +1 -1
  20. package/dist/packages/ui/src/html.d.ts +1 -0
  21. package/dist/packages/ui/src/index.d.ts +1 -0
  22. package/dist/{apps/web/src/index.d.ts → packages/ui/src/kernel.d.ts} +3 -2
  23. package/dist/packages/ui/src/observability.d.ts +1 -1
  24. package/dist/packages/ui/src/settings-dialog.d.ts +0 -1
  25. package/dist/preview-sw.js +1 -1
  26. package/dist/runtime.d.ts +3 -0
  27. package/dist/runtime.esm.js +2 -2
  28. package/dist/runtime.js +2 -2
  29. package/dist/schemas.d.ts +1 -1
  30. package/dist/shell.esm.js +277 -285
  31. package/dist/shell.js +277 -285
  32. package/dist/terminal.esm.js +2 -2
  33. package/dist/terminal.js +2 -2
  34. package/dist/workbench/editor.d.ts +0 -4
  35. package/dist/workbench/index.d.ts +0 -2
  36. package/dist/workbench/intellisense.d.ts +0 -1
  37. package/dist/workbench/xterm-adapter.d.ts +0 -1
  38. package/package.json +2 -4
  39. package/src/code-lab.css +0 -8086
  40. package/src/csp.ts +0 -590
  41. package/src/diagnostics.ts +0 -287
  42. package/src/extensions/cpp.ts +0 -2371
  43. package/src/extensions/guided-lab.ts +0 -68
  44. package/src/extensions/javascript.ts +0 -54
  45. package/src/extensions/python.ts +0 -1743
  46. package/src/extensions/typescript.ts +0 -85
  47. package/src/extensions/umbrella.ts +0 -5
  48. package/src/html.ts +0 -88
  49. package/src/index.ts +0 -129
  50. package/src/logger.ts +0 -139
  51. package/src/modular-kernel.ts +0 -7
  52. package/src/preview-sw.js +0 -296
  53. package/src/runtime/test-harness.ts +0 -57
  54. package/src/runtime.ts +0 -10565
  55. package/src/sample.html +0 -304
  56. package/src/schemas.ts +0 -366
  57. package/src/scm.ts +0 -2453
  58. package/src/search.ts +0 -433
  59. package/src/shell.ts +0 -10990
  60. package/src/storage.ts +0 -773
  61. package/src/terminal.ts +0 -1402
  62. package/src/workbench/command-palette.ts +0 -101
  63. package/src/workbench/diff-editor.ts +0 -472
  64. package/src/workbench/editor.ts +0 -49
  65. package/src/workbench/icons.ts +0 -255
  66. package/src/workbench/index.ts +0 -29
  67. package/src/workbench/intellisense.ts +0 -1884
  68. package/src/workbench/share.ts +0 -128
  69. package/src/workbench/xterm-adapter.ts +0 -1571
  70. package/src/workbench.ts +0 -21825
  71. package/src/zip.ts +0 -348
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @innovatorved/code-lab v0.7.0
2
+ * @innovatorved/code-lab v0.7.2
3
3
  * Browser-native IDE, POSIX Shell, Web Worker Node.js/Bun Runtime, WASI C++20 Toolchain, Python 3.12 WebAssembly, and Git Engine.
4
4
  */
5
5
  export * from './schemas';
package/dist/logger.d.ts CHANGED
@@ -3,7 +3,11 @@
3
3
  * ============================================================================
4
4
  * Bundled as `CodeLabLogger` into the runtime, shell, terminal, and workbench
5
5
  * bundles so no subsystem needs empty `catch` blocks or ad-hoc console calls.
6
+ * Re-exports the single unified `CodeLabError` and `isCodeLabError` from
7
+ * `@code-lab/core`.
6
8
  */
9
+ import { CodeLabError, isCodeLabError, type CodeLabErrorCode, type CodeLabErrorOptions } from './packages/core/src/errors';
10
+ export { CodeLabError, isCodeLabError, type CodeLabErrorCode, type CodeLabErrorOptions };
7
11
  export declare const LOG_PREFIX = "[code-lab]";
8
12
  export type CodeLabLogLevel = 'debug' | 'info' | 'warn' | 'error';
9
13
  export interface CodeLabLogSink {
@@ -23,26 +27,6 @@ export interface CodeLabLogger {
23
27
  warn: (...args: unknown[]) => void;
24
28
  error: (...args: unknown[]) => void;
25
29
  }
26
- export type CodeLabErrorCode = 'E_SAVE' | 'E_PERSISTENCE' | 'E_INSTALL' | 'E_PREVIEW' | 'E_RUNTIME' | 'E_SHELL' | 'E_CLONE' | 'E_CONFIG';
27
- export interface CodeLabErrorOptions {
28
- cause?: unknown;
29
- recoverable?: boolean;
30
- details?: Record<string, unknown>;
31
- context?: Record<string, unknown>;
32
- }
33
- /**
34
- * Structured error surfaced through `wb.on('error', ...)` and `wb.on('save-state', ...)`.
35
- */
36
- export declare class CodeLabError extends Error {
37
- readonly code: CodeLabErrorCode;
38
- readonly options: CodeLabErrorOptions;
39
- readonly cause?: unknown;
40
- readonly recoverable: boolean;
41
- readonly details?: Record<string, unknown>;
42
- readonly context?: Record<string, unknown>;
43
- constructor(code: CodeLabErrorCode, message: string, options?: CodeLabErrorOptions);
44
- }
45
- export declare function isCodeLabError(value: unknown): value is CodeLabError;
46
30
  /**
47
31
  * Small leveled logger. Hosts can pass `options.logger` to route diagnostics
48
32
  * into their own telemetry; `options.debug` enables verbose output. Errors and
@@ -4,4 +4,3 @@ export * from './packages/settings/src/index';
4
4
  export * from './packages/commands/src/index';
5
5
  export * from './packages/sql/src/index';
6
6
  export * from './packages/ui/src/index';
7
- export * from './apps/web/src/index';
@@ -2,15 +2,19 @@
2
2
  * @code-lab/core — Typed error hierarchy & central ring-buffered Logger.
3
3
  */
4
4
  import { type Event, Emitter } from './events';
5
- export type CodeLabErrorCode = 'ERR_INVALID_ARGUMENT' | 'ERR_DISPOSED' | 'ERR_DI_MISSING' | 'ERR_DI_CYCLE' | 'ERR_FS_NOT_FOUND' | 'ERR_FS_EXISTS' | 'ERR_FS_IS_DIR' | 'ERR_FS_NOT_DIR' | 'ERR_FS_QUOTA' | 'ERR_CONFIG_PARSE' | 'ERR_CONFIG_SCHEMA' | 'ERR_COMMAND_NOT_FOUND' | 'ERR_RUNTIME_TIMEOUT' | 'ERR_RUNTIME_CRASH' | 'ERR_PLUGIN_INVALID' | 'ERR_SECURITY_POLICY';
5
+ export type CodeLabErrorCode = 'ERR_INVALID_ARGUMENT' | 'ERR_DISPOSED' | 'ERR_DI_MISSING' | 'ERR_DI_CYCLE' | 'ERR_FS_NOT_FOUND' | 'ERR_FS_EXISTS' | 'ERR_FS_IS_DIR' | 'ERR_FS_NOT_DIR' | 'ERR_FS_QUOTA' | 'ERR_CONFIG_PARSE' | 'ERR_CONFIG_SCHEMA' | 'ERR_COMMAND_NOT_FOUND' | 'ERR_RUNTIME_TIMEOUT' | 'ERR_RUNTIME_CRASH' | 'ERR_PLUGIN_INVALID' | 'ERR_SECURITY_POLICY' | 'E_SAVE' | 'E_PERSISTENCE' | 'E_INSTALL' | 'E_PREVIEW' | 'E_RUNTIME' | 'E_SHELL' | 'E_CLONE' | 'E_CONFIG';
6
6
  export interface CodeLabErrorOptions {
7
7
  readonly cause?: unknown;
8
8
  readonly context?: Readonly<Record<string, unknown>>;
9
+ readonly details?: Readonly<Record<string, unknown>>;
9
10
  readonly recoverable?: boolean;
10
11
  }
11
12
  export declare class CodeLabError extends Error {
12
13
  readonly code: CodeLabErrorCode;
14
+ readonly options: CodeLabErrorOptions;
15
+ readonly cause?: unknown;
13
16
  readonly context: Readonly<Record<string, unknown>>;
17
+ readonly details?: Readonly<Record<string, unknown>>;
14
18
  readonly recoverable: boolean;
15
19
  constructor(code: CodeLabErrorCode, message: string, options?: CodeLabErrorOptions);
16
20
  }
@@ -8,30 +8,3 @@ export declare class MemoryBackend implements IFsBackend {
8
8
  deleteEntry(path: string): Promise<void>;
9
9
  clear(): Promise<void>;
10
10
  }
11
- export declare class IndexedDbBackend implements IFsBackend {
12
- readonly name: "indexeddb";
13
- private readonly dbName;
14
- private readonly storeName;
15
- private readonly fallback;
16
- constructor(namespace?: string);
17
- private openDb;
18
- loadAll(): Promise<Map<string, Uint8Array>>;
19
- writeEntry(path: string, bytes: Uint8Array): Promise<void>;
20
- deleteEntry(path: string): Promise<void>;
21
- clear(): Promise<void>;
22
- }
23
- export declare class OpfsBackend implements IFsBackend {
24
- readonly name: "opfs";
25
- lastError: unknown;
26
- private readonly rootDirName;
27
- private readonly fallback;
28
- private readonly onError?;
29
- constructor(namespace?: string, options?: {
30
- onError?: (err: unknown) => void;
31
- });
32
- private getNamespaceRoot;
33
- loadAll(): Promise<Map<string, Uint8Array>>;
34
- writeEntry(path: string, bytes: Uint8Array): Promise<void>;
35
- deleteEntry(path: string): Promise<void>;
36
- clear(): Promise<void>;
37
- }
@@ -1,3 +1,3 @@
1
1
  export { type FsEntryKind, type FsStat, type FsChangeEvent, type IFsBackend, type IFileSystemService, IFileSystemServiceId } from './types';
2
- export { MemoryBackend, IndexedDbBackend, OpfsBackend } from './backends';
2
+ export { MemoryBackend } from './backends';
3
3
  export { FileSystemService } from './vfs-service';
@@ -0,0 +1 @@
1
+ export declare function escapeHtml(raw: string): string;
@@ -2,3 +2,4 @@ export { type ThemeKind, type ThemeDefinition, type IThemeService, DARK_THEME, L
2
2
  export { type PanelContribution, type LanguageContribution, type PluginContributions, type PluginActivationContext, type CodeLabPluginManifest, type RegisteredPluginInfo, type IPluginRegistry, IPluginRegistryId, PluginRegistry } from './plugin-registry';
3
3
  export { type SettingsScope, type SettingsInlineMountOptions, type SettingsOpenOptions, type SettingsDialogOptions, SettingsDialogController } from './settings-dialog';
4
4
  export { type ObservabilitySnapshotInput, scoreFuzzyFileMatch, rankWorkspaceFiles, renderObservabilityPanelHtml, WorkbenchErrorBoundary } from './observability';
5
+ export { type CodeLabKernelOptions, type CodeLabKernel, createCodeLabKernel } from './kernel';
@@ -2,10 +2,11 @@ import { type ICommandRegistry, type IContextKeyService, type IKeybindingService
2
2
  import { ServiceContainer, type EventTraceRecord, type IDisposable, type ILogger } from '@code-lab/core';
3
3
  import { type IFsBackend, type IFileSystemService } from '@code-lab/fs';
4
4
  import { type IConfigurationService } from '@code-lab/settings';
5
- import { type IPluginRegistry, type IThemeService } from '@code-lab/ui';
5
+ import { type IPluginRegistry } from './plugin-registry';
6
+ import { type IThemeService } from './themes';
6
7
  export interface CodeLabKernelOptions {
7
8
  readonly instanceId?: string;
8
- readonly fsBackend?: 'memory' | 'indexeddb' | 'opfs' | IFsBackend;
9
+ readonly fsBackend?: 'memory' | IFsBackend;
9
10
  readonly initialFiles?: Readonly<Record<string, string>>;
10
11
  readonly logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'silent';
11
12
  }
@@ -1,4 +1,4 @@
1
- import type { EventTraceRecord, ILogger, IServiceContainer } from '@code-lab/core';
1
+ import { type EventTraceRecord, type ILogger, type IServiceContainer } from '@code-lab/core';
2
2
  import type { IConfigurationService } from '@code-lab/settings';
3
3
  import type { IPluginRegistry } from './plugin-registry';
4
4
  export declare function scoreFuzzyFileMatch(candidatePath: string, query: string): number;
@@ -14,7 +14,6 @@ export interface SettingsDialogOptions {
14
14
  readonly onOpenSettingsJson?: () => void;
15
15
  readonly onOpenJson?: () => void;
16
16
  readonly onExportSettings?: (json: string) => void;
17
- readonly onImportSettings?: () => void;
18
17
  readonly onWorkspaceSettingsMutated?: (nextWorkspaceSettings: Record<string, unknown>) => void;
19
18
  }
20
19
  export declare const SETTINGS_COMPONENT_CSS = "/* @innovatorved/code-lab/ui \u2014 Tokenized Settings & Control Components */\n.cl-settings-dialog,\n.cl-settings-editor {\n --cl-ui-sans: var(--cl-font-sans, var(--ds-font-sans, var(--font-sans, \"Geist\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif)));\n --cl-ui-mono: var(--cl-font-mono, var(--ds-font-mono, var(--font-mono, \"Geist Mono\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Monaco, Consolas, monospace)));\n --cl-ui-text-2xs: var(--cl-text-2xs, var(--ds-text-2xs, 0.6875rem));\n --cl-ui-text-xs: var(--cl-text-xs, var(--ds-text-xs, 0.75rem));\n --cl-ui-text-sm: var(--cl-text-sm, var(--ds-text-sm, 0.8125rem));\n --cl-ui-text-base: var(--cl-text-base, var(--ds-text-base, 0.875rem));\n font-family: var(--cl-ui-sans);\n color: var(--cl-fg, #f4f4f5);\n}\n\n.cl-settings-editor.cl-settings-inline {\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 0;\n background: var(--cl-editor-bg, var(--cl-bg, #0f0f10));\n}\n\n.cl-settings-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 12px 20px;\n border-bottom: 1px solid var(--cl-border, #27272a);\n background: var(--cl-surface, var(--cl-bg-elevated, #141415));\n flex-wrap: wrap;\n}\n\n.cl-settings-title {\n margin: 0;\n font-size: var(--cl-ui-text-base);\n font-weight: 600;\n letter-spacing: -0.015em;\n color: var(--cl-fg-active, var(--cl-fg, #f4f4f5));\n}\n\n.cl-settings-actions {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n}\n\n.cl-settings-toolbar {\n padding: 12px 20px 0 20px;\n border-bottom: 1px solid var(--cl-border, #27272a);\n background: var(--cl-surface, var(--cl-bg-elevated, #141415));\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.cl-settings-search {\n width: 100%;\n height: 32px;\n padding: 0 10px;\n border-radius: var(--cl-radius-md, 6px);\n border: 1px solid var(--cl-input-border, var(--cl-border, #27272a));\n background: var(--cl-input-bg, var(--cl-bg, #0f0f10));\n color: var(--cl-fg, #f4f4f5);\n font-family: var(--cl-ui-sans);\n font-size: var(--cl-ui-text-sm);\n outline: none;\n transition: border-color 120ms ease;\n}\n\n.cl-settings-search::placeholder {\n color: var(--cl-fg-faint, var(--cl-fg-muted, #8e8e97));\n}\n\n.cl-settings-search:focus {\n border-color: var(--cl-focus-border, #a1a1aa);\n}\n\n.cl-settings-scopes {\n display: flex;\n align-items: center;\n gap: 4px;\n overflow-x: auto;\n}\n\n.cl-settings-scope-tab {\n flex: none;\n padding: 6px 12px;\n border: none;\n border-bottom: 2px solid transparent;\n background: transparent;\n color: var(--cl-fg-muted, #a1a1aa);\n font-family: var(--cl-ui-sans);\n font-size: var(--cl-ui-text-xs);\n font-weight: 500;\n cursor: pointer;\n transition: color 120ms ease, border-color 120ms ease;\n}\n\n.cl-settings-scope-tab:hover {\n color: var(--cl-fg, #f4f4f5);\n}\n\n.cl-settings-scope-tab[aria-selected=\"true\"] {\n color: var(--cl-fg-active, var(--cl-fg, #f4f4f5));\n font-weight: 600;\n border-bottom-color: var(--cl-accent, #f4f4f5);\n}\n\n.cl-settings-body {\n display: grid;\n grid-template-columns: 180px minmax(0, 1fr);\n}\n\n.cl-settings-body--dialog {\n min-height: 320px;\n max-height: 62vh;\n}\n\n.cl-settings-body--inline {\n flex: 1;\n min-height: 0;\n overflow: hidden;\n}\n\n.cl-settings-categories {\n border-right: 1px solid var(--cl-border, #27272a);\n background: var(--cl-surface, var(--cl-bg-elevated, #141415));\n padding: 10px 8px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n overflow-y: auto;\n}\n\n.cl-settings-cat-btn {\n text-align: left;\n padding: 6px 10px;\n border: 1px solid transparent;\n border-radius: var(--cl-radius-md, 6px);\n background: transparent;\n color: var(--cl-fg-muted, #a1a1aa);\n font-family: var(--cl-ui-sans);\n font-size: var(--cl-ui-text-sm);\n font-weight: 500;\n line-height: 1.35;\n cursor: pointer;\n transition: background 120ms ease, color 120ms ease;\n}\n\n.cl-settings-cat-btn:hover {\n background: var(--cl-list-hover, var(--cl-bg-hover, #1f1f22));\n color: var(--cl-fg, #f4f4f5);\n}\n\n.cl-settings-cat-btn[aria-current=\"true\"] {\n background: var(--cl-list-active, var(--cl-bg-active, #28282b));\n color: var(--cl-list-active-fg, var(--cl-fg, #f4f4f5));\n font-weight: 600;\n}\n\n.cl-settings-list {\n padding: 14px 24px 28px 20px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.cl-settings-empty {\n padding: 16px 4px;\n color: var(--cl-fg-muted, #a1a1aa);\n font-size: var(--cl-ui-text-sm);\n}\n\n.cl-setting-item {\n padding: 14px 16px;\n border: 1px solid var(--cl-border, #27272a);\n border-radius: var(--cl-radius-lg, 8px);\n background: var(--cl-widget-bg, var(--cl-bg-panel, #18181a));\n display: flex;\n flex-direction: column;\n gap: 6px;\n transition: border-color 120ms ease;\n}\n\n.cl-setting-item--modified {\n border-color: var(--cl-border-strong, #3a3a3e);\n}\n\n.cl-setting-item__top {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n flex-wrap: wrap;\n}\n\n.cl-setting-item__heading {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n min-width: 0;\n}\n\n.cl-setting-item__cat {\n font-size: var(--cl-ui-text-xs);\n color: var(--cl-fg-muted, #a1a1aa);\n font-weight: 500;\n}\n\n.cl-setting-item__title {\n font-size: var(--cl-ui-text-sm);\n font-weight: 600;\n color: var(--cl-fg-active, var(--cl-fg, #f4f4f5));\n}\n\n.cl-setting-item__key {\n font-family: var(--cl-ui-mono);\n font-size: var(--cl-ui-text-2xs);\n padding: 1px 5px;\n border-radius: var(--cl-radius-sm, 4px);\n border: 1px solid var(--cl-border, #27272a);\n background: var(--cl-input-bg, var(--cl-bg, #0f0f10));\n color: var(--cl-fg-muted, #a1a1aa);\n}\n\n.cl-setting-badge {\n font-family: var(--cl-ui-mono);\n font-size: var(--cl-ui-text-2xs);\n font-weight: 600;\n padding: 1px 6px;\n border-radius: 999px;\n background: var(--cl-btn-primary-bg, var(--cl-accent, #f4f4f5));\n color: var(--cl-btn-primary-fg, var(--cl-accent-fg, #0f0f10));\n}\n\n.cl-setting-item__desc {\n font-size: var(--cl-ui-text-xs);\n line-height: 1.5;\n color: var(--cl-fg-muted, #a1a1aa);\n}\n\n.cl-setting-item__control {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-top: 2px;\n}\n\n.cl-ui-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: 28px;\n padding: 0 10px;\n border-radius: var(--cl-radius-md, 6px);\n border: 1px solid var(--cl-input-border, var(--cl-border, #27272a));\n background: var(--cl-input-bg, var(--cl-bg, #0f0f10));\n color: var(--cl-fg, #f4f4f5);\n font-family: var(--cl-ui-sans);\n font-size: var(--cl-ui-text-xs);\n font-weight: 500;\n line-height: 1;\n cursor: pointer;\n transition: background 120ms ease, border-color 120ms ease, color 120ms ease;\n}\n\n.cl-ui-btn:hover {\n background: var(--cl-list-hover, var(--cl-bg-hover, #1f1f22));\n border-color: var(--cl-border-strong, #3a3a3e);\n}\n\n.cl-ui-control {\n height: 30px;\n padding: 0 9px;\n border-radius: var(--cl-radius-md, 6px);\n border: 1px solid var(--cl-input-border, var(--cl-border, #27272a));\n background: var(--cl-input-bg, var(--cl-bg, #0f0f10));\n color: var(--cl-fg, #f4f4f5);\n font-family: var(--cl-ui-sans);\n font-size: var(--cl-ui-text-sm);\n outline: none;\n transition: border-color 120ms ease;\n}\n\n.cl-ui-control:focus {\n border-color: var(--cl-focus-border, #a1a1aa);\n}\n\n.cl-ui-control--num {\n width: 104px;\n font-family: var(--cl-ui-mono);\n font-variant-numeric: tabular-nums;\n}\n\n.cl-ui-control--array {\n width: min(280px, 100%);\n font-family: var(--cl-ui-mono);\n font-size: var(--cl-ui-text-xs);\n}\n\n.cl-ui-control--text {\n width: min(200px, 100%);\n}\n\n.cl-ui-checkbox {\n width: 16px;\n height: 16px;\n accent-color: var(--cl-accent, #f4f4f5);\n cursor: pointer;\n}\n\n@media (max-width: 640px) {\n .cl-settings-body {\n grid-template-columns: minmax(0, 1fr);\n }\n .cl-settings-categories {\n flex-direction: row;\n border-right: none;\n border-bottom: 1px solid var(--cl-border, #27272a);\n overflow-x: auto;\n }\n}\n";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ============================================================
3
- * @innovatorved/code-lab v0.7.1 — Standalone Browser Code IDE & Virtual Runtime
3
+ * @innovatorved/code-lab v0.7.2 — Standalone Browser Code IDE & Virtual Runtime
4
4
  * ============================================================
5
5
  * Features:
6
6
  * - Sandboxed Web Worker Execution Engine with Multi-Instance Isolation & Watchdog Timer
package/dist/runtime.d.ts CHANGED
@@ -27,9 +27,12 @@ export declare const executeWasiModule: (wasmBytesOrModule: Uint8Array | ArrayBu
27
27
  stdout: string;
28
28
  stderr: string;
29
29
  }>;
30
+ export declare const WasiExitSignal: any;
30
31
  export declare const executeInVirtualRuntime: (options?: any) => Promise<any>;
31
32
  declare const createWorkerRuntimeSourceExport: () => string;
32
33
  export { createWorkerRuntimeSourceExport as createWorkerRuntimeSource };
33
34
  export declare const cancelWorkerExecution: (reason?: string, instanceId?: string) => boolean;
35
+ export declare const destroyWorkerPool: () => void;
36
+ export declare const clearReplSession: (sessionId?: string) => void;
34
37
  export declare const executeInWorker: (options?: any) => Promise<any>;
35
38
  export default _runtimeApi;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ============================================================
3
- * @innovatorved/code-lab v0.7.1 — Standalone Browser Code IDE & Virtual Runtime
3
+ * @innovatorved/code-lab v0.7.2 — Standalone Browser Code IDE & Virtual Runtime
4
4
  * ============================================================
5
5
  * Features:
6
6
  * - Sandboxed Web Worker Execution Engine with Multi-Instance Isolation & Watchdog Timer
@@ -15,7 +15,7 @@
15
15
  * ============================================================
16
16
  */
17
17
  const _root = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : {};
18
- var CodeLabLogger=(()=>{var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var y=(o,n)=>{for(var a in n)s(o,a,{get:n[a],enumerable:!0})},v=(o,n,a,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of C(n))!x.call(o,e)&&e!==a&&s(o,e,{get:()=>n[e],enumerable:!(t=p(n,e))||t.enumerable});return o};var O=o=>v(s({},"__esModule",{value:!0}),o);var h={};y(h,{CodeLabError:()=>d,DEFAULT_LOGGER:()=>w,LOG_PREFIX:()=>c,createLogger:()=>g,default:()=>_,isCodeLabError:()=>f});var c="[code-lab]",d=class extends Error{code;options;cause;recoverable;details;context;constructor(n,a,t={}){super(a),this.name="CodeLabError",this.code=n,this.options=t,this.cause=t.cause,this.recoverable=t.recoverable!==!1;let e=t.details??t.context;e!==void 0&&(this.details=e,this.context=e),Object.setPrototypeOf(this,new.target.prototype)}};function f(o){return!!(o&&typeof o=="object"&&(o instanceof d||o.name==="CodeLabError"&&typeof o.code=="string"))}function g(o={}){let n=o.logger??null,a=o.debug===!0,t=o.prefix||c,e=(r,b)=>{if(r==="debug"&&!a)return;if(n&&typeof n[r]=="function"){let L=null;try{n[r](...b);return}catch(k){L=k}}let i=typeof console<"u"?console:null,l=i?i[r]:null;typeof l=="function"&&l.call(i,t,...b)};return{debug:(...r)=>e("debug",r),info:(...r)=>e("info",r),warn:(...r)=>e("warn",r),error:(...r)=>e("error",r)}}var w=g(),E={LOG_PREFIX:c,CodeLabError:d,isCodeLabError:f,createLogger:g,DEFAULT_LOGGER:w},u=typeof globalThis<"u"?globalThis:null;u&&!u.CodeLabLogger&&(u.CodeLabLogger=E);var _=E;return O(h);})();
18
+ var CodeLabLogger=(()=>{var d=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var k=(e,n)=>{for(var i in n)d(e,i,{get:n[i],enumerable:!0})},m=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of R(n))!w.call(e,o)&&o!==i&&d(e,o,{get:()=>n[o],enumerable:!(r=y(n,o))||r.enumerable});return e};var _=e=>m(d({},"__esModule",{value:!0}),e);var h={};k(h,{CodeLabError:()=>s,DEFAULT_LOGGER:()=>f,LOG_PREFIX:()=>a,createLogger:()=>c,default:()=>C,isCodeLabError:()=>g});var s=class extends Error{code;options;cause;context;details;recoverable;constructor(n,i,r={}){super(i,r.cause!==void 0?{cause:r.cause}:void 0),this.name="CodeLabError",this.code=n,this.options=r,this.cause=r.cause,this.recoverable=r.recoverable!==!1;let o=r.details??r.context;this.context=Object.freeze({...o??{}}),o!==void 0&&(this.details=this.context),Object.setPrototypeOf(this,new.target.prototype)}};function g(e){return e instanceof s||typeof e=="object"&&e!==null&&e.name==="CodeLabError"&&typeof e.code=="string"}var a="[code-lab]";function c(e={}){let n=e.logger??null,i=e.debug===!0,r=e.prefix||a,o=(t,L)=>{if(t==="debug"&&!i)return;if(n&&typeof n[t]=="function"){let b=null;try{n[t](...L);return}catch(v){b=v}}let l=typeof console<"u"?console:null,E=l?l[t]:null;typeof E=="function"&&E.call(l,r,...L)};return{debug:(...t)=>o("debug",t),info:(...t)=>o("info",t),warn:(...t)=>o("warn",t),error:(...t)=>o("error",t)}}var f=c(),p={LOG_PREFIX:a,CodeLabError:s,isCodeLabError:g,createLogger:c,DEFAULT_LOGGER:f},u=typeof globalThis<"u"?globalThis:null;u&&!u.CodeLabLogger&&(u.CodeLabLogger=p);var C=p;return _(h);})();
19
19
 
20
20
  (function () {
21
21
  "use strict";typeof globalThis<"u"&&typeof globalThis.Bun>"u"&&(globalThis.Bun={version:"1.1.20"});function __initVirtualRuntime(X){const D=X&&X.CodeLabLogger&&typeof X.CodeLabLogger.createLogger=="function"?X.CodeLabLogger.createLogger():{debug(){},info(){},warn(t,e){typeof console<"u"&&console.warn&&console.warn("[CodeLab]",t,e||"")},error(t,e){typeof console<"u"&&console.error&&console.error("[CodeLab]",t,e||"")}},he=typeof TextEncoder<"u"?new TextEncoder:null,ce=typeof TextDecoder<"u"?new TextDecoder("utf-8",{fatal:!1}):null;function se(t){if(t=String(t),he)return he.encode(t);const e=[];for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);if(s<128)e.push(s);else if(s<2048)e.push(192|s>>6,128|s&63);else if(s>=55296&&s<=56319&&r+1<t.length){const n=t.charCodeAt(r+1);n>=56320&&n<=57343?(s=65536+((s&1023)<<10|n&1023),e.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|s&63),r++):e.push(224|s>>12,128|s>>6&63,128|s&63)}else e.push(224|s>>12,128|s>>6&63,128|s&63)}return new Uint8Array(e)}function te(t){if(ce)return ce.decode(t);let e="",r=0;for(;r<t.length;){const s=t[r++];if(s<128)e+=String.fromCharCode(s);else if((s&224)===192){const n=t[r++]&63;e+=String.fromCharCode((s&31)<<6|n)}else if((s&240)===224){const n=t[r++]&63,i=t[r++]&63;e+=String.fromCharCode((s&15)<<12|n<<6|i)}else{const n=t[r++]&63,i=t[r++]&63,a=t[r++]&63,f=((s&7)<<18|n<<12|i<<6|a)-65536;e+=String.fromCharCode(55296+(f>>10),56320+(f&1023))}}return e}const ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ue=new Int16Array(256).fill(-1);for(let t=0;t<ne.length;t++)ue[ne.charCodeAt(t)]=t;ue[45]=62,ue[95]=63;function ge(t,e=!1){let r="";const s=t.length;for(let n=0;n<s;n+=3){const i=t[n],a=n+1<s?t[n+1]:0,f=n+2<s?t[n+2]:0,p=i<<16|a<<8|f;r+=ne[p>>18&63],r+=ne[p>>12&63],r+=n+1<s?ne[p>>6&63]:e?"":"=",r+=n+2<s?ne[p&63]:e?"":"="}return e&&(r=r.replace(/\+/g,"-").replace(/\//g,"_")),r}function xe(t){const e=[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);if(a===61)break;const f=a<256?ue[a]:-1;f>=0&&e.push(f)}const r=Math.floor(e.length*3/4),s=new Uint8Array(r);let n=0;for(let i=0;i<e.length;i+=4){const a=e[i],f=i+1<e.length?e[i+1]:0,p=i+2<e.length?e[i+2]:0,y=i+3<e.length?e[i+3]:0,S=a<<18|f<<12|p<<6|y;n<r&&(s[n++]=S>>16&255),n<r&&(s[n++]=S>>8&255),n<r&&(s[n++]=S&255)}return s}function $e(t){let e="";for(let r=0;r<t.length;r++){const s=t[r];e+=(s<16?"0":"")+s.toString(16)}return e}function Ie(t){t=String(t);const e=[];for(let r=0;r+1<t.length;r+=2){const s=parseInt(t.slice(r,r+2),16);if(Number.isNaN(s))break;e.push(s)}return new Uint8Array(e)}class O extends Uint8Array{constructor(e,r,s){typeof e=="number"?super(e):e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer?super(e,r,s):e!==void 0?super(e):super(0),this._isVirtualBuffer=!0}static get[Symbol.species](){return O}static isBuffer(e){return!!(e&&(e instanceof O||e._isVirtualBuffer===!0))}static isEncoding(e){return typeof e!="string"?!1:["utf8","utf-8","hex","base64","base64url","ascii","latin1","binary","ucs2","ucs-2","utf16le","utf-16le"].includes(e.toLowerCase())}static from(e,r,s){if(typeof e=="string"){const n=(typeof r=="string"?r:"utf8").toLowerCase();let i;if(n==="utf8"||n==="utf-8")i=se(e);else if(n==="hex")i=Ie(e);else if(n==="base64"||n==="base64url")i=xe(e);else if(n==="ascii"||n==="latin1"||n==="binary"){i=new Uint8Array(e.length);for(let f=0;f<e.length;f++)i[f]=e.charCodeAt(f)&255}else if(n==="utf16le"||n==="utf-16le"||n==="ucs2"||n==="ucs-2"){i=new Uint8Array(e.length*2);for(let f=0;f<e.length;f++){const p=e.charCodeAt(f);i[f*2]=p&255,i[f*2+1]=p>>>8&255}}else i=se(e);const a=new O(i.length);return a.set(i),a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer){const n=new Uint8Array(e,r||0,s!==void 0?s:e.byteLength-(r||0));return Object.setPrototypeOf(n,O.prototype),n._isVirtualBuffer=!0,n}if(ArrayBuffer.isView(e)){const n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),i=new O(n.length);return i.set(n),i}if(Array.isArray(e)||e&&typeof e.length=="number"){const n=new O(e.length);for(let i=0;i<e.length;i++)n[i]=e[i]&255;return n}if(e&&typeof e.valueOf=="function"&&e.valueOf()!==e)return O.from(e.valueOf(),r,s);throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object")}static alloc(e,r,s){if(typeof e!="number"||e<0||!Number.isFinite(e))throw new RangeError("Invalid buffer size");const n=new O(e);return r!==void 0&&e>0&&n.fill(r,0,e,s),n}static allocUnsafe(e){return O.alloc(e)}static allocUnsafeSlow(e){return O.alloc(e)}static concat(e,r){if(!Array.isArray(e))throw new TypeError("list argument must be an Array");if(e.length===0)return O.alloc(0);let s=r;if(s===void 0){s=0;for(let a=0;a<e.length;a++)s+=e[a].length}const n=O.alloc(s);let i=0;for(let a=0;a<e.length;a++){const f=e[a];if(i+f.length>s){n.set(f.subarray(0,s-i),i);break}n.set(f,i),i+=f.length}return n}static byteLength(e,r="utf8"){if(typeof e!="string"){if(e&&typeof e.byteLength=="number")return e.byteLength;if(e&&typeof e.length=="number")return e.length;throw new TypeError('The "string" argument must be of type string or an instance of Buffer or ArrayBuffer')}const s=(r||"utf8").toLowerCase();return s==="utf8"||s==="utf-8"?se(e).length:s==="ascii"||s==="latin1"||s==="binary"?e.length:s==="utf16le"||s==="utf-16le"||s==="ucs2"||s==="ucs-2"?e.length*2:s==="hex"?e.length>>>1:s==="base64"||s==="base64url"?xe(e).length:se(e).length}static compare(e,r){if(!(e instanceof Uint8Array)||!(r instanceof Uint8Array))throw new TypeError("Arguments must be Buffers or Uint8Arrays");const s=Math.min(e.length,r.length);for(let n=0;n<s;n++)if(e[n]!==r[n])return e[n]<r[n]?-1:1;return e.length===r.length?0:e.length<r.length?-1:1}fill(e,r=0,s=this.length,n="utf8"){if(typeof r=="string"?(n=r,r=0,s=this.length):typeof s=="string"&&(n=s,s=this.length),typeof e=="number")return super.fill(e&255,r,s),this;const i=typeof e=="string"?O.from(e,n):e;if(!i||i.length===0)return super.fill(0,r,s),this;for(let a=r;a<s;a++)this[a]=i[(a-r)%i.length];return this}subarray(e=0,r=this.length){const s=Uint8Array.prototype.subarray.call(this,e,r);return Object.setPrototypeOf(s,O.prototype),s._isVirtualBuffer=!0,s}slice(e=0,r=this.length){return this.subarray(e,r)}compare(e,r=0,s=e.length,n=0,i=this.length){const a=this.subarray(n,i),f=e.subarray(r,s);return O.compare(a,f)}equals(e){return!(e instanceof Uint8Array)||this.length!==e.length?!1:O.compare(this,e)===0}copy(e,r=0,s=0,n=this.length){if(s>=n||r>=e.length)return 0;const i=this.subarray(s,n),a=Math.min(i.length,e.length-r);return e.set(i.subarray(0,a),r),a}write(e,r=0,s=this.length-r,n="utf8"){typeof r=="string"?(n=r,r=0,s=this.length):typeof s=="string"&&(n=s,s=this.length-r);const i=O.from(String(e),n),a=Math.min(i.length,s,this.length-r);return a<=0?0:(this.set(i.subarray(0,a),r),a)}toString(e="utf8",r=0,s=this.length){if(r<0&&(r=0),s>this.length&&(s=this.length),r>=s)return"";const n=Uint8Array.prototype.subarray.call(this,r,s),i=String(e||"utf8").toLowerCase();if(i==="utf8"||i==="utf-8")return te(n);if(i==="hex")return $e(n);if(i==="base64")return ge(n,!1);if(i==="base64url")return ge(n,!0);if(i==="ascii"||i==="latin1"||i==="binary"){let a="";for(let f=0;f<n.length;f++)a+=String.fromCharCode(n[f]);return a}if(i==="utf16le"||i==="utf-16le"||i==="ucs2"||i==="ucs-2"){let a="";for(let f=0;f+1<n.length;f+=2)a+=String.fromCharCode(n[f]|n[f+1]<<8);return a}return te(n)}toJSON(){return{type:"Buffer",data:Array.from(this)}}_dv(){return new DataView(this.buffer,this.byteOffset,this.byteLength)}readUInt8(e=0){return this._dv().getUint8(e)}readUint8(e=0){return this._dv().getUint8(e)}readInt8(e=0){return this._dv().getInt8(e)}readUInt16BE(e=0){return this._dv().getUint16(e,!1)}readUint16BE(e=0){return this._dv().getUint16(e,!1)}readUInt16LE(e=0){return this._dv().getUint16(e,!0)}readUint16LE(e=0){return this._dv().getUint16(e,!0)}readInt16BE(e=0){return this._dv().getInt16(e,!1)}readInt16LE(e=0){return this._dv().getInt16(e,!0)}readUInt32BE(e=0){return this._dv().getUint32(e,!1)}readUint32BE(e=0){return this._dv().getUint32(e,!1)}readUInt32LE(e=0){return this._dv().getUint32(e,!0)}readUint32LE(e=0){return this._dv().getUint32(e,!0)}readInt32BE(e=0){return this._dv().getInt32(e,!1)}readInt32LE(e=0){return this._dv().getInt32(e,!0)}readBigUInt64BE(e=0){return this._dv().getBigUint64(e,!1)}readBigUint64BE(e=0){return this._dv().getBigUint64(e,!1)}readBigUInt64LE(e=0){return this._dv().getBigUint64(e,!0)}readBigUint64LE(e=0){return this._dv().getBigUint64(e,!0)}readBigInt64BE(e=0){return this._dv().getBigInt64(e,!1)}readBigInt64LE(e=0){return this._dv().getBigInt64(e,!0)}readFloatBE(e=0){return this._dv().getFloat32(e,!1)}readFloatLE(e=0){return this._dv().getFloat32(e,!0)}readDoubleBE(e=0){return this._dv().getFloat64(e,!1)}readDoubleLE(e=0){return this._dv().getFloat64(e,!0)}writeUInt8(e,r=0){return this._dv().setUint8(r,Number(e)),r+1}writeUint8(e,r=0){return this.writeUInt8(e,r)}writeInt8(e,r=0){return this._dv().setInt8(r,Number(e)),r+1}writeUInt16BE(e,r=0){return this._dv().setUint16(r,Number(e),!1),r+2}writeUint16BE(e,r=0){return this.writeUInt16BE(e,r)}writeUInt16LE(e,r=0){return this._dv().setUint16(r,Number(e),!0),r+2}writeUint16LE(e,r=0){return this.writeUInt16LE(e,r)}writeInt16BE(e,r=0){return this._dv().setInt16(r,Number(e),!1),r+2}writeInt16LE(e,r=0){return this._dv().setInt16(r,Number(e),!0),r+2}writeUInt32BE(e,r=0){return this._dv().setUint32(r,Number(e)>>>0,!1),r+4}writeUint32BE(e,r=0){return this.writeUInt32BE(e,r)}writeUInt32LE(e,r=0){return this._dv().setUint32(r,Number(e)>>>0,!0),r+4}writeUint32LE(e,r=0){return this.writeUInt32LE(e,r)}writeInt32BE(e,r=0){return this._dv().setInt32(r,Number(e)|0,!1),r+4}writeInt32LE(e,r=0){return this._dv().setInt32(r,Number(e)|0,!0),r+4}writeBigUInt64BE(e,r=0){return this._dv().setBigUint64(r,BigInt(e),!1),r+8}writeBigUint64BE(e,r=0){return this.writeBigUInt64BE(e,r)}writeBigUInt64LE(e,r=0){return this._dv().setBigUint64(r,BigInt(e),!0),r+8}writeBigUint64LE(e,r=0){return this.writeBigUInt64LE(e,r)}writeBigInt64BE(e,r=0){return this._dv().setBigInt64(r,BigInt(e),!1),r+8}writeBigInt64LE(e,r=0){return this._dv().setBigInt64(r,BigInt(e),!0),r+8}writeFloatBE(e,r=0){return this._dv().setFloat32(r,Number(e),!1),r+4}writeFloatLE(e,r=0){return this._dv().setFloat32(r,Number(e),!0),r+4}writeDoubleBE(e,r=0){return this._dv().setFloat64(r,Number(e),!1),r+8}writeDoubleLE(e,r=0){return this._dv().setFloat64(r,Number(e),!0),r+8}}const tt=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],Ve=new Uint32Array(64);for(let t=0;t<64;t++)Ve[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296)>>>0;function nt(t){const e=t.length,r=e<<3>>>0,s=e>>>29>>>0,n=(e+8&-64)+64,i=new Uint8Array(n);i.set(t),i[e]=128;const a=new DataView(i.buffer);a.setUint32(n-8,r,!0),a.setUint32(n-4,s,!0);let f=1732584193,p=4023233417,y=2562383102,S=271733878;const l=new Uint32Array(16);for(let m=0;m<n;m+=64){for(let u=0;u<16;u++)l[u]=a.getUint32(m+u*4,!0);let A=f,N=p,k=y,L=S;for(let u=0;u<64;u++){let B,F;u<16?(B=N&k|~N&L,F=u):u<32?(B=L&N|~L&k,F=(5*u+1)%16):u<48?(B=N^k^L,F=(3*u+5)%16):(B=k^(N|~L),F=7*u%16),B=B+A+Ve[u]+l[F]|0,A=L,L=k,k=N;const U=tt[u];N=N+(B<<U|B>>>32-U)|0}f=f+A|0,p=p+N|0,y=y+k|0,S=S+L|0}const d=O.alloc(16);return d.writeInt32LE(f,0),d.writeInt32LE(p,4),d.writeInt32LE(y,8),d.writeInt32LE(S,12),d}const We=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function ke(t,e){return t>>>e|t<<32-e}function rt(t){const e=t.length,r=Math.floor(e/536870912),s=e<<3>>>0,n=(e+8&-64)+64,i=new Uint8Array(n);i.set(t),i[e]=128;const a=new DataView(i.buffer);a.setUint32(n-8,r,!1),a.setUint32(n-4,s,!1);let f=1779033703,p=3144134277,y=1013904242,S=2773480762,l=1359893119,d=2600822924,m=528734635,A=1541459225;const N=new Uint32Array(64);for(let L=0;L<n;L+=64){for(let R=0;R<16;R++)N[R]=a.getUint32(L+R*4,!1);for(let R=16;R<64;R++){const T=ke(N[R-15],7)^ke(N[R-15],18)^N[R-15]>>>3,v=ke(N[R-2],17)^ke(N[R-2],19)^N[R-2]>>>10;N[R]=N[R-16]+T+N[R-7]+v>>>0}let u=f,B=p,F=y,U=S,b=l,w=d,g=m,x=A;for(let R=0;R<64;R++){const T=ke(b,6)^ke(b,11)^ke(b,25),v=b&w^~b&g,$=x+T+v+We[R]+N[R]>>>0,j=ke(u,2)^ke(u,13)^ke(u,22),C=u&B^u&F^B&F,z=j+C>>>0;x=g,g=w,w=b,b=U+$>>>0,U=F,F=B,B=u,u=$+z>>>0}f=f+u>>>0,p=p+B>>>0,y=y+F>>>0,S=S+U>>>0,l=l+b>>>0,d=d+w>>>0,m=m+g>>>0,A=A+x>>>0}const k=O.alloc(32);return k.writeUInt32BE(f,0),k.writeUInt32BE(p,4),k.writeUInt32BE(y,8),k.writeUInt32BE(S,12),k.writeUInt32BE(l,16),k.writeUInt32BE(d,20),k.writeUInt32BE(m,24),k.writeUInt32BE(A,28),k}function Pe(t){const e=t.length,r=Math.floor(e/536870912),s=e<<3>>>0,n=(e+8&-64)+64,i=new Uint8Array(n);i.set(t),i[e]=128;const a=new DataView(i.buffer);a.setUint32(n-8,r,!1),a.setUint32(n-4,s,!1);let f=1732584193,p=4023233417,y=2562383102,S=271733878,l=3285377520;const d=new Uint32Array(80);for(let A=0;A<n;A+=64){for(let F=0;F<16;F++)d[F]=a.getUint32(A+F*4,!1);for(let F=16;F<80;F++){const U=d[F-3]^d[F-8]^d[F-14]^d[F-16];d[F]=(U<<1|U>>>31)>>>0}let N=f,k=p,L=y,u=S,B=l;for(let F=0;F<80;F++){let U,b;F<20?(U=k&L|~k&u,b=1518500249):F<40?(U=k^L^u,b=1859775393):F<60?(U=k&L|k&u|L&u,b=2400959708):(U=k^L^u,b=3395469782);const w=((N<<5|N>>>27)>>>0)+(U>>>0)+B+b+d[F]>>>0;B=u,u=L,L=(k<<30|k>>>2)>>>0,k=N,N=w}f=f+N>>>0,p=p+k>>>0,y=y+L>>>0,S=S+u>>>0,l=l+B>>>0}const m=O.alloc(20);return m.writeUInt32BE(f,0),m.writeUInt32BE(p,4),m.writeUInt32BE(y,8),m.writeUInt32BE(S,12),m.writeUInt32BE(l,16),m}function st(t,e){const r=String(t).toLowerCase().replace("-","");if(r==="md5")return nt(e);if(r==="sha1")return Pe(e);if(r==="sha256")return rt(e);throw new Error(`Unsupported hash algorithm: ${t}`)}class pe{constructor(e){this.algorithm=e,this.chunks=[],this.digested=!1}update(e,r){if(this.digested)throw new Error("Digest already called");const s=typeof e=="string"?O.from(e,r||"utf8"):O.from(e);return this.chunks.push(s),this}digest(e){if(this.digested)throw new Error("Digest already called");this.digested=!0;const r=O.concat(this.chunks),s=st(this.algorithm,r);return!e||e==="buffer"?s:s.toString(e)}}class re{constructor(e,r){this.algorithm=e;let s=typeof r=="string"?O.from(r,"utf8"):O.from(r);const n=64;s.length>n&&(s=st(e,s)),this.ipad=O.alloc(n,54),this.opad=O.alloc(n,92);for(let i=0;i<s.length;i++)this.ipad[i]^=s[i],this.opad[i]^=s[i];this.inner=new pe(e),this.inner.update(this.ipad),this.digested=!1}update(e,r){return this.inner.update(e,r),this}digest(e){if(this.digested)throw new Error("Digest already called");this.digested=!0;const r=this.inner.digest(),s=new pe(this.algorithm);return s.update(this.opad),s.update(r),s.digest(e)}}const je={createHash(t){return new pe(t)},createHmac(t,e){return new re(t,e)},timingSafeEqual(t,e){if(!ArrayBuffer.isView(t)||!ArrayBuffer.isView(e))throw new TypeError("Input must be Buffer or TypedArray");if(t.byteLength!==e.byteLength)throw new RangeError("Input buffers must have the same byte length");const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let n=0;for(let i=0;i<r.length;i++)n|=r[i]^s[i];return n===0},randomBytes(t,e){const r=O.alloc(t);if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(r);else for(let s=0;s<t;s++)r[s]=Math.floor(Math.random()*256);return typeof e=="function"&&queueMicrotask(()=>e(null,r)),r},randomUUID(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const t=je.randomBytes(16);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const e=t.toString("hex");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}},fn=(()=>{const t=new Uint32Array(256);for(let e=0;e<256;e++){let r=e;for(let s=0;s<8;s++)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r>>>0}return t})(),Ee={crc32(t,e=0){const r=typeof t=="string"?se(t):t instanceof Uint8Array?t:O.from(t);let s=e>>>0^4294967295;for(let n=0;n<r.length;n++)s=fn[(s^r[n])&255]^s>>>8;return(s^4294967295)>>>0},constants:{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,ZLIB_VERNUM:4880,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1}};(()=>{let t=null;try{t=typeof require=="function"?require("zlib"):null}catch{t=null}const e=["gzip","gunzip","deflate","inflate","deflateRaw","inflateRaw","unzip","gzipSync","gunzipSync","deflateSync","inflateSync","deflateRawSync","inflateRawSync","unzipSync","createGzip","createGunzip","createDeflate","createInflate","createDeflateRaw","createInflateRaw"];if(t){for(const n of e)typeof t[n]=="function"&&(Ee[n]=t[n].bind(t));return}const r=(n,i)=>(a,f,p)=>{const y=typeof f=="function"?f:typeof p=="function"?p:null,S=(async()=>{if(typeof CompressionStream>"u"||typeof DecompressionStream>"u"||typeof Response>"u")throw new Error("zlib."+i+" is not supported in this environment");const d=/^(gunzip|unzip|inflate)/.test(i)?new DecompressionStream(n):new CompressionStream(n),m=d.writable.getWriter(),A=a instanceof Uint8Array?a:O.from(a);m.write(A),m.close();const N=await new Response(d.readable).arrayBuffer();return O.from(N)})();if(y){S.then(l=>y(null,l),l=>y(l));return}return S};Ee.gzip=r("gzip","gzip"),Ee.gunzip=r("gzip","gunzip"),Ee.unzip=r("gzip","unzip"),Ee.deflate=r("deflate","deflate"),Ee.inflate=r("deflate","inflate"),Ee.deflateRaw=r("deflate-raw","deflateRaw"),Ee.inflateRaw=r("deflate-raw","inflateRaw");const s=n=>()=>{throw new Error("zlib."+n+" is not supported in a browser worker (use the async API)")};Ee.gzipSync=s("gzipSync"),Ee.gunzipSync=s("gunzipSync"),Ee.deflateSync=s("deflateSync"),Ee.inflateSync=s("inflateSync"),Ee.deflateRawSync=s("deflateRawSync"),Ee.inflateRawSync=s("inflateRawSync"),Ee.unzipSync=s("unzipSync")})();let it=()=>"/workspace";const J={sep:"/",delimiter:":",normalize(t){if(typeof t!="string")throw new TypeError("Path must be a string");if(t.length===0)return".";const e=t.startsWith("/"),r=t.endsWith("/")&&t.length>1,s=t.split("/"),n=[];for(let a=0;a<s.length;a++){const f=s[a];!f||f==="."||(f===".."?n.length>0&&n[n.length-1]!==".."?n.pop():e||n.push(".."):n.push(f))}let i=(e?"/":"")+n.join("/");return i||(i=e?"/":"."),r&&i!=="/"&&(i+="/"),i},join(...t){if(t.length===0)return".";const e=t.filter(r=>r!=="").join("/");return e?J.normalize(e):"."},resolve(...t){let e="";for(let s=t.length-1;s>=0&&!e.startsWith("/");s--){const n=t[s];n&&(e=e?`${n}/${e}`:n)}e.startsWith("/")||(e=`${typeof it=="function"?it():"/workspace"}/${e}`);const r=J.normalize(e);return r.length>1&&r.endsWith("/")?r.slice(0,-1):r},relative(t,e){const r=J.resolve(t),s=J.resolve(e);if(r===s)return"";const n=r.split("/").filter(Boolean),i=s.split("/").filter(Boolean);let a=0;for(;a<n.length&&a<i.length&&n[a]===i[a];)a++;return[...new Array(n.length-a).fill(".."),...i.slice(a)].join("/")},dirname(t){if(typeof t!="string")throw new TypeError("Path must be a string");if(t.length===0)return".";const e=t.length>1&&t.endsWith("/")?t.slice(0,-1):t,r=e.lastIndexOf("/");return r===-1?".":r===0?"/":e.slice(0,r)},basename(t,e){if(typeof t!="string")throw new TypeError("Path must be a string");const r=t.length>1&&t.endsWith("/")?t.slice(0,-1):t,s=r.lastIndexOf("/");let n=s===-1?r:r.slice(s+1);return e&&n.endsWith(e)&&(n=n.slice(0,n.length-e.length)),n},extname(t){const e=J.basename(t),r=e.lastIndexOf(".");return r<=0?"":e.slice(r)},parse(t){if(typeof t!="string")throw new TypeError("Path must be a string");const e=t.startsWith("/")?"/":"",r=t?J.dirname(t):"",s=t?J.basename(t):"",n=t?J.extname(t):"",i=n?s.slice(0,s.length-n.length):s;return{root:e,dir:r==="."&&!t.startsWith("./")?"":r,base:s,ext:n,name:i}},format(t){if(!t||typeof t!="object")throw new TypeError("pathObject must be an object");const e=t.dir||t.root||"",r=t.base||`${t.name||""}${t.ext||""}`;return e?e===t.root?`${e}${r}`:`${e}/${r}`:r},isAbsolute(t){return typeof t=="string"&&t.startsWith("/")}};J.posix=J;let xt=null;const ln={tmpdir:()=>"/tmp",EOL:`
package/dist/runtime.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ============================================================
3
- * @innovatorved/code-lab v0.7.1 — Standalone Browser Code IDE & Virtual Runtime
3
+ * @innovatorved/code-lab v0.7.2 — Standalone Browser Code IDE & Virtual Runtime
4
4
  * ============================================================
5
5
  * Features:
6
6
  * - Sandboxed Web Worker Execution Engine with Multi-Instance Isolation & Watchdog Timer
@@ -16,7 +16,7 @@
16
16
  */
17
17
  (function (root) {
18
18
  'use strict';
19
- var CodeLabLogger=(()=>{var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var y=(o,n)=>{for(var a in n)s(o,a,{get:n[a],enumerable:!0})},v=(o,n,a,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of C(n))!x.call(o,e)&&e!==a&&s(o,e,{get:()=>n[e],enumerable:!(t=p(n,e))||t.enumerable});return o};var O=o=>v(s({},"__esModule",{value:!0}),o);var h={};y(h,{CodeLabError:()=>d,DEFAULT_LOGGER:()=>w,LOG_PREFIX:()=>c,createLogger:()=>g,default:()=>_,isCodeLabError:()=>f});var c="[code-lab]",d=class extends Error{code;options;cause;recoverable;details;context;constructor(n,a,t={}){super(a),this.name="CodeLabError",this.code=n,this.options=t,this.cause=t.cause,this.recoverable=t.recoverable!==!1;let e=t.details??t.context;e!==void 0&&(this.details=e,this.context=e),Object.setPrototypeOf(this,new.target.prototype)}};function f(o){return!!(o&&typeof o=="object"&&(o instanceof d||o.name==="CodeLabError"&&typeof o.code=="string"))}function g(o={}){let n=o.logger??null,a=o.debug===!0,t=o.prefix||c,e=(r,b)=>{if(r==="debug"&&!a)return;if(n&&typeof n[r]=="function"){let L=null;try{n[r](...b);return}catch(k){L=k}}let i=typeof console<"u"?console:null,l=i?i[r]:null;typeof l=="function"&&l.call(i,t,...b)};return{debug:(...r)=>e("debug",r),info:(...r)=>e("info",r),warn:(...r)=>e("warn",r),error:(...r)=>e("error",r)}}var w=g(),E={LOG_PREFIX:c,CodeLabError:d,isCodeLabError:f,createLogger:g,DEFAULT_LOGGER:w},u=typeof globalThis<"u"?globalThis:null;u&&!u.CodeLabLogger&&(u.CodeLabLogger=E);var _=E;return O(h);})();
19
+ var CodeLabLogger=(()=>{var d=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var k=(e,n)=>{for(var i in n)d(e,i,{get:n[i],enumerable:!0})},m=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of R(n))!w.call(e,o)&&o!==i&&d(e,o,{get:()=>n[o],enumerable:!(r=y(n,o))||r.enumerable});return e};var _=e=>m(d({},"__esModule",{value:!0}),e);var h={};k(h,{CodeLabError:()=>s,DEFAULT_LOGGER:()=>f,LOG_PREFIX:()=>a,createLogger:()=>c,default:()=>C,isCodeLabError:()=>g});var s=class extends Error{code;options;cause;context;details;recoverable;constructor(n,i,r={}){super(i,r.cause!==void 0?{cause:r.cause}:void 0),this.name="CodeLabError",this.code=n,this.options=r,this.cause=r.cause,this.recoverable=r.recoverable!==!1;let o=r.details??r.context;this.context=Object.freeze({...o??{}}),o!==void 0&&(this.details=this.context),Object.setPrototypeOf(this,new.target.prototype)}};function g(e){return e instanceof s||typeof e=="object"&&e!==null&&e.name==="CodeLabError"&&typeof e.code=="string"}var a="[code-lab]";function c(e={}){let n=e.logger??null,i=e.debug===!0,r=e.prefix||a,o=(t,L)=>{if(t==="debug"&&!i)return;if(n&&typeof n[t]=="function"){let b=null;try{n[t](...L);return}catch(v){b=v}}let l=typeof console<"u"?console:null,E=l?l[t]:null;typeof E=="function"&&E.call(l,r,...L)};return{debug:(...t)=>o("debug",t),info:(...t)=>o("info",t),warn:(...t)=>o("warn",t),error:(...t)=>o("error",t)}}var f=c(),p={LOG_PREFIX:a,CodeLabError:s,isCodeLabError:g,createLogger:c,DEFAULT_LOGGER:f},u=typeof globalThis<"u"?globalThis:null;u&&!u.CodeLabLogger&&(u.CodeLabLogger=p);var C=p;return _(h);})();
20
20
 
21
21
  (function () {
22
22
  "use strict";typeof globalThis<"u"&&typeof globalThis.Bun>"u"&&(globalThis.Bun={version:"1.1.20"});function __initVirtualRuntime(X){const D=X&&X.CodeLabLogger&&typeof X.CodeLabLogger.createLogger=="function"?X.CodeLabLogger.createLogger():{debug(){},info(){},warn(t,e){typeof console<"u"&&console.warn&&console.warn("[CodeLab]",t,e||"")},error(t,e){typeof console<"u"&&console.error&&console.error("[CodeLab]",t,e||"")}},he=typeof TextEncoder<"u"?new TextEncoder:null,ce=typeof TextDecoder<"u"?new TextDecoder("utf-8",{fatal:!1}):null;function se(t){if(t=String(t),he)return he.encode(t);const e=[];for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);if(s<128)e.push(s);else if(s<2048)e.push(192|s>>6,128|s&63);else if(s>=55296&&s<=56319&&r+1<t.length){const n=t.charCodeAt(r+1);n>=56320&&n<=57343?(s=65536+((s&1023)<<10|n&1023),e.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|s&63),r++):e.push(224|s>>12,128|s>>6&63,128|s&63)}else e.push(224|s>>12,128|s>>6&63,128|s&63)}return new Uint8Array(e)}function te(t){if(ce)return ce.decode(t);let e="",r=0;for(;r<t.length;){const s=t[r++];if(s<128)e+=String.fromCharCode(s);else if((s&224)===192){const n=t[r++]&63;e+=String.fromCharCode((s&31)<<6|n)}else if((s&240)===224){const n=t[r++]&63,i=t[r++]&63;e+=String.fromCharCode((s&15)<<12|n<<6|i)}else{const n=t[r++]&63,i=t[r++]&63,a=t[r++]&63,f=((s&7)<<18|n<<12|i<<6|a)-65536;e+=String.fromCharCode(55296+(f>>10),56320+(f&1023))}}return e}const ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ue=new Int16Array(256).fill(-1);for(let t=0;t<ne.length;t++)ue[ne.charCodeAt(t)]=t;ue[45]=62,ue[95]=63;function ge(t,e=!1){let r="";const s=t.length;for(let n=0;n<s;n+=3){const i=t[n],a=n+1<s?t[n+1]:0,f=n+2<s?t[n+2]:0,p=i<<16|a<<8|f;r+=ne[p>>18&63],r+=ne[p>>12&63],r+=n+1<s?ne[p>>6&63]:e?"":"=",r+=n+2<s?ne[p&63]:e?"":"="}return e&&(r=r.replace(/\+/g,"-").replace(/\//g,"_")),r}function xe(t){const e=[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);if(a===61)break;const f=a<256?ue[a]:-1;f>=0&&e.push(f)}const r=Math.floor(e.length*3/4),s=new Uint8Array(r);let n=0;for(let i=0;i<e.length;i+=4){const a=e[i],f=i+1<e.length?e[i+1]:0,p=i+2<e.length?e[i+2]:0,y=i+3<e.length?e[i+3]:0,S=a<<18|f<<12|p<<6|y;n<r&&(s[n++]=S>>16&255),n<r&&(s[n++]=S>>8&255),n<r&&(s[n++]=S&255)}return s}function $e(t){let e="";for(let r=0;r<t.length;r++){const s=t[r];e+=(s<16?"0":"")+s.toString(16)}return e}function Ie(t){t=String(t);const e=[];for(let r=0;r+1<t.length;r+=2){const s=parseInt(t.slice(r,r+2),16);if(Number.isNaN(s))break;e.push(s)}return new Uint8Array(e)}class O extends Uint8Array{constructor(e,r,s){typeof e=="number"?super(e):e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer?super(e,r,s):e!==void 0?super(e):super(0),this._isVirtualBuffer=!0}static get[Symbol.species](){return O}static isBuffer(e){return!!(e&&(e instanceof O||e._isVirtualBuffer===!0))}static isEncoding(e){return typeof e!="string"?!1:["utf8","utf-8","hex","base64","base64url","ascii","latin1","binary","ucs2","ucs-2","utf16le","utf-16le"].includes(e.toLowerCase())}static from(e,r,s){if(typeof e=="string"){const n=(typeof r=="string"?r:"utf8").toLowerCase();let i;if(n==="utf8"||n==="utf-8")i=se(e);else if(n==="hex")i=Ie(e);else if(n==="base64"||n==="base64url")i=xe(e);else if(n==="ascii"||n==="latin1"||n==="binary"){i=new Uint8Array(e.length);for(let f=0;f<e.length;f++)i[f]=e.charCodeAt(f)&255}else if(n==="utf16le"||n==="utf-16le"||n==="ucs2"||n==="ucs-2"){i=new Uint8Array(e.length*2);for(let f=0;f<e.length;f++){const p=e.charCodeAt(f);i[f*2]=p&255,i[f*2+1]=p>>>8&255}}else i=se(e);const a=new O(i.length);return a.set(i),a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer){const n=new Uint8Array(e,r||0,s!==void 0?s:e.byteLength-(r||0));return Object.setPrototypeOf(n,O.prototype),n._isVirtualBuffer=!0,n}if(ArrayBuffer.isView(e)){const n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),i=new O(n.length);return i.set(n),i}if(Array.isArray(e)||e&&typeof e.length=="number"){const n=new O(e.length);for(let i=0;i<e.length;i++)n[i]=e[i]&255;return n}if(e&&typeof e.valueOf=="function"&&e.valueOf()!==e)return O.from(e.valueOf(),r,s);throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object")}static alloc(e,r,s){if(typeof e!="number"||e<0||!Number.isFinite(e))throw new RangeError("Invalid buffer size");const n=new O(e);return r!==void 0&&e>0&&n.fill(r,0,e,s),n}static allocUnsafe(e){return O.alloc(e)}static allocUnsafeSlow(e){return O.alloc(e)}static concat(e,r){if(!Array.isArray(e))throw new TypeError("list argument must be an Array");if(e.length===0)return O.alloc(0);let s=r;if(s===void 0){s=0;for(let a=0;a<e.length;a++)s+=e[a].length}const n=O.alloc(s);let i=0;for(let a=0;a<e.length;a++){const f=e[a];if(i+f.length>s){n.set(f.subarray(0,s-i),i);break}n.set(f,i),i+=f.length}return n}static byteLength(e,r="utf8"){if(typeof e!="string"){if(e&&typeof e.byteLength=="number")return e.byteLength;if(e&&typeof e.length=="number")return e.length;throw new TypeError('The "string" argument must be of type string or an instance of Buffer or ArrayBuffer')}const s=(r||"utf8").toLowerCase();return s==="utf8"||s==="utf-8"?se(e).length:s==="ascii"||s==="latin1"||s==="binary"?e.length:s==="utf16le"||s==="utf-16le"||s==="ucs2"||s==="ucs-2"?e.length*2:s==="hex"?e.length>>>1:s==="base64"||s==="base64url"?xe(e).length:se(e).length}static compare(e,r){if(!(e instanceof Uint8Array)||!(r instanceof Uint8Array))throw new TypeError("Arguments must be Buffers or Uint8Arrays");const s=Math.min(e.length,r.length);for(let n=0;n<s;n++)if(e[n]!==r[n])return e[n]<r[n]?-1:1;return e.length===r.length?0:e.length<r.length?-1:1}fill(e,r=0,s=this.length,n="utf8"){if(typeof r=="string"?(n=r,r=0,s=this.length):typeof s=="string"&&(n=s,s=this.length),typeof e=="number")return super.fill(e&255,r,s),this;const i=typeof e=="string"?O.from(e,n):e;if(!i||i.length===0)return super.fill(0,r,s),this;for(let a=r;a<s;a++)this[a]=i[(a-r)%i.length];return this}subarray(e=0,r=this.length){const s=Uint8Array.prototype.subarray.call(this,e,r);return Object.setPrototypeOf(s,O.prototype),s._isVirtualBuffer=!0,s}slice(e=0,r=this.length){return this.subarray(e,r)}compare(e,r=0,s=e.length,n=0,i=this.length){const a=this.subarray(n,i),f=e.subarray(r,s);return O.compare(a,f)}equals(e){return!(e instanceof Uint8Array)||this.length!==e.length?!1:O.compare(this,e)===0}copy(e,r=0,s=0,n=this.length){if(s>=n||r>=e.length)return 0;const i=this.subarray(s,n),a=Math.min(i.length,e.length-r);return e.set(i.subarray(0,a),r),a}write(e,r=0,s=this.length-r,n="utf8"){typeof r=="string"?(n=r,r=0,s=this.length):typeof s=="string"&&(n=s,s=this.length-r);const i=O.from(String(e),n),a=Math.min(i.length,s,this.length-r);return a<=0?0:(this.set(i.subarray(0,a),r),a)}toString(e="utf8",r=0,s=this.length){if(r<0&&(r=0),s>this.length&&(s=this.length),r>=s)return"";const n=Uint8Array.prototype.subarray.call(this,r,s),i=String(e||"utf8").toLowerCase();if(i==="utf8"||i==="utf-8")return te(n);if(i==="hex")return $e(n);if(i==="base64")return ge(n,!1);if(i==="base64url")return ge(n,!0);if(i==="ascii"||i==="latin1"||i==="binary"){let a="";for(let f=0;f<n.length;f++)a+=String.fromCharCode(n[f]);return a}if(i==="utf16le"||i==="utf-16le"||i==="ucs2"||i==="ucs-2"){let a="";for(let f=0;f+1<n.length;f+=2)a+=String.fromCharCode(n[f]|n[f+1]<<8);return a}return te(n)}toJSON(){return{type:"Buffer",data:Array.from(this)}}_dv(){return new DataView(this.buffer,this.byteOffset,this.byteLength)}readUInt8(e=0){return this._dv().getUint8(e)}readUint8(e=0){return this._dv().getUint8(e)}readInt8(e=0){return this._dv().getInt8(e)}readUInt16BE(e=0){return this._dv().getUint16(e,!1)}readUint16BE(e=0){return this._dv().getUint16(e,!1)}readUInt16LE(e=0){return this._dv().getUint16(e,!0)}readUint16LE(e=0){return this._dv().getUint16(e,!0)}readInt16BE(e=0){return this._dv().getInt16(e,!1)}readInt16LE(e=0){return this._dv().getInt16(e,!0)}readUInt32BE(e=0){return this._dv().getUint32(e,!1)}readUint32BE(e=0){return this._dv().getUint32(e,!1)}readUInt32LE(e=0){return this._dv().getUint32(e,!0)}readUint32LE(e=0){return this._dv().getUint32(e,!0)}readInt32BE(e=0){return this._dv().getInt32(e,!1)}readInt32LE(e=0){return this._dv().getInt32(e,!0)}readBigUInt64BE(e=0){return this._dv().getBigUint64(e,!1)}readBigUint64BE(e=0){return this._dv().getBigUint64(e,!1)}readBigUInt64LE(e=0){return this._dv().getBigUint64(e,!0)}readBigUint64LE(e=0){return this._dv().getBigUint64(e,!0)}readBigInt64BE(e=0){return this._dv().getBigInt64(e,!1)}readBigInt64LE(e=0){return this._dv().getBigInt64(e,!0)}readFloatBE(e=0){return this._dv().getFloat32(e,!1)}readFloatLE(e=0){return this._dv().getFloat32(e,!0)}readDoubleBE(e=0){return this._dv().getFloat64(e,!1)}readDoubleLE(e=0){return this._dv().getFloat64(e,!0)}writeUInt8(e,r=0){return this._dv().setUint8(r,Number(e)),r+1}writeUint8(e,r=0){return this.writeUInt8(e,r)}writeInt8(e,r=0){return this._dv().setInt8(r,Number(e)),r+1}writeUInt16BE(e,r=0){return this._dv().setUint16(r,Number(e),!1),r+2}writeUint16BE(e,r=0){return this.writeUInt16BE(e,r)}writeUInt16LE(e,r=0){return this._dv().setUint16(r,Number(e),!0),r+2}writeUint16LE(e,r=0){return this.writeUInt16LE(e,r)}writeInt16BE(e,r=0){return this._dv().setInt16(r,Number(e),!1),r+2}writeInt16LE(e,r=0){return this._dv().setInt16(r,Number(e),!0),r+2}writeUInt32BE(e,r=0){return this._dv().setUint32(r,Number(e)>>>0,!1),r+4}writeUint32BE(e,r=0){return this.writeUInt32BE(e,r)}writeUInt32LE(e,r=0){return this._dv().setUint32(r,Number(e)>>>0,!0),r+4}writeUint32LE(e,r=0){return this.writeUInt32LE(e,r)}writeInt32BE(e,r=0){return this._dv().setInt32(r,Number(e)|0,!1),r+4}writeInt32LE(e,r=0){return this._dv().setInt32(r,Number(e)|0,!0),r+4}writeBigUInt64BE(e,r=0){return this._dv().setBigUint64(r,BigInt(e),!1),r+8}writeBigUint64BE(e,r=0){return this.writeBigUInt64BE(e,r)}writeBigUInt64LE(e,r=0){return this._dv().setBigUint64(r,BigInt(e),!0),r+8}writeBigUint64LE(e,r=0){return this.writeBigUInt64LE(e,r)}writeBigInt64BE(e,r=0){return this._dv().setBigInt64(r,BigInt(e),!1),r+8}writeBigInt64LE(e,r=0){return this._dv().setBigInt64(r,BigInt(e),!0),r+8}writeFloatBE(e,r=0){return this._dv().setFloat32(r,Number(e),!1),r+4}writeFloatLE(e,r=0){return this._dv().setFloat32(r,Number(e),!0),r+4}writeDoubleBE(e,r=0){return this._dv().setFloat64(r,Number(e),!1),r+8}writeDoubleLE(e,r=0){return this._dv().setFloat64(r,Number(e),!0),r+8}}const tt=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],Ve=new Uint32Array(64);for(let t=0;t<64;t++)Ve[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296)>>>0;function nt(t){const e=t.length,r=e<<3>>>0,s=e>>>29>>>0,n=(e+8&-64)+64,i=new Uint8Array(n);i.set(t),i[e]=128;const a=new DataView(i.buffer);a.setUint32(n-8,r,!0),a.setUint32(n-4,s,!0);let f=1732584193,p=4023233417,y=2562383102,S=271733878;const l=new Uint32Array(16);for(let m=0;m<n;m+=64){for(let u=0;u<16;u++)l[u]=a.getUint32(m+u*4,!0);let A=f,N=p,k=y,L=S;for(let u=0;u<64;u++){let B,F;u<16?(B=N&k|~N&L,F=u):u<32?(B=L&N|~L&k,F=(5*u+1)%16):u<48?(B=N^k^L,F=(3*u+5)%16):(B=k^(N|~L),F=7*u%16),B=B+A+Ve[u]+l[F]|0,A=L,L=k,k=N;const U=tt[u];N=N+(B<<U|B>>>32-U)|0}f=f+A|0,p=p+N|0,y=y+k|0,S=S+L|0}const d=O.alloc(16);return d.writeInt32LE(f,0),d.writeInt32LE(p,4),d.writeInt32LE(y,8),d.writeInt32LE(S,12),d}const We=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function ke(t,e){return t>>>e|t<<32-e}function rt(t){const e=t.length,r=Math.floor(e/536870912),s=e<<3>>>0,n=(e+8&-64)+64,i=new Uint8Array(n);i.set(t),i[e]=128;const a=new DataView(i.buffer);a.setUint32(n-8,r,!1),a.setUint32(n-4,s,!1);let f=1779033703,p=3144134277,y=1013904242,S=2773480762,l=1359893119,d=2600822924,m=528734635,A=1541459225;const N=new Uint32Array(64);for(let L=0;L<n;L+=64){for(let R=0;R<16;R++)N[R]=a.getUint32(L+R*4,!1);for(let R=16;R<64;R++){const T=ke(N[R-15],7)^ke(N[R-15],18)^N[R-15]>>>3,v=ke(N[R-2],17)^ke(N[R-2],19)^N[R-2]>>>10;N[R]=N[R-16]+T+N[R-7]+v>>>0}let u=f,B=p,F=y,U=S,b=l,w=d,g=m,x=A;for(let R=0;R<64;R++){const T=ke(b,6)^ke(b,11)^ke(b,25),v=b&w^~b&g,$=x+T+v+We[R]+N[R]>>>0,j=ke(u,2)^ke(u,13)^ke(u,22),C=u&B^u&F^B&F,z=j+C>>>0;x=g,g=w,w=b,b=U+$>>>0,U=F,F=B,B=u,u=$+z>>>0}f=f+u>>>0,p=p+B>>>0,y=y+F>>>0,S=S+U>>>0,l=l+b>>>0,d=d+w>>>0,m=m+g>>>0,A=A+x>>>0}const k=O.alloc(32);return k.writeUInt32BE(f,0),k.writeUInt32BE(p,4),k.writeUInt32BE(y,8),k.writeUInt32BE(S,12),k.writeUInt32BE(l,16),k.writeUInt32BE(d,20),k.writeUInt32BE(m,24),k.writeUInt32BE(A,28),k}function Pe(t){const e=t.length,r=Math.floor(e/536870912),s=e<<3>>>0,n=(e+8&-64)+64,i=new Uint8Array(n);i.set(t),i[e]=128;const a=new DataView(i.buffer);a.setUint32(n-8,r,!1),a.setUint32(n-4,s,!1);let f=1732584193,p=4023233417,y=2562383102,S=271733878,l=3285377520;const d=new Uint32Array(80);for(let A=0;A<n;A+=64){for(let F=0;F<16;F++)d[F]=a.getUint32(A+F*4,!1);for(let F=16;F<80;F++){const U=d[F-3]^d[F-8]^d[F-14]^d[F-16];d[F]=(U<<1|U>>>31)>>>0}let N=f,k=p,L=y,u=S,B=l;for(let F=0;F<80;F++){let U,b;F<20?(U=k&L|~k&u,b=1518500249):F<40?(U=k^L^u,b=1859775393):F<60?(U=k&L|k&u|L&u,b=2400959708):(U=k^L^u,b=3395469782);const w=((N<<5|N>>>27)>>>0)+(U>>>0)+B+b+d[F]>>>0;B=u,u=L,L=(k<<30|k>>>2)>>>0,k=N,N=w}f=f+N>>>0,p=p+k>>>0,y=y+L>>>0,S=S+u>>>0,l=l+B>>>0}const m=O.alloc(20);return m.writeUInt32BE(f,0),m.writeUInt32BE(p,4),m.writeUInt32BE(y,8),m.writeUInt32BE(S,12),m.writeUInt32BE(l,16),m}function st(t,e){const r=String(t).toLowerCase().replace("-","");if(r==="md5")return nt(e);if(r==="sha1")return Pe(e);if(r==="sha256")return rt(e);throw new Error(`Unsupported hash algorithm: ${t}`)}class pe{constructor(e){this.algorithm=e,this.chunks=[],this.digested=!1}update(e,r){if(this.digested)throw new Error("Digest already called");const s=typeof e=="string"?O.from(e,r||"utf8"):O.from(e);return this.chunks.push(s),this}digest(e){if(this.digested)throw new Error("Digest already called");this.digested=!0;const r=O.concat(this.chunks),s=st(this.algorithm,r);return!e||e==="buffer"?s:s.toString(e)}}class re{constructor(e,r){this.algorithm=e;let s=typeof r=="string"?O.from(r,"utf8"):O.from(r);const n=64;s.length>n&&(s=st(e,s)),this.ipad=O.alloc(n,54),this.opad=O.alloc(n,92);for(let i=0;i<s.length;i++)this.ipad[i]^=s[i],this.opad[i]^=s[i];this.inner=new pe(e),this.inner.update(this.ipad),this.digested=!1}update(e,r){return this.inner.update(e,r),this}digest(e){if(this.digested)throw new Error("Digest already called");this.digested=!0;const r=this.inner.digest(),s=new pe(this.algorithm);return s.update(this.opad),s.update(r),s.digest(e)}}const je={createHash(t){return new pe(t)},createHmac(t,e){return new re(t,e)},timingSafeEqual(t,e){if(!ArrayBuffer.isView(t)||!ArrayBuffer.isView(e))throw new TypeError("Input must be Buffer or TypedArray");if(t.byteLength!==e.byteLength)throw new RangeError("Input buffers must have the same byte length");const r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let n=0;for(let i=0;i<r.length;i++)n|=r[i]^s[i];return n===0},randomBytes(t,e){const r=O.alloc(t);if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(r);else for(let s=0;s<t;s++)r[s]=Math.floor(Math.random()*256);return typeof e=="function"&&queueMicrotask(()=>e(null,r)),r},randomUUID(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const t=je.randomBytes(16);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const e=t.toString("hex");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}},fn=(()=>{const t=new Uint32Array(256);for(let e=0;e<256;e++){let r=e;for(let s=0;s<8;s++)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r>>>0}return t})(),Ee={crc32(t,e=0){const r=typeof t=="string"?se(t):t instanceof Uint8Array?t:O.from(t);let s=e>>>0^4294967295;for(let n=0;n<r.length;n++)s=fn[(s^r[n])&255]^s>>>8;return(s^4294967295)>>>0},constants:{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,ZLIB_VERNUM:4880,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1}};(()=>{let t=null;try{t=typeof require=="function"?require("zlib"):null}catch{t=null}const e=["gzip","gunzip","deflate","inflate","deflateRaw","inflateRaw","unzip","gzipSync","gunzipSync","deflateSync","inflateSync","deflateRawSync","inflateRawSync","unzipSync","createGzip","createGunzip","createDeflate","createInflate","createDeflateRaw","createInflateRaw"];if(t){for(const n of e)typeof t[n]=="function"&&(Ee[n]=t[n].bind(t));return}const r=(n,i)=>(a,f,p)=>{const y=typeof f=="function"?f:typeof p=="function"?p:null,S=(async()=>{if(typeof CompressionStream>"u"||typeof DecompressionStream>"u"||typeof Response>"u")throw new Error("zlib."+i+" is not supported in this environment");const d=/^(gunzip|unzip|inflate)/.test(i)?new DecompressionStream(n):new CompressionStream(n),m=d.writable.getWriter(),A=a instanceof Uint8Array?a:O.from(a);m.write(A),m.close();const N=await new Response(d.readable).arrayBuffer();return O.from(N)})();if(y){S.then(l=>y(null,l),l=>y(l));return}return S};Ee.gzip=r("gzip","gzip"),Ee.gunzip=r("gzip","gunzip"),Ee.unzip=r("gzip","unzip"),Ee.deflate=r("deflate","deflate"),Ee.inflate=r("deflate","inflate"),Ee.deflateRaw=r("deflate-raw","deflateRaw"),Ee.inflateRaw=r("deflate-raw","inflateRaw");const s=n=>()=>{throw new Error("zlib."+n+" is not supported in a browser worker (use the async API)")};Ee.gzipSync=s("gzipSync"),Ee.gunzipSync=s("gunzipSync"),Ee.deflateSync=s("deflateSync"),Ee.inflateSync=s("inflateSync"),Ee.deflateRawSync=s("deflateRawSync"),Ee.inflateRawSync=s("inflateRawSync"),Ee.unzipSync=s("unzipSync")})();let it=()=>"/workspace";const J={sep:"/",delimiter:":",normalize(t){if(typeof t!="string")throw new TypeError("Path must be a string");if(t.length===0)return".";const e=t.startsWith("/"),r=t.endsWith("/")&&t.length>1,s=t.split("/"),n=[];for(let a=0;a<s.length;a++){const f=s[a];!f||f==="."||(f===".."?n.length>0&&n[n.length-1]!==".."?n.pop():e||n.push(".."):n.push(f))}let i=(e?"/":"")+n.join("/");return i||(i=e?"/":"."),r&&i!=="/"&&(i+="/"),i},join(...t){if(t.length===0)return".";const e=t.filter(r=>r!=="").join("/");return e?J.normalize(e):"."},resolve(...t){let e="";for(let s=t.length-1;s>=0&&!e.startsWith("/");s--){const n=t[s];n&&(e=e?`${n}/${e}`:n)}e.startsWith("/")||(e=`${typeof it=="function"?it():"/workspace"}/${e}`);const r=J.normalize(e);return r.length>1&&r.endsWith("/")?r.slice(0,-1):r},relative(t,e){const r=J.resolve(t),s=J.resolve(e);if(r===s)return"";const n=r.split("/").filter(Boolean),i=s.split("/").filter(Boolean);let a=0;for(;a<n.length&&a<i.length&&n[a]===i[a];)a++;return[...new Array(n.length-a).fill(".."),...i.slice(a)].join("/")},dirname(t){if(typeof t!="string")throw new TypeError("Path must be a string");if(t.length===0)return".";const e=t.length>1&&t.endsWith("/")?t.slice(0,-1):t,r=e.lastIndexOf("/");return r===-1?".":r===0?"/":e.slice(0,r)},basename(t,e){if(typeof t!="string")throw new TypeError("Path must be a string");const r=t.length>1&&t.endsWith("/")?t.slice(0,-1):t,s=r.lastIndexOf("/");let n=s===-1?r:r.slice(s+1);return e&&n.endsWith(e)&&(n=n.slice(0,n.length-e.length)),n},extname(t){const e=J.basename(t),r=e.lastIndexOf(".");return r<=0?"":e.slice(r)},parse(t){if(typeof t!="string")throw new TypeError("Path must be a string");const e=t.startsWith("/")?"/":"",r=t?J.dirname(t):"",s=t?J.basename(t):"",n=t?J.extname(t):"",i=n?s.slice(0,s.length-n.length):s;return{root:e,dir:r==="."&&!t.startsWith("./")?"":r,base:s,ext:n,name:i}},format(t){if(!t||typeof t!="object")throw new TypeError("pathObject must be an object");const e=t.dir||t.root||"",r=t.base||`${t.name||""}${t.ext||""}`;return e?e===t.root?`${e}${r}`:`${e}/${r}`:r},isAbsolute(t){return typeof t=="string"&&t.startsWith("/")}};J.posix=J;let xt=null;const ln={tmpdir:()=>"/tmp",EOL:`
package/dist/schemas.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as z from 'zod';
2
2
  /**
3
- * Zod Schemas and Inferred TypeScript Types for code-lab v0.7.0
3
+ * Zod Schemas and Inferred TypeScript Types for code-lab v0.7.2
4
4
  */
5
5
  export declare const GuidedStepSchema: z.ZodObject<{
6
6
  id: z.ZodString;