@innovatorved/code-lab 0.2.0 → 0.3.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 (70) hide show
  1. package/ARCHITECTURE.md +11 -6
  2. package/CHANGELOG.md +27 -0
  3. package/README.md +18 -8
  4. package/dist/code-lab.css +198 -0
  5. package/dist/code-lab.d.ts +27 -9
  6. package/dist/code-lab.esm.js +8248 -83
  7. package/dist/code-lab.js +8246 -81
  8. package/dist/extensions/cpp.d.ts +32 -6
  9. package/dist/extensions/cpp.esm.js +745 -6
  10. package/dist/extensions/cpp.js +745 -6
  11. package/dist/extensions/guided-lab.esm.js +39 -1
  12. package/dist/extensions/guided-lab.js +39 -1
  13. package/dist/extensions/python.d.ts +92 -0
  14. package/dist/extensions/python.esm.js +5476 -0
  15. package/dist/extensions/python.js +5495 -0
  16. package/dist/index.d.ts +7 -4
  17. package/dist/preview-sw.js +1 -1
  18. package/dist/runtime/index.d.ts +4 -0
  19. package/dist/runtime/module-loader.d.ts +11 -0
  20. package/dist/runtime/test-harness.d.ts +24 -0
  21. package/dist/runtime/vfs.d.ts +31 -0
  22. package/dist/runtime/wasi-host.d.ts +33 -0
  23. package/dist/runtime.esm.js +36 -4
  24. package/dist/runtime.js +36 -4
  25. package/dist/schemas.d.ts +134 -21
  26. package/dist/schemas.esm.js +43 -1
  27. package/dist/schemas.js +43 -1
  28. package/dist/shell/coreutils/compilers-cli.d.ts +24 -0
  29. package/dist/shell/index.d.ts +4 -0
  30. package/dist/shell/lexer-parser.d.ts +26 -0
  31. package/dist/shell.esm.js +113 -1
  32. package/dist/shell.js +113 -1
  33. package/dist/terminal.esm.js +1 -1
  34. package/dist/terminal.js +1 -1
  35. package/dist/workbench/command-palette.d.ts +10 -0
  36. package/dist/workbench/diff-editor.d.ts +26 -0
  37. package/dist/workbench/drawer.d.ts +18 -0
  38. package/dist/workbench/editor.d.ts +11 -0
  39. package/dist/workbench/file-tree.d.ts +11 -0
  40. package/dist/workbench/guided-pane.d.ts +11 -0
  41. package/dist/workbench/icons.d.ts +5 -0
  42. package/dist/workbench/index.d.ts +39 -0
  43. package/dist/workbench/share.d.ts +21 -0
  44. package/dist/workbench/styles.d.ts +4 -0
  45. package/dist/workbench/toolbar.d.ts +17 -0
  46. package/dist/workbench.d.ts +6 -1
  47. package/package.json +8 -2
  48. package/src/code-lab.css +198 -0
  49. package/src/extensions/cpp.ts +710 -5
  50. package/src/extensions/python.ts +1293 -0
  51. package/src/index.ts +35 -3
  52. package/src/runtime/index.ts +5 -0
  53. package/src/runtime/test-harness.ts +57 -0
  54. package/src/runtime.ts +35 -3
  55. package/src/schemas.ts +46 -1
  56. package/src/shell/coreutils/compilers-cli.ts +103 -0
  57. package/src/shell/index.ts +5 -0
  58. package/src/shell.ts +112 -0
  59. package/src/workbench/command-palette.ts +140 -0
  60. package/src/workbench/diff-editor.ts +216 -0
  61. package/src/workbench/drawer.ts +148 -0
  62. package/src/workbench/editor.ts +49 -0
  63. package/src/workbench/file-tree.ts +51 -0
  64. package/src/workbench/guided-pane.ts +33 -0
  65. package/src/workbench/icons.ts +48 -0
  66. package/src/workbench/index.ts +38 -0
  67. package/src/workbench/share.ts +99 -0
  68. package/src/workbench/styles.ts +200 -0
  69. package/src/workbench/toolbar.ts +171 -0
  70. package/src/workbench.ts +755 -70
@@ -1,4 +1,5 @@
1
1
  import { CppExtensionOptions } from '../schemas';
2
+ import type { DiagnosticItem } from '../diagnostics';
2
3
  /**
3
4
  * Built-in competitive programming & DSA headers seeded into `/usr/include`
4
5
  * inside the VirtualFS alongside the WASI sysroot.
@@ -100,6 +101,33 @@ export declare function registerCppCompilerOnRuntime(toolchain: CppToolchainMana
100
101
  wasmBinary: Uint8Array<ArrayBufferLike>;
101
102
  outputPath: string;
102
103
  }>;
104
+ /**
105
+ * Full C++20 standard library header set + built-in CodeLab headers.
106
+ */
107
+ export declare const STANDARD_CPP20_HEADERS: ReadonlySet<string>;
108
+ export interface CppSymbolDoc {
109
+ label: string;
110
+ kind?: string;
111
+ detail: string;
112
+ documentation: string;
113
+ insertText?: string;
114
+ header?: string;
115
+ complexity?: string;
116
+ }
117
+ export declare const CPP_COMPLETIONS_AND_HOVERS: Record<string, CppSymbolDoc>;
118
+ /**
119
+ * Registers Monaco C++20 completion and hover providers.
120
+ */
121
+ export declare function registerMonacoCppLanguageService(monacoInstance: any): boolean;
122
+ /**
123
+ * Real-time C++20 static AST/syntax linter.
124
+ * Debounced on keystroke in `.cpp`, `.cc`, `.cxx`, `.hpp`, `.h` files.
125
+ */
126
+ export declare function analyzeCppSource(source: string, filename?: string, vfs?: any): DiagnosticItem[];
127
+ /**
128
+ * Parses Clang / LLVM WASI compiler stderr and applies diagnostics to Monaco and DiagnosticsStore.
129
+ */
130
+ export declare function applyClangStderrDiagnostics(stderrText: string, diagnosticsStore?: any, monacoInstance?: any, activeModel?: any): DiagnosticItem[];
103
131
  /**
104
132
  * Real C++20 in WebAssembly Extension for CodeLab (`@innovatorved/code-lab/extensions/cpp`).
105
133
  *
@@ -109,11 +137,9 @@ export declare function registerCppCompilerOnRuntime(toolchain: CppToolchainMana
109
137
  * - `JS | TS | C++` language switcher in the CodeLab workbench
110
138
  * - `g++`, `clang++`, `c++`, and `./a.out` binary execution in the POSIX shell
111
139
  * - Guided Lab `cppStarterFiles`, `cppSolutionFiles`, and `cppFiles` curriculum support
140
+ * - Monaco IntelliSense, hovers, debounced C++20 static linter, and Clang compiler squiggles
112
141
  */
113
- export declare function cppExtension(workbench: any, options?: ExtendedCppExtensionOptions): any;
114
- export declare function createCppExtension(options?: ExtendedCppExtensionOptions): {
115
- (workbench: any): any;
116
- extensionName: string;
117
- languageId: "cpp";
118
- };
142
+ export declare function installCppExtension(workbench: any, options?: ExtendedCppExtensionOptions): any;
143
+ export declare function cppExtension(workbenchOrOptions?: any, maybeOptions?: ExtendedCppExtensionOptions): any;
144
+ export declare function createCppExtension(options?: ExtendedCppExtensionOptions): any;
119
145
  export default cppExtension;