@pellux/goodvibes-sdk 0.24.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/dist/_internal/platform/agents/orchestrator.d.ts +2 -0
  2. package/dist/_internal/platform/agents/orchestrator.d.ts.map +1 -1
  3. package/dist/_internal/platform/agents/orchestrator.js +38 -0
  4. package/dist/_internal/platform/automation/delivery-manager.d.ts +5 -0
  5. package/dist/_internal/platform/automation/delivery-manager.d.ts.map +1 -1
  6. package/dist/_internal/platform/automation/delivery-manager.js +14 -1
  7. package/dist/_internal/platform/automation/manager-runtime.d.ts +5 -0
  8. package/dist/_internal/platform/automation/manager-runtime.d.ts.map +1 -1
  9. package/dist/_internal/platform/automation/manager-runtime.js +32 -0
  10. package/dist/_internal/platform/channels/plugin-registry.d.ts +6 -0
  11. package/dist/_internal/platform/channels/plugin-registry.d.ts.map +1 -1
  12. package/dist/_internal/platform/channels/plugin-registry.js +17 -4
  13. package/dist/_internal/platform/channels/route-manager.d.ts +7 -0
  14. package/dist/_internal/platform/channels/route-manager.d.ts.map +1 -1
  15. package/dist/_internal/platform/channels/route-manager.js +41 -3
  16. package/dist/_internal/platform/channels/surface-registry.d.ts +3 -1
  17. package/dist/_internal/platform/channels/surface-registry.d.ts.map +1 -1
  18. package/dist/_internal/platform/channels/surface-registry.js +16 -17
  19. package/dist/_internal/platform/config/schema-types.d.ts +1 -1
  20. package/dist/_internal/platform/config/schema-types.d.ts.map +1 -1
  21. package/dist/_internal/platform/control-plane/gateway.d.ts +5 -0
  22. package/dist/_internal/platform/control-plane/gateway.d.ts.map +1 -1
  23. package/dist/_internal/platform/control-plane/gateway.js +69 -4
  24. package/dist/_internal/platform/daemon/facade-composition.d.ts.map +1 -1
  25. package/dist/_internal/platform/daemon/facade-composition.js +2 -0
  26. package/dist/_internal/platform/daemon/facade.d.ts.map +1 -1
  27. package/dist/_internal/platform/daemon/facade.js +3 -1
  28. package/dist/_internal/platform/daemon/service-manager.d.ts +5 -0
  29. package/dist/_internal/platform/daemon/service-manager.d.ts.map +1 -1
  30. package/dist/_internal/platform/daemon/service-manager.js +29 -0
  31. package/dist/_internal/platform/integrations/delivery.d.ts +5 -1
  32. package/dist/_internal/platform/integrations/delivery.d.ts.map +1 -1
  33. package/dist/_internal/platform/integrations/delivery.js +8 -1
  34. package/dist/_internal/platform/integrations/notifier.d.ts +5 -1
  35. package/dist/_internal/platform/integrations/notifier.d.ts.map +1 -1
  36. package/dist/_internal/platform/integrations/notifier.js +6 -3
  37. package/dist/_internal/platform/intelligence/lsp/service.d.ts.map +1 -1
  38. package/dist/_internal/platform/intelligence/lsp/service.js +18 -9
  39. package/dist/_internal/platform/permissions/manager.d.ts +3 -1
  40. package/dist/_internal/platform/permissions/manager.d.ts.map +1 -1
  41. package/dist/_internal/platform/permissions/manager.js +9 -5
  42. package/dist/_internal/platform/providers/anthropic-vertex.d.ts.map +1 -1
  43. package/dist/_internal/platform/providers/anthropic-vertex.js +135 -2
  44. package/dist/_internal/platform/runtime/emitters/routes.d.ts +5 -0
  45. package/dist/_internal/platform/runtime/emitters/routes.d.ts.map +1 -1
  46. package/dist/_internal/platform/runtime/emitters/routes.js +3 -0
  47. package/dist/_internal/platform/runtime/events/contracts/automation-route.d.ts +1 -0
  48. package/dist/_internal/platform/runtime/events/contracts/automation-route.d.ts.map +1 -1
  49. package/dist/_internal/platform/runtime/events/contracts/automation-route.js +7 -0
  50. package/dist/_internal/platform/runtime/events/contracts.d.ts +1 -1
  51. package/dist/_internal/platform/runtime/events/contracts.d.ts.map +1 -1
  52. package/dist/_internal/platform/runtime/events/contracts.js +3 -2
  53. package/dist/_internal/platform/runtime/events/routes.d.ts +5 -0
  54. package/dist/_internal/platform/runtime/events/routes.d.ts.map +1 -1
  55. package/dist/_internal/platform/runtime/feature-flags/flags.d.ts.map +1 -1
  56. package/dist/_internal/platform/runtime/feature-flags/flags.js +17 -21
  57. package/dist/_internal/platform/runtime/feature-flags/gates.d.ts +7 -0
  58. package/dist/_internal/platform/runtime/feature-flags/gates.d.ts.map +1 -0
  59. package/dist/_internal/platform/runtime/feature-flags/gates.js +38 -0
  60. package/dist/_internal/platform/runtime/feature-flags/index.d.ts +2 -0
  61. package/dist/_internal/platform/runtime/feature-flags/index.d.ts.map +1 -1
  62. package/dist/_internal/platform/runtime/feature-flags/index.js +1 -0
  63. package/dist/_internal/platform/runtime/mcp/index.d.ts +2 -1
  64. package/dist/_internal/platform/runtime/mcp/index.d.ts.map +1 -1
  65. package/dist/_internal/platform/runtime/mcp/index.js +4 -1
  66. package/dist/_internal/platform/runtime/permissions/index.d.ts +20 -1
  67. package/dist/_internal/platform/runtime/permissions/index.d.ts.map +1 -1
  68. package/dist/_internal/platform/runtime/permissions/index.js +27 -1
  69. package/dist/_internal/platform/runtime/permissions/policy-loader.d.ts +6 -0
  70. package/dist/_internal/platform/runtime/permissions/policy-loader.d.ts.map +1 -1
  71. package/dist/_internal/platform/runtime/permissions/policy-loader.js +7 -2
  72. package/dist/_internal/platform/runtime/plugins/index.d.ts +2 -1
  73. package/dist/_internal/platform/runtime/plugins/index.d.ts.map +1 -1
  74. package/dist/_internal/platform/runtime/plugins/index.js +4 -1
  75. package/dist/_internal/platform/runtime/services.d.ts +1 -0
  76. package/dist/_internal/platform/runtime/services.d.ts.map +1 -1
  77. package/dist/_internal/platform/runtime/services.js +21 -5
  78. package/dist/_internal/platform/runtime/shell-command-ops.d.ts +2 -0
  79. package/dist/_internal/platform/runtime/shell-command-ops.d.ts.map +1 -1
  80. package/dist/_internal/platform/runtime/shell-command-ops.js +4 -1
  81. package/dist/_internal/platform/runtime/tasks/index.d.ts +2 -1
  82. package/dist/_internal/platform/runtime/tasks/index.d.ts.map +1 -1
  83. package/dist/_internal/platform/runtime/tasks/index.js +2 -2
  84. package/dist/_internal/platform/runtime/tasks/manager.d.ts +5 -1
  85. package/dist/_internal/platform/runtime/tasks/manager.d.ts.map +1 -1
  86. package/dist/_internal/platform/runtime/tasks/manager.js +30 -1
  87. package/dist/_internal/platform/runtime/telemetry/index.d.ts +9 -3
  88. package/dist/_internal/platform/runtime/telemetry/index.d.ts.map +1 -1
  89. package/dist/_internal/platform/runtime/telemetry/index.js +7 -4
  90. package/dist/_internal/platform/runtime/tools/index.d.ts.map +1 -1
  91. package/dist/_internal/platform/runtime/tools/index.js +4 -1
  92. package/dist/_internal/platform/runtime/tools/types.d.ts +6 -0
  93. package/dist/_internal/platform/runtime/tools/types.d.ts.map +1 -1
  94. package/dist/_internal/platform/security/token-audit.d.ts +7 -0
  95. package/dist/_internal/platform/security/token-audit.d.ts.map +1 -1
  96. package/dist/_internal/platform/security/token-audit.js +6 -2
  97. package/dist/_internal/platform/state/mode-manager.d.ts +7 -0
  98. package/dist/_internal/platform/state/mode-manager.d.ts.map +1 -1
  99. package/dist/_internal/platform/state/mode-manager.js +25 -0
  100. package/dist/_internal/platform/tools/index.d.ts +4 -0
  101. package/dist/_internal/platform/tools/index.d.ts.map +1 -1
  102. package/dist/_internal/platform/tools/index.js +37 -23
  103. package/dist/_internal/platform/tools/shared/overflow.d.ts +3 -0
  104. package/dist/_internal/platform/tools/shared/overflow.d.ts.map +1 -1
  105. package/dist/_internal/platform/tools/shared/overflow.js +6 -2
  106. package/dist/_internal/platform/version.js +1 -1
  107. package/dist/_internal/platform/watchers/registry.d.ts +6 -0
  108. package/dist/_internal/platform/watchers/registry.d.ts.map +1 -1
  109. package/dist/_internal/platform/watchers/registry.js +35 -0
  110. package/package.json +9 -8
  111. package/vendor/bash-language-server/CHANGELOG.md +453 -0
  112. package/vendor/bash-language-server/GOODVIBES_PATCH.md +22 -0
  113. package/vendor/bash-language-server/README.md +230 -0
  114. package/vendor/bash-language-server/out/analyser.d.ts +187 -0
  115. package/vendor/bash-language-server/out/analyser.js +782 -0
  116. package/vendor/bash-language-server/out/analyser.js.map +1 -0
  117. package/vendor/bash-language-server/out/builtins.d.ts +2 -0
  118. package/vendor/bash-language-server/out/builtins.js +71 -0
  119. package/vendor/bash-language-server/out/builtins.js.map +1 -0
  120. package/vendor/bash-language-server/out/cli.d.ts +3 -0
  121. package/vendor/bash-language-server/out/cli.js +74 -0
  122. package/vendor/bash-language-server/out/cli.js.map +1 -0
  123. package/vendor/bash-language-server/out/config.d.ts +88 -0
  124. package/vendor/bash-language-server/out/config.js +96 -0
  125. package/vendor/bash-language-server/out/config.js.map +1 -0
  126. package/vendor/bash-language-server/out/executables.d.ts +19 -0
  127. package/vendor/bash-language-server/out/executables.js +86 -0
  128. package/vendor/bash-language-server/out/executables.js.map +1 -0
  129. package/vendor/bash-language-server/out/parser.d.ts +2 -0
  130. package/vendor/bash-language-server/out/parser.js +36 -0
  131. package/vendor/bash-language-server/out/parser.js.map +1 -0
  132. package/vendor/bash-language-server/out/reserved-words.d.ts +2 -0
  133. package/vendor/bash-language-server/out/reserved-words.js +33 -0
  134. package/vendor/bash-language-server/out/reserved-words.js.map +1 -0
  135. package/vendor/bash-language-server/out/server.d.ts +56 -0
  136. package/vendor/bash-language-server/out/server.js +756 -0
  137. package/vendor/bash-language-server/out/server.js.map +1 -0
  138. package/vendor/bash-language-server/out/shellcheck/config.d.ts +5 -0
  139. package/vendor/bash-language-server/out/shellcheck/config.js +17 -0
  140. package/vendor/bash-language-server/out/shellcheck/config.js.map +1 -0
  141. package/vendor/bash-language-server/out/shellcheck/directive.d.ts +18 -0
  142. package/vendor/bash-language-server/out/shellcheck/directive.js +62 -0
  143. package/vendor/bash-language-server/out/shellcheck/directive.js.map +1 -0
  144. package/vendor/bash-language-server/out/shellcheck/index.d.ts +22 -0
  145. package/vendor/bash-language-server/out/shellcheck/index.js +229 -0
  146. package/vendor/bash-language-server/out/shellcheck/index.js.map +1 -0
  147. package/vendor/bash-language-server/out/shellcheck/types.d.ts +175 -0
  148. package/vendor/bash-language-server/out/shellcheck/types.js +35 -0
  149. package/vendor/bash-language-server/out/shellcheck/types.js.map +1 -0
  150. package/vendor/bash-language-server/out/shfmt/index.d.ts +18 -0
  151. package/vendor/bash-language-server/out/shfmt/index.js +151 -0
  152. package/vendor/bash-language-server/out/shfmt/index.js.map +1 -0
  153. package/vendor/bash-language-server/out/snippets.d.ts +2 -0
  154. package/vendor/bash-language-server/out/snippets.js +671 -0
  155. package/vendor/bash-language-server/out/snippets.js.map +1 -0
  156. package/vendor/bash-language-server/out/types.d.ts +13 -0
  157. package/vendor/bash-language-server/out/types.js +12 -0
  158. package/vendor/bash-language-server/out/types.js.map +1 -0
  159. package/vendor/bash-language-server/out/util/array.d.ts +14 -0
  160. package/vendor/bash-language-server/out/util/array.js +36 -0
  161. package/vendor/bash-language-server/out/util/array.js.map +1 -0
  162. package/vendor/bash-language-server/out/util/async.d.ts +13 -0
  163. package/vendor/bash-language-server/out/util/async.js +24 -0
  164. package/vendor/bash-language-server/out/util/async.js.map +1 -0
  165. package/vendor/bash-language-server/out/util/declarations.d.ts +88 -0
  166. package/vendor/bash-language-server/out/util/declarations.js +295 -0
  167. package/vendor/bash-language-server/out/util/declarations.js.map +1 -0
  168. package/vendor/bash-language-server/out/util/discriminate.d.ts +1 -0
  169. package/vendor/bash-language-server/out/util/discriminate.js +7 -0
  170. package/vendor/bash-language-server/out/util/discriminate.js.map +1 -0
  171. package/vendor/bash-language-server/out/util/fs.d.ts +6 -0
  172. package/vendor/bash-language-server/out/util/fs.js +73 -0
  173. package/vendor/bash-language-server/out/util/fs.js.map +1 -0
  174. package/vendor/bash-language-server/out/util/logger.d.ts +35 -0
  175. package/vendor/bash-language-server/out/util/logger.js +105 -0
  176. package/vendor/bash-language-server/out/util/logger.js.map +1 -0
  177. package/vendor/bash-language-server/out/util/lsp.d.ts +5 -0
  178. package/vendor/bash-language-server/out/util/lsp.js +13 -0
  179. package/vendor/bash-language-server/out/util/lsp.js.map +1 -0
  180. package/vendor/bash-language-server/out/util/platform.d.ts +1 -0
  181. package/vendor/bash-language-server/out/util/platform.js +7 -0
  182. package/vendor/bash-language-server/out/util/platform.js.map +1 -0
  183. package/vendor/bash-language-server/out/util/sh.d.ts +16 -0
  184. package/vendor/bash-language-server/out/util/sh.js +132 -0
  185. package/vendor/bash-language-server/out/util/sh.js.map +1 -0
  186. package/vendor/bash-language-server/out/util/shebang.d.ts +10 -0
  187. package/vendor/bash-language-server/out/util/shebang.js +53 -0
  188. package/vendor/bash-language-server/out/util/shebang.js.map +1 -0
  189. package/vendor/bash-language-server/out/util/sourcing.d.ts +15 -0
  190. package/vendor/bash-language-server/out/util/sourcing.js +182 -0
  191. package/vendor/bash-language-server/out/util/sourcing.js.map +1 -0
  192. package/vendor/bash-language-server/out/util/tree-sitter.d.ts +22 -0
  193. package/vendor/bash-language-server/out/util/tree-sitter.js +110 -0
  194. package/vendor/bash-language-server/out/util/tree-sitter.js.map +1 -0
  195. package/vendor/bash-language-server/package.json +52 -0
  196. package/vendor/bash-language-server/parser.info +2 -0
  197. package/vendor/bash-language-server/tree-sitter-bash.wasm +0 -0
  198. package/scripts/postinstall-patch-minimatch.mjs +0 -285
@@ -0,0 +1,18 @@
1
+ import * as LSP from 'vscode-languageserver/node';
2
+ import { TextDocument, TextEdit } from 'vscode-languageserver-textdocument';
3
+ type FormatterOptions = {
4
+ executablePath: string;
5
+ cwd?: string;
6
+ };
7
+ export declare class Formatter {
8
+ private cwd;
9
+ executablePath: string;
10
+ private _canFormat;
11
+ constructor({ cwd, executablePath }: FormatterOptions);
12
+ get canFormat(): boolean;
13
+ format(document: TextDocument, formatOptions?: LSP.FormattingOptions | null, shfmtConfig?: Record<string, string | boolean> | null): Promise<TextEdit[]>;
14
+ private executeFormat;
15
+ private getShfmtArguments;
16
+ private runShfmt;
17
+ }
18
+ export {};
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Formatter = void 0;
13
+ const child_process_1 = require("child_process");
14
+ const editorconfig = require("editorconfig");
15
+ const LSP = require("vscode-languageserver/node");
16
+ const logger_1 = require("../util/logger");
17
+ class Formatter {
18
+ constructor({ cwd, executablePath }) {
19
+ this._canFormat = true;
20
+ this.cwd = cwd || process.cwd();
21
+ this.executablePath = executablePath;
22
+ }
23
+ get canFormat() {
24
+ return this._canFormat;
25
+ }
26
+ format(document, formatOptions, shfmtConfig) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ if (!this._canFormat) {
29
+ return [];
30
+ }
31
+ return this.executeFormat(document, formatOptions, shfmtConfig);
32
+ });
33
+ }
34
+ executeFormat(document, formatOptions, shfmtConfig) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ const result = yield this.runShfmt(document, formatOptions, shfmtConfig);
37
+ if (!this._canFormat) {
38
+ return [];
39
+ }
40
+ return [
41
+ {
42
+ range: LSP.Range.create(LSP.Position.create(0, 0), LSP.Position.create(Number.MAX_VALUE, Number.MAX_VALUE)),
43
+ newText: result,
44
+ },
45
+ ];
46
+ });
47
+ }
48
+ getShfmtArguments(documentUri, formatOptions, lspShfmtConfig) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ const args = [];
51
+ // this is the config that we'll use to build args - default to language server config
52
+ let activeShfmtConfig = Object.assign({}, lspShfmtConfig);
53
+ // do we have a document stored on the local filesystem?
54
+ const filepathMatch = documentUri.match(/^file:\/\/(.*)$/);
55
+ if (filepathMatch) {
56
+ const filepath = filepathMatch[1];
57
+ args.push(`--filename=${filepathMatch[1]}`);
58
+ if (!(lspShfmtConfig === null || lspShfmtConfig === void 0 ? void 0 : lspShfmtConfig.ignoreEditorconfig)) {
59
+ const editorconfigProperties = yield editorconfig.parse(filepath);
60
+ logger_1.logger.debug(`Shfmt: found .editorconfig properties: ${JSON.stringify(editorconfigProperties)}`);
61
+ const editorconfigShfmtConfig = {};
62
+ editorconfigShfmtConfig.binaryNextLine = editorconfigProperties.binary_next_line;
63
+ editorconfigShfmtConfig.caseIndent = editorconfigProperties.switch_case_indent;
64
+ editorconfigShfmtConfig.funcNextLine = editorconfigProperties.function_next_line;
65
+ editorconfigShfmtConfig.keepPadding = editorconfigProperties.keep_padding;
66
+ // --simplify is not supported via .editorconfig
67
+ editorconfigShfmtConfig.spaceRedirects = editorconfigProperties.space_redirects;
68
+ editorconfigShfmtConfig.languageDialect = editorconfigProperties.shell_variant;
69
+ // if we have any shfmt-specific options in .editorconfig, use the config in .editorconfig and
70
+ // ignore the language server config (this is similar to shfmt's approach of using either
71
+ // .editorconfig or command line flags, but not both)
72
+ if (editorconfigShfmtConfig.binaryNextLine !== undefined ||
73
+ editorconfigShfmtConfig.caseIndent !== undefined ||
74
+ editorconfigShfmtConfig.funcNextLine !== undefined ||
75
+ editorconfigShfmtConfig.keepPadding !== undefined ||
76
+ editorconfigShfmtConfig.spaceRedirects !== undefined ||
77
+ editorconfigShfmtConfig.languageDialect !== undefined) {
78
+ logger_1.logger.debug('Shfmt: detected shfmt properties in .editorconfig - ignoring language server shfmt config');
79
+ activeShfmtConfig = Object.assign({}, editorconfigShfmtConfig);
80
+ }
81
+ else {
82
+ logger_1.logger.debug('Shfmt: no shfmt properties found in .editorconfig - using language server shfmt config');
83
+ }
84
+ }
85
+ else {
86
+ logger_1.logger.debug('Shfmt: configured to ignore .editorconfig - using language server shfmt config');
87
+ }
88
+ }
89
+ // indentation always comes via the editor - if someone is using .editorconfig then the
90
+ // expectation is that they will have configured their editor's indentation in this way too
91
+ const indentation = (formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.insertSpaces) ? formatOptions.tabSize : 0;
92
+ args.push(`-i=${indentation}`); // --indent
93
+ if (activeShfmtConfig === null || activeShfmtConfig === void 0 ? void 0 : activeShfmtConfig.binaryNextLine)
94
+ args.push('-bn'); // --binary-next-line
95
+ if (activeShfmtConfig === null || activeShfmtConfig === void 0 ? void 0 : activeShfmtConfig.caseIndent)
96
+ args.push('-ci'); // --case-indent
97
+ if (activeShfmtConfig === null || activeShfmtConfig === void 0 ? void 0 : activeShfmtConfig.funcNextLine)
98
+ args.push('-fn'); // --func-next-line
99
+ if (activeShfmtConfig === null || activeShfmtConfig === void 0 ? void 0 : activeShfmtConfig.keepPadding)
100
+ args.push('-kp'); // --keep-padding
101
+ if (activeShfmtConfig === null || activeShfmtConfig === void 0 ? void 0 : activeShfmtConfig.simplifyCode)
102
+ args.push('-s'); // --simplify
103
+ if (activeShfmtConfig === null || activeShfmtConfig === void 0 ? void 0 : activeShfmtConfig.spaceRedirects)
104
+ args.push('-sr'); // --space-redirects
105
+ if (activeShfmtConfig === null || activeShfmtConfig === void 0 ? void 0 : activeShfmtConfig.languageDialect)
106
+ args.push(`-ln=${activeShfmtConfig.languageDialect}`); // --language-dialect
107
+ return args;
108
+ });
109
+ }
110
+ runShfmt(document, formatOptions, shfmtConfig) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ const args = yield this.getShfmtArguments(document.uri, formatOptions, shfmtConfig);
113
+ logger_1.logger.debug(`Shfmt: running "${this.executablePath} ${args.join(' ')}"`);
114
+ let out = '';
115
+ let err = '';
116
+ const proc = new Promise((resolve, reject) => {
117
+ const proc = (0, child_process_1.spawn)(this.executablePath, [...args, '-'], { cwd: this.cwd });
118
+ proc.on('error', reject);
119
+ proc.on('close', resolve);
120
+ proc.stdout.on('data', (data) => (out += data));
121
+ proc.stderr.on('data', (data) => (err += data));
122
+ proc.stdin.on('error', () => {
123
+ // NOTE: Ignore STDIN errors in case the process ends too quickly, before we try to
124
+ // write. If we write after the process ends without this, we get an uncatchable EPIPE.
125
+ // This is solved in Node >= 15.1 by the "on('spawn', ...)" event, but we need to
126
+ // support earlier versions.
127
+ });
128
+ proc.stdin.end(document.getText());
129
+ });
130
+ let exit;
131
+ try {
132
+ exit = yield proc;
133
+ }
134
+ catch (e) {
135
+ if (e.code === 'ENOENT') {
136
+ // shfmt path wasn't found, don't try to format any more:
137
+ logger_1.logger.warn(`Shfmt: disabling formatting as no executable was found at path '${this.executablePath}'`);
138
+ this._canFormat = false;
139
+ return '';
140
+ }
141
+ throw new Error(`Shfmt: child process error: ${e}`);
142
+ }
143
+ if (exit != 0) {
144
+ throw new Error(`Shfmt: exited with status ${exit}: ${err}`);
145
+ }
146
+ return out;
147
+ });
148
+ }
149
+ }
150
+ exports.Formatter = Formatter;
151
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shfmt/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAqC;AACrC,6CAA4C;AAC5C,kDAAiD;AAGjD,2CAAuC;AAOvC,MAAa,SAAS;IAKpB,YAAY,EAAE,GAAG,EAAE,cAAc,EAAoB;QACnD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;QACtB,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAA;QAC/B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;IACtC,CAAC;IAED,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAA;IACxB,CAAC;IAEY,MAAM,CACjB,QAAsB,EACtB,aAA4C,EAC5C,WAAqD;;YAErD,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;gBACrB,OAAO,EAAE,CAAA;YACX,CAAC;YAED,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,CAAC,CAAA;QACjE,CAAC;KAAA;IAEa,aAAa,CACzB,QAAsB,EACtB,aAA4C,EAC5C,WAAqD;;YAErD,MAAM,MAAM,GAAG,MAAM,IAAI,CAA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