@poe-platform/safe-bash 0.1.428 → 0.1.430
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/dist/safe-bash/browser.js +3 -1
- package/dist/safe-bash/browser.js.map +2 -2
- package/dist/safe-bash/commands/expr/command.d.ts +6 -0
- package/dist/safe-bash/commands/expr/command.d.ts.map +1 -0
- package/dist/safe-bash/commands/expr/command.js +75 -0
- package/dist/safe-bash/commands/expr/command.js.map +1 -0
- package/dist/safe-bash/commands/expr/index.d.ts +2 -2
- package/dist/safe-bash/commands/expr/index.d.ts.map +1 -1
- package/dist/safe-bash/commands/expr/index.js +3 -73
- package/dist/safe-bash/commands/expr/index.js.map +1 -1
- package/dist/safe-bash/commands/grep-aliases/aliases.d.ts +4 -0
- package/dist/safe-bash/commands/grep-aliases/aliases.d.ts.map +1 -0
- package/dist/safe-bash/commands/grep-aliases/aliases.js +29 -0
- package/dist/safe-bash/commands/grep-aliases/aliases.js.map +1 -0
- package/dist/safe-bash/commands/grep-aliases/index.d.ts.map +1 -1
- package/dist/safe-bash/commands/grep-aliases/index.js +2 -26
- package/dist/safe-bash/commands/grep-aliases/index.js.map +1 -1
- package/dist/safe-bash/commands/index.d.ts +3 -13
- package/dist/safe-bash/commands/index.d.ts.map +1 -1
- package/dist/safe-bash/commands/index.js +2 -18
- package/dist/safe-bash/commands/index.js.map +1 -1
- package/dist/safe-bash/commands/standard.d.ts +15 -0
- package/dist/safe-bash/commands/standard.d.ts.map +1 -0
- package/dist/safe-bash/commands/standard.js +22 -0
- package/dist/safe-bash/commands/standard.js.map +1 -0
- package/dist/safe-bash/contracts/errors.d.ts +2 -2
- package/dist/safe-bash/contracts/errors.d.ts.map +1 -1
- package/dist/safe-bash/contracts/errors.js +1 -1
- package/dist/safe-bash/contracts/errors.js.map +1 -1
- package/dist/safe-bash/contracts/filesystem.d.ts +2 -2
- package/dist/safe-bash/contracts/filesystem.d.ts.map +1 -1
- package/dist/safe-bash/contracts/filesystem.js +1 -1
- package/dist/safe-bash/contracts/filesystem.js.map +1 -1
- package/dist/safe-bash/contracts/io.d.ts +3 -3
- package/dist/safe-bash/contracts/io.d.ts.map +1 -1
- package/dist/safe-bash/contracts/io.js +2 -2
- package/dist/safe-bash/contracts/io.js.map +1 -1
- package/dist/safe-bash/contracts/path.d.ts +2 -1
- package/dist/safe-bash/contracts/path.d.ts.map +1 -1
- package/dist/safe-bash/contracts/path.js +2 -1
- package/dist/safe-bash/contracts/path.js.map +1 -1
- package/dist/safe-bash/fs/memory/index.d.ts +1 -1
- package/dist/safe-bash/fs/memory/index.d.ts.map +1 -1
- package/dist/safe-bash/fs/memory/index.js +1 -1
- package/dist/safe-bash/fs/memory/index.js.map +1 -1
- package/dist/safe-bash/fs/mount/index.d.ts +2 -2
- package/dist/safe-bash/fs/mount/index.d.ts.map +1 -1
- package/dist/safe-bash/fs/mount/index.js +1 -1
- package/dist/safe-bash/fs/mount/index.js.map +1 -1
- package/dist/safe-bash/fs/overlay/index.d.ts +2 -2
- package/dist/safe-bash/fs/overlay/index.d.ts.map +1 -1
- package/dist/safe-bash/fs/overlay/index.js +1 -1
- package/dist/safe-bash/fs/overlay/index.js.map +1 -1
- package/dist/safe-bash/fs/readonly/index.d.ts +1 -1
- package/dist/safe-bash/fs/readonly/index.d.ts.map +1 -1
- package/dist/safe-bash/fs/readonly/index.js +1 -1
- package/dist/safe-bash/fs/readonly/index.js.map +1 -1
- package/dist/safe-bash/plugins/composition.d.ts +64 -0
- package/dist/safe-bash/plugins/composition.d.ts.map +1 -0
- package/dist/safe-bash/plugins/composition.js +50 -0
- package/dist/safe-bash/plugins/composition.js.map +1 -0
- package/dist/safe-bash/plugins/index.d.ts +4 -54
- package/dist/safe-bash/plugins/index.d.ts.map +1 -1
- package/dist/safe-bash/plugins/index.js +9 -46
- package/dist/safe-bash/plugins/index.js.map +1 -1
- package/dist/safe-bash/plugins/portable.d.ts +9 -0
- package/dist/safe-bash/plugins/portable.d.ts.map +1 -0
- package/dist/safe-bash/plugins/portable.js +44 -0
- package/dist/safe-bash/plugins/portable.js.map +1 -0
- package/dist/safe-bash/portable.d.ts +3 -0
- package/dist/safe-bash/portable.d.ts.map +1 -0
- package/dist/safe-bash/portable.js +39092 -0
- package/dist/safe-bash/portable.js.map +7 -0
- package/dist/safe-bash/shell/runtime.js +1 -1
- package/dist/safe-bash/shell/runtime.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type CommandDefinition } from "../../contracts/index.js";
|
|
2
|
+
import { RegexExecutor } from "../regex-execution/portable.js";
|
|
3
|
+
import { type ExprCommandsOptions } from "./internal.js";
|
|
4
|
+
export type { ExprCommandsOptions, ExprLimits } from "./internal.js";
|
|
5
|
+
export declare function createExprCommandWithExecutor(executor: RegexExecutor, options?: ExprCommandsOptions): CommandDefinition;
|
|
6
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/commands/expr/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAE,aAAa,EAAyC,MAAM,gCAAgC,CAAC;AAGtG,OAAO,EAA4C,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGnG,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIrE,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,GAAE,mBAAwB,GAAG,iBAAiB,CA6D3H"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { writeBytes } from "../../contracts/index.js";
|
|
2
|
+
import { escapeText } from "../../escaping.js";
|
|
3
|
+
import { RegexExecutor, RegexExecutionError, withRegexSession } from "../regex-execution/portable.js";
|
|
4
|
+
import { ExprMatchError, exprMatchCeilings } from "../regex-execution/protocol.js";
|
|
5
|
+
import { bytes, characterCount, smallInteger, truth } from "./evaluate.js";
|
|
6
|
+
import { Budget, ExprError, screenMatch, settings } from "./internal.js";
|
|
7
|
+
import { evaluateExpression } from "./syntax.js";
|
|
8
|
+
const help = "Usage: expr EXPRESSION\nTokens: | & < <= = == != >= > + - * / % :\nPrefixes: + TOKEN, length STRING, index STRING CHARS, substr STRING POS LENGTH, match STRING REGEXP\nGroup with ( EXPRESSION ). Each token is a separate argument.\nMatching uses bounded worker-only BRE in C/POSIX byte or C.UTF-8 scalar profiles.\n";
|
|
9
|
+
export function createExprCommandWithExecutor(executor, options = {}) {
|
|
10
|
+
const limits = settings(options);
|
|
11
|
+
return { name: "expr", description: "Evaluate bounded integer and string expressions", async execute(context) {
|
|
12
|
+
return withRegexSession(context, executor, async (session) => {
|
|
13
|
+
context.signal.throwIfAborted();
|
|
14
|
+
const budget = new Budget(context, limits);
|
|
15
|
+
let output;
|
|
16
|
+
let exitCode = 0;
|
|
17
|
+
try {
|
|
18
|
+
budget.arguments();
|
|
19
|
+
if (context.args.length === 1 && ["--help", "--version"].includes(context.args[0])) {
|
|
20
|
+
const text = context.args[0] === "--help" ? help : "expr (virtual-bash)\n";
|
|
21
|
+
budget.check(Buffer.byteLength(text), limits.maxOutputBytes, "output bytes");
|
|
22
|
+
output = budget.encode(text);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const value = await evaluateExpression(context.args, budget, async (subject, pattern, unicode) => {
|
|
26
|
+
budget.charge();
|
|
27
|
+
screenMatch(subject, pattern, budget);
|
|
28
|
+
if (budget.remaining() < 1)
|
|
29
|
+
throw new ExprError("evaluation work limit exceeded", 3);
|
|
30
|
+
const result = await session.matchExpr({ kind: "expr-match", pattern, profile: unicode ? "utf8-scalar" : "byte", limits: {
|
|
31
|
+
maxPatternBytes: limits.maxRegexPatternBytes,
|
|
32
|
+
maxSubjectBytes: Math.min(limits.maxStringBytes, exprMatchCeilings.maxSubjectBytes),
|
|
33
|
+
maxNodes: limits.maxRegexNodes, maxDepth: limits.maxRegexDepth,
|
|
34
|
+
maxSteps: Math.min(budget.remaining(), exprMatchCeilings.maxSteps),
|
|
35
|
+
maxStates: limits.maxRegexStates, maxAllocatedUnits: limits.maxRegexAllocatedUnits,
|
|
36
|
+
} }, subject);
|
|
37
|
+
budget.charge(result.steps);
|
|
38
|
+
if (result.hasCapture) {
|
|
39
|
+
const start = result.capture?.start ?? 0, end = result.capture?.end ?? 0;
|
|
40
|
+
budget.allocation(end - start);
|
|
41
|
+
return new Uint8Array(subject.subarray(start, end));
|
|
42
|
+
}
|
|
43
|
+
return smallInteger(characterCount(subject.subarray(0, result.overall?.end ?? 0), budget, unicode), budget);
|
|
44
|
+
}, context.args[0] === "--" ? 1 : 0);
|
|
45
|
+
exitCode = truth(value, budget) ? 0 : 1;
|
|
46
|
+
const result = bytes(value, budget);
|
|
47
|
+
budget.check(result.length + 1, limits.maxOutputBytes, "output bytes");
|
|
48
|
+
budget.charge(result.length + 1);
|
|
49
|
+
output = new Uint8Array(result.length + 1);
|
|
50
|
+
output.set(result);
|
|
51
|
+
output[result.length] = 10;
|
|
52
|
+
}
|
|
53
|
+
await budget.yield();
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
context.signal.throwIfAborted();
|
|
57
|
+
const detail = error instanceof ExprError || error instanceof ExprMatchError || error instanceof RegexExecutionError ? error.message : "execution or output failure";
|
|
58
|
+
let message;
|
|
59
|
+
try {
|
|
60
|
+
budget.check(detail.length + 7, limits.maxOutputBytes, "output bytes");
|
|
61
|
+
message = escapeText(detail, "diagnostic", size => budget.check(size + 7, limits.maxOutputBytes, "output bytes"));
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
await writeBytes(context.stderr, new TextEncoder().encode("expr: output bytes limit exceeded\n"), context.signal);
|
|
65
|
+
return { exitCode: 3 };
|
|
66
|
+
}
|
|
67
|
+
await writeBytes(context.stderr, new TextEncoder().encode(`expr: ${message}\n`), context.signal);
|
|
68
|
+
return { exitCode: error instanceof ExprError ? error.exitCode : error instanceof ExprMatchError && error.category !== "limit" ? 2 : 3 };
|
|
69
|
+
}
|
|
70
|
+
await writeBytes(context.stdout, output, context.signal);
|
|
71
|
+
return { exitCode };
|
|
72
|
+
});
|
|
73
|
+
} };
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/commands/expr/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACtG,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAA4B,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIjD,MAAM,IAAI,GAAG,4TAA4T,CAAC;AAE1U,MAAM,UAAU,6BAA6B,CAAC,QAAuB,EAAE,UAA+B,EAAE;IACtG,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,iDAAiD,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO;YAC1G,OAAO,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;gBACzD,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;gBAChC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,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O,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;oBACzB,CAAC;oBACD,MAAM,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,SAAS,OAAO,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;oBACjG,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,YAAY,cAAc,IAAI,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3I,CAAC;gBACD,MAAM,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;gBACzD,OAAO,EAAE,QAAQ,EAAE,CAAC;YACtB,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,CAAC;AACN,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { CommandDefinition, VirtualShellPlugin } from "../../contracts/index.js";
|
|
2
|
+
import type { ExprCommandsOptions } from "./internal.js";
|
|
3
3
|
export type { ExprCommandsOptions, ExprLimits } from "./internal.js";
|
|
4
4
|
export declare function createExprCommand(options?: ExprCommandsOptions): CommandDefinition;
|
|
5
5
|
export declare function createExprCommands(options?: ExprCommandsOptions): readonly CommandDefinition[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/expr/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/expr/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGtF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAErE,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,mBAAwB,GAAG,iBAAiB,CAEtF;AAED,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,SAAS,iBAAiB,EAAE,CAElG;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,kBAAkB,CAMlF"}
|
|
@@ -1,77 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { RegexExecutor, RegexExecutionError, withRegexSession } from "../regex-execution/client.js";
|
|
4
|
-
import { ExprMatchError, exprMatchCeilings } from "../regex-execution/protocol.js";
|
|
5
|
-
import { bytes, characterCount, smallInteger, truth } from "./evaluate.js";
|
|
6
|
-
import { Budget, ExprError, screenMatch, settings } from "./internal.js";
|
|
7
|
-
import { evaluateExpression } from "./syntax.js";
|
|
8
|
-
const help = "Usage: expr EXPRESSION\nTokens: | & < <= = == != >= > + - * / % :\nPrefixes: + TOKEN, length STRING, index STRING CHARS, substr STRING POS LENGTH, match STRING REGEXP\nGroup with ( EXPRESSION ). Each token is a separate argument.\nMatching uses bounded worker-only BRE in C/POSIX byte or C.UTF-8 scalar profiles.\n";
|
|
1
|
+
import { RegexExecutor } from "../regex-execution/client.js";
|
|
2
|
+
import { createExprCommandWithExecutor } from "./command.js";
|
|
9
3
|
export function createExprCommand(options = {}) {
|
|
10
|
-
|
|
11
|
-
const executor = new RegexExecutor(options.regex);
|
|
12
|
-
return { name: "expr", description: "Evaluate bounded integer and string expressions", async execute(context) {
|
|
13
|
-
return withRegexSession(context, executor, async (session) => {
|
|
14
|
-
context.signal.throwIfAborted();
|
|
15
|
-
const budget = new Budget(context, limits);
|
|
16
|
-
let output;
|
|
17
|
-
let exitCode = 0;
|
|
18
|
-
try {
|
|
19
|
-
budget.arguments();
|
|
20
|
-
if (context.args.length === 1 && ["--help", "--version"].includes(context.args[0])) {
|
|
21
|
-
const text = context.args[0] === "--help" ? help : "expr (virtual-bash)\n";
|
|
22
|
-
budget.check(Buffer.byteLength(text), limits.maxOutputBytes, "output bytes");
|
|
23
|
-
output = budget.encode(text);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
const value = await evaluateExpression(context.args, budget, async (subject, pattern, unicode) => {
|
|
27
|
-
budget.charge();
|
|
28
|
-
screenMatch(subject, pattern, budget);
|
|
29
|
-
if (budget.remaining() < 1)
|
|
30
|
-
throw new ExprError("evaluation work limit exceeded", 3);
|
|
31
|
-
const result = await session.matchExpr({ kind: "expr-match", pattern, profile: unicode ? "utf8-scalar" : "byte", limits: {
|
|
32
|
-
maxPatternBytes: limits.maxRegexPatternBytes,
|
|
33
|
-
maxSubjectBytes: Math.min(limits.maxStringBytes, exprMatchCeilings.maxSubjectBytes),
|
|
34
|
-
maxNodes: limits.maxRegexNodes, maxDepth: limits.maxRegexDepth,
|
|
35
|
-
maxSteps: Math.min(budget.remaining(), exprMatchCeilings.maxSteps),
|
|
36
|
-
maxStates: limits.maxRegexStates, maxAllocatedUnits: limits.maxRegexAllocatedUnits,
|
|
37
|
-
} }, subject);
|
|
38
|
-
budget.charge(result.steps);
|
|
39
|
-
if (result.hasCapture) {
|
|
40
|
-
const start = result.capture?.start ?? 0, end = result.capture?.end ?? 0;
|
|
41
|
-
budget.allocation(end - start);
|
|
42
|
-
return new Uint8Array(subject.subarray(start, end));
|
|
43
|
-
}
|
|
44
|
-
return smallInteger(characterCount(subject.subarray(0, result.overall?.end ?? 0), budget, unicode), budget);
|
|
45
|
-
}, context.args[0] === "--" ? 1 : 0);
|
|
46
|
-
exitCode = truth(value, budget) ? 0 : 1;
|
|
47
|
-
const result = bytes(value, budget);
|
|
48
|
-
budget.check(result.length + 1, limits.maxOutputBytes, "output bytes");
|
|
49
|
-
budget.charge(result.length + 1);
|
|
50
|
-
output = new Uint8Array(result.length + 1);
|
|
51
|
-
output.set(result);
|
|
52
|
-
output[result.length] = 10;
|
|
53
|
-
}
|
|
54
|
-
await budget.yield();
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
context.signal.throwIfAborted();
|
|
58
|
-
const detail = error instanceof ExprError || error instanceof ExprMatchError || error instanceof RegexExecutionError ? error.message : "execution or output failure";
|
|
59
|
-
let message;
|
|
60
|
-
try {
|
|
61
|
-
budget.check(detail.length + 7, limits.maxOutputBytes, "output bytes");
|
|
62
|
-
message = escapeText(detail, "diagnostic", size => budget.check(size + 7, limits.maxOutputBytes, "output bytes"));
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
await writeBytes(context.stderr, new TextEncoder().encode("expr: output bytes limit exceeded\n"), context.signal);
|
|
66
|
-
return { exitCode: 3 };
|
|
67
|
-
}
|
|
68
|
-
await writeBytes(context.stderr, new TextEncoder().encode(`expr: ${message}\n`), context.signal);
|
|
69
|
-
return { exitCode: error instanceof ExprError ? error.exitCode : error instanceof ExprMatchError && error.category !== "limit" ? 2 : 3 };
|
|
70
|
-
}
|
|
71
|
-
await writeBytes(context.stdout, output, context.signal);
|
|
72
|
-
return { exitCode };
|
|
73
|
-
});
|
|
74
|
-
} };
|
|
4
|
+
return createExprCommandWithExecutor(new RegexExecutor(options.regex), options);
|
|
75
5
|
}
|
|
76
6
|
export function createExprCommands(options = {}) {
|
|
77
7
|
return [createExprCommand(options)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/expr/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/expr/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAK7D,MAAM,UAAU,iBAAiB,CAAC,UAA+B,EAAE;IACjE,OAAO,6BAA6B,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,UAA+B,EAAE;IAClE,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,UAA+B,EAAE;IAC5D,MAAM,QAAQ,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC7C,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,CAAC,IAAI;YACxC,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;YACvG,KAAK,MAAM,OAAO,IAAI,QAAQ;gBAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC;QACzG,CAAC,EAAE,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CommandDefinition } from "../../contracts/index.js";
|
|
2
|
+
export declare function alias(name: "egrep" | "fgrep", grep: CommandDefinition): CommandDefinition;
|
|
3
|
+
export declare function createGrepAliases(grep: CommandDefinition): readonly CommandDefinition[];
|
|
4
|
+
//# sourceMappingURL=aliases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aliases.d.ts","sourceRoot":"","sources":["../../../src/commands/grep-aliases/aliases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,wBAAgB,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,IAAI,EAAE,iBAAiB,GAAG,iBAAiB,CAwBzF;AAGD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,iBAAiB,EAAE,CAEvF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function alias(name, grep) {
|
|
2
|
+
return {
|
|
3
|
+
name,
|
|
4
|
+
execute: context => {
|
|
5
|
+
const stdinIsDefault = context.stdinIsDefault;
|
|
6
|
+
const invoke = context.invoke;
|
|
7
|
+
const registerCleanup = context.registerCleanup;
|
|
8
|
+
return grep.execute({
|
|
9
|
+
...context,
|
|
10
|
+
command: name,
|
|
11
|
+
args: [name === "egrep" ? "-E" : "-F", ...context.args],
|
|
12
|
+
stdin: context.stdin,
|
|
13
|
+
stdout: context.stdout,
|
|
14
|
+
stderr: context.stderr,
|
|
15
|
+
cwd: context.cwd,
|
|
16
|
+
env: context.env,
|
|
17
|
+
fs: context.fs,
|
|
18
|
+
signal: context.signal,
|
|
19
|
+
...(stdinIsDefault === undefined ? {} : { stdinIsDefault }),
|
|
20
|
+
...(invoke === undefined ? {} : { invoke: invoke.bind(context) }),
|
|
21
|
+
...(registerCleanup === undefined ? {} : { registerCleanup: registerCleanup.bind(context) }),
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function createGrepAliases(grep) {
|
|
27
|
+
return [alias("egrep", grep), alias("fgrep", grep)];
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=aliases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aliases.js","sourceRoot":"","sources":["../../../src/commands/grep-aliases/aliases.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,KAAK,CAAC,IAAuB,EAAE,IAAuB;IACpE,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,OAAO,CAAC,EAAE;YACjB,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;YAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAC9B,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,C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AkB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/grep-aliases/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAID,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,gBAAqB,GAAG,SAAS,iBAAiB,EAAE,CAGpG;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,iBAAiB,CAE9E;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,iBAAiB,CAE9E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,gBAAqB,GAAG,kBAAkB,CAWpF"}
|
|
@@ -1,32 +1,8 @@
|
|
|
1
1
|
import { grepCommands } from "../grep.js";
|
|
2
|
-
|
|
3
|
-
return {
|
|
4
|
-
name,
|
|
5
|
-
execute: context => {
|
|
6
|
-
const stdinIsDefault = context.stdinIsDefault;
|
|
7
|
-
const invoke = context.invoke;
|
|
8
|
-
const registerCleanup = context.registerCleanup;
|
|
9
|
-
return grep.execute({
|
|
10
|
-
...context,
|
|
11
|
-
command: name,
|
|
12
|
-
args: [name === "egrep" ? "-E" : "-F", ...context.args],
|
|
13
|
-
stdin: context.stdin,
|
|
14
|
-
stdout: context.stdout,
|
|
15
|
-
stderr: context.stderr,
|
|
16
|
-
cwd: context.cwd,
|
|
17
|
-
env: context.env,
|
|
18
|
-
fs: context.fs,
|
|
19
|
-
signal: context.signal,
|
|
20
|
-
...(stdinIsDefault === undefined ? {} : { stdinIsDefault }),
|
|
21
|
-
...(invoke === undefined ? {} : { invoke: invoke.bind(context) }),
|
|
22
|
-
...(registerCleanup === undefined ? {} : { registerCleanup: registerCleanup.bind(context) }),
|
|
23
|
-
});
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
}
|
|
2
|
+
import { alias, createGrepAliases } from "./aliases.js";
|
|
27
3
|
export function createGrepAliasCommands(options = {}) {
|
|
28
4
|
const grep = grepCommands(options.regex)[0];
|
|
29
|
-
return
|
|
5
|
+
return createGrepAliases(grep);
|
|
30
6
|
}
|
|
31
7
|
export function egrepCommand(options = {}) {
|
|
32
8
|
return alias("egrep", grepCommands(options.regex)[0]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/grep-aliases/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ1C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/grep-aliases/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ1C,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,UAAU,uBAAuB,CAAC,UAA4B,EAAE;IACpE,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,CAAC;IAC7C,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,UAA4B,EAAE;IACzD,OAAO,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,UAA4B,EAAE;IACzD,OAAO,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,UAA4B,EAAE;IAC9D,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,KAAK,CAAC,IAAI;YACR,MAAM,WAAW,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;YACrD,IAAI,CAAC,OAAO,CAAC,OAAO;gBAAE,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;oBAC3D,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;wBAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC5G,CAAC;YACD,KAAK,MAAM,UAAU,IAAI,WAAW;gBAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC;QAClH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
3
|
-
|
|
4
|
-
export type { ExecutionCommandsOptions } from "./execution.js";
|
|
5
|
-
export interface StandardCommandsOptions {
|
|
6
|
-
readonly execution?: ExecutionCommandsOptions;
|
|
7
|
-
readonly execute?: CommandHandler;
|
|
8
|
-
readonly replace?: boolean;
|
|
9
|
-
readonly regex?: RegexExecutionOptions;
|
|
10
|
-
readonly maxDirectoryEntries?: number;
|
|
11
|
-
readonly maxTeeTargets?: number;
|
|
12
|
-
readonly maxTailFollowHandles?: number;
|
|
13
|
-
}
|
|
1
|
+
import type { CommandDefinition, VirtualShellPlugin } from "../contracts/index.js";
|
|
2
|
+
import { type StandardCommandsOptions } from "./standard.js";
|
|
3
|
+
export type { StandardCommandsOptions, ExecutionCommandsOptions } from "./standard.js";
|
|
14
4
|
export declare function createStandardCommands(options?: StandardCommandsOptions): readonly CommandDefinition[];
|
|
15
5
|
export declare function standardCommands(options?: StandardCommandsOptions): VirtualShellPlugin;
|
|
16
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGnF,OAAO,EAAkC,KAAK,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7F,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAEvF,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,uBAA4B,GAAG,SAAS,iBAAiB,EAAE,CAE1G;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,GAAG,kBAAkB,CAkB1F"}
|
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
import {} from "../contracts/index.js";
|
|
2
|
-
import { basicCommands } from "./basic.js";
|
|
3
|
-
import { filesystemCommands } from "./filesystem.js";
|
|
4
|
-
import { streamCommands } from "./streams.js";
|
|
5
|
-
import { textCommands } from "./text.js";
|
|
6
1
|
import { grepCommands } from "./grep.js";
|
|
7
|
-
import { predicateCommands } from "./predicates.js";
|
|
8
|
-
import { directExecutor, executionCommands } from "./execution.js";
|
|
9
|
-
import { findCommands } from "./find.js";
|
|
10
2
|
import { diagnostic } from "./internal.js";
|
|
3
|
+
import { createStandardCommandsWithGrep } from "./standard.js";
|
|
11
4
|
export function createStandardCommands(options = {}) {
|
|
12
|
-
|
|
13
|
-
const execute = directExecutor(options.execute ?? (async (context) => {
|
|
14
|
-
const command = commands.find(definition => definition.name === context.command);
|
|
15
|
-
if (command)
|
|
16
|
-
return command.execute(context);
|
|
17
|
-
await diagnostic(context, new Error("command not found"));
|
|
18
|
-
return { exitCode: 127 };
|
|
19
|
-
}));
|
|
20
|
-
commands.push(...basicCommands(), ...filesystemCommands(options.maxDirectoryEntries), ...streamCommands(options.maxTeeTargets, options.maxTailFollowHandles), ...textCommands(), ...grepCommands(options.regex), ...predicateCommands(), ...executionCommands(execute, options.execution), ...findCommands(execute, options.maxDirectoryEntries));
|
|
21
|
-
return commands;
|
|
5
|
+
return createStandardCommandsWithGrep(options, grepCommands(options.regex));
|
|
22
6
|
}
|
|
23
7
|
export function standardCommands(options = {}) {
|
|
24
8
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,8BAA8B,EAAgC,MAAM,eAAe,CAAC;AAI7F,MAAM,UAAU,sBAAsB,CAAC,UAAmC,EAAE;IAC1E,OAAO,8BAA8B,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,UAAmC,EAAE;IACpE,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,KAAK,CAAC,IAAI;YACR,MAAM,QAAQ,GAAG,sBAAsB,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,CAAC,KAAK,EAAC,OAAO,EAAC,EAAE;oBACjG,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;oBACnD,IAAI,OAAO;wBAAE,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;oBAC7C,MAAM,UAAU,CAAC,OAAO,EAAE,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;oBAC1D,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;gBAC3B,CAAC,CAAC,EAAE,CAAC,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;gBACrB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;oBAC/B,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;wBAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;gBACtG,CAAC;YACH,CAAC;YACD,KAAK,MAAM,OAAO,IAAI,QAAQ;gBAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC;QACzG,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CommandDefinition, type CommandHandler } from "../contracts/index.js";
|
|
2
|
+
import { type ExecutionCommandsOptions } from "./execution.js";
|
|
3
|
+
import type { RegexExecutionOptions } from "./regex-execution/protocol.js";
|
|
4
|
+
export type { ExecutionCommandsOptions } from "./execution.js";
|
|
5
|
+
export interface StandardCommandsOptions {
|
|
6
|
+
readonly execution?: ExecutionCommandsOptions;
|
|
7
|
+
readonly execute?: CommandHandler;
|
|
8
|
+
readonly replace?: boolean;
|
|
9
|
+
readonly regex?: RegexExecutionOptions;
|
|
10
|
+
readonly maxDirectoryEntries?: number;
|
|
11
|
+
readonly maxTeeTargets?: number;
|
|
12
|
+
readonly maxTailFollowHandles?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function createStandardCommandsWithGrep(options: StandardCommandsOptions, grep: readonly CommandDefinition[]): readonly CommandDefinition[];
|
|
15
|
+
//# sourceMappingURL=standard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standard.d.ts","sourceRoot":"","sources":["../../src/commands/standard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMpF,OAAO,EAAqC,KAAK,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAGlG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE3E,YAAY,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,wBAAwB,CAAC;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACxC;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,uBAAuB,EAAE,IAAI,EAAE,SAAS,iBAAiB,EAAE,GAAG,SAAS,iBAAiB,EAAE,CAUjJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {} from "../contracts/index.js";
|
|
2
|
+
import { basicCommands } from "./basic.js";
|
|
3
|
+
import { filesystemCommands } from "./filesystem.js";
|
|
4
|
+
import { streamCommands } from "./streams.js";
|
|
5
|
+
import { textCommands } from "./text.js";
|
|
6
|
+
import { predicateCommands } from "./predicates.js";
|
|
7
|
+
import { directExecutor, executionCommands } from "./execution.js";
|
|
8
|
+
import { findCommands } from "./find.js";
|
|
9
|
+
import { diagnostic } from "./internal.js";
|
|
10
|
+
export function createStandardCommandsWithGrep(options, grep) {
|
|
11
|
+
const commands = [];
|
|
12
|
+
const execute = directExecutor(options.execute ?? (async (context) => {
|
|
13
|
+
const command = commands.find(definition => definition.name === context.command);
|
|
14
|
+
if (command)
|
|
15
|
+
return command.execute(context);
|
|
16
|
+
await diagnostic(context, new Error("command not found"));
|
|
17
|
+
return { exitCode: 127 };
|
|
18
|
+
}));
|
|
19
|
+
commands.push(...basicCommands(), ...filesystemCommands(options.maxDirectoryEntries), ...streamCommands(options.maxTeeTargets, options.maxTailFollowHandles), ...textCommands(), ...grep, ...predicateCommands(), ...executionCommands(execute, options.execution), ...findCommands(execute, options.maxDirectoryEntries));
|
|
20
|
+
return commands;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=standard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standard.js","sourceRoot":"","sources":["../../src/commands/standard.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAiC,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAe3C,MAAM,UAAU,8BAA8B,CAAC,OAAgC,EAAE,IAAkC;IACjH,MAAM,QAAQ,GAAwB,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,KAAK,EAAC,OAAO,EAAC,EAAE;QACjE,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;QACjF,IAAI,OAAO;YAAE,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,UAAU,CAAC,OAAO,EAAE,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAC1D,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC,CAAC;IACJ,QAAQ,CAAC,IAAI,CAAC,GAAG,aAAa,EAAE,EAAE,GAAG,kBAAkB,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,GAAG,YAAY,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,iBAAiB,EAAE,EAAE,GAAG,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,GAAG,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC3T,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { isErrnoCode, isFsError, toFsError, FsError } from "@poe-platform/safe-fs";
|
|
2
|
-
export type { ErrnoCode, FsErrorOptions } from "@poe-platform/safe-fs";
|
|
1
|
+
export { isErrnoCode, isFsError, toFsError, FsError } from "@poe-platform/safe-fs/core";
|
|
2
|
+
export type { ErrnoCode, FsErrorOptions } from "@poe-platform/safe-fs/core";
|
|
3
3
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/contracts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/contracts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACnF,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { isErrnoCode, isFsError, toFsError, FsError } from "@poe-platform/safe-fs";
|
|
1
|
+
export { isErrnoCode, isFsError, toFsError, FsError } from "@poe-platform/safe-fs/core";
|
|
2
2
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/contracts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/contracts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ACCESS_MODES } from "@poe-platform/safe-fs";
|
|
2
|
-
export type { FileType, EntryComparison, FileStat, DirectoryEntry, FileSystemCapabilities, FsOptions, FileReadHandle, ReadFileOptions, ReadDirectoryOptions, WriteFileOptions, AppendFileOptions, MkdirOptions, RemoveOptions, CopyFileOptions, ReadStreamOptions, FileSystem, FileSystemFactory } from "@poe-platform/safe-fs";
|
|
1
|
+
export { ACCESS_MODES } from "@poe-platform/safe-fs/core";
|
|
2
|
+
export type { FileType, EntryComparison, FileStat, DirectoryEntry, FileSystemCapabilities, FsOptions, FileReadHandle, ReadFileOptions, ReadDirectoryOptions, WriteFileOptions, AppendFileOptions, MkdirOptions, RemoveOptions, CopyFileOptions, ReadStreamOptions, FileSystem, FileSystemFactory } from "@poe-platform/safe-fs/core";
|
|
3
3
|
//# sourceMappingURL=filesystem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../src/contracts/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../src/contracts/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,sBAAsB,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ACCESS_MODES } from "@poe-platform/safe-fs";
|
|
1
|
+
export { ACCESS_MODES } from "@poe-platform/safe-fs/core";
|
|
2
2
|
//# sourceMappingURL=filesystem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../src/contracts/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../src/contracts/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ByteSource, CollectOptions } from "@poe-platform/safe-fs";
|
|
2
|
-
export { collectBytes, readBytes, toByteSource } from "@poe-platform/safe-fs";
|
|
3
|
-
export type { ByteSource, CollectOptions } from "@poe-platform/safe-fs";
|
|
1
|
+
import type { ByteSource, CollectOptions } from "@poe-platform/safe-fs/core";
|
|
2
|
+
export { collectBytes, readBytes, toByteSource } from "@poe-platform/safe-fs/core";
|
|
3
|
+
export type { ByteSource, CollectOptions } from "@poe-platform/safe-fs/core";
|
|
4
4
|
export declare const outputFailure: unique symbol;
|
|
5
5
|
export interface ByteSink {
|
|
6
6
|
write(chunk: Uint8Array): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../src/contracts/io.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../src/contracts/io.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC9E,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIxE,eAAO,MAAM,aAAa,eAA2B,CAAC;AAEtD,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,QAAQ,CAAC,WAAW,CAAC,EAAE;QACrB,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC;QACrC,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACzC,CAAC;CACH;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAED,wBAAgB,cAAc,CAAC,OAAO,GAAE,eAAoB,GAAG,QAAQ,CA8FtE;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3E;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvG;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAMvG;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { collectBytes, readBytes } from "@poe-platform/safe-fs";
|
|
2
|
-
export { collectBytes, readBytes, toByteSource } from "@poe-platform/safe-fs";
|
|
1
|
+
import { collectBytes, readBytes } from "@poe-platform/safe-fs/core";
|
|
2
|
+
export { collectBytes, readBytes, toByteSource } from "@poe-platform/safe-fs/core";
|
|
3
3
|
import { TransformStream } from "node:stream/web";
|
|
4
4
|
import { FsError } from "./errors.js";
|
|
5
5
|
export const outputFailure = Symbol("output failure");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/contracts/io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/contracts/io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAuBtD,MAAM,UAAU,cAAc,CAAC,UAA2B,EAAE;IAC1D,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,EAAE,GAAG,IAAI,CAAC;IACzD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;QAC9D,MAAM,IAAI,UAAU,CAAC,+CAA+C,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,eAAe,CAChC,SAAS,EACT,EAAE,aAAa,EAAE,CAAC,EAAE,EACpB,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,CACrD,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC3C,MAAM,MAAM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OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAC/B,CAAC,MAAM,EAAE,EAAE;gBACT,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBAC7C,OAAO,CAAC,MAAM,CAAC,CAAC;YAClB,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;gBACjB,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBAC7C,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC,CACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC7C,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { validatePath, resolvePath, normalizePath, relativePath, isPathWithin, assertPathWithin,
|
|
1
|
+
export { validatePath, resolvePath, normalizePath, relativePath, isPathWithin, assertPathWithin, basename, dirname, extname, joinPath, isAbsolutePath } from "@poe-platform/safe-fs/core";
|
|
2
|
+
export { posix as posixPath } from "node:path";
|
|
2
3
|
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/contracts/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/contracts/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACrL,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { validatePath, resolvePath, normalizePath, relativePath, isPathWithin, assertPathWithin,
|
|
1
|
+
export { validatePath, resolvePath, normalizePath, relativePath, isPathWithin, assertPathWithin, basename, dirname, extname, joinPath, isAbsolutePath } from "@poe-platform/safe-fs/core";
|
|
2
|
+
export { posix as posixPath } from "node:path";
|
|
2
3
|
//# sourceMappingURL=path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/contracts/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/contracts/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACrL,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createMemoryFileSystem, defaultMemoryFileSystemLimits, MemoryFileSystem, type MemoryFileSystemLimits, type MemoryFileSystemOptions, } from "@poe-platform/safe-fs";
|
|
1
|
+
export { createMemoryFileSystem, defaultMemoryFileSystemLimits, MemoryFileSystem, type MemoryFileSystemLimits, type MemoryFileSystemOptions, } from "@poe-platform/safe-fs/core";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fs/memory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAAE,6BAA6B,EAAE,gBAAgB,EACvE,KAAK,sBAAsB,EAAE,KAAK,uBAAuB,GAC1D,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fs/memory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAAE,6BAA6B,EAAE,gBAAgB,EACvE,KAAK,sBAAsB,EAAE,KAAK,uBAAuB,GAC1D,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createMemoryFileSystem, defaultMemoryFileSystemLimits, MemoryFileSystem, } from "@poe-platform/safe-fs";
|
|
1
|
+
export { createMemoryFileSystem, defaultMemoryFileSystemLimits, MemoryFileSystem, } from "@poe-platform/safe-fs/core";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fs/memory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAAE,6BAA6B,EAAE,gBAAgB,GAExE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fs/memory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAAE,6BAA6B,EAAE,gBAAgB,GAExE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createMountFileSystem, MountFileSystem } from "@poe-platform/safe-fs";
|
|
2
|
-
export type { MountFileSystemOptions } from "@poe-platform/safe-fs";
|
|
1
|
+
export { createMountFileSystem, MountFileSystem } from "@poe-platform/safe-fs/core";
|
|
2
|
+
export type { MountFileSystemOptions } from "@poe-platform/safe-fs/core";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|