@poe-platform/safe-bash 0.1.782 → 0.1.784

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +40 -0
  2. package/dist/office-package/zip-sync.d.ts +2 -0
  3. package/dist/office-package/zip-sync.js +111 -0
  4. package/dist/safe-bash/chunks/chunk-4FDQJUFW.js +3464 -0
  5. package/dist/safe-bash/chunks/csvkit-K55OYAQC.js +1564 -0
  6. package/dist/safe-bash/chunks/ffmpeg-BEFTQ6DZ.js +60 -0
  7. package/dist/safe-bash/chunks/gh-HQWOWLWE.js +41 -0
  8. package/dist/safe-bash/chunks/git-UFNPAOYZ.js +52 -0
  9. package/dist/safe-bash/chunks/imagemagick-53BMHH6D.js +134 -0
  10. package/dist/safe-bash/chunks/implementation-QUTAAYMT.js +105 -0
  11. package/dist/safe-bash/chunks/pdfimages-4OYI6FLG.js +73 -0
  12. package/dist/safe-bash/chunks/pdfinfo-I7U6TQPP.js +153 -0
  13. package/dist/safe-bash/chunks/pdftk-SUA6FMHI.js +79 -0
  14. package/dist/safe-bash/chunks/pdftoppm-4C5DGEWX.js +139 -0
  15. package/dist/safe-bash/chunks/pdftotext-Y4WI225Y.js +118 -0
  16. package/dist/safe-bash/chunks/qpdf-IORB4RV5.js +68 -0
  17. package/dist/safe-bash/chunks/sips-WHAMJFEU.js +77 -0
  18. package/dist/safe-bash/chunks/soffice-SYEK6WJS.js +89 -0
  19. package/dist/safe-bash/chunks/wkhtmltopdf-ZIICWJLF.js +85 -0
  20. package/dist/safe-bash/command-chunks/chunk-2LP3VMPA.js +58 -0
  21. package/dist/safe-bash/command-chunks/{chunk-CG4JSOK2.js → chunk-3HDIDEUJ.js} +1 -1
  22. package/dist/safe-bash/command-chunks/chunk-4DSJDVBM.js +2897 -0
  23. package/dist/safe-bash/command-chunks/{chunk-GBHSE6ZO.js → chunk-5GRLAARV.js} +1 -1
  24. package/dist/safe-bash/command-chunks/chunk-7OKDCM5U.js +112 -0
  25. package/dist/safe-bash/command-chunks/{chunk-FH3D75FC.js → chunk-ADCGH6A7.js} +1 -1
  26. package/dist/safe-bash/command-chunks/{chunk-MTKXVRXL.js → chunk-DREUDEQG.js} +1 -1
  27. package/dist/safe-bash/command-chunks/{chunk-ADBFNLLK.js → chunk-FXYWQ6S4.js} +16 -14
  28. package/dist/safe-bash/command-chunks/{chunk-Y2KHC6TZ.js → chunk-IDKD76KR.js} +5 -3
  29. package/dist/safe-bash/command-chunks/{chunk-K6KBYLQC.js → chunk-JUDOV5MJ.js} +1 -1
  30. package/dist/safe-bash/command-chunks/{chunk-3ZK5F23O.js → chunk-L3MLMXL4.js} +1 -1
  31. package/dist/safe-bash/command-chunks/{chunk-E5TEVROY.js → chunk-PFBJR2PY.js} +4 -4
  32. package/dist/safe-bash/command-chunks/{chunk-YGYOVXTO.js → chunk-UUR2S7AD.js} +9 -5
  33. package/dist/safe-bash/command-chunks/chunk-VIVYKW7Q.js +101 -0
  34. package/dist/safe-bash/command-chunks/{chunk-I5GLTNVH.js → chunk-X4P42NYK.js} +2 -27
  35. package/dist/safe-bash/command-chunks/{chunk-XF6TXYLD.js → chunk-Z57TV6TC.js} +4 -54
  36. package/dist/safe-bash/command-chunks/{chunk-QDPRSPHQ.js → chunk-Z64BW7CG.js} +1 -1
  37. package/dist/safe-bash/command-chunks/{chunk-X3IVPNC3.js → chunk-Z7TYZG3A.js} +5 -3
  38. package/dist/safe-bash/command-chunks/{chunk-GZXLPWT5.js → chunk-ZF3ZVGQC.js} +259 -258
  39. package/dist/safe-bash/command-chunks/{pptx-ZL6L7KP2-QVZEYFUV.js → pptx-KY2OJWZW-76LBHCHD.js} +4 -3
  40. package/dist/safe-bash/commands/csvkit/index.d.ts +1 -8
  41. package/dist/safe-bash/commands/csvkit/index.js +5 -1639
  42. package/dist/safe-bash/commands/csvkit/sync.d.ts +9 -0
  43. package/dist/safe-bash/commands/csvkit/sync.js +1639 -0
  44. package/dist/safe-bash/commands/pandoc/implementation.d.ts +8 -0
  45. package/dist/safe-bash/commands/pandoc/implementation.js +92 -0
  46. package/dist/safe-bash/commands/pandoc/index.d.ts +2 -6
  47. package/dist/safe-bash/commands/pandoc/index.js +2 -90
  48. package/dist/safe-bash/core.browser.js +808 -6271
  49. package/dist/safe-bash/core.d.ts +17 -16
  50. package/dist/safe-bash/core.js +17 -16
  51. package/dist/safe-bash/lazy-gh.d.ts +10 -0
  52. package/dist/safe-bash/lazy-gh.js +30 -0
  53. package/dist/safe-bash/lazy-optional.d.ts +499 -0
  54. package/dist/safe-bash/lazy-optional.js +609 -0
  55. package/dist/safe-bash/plugins/composition.d.ts +1 -1
  56. package/dist/safe-bash/plugins/composition.js +1 -1
  57. package/dist/safe-bash/plugins/lazy-command.d.ts +9 -0
  58. package/dist/safe-bash/plugins/lazy-command.js +57 -0
  59. package/dist/safe-bash/shell/runtime.js +24 -25
  60. package/dist/safe-bash-command-csvkit/cli/lexical.d.ts +3 -0
  61. package/dist/safe-bash-command-csvkit/cli/parser.d.ts +1 -2
  62. package/dist/safe-bash-command-csvkit/codecs/python.js +3 -2
  63. package/dist/safe-bash-command-csvkit/codecs/utf8.js +2 -1
  64. package/dist/safe-bash-command-csvkit/index.js +453 -3270
  65. package/dist/safe-bash-command-csvkit/sync-support.d.ts +7 -0
  66. package/dist/safe-bash-command-csvkit/sync-support.js +31 -0
  67. package/dist/safe-bash-command-gh/index.js +25 -17
  68. package/dist/safe-bash-command-git/index.js +6 -10
  69. package/dist/safe-bash-command-imagemagick/index.js +2 -2
  70. package/dist/safe-bash-command-pandoc/citeproc-filters.js +4 -2
  71. package/dist/safe-bash-command-pandoc/command.js +8 -6
  72. package/dist/safe-bash-command-pandoc/index.js +8 -6
  73. package/dist/safe-bash-command-pandoc/lua-filters.js +3 -2
  74. package/dist/safe-bash-command-pandoc/options.d.ts +5 -0
  75. package/dist/safe-bash-command-pandoc/options.js +93 -0
  76. package/dist/safe-bash-command-sips/index.js +2 -2
  77. package/dist/safe-bash-command-soffice/index.d.ts +1 -2
  78. package/dist/safe-bash-command-soffice/index.js +22 -18
  79. package/dist/safe-bash-command-ssconvert/commands.js +2 -2
  80. package/dist/safe-bash-command-ssconvert/core.js +2 -2
  81. package/dist/safe-bash-command-ssconvert/formats/csv.js +2 -2
  82. package/dist/safe-bash-command-ssconvert/formats/xls.js +3 -3
  83. package/dist/safe-bash-command-ssconvert/formats/xlsx.js +3 -3
  84. package/dist/safe-bash-command-timeout/index.js +3 -3
  85. package/dist/safe-bash-command-yq/index.js +5 -5
  86. package/dist/safe-bash-compression-engine/bounded-codec.js +3 -3
  87. package/dist/safe-bash-compression-engine/codec-loader.js +2 -2
  88. package/dist/safe-bash-compression-engine/files.js +7 -7
  89. package/dist/safe-bash-compression-engine/index.js +6 -6
  90. package/dist/safe-bash-compression-engine/operand.js +7 -7
  91. package/dist/safe-bash-compression-engine/stream.js +6 -6
  92. package/dist/safe-bash-compression-engine/zstd-decode.js +5 -5
  93. package/dist/safe-bash-contracts/diagnostics.js +3 -3
  94. package/dist/safe-bash-contracts/escaping.js +9 -9
  95. package/dist/safe-bash-contracts/filesystem-descriptor.js +1 -1
  96. package/dist/safe-bash-contracts/filesystem-output.js +10 -10
  97. package/dist/safe-bash-contracts/index.js +40 -40
  98. package/dist/safe-bash-io-engine/commands/search/requirements.js +4 -4
  99. package/dist/safe-bash-io-engine/commands/text-programs/shared.js +4 -4
  100. package/dist/safe-bash-io-engine/internal.d.ts +9 -0
  101. package/dist/safe-bash-io-engine/internal.js +3 -3
  102. package/dist/safe-bash-query-engine/index.js +6 -6
  103. package/dist/safe-bash-query-engine/interpreter.js +5 -5
  104. package/dist/safe-bash-query-engine/query-core.js +6 -6
  105. package/dist/safe-bash-regex-engine/execution/bounded-provider.js +3 -3
  106. package/dist/safe-bash-regex-engine/index.js +2 -2
  107. package/dist/safe-bash-regex-engine/text/regex.js +2 -2
  108. package/dist/safe-bash-xml-engine/index.js +3 -3
  109. package/package.json +4 -4
  110. package/dist/safe-bash/command-chunks/{chunk-DC52GWRK.js → chunk-BUKYQBXO.js} +13 -13
  111. package/dist/safe-bash/command-chunks/{chunk-QJ3ONEBI.js → chunk-DEH3CMGL.js} +3 -3
  112. package/dist/safe-bash/command-chunks/{chunk-Y64PA6IA.js → chunk-KHZZ4V3L.js} +3 -3
  113. package/dist/safe-bash/command-chunks/{chunk-I7PKIGII.js → chunk-QIRUOY2W.js} +3 -3
  114. package/dist/safe-bash/command-chunks/{chunk-HQG2IBZL.js → chunk-TOSM3T3A.js} +6 -6
  115. package/dist/safe-bash/command-chunks/{chunk-F4IQCXZG.js → chunk-VBZMCL23.js} +4 -4
  116. package/dist/safe-bash/command-chunks/{chunk-J2NPH7DO.js → chunk-W2T7JWT3.js} +3 -3
@@ -0,0 +1,8 @@
1
+ import type { CommandDefinition, VirtualShellPlugin } from "../../contracts/index.js";
2
+ import { type PandocCommandsOptions } from "../../../safe-bash-command-pandoc/index.js";
3
+ export * from "../../../safe-bash-command-pandoc/index.js";
4
+ export declare function createPandocCommand(options?: PandocCommandsOptions, hasCommand?: (name: string) => boolean): CommandDefinition;
5
+ export declare function createPandocCommands(options?: PandocCommandsOptions): readonly CommandDefinition[];
6
+ export declare function pandocCommands(options?: PandocCommandsOptions): VirtualShellPlugin;
7
+ export declare function evalSyncPandoc(inBytes: Uint8Array | undefined, opArgs: readonly string[], readFileSync?: (filePath: string) => Uint8Array | undefined, writeFileSync?: (filePath: string, bytes: Uint8Array) => boolean): string | undefined;
8
+ //# sourceMappingURL=implementation.d.ts.map
@@ -0,0 +1,92 @@
1
+ import { builtInDirectContextExecutors, syncCommandEvaluators } from "../internal.js";
2
+ import { createPandocCommand as createRawPandocCommand, createPandocCommands as createRawPandocCommands, inspectFormats, parseConversionArgs, convertSync, } from "../../../safe-bash-command-pandoc/index.js";
3
+ export * from "../../../safe-bash-command-pandoc/index.js";
4
+ export function createPandocCommand(options = {}, hasCommand) {
5
+ const def = createRawPandocCommand(options, hasCommand);
6
+ if (options.limits === undefined && options.filters === undefined && options.jsonFilterCommand === undefined && options.citeproc === undefined) {
7
+ builtInDirectContextExecutors.add(def.execute);
8
+ }
9
+ return def;
10
+ }
11
+ export function createPandocCommands(options = {}) {
12
+ const defs = createRawPandocCommands(options);
13
+ if (options.limits === undefined && options.filters === undefined && options.jsonFilterCommand === undefined && options.citeproc === undefined) {
14
+ for (let i = 0; i < defs.length; i++)
15
+ builtInDirectContextExecutors.add(defs[i].execute);
16
+ }
17
+ return defs;
18
+ }
19
+ export function pandocCommands(options = {}) {
20
+ let hasCommand;
21
+ const command = createPandocCommand(options, name => hasCommand?.(name) ?? false);
22
+ return {
23
+ name: "pandoc",
24
+ setup(host) {
25
+ hasCommand = name => host.commands.has(name);
26
+ host.commands.register(command, { replace: options.replace ?? false });
27
+ },
28
+ };
29
+ }
30
+ export function evalSyncPandoc(inBytes, opArgs, readFileSync, writeFileSync) {
31
+ try {
32
+ if (opArgs.length > 0 && opArgs.every((a) => a === "--list-input-formats" || a === "--list-output-formats")) {
33
+ return inspectFormats(opArgs);
34
+ }
35
+ for (let i = 0; i < opArgs.length; i++) {
36
+ const a = opArgs[i];
37
+ if (a === "-d" || a === "--defaults" || a.startsWith("-d") || a.startsWith("--defaults=")) {
38
+ return undefined;
39
+ }
40
+ }
41
+ const signal = new AbortController().signal;
42
+ const parsed = parseConversionArgs(opArgs, {
43
+ cwd: "/",
44
+ ...(inBytes === undefined ? {} : { stdin: [inBytes] }),
45
+ readFile: async () => new Uint8Array(0),
46
+ writeFile: async () => { },
47
+ }, signal);
48
+ const inputs = [];
49
+ if (!parsed.operands) {
50
+ if (inBytes === undefined || inBytes.byteLength > 262144)
51
+ return undefined;
52
+ inputs.push({ bytes: inBytes });
53
+ }
54
+ else {
55
+ for (const op of parsed.operands) {
56
+ if (op.source === undefined) {
57
+ if (inBytes === undefined || inBytes.byteLength > 262144)
58
+ return undefined;
59
+ inputs.push({ bytes: inBytes });
60
+ }
61
+ else {
62
+ if (parsed.destination && op.source === parsed.destination)
63
+ return undefined;
64
+ const b = readFileSync?.(op.source);
65
+ if (!b || b.byteLength > 262144)
66
+ return undefined;
67
+ inputs.push({ bytes: b, source: op.source, ...(op.base === undefined ? {} : { base: op.base }) });
68
+ }
69
+ }
70
+ }
71
+ const serialized = convertSync(inputs, parsed.options);
72
+ if (!serialized)
73
+ return undefined;
74
+ if (parsed.destination !== undefined) {
75
+ if (!writeFileSync)
76
+ return undefined;
77
+ const outBytes = serialized.kind === "binary" ? serialized.bytes : new TextEncoder().encode(serialized.text);
78
+ if (!writeFileSync(parsed.destination, outBytes))
79
+ return undefined;
80
+ return "";
81
+ }
82
+ if (serialized.kind === "text") {
83
+ return serialized.text;
84
+ }
85
+ return new TextDecoder("utf-8", { fatal: true }).decode(serialized.bytes);
86
+ }
87
+ catch {
88
+ return undefined;
89
+ }
90
+ }
91
+ syncCommandEvaluators.evalSyncPandoc = evalSyncPandoc;
92
+ //# sourceMappingURL=implementation.js.map
@@ -1,8 +1,4 @@
1
- import type { CommandDefinition, VirtualShellPlugin } from "../../contracts/index.js";
2
- import { type PandocCommandsOptions } from "../../../safe-bash-command-pandoc/index.js";
3
1
  export * from "../../../safe-bash-command-pandoc/index.js";
4
- export declare function createPandocCommand(options?: PandocCommandsOptions, hasCommand?: (name: string) => boolean): CommandDefinition;
5
- export declare function createPandocCommands(options?: PandocCommandsOptions): readonly CommandDefinition[];
6
- export declare function pandocCommands(options?: PandocCommandsOptions): VirtualShellPlugin;
7
- export declare function evalSyncPandoc(inBytes: Uint8Array | undefined, opArgs: readonly string[], readFileSync?: (filePath: string) => Uint8Array | undefined, writeFileSync?: (filePath: string, bytes: Uint8Array) => boolean): string | undefined;
2
+ export * from "./implementation.js";
3
+ export { createPandocCommand, createPandocCommands, pandocCommands } from "../../lazy-optional.js";
8
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,92 +1,4 @@
1
- import { builtInDirectContextExecutors, syncCommandEvaluators } from "../internal.js";
2
- import { createPandocCommand as createRawPandocCommand, createPandocCommands as createRawPandocCommands, inspectFormats, parseConversionArgs, convertSync, } from "../../../safe-bash-command-pandoc/index.js";
3
1
  export * from "../../../safe-bash-command-pandoc/index.js";
4
- export function createPandocCommand(options = {}, hasCommand) {
5
- const def = createRawPandocCommand(options, hasCommand);
6
- if (options.limits === undefined && options.filters === undefined && options.jsonFilterCommand === undefined && options.citeproc === undefined) {
7
- builtInDirectContextExecutors.add(def.execute);
8
- }
9
- return def;
10
- }
11
- export function createPandocCommands(options = {}) {
12
- const defs = createRawPandocCommands(options);
13
- if (options.limits === undefined && options.filters === undefined && options.jsonFilterCommand === undefined && options.citeproc === undefined) {
14
- for (let i = 0; i < defs.length; i++)
15
- builtInDirectContextExecutors.add(defs[i].execute);
16
- }
17
- return defs;
18
- }
19
- export function pandocCommands(options = {}) {
20
- let hasCommand;
21
- const command = createPandocCommand(options, name => hasCommand?.(name) ?? false);
22
- return {
23
- name: "pandoc",
24
- setup(host) {
25
- hasCommand = name => host.commands.has(name);
26
- host.commands.register(command, { replace: options.replace ?? false });
27
- },
28
- };
29
- }
30
- export function evalSyncPandoc(inBytes, opArgs, readFileSync, writeFileSync) {
31
- try {
32
- if (opArgs.length > 0 && opArgs.every((a) => a === "--list-input-formats" || a === "--list-output-formats")) {
33
- return inspectFormats(opArgs);
34
- }
35
- for (let i = 0; i < opArgs.length; i++) {
36
- const a = opArgs[i];
37
- if (a === "-d" || a === "--defaults" || a.startsWith("-d") || a.startsWith("--defaults=")) {
38
- return undefined;
39
- }
40
- }
41
- const signal = new AbortController().signal;
42
- const parsed = parseConversionArgs(opArgs, {
43
- cwd: "/",
44
- ...(inBytes === undefined ? {} : { stdin: [inBytes] }),
45
- readFile: async () => new Uint8Array(0),
46
- writeFile: async () => { },
47
- }, signal);
48
- const inputs = [];
49
- if (!parsed.operands) {
50
- if (inBytes === undefined || inBytes.byteLength > 262144)
51
- return undefined;
52
- inputs.push({ bytes: inBytes });
53
- }
54
- else {
55
- for (const op of parsed.operands) {
56
- if (op.source === undefined) {
57
- if (inBytes === undefined || inBytes.byteLength > 262144)
58
- return undefined;
59
- inputs.push({ bytes: inBytes });
60
- }
61
- else {
62
- if (parsed.destination && op.source === parsed.destination)
63
- return undefined;
64
- const b = readFileSync?.(op.source);
65
- if (!b || b.byteLength > 262144)
66
- return undefined;
67
- inputs.push({ bytes: b, source: op.source, ...(op.base === undefined ? {} : { base: op.base }) });
68
- }
69
- }
70
- }
71
- const serialized = convertSync(inputs, parsed.options);
72
- if (!serialized)
73
- return undefined;
74
- if (parsed.destination !== undefined) {
75
- if (!writeFileSync)
76
- return undefined;
77
- const outBytes = serialized.kind === "binary" ? serialized.bytes : new TextEncoder().encode(serialized.text);
78
- if (!writeFileSync(parsed.destination, outBytes))
79
- return undefined;
80
- return "";
81
- }
82
- if (serialized.kind === "text") {
83
- return serialized.text;
84
- }
85
- return new TextDecoder("utf-8", { fatal: true }).decode(serialized.bytes);
86
- }
87
- catch {
88
- return undefined;
89
- }
90
- }
91
- syncCommandEvaluators.evalSyncPandoc = evalSyncPandoc;
2
+ export * from "./implementation.js";
3
+ export { createPandocCommand, createPandocCommands, pandocCommands } from "../../lazy-optional.js";
92
4
  //# sourceMappingURL=index.js.map