@innovatorved/code-lab 0.1.6 → 0.1.8
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 +34 -16
- package/README.md +17 -7
- package/dist/code-lab.css +26 -0
- package/dist/code-lab.d.ts +271 -1
- package/dist/code-lab.esm.js +2909 -166
- package/dist/code-lab.js +2869 -164
- package/dist/csp.d.ts +86 -0
- package/dist/diagnostics.d.ts +43 -0
- package/dist/extensions/guided-lab.esm.js +66 -0
- package/dist/extensions/guided-lab.js +66 -0
- package/dist/html.d.ts +24 -0
- package/dist/index.d.ts +9 -1
- package/dist/logger.d.ts +60 -0
- package/dist/preview-sw.js +425 -11
- package/dist/runtime.d.ts +6 -27
- package/dist/runtime.esm.js +171 -31
- package/dist/runtime.js +171 -31
- package/dist/schemas.d.ts +366 -25
- package/dist/schemas.esm.js +73 -0
- package/dist/schemas.js +73 -0
- package/dist/scm.d.ts +77 -0
- package/dist/search.d.ts +75 -0
- package/dist/shell.d.ts +18 -47
- package/dist/shell.esm.js +236 -37
- package/dist/shell.js +236 -37
- package/dist/storage.d.ts +57 -0
- package/dist/terminal.d.ts +11 -87
- package/dist/terminal.esm.js +124 -7
- package/dist/terminal.js +124 -7
- package/dist/zip.d.ts +42 -0
- package/package.json +11 -3
- package/src/code-lab.css +26 -0
- package/src/csp.ts +396 -0
- package/src/diagnostics.ts +116 -0
- package/src/html.ts +88 -0
- package/src/index.ts +39 -1
- package/src/logger.ts +139 -0
- package/src/preview-sw.js +97 -11
- package/src/runtime.ts +132 -105
- package/src/schemas.ts +94 -1
- package/src/scm.ts +268 -0
- package/src/search.ts +389 -0
- package/src/shell.ts +410 -369
- package/src/storage.ts +377 -0
- package/src/terminal.ts +898 -918
- package/src/workbench.ts +926 -89
- package/src/zip.ts +326 -0
- package/src/runtime.js +0 -8229
- package/src/shell.js +0 -7257
- package/src/terminal.js +0 -1046
- package/src/workbench.js +0 -7353
package/dist/schemas.esm.js
CHANGED
|
@@ -4157,6 +4157,9 @@ var WorkbenchOptionsSchema = external_exports.object({
|
|
|
4157
4157
|
testFile: external_exports.string().optional(),
|
|
4158
4158
|
backLabel: external_exports.string().default("Back"),
|
|
4159
4159
|
monacoUrl: external_exports.string().optional(),
|
|
4160
|
+
previewOrigin: external_exports.string().optional(),
|
|
4161
|
+
logger: external_exports.any().optional(),
|
|
4162
|
+
debug: external_exports.boolean().optional(),
|
|
4160
4163
|
onClose: external_exports.function().returns(external_exports.void()).optional(),
|
|
4161
4164
|
onRun: external_exports.function().args(external_exports.any()).returns(external_exports.void()).optional(),
|
|
4162
4165
|
onTestResult: external_exports.function().args(external_exports.any()).returns(external_exports.void()).optional(),
|
|
@@ -4178,14 +4181,84 @@ var WorkbenchOptionsSchema = external_exports.object({
|
|
|
4178
4181
|
onStepComplete: external_exports.function().args(external_exports.any(), external_exports.number()).returns(external_exports.void()).optional(),
|
|
4179
4182
|
onLabComplete: external_exports.function().args(external_exports.string()).returns(external_exports.void()).optional()
|
|
4180
4183
|
});
|
|
4184
|
+
var SearchOptionsSchema = external_exports.object({
|
|
4185
|
+
query: external_exports.string().default(""),
|
|
4186
|
+
caseSensitive: external_exports.boolean().optional().default(false),
|
|
4187
|
+
wholeWord: external_exports.boolean().optional().default(false),
|
|
4188
|
+
regex: external_exports.boolean().optional().default(false),
|
|
4189
|
+
isRegex: external_exports.boolean().optional().default(false),
|
|
4190
|
+
include: external_exports.string().optional(),
|
|
4191
|
+
includeGlob: external_exports.string().optional(),
|
|
4192
|
+
includePattern: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
|
|
4193
|
+
exclude: external_exports.string().optional(),
|
|
4194
|
+
excludeGlob: external_exports.string().optional(),
|
|
4195
|
+
excludePattern: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
|
|
4196
|
+
maxMatches: external_exports.number().int().positive().optional(),
|
|
4197
|
+
maxMatchesPerFile: external_exports.number().int().positive().optional()
|
|
4198
|
+
});
|
|
4199
|
+
var DiagnosticSeveritySchema = external_exports.enum(["error", "warning", "info", "hint"]);
|
|
4200
|
+
var DiagnosticItemSchema = external_exports.object({
|
|
4201
|
+
id: external_exports.string(),
|
|
4202
|
+
file: external_exports.string(),
|
|
4203
|
+
line: external_exports.number().int(),
|
|
4204
|
+
col: external_exports.number().int().optional(),
|
|
4205
|
+
column: external_exports.number().int().optional(),
|
|
4206
|
+
endLine: external_exports.number().int().optional(),
|
|
4207
|
+
endCol: external_exports.number().int().optional(),
|
|
4208
|
+
endColumn: external_exports.number().int().optional(),
|
|
4209
|
+
message: external_exports.string(),
|
|
4210
|
+
severity: DiagnosticSeveritySchema,
|
|
4211
|
+
source: external_exports.string().optional(),
|
|
4212
|
+
code: external_exports.union([external_exports.string(), external_exports.number()]).optional(),
|
|
4213
|
+
tags: external_exports.array(external_exports.string()).optional()
|
|
4214
|
+
});
|
|
4215
|
+
var StoredProjectSchema = external_exports.object({
|
|
4216
|
+
id: external_exports.string(),
|
|
4217
|
+
name: external_exports.string(),
|
|
4218
|
+
files: external_exports.record(external_exports.string()),
|
|
4219
|
+
updatedAt: external_exports.number(),
|
|
4220
|
+
createdAt: external_exports.number().optional(),
|
|
4221
|
+
entry: external_exports.string().optional(),
|
|
4222
|
+
testEntry: external_exports.string().optional(),
|
|
4223
|
+
version: external_exports.number().optional()
|
|
4224
|
+
});
|
|
4225
|
+
var GitFileChangeTypeSchema = external_exports.enum(["modified", "added", "deleted", "untracked"]);
|
|
4226
|
+
var GitFileStatusSchema = external_exports.object({
|
|
4227
|
+
path: external_exports.string(),
|
|
4228
|
+
status: GitFileChangeTypeSchema,
|
|
4229
|
+
staged: external_exports.boolean(),
|
|
4230
|
+
oldContent: external_exports.string().optional(),
|
|
4231
|
+
newContent: external_exports.string().optional()
|
|
4232
|
+
});
|
|
4233
|
+
var GitStateSummarySchema = external_exports.object({
|
|
4234
|
+
branch: external_exports.string().default("main"),
|
|
4235
|
+
headCommit: external_exports.string().optional(),
|
|
4236
|
+
branches: external_exports.array(external_exports.string()).default(["main"]),
|
|
4237
|
+
staged: external_exports.array(GitFileStatusSchema).default([]),
|
|
4238
|
+
unstaged: external_exports.array(GitFileStatusSchema).default([]),
|
|
4239
|
+
untracked: external_exports.array(GitFileStatusSchema).default([]),
|
|
4240
|
+
modified: external_exports.array(GitFileStatusSchema).optional(),
|
|
4241
|
+
deleted: external_exports.array(GitFileStatusSchema).optional(),
|
|
4242
|
+
hasChanges: external_exports.boolean().default(false),
|
|
4243
|
+
isClean: external_exports.boolean().default(true),
|
|
4244
|
+
ahead: external_exports.number().int().default(0),
|
|
4245
|
+
behind: external_exports.number().int().default(0)
|
|
4246
|
+
});
|
|
4181
4247
|
export {
|
|
4182
4248
|
CloneProgressEventSchema,
|
|
4183
4249
|
CloneProgressPhaseSchema,
|
|
4250
|
+
DiagnosticItemSchema,
|
|
4251
|
+
DiagnosticSeveritySchema,
|
|
4252
|
+
GitFileChangeTypeSchema,
|
|
4253
|
+
GitFileStatusSchema,
|
|
4184
4254
|
GitHubCloneOptionsSchema,
|
|
4255
|
+
GitStateSummarySchema,
|
|
4185
4256
|
GuidedLabExtensionOptionsSchema,
|
|
4186
4257
|
GuidedStepSchema,
|
|
4187
4258
|
LanguageBundleSchema,
|
|
4188
4259
|
RuntimeExecuteOptionsSchema,
|
|
4260
|
+
SearchOptionsSchema,
|
|
4261
|
+
StoredProjectSchema,
|
|
4189
4262
|
WorkbenchOptionsSchema,
|
|
4190
4263
|
WorkspaceSnapshotSchema
|
|
4191
4264
|
};
|
package/dist/schemas.js
CHANGED
|
@@ -21,11 +21,18 @@ var schemas_exports = {};
|
|
|
21
21
|
__export(schemas_exports, {
|
|
22
22
|
CloneProgressEventSchema: () => CloneProgressEventSchema,
|
|
23
23
|
CloneProgressPhaseSchema: () => CloneProgressPhaseSchema,
|
|
24
|
+
DiagnosticItemSchema: () => DiagnosticItemSchema,
|
|
25
|
+
DiagnosticSeveritySchema: () => DiagnosticSeveritySchema,
|
|
26
|
+
GitFileChangeTypeSchema: () => GitFileChangeTypeSchema,
|
|
27
|
+
GitFileStatusSchema: () => GitFileStatusSchema,
|
|
24
28
|
GitHubCloneOptionsSchema: () => GitHubCloneOptionsSchema,
|
|
29
|
+
GitStateSummarySchema: () => GitStateSummarySchema,
|
|
25
30
|
GuidedLabExtensionOptionsSchema: () => GuidedLabExtensionOptionsSchema,
|
|
26
31
|
GuidedStepSchema: () => GuidedStepSchema,
|
|
27
32
|
LanguageBundleSchema: () => LanguageBundleSchema,
|
|
28
33
|
RuntimeExecuteOptionsSchema: () => RuntimeExecuteOptionsSchema,
|
|
34
|
+
SearchOptionsSchema: () => SearchOptionsSchema,
|
|
35
|
+
StoredProjectSchema: () => StoredProjectSchema,
|
|
29
36
|
WorkbenchOptionsSchema: () => WorkbenchOptionsSchema,
|
|
30
37
|
WorkspaceSnapshotSchema: () => WorkspaceSnapshotSchema
|
|
31
38
|
});
|
|
@@ -4184,6 +4191,9 @@ var WorkbenchOptionsSchema = external_exports.object({
|
|
|
4184
4191
|
testFile: external_exports.string().optional(),
|
|
4185
4192
|
backLabel: external_exports.string().default("Back"),
|
|
4186
4193
|
monacoUrl: external_exports.string().optional(),
|
|
4194
|
+
previewOrigin: external_exports.string().optional(),
|
|
4195
|
+
logger: external_exports.any().optional(),
|
|
4196
|
+
debug: external_exports.boolean().optional(),
|
|
4187
4197
|
onClose: external_exports.function().returns(external_exports.void()).optional(),
|
|
4188
4198
|
onRun: external_exports.function().args(external_exports.any()).returns(external_exports.void()).optional(),
|
|
4189
4199
|
onTestResult: external_exports.function().args(external_exports.any()).returns(external_exports.void()).optional(),
|
|
@@ -4205,3 +4215,66 @@ var WorkbenchOptionsSchema = external_exports.object({
|
|
|
4205
4215
|
onStepComplete: external_exports.function().args(external_exports.any(), external_exports.number()).returns(external_exports.void()).optional(),
|
|
4206
4216
|
onLabComplete: external_exports.function().args(external_exports.string()).returns(external_exports.void()).optional()
|
|
4207
4217
|
});
|
|
4218
|
+
var SearchOptionsSchema = external_exports.object({
|
|
4219
|
+
query: external_exports.string().default(""),
|
|
4220
|
+
caseSensitive: external_exports.boolean().optional().default(false),
|
|
4221
|
+
wholeWord: external_exports.boolean().optional().default(false),
|
|
4222
|
+
regex: external_exports.boolean().optional().default(false),
|
|
4223
|
+
isRegex: external_exports.boolean().optional().default(false),
|
|
4224
|
+
include: external_exports.string().optional(),
|
|
4225
|
+
includeGlob: external_exports.string().optional(),
|
|
4226
|
+
includePattern: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
|
|
4227
|
+
exclude: external_exports.string().optional(),
|
|
4228
|
+
excludeGlob: external_exports.string().optional(),
|
|
4229
|
+
excludePattern: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional(),
|
|
4230
|
+
maxMatches: external_exports.number().int().positive().optional(),
|
|
4231
|
+
maxMatchesPerFile: external_exports.number().int().positive().optional()
|
|
4232
|
+
});
|
|
4233
|
+
var DiagnosticSeveritySchema = external_exports.enum(["error", "warning", "info", "hint"]);
|
|
4234
|
+
var DiagnosticItemSchema = external_exports.object({
|
|
4235
|
+
id: external_exports.string(),
|
|
4236
|
+
file: external_exports.string(),
|
|
4237
|
+
line: external_exports.number().int(),
|
|
4238
|
+
col: external_exports.number().int().optional(),
|
|
4239
|
+
column: external_exports.number().int().optional(),
|
|
4240
|
+
endLine: external_exports.number().int().optional(),
|
|
4241
|
+
endCol: external_exports.number().int().optional(),
|
|
4242
|
+
endColumn: external_exports.number().int().optional(),
|
|
4243
|
+
message: external_exports.string(),
|
|
4244
|
+
severity: DiagnosticSeveritySchema,
|
|
4245
|
+
source: external_exports.string().optional(),
|
|
4246
|
+
code: external_exports.union([external_exports.string(), external_exports.number()]).optional(),
|
|
4247
|
+
tags: external_exports.array(external_exports.string()).optional()
|
|
4248
|
+
});
|
|
4249
|
+
var StoredProjectSchema = external_exports.object({
|
|
4250
|
+
id: external_exports.string(),
|
|
4251
|
+
name: external_exports.string(),
|
|
4252
|
+
files: external_exports.record(external_exports.string()),
|
|
4253
|
+
updatedAt: external_exports.number(),
|
|
4254
|
+
createdAt: external_exports.number().optional(),
|
|
4255
|
+
entry: external_exports.string().optional(),
|
|
4256
|
+
testEntry: external_exports.string().optional(),
|
|
4257
|
+
version: external_exports.number().optional()
|
|
4258
|
+
});
|
|
4259
|
+
var GitFileChangeTypeSchema = external_exports.enum(["modified", "added", "deleted", "untracked"]);
|
|
4260
|
+
var GitFileStatusSchema = external_exports.object({
|
|
4261
|
+
path: external_exports.string(),
|
|
4262
|
+
status: GitFileChangeTypeSchema,
|
|
4263
|
+
staged: external_exports.boolean(),
|
|
4264
|
+
oldContent: external_exports.string().optional(),
|
|
4265
|
+
newContent: external_exports.string().optional()
|
|
4266
|
+
});
|
|
4267
|
+
var GitStateSummarySchema = external_exports.object({
|
|
4268
|
+
branch: external_exports.string().default("main"),
|
|
4269
|
+
headCommit: external_exports.string().optional(),
|
|
4270
|
+
branches: external_exports.array(external_exports.string()).default(["main"]),
|
|
4271
|
+
staged: external_exports.array(GitFileStatusSchema).default([]),
|
|
4272
|
+
unstaged: external_exports.array(GitFileStatusSchema).default([]),
|
|
4273
|
+
untracked: external_exports.array(GitFileStatusSchema).default([]),
|
|
4274
|
+
modified: external_exports.array(GitFileStatusSchema).optional(),
|
|
4275
|
+
deleted: external_exports.array(GitFileStatusSchema).optional(),
|
|
4276
|
+
hasChanges: external_exports.boolean().default(false),
|
|
4277
|
+
isClean: external_exports.boolean().default(true),
|
|
4278
|
+
ahead: external_exports.number().int().default(0),
|
|
4279
|
+
behind: external_exports.number().int().default(0)
|
|
4280
|
+
});
|
package/dist/scm.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @innovatorved/code-lab — Interactive Git Source Control (SCM) Engine
|
|
3
|
+
* ============================================================================
|
|
4
|
+
* Pure TypeScript in-browser Git status, staging, unstaging, and commit engine
|
|
5
|
+
* backed by workspace VFS state. Powers both the interactive Source Control UI
|
|
6
|
+
* and shell/CLI Git operations.
|
|
7
|
+
*
|
|
8
|
+
* Strict leaf module: fully typed, zero explicit any, zero empty catches.
|
|
9
|
+
*/
|
|
10
|
+
export type GitFileChangeType = 'modified' | 'added' | 'deleted' | 'untracked';
|
|
11
|
+
export interface GitFileStatus {
|
|
12
|
+
path: string;
|
|
13
|
+
status: GitFileChangeType;
|
|
14
|
+
staged: boolean;
|
|
15
|
+
oldContent?: string;
|
|
16
|
+
newContent?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface GitCommitRecord {
|
|
19
|
+
hash: string;
|
|
20
|
+
message: string;
|
|
21
|
+
timestamp: number;
|
|
22
|
+
author?: string;
|
|
23
|
+
files: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
export interface GitState {
|
|
26
|
+
branch: string;
|
|
27
|
+
branches?: string[];
|
|
28
|
+
headCommit: string;
|
|
29
|
+
headFiles: Record<string, string>;
|
|
30
|
+
staged: Map<string, string | null>;
|
|
31
|
+
commits: GitCommitRecord[];
|
|
32
|
+
}
|
|
33
|
+
export interface GitStatusResult {
|
|
34
|
+
branch: string;
|
|
35
|
+
headCommit: string;
|
|
36
|
+
untracked: GitFileStatus[];
|
|
37
|
+
modified: GitFileStatus[];
|
|
38
|
+
deleted: GitFileStatus[];
|
|
39
|
+
staged: GitFileStatus[];
|
|
40
|
+
unstaged: GitFileStatus[];
|
|
41
|
+
hasChanges: boolean;
|
|
42
|
+
isClean: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Computes a deterministic 7-character short hash for a commit payload.
|
|
46
|
+
*/
|
|
47
|
+
export declare function computeShortCommitHash(input: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Initializes a fresh in-memory Git repository state from initial VFS files.
|
|
50
|
+
*/
|
|
51
|
+
export declare function createGitState(initialFiles?: Record<string, string>, branch?: string): GitState;
|
|
52
|
+
/**
|
|
53
|
+
* Computes working-tree and staging-area Git status against `gitState`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function computeGitStatus(vfsFiles: Record<string, string>, _repoRoot?: string, gitState?: GitState): GitStatusResult;
|
|
56
|
+
/**
|
|
57
|
+
* Stages a file addition, modification, or deletion (`currentContent === null`).
|
|
58
|
+
*/
|
|
59
|
+
export declare function stageFile(gitState: GitState, relativePath: string, currentContent: string | null): void;
|
|
60
|
+
/**
|
|
61
|
+
* Removes a file from the staging index.
|
|
62
|
+
*/
|
|
63
|
+
export declare function unstageFile(gitState: GitState, relativePath: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* Commits all staged changes to `gitState`, advancing `headCommit` and `headFiles`,
|
|
66
|
+
* and clearing the staging area. Throws if message is empty or staging area is empty.
|
|
67
|
+
*/
|
|
68
|
+
export declare function commitChanges(gitState: GitState, message: string): string;
|
|
69
|
+
declare const _default: {
|
|
70
|
+
createGitState: typeof createGitState;
|
|
71
|
+
computeGitStatus: typeof computeGitStatus;
|
|
72
|
+
stageFile: typeof stageFile;
|
|
73
|
+
unstageFile: typeof unstageFile;
|
|
74
|
+
commitChanges: typeof commitChanges;
|
|
75
|
+
computeShortCommitHash: typeof computeShortCommitHash;
|
|
76
|
+
};
|
|
77
|
+
export default _default;
|
package/dist/search.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @innovatorved/code-lab — High-Performance Cross-File Search & Replace Core
|
|
3
|
+
* ============================================================================
|
|
4
|
+
* Pure TypeScript implementation of workspace-wide text search and atomic multi-file
|
|
5
|
+
* replacements. Supports regex, whole-word, case-sensitive matching, glob filtering,
|
|
6
|
+
* line/column coordinate extraction, and match highlight snippets.
|
|
7
|
+
*
|
|
8
|
+
* Strict leaf module: fully typed, zero explicit any, zero empty catches.
|
|
9
|
+
*/
|
|
10
|
+
export interface SearchOptions {
|
|
11
|
+
query?: string;
|
|
12
|
+
caseSensitive?: boolean;
|
|
13
|
+
wholeWord?: boolean;
|
|
14
|
+
regex?: boolean;
|
|
15
|
+
isRegex?: boolean;
|
|
16
|
+
include?: string;
|
|
17
|
+
includeGlob?: string;
|
|
18
|
+
includePattern?: string | string[];
|
|
19
|
+
exclude?: string;
|
|
20
|
+
excludeGlob?: string;
|
|
21
|
+
excludePattern?: string | string[];
|
|
22
|
+
maxMatches?: number;
|
|
23
|
+
maxMatchesPerFile?: number;
|
|
24
|
+
targetFiles?: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface SearchMatchItem {
|
|
27
|
+
line: number;
|
|
28
|
+
col: number;
|
|
29
|
+
column?: number;
|
|
30
|
+
length: number;
|
|
31
|
+
matchText?: string;
|
|
32
|
+
lineText: string;
|
|
33
|
+
beforeSnippet?: string;
|
|
34
|
+
afterSnippet?: string;
|
|
35
|
+
matchIndex?: number;
|
|
36
|
+
matchEndIndex?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface SearchMatchGroup {
|
|
39
|
+
file: string;
|
|
40
|
+
matches: SearchMatchItem[];
|
|
41
|
+
}
|
|
42
|
+
export interface SearchResult extends Array<SearchMatchGroup> {
|
|
43
|
+
matches: SearchMatchGroup[];
|
|
44
|
+
totalMatches: number;
|
|
45
|
+
fileCount: number;
|
|
46
|
+
filesCount: number;
|
|
47
|
+
query: string;
|
|
48
|
+
durationMs?: number;
|
|
49
|
+
error?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface ReplaceResult {
|
|
52
|
+
updatedFiles: Record<string, string>;
|
|
53
|
+
replacedCount: number;
|
|
54
|
+
filesAffected: string[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Escapes regex special characters in a literal string.
|
|
58
|
+
*/
|
|
59
|
+
export declare function escapeRegex(text: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Normalizes a virtual workspace path (POSIX forward-slashes, no leading ./ or /).
|
|
62
|
+
*/
|
|
63
|
+
export declare function normalizeSearchPath(filePath: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* Matches a file path against a glob or literal substring filter.
|
|
66
|
+
*/
|
|
67
|
+
export declare function matchesGlob(filePath: string, pattern: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Searches across a map of virtual files for matching text or regex patterns.
|
|
70
|
+
*/
|
|
71
|
+
export declare function searchInFiles(files: Record<string, string>, queryOrOptions: string | SearchOptions, optionsOrUndefined?: SearchOptions): SearchResult;
|
|
72
|
+
/**
|
|
73
|
+
* Replaces occurrences of a query pattern across virtual workspace files.
|
|
74
|
+
*/
|
|
75
|
+
export declare function replaceInFiles(files: Record<string, string>, arg2: string | SearchOptions, arg3: string, arg4?: SearchOptions | string[]): ReplaceResult;
|
package/dist/shell.d.ts
CHANGED
|
@@ -1,56 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @innovatorved/code-lab - POSIX Shell Engine & UNIX Coreutils
|
|
2
|
+
* @innovatorved/code-lab - POSIX Shell Engine & UNIX Coreutils
|
|
3
3
|
*
|
|
4
4
|
* Full-fidelity, CSP-safe POSIX shell AST interpreter and 35+ standard UNIX
|
|
5
5
|
* coreutils operating directly on the in-memory virtual filesystem (VFS).
|
|
6
6
|
*
|
|
7
|
+
* Capabilities:
|
|
8
|
+
* - Deterministic lexer and AST parser (zero dynamic eval, zero new Function)
|
|
9
|
+
* - Pipelines (cmd1 | cmd2 | cmd3) with streaming stdin/stdout chaining
|
|
10
|
+
* - Output redirection (>, >>, 1>, 2>, 2>&1, 1>&2, &>)
|
|
11
|
+
* - Input redirection (<, 0<)
|
|
12
|
+
* - Logical operators (&&, ||, ;)
|
|
13
|
+
* - Background job execution (cmd &) with job table & PID tracking
|
|
14
|
+
* - Variable expansion ($VAR, ${VAR}, ${VAR:-def}, $?, $PWD, $HOME, $USER)
|
|
15
|
+
* - Command substitution ($(cmd), `cmd`)
|
|
16
|
+
* - Glob expansion (*.js, src/**\/*.ts, [0-9]*.txt) against VFS
|
|
17
|
+
* - 40+ UNIX coreutils (ls, cd, pwd, cat, head, tail, grep, find, wc, sort, uniq,
|
|
18
|
+
* sed, awk, cut, tr, diff, tree, cp, mv, rm, mkdir, touch, chmod, stat, echo,
|
|
19
|
+
* printf, env, export, unset, which, whoami, uname, date, sleep, true, false,
|
|
20
|
+
* clear, history, ps, jobs, kill, git, help, dirname, basename, seq, tee)
|
|
21
|
+
* - Bidirectional VFS mutation bridge (touch, mkdir, rm, mv, cp, echo >, sed -i)
|
|
22
|
+
*
|
|
7
23
|
* (C) 2026 InnovatorVed / CodeLab. MIT License.
|
|
8
24
|
*/
|
|
9
|
-
import type { CloneProgressEvent, CloneProgressPhase, GitHubCloneOptions } from './schemas.js';
|
|
10
|
-
export type { CloneProgressEvent, CloneProgressPhase, GitHubCloneOptions };
|
|
11
|
-
export interface CloneResult {
|
|
12
|
-
owner: string;
|
|
13
|
-
repo: string;
|
|
14
|
-
branch: string;
|
|
15
|
-
url: string;
|
|
16
|
-
targetDir: string;
|
|
17
|
-
count: number;
|
|
18
|
-
fileCount: number;
|
|
19
|
-
filesWritten: number;
|
|
20
|
-
totalBytes: number;
|
|
21
|
-
commits: Array<{
|
|
22
|
-
hash: string;
|
|
23
|
-
author: string;
|
|
24
|
-
date: string;
|
|
25
|
-
message: string;
|
|
26
|
-
}>;
|
|
27
|
-
headSnapshot: Record<string, string>;
|
|
28
|
-
}
|
|
29
|
-
export interface ShellExecResult {
|
|
30
|
-
code: number;
|
|
31
|
-
exitCode?: number;
|
|
32
|
-
ok?: boolean;
|
|
33
|
-
stdout: string;
|
|
34
|
-
stderr: string;
|
|
35
|
-
controlFlow?: {
|
|
36
|
-
type: string;
|
|
37
|
-
count?: number;
|
|
38
|
-
code?: number;
|
|
39
|
-
};
|
|
40
|
-
aborted?: boolean;
|
|
41
|
-
}
|
|
42
|
-
export interface ShellExecOptions {
|
|
43
|
-
cwd?: string;
|
|
44
|
-
env?: Record<string, string>;
|
|
45
|
-
vfs?: any;
|
|
46
|
-
portTable?: any;
|
|
47
|
-
onStdout?: (chunk: string) => void;
|
|
48
|
-
onStderr?: (chunk: string) => void;
|
|
49
|
-
stdin?: string;
|
|
50
|
-
fetchImpl?: any;
|
|
51
|
-
onProgress?: (event: CloneProgressEvent) => void;
|
|
52
|
-
signal?: AbortSignal;
|
|
53
|
-
}
|
|
54
25
|
declare const _hostShell: any;
|
|
55
26
|
export declare const createPosixShell: (options?: any) => any;
|
|
56
27
|
export declare const parseShellCommand: (cmd: string) => any;
|
|
@@ -61,6 +32,6 @@ export declare const PosixPath: any;
|
|
|
61
32
|
export declare const expandGlob: (pattern: string, vfs: any, cwd?: string) => string[];
|
|
62
33
|
export declare const createVirtualPortTable: () => any;
|
|
63
34
|
export declare const parseGitHubRepoUrl: (input: string) => any;
|
|
64
|
-
export declare const cloneGitHubRepository: (repoInput: string, vfs: any, options?:
|
|
35
|
+
export declare const cloneGitHubRepository: (repoInput: string, vfs: any, options?: any) => Promise<any>;
|
|
65
36
|
export declare const CodeLabShell: any;
|
|
66
37
|
export default _hostShell;
|