@innovatorved/code-lab 0.7.0 → 0.7.1

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 (129) hide show
  1. package/ARCHITECTURE.md +2 -2
  2. package/CHANGELOG.md +20 -0
  3. package/README.md +2 -2
  4. package/dist/apps/web/src/index.d.ts +0 -9
  5. package/dist/code-lab-sql.esm.js +19 -19
  6. package/dist/code-lab-sql.umd.js +20 -20
  7. package/dist/code-lab.css +1 -1
  8. package/dist/code-lab.d.ts +1 -1
  9. package/dist/code-lab.esm.js +679 -1439
  10. package/dist/code-lab.js +678 -1438
  11. package/dist/extensions/cpp.esm.js +132 -8760
  12. package/dist/extensions/cpp.js +124 -8770
  13. package/dist/extensions/guided-lab.esm.js +33 -6836
  14. package/dist/extensions/guided-lab.js +33 -6854
  15. package/dist/extensions/javascript.esm.js +1 -36
  16. package/dist/extensions/javascript.js +1 -58
  17. package/dist/extensions/python.esm.js +79 -8118
  18. package/dist/extensions/python.js +79 -8136
  19. package/dist/extensions/typescript.esm.js +1 -55
  20. package/dist/extensions/typescript.js +1 -77
  21. package/dist/modular-kernel.d.ts +0 -4
  22. package/dist/preview-sw.js +1 -1
  23. package/dist/runtime.esm.js +77 -77
  24. package/dist/runtime.js +77 -77
  25. package/dist/schemas.d.ts +9 -0
  26. package/dist/schemas.esm.js +33 -6815
  27. package/dist/schemas.js +33 -6831
  28. package/dist/shell.esm.js +33 -33
  29. package/dist/shell.js +33 -33
  30. package/dist/terminal.esm.js +8 -6
  31. package/dist/terminal.js +6 -6
  32. package/dist/workbench/command-palette.d.ts +0 -4
  33. package/dist/workbench/index.d.ts +0 -20
  34. package/dist/workbench/intellisense.d.ts +1 -7
  35. package/package.json +3 -10
  36. package/src/code-lab.css +4 -502
  37. package/src/extensions/cpp.ts +11 -29
  38. package/src/extensions/guided-lab.ts +6 -2
  39. package/src/extensions/python.ts +9 -3
  40. package/src/modular-kernel.ts +0 -4
  41. package/src/runtime.ts +124 -39
  42. package/src/schemas.ts +2 -2
  43. package/src/shell.ts +3 -0
  44. package/src/terminal.ts +4 -2
  45. package/src/workbench/command-palette.ts +22 -302
  46. package/src/workbench/diff-editor.ts +2 -0
  47. package/src/workbench/icons.ts +1 -1
  48. package/src/workbench/index.ts +0 -15
  49. package/src/workbench/intellisense.ts +17 -4
  50. package/src/workbench.ts +68 -375
  51. package/dist/code-lab.umd.js +0 -6117
  52. package/dist/packages/editor/src/index.d.ts +0 -118
  53. package/dist/packages/preview/src/index.d.ts +0 -34
  54. package/dist/packages/runtime/src/index.d.ts +0 -47
  55. package/dist/packages/terminal/src/index.d.ts +0 -54
  56. package/dist/workbench/drawer.d.ts +0 -18
  57. package/dist/workbench/file-tree.d.ts +0 -11
  58. package/dist/workbench/guided-pane.d.ts +0 -11
  59. package/dist/workbench/styles.d.ts +0 -4
  60. package/dist/workbench/toolbar.d.ts +0 -17
  61. package/packages/commands/README.md +0 -7
  62. package/packages/commands/package.json +0 -16
  63. package/packages/commands/src/index.ts +0 -467
  64. package/packages/commands/tsconfig.json +0 -22
  65. package/packages/core/README.md +0 -12
  66. package/packages/core/package.json +0 -13
  67. package/packages/core/src/di.ts +0 -147
  68. package/packages/core/src/disposable.ts +0 -112
  69. package/packages/core/src/errors.ts +0 -205
  70. package/packages/core/src/events.ts +0 -157
  71. package/packages/core/src/index.ts +0 -49
  72. package/packages/core/src/path.ts +0 -118
  73. package/packages/core/src/registry.ts +0 -61
  74. package/packages/core/tsconfig.json +0 -19
  75. package/packages/editor/README.md +0 -9
  76. package/packages/editor/package.json +0 -18
  77. package/packages/editor/src/index.ts +0 -344
  78. package/packages/editor/tsconfig.json +0 -24
  79. package/packages/fs/README.md +0 -7
  80. package/packages/fs/package.json +0 -16
  81. package/packages/fs/src/backends.ts +0 -301
  82. package/packages/fs/src/index.ts +0 -18
  83. package/packages/fs/src/types.ts +0 -44
  84. package/packages/fs/src/vfs-service.ts +0 -257
  85. package/packages/fs/tsconfig.json +0 -22
  86. package/packages/preview/README.md +0 -3
  87. package/packages/preview/package.json +0 -16
  88. package/packages/preview/src/index.ts +0 -125
  89. package/packages/preview/tsconfig.json +0 -22
  90. package/packages/runtime/README.md +0 -3
  91. package/packages/runtime/package.json +0 -17
  92. package/packages/runtime/src/index.ts +0 -134
  93. package/packages/runtime/tsconfig.json +0 -23
  94. package/packages/settings/README.md +0 -7
  95. package/packages/settings/package.json +0 -16
  96. package/packages/settings/src/builtin-schemas.ts +0 -262
  97. package/packages/settings/src/configuration-service.ts +0 -609
  98. package/packages/settings/src/index.ts +0 -38
  99. package/packages/settings/src/jsonc.ts +0 -189
  100. package/packages/settings/src/schema.ts +0 -164
  101. package/packages/settings/tsconfig.json +0 -22
  102. package/packages/sql/README.md +0 -12
  103. package/packages/sql/package.json +0 -13
  104. package/packages/sql/src/completions.ts +0 -359
  105. package/packages/sql/src/diagnostics.ts +0 -200
  106. package/packages/sql/src/formatter.ts +0 -271
  107. package/packages/sql/src/index.ts +0 -54
  108. package/packages/sql/src/sql-editor.ts +0 -802
  109. package/packages/sql/src/styles.ts +0 -524
  110. package/packages/sql/src/tokenizer.ts +0 -457
  111. package/packages/sql/src/types.ts +0 -148
  112. package/packages/sql/tsconfig.json +0 -19
  113. package/packages/terminal/README.md +0 -3
  114. package/packages/terminal/package.json +0 -16
  115. package/packages/terminal/src/index.ts +0 -183
  116. package/packages/terminal/tsconfig.json +0 -22
  117. package/packages/ui/README.md +0 -8
  118. package/packages/ui/package.json +0 -18
  119. package/packages/ui/src/index.ts +0 -40
  120. package/packages/ui/src/observability.ts +0 -173
  121. package/packages/ui/src/plugin-registry.ts +0 -289
  122. package/packages/ui/src/settings-dialog.ts +0 -939
  123. package/packages/ui/src/themes.ts +0 -333
  124. package/packages/ui/tsconfig.json +0 -24
  125. package/src/workbench/drawer.ts +0 -157
  126. package/src/workbench/file-tree.ts +0 -51
  127. package/src/workbench/guided-pane.ts +0 -43
  128. package/src/workbench/styles.ts +0 -211
  129. package/src/workbench/toolbar.ts +0 -182
package/src/workbench.ts CHANGED
@@ -83,333 +83,9 @@
83
83
 
84
84
  // The bundler rewrites this literal from package.json at build time. Keeping
85
85
  // the fallback in sync lets tests require src/workbench.js directly.
86
- const CODELAB_VERSION = '0.7.0';
86
+ const CODELAB_VERSION = '0.7.1';
87
87
 
88
88
  // Ambient TypeScript declarations for Node.js built-ins inside Monaco
89
- const NODE_AMBIENT_DTS = `
90
- declare var require: (id: string) => any;
91
- declare var module: { exports: any };
92
- declare var exports: any;
93
- declare var __dirname: string;
94
- declare var __filename: string;
95
- declare var process: {
96
- env: Record<string, string | undefined>;
97
- argv: string[];
98
- version: string;
99
- versions: Record<string, string>;
100
- platform: string;
101
- arch: string;
102
- pid: number;
103
- cwd(): string;
104
- hrtime: { (time?: [number, number]): [number, number]; bigint(): bigint };
105
- nextTick(cb: (...args: any[]) => void, ...args: any[]): void;
106
- stdout: { write(chunk: any): boolean };
107
- stderr: { write(chunk: any): boolean };
108
- };
109
- declare class Buffer extends Uint8Array {
110
- static from(data: any, encoding?: string): Buffer;
111
- static alloc(size: number, fill?: any, encoding?: string): Buffer;
112
- static allocUnsafe(size: number): Buffer;
113
- static concat(list: Uint8Array[], totalLength?: number): Buffer;
114
- static isBuffer(obj: any): obj is Buffer;
115
- static byteLength(str: string | Uint8Array, encoding?: string): number;
116
- static compare(a: Uint8Array, b: Uint8Array): number;
117
- toString(encoding?: string, start?: number, end?: number): string;
118
- write(str: string, offset?: number, length?: number, encoding?: string): number;
119
- slice(start?: number, end?: number): Buffer;
120
- subarray(start?: number, end?: number): Buffer;
121
- equals(other: Uint8Array): boolean;
122
- copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
123
- readUInt8(offset?: number): number;
124
- readUInt16BE(offset?: number): number;
125
- readUInt16LE(offset?: number): number;
126
- readUInt32BE(offset?: number): number;
127
- readUInt32LE(offset?: number): number;
128
- readInt32BE(offset?: number): number;
129
- readInt32LE(offset?: number): number;
130
- readBigUInt64BE(offset?: number): bigint;
131
- readBigInt64BE(offset?: number): bigint;
132
- writeUInt8(value: number, offset?: number): number;
133
- writeUInt16BE(value: number, offset?: number): number;
134
- writeUInt16LE(value: number, offset?: number): number;
135
- writeUInt32BE(value: number, offset?: number): number;
136
- writeUInt32LE(value: number, offset?: number): number;
137
- writeInt32BE(value: number, offset?: number): number;
138
- writeInt32LE(value: number, offset?: number): number;
139
- writeBigUInt64BE(value: bigint, offset?: number): number;
140
- writeBigInt64BE(value: bigint, offset?: number): number;
141
- }
142
- declare module 'node:test' {
143
- export function describe(name: string, fn: () => any): void;
144
- export function it(name: string, fn: () => any): void;
145
- export function test(name: string, fn: () => any): void;
146
- export function before(fn: () => any): void;
147
- export function after(fn: () => any): void;
148
- export function beforeEach(fn: () => any): void;
149
- export function afterEach(fn: () => any): void;
150
- }
151
- declare module 'test' { export * from 'node:test'; }
152
- declare module 'node:assert' {
153
- function assert(value: any, message?: string | Error): void;
154
- namespace assert {
155
- function ok(value: any, message?: string | Error): void;
156
- function equal(actual: any, expected: any, message?: string | Error): void;
157
- function strictEqual(actual: any, expected: any, message?: string | Error): void;
158
- function notEqual(actual: any, expected: any, message?: string | Error): void;
159
- function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
160
- function deepEqual(actual: any, expected: any, message?: string | Error): void;
161
- function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
162
- function throws(block: () => any, error?: any, message?: string): void;
163
- function doesNotThrow(block: () => any, error?: any, message?: string): void;
164
- function rejects(block: (() => Promise<any>) | Promise<any>, error?: any, message?: string): Promise<void>;
165
- function doesNotReject(block: (() => Promise<any>) | Promise<any>, error?: any, message?: string): Promise<void>;
166
- function match(string: string, regexp: RegExp, message?: string): void;
167
- function doesNotMatch(string: string, regexp: RegExp, message?: string): void;
168
- function fail(message?: string | Error): never;
169
- }
170
- export = assert;
171
- }
172
- declare module 'assert' { import assert = require('node:assert'); export = assert; }
173
- declare module 'node:assert/strict' { import assert = require('node:assert'); export = assert; }
174
- declare module 'assert/strict' { import assert = require('node:assert'); export = assert; }
175
- declare module 'node:events' {
176
- export class EventEmitter {
177
- on(event: string | symbol, listener: (...args: any[]) => void): this;
178
- once(event: string | symbol, listener: (...args: any[]) => void): this;
179
- off(event: string | symbol, listener: (...args: any[]) => void): this;
180
- removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
181
- removeAllListeners(event?: string | symbol): this;
182
- emit(event: string | symbol, ...args: any[]): boolean;
183
- listenerCount(event: string | symbol): number;
184
- listeners(event: string | symbol): Function[];
185
- }
186
- export default EventEmitter;
187
- }
188
- declare module 'events' { export * from 'node:events'; }
189
- declare module 'node:crypto' {
190
- export function createHash(algorithm: 'md5' | 'sha1' | 'sha256' | 'sha512' | string): {
191
- update(data: string | Uint8Array): any;
192
- digest(encoding?: 'hex' | 'base64' | 'base64url'): any;
193
- };
194
- export function createHmac(algorithm: string, key: string | Uint8Array): {
195
- update(data: string | Uint8Array): any;
196
- digest(encoding?: 'hex' | 'base64' | 'base64url'): any;
197
- };
198
- export function timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean;
199
- export function randomUUID(): string;
200
- export function randomBytes(size: number): Buffer;
201
- export function randomInt(min: number, max?: number): number;
202
- export function pbkdf2Sync(password: any, salt: any, iterations: number, keylen: number, digest: string): Buffer;
203
- export function scryptSync(password: any, salt: any, keylen: number, options?: any): Buffer;
204
- export function createCipheriv(algorithm: string, key: any, iv: any): any;
205
- export function createDecipheriv(algorithm: string, key: any, iv: any): any;
206
- }
207
- declare module 'crypto' { export * from 'node:crypto'; }
208
- declare module 'node:fs' {
209
- export function openSync(path: string, flags?: string): number;
210
- export function closeSync(fd: number): void;
211
- export function writeSync(fd: number, buffer: Uint8Array | string, offset?: number, length?: number, position?: number | null): number;
212
- export function readSync(fd: number, buffer: Uint8Array, offset: number, length: number, position: number | null): number;
213
- export function fsyncSync(fd: number): void;
214
- export function fstatSync(fd: number): { size: number; isDirectory(): boolean; isFile(): boolean };
215
- export function statSync(path: string): { size: number; isDirectory(): boolean; isFile(): boolean };
216
- export function existsSync(path: string): boolean;
217
- export function mkdirSync(path: string, options?: any): void;
218
- export function mkdtempSync(prefix: string): string;
219
- export function readdirSync(path: string): string[];
220
- export function readFileSync(path: string, options?: any): any;
221
- export function writeFileSync(path: string, data: any, options?: any): void;
222
- export function appendFileSync(path: string, data: any, options?: any): void;
223
- export function copyFileSync(src: string, dest: string): void;
224
- export function truncateSync(path: string, len?: number): void;
225
- export function renameSync(oldPath: string, newPath: string): void;
226
- export function unlinkSync(path: string): void;
227
- export function rmSync(path: string, options?: any): void;
228
- export const promises: typeof import('node:fs/promises');
229
- }
230
- declare module 'fs' { export * from 'node:fs'; }
231
- declare module 'node:fs/promises' {
232
- export function readFile(path: string, options?: any): Promise<any>;
233
- export function writeFile(path: string, data: any, options?: any): Promise<void>;
234
- export function appendFile(path: string, data: any, options?: any): Promise<void>;
235
- export function mkdir(path: string, options?: any): Promise<void>;
236
- export function readdir(path: string): Promise<string[]>;
237
- export function stat(path: string): Promise<{ size: number; isDirectory(): boolean; isFile(): boolean }>;
238
- export function unlink(path: string): Promise<void>;
239
- export function rm(path: string, options?: any): Promise<void>;
240
- export function rename(oldPath: string, newPath: string): Promise<void>;
241
- }
242
- declare module 'fs/promises' { export * from 'node:fs/promises'; }
243
- declare module 'node:path' {
244
- export function join(...paths: string[]): string;
245
- export function resolve(...paths: string[]): string;
246
- export function normalize(p: string): string;
247
- export function relative(from: string, to: string): string;
248
- export function isAbsolute(p: string): boolean;
249
- export function dirname(p: string): string;
250
- export function basename(p: string, ext?: string): string;
251
- export function extname(p: string): string;
252
- export function parse(p: string): { root: string; dir: string; base: string; ext: string; name: string };
253
- export function format(pObj: any): string;
254
- export const sep: string;
255
- export const delimiter: string;
256
- }
257
- declare module 'path' { export * from 'node:path'; }
258
- declare module 'node:os' {
259
- export function tmpdir(): string;
260
- export function homedir(): string;
261
- export function hostname(): string;
262
- export function platform(): string;
263
- export function arch(): string;
264
- export function cpus(): any[];
265
- export const EOL: string;
266
- }
267
- declare module 'os' { export * from 'node:os'; }
268
- declare module 'node:zlib' {
269
- export function crc32(data: string | Uint8Array, value?: number): number;
270
- export function gzipSync(buf: string | Uint8Array): Buffer;
271
- export function gunzipSync(buf: Uint8Array): Buffer;
272
- export function deflateSync(buf: string | Uint8Array): Buffer;
273
- export function inflateSync(buf: Uint8Array): Buffer;
274
- }
275
- declare module 'zlib' { export * from 'node:zlib'; }
276
- declare module 'node:http' {
277
- export class Agent { constructor(opts?: any); destroy(): void; }
278
- export function createServer(handler: (req: any, res: any) => void): any;
279
- export function request(options: any, callback?: (res: any) => void): any;
280
- export function get(options: any, callback?: (res: any) => void): any;
281
- }
282
- declare module 'http' { export * from 'node:http'; }
283
- declare module 'node:https' { export * from 'node:http'; }
284
- declare module 'https' { export * from 'node:http'; }
285
- declare module 'node:net' {
286
- export class Socket { constructor(opts?: any); connect(...args: any[]): this; write(data: any): boolean; end(data?: any): this; destroy(): this; on(ev: string, cb: (...args: any[]) => void): this; }
287
- export class Server { listen(...args: any[]): this; close(cb?: () => void): this; on(ev: string, cb: (...args: any[]) => void): this; address(): any; }
288
- export function createServer(fn?: (socket: Socket) => void): Server;
289
- export function createConnection(...args: any[]): Socket;
290
- }
291
- declare module 'net' { export * from 'node:net'; }
292
- declare module 'node:stream' {
293
- import { EventEmitter } from 'node:events';
294
- export class Stream extends EventEmitter { pipe<T>(dest: T): T; }
295
- export class Readable extends Stream { constructor(opts?: any); push(chunk: any): boolean; read(size?: number): any; }
296
- export class Writable extends Stream { constructor(opts?: any); write(chunk: any, cb?: any): boolean; end(chunk?: any, cb?: any): this; }
297
- export class Duplex extends Readable { write(chunk: any, cb?: any): boolean; end(chunk?: any, cb?: any): this; }
298
- export class Transform extends Duplex {}
299
- export class PassThrough extends Transform {}
300
- export function pipeline(...streams: any[]): any;
301
- }
302
- declare module 'stream' { export * from 'node:stream'; }
303
- declare module 'node:util' {
304
- export function format(fmt: any, ...args: any[]): string;
305
- export function inspect(obj: any, opts?: any): string;
306
- export function promisify(fn: Function): (...args: any[]) => Promise<any>;
307
- export function callbackify(fn: Function): (...args: any[]) => void;
308
- export function inherits(ctor: any, superCtor: any): void;
309
- export const types: Record<string, (val: any) => boolean>;
310
- export class TextEncoder { encode(input?: string): Uint8Array; }
311
- export class TextDecoder { decode(input?: Uint8Array): string; }
312
- }
313
- declare module 'util' { export * from 'node:util'; }
314
- declare module 'node:url' {
315
- export { URL, URLSearchParams };
316
- export function parse(urlStr: string, parseQueryString?: boolean): any;
317
- export function format(urlObj: any): string;
318
- }
319
- declare module 'url' { export * from 'node:url'; }
320
- declare module 'node:querystring' {
321
- export function parse(str: string): Record<string, any>;
322
- export function stringify(obj: Record<string, any>): string;
323
- }
324
- declare module 'querystring' { export * from 'node:querystring'; }
325
- declare module 'node:perf_hooks' {
326
- export const performance: { now(): number; timeOrigin: number; mark(name: string): void; measure(name: string, start?: string, end?: string): void };
327
- }
328
- declare module 'perf_hooks' { export * from 'node:perf_hooks'; }
329
- declare module 'node:timers' {
330
- export { setTimeout, clearTimeout, setInterval, clearInterval, setImmediate, clearImmediate };
331
- }
332
- declare module 'timers' { export * from 'node:timers'; }
333
- declare module 'node:timers/promises' {
334
- export function setTimeout<T = void>(delay?: number, value?: T): Promise<T>;
335
- export function setImmediate<T = void>(value?: T): Promise<T>;
336
- }
337
- declare module 'timers/promises' { export * from 'node:timers/promises'; }
338
- declare module 'node:string_decoder' {
339
- export class StringDecoder { constructor(encoding?: string); write(buf: Uint8Array): string; end(buf?: Uint8Array): string; }
340
- }
341
- declare module 'string_decoder' { export * from 'node:string_decoder'; }
342
- declare module 'node:dns' {
343
- export function lookup(hostname: string, cb: (err: any, address: string, family: number) => void): void;
344
- export function resolve(hostname: string, cb: (err: any, records: string[]) => void): void;
345
- }
346
- declare module 'dns' { export * from 'node:dns'; }
347
- declare module 'node:child_process' {
348
- export function execSync(cmd: string, opts?: any): Buffer | string;
349
- export function spawn(cmd: string, args?: string[], opts?: any): any;
350
- }
351
- declare module 'child_process' { export * from 'node:child_process'; }
352
- declare module 'node:buffer' { export { Buffer }; }
353
- declare module 'buffer' { export { Buffer }; }
354
- declare const Bun: {
355
- version: string;
356
- revision: string;
357
- env: Record<string, string | undefined>;
358
- serve(options: { port?: number; hostname?: string; fetch(req: Request, server?: any): Response | Promise<Response>; error?(err: Error): Response | Promise<Response> }): { port: number; hostname: string; url: string; stop(closeActiveConnections?: boolean): void };
359
- file(path: string, options?: { type?: string }): { size: number; type: string; text(): Promise<string>; json(): Promise<any>; arrayBuffer(): Promise<ArrayBuffer>; bytes(): Promise<Uint8Array>; exists(): Promise<boolean> };
360
- write(dest: string | any, input: string | Uint8Array | ArrayBuffer | Response | any): Promise<number>;
361
- sleep(ms: number): Promise<void>;
362
- sleepSync(ms: number): void;
363
- hash(input: string | Uint8Array, seed?: number): number;
364
- deepEquals(a: any, b: any, strict?: boolean): boolean;
365
- inspect(val: any): string;
366
- nanoseconds(): number;
367
- which(bin: string): string | null;
368
- escapeHTML(str: string): string;
369
- stringWidth(str: string): number;
370
- };
371
- declare module 'bun' {
372
- export const version: string;
373
- export const env: Record<string, string | undefined>;
374
- export const serve: typeof Bun.serve;
375
- export const file: typeof Bun.file;
376
- export const write: typeof Bun.write;
377
- export const sleep: typeof Bun.sleep;
378
- export const sleepSync: typeof Bun.sleepSync;
379
- export const hash: typeof Bun.hash;
380
- export const deepEquals: typeof Bun.deepEquals;
381
- export const inspect: typeof Bun.inspect;
382
- export const nanoseconds: typeof Bun.nanoseconds;
383
- export const which: typeof Bun.which;
384
- export const escapeHTML: typeof Bun.escapeHTML;
385
- export const stringWidth: typeof Bun.stringWidth;
386
- export default Bun;
387
- }
388
- declare module 'bun:test' {
389
- export function test(name: string, fn: () => any, timeout?: number): Promise<void>;
390
- export function it(name: string, fn: () => any, timeout?: number): Promise<void>;
391
- export function describe(name: string, fn: () => void): void;
392
- export function beforeAll(fn: () => any): void;
393
- export function afterAll(fn: () => any): void;
394
- export function beforeEach(fn: () => any): void;
395
- export function afterEach(fn: () => any): void;
396
- export function expect(actual: any): any;
397
- export const mock: any;
398
- export const jest: any;
399
- }
400
- declare module 'bun:sqlite' {
401
- export class Database {
402
- constructor(filename?: string, options?: any);
403
- exec(sql: string): this;
404
- run(sql: string, ...params: any[]): { changes: number; lastInsertRowid: number };
405
- query(sql: string): { all(...params: any[]): any[]; get(...params: any[]): any; values(...params: any[]): any[][]; run(...params: any[]): { changes: number; lastInsertRowid: number } };
406
- prepare(sql: string): { all(...params: any[]): any[]; get(...params: any[]): any; values(...params: any[]): any[][]; run(...params: any[]): { changes: number; lastInsertRowid: number }; finalize(): void };
407
- transaction<T extends (...args: any[]) => any>(fn: T): T;
408
- close(): void;
409
- }
410
- export default Database;
411
- }
412
- `;
413
89
 
414
90
  const _sharedHtmlMod = (typeof CodeLabHtml !== 'undefined' && CodeLabHtml) ||
415
91
  (root && root.CodeLabHtml) ||
@@ -1113,8 +789,6 @@ declare module 'bun:sqlite' {
1113
789
  if (typeof jsDefaults.setEagerModelSync === 'function') jsDefaults.setEagerModelSync(true);
1114
790
  tsDefaults.setDiagnosticsOptions({ noSemanticValidation: false, noSyntaxValidation: false });
1115
791
  jsDefaults.setDiagnosticsOptions({ noSemanticValidation: false, noSyntaxValidation: false });
1116
- tsDefaults.addExtraLib(NODE_AMBIENT_DTS, 'file:///node-ambient.d.ts');
1117
- jsDefaults.addExtraLib(NODE_AMBIENT_DTS, 'file:///node-ambient.d.ts');
1118
792
  }
1119
793
 
1120
794
  resolve(m);
@@ -3719,15 +3393,14 @@ int main() {
3719
3393
  if (project.gitMeta && typeof project.gitMeta === 'object' && typeof this._restoreSavedGitState === 'function') {
3720
3394
  this._restoreSavedGitState(project.gitMeta);
3721
3395
  } else if (project.gitFiles && root.CodeLabScm && typeof root.CodeLabScm.hydrateFromIsoGitRepo === 'function' && this.shell && this.shell.vfs) {
3722
- const gs = this._getGitState();
3723
- if (gs) {
3724
- Promise.resolve(root.CodeLabScm.hydrateFromIsoGitRepo(this.shell.vfs, gs)).then((hydrated) => {
3725
- if (hydrated && !this._destroyed) {
3726
- if (this.activeSidebarView === 'scm') this._renderScmSidebar();
3727
- this._updateStatusBar();
3728
- }
3729
- }).catch((_e) => { void _e; });
3730
- }
3396
+ Promise.resolve(root.CodeLabScm.hydrateFromIsoGitRepo(this.shell.vfs, '/workspace')).then((hydrated) => {
3397
+ if (hydrated && !this._destroyed) {
3398
+ this._gitState = hydrated;
3399
+ if (this.shell) this.shell.gitState = hydrated;
3400
+ if (this.activeSidebarView === 'scm') this._renderScmSidebar();
3401
+ this._updateStatusBar();
3402
+ }
3403
+ }).catch((_e) => { void _e; });
3731
3404
  }
3732
3405
  this._buildSavedStateSnapshot({ flushFiles: true });
3733
3406
  this._syncAllModels();
@@ -3994,14 +3667,16 @@ int main() {
3994
3667
  if (probsTextEl) {
3995
3668
  let errs = 0;
3996
3669
  let warns = 0;
3670
+ let infos = 0;
3997
3671
  if (this._diagnosticsStore && typeof this._diagnosticsStore.getAll === 'function') {
3998
3672
  const storeItems = this._diagnosticsStore.getAll();
3999
3673
  for (const p of storeItems) {
4000
3674
  if (p && p.severity === 'error') errs++;
4001
3675
  else if (p && p.severity === 'warning') warns++;
3676
+ else if (p) infos++;
4002
3677
  }
4003
3678
  }
4004
- probsTextEl.textContent = `⊗ ${errs} ⚠ ${warns}`;
3679
+ probsTextEl.textContent = infos > 0 ? `⊗ ${errs} ⚠ ${warns} ⓘ ${infos}` : `⊗ ${errs} ⚠ ${warns}`;
4005
3680
  }
4006
3681
  const hasDirty = Boolean((this._dirtyFiles && this._dirtyFiles.size > 0) || this.saveStatusState === 'dirty');
4007
3682
  if (saveEl) {
@@ -4759,9 +4434,6 @@ int main() {
4759
4434
  <button type="button" class="codelab-btn codelab-btn--icon ${this.panelVisible ? 'active' : ''}" id="cl-toggle-drawer-btn" data-cl-action="toggle-drawer" title="Toggle Panel (⌘J)" aria-label="Toggle Panel" aria-pressed="${this.panelVisible ? 'true' : 'false'}">
4760
4435
  ${CL_ICONS.panelBottom}
4761
4436
  </button>
4762
- <button type="button" class="codelab-btn codelab-btn--icon" id="cl-settings-btn" data-cl-action="open-settings" title="Settings (⌘,)" aria-label="Open Settings">
4763
- ${CL_ICONS.settings}
4764
- </button>
4765
4437
  <button type="button" class="codelab-btn codelab-btn--icon" id="cl-fullscreen-btn" data-cl-action="toggle-fullscreen" title="Toggle Fullscreen IDE (Esc to exit)" aria-label="Toggle Fullscreen IDE">
4766
4438
  ${CL_ICONS.maximize}
4767
4439
  </button>
@@ -4780,25 +4452,25 @@ int main() {
4780
4452
  <nav class="codelab-activitybar" id="cl-activitybar" aria-label="Activity Bar">
4781
4453
  <div class="codelab-activitybar__top">
4782
4454
  <button type="button" class="codelab-activitybar__btn codelab-activitybar__item ${this.sidebarVisible && this.activeSidebarView === 'explorer' ? 'active' : ''}" data-cl-activity="explorer" title="Explorer (⇧⌘E)" aria-label="Explorer" aria-pressed="${this.sidebarVisible && this.activeSidebarView === 'explorer'}">
4783
- ${CL_ICONS.files}
4455
+ ${CL_ICONS.activityExplorer || CL_ICONS.files}
4784
4456
  </button>
4785
4457
  <button type="button" class="codelab-activitybar__btn codelab-activitybar__item ${this.sidebarVisible && this.activeSidebarView === 'search' ? 'active' : ''}" data-cl-activity="search" title="Search (⇧⌘F)" aria-label="Search" aria-pressed="${this.sidebarVisible && this.activeSidebarView === 'search'}">
4786
- ${CL_ICONS.search}
4458
+ ${CL_ICONS.activitySearch || CL_ICONS.search}
4787
4459
  </button>
4788
4460
  <button type="button" class="codelab-activitybar__btn codelab-activitybar__item ${this.sidebarVisible && this.activeSidebarView === 'scm' ? 'active' : ''}" data-cl-activity="scm" title="Source Control (⌃⇧G)" aria-label="Source Control" aria-pressed="${this.sidebarVisible && this.activeSidebarView === 'scm'}">
4789
- ${CL_ICONS.gitBranch}
4461
+ ${CL_ICONS.activityScm || CL_ICONS.gitBranch}
4790
4462
  <span class="codelab-activitybar__badge" id="cl-activity-scm-badge" hidden>0</span>
4791
4463
  </button>
4792
4464
  <div class="codelab-activitybar__plugins" id="cl-activitybar-plugins">${pluginSidebarBtnsHtml}</div>
4793
4465
  ${this.hasGuidedLab ? `
4794
4466
  <button type="button" class="codelab-activitybar__btn codelab-activitybar__item ${!isGuideCollapsed ? 'active' : ''}" data-cl-action="toggle-guide" title="Guided Lab Steps" aria-label="Guided Lab Steps" aria-pressed="${!isGuideCollapsed}">
4795
- ${CL_ICONS.book}
4467
+ ${CL_ICONS.activityGuided || CL_ICONS.book}
4796
4468
  </button>
4797
4469
  ` : ''}
4798
4470
  </div>
4799
4471
  <div class="codelab-activitybar__bottom">
4800
4472
  <button type="button" class="codelab-activitybar__btn codelab-activitybar__item ${this.activeTab === '__settings__' ? 'active' : ''}" data-cl-activity="settings" data-cl-action="open-settings" title="Settings (⌘,)" aria-label="Settings" aria-pressed="${this.activeTab === '__settings__'}">
4801
- ${CL_ICONS.settings}
4473
+ ${CL_ICONS.activitySettings || CL_ICONS.settings}
4802
4474
  </button>
4803
4475
  </div>
4804
4476
  </nav>
@@ -4954,9 +4626,9 @@ int main() {
4954
4626
  <span>Ports</span>
4955
4627
  <span class="codelab-drawer__pill" id="cl-ports-pill" style="display:${(this.portTable && typeof this.portTable.listServers === 'function' && this.portTable.listServers().length > 0) ? 'inline-flex' : 'none'}">${this.portTable && typeof this.portTable.listServers === 'function' ? this.portTable.listServers().length : 0} open</span>
4956
4628
  </button>
4957
- <button type="button" role="tab" tabindex="${this.drawerTab === 'tests' ? '0' : '-1'}" aria-selected="${this.drawerTab === 'tests'}" class="codelab-drawer__tab ${this.drawerTab === 'tests' ? 'active' : ''}" data-cl-drawertab="tests" style="${(isSingleSql && !this._findEntryFile('test')) ? 'display:none' : ''}">
4629
+ <button type="button" role="tab" tabindex="${this.drawerTab === 'tests' ? '0' : '-1'}" aria-selected="${this.drawerTab === 'tests'}" class="codelab-drawer__tab ${this.drawerTab === 'tests' ? 'active' : ''}" data-cl-drawertab="tests" title="Test Suite" style="${(isSingleSql && !this._findEntryFile('test')) ? 'display:none' : ''}">
4958
4630
  ${CL_ICONS.check}
4959
- <span>Test Suite</span>
4631
+ <span>Tests</span>
4960
4632
  <span class="codelab-drawer__pill" id="cl-test-pill" style="display:none">Ready</span>
4961
4633
  </button>
4962
4634
  <button type="button" role="tab" tabindex="${this.drawerTab === 'stdin' ? '0' : '-1'}" aria-selected="${this.drawerTab === 'stdin'}" class="codelab-drawer__tab ${this.drawerTab === 'stdin' ? 'active' : ''}" data-cl-drawertab="stdin" title="Standard Input" style="${isSingleSql ? 'display:none' : ''}">
@@ -4965,16 +4637,16 @@ int main() {
4965
4637
  </button>
4966
4638
  <button type="button" role="tab" tabindex="${this.drawerTab === 'preview' ? '0' : '-1'}" aria-selected="${this.drawerTab === 'preview'}" class="codelab-drawer__tab ${this.drawerTab === 'preview' ? 'active' : ''}" data-cl-drawertab="preview" title="In-browser Web Preview" style="${isSingleSql ? 'display:none' : ''}">
4967
4639
  ${CL_ICONS.globe}
4968
- <span>Web Preview</span>
4640
+ <span>Preview</span>
4969
4641
  </button>
4970
4642
  <button type="button" role="tab" tabindex="${this.drawerTab === 'network' ? '0' : '-1'}" aria-selected="${this.drawerTab === 'network'}" class="codelab-drawer__tab ${this.drawerTab === 'network' ? 'active' : ''}" data-cl-drawertab="network" style="${isSingleSql ? 'display:none' : ''}">
4971
4643
  ${CL_ICONS.activity}
4972
4644
  <span>Network</span>
4973
4645
  <span class="codelab-drawer__pill" id="cl-network-pill" style="display:${(this.lastHttpTrace || []).length > 0 ? 'inline-flex' : 'none'}">${(this.lastHttpTrace || []).length} reqs</span>
4974
4646
  </button>
4975
- <button type="button" role="tab" tabindex="${this.drawerTab === 'inspector' ? '0' : '-1'}" aria-selected="${this.drawerTab === 'inspector'}" class="codelab-drawer__tab ${this.drawerTab === 'inspector' ? 'active' : ''}" data-cl-drawertab="inspector" style="${isSingleSql ? 'display:none' : ''}">
4647
+ <button type="button" role="tab" tabindex="${this.drawerTab === 'inspector' ? '0' : '-1'}" aria-selected="${this.drawerTab === 'inspector'}" class="codelab-drawer__tab ${this.drawerTab === 'inspector' ? 'active' : ''}" data-cl-drawertab="inspector" title="Virtual Disk &amp; HTTP Inspector" style="${isSingleSql ? 'display:none' : ''}">
4976
4648
  ${CL_ICONS.database}
4977
- <span>Virtual Disk &amp; HTTP</span>
4649
+ <span>Inspector</span>
4978
4650
  <span class="codelab-drawer__pill" id="cl-vfs-pill" style="display:none">0 files</span>
4979
4651
  </button>
4980
4652
  ${this.kernel ? `
@@ -5136,9 +4808,14 @@ int main() {
5136
4808
  }
5137
4809
  }
5138
4810
  const code = this.files[filePath];
5139
- if (_wbComponents && typeof _wbComponents.findEnclosingSymbolAtLine === 'function') {
4811
+ if (
4812
+ _wbComponents &&
4813
+ typeof _wbComponents.extractDocumentSymbols === 'function' &&
4814
+ typeof _wbComponents.findEnclosingSymbolAtLine === 'function'
4815
+ ) {
5140
4816
  const curLine = (this.cursorPos && this.cursorPos.lineNumber) ? this.cursorPos.lineNumber : 1;
5141
- const sym = _wbComponents.findEnclosingSymbolAtLine(filePath, code, curLine);
4817
+ const symbols = _wbComponents.extractDocumentSymbols(filePath, code);
4818
+ const sym = _wbComponents.findEnclosingSymbolAtLine(symbols, curLine);
5142
4819
  if (sym && sym.name) {
5143
4820
  return sym.containerName ? `${sym.containerName}.${sym.name}` : sym.name;
5144
4821
  }
@@ -5250,11 +4927,6 @@ int main() {
5250
4927
  </div>
5251
4928
  <div class="codelab-breadcrumbs__actions">
5252
4929
  ${diffBtnHtml}
5253
- <button type="button" class="codelab-breadcrumb__btn" data-action="command-palette" data-cl-action="command-palette" title="Open Command Palette (⌘⇧P)">
5254
- ${CL_ICONS.command}
5255
- <span>Command Palette</span>
5256
- <kbd class="codelab-breadcrumb__kbd">⌘⇧P</kbd>
5257
- </button>
5258
4930
  <button type="button" class="codelab-breadcrumb__btn" data-action="export-workspace" data-cl-action="export-workspace" title="Export Workspace Snapshot">
5259
4931
  ${CL_ICONS.download}
5260
4932
  <span>Export</span>
@@ -11768,6 +11440,17 @@ int main() {
11768
11440
  _bindEvents() {
11769
11441
  if (this._isBooting || this._eventsBound) return;
11770
11442
  this._eventsBound = true;
11443
+ if (Array.isArray(this._containerListeners) && this.container && typeof this.container.removeEventListener === 'function') {
11444
+ for (const [evType, evFn, evOpts] of this._containerListeners) {
11445
+ try { this.container.removeEventListener(evType, evFn, evOpts); } catch (_err) { void _err; }
11446
+ }
11447
+ }
11448
+ this._containerListeners = [];
11449
+ const onContainer = (type, fn, opts) => {
11450
+ if (!this.container || typeof this.container.addEventListener !== 'function') return;
11451
+ this.container.addEventListener(type, fn, opts);
11452
+ this._containerListeners.push([type, fn, opts]);
11453
+ };
11771
11454
 
11772
11455
  this._bindSplitters();
11773
11456
 
@@ -12003,7 +11686,7 @@ int main() {
12003
11686
  return;
12004
11687
  }
12005
11688
  };
12006
- this.container.addEventListener('keydown', this._captureKeydownHandler, true);
11689
+ onContainer('keydown', this._captureKeydownHandler, true);
12007
11690
  if (typeof document !== 'undefined' && typeof document.addEventListener === 'function') {
12008
11691
  this._documentKeydownHandler = e => {
12009
11692
  if (!e || e.defaultPrevented || this._destroyed) return;
@@ -12052,7 +11735,7 @@ int main() {
12052
11735
  document.addEventListener('keydown', this._documentKeydownHandler);
12053
11736
  }
12054
11737
 
12055
- this.container.addEventListener('pointerdown', e => {
11738
+ onContainer('pointerdown', e => {
12056
11739
  if (e && e.target && typeof e.target.closest === 'function' && e.target.closest('#cl-activitybar [data-cl-activity]')) {
12057
11740
  const ae = (typeof document !== 'undefined' && document.activeElement) ? document.activeElement : null;
12058
11741
  const focusInOtherRegion = Boolean(
@@ -12066,7 +11749,7 @@ int main() {
12066
11749
  }
12067
11750
  }, true);
12068
11751
 
12069
- this.container.addEventListener('pointerdown', e => {
11752
+ onContainer('pointerdown', e => {
12070
11753
  CodeLabWorkbench._lastActiveInstance = this;
12071
11754
  this._lastBackdropPointerDownTarget = (e && e.target) ? e.target : null;
12072
11755
  if (e && e.target && typeof e.target.closest === 'function' && e.target.closest('.codelab-menubar__trigger[data-cl-menu]')) {
@@ -12075,11 +11758,11 @@ int main() {
12075
11758
  this._menuOpenBeforePointerDown = undefined;
12076
11759
  }
12077
11760
  });
12078
- this.container.addEventListener('focusin', () => {
11761
+ onContainer('focusin', () => {
12079
11762
  CodeLabWorkbench._lastActiveInstance = this;
12080
11763
  });
12081
11764
 
12082
- this.container.addEventListener('mouseover', e => {
11765
+ onContainer('mouseover', e => {
12083
11766
  if (!e || !e.target || typeof e.target.closest !== 'function') return;
12084
11767
  if (this._activeTopMenu) {
12085
11768
  const trigger = e.target.closest('.codelab-menubar__trigger[data-cl-menu]');
@@ -12111,7 +11794,7 @@ int main() {
12111
11794
  }
12112
11795
  });
12113
11796
 
12114
- this.container.addEventListener('input', e => {
11797
+ onContainer('input', e => {
12115
11798
  if (!e || !e.target) return;
12116
11799
  const t = e.target;
12117
11800
  if (t.id === 'cl-search-input') {
@@ -12153,7 +11836,7 @@ int main() {
12153
11836
  }
12154
11837
  });
12155
11838
 
12156
- this.container.addEventListener('change', e => {
11839
+ onContainer('change', e => {
12157
11840
  if (!e || !e.target) return;
12158
11841
  const t = e.target;
12159
11842
  if (t.id === 'cl-scm-branch-select' && typeof t.value === 'string' && t.value) {
@@ -12163,7 +11846,7 @@ int main() {
12163
11846
  }
12164
11847
  });
12165
11848
 
12166
- this.container.addEventListener('keydown', e => {
11849
+ onContainer('keydown', e => {
12167
11850
  const keyLower = (e.key || '').toLowerCase();
12168
11851
  const target = e.target;
12169
11852
  const hasClosest = Boolean(target && typeof target.closest === 'function');
@@ -12712,7 +12395,7 @@ int main() {
12712
12395
  }
12713
12396
  });
12714
12397
 
12715
- this.container.addEventListener('contextmenu', e => {
12398
+ onContainer('contextmenu', e => {
12716
12399
  const tabEl = e.target.closest('.codelab-tab');
12717
12400
  if (tabEl && (tabEl.dataset.clFile || tabEl.dataset.tabFile)) {
12718
12401
  e.preventDefault();
@@ -12780,10 +12463,10 @@ int main() {
12780
12463
  }
12781
12464
  }
12782
12465
  };
12783
- this.container.addEventListener('auxclick', handleTabMiddleClick);
12784
- this.container.addEventListener('mousedown', handleTabMiddleClick);
12466
+ onContainer('auxclick', handleTabMiddleClick);
12467
+ onContainer('mousedown', handleTabMiddleClick);
12785
12468
 
12786
- this.container.addEventListener('click', e => {
12469
+ onContainer('click', e => {
12787
12470
  const menuCmdBtn = e.target.closest('[data-cl-menu-cmd]');
12788
12471
  if (menuCmdBtn) {
12789
12472
  e.stopPropagation();
@@ -13641,7 +13324,7 @@ int main() {
13641
13324
  }
13642
13325
  });
13643
13326
 
13644
- this.container.addEventListener('change', e => {
13327
+ onContainer('change', e => {
13645
13328
  const previewPortSelect = e.target && typeof e.target.closest === 'function'
13646
13329
  ? e.target.closest('[data-cl-action="preview-port-change"]')
13647
13330
  : null;
@@ -17150,7 +16833,7 @@ int main() {
17150
16833
  if (!this._diagnosticsStore && diagMod && typeof diagMod.createDiagnosticsStore === 'function') {
17151
16834
  this._diagnosticsStore = diagMod.createDiagnosticsStore();
17152
16835
  if (typeof this._diagnosticsStore.subscribe === 'function') {
17153
- this._diagnosticsStore.subscribe(() => {
16836
+ this._diagnosticsUnsub = this._diagnosticsStore.subscribe(() => {
17154
16837
  if (this._destroyed || !this.container) return;
17155
16838
  const badgeEl = this.container.querySelector('#cl-problems-count');
17156
16839
  if (badgeEl && typeof this._diagnosticsStore.getAll === 'function') {
@@ -18246,9 +17929,9 @@ int main() {
18246
17929
  void _err;
18247
17930
  }
18248
17931
  }
18249
- if (this.kernel && this.kernel.fs && typeof this.kernel.fs.writeFileSync === 'function') {
17932
+ if (this.kernel && this.kernel.fs && typeof this.kernel.fs.writeFile === 'function') {
18250
17933
  try {
18251
- this.kernel.fs.writeFileSync(absPath, content);
17934
+ this.kernel.fs.writeFile(absPath, content);
18252
17935
  } catch (_err) {
18253
17936
  void _err;
18254
17937
  }
@@ -18416,9 +18099,9 @@ int main() {
18416
18099
  const restored = String(this.files[cleanRel] ?? '');
18417
18100
  if (this._dirtyFiles) this._dirtyFiles.delete(cleanRel);
18418
18101
  if (this._savedSnapshot) this._savedSnapshot[cleanRel] = restored;
18419
- if (this.kernel && this.kernel.fs && typeof this.kernel.fs.writeFileSync === 'function') {
18102
+ if (this.kernel && this.kernel.fs && typeof this.kernel.fs.writeFile === 'function') {
18420
18103
  try {
18421
- this.kernel.fs.writeFileSync(`/workspace/${cleanRel}`, restored);
18104
+ this.kernel.fs.writeFile(`/workspace/${cleanRel}`, restored);
18422
18105
  } catch (_err) {
18423
18106
  void _err;
18424
18107
  }
@@ -21683,6 +21366,16 @@ int main() {
21683
21366
  }
21684
21367
  this._portToasts.clear();
21685
21368
  }
21369
+ if (typeof this._diagnosticsUnsub === 'function') {
21370
+ try { this._diagnosticsUnsub(); } catch (_err) { void _err; }
21371
+ this._diagnosticsUnsub = null;
21372
+ }
21373
+ if (Array.isArray(this._containerListeners) && this.container && typeof this.container.removeEventListener === 'function') {
21374
+ for (const [evType, evFn, evOpts] of this._containerListeners) {
21375
+ try { this.container.removeEventListener(evType, evFn, evOpts); } catch (_err) { void _err; }
21376
+ }
21377
+ this._containerListeners = [];
21378
+ }
21686
21379
  if (this._markerDisposable && typeof this._markerDisposable.dispose === 'function') {
21687
21380
  try { this._markerDisposable.dispose(); } catch (err) { this.logger.debug('markerDisposable dispose skipped.', err); }
21688
21381
  this._markerDisposable = null;