@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.
- package/ARCHITECTURE.md +11 -6
- package/CHANGELOG.md +27 -0
- package/README.md +18 -8
- package/dist/code-lab.css +198 -0
- package/dist/code-lab.d.ts +27 -9
- package/dist/code-lab.esm.js +8248 -83
- package/dist/code-lab.js +8246 -81
- package/dist/extensions/cpp.d.ts +32 -6
- package/dist/extensions/cpp.esm.js +745 -6
- package/dist/extensions/cpp.js +745 -6
- package/dist/extensions/guided-lab.esm.js +39 -1
- package/dist/extensions/guided-lab.js +39 -1
- package/dist/extensions/python.d.ts +92 -0
- package/dist/extensions/python.esm.js +5476 -0
- package/dist/extensions/python.js +5495 -0
- package/dist/index.d.ts +7 -4
- package/dist/preview-sw.js +1 -1
- package/dist/runtime/index.d.ts +4 -0
- package/dist/runtime/module-loader.d.ts +11 -0
- package/dist/runtime/test-harness.d.ts +24 -0
- package/dist/runtime/vfs.d.ts +31 -0
- package/dist/runtime/wasi-host.d.ts +33 -0
- package/dist/runtime.esm.js +36 -4
- package/dist/runtime.js +36 -4
- package/dist/schemas.d.ts +134 -21
- package/dist/schemas.esm.js +43 -1
- package/dist/schemas.js +43 -1
- package/dist/shell/coreutils/compilers-cli.d.ts +24 -0
- package/dist/shell/index.d.ts +4 -0
- package/dist/shell/lexer-parser.d.ts +26 -0
- package/dist/shell.esm.js +113 -1
- package/dist/shell.js +113 -1
- package/dist/terminal.esm.js +1 -1
- package/dist/terminal.js +1 -1
- package/dist/workbench/command-palette.d.ts +10 -0
- package/dist/workbench/diff-editor.d.ts +26 -0
- package/dist/workbench/drawer.d.ts +18 -0
- package/dist/workbench/editor.d.ts +11 -0
- package/dist/workbench/file-tree.d.ts +11 -0
- package/dist/workbench/guided-pane.d.ts +11 -0
- package/dist/workbench/icons.d.ts +5 -0
- package/dist/workbench/index.d.ts +39 -0
- package/dist/workbench/share.d.ts +21 -0
- package/dist/workbench/styles.d.ts +4 -0
- package/dist/workbench/toolbar.d.ts +17 -0
- package/dist/workbench.d.ts +6 -1
- package/package.json +8 -2
- package/src/code-lab.css +198 -0
- package/src/extensions/cpp.ts +710 -5
- package/src/extensions/python.ts +1293 -0
- package/src/index.ts +35 -3
- package/src/runtime/index.ts +5 -0
- package/src/runtime/test-harness.ts +57 -0
- package/src/runtime.ts +35 -3
- package/src/schemas.ts +46 -1
- package/src/shell/coreutils/compilers-cli.ts +103 -0
- package/src/shell/index.ts +5 -0
- package/src/shell.ts +112 -0
- package/src/workbench/command-palette.ts +140 -0
- package/src/workbench/diff-editor.ts +216 -0
- package/src/workbench/drawer.ts +148 -0
- package/src/workbench/editor.ts +49 -0
- package/src/workbench/file-tree.ts +51 -0
- package/src/workbench/guided-pane.ts +33 -0
- package/src/workbench/icons.ts +48 -0
- package/src/workbench/index.ts +38 -0
- package/src/workbench/share.ts +99 -0
- package/src/workbench/styles.ts +200 -0
- package/src/workbench/toolbar.ts +171 -0
- package/src/workbench.ts +755 -70
package/dist/schemas.esm.js
CHANGED
|
@@ -4058,7 +4058,8 @@ var GuidedStepSchema = external_exports.object({
|
|
|
4058
4058
|
hint: external_exports.string().optional(),
|
|
4059
4059
|
testNames: external_exports.array(external_exports.string()).optional()
|
|
4060
4060
|
});
|
|
4061
|
-
var LanguageIdSchema = external_exports.enum(["js", "ts", "cpp"]);
|
|
4061
|
+
var LanguageIdSchema = external_exports.enum(["js", "ts", "cpp", "py"]);
|
|
4062
|
+
var LanguageEnum = LanguageIdSchema;
|
|
4062
4063
|
var LanguageBundleSchema = external_exports.object({
|
|
4063
4064
|
language: LanguageIdSchema.default("js"),
|
|
4064
4065
|
files: external_exports.record(external_exports.string()).default({}),
|
|
@@ -4081,6 +4082,12 @@ var GuidedLabExtensionOptionsSchema = external_exports.object({
|
|
|
4081
4082
|
cppStarterFiles: external_exports.record(external_exports.string()).optional(),
|
|
4082
4083
|
cppSolutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4083
4084
|
cppFiles: external_exports.record(external_exports.string()).optional(),
|
|
4085
|
+
pyStarterFiles: external_exports.record(external_exports.string()).optional(),
|
|
4086
|
+
pySolutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4087
|
+
pyFiles: external_exports.record(external_exports.string()).optional(),
|
|
4088
|
+
pyEntry: external_exports.string().optional(),
|
|
4089
|
+
pyTestEntry: external_exports.string().optional(),
|
|
4090
|
+
pyTestCode: external_exports.string().optional(),
|
|
4084
4091
|
summary: external_exports.string().optional(),
|
|
4085
4092
|
onStepComplete: external_exports.function().args(GuidedStepSchema, external_exports.number()).returns(external_exports.void()).optional(),
|
|
4086
4093
|
onLabComplete: external_exports.function().args(external_exports.string()).returns(external_exports.void()).optional()
|
|
@@ -4112,6 +4119,30 @@ var CppExtensionOptionsSchema = external_exports.object({
|
|
|
4112
4119
|
solutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4113
4120
|
onProgress: external_exports.function().args(external_exports.any()).returns(external_exports.void()).optional()
|
|
4114
4121
|
});
|
|
4122
|
+
var PythonToolchainProgressSchema = external_exports.object({
|
|
4123
|
+
stage: external_exports.enum(["downloading", "caching", "extracting", "initializing", "ready"]),
|
|
4124
|
+
loadedBytes: external_exports.number().optional(),
|
|
4125
|
+
totalBytes: external_exports.number().optional(),
|
|
4126
|
+
percent: external_exports.number().optional(),
|
|
4127
|
+
message: external_exports.string().optional()
|
|
4128
|
+
});
|
|
4129
|
+
var PythonExtensionOptionsSchema = external_exports.object({
|
|
4130
|
+
cdnBaseUrl: external_exports.string().optional(),
|
|
4131
|
+
indexUrl: external_exports.string().optional(),
|
|
4132
|
+
pyodideIndexUrl: external_exports.string().optional(),
|
|
4133
|
+
cacheInIndexedDB: external_exports.boolean().default(true),
|
|
4134
|
+
preload: external_exports.boolean().default(false),
|
|
4135
|
+
activate: external_exports.boolean().optional(),
|
|
4136
|
+
entry: external_exports.string().default("main.py"),
|
|
4137
|
+
testEntry: external_exports.string().default("test.py"),
|
|
4138
|
+
packages: external_exports.array(external_exports.string()).optional(),
|
|
4139
|
+
preloadPackages: external_exports.array(external_exports.string()).optional(),
|
|
4140
|
+
compilerMemoryLimitMb: external_exports.number().optional(),
|
|
4141
|
+
files: external_exports.record(external_exports.string()).optional(),
|
|
4142
|
+
starterFiles: external_exports.record(external_exports.string()).optional(),
|
|
4143
|
+
solutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4144
|
+
onProgress: external_exports.function().args(external_exports.any()).returns(external_exports.void()).optional()
|
|
4145
|
+
});
|
|
4115
4146
|
var CloneProgressPhaseSchema = external_exports.enum([
|
|
4116
4147
|
"connecting",
|
|
4117
4148
|
"metadata",
|
|
@@ -4207,6 +4238,14 @@ var WorkbenchOptionsSchema = external_exports.object({
|
|
|
4207
4238
|
cppFiles: external_exports.record(external_exports.string()).optional(),
|
|
4208
4239
|
cppStarterFiles: external_exports.record(external_exports.string()).optional(),
|
|
4209
4240
|
cppSolutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4241
|
+
pyFiles: external_exports.record(external_exports.string()).optional(),
|
|
4242
|
+
pyStarterFiles: external_exports.record(external_exports.string()).optional(),
|
|
4243
|
+
pySolutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4244
|
+
pyEntry: external_exports.string().optional().default("main.py"),
|
|
4245
|
+
pyTestEntry: external_exports.string().optional().default("test.py"),
|
|
4246
|
+
pyTestCode: external_exports.string().optional(),
|
|
4247
|
+
showWebPreview: external_exports.boolean().optional(),
|
|
4248
|
+
stdin: external_exports.string().optional(),
|
|
4210
4249
|
guided: external_exports.any().optional(),
|
|
4211
4250
|
mode: external_exports.enum(["guided", "sandbox"]).optional(),
|
|
4212
4251
|
language: LanguageIdSchema.optional(),
|
|
@@ -4292,7 +4331,10 @@ export {
|
|
|
4292
4331
|
GuidedLabExtensionOptionsSchema,
|
|
4293
4332
|
GuidedStepSchema,
|
|
4294
4333
|
LanguageBundleSchema,
|
|
4334
|
+
LanguageEnum,
|
|
4295
4335
|
LanguageIdSchema,
|
|
4336
|
+
PythonExtensionOptionsSchema,
|
|
4337
|
+
PythonToolchainProgressSchema,
|
|
4296
4338
|
RuntimeExecuteOptionsSchema,
|
|
4297
4339
|
SearchOptionsSchema,
|
|
4298
4340
|
StoredProjectSchema,
|
package/dist/schemas.js
CHANGED
|
@@ -32,7 +32,10 @@ __export(schemas_exports, {
|
|
|
32
32
|
GuidedLabExtensionOptionsSchema: () => GuidedLabExtensionOptionsSchema,
|
|
33
33
|
GuidedStepSchema: () => GuidedStepSchema,
|
|
34
34
|
LanguageBundleSchema: () => LanguageBundleSchema,
|
|
35
|
+
LanguageEnum: () => LanguageEnum,
|
|
35
36
|
LanguageIdSchema: () => LanguageIdSchema,
|
|
37
|
+
PythonExtensionOptionsSchema: () => PythonExtensionOptionsSchema,
|
|
38
|
+
PythonToolchainProgressSchema: () => PythonToolchainProgressSchema,
|
|
36
39
|
RuntimeExecuteOptionsSchema: () => RuntimeExecuteOptionsSchema,
|
|
37
40
|
SearchOptionsSchema: () => SearchOptionsSchema,
|
|
38
41
|
StoredProjectSchema: () => StoredProjectSchema,
|
|
@@ -4095,7 +4098,8 @@ var GuidedStepSchema = external_exports.object({
|
|
|
4095
4098
|
hint: external_exports.string().optional(),
|
|
4096
4099
|
testNames: external_exports.array(external_exports.string()).optional()
|
|
4097
4100
|
});
|
|
4098
|
-
var LanguageIdSchema = external_exports.enum(["js", "ts", "cpp"]);
|
|
4101
|
+
var LanguageIdSchema = external_exports.enum(["js", "ts", "cpp", "py"]);
|
|
4102
|
+
var LanguageEnum = LanguageIdSchema;
|
|
4099
4103
|
var LanguageBundleSchema = external_exports.object({
|
|
4100
4104
|
language: LanguageIdSchema.default("js"),
|
|
4101
4105
|
files: external_exports.record(external_exports.string()).default({}),
|
|
@@ -4118,6 +4122,12 @@ var GuidedLabExtensionOptionsSchema = external_exports.object({
|
|
|
4118
4122
|
cppStarterFiles: external_exports.record(external_exports.string()).optional(),
|
|
4119
4123
|
cppSolutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4120
4124
|
cppFiles: external_exports.record(external_exports.string()).optional(),
|
|
4125
|
+
pyStarterFiles: external_exports.record(external_exports.string()).optional(),
|
|
4126
|
+
pySolutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4127
|
+
pyFiles: external_exports.record(external_exports.string()).optional(),
|
|
4128
|
+
pyEntry: external_exports.string().optional(),
|
|
4129
|
+
pyTestEntry: external_exports.string().optional(),
|
|
4130
|
+
pyTestCode: external_exports.string().optional(),
|
|
4121
4131
|
summary: external_exports.string().optional(),
|
|
4122
4132
|
onStepComplete: external_exports.function().args(GuidedStepSchema, external_exports.number()).returns(external_exports.void()).optional(),
|
|
4123
4133
|
onLabComplete: external_exports.function().args(external_exports.string()).returns(external_exports.void()).optional()
|
|
@@ -4149,6 +4159,30 @@ var CppExtensionOptionsSchema = external_exports.object({
|
|
|
4149
4159
|
solutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4150
4160
|
onProgress: external_exports.function().args(external_exports.any()).returns(external_exports.void()).optional()
|
|
4151
4161
|
});
|
|
4162
|
+
var PythonToolchainProgressSchema = external_exports.object({
|
|
4163
|
+
stage: external_exports.enum(["downloading", "caching", "extracting", "initializing", "ready"]),
|
|
4164
|
+
loadedBytes: external_exports.number().optional(),
|
|
4165
|
+
totalBytes: external_exports.number().optional(),
|
|
4166
|
+
percent: external_exports.number().optional(),
|
|
4167
|
+
message: external_exports.string().optional()
|
|
4168
|
+
});
|
|
4169
|
+
var PythonExtensionOptionsSchema = external_exports.object({
|
|
4170
|
+
cdnBaseUrl: external_exports.string().optional(),
|
|
4171
|
+
indexUrl: external_exports.string().optional(),
|
|
4172
|
+
pyodideIndexUrl: external_exports.string().optional(),
|
|
4173
|
+
cacheInIndexedDB: external_exports.boolean().default(true),
|
|
4174
|
+
preload: external_exports.boolean().default(false),
|
|
4175
|
+
activate: external_exports.boolean().optional(),
|
|
4176
|
+
entry: external_exports.string().default("main.py"),
|
|
4177
|
+
testEntry: external_exports.string().default("test.py"),
|
|
4178
|
+
packages: external_exports.array(external_exports.string()).optional(),
|
|
4179
|
+
preloadPackages: external_exports.array(external_exports.string()).optional(),
|
|
4180
|
+
compilerMemoryLimitMb: external_exports.number().optional(),
|
|
4181
|
+
files: external_exports.record(external_exports.string()).optional(),
|
|
4182
|
+
starterFiles: external_exports.record(external_exports.string()).optional(),
|
|
4183
|
+
solutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4184
|
+
onProgress: external_exports.function().args(external_exports.any()).returns(external_exports.void()).optional()
|
|
4185
|
+
});
|
|
4152
4186
|
var CloneProgressPhaseSchema = external_exports.enum([
|
|
4153
4187
|
"connecting",
|
|
4154
4188
|
"metadata",
|
|
@@ -4244,6 +4278,14 @@ var WorkbenchOptionsSchema = external_exports.object({
|
|
|
4244
4278
|
cppFiles: external_exports.record(external_exports.string()).optional(),
|
|
4245
4279
|
cppStarterFiles: external_exports.record(external_exports.string()).optional(),
|
|
4246
4280
|
cppSolutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4281
|
+
pyFiles: external_exports.record(external_exports.string()).optional(),
|
|
4282
|
+
pyStarterFiles: external_exports.record(external_exports.string()).optional(),
|
|
4283
|
+
pySolutionFiles: external_exports.record(external_exports.string()).optional(),
|
|
4284
|
+
pyEntry: external_exports.string().optional().default("main.py"),
|
|
4285
|
+
pyTestEntry: external_exports.string().optional().default("test.py"),
|
|
4286
|
+
pyTestCode: external_exports.string().optional(),
|
|
4287
|
+
showWebPreview: external_exports.boolean().optional(),
|
|
4288
|
+
stdin: external_exports.string().optional(),
|
|
4247
4289
|
guided: external_exports.any().optional(),
|
|
4248
4290
|
mode: external_exports.enum(["guided", "sandbox"]).optional(),
|
|
4249
4291
|
language: LanguageIdSchema.optional(),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @innovatorved/code-lab — Shell Compiler Coreutils
|
|
3
|
+
* Provides `node`, `tsx`, `tsc`, `g++`, `clang++`, `python`, `python3`, `pytest`, `pip`.
|
|
4
|
+
*/
|
|
5
|
+
export interface ShellExecutionContext {
|
|
6
|
+
vfs: any;
|
|
7
|
+
cwd: string;
|
|
8
|
+
env: Record<string, string>;
|
|
9
|
+
resolvePath: (p: string) => string;
|
|
10
|
+
onStdout?: (text: string) => void;
|
|
11
|
+
onStderr?: (text: string) => void;
|
|
12
|
+
shell?: any;
|
|
13
|
+
}
|
|
14
|
+
export interface ShellExecResult {
|
|
15
|
+
code: number;
|
|
16
|
+
stdout: string;
|
|
17
|
+
stderr: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const COMPILER_COREUTILS: {
|
|
20
|
+
python3(args: string[], ctx: ShellExecutionContext): Promise<ShellExecResult>;
|
|
21
|
+
python(args: string[], ctx: ShellExecutionContext): Promise<ShellExecResult>;
|
|
22
|
+
pytest(args: string[], ctx: ShellExecutionContext): Promise<ShellExecResult>;
|
|
23
|
+
pip(args: string[], ctx: ShellExecutionContext): Promise<ShellExecResult>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @innovatorved/code-lab — POSIX Shell Lexer & AST Parser
|
|
3
|
+
*/
|
|
4
|
+
export interface ShellToken {
|
|
5
|
+
type: 'word' | 'pipe' | 'redirect_out' | 'redirect_append' | 'redirect_in' | 'and' | 'or' | 'semi' | 'bg';
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ShellCommandNode {
|
|
9
|
+
type: 'command';
|
|
10
|
+
args: string[];
|
|
11
|
+
redirects?: Array<{
|
|
12
|
+
type: string;
|
|
13
|
+
target: string;
|
|
14
|
+
fd?: number;
|
|
15
|
+
}>;
|
|
16
|
+
async?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ShellPipelineNode {
|
|
19
|
+
type: 'pipeline';
|
|
20
|
+
commands: ShellCommandNode[];
|
|
21
|
+
operator?: '&&' | '||' | ';';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Tokenizes a raw POSIX shell command string safely without eval.
|
|
25
|
+
*/
|
|
26
|
+
export declare function tokenizeShell(cmdString: string): string[];
|
package/dist/shell.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ============================================================
|
|
3
|
-
* @innovatorved/code-lab v0.
|
|
3
|
+
* @innovatorved/code-lab v0.3.0 — Standalone Browser Code IDE & Virtual Runtime
|
|
4
4
|
* ============================================================
|
|
5
5
|
* Features:
|
|
6
6
|
* - Sandboxed Web Worker Execution Engine with Multi-Instance Isolation & Watchdog Timer
|
|
@@ -6056,6 +6056,7 @@ var CodeLabLogger = (() => {
|
|
|
6056
6056
|
stdout += ' git [status diff log] Built-in version control\n';
|
|
6057
6057
|
stdout += ' node, bun, npm, pnpm, npx, bunx CLI runtime and package shims\n';
|
|
6058
6058
|
stdout += ' g++, clang++, c++ C++20 WebAssembly compiler (via cppExtension)\n';
|
|
6059
|
+
stdout += ' python, python3, pytest Python 3.12 WebAssembly runtime (via pythonExtension)\n';
|
|
6059
6060
|
stdout += ' serve [dir] [--port] Built-in preview server (transpiles TS/JSX for the browser)\n';
|
|
6060
6061
|
stdout += ' ports, curl Port table inspection & HTTP requests\n';
|
|
6061
6062
|
stdout += ' hey, ab, wrk Concurrent HTTP load generator & latency percentiles\n';
|
|
@@ -6293,6 +6294,117 @@ var CodeLabLogger = (() => {
|
|
|
6293
6294
|
return COREUTILS['g++'](args, ctx);
|
|
6294
6295
|
},
|
|
6295
6296
|
|
|
6297
|
+
async python3(args, ctx) {
|
|
6298
|
+
if (args.length === 0) {
|
|
6299
|
+
return { code: 0, stdout: 'Python 3.12.8 (CPython WebAssembly via Pyodide)\n', stderr: '' };
|
|
6300
|
+
}
|
|
6301
|
+
|
|
6302
|
+
if (args[0] === '--version' || args[0] === '-V') {
|
|
6303
|
+
return { code: 0, stdout: 'Python 3.12.8 (CPython WebAssembly via Pyodide)\n', stderr: '' };
|
|
6304
|
+
}
|
|
6305
|
+
|
|
6306
|
+
let codeToRun = undefined;
|
|
6307
|
+
let entryFile = undefined;
|
|
6308
|
+
|
|
6309
|
+
if (args[0] === '-c' && args.length > 1) {
|
|
6310
|
+
codeToRun = args[1];
|
|
6311
|
+
} else if (!args[0].startsWith('-')) {
|
|
6312
|
+
entryFile = ctx.resolvePath(args[0]);
|
|
6313
|
+
}
|
|
6314
|
+
|
|
6315
|
+
const pyCompiler =
|
|
6316
|
+
(ctx.shell && ctx.shell.options && ctx.shell.options.pythonCompiler) ||
|
|
6317
|
+
(typeof globalThis !== 'undefined' && globalThis.__codelabPythonCompiler) ||
|
|
6318
|
+
(typeof window !== 'undefined' && window.__codelabPythonCompiler);
|
|
6319
|
+
|
|
6320
|
+
if (typeof pyCompiler !== 'function') {
|
|
6321
|
+
return {
|
|
6322
|
+
code: 1,
|
|
6323
|
+
stdout: '',
|
|
6324
|
+
stderr:
|
|
6325
|
+
'python3: Python WebAssembly toolchain is not enabled. Enable pythonExtension from "@innovatorved/code-lab/extensions/python".\n'
|
|
6326
|
+
};
|
|
6327
|
+
}
|
|
6328
|
+
|
|
6329
|
+
let outText = '';
|
|
6330
|
+
let errText = '';
|
|
6331
|
+
const res = await pyCompiler({
|
|
6332
|
+
entry: entryFile,
|
|
6333
|
+
source: codeToRun,
|
|
6334
|
+
vfs: ctx.vfs,
|
|
6335
|
+
onStdout: (t) => {
|
|
6336
|
+
outText += t;
|
|
6337
|
+
if (ctx.onStdout) ctx.onStdout(t);
|
|
6338
|
+
},
|
|
6339
|
+
onStderr: (t) => {
|
|
6340
|
+
errText += t;
|
|
6341
|
+
if (ctx.onStderr) ctx.onStderr(t);
|
|
6342
|
+
}
|
|
6343
|
+
});
|
|
6344
|
+
|
|
6345
|
+
return {
|
|
6346
|
+
code: res && res.ok ? 0 : ((res && res.exitCode) || 1),
|
|
6347
|
+
stdout: outText,
|
|
6348
|
+
stderr: errText
|
|
6349
|
+
};
|
|
6350
|
+
},
|
|
6351
|
+
|
|
6352
|
+
async python(args, ctx) {
|
|
6353
|
+
return COREUTILS['python3'](args, ctx);
|
|
6354
|
+
},
|
|
6355
|
+
|
|
6356
|
+
async pytest(args, ctx) {
|
|
6357
|
+
if (args.length > 0 && (args[0] === '--version' || args[0] === '-V')) {
|
|
6358
|
+
return { code: 0, stdout: 'pytest 8.3.4 (Python 3.12 WebAssembly)\n', stderr: '' };
|
|
6359
|
+
}
|
|
6360
|
+
const testFiles = args.filter((a) => !a.startsWith('-'));
|
|
6361
|
+
let target = testFiles[0];
|
|
6362
|
+
if (!target && ctx.vfs) {
|
|
6363
|
+
try {
|
|
6364
|
+
const allFiles = Object.keys(typeof ctx.vfs.toSnapshot === 'function' ? ctx.vfs.toSnapshot('/workspace') : (ctx.vfs.files || {}));
|
|
6365
|
+
target = allFiles.find((f) => /(?:^|\/)(?:test_.*|.*_test|test)\.py$/i.test(f));
|
|
6366
|
+
} catch (err) {
|
|
6367
|
+
void err;
|
|
6368
|
+
}
|
|
6369
|
+
}
|
|
6370
|
+
target = target || 'test.py';
|
|
6371
|
+
return COREUTILS['python3']([target], ctx);
|
|
6372
|
+
},
|
|
6373
|
+
|
|
6374
|
+
async pip(args, ctx) {
|
|
6375
|
+
if (args.length === 0 || args[0] === '--version' || args[0] === '-V') {
|
|
6376
|
+
return { code: 0, stdout: 'pip 24.0 from /usr/lib/python/pip (python 3.12)\n', stderr: '' };
|
|
6377
|
+
}
|
|
6378
|
+
if (args[0] === 'install') {
|
|
6379
|
+
const pkgs = args.slice(1).filter((p) => !p.startsWith('-'));
|
|
6380
|
+
const toolchain =
|
|
6381
|
+
(ctx.shell && ctx.shell.options && ctx.shell.options.pythonToolchain) ||
|
|
6382
|
+
(typeof globalThis !== 'undefined' && globalThis.__codelabPythonToolchain) ||
|
|
6383
|
+
(typeof window !== 'undefined' && window.__codelabPythonToolchain);
|
|
6384
|
+
if (toolchain && typeof toolchain.installPackages === 'function') {
|
|
6385
|
+
const res = await toolchain.installPackages(pkgs);
|
|
6386
|
+
if (res.ok) {
|
|
6387
|
+
return {
|
|
6388
|
+
code: 0,
|
|
6389
|
+
stdout: `Successfully installed ${res.installed.join(', ') || 'packages'}\n`,
|
|
6390
|
+
stderr: ''
|
|
6391
|
+
};
|
|
6392
|
+
}
|
|
6393
|
+
return {
|
|
6394
|
+
code: 1,
|
|
6395
|
+
stdout: '',
|
|
6396
|
+
stderr: `ERROR: Could not find a version that satisfies the requirement ${res.error || pkgs.join(', ')}\n`
|
|
6397
|
+
};
|
|
6398
|
+
}
|
|
6399
|
+
return {
|
|
6400
|
+
code: 0,
|
|
6401
|
+
stdout: `Successfully installed ${pkgs.join(', ') || 'packages'}\n`,
|
|
6402
|
+
stderr: ''
|
|
6403
|
+
};
|
|
6404
|
+
}
|
|
6405
|
+
return { code: 0, stdout: 'pip 24.0 (Pyodide micropip)\n', stderr: '' };
|
|
6406
|
+
},
|
|
6407
|
+
|
|
6296
6408
|
async bun(args, ctx) {
|
|
6297
6409
|
if (args.length === 0) {
|
|
6298
6410
|
return { code: 0, stdout: 'Bun v1.1.20\n', stderr: '' };
|
package/dist/shell.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ============================================================
|
|
3
|
-
* @innovatorved/code-lab v0.
|
|
3
|
+
* @innovatorved/code-lab v0.3.0 — Standalone Browser Code IDE & Virtual Runtime
|
|
4
4
|
* ============================================================
|
|
5
5
|
* Features:
|
|
6
6
|
* - Sandboxed Web Worker Execution Engine with Multi-Instance Isolation & Watchdog Timer
|
|
@@ -6057,6 +6057,7 @@ var CodeLabLogger = (() => {
|
|
|
6057
6057
|
stdout += ' git [status diff log] Built-in version control\n';
|
|
6058
6058
|
stdout += ' node, bun, npm, pnpm, npx, bunx CLI runtime and package shims\n';
|
|
6059
6059
|
stdout += ' g++, clang++, c++ C++20 WebAssembly compiler (via cppExtension)\n';
|
|
6060
|
+
stdout += ' python, python3, pytest Python 3.12 WebAssembly runtime (via pythonExtension)\n';
|
|
6060
6061
|
stdout += ' serve [dir] [--port] Built-in preview server (transpiles TS/JSX for the browser)\n';
|
|
6061
6062
|
stdout += ' ports, curl Port table inspection & HTTP requests\n';
|
|
6062
6063
|
stdout += ' hey, ab, wrk Concurrent HTTP load generator & latency percentiles\n';
|
|
@@ -6294,6 +6295,117 @@ var CodeLabLogger = (() => {
|
|
|
6294
6295
|
return COREUTILS['g++'](args, ctx);
|
|
6295
6296
|
},
|
|
6296
6297
|
|
|
6298
|
+
async python3(args, ctx) {
|
|
6299
|
+
if (args.length === 0) {
|
|
6300
|
+
return { code: 0, stdout: 'Python 3.12.8 (CPython WebAssembly via Pyodide)\n', stderr: '' };
|
|
6301
|
+
}
|
|
6302
|
+
|
|
6303
|
+
if (args[0] === '--version' || args[0] === '-V') {
|
|
6304
|
+
return { code: 0, stdout: 'Python 3.12.8 (CPython WebAssembly via Pyodide)\n', stderr: '' };
|
|
6305
|
+
}
|
|
6306
|
+
|
|
6307
|
+
let codeToRun = undefined;
|
|
6308
|
+
let entryFile = undefined;
|
|
6309
|
+
|
|
6310
|
+
if (args[0] === '-c' && args.length > 1) {
|
|
6311
|
+
codeToRun = args[1];
|
|
6312
|
+
} else if (!args[0].startsWith('-')) {
|
|
6313
|
+
entryFile = ctx.resolvePath(args[0]);
|
|
6314
|
+
}
|
|
6315
|
+
|
|
6316
|
+
const pyCompiler =
|
|
6317
|
+
(ctx.shell && ctx.shell.options && ctx.shell.options.pythonCompiler) ||
|
|
6318
|
+
(typeof globalThis !== 'undefined' && globalThis.__codelabPythonCompiler) ||
|
|
6319
|
+
(typeof window !== 'undefined' && window.__codelabPythonCompiler);
|
|
6320
|
+
|
|
6321
|
+
if (typeof pyCompiler !== 'function') {
|
|
6322
|
+
return {
|
|
6323
|
+
code: 1,
|
|
6324
|
+
stdout: '',
|
|
6325
|
+
stderr:
|
|
6326
|
+
'python3: Python WebAssembly toolchain is not enabled. Enable pythonExtension from "@innovatorved/code-lab/extensions/python".\n'
|
|
6327
|
+
};
|
|
6328
|
+
}
|
|
6329
|
+
|
|
6330
|
+
let outText = '';
|
|
6331
|
+
let errText = '';
|
|
6332
|
+
const res = await pyCompiler({
|
|
6333
|
+
entry: entryFile,
|
|
6334
|
+
source: codeToRun,
|
|
6335
|
+
vfs: ctx.vfs,
|
|
6336
|
+
onStdout: (t) => {
|
|
6337
|
+
outText += t;
|
|
6338
|
+
if (ctx.onStdout) ctx.onStdout(t);
|
|
6339
|
+
},
|
|
6340
|
+
onStderr: (t) => {
|
|
6341
|
+
errText += t;
|
|
6342
|
+
if (ctx.onStderr) ctx.onStderr(t);
|
|
6343
|
+
}
|
|
6344
|
+
});
|
|
6345
|
+
|
|
6346
|
+
return {
|
|
6347
|
+
code: res && res.ok ? 0 : ((res && res.exitCode) || 1),
|
|
6348
|
+
stdout: outText,
|
|
6349
|
+
stderr: errText
|
|
6350
|
+
};
|
|
6351
|
+
},
|
|
6352
|
+
|
|
6353
|
+
async python(args, ctx) {
|
|
6354
|
+
return COREUTILS['python3'](args, ctx);
|
|
6355
|
+
},
|
|
6356
|
+
|
|
6357
|
+
async pytest(args, ctx) {
|
|
6358
|
+
if (args.length > 0 && (args[0] === '--version' || args[0] === '-V')) {
|
|
6359
|
+
return { code: 0, stdout: 'pytest 8.3.4 (Python 3.12 WebAssembly)\n', stderr: '' };
|
|
6360
|
+
}
|
|
6361
|
+
const testFiles = args.filter((a) => !a.startsWith('-'));
|
|
6362
|
+
let target = testFiles[0];
|
|
6363
|
+
if (!target && ctx.vfs) {
|
|
6364
|
+
try {
|
|
6365
|
+
const allFiles = Object.keys(typeof ctx.vfs.toSnapshot === 'function' ? ctx.vfs.toSnapshot('/workspace') : (ctx.vfs.files || {}));
|
|
6366
|
+
target = allFiles.find((f) => /(?:^|\/)(?:test_.*|.*_test|test)\.py$/i.test(f));
|
|
6367
|
+
} catch (err) {
|
|
6368
|
+
void err;
|
|
6369
|
+
}
|
|
6370
|
+
}
|
|
6371
|
+
target = target || 'test.py';
|
|
6372
|
+
return COREUTILS['python3']([target], ctx);
|
|
6373
|
+
},
|
|
6374
|
+
|
|
6375
|
+
async pip(args, ctx) {
|
|
6376
|
+
if (args.length === 0 || args[0] === '--version' || args[0] === '-V') {
|
|
6377
|
+
return { code: 0, stdout: 'pip 24.0 from /usr/lib/python/pip (python 3.12)\n', stderr: '' };
|
|
6378
|
+
}
|
|
6379
|
+
if (args[0] === 'install') {
|
|
6380
|
+
const pkgs = args.slice(1).filter((p) => !p.startsWith('-'));
|
|
6381
|
+
const toolchain =
|
|
6382
|
+
(ctx.shell && ctx.shell.options && ctx.shell.options.pythonToolchain) ||
|
|
6383
|
+
(typeof globalThis !== 'undefined' && globalThis.__codelabPythonToolchain) ||
|
|
6384
|
+
(typeof window !== 'undefined' && window.__codelabPythonToolchain);
|
|
6385
|
+
if (toolchain && typeof toolchain.installPackages === 'function') {
|
|
6386
|
+
const res = await toolchain.installPackages(pkgs);
|
|
6387
|
+
if (res.ok) {
|
|
6388
|
+
return {
|
|
6389
|
+
code: 0,
|
|
6390
|
+
stdout: `Successfully installed ${res.installed.join(', ') || 'packages'}\n`,
|
|
6391
|
+
stderr: ''
|
|
6392
|
+
};
|
|
6393
|
+
}
|
|
6394
|
+
return {
|
|
6395
|
+
code: 1,
|
|
6396
|
+
stdout: '',
|
|
6397
|
+
stderr: `ERROR: Could not find a version that satisfies the requirement ${res.error || pkgs.join(', ')}\n`
|
|
6398
|
+
};
|
|
6399
|
+
}
|
|
6400
|
+
return {
|
|
6401
|
+
code: 0,
|
|
6402
|
+
stdout: `Successfully installed ${pkgs.join(', ') || 'packages'}\n`,
|
|
6403
|
+
stderr: ''
|
|
6404
|
+
};
|
|
6405
|
+
}
|
|
6406
|
+
return { code: 0, stdout: 'pip 24.0 (Pyodide micropip)\n', stderr: '' };
|
|
6407
|
+
},
|
|
6408
|
+
|
|
6297
6409
|
async bun(args, ctx) {
|
|
6298
6410
|
if (args.length === 0) {
|
|
6299
6411
|
return { code: 0, stdout: 'Bun v1.1.20\n', stderr: '' };
|
package/dist/terminal.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ============================================================
|
|
3
|
-
* @innovatorved/code-lab v0.
|
|
3
|
+
* @innovatorved/code-lab v0.3.0 — 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/terminal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ============================================================
|
|
3
|
-
* @innovatorved/code-lab v0.
|
|
3
|
+
* @innovatorved/code-lab v0.3.0 — Standalone Browser Code IDE & Virtual Runtime
|
|
4
4
|
* ============================================================
|
|
5
5
|
* Features:
|
|
6
6
|
* - Sandboxed Web Worker Execution Engine with Multi-Instance Isolation & Watchdog Timer
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @innovatorved/code-lab — Fuzzy-Searchable Command Palette (Cmd+Shift+P / Cmd+K)
|
|
3
|
+
*/
|
|
4
|
+
export interface CommandPaletteItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
shortcut?: string;
|
|
8
|
+
action: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function getStandardWorkbenchCommands(workbench: any): CommandPaletteItem[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @innovatorved/code-lab — Inline Monaco Side-by-Side Diff Editor & Fallback Unified Diff
|
|
3
|
+
*/
|
|
4
|
+
export interface DiffComputeResult {
|
|
5
|
+
hunks: Array<{
|
|
6
|
+
type: 'context' | 'add' | 'del';
|
|
7
|
+
text: string;
|
|
8
|
+
oldLine: number | null;
|
|
9
|
+
newLine: number | null;
|
|
10
|
+
}>;
|
|
11
|
+
added: number;
|
|
12
|
+
removed: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function computeSimpleDiff(oldText: string, newText: string): DiffComputeResult;
|
|
15
|
+
export declare class CodeLabDiffEditorManager {
|
|
16
|
+
private workbench;
|
|
17
|
+
private diffEditor;
|
|
18
|
+
private originalModel;
|
|
19
|
+
private modifiedModel;
|
|
20
|
+
isActive: boolean;
|
|
21
|
+
activeFile: string;
|
|
22
|
+
currentTarget: 'starter' | 'solution';
|
|
23
|
+
constructor(workbench: any);
|
|
24
|
+
openInlineDiff(file: string, target?: 'starter' | 'solution'): boolean;
|
|
25
|
+
closeInlineDiff(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @innovatorved/code-lab — Resizable Bottom Drawer, Contextual Tabs & Telemetry HUD
|
|
3
|
+
*/
|
|
4
|
+
export interface DrawerTabOptions {
|
|
5
|
+
workbench: any;
|
|
6
|
+
drawerTab: string;
|
|
7
|
+
hasGuidedLab: boolean;
|
|
8
|
+
mode: string;
|
|
9
|
+
hasWebContent: boolean;
|
|
10
|
+
problemsCount: number;
|
|
11
|
+
testSuiteVisible: boolean;
|
|
12
|
+
lastDurationMs: number | null;
|
|
13
|
+
lastPeakMemoryBytes: number | null;
|
|
14
|
+
}
|
|
15
|
+
export declare function formatTelemetryHud(durationMs: number | null, memoryBytes: number | null, lang: string): string;
|
|
16
|
+
export declare function renderDrawerTabsHtml(opts: DrawerTabOptions): string;
|
|
17
|
+
export declare function renderProblemsPanelHtml(workbench: any): string;
|
|
18
|
+
export declare function renderStdinPanelHtml(workbench: any): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @innovatorved/code-lab — Monaco Editor Host, Model Lifecycle & Formatting
|
|
3
|
+
*/
|
|
4
|
+
export interface EditorPosition {
|
|
5
|
+
lineNumber: number;
|
|
6
|
+
column: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Normalizes C++ source indentation and braces.
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatCppSource(code: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @innovatorved/code-lab — Explorer File Tree & CRUD Utilities
|
|
3
|
+
*/
|
|
4
|
+
export interface FileNode {
|
|
5
|
+
name: string;
|
|
6
|
+
fullPath: string;
|
|
7
|
+
isFolder: boolean;
|
|
8
|
+
children: FileNode[];
|
|
9
|
+
}
|
|
10
|
+
export declare function buildFileHierarchy(files: Record<string, string>, creatingItem?: any): FileNode;
|
|
11
|
+
export declare function getFileIcon(filename: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @innovatorved/code-lab — Guided Pane: Walkthrough Stepper, Hints & Verification
|
|
3
|
+
*/
|
|
4
|
+
export interface GuidedStepData {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
instructions: string | string[];
|
|
8
|
+
hint?: string;
|
|
9
|
+
testNames?: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function renderStepPillsHtml(steps: GuidedStepData[], activeIndex: number, completedStepIds: Set<string>): string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @innovatorved/code-lab — Workbench Subsystem Entrypoint
|
|
3
|
+
*/
|
|
4
|
+
export * from './icons';
|
|
5
|
+
export * from './styles';
|
|
6
|
+
export * from './toolbar';
|
|
7
|
+
export * from './drawer';
|
|
8
|
+
export * from './diff-editor';
|
|
9
|
+
export * from './command-palette';
|
|
10
|
+
export * from './share';
|
|
11
|
+
export * from './file-tree';
|
|
12
|
+
export * from './editor';
|
|
13
|
+
export * from './guided-pane';
|
|
14
|
+
import * as toolbar from './toolbar';
|
|
15
|
+
import * as drawer from './drawer';
|
|
16
|
+
import * as diffEditor from './diff-editor';
|
|
17
|
+
import * as commandPalette from './command-palette';
|
|
18
|
+
import * as share from './share';
|
|
19
|
+
import * as fileTree from './file-tree';
|
|
20
|
+
import * as guidedPane from './guided-pane';
|
|
21
|
+
export declare const CodeLabWorkbenchComponents: {
|
|
22
|
+
renderStepPillsHtml(steps: guidedPane.GuidedStepData[], activeIndex: number, completedStepIds: Set<string>): string;
|
|
23
|
+
formatCppSource(code: string): string;
|
|
24
|
+
buildFileHierarchy(files: Record<string, string>, creatingItem?: any): fileTree.FileNode;
|
|
25
|
+
getFileIcon(filename: string): string;
|
|
26
|
+
compressWorkspaceSnapshot(payload: share.WorkspaceSharePayload): Promise<string>;
|
|
27
|
+
decompressWorkspaceSnapshot(encoded: string): Promise<share.WorkspaceSharePayload | null>;
|
|
28
|
+
getStandardWorkbenchCommands(workbench: any): commandPalette.CommandPaletteItem[];
|
|
29
|
+
computeSimpleDiff(oldText: string, newText: string): diffEditor.DiffComputeResult;
|
|
30
|
+
CodeLabDiffEditorManager: typeof diffEditor.CodeLabDiffEditorManager;
|
|
31
|
+
formatTelemetryHud(durationMs: number | null, memoryBytes: number | null, lang: string): string;
|
|
32
|
+
renderDrawerTabsHtml(opts: drawer.DrawerTabOptions): string;
|
|
33
|
+
renderProblemsPanelHtml(workbench: any): string;
|
|
34
|
+
renderStdinPanelHtml(workbench: any): string;
|
|
35
|
+
renderLanguageSwitcherHtml(workbench: any): string;
|
|
36
|
+
renderToolbarHtml(opts: toolbar.ToolbarRenderOptions): string;
|
|
37
|
+
WORKBENCH_STYLES: "\n/* \u2500\u2500 Split Run Button \u2500\u2500 */\n.codelab-btn-split {\n display: inline-flex;\n align-items: stretch;\n border-radius: var(--cl-radius, 6px);\n overflow: visible;\n position: relative;\n}\n.codelab-btn-split .codelab-btn-split__main {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: 1px solid rgba(255, 255, 255, 0.2);\n}\n.codelab-btn-split .codelab-btn-split__trigger {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n padding: 0 6px;\n min-width: 24px;\n}\n.codelab-split-menu {\n position: absolute;\n top: calc(100% + 4px);\n right: 0;\n background: var(--cl-bg-elevated, #252526);\n border: 1px solid var(--cl-border, #3c3c3c);\n border-radius: var(--cl-radius, 6px);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);\n z-index: 1000;\n min-width: 220px;\n padding: 4px 0;\n display: none;\n}\n.codelab-split-menu.open {\n display: block;\n}\n.codelab-split-menu__item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n padding: 6px 12px;\n background: none;\n border: none;\n color: var(--cl-fg, #cccccc);\n font-size: 12px;\n cursor: pointer;\n text-align: left;\n}\n.codelab-split-menu__item:hover {\n background: var(--cl-accent, #007acc);\n color: #ffffff;\n}\n\n/* \u2500\u2500 Command Palette Trigger Pill \u2500\u2500 */\n.codelab-cmd-trigger {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 3px 10px;\n border-radius: var(--cl-radius, 6px);\n background: var(--cl-input-bg, rgba(255, 255, 255, 0.06));\n border: 1px solid var(--cl-border, #3c3c3c);\n color: var(--cl-fg-muted, #858585);\n font-size: 11px;\n cursor: pointer;\n transition: all 0.15s ease;\n}\n.codelab-cmd-trigger:hover {\n background: var(--cl-input-bg-focus, rgba(255, 255, 255, 0.12));\n color: var(--cl-fg, #cccccc);\n border-color: var(--cl-accent, #007acc);\n}\n\n/* \u2500\u2500 HUD Telemetry Pill \u2500\u2500 */\n.codelab-hud-pill {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 2px 10px;\n border-radius: 12px;\n background: var(--cl-hud-bg, rgba(0, 122, 204, 0.15));\n border: 1px solid var(--cl-hud-border, rgba(0, 122, 204, 0.35));\n color: var(--cl-hud-fg, #4fc1ff);\n font-family: var(--cl-font-mono, monospace);\n font-size: 11px;\n font-weight: 500;\n letter-spacing: 0.3px;\n margin-left: auto;\n user-select: none;\n}\n.codelab-hud-pill__metric {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n}\n\n/* \u2500\u2500 Stdin / Custom Input Panel \u2500\u2500 */\n.codelab-stdin-panel {\n display: flex;\n flex-direction: column;\n height: 100%;\n padding: 8px 12px;\n background: var(--cl-bg-editor, #1e1e1e);\n box-sizing: border-box;\n}\n.codelab-stdin-panel__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 6px;\n font-size: 11px;\n color: var(--cl-fg-muted, #858585);\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n.codelab-stdin-panel__textarea {\n flex: 1;\n width: 100%;\n background: var(--cl-input-bg, #252526);\n border: 1px solid var(--cl-border, #3c3c3c);\n border-radius: var(--cl-radius, 4px);\n color: var(--cl-fg, #cccccc);\n font-family: var(--cl-font-mono, monospace);\n font-size: 12px;\n line-height: 1.5;\n padding: 8px;\n resize: none;\n outline: none;\n box-sizing: border-box;\n}\n.codelab-stdin-panel__textarea:focus {\n border-color: var(--cl-accent, #007acc);\n}\n\n/* \u2500\u2500 Problems Drawer Tab \u2500\u2500 */\n.codelab-problems-list {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n height: 100%;\n padding: 4px 0;\n}\n.codelab-problem-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 5px 12px;\n font-size: 12px;\n font-family: var(--cl-font-mono, monospace);\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.04);\n}\n.codelab-problem-item:hover {\n background: var(--cl-tree-hover, rgba(255, 255, 255, 0.06));\n}\n.codelab-problem-item--error {\n color: #f14c4c;\n}\n.codelab-problem-item--warning {\n color: #cca700;\n}\n.codelab-problem-item--info {\n color: #3794ff;\n}\n.codelab-problem-item__location {\n color: var(--cl-fg-muted, #858585);\n font-size: 11px;\n margin-left: auto;\n}\n\n/* \u2500\u2500 Monaco Side-by-Side Diff Editor \u2500\u2500 */\n.codelab-diff-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background: var(--cl-bg-editor, #1e1e1e);\n}\n.codelab-diff-toolbar {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 12px;\n background: var(--cl-bg-panel, #252526);\n border-bottom: 1px solid var(--cl-border, #3c3c3c);\n font-size: 12px;\n}\n.codelab-diff-host {\n flex: 1;\n width: 100%;\n height: calc(100% - 36px);\n position: relative;\n}\n";
|
|
38
|
+
CL_ICONS: Record<string, string>;
|
|
39
|
+
};
|