agent-config-detect 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/cjs/errors.js +105 -0
  4. package/dist/cjs/errors.js.map +1 -0
  5. package/dist/cjs/index.js +89 -0
  6. package/dist/cjs/index.js.map +1 -0
  7. package/dist/cjs/platform/Platform.js +13 -0
  8. package/dist/cjs/platform/Platform.js.map +1 -0
  9. package/dist/cjs/platform/TestPlatform.js +65 -0
  10. package/dist/cjs/platform/TestPlatform.js.map +1 -0
  11. package/dist/cjs/platform/index.js +118 -0
  12. package/dist/cjs/platform/index.js.map +1 -0
  13. package/dist/cjs/platform/internal/common.js +40 -0
  14. package/dist/cjs/platform/internal/common.js.map +1 -0
  15. package/dist/cjs/platform/internal/darwin.js +40 -0
  16. package/dist/cjs/platform/internal/darwin.js.map +1 -0
  17. package/dist/cjs/platform/internal/linux.js +69 -0
  18. package/dist/cjs/platform/internal/linux.js.map +1 -0
  19. package/dist/cjs/platform/internal/testUtils.js +79 -0
  20. package/dist/cjs/platform/internal/testUtils.js.map +1 -0
  21. package/dist/cjs/platform/internal/windows.js +61 -0
  22. package/dist/cjs/platform/internal/windows.js.map +1 -0
  23. package/dist/cjs/types/ConfigResource.js +44 -0
  24. package/dist/cjs/types/ConfigResource.js.map +1 -0
  25. package/dist/cjs/types/DirectoryResource.js +42 -0
  26. package/dist/cjs/types/DirectoryResource.js.map +1 -0
  27. package/dist/cjs/types/DirectoryStructure.js +56 -0
  28. package/dist/cjs/types/DirectoryStructure.js.map +1 -0
  29. package/dist/cjs/types/EnvValue.js +199 -0
  30. package/dist/cjs/types/EnvValue.js.map +1 -0
  31. package/dist/cjs/types/FileFormat.js +25 -0
  32. package/dist/cjs/types/FileFormat.js.map +1 -0
  33. package/dist/cjs/types/HarnessKind.js +130 -0
  34. package/dist/cjs/types/HarnessKind.js.map +1 -0
  35. package/dist/cjs/types/InstallationStatus.js +119 -0
  36. package/dist/cjs/types/InstallationStatus.js.map +1 -0
  37. package/dist/cjs/types/PathType.js +25 -0
  38. package/dist/cjs/types/PathType.js.map +1 -0
  39. package/dist/cjs/types/ResourceKind.js +26 -0
  40. package/dist/cjs/types/ResourceKind.js.map +1 -0
  41. package/dist/cjs/types/Scope.js +59 -0
  42. package/dist/cjs/types/Scope.js.map +1 -0
  43. package/dist/cjs/types/index.js +116 -0
  44. package/dist/cjs/types/index.js.map +1 -0
  45. package/dist/dts/errors.d.ts +125 -0
  46. package/dist/dts/errors.d.ts.map +1 -0
  47. package/dist/dts/index.d.ts +11 -0
  48. package/dist/dts/index.d.ts.map +1 -0
  49. package/dist/dts/platform/Platform.d.ts +61 -0
  50. package/dist/dts/platform/Platform.d.ts.map +1 -0
  51. package/dist/dts/platform/TestPlatform.d.ts +52 -0
  52. package/dist/dts/platform/TestPlatform.d.ts.map +1 -0
  53. package/dist/dts/platform/index.d.ts +20 -0
  54. package/dist/dts/platform/index.d.ts.map +1 -0
  55. package/dist/dts/platform/internal/common.d.ts +20 -0
  56. package/dist/dts/platform/internal/common.d.ts.map +1 -0
  57. package/dist/dts/platform/internal/darwin.d.ts +33 -0
  58. package/dist/dts/platform/internal/darwin.d.ts.map +1 -0
  59. package/dist/dts/platform/internal/linux.d.ts +29 -0
  60. package/dist/dts/platform/internal/linux.d.ts.map +1 -0
  61. package/dist/dts/platform/internal/testUtils.d.ts +32 -0
  62. package/dist/dts/platform/internal/testUtils.d.ts.map +1 -0
  63. package/dist/dts/platform/internal/windows.d.ts +38 -0
  64. package/dist/dts/platform/internal/windows.d.ts.map +1 -0
  65. package/dist/dts/types/ConfigResource.d.ts +34 -0
  66. package/dist/dts/types/ConfigResource.d.ts.map +1 -0
  67. package/dist/dts/types/DirectoryResource.d.ts +33 -0
  68. package/dist/dts/types/DirectoryResource.d.ts.map +1 -0
  69. package/dist/dts/types/DirectoryStructure.d.ts +61 -0
  70. package/dist/dts/types/DirectoryStructure.d.ts.map +1 -0
  71. package/dist/dts/types/EnvValue.d.ts +102 -0
  72. package/dist/dts/types/EnvValue.d.ts.map +1 -0
  73. package/dist/dts/types/FileFormat.d.ts +22 -0
  74. package/dist/dts/types/FileFormat.d.ts.map +1 -0
  75. package/dist/dts/types/HarnessKind.d.ts +45 -0
  76. package/dist/dts/types/HarnessKind.d.ts.map +1 -0
  77. package/dist/dts/types/InstallationStatus.d.ts +89 -0
  78. package/dist/dts/types/InstallationStatus.d.ts.map +1 -0
  79. package/dist/dts/types/PathType.d.ts +22 -0
  80. package/dist/dts/types/PathType.d.ts.map +1 -0
  81. package/dist/dts/types/ResourceKind.d.ts +23 -0
  82. package/dist/dts/types/ResourceKind.d.ts.map +1 -0
  83. package/dist/dts/types/Scope.d.ts +59 -0
  84. package/dist/dts/types/Scope.d.ts.map +1 -0
  85. package/dist/dts/types/index.d.ts +16 -0
  86. package/dist/dts/types/index.d.ts.map +1 -0
  87. package/dist/esm/errors.js +87 -0
  88. package/dist/esm/errors.js.map +1 -0
  89. package/dist/esm/index.js +14 -0
  90. package/dist/esm/index.js.map +1 -0
  91. package/dist/esm/package.json +4 -0
  92. package/dist/esm/platform/Platform.js +6 -0
  93. package/dist/esm/platform/Platform.js.map +1 -0
  94. package/dist/esm/platform/TestPlatform.js +54 -0
  95. package/dist/esm/platform/TestPlatform.js.map +1 -0
  96. package/dist/esm/platform/index.js +68 -0
  97. package/dist/esm/platform/index.js.map +1 -0
  98. package/dist/esm/platform/internal/common.js +30 -0
  99. package/dist/esm/platform/internal/common.js.map +1 -0
  100. package/dist/esm/platform/internal/darwin.js +33 -0
  101. package/dist/esm/platform/internal/darwin.js.map +1 -0
  102. package/dist/esm/platform/internal/linux.js +62 -0
  103. package/dist/esm/platform/internal/linux.js.map +1 -0
  104. package/dist/esm/platform/internal/testUtils.js +70 -0
  105. package/dist/esm/platform/internal/testUtils.js.map +1 -0
  106. package/dist/esm/platform/internal/windows.js +54 -0
  107. package/dist/esm/platform/internal/windows.js.map +1 -0
  108. package/dist/esm/types/ConfigResource.js +36 -0
  109. package/dist/esm/types/ConfigResource.js.map +1 -0
  110. package/dist/esm/types/DirectoryResource.js +34 -0
  111. package/dist/esm/types/DirectoryResource.js.map +1 -0
  112. package/dist/esm/types/DirectoryStructure.js +45 -0
  113. package/dist/esm/types/DirectoryStructure.js.map +1 -0
  114. package/dist/esm/types/EnvValue.js +182 -0
  115. package/dist/esm/types/EnvValue.js.map +1 -0
  116. package/dist/esm/types/FileFormat.js +18 -0
  117. package/dist/esm/types/FileFormat.js.map +1 -0
  118. package/dist/esm/types/HarnessKind.js +120 -0
  119. package/dist/esm/types/HarnessKind.js.map +1 -0
  120. package/dist/esm/types/InstallationStatus.js +101 -0
  121. package/dist/esm/types/InstallationStatus.js.map +1 -0
  122. package/dist/esm/types/PathType.js +18 -0
  123. package/dist/esm/types/PathType.js.map +1 -0
  124. package/dist/esm/types/ResourceKind.js +19 -0
  125. package/dist/esm/types/ResourceKind.js.map +1 -0
  126. package/dist/esm/types/Scope.js +46 -0
  127. package/dist/esm/types/Scope.js.map +1 -0
  128. package/dist/esm/types/index.js +17 -0
  129. package/dist/esm/types/index.js.map +1 -0
  130. package/errors/package.json +6 -0
  131. package/package.json +135 -0
  132. package/platform/Platform/package.json +6 -0
  133. package/platform/TestPlatform/package.json +6 -0
  134. package/src/errors.ts +135 -0
  135. package/src/index.ts +27 -0
  136. package/src/platform/Platform.ts +64 -0
  137. package/src/platform/TestPlatform.ts +93 -0
  138. package/src/platform/index.ts +72 -0
  139. package/src/platform/internal/common.ts +30 -0
  140. package/src/platform/internal/darwin.ts +43 -0
  141. package/src/platform/internal/linux.ts +66 -0
  142. package/src/platform/internal/testUtils.ts +82 -0
  143. package/src/platform/internal/windows.ts +58 -0
  144. package/src/types/ConfigResource.ts +48 -0
  145. package/src/types/DirectoryResource.ts +45 -0
  146. package/src/types/DirectoryStructure.ts +64 -0
  147. package/src/types/EnvValue.ts +189 -0
  148. package/src/types/FileFormat.ts +36 -0
  149. package/src/types/HarnessKind.ts +150 -0
  150. package/src/types/InstallationStatus.ts +119 -0
  151. package/src/types/PathType.ts +24 -0
  152. package/src/types/ResourceKind.ts +27 -0
  153. package/src/types/Scope.ts +57 -0
  154. package/src/types/index.ts +17 -0
  155. package/types/ConfigResource/package.json +6 -0
  156. package/types/DirectoryResource/package.json +6 -0
  157. package/types/DirectoryStructure/package.json +6 -0
  158. package/types/EnvValue/package.json +6 -0
  159. package/types/FileFormat/package.json +6 -0
  160. package/types/HarnessKind/package.json +6 -0
  161. package/types/InstallationStatus/package.json +6 -0
  162. package/types/PathType/package.json +6 -0
  163. package/types/ResourceKind/package.json +6 -0
  164. package/types/Scope/package.json +6 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-present Tin Pham
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # Effect Monorepo Template - Domain Package
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.YamlParseError = exports.UnsupportedScopeError = exports.UnsupportedPlatformError = exports.UnsupportedMcpConfigError = exports.NotFoundError = exports.MissingFieldError = exports.MissingEnvVarError = exports.IoError = exports.InvalidPathError = exports.EnvVarError = exports.BinaryDetectionError = void 0;
7
+ var _effect = require("effect");
8
+ /**
9
+ * Error types for harness operations.
10
+ *
11
+ * @module
12
+ */
13
+
14
+ /**
15
+ * The requested harness was not found on this system.
16
+ */
17
+ class NotFoundError extends /*#__PURE__*/_effect.Data.TaggedError("NotFoundError") {}
18
+ /**
19
+ * The path is invalid or inaccessible.
20
+ */
21
+ exports.NotFoundError = NotFoundError;
22
+ class InvalidPathError extends /*#__PURE__*/_effect.Data.TaggedError("InvalidPathError") {
23
+ get message() {
24
+ return `invalid path: ${this.path}`;
25
+ }
26
+ }
27
+ /**
28
+ * An environment variable could not be read.
29
+ */
30
+ exports.InvalidPathError = InvalidPathError;
31
+ class EnvVarError extends /*#__PURE__*/_effect.Data.TaggedError("EnvVarError") {
32
+ get message() {
33
+ return `environment variable error: ${this.cause.message}`;
34
+ }
35
+ }
36
+ /**
37
+ * The current platform is not supported.
38
+ */
39
+ exports.EnvVarError = EnvVarError;
40
+ class UnsupportedPlatformError extends /*#__PURE__*/_effect.Data.TaggedError("UnsupportedPlatformError") {
41
+ get message() {
42
+ return "unsupported platform";
43
+ }
44
+ }
45
+ /**
46
+ * An I/O error occurred.
47
+ */
48
+ exports.UnsupportedPlatformError = UnsupportedPlatformError;
49
+ class IoError extends /*#__PURE__*/_effect.Data.TaggedError("IoError") {
50
+ get message() {
51
+ return `IO error: ${this.cause.message}`;
52
+ }
53
+ }
54
+ /**
55
+ * MCP server uses unsupported features for target harness.
56
+ */
57
+ exports.IoError = IoError;
58
+ class UnsupportedMcpConfigError extends /*#__PURE__*/_effect.Data.TaggedError("UnsupportedMcpConfigError") {
59
+ get message() {
60
+ return `unsupported MCP config for ${this.harness}: ${this.reason}`;
61
+ }
62
+ }
63
+ /**
64
+ * Binary detection failed due to system error.
65
+ */
66
+ exports.UnsupportedMcpConfigError = UnsupportedMcpConfigError;
67
+ class BinaryDetectionError extends /*#__PURE__*/_effect.Data.TaggedError("BinaryDetectionError") {}
68
+ /**
69
+ * The requested scope is not supported by this harness.
70
+ */
71
+ exports.BinaryDetectionError = BinaryDetectionError;
72
+ class UnsupportedScopeError extends /*#__PURE__*/_effect.Data.TaggedError("UnsupportedScopeError") {
73
+ get message() {
74
+ return `${this.harness} does not support ${this.scope} scope`;
75
+ }
76
+ }
77
+ /**
78
+ * YAML parsing failed.
79
+ */
80
+ exports.UnsupportedScopeError = UnsupportedScopeError;
81
+ class YamlParseError extends /*#__PURE__*/_effect.Data.TaggedError("YamlParseError") {
82
+ get message() {
83
+ return `YAML parse error: ${this.cause.message}`;
84
+ }
85
+ }
86
+ /**
87
+ * A required field is missing from the input.
88
+ */
89
+ exports.YamlParseError = YamlParseError;
90
+ class MissingFieldError extends /*#__PURE__*/_effect.Data.TaggedError("MissingFieldError") {
91
+ get message() {
92
+ return `missing required field: ${this.field}`;
93
+ }
94
+ }
95
+ /**
96
+ * An environment variable referenced by EnvValue is not set.
97
+ */
98
+ exports.MissingFieldError = MissingFieldError;
99
+ class MissingEnvVarError extends /*#__PURE__*/_effect.Data.TaggedError("MissingEnvVarError") {
100
+ get message() {
101
+ return `missing environment variable: ${this.name}`;
102
+ }
103
+ }
104
+ exports.MissingEnvVarError = MissingEnvVarError;
105
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","names":["_effect","require","NotFoundError","Data","TaggedError","exports","InvalidPathError","message","path","EnvVarError","cause","UnsupportedPlatformError","IoError","UnsupportedMcpConfigError","harness","reason","BinaryDetectionError","UnsupportedScopeError","scope","YamlParseError","MissingFieldError","field","MissingEnvVarError","name"],"sources":["../../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CAACC,WAAW,CAAC,sBAAsB,CAE/E;AAEF;;;AAAAC,OAAA,CAAAW,oBAAA,GAAAA,oBAAA;AAGM,MAAOC,qBAAsB,sBAAQd,YAAI,CAACC,WAAW,CAAC,uBAAuB,CAGjF;EACA,IAAIG,OAAOA,CAAA;IACT,OAAO,GAAG,IAAI,CAACO,OAAO,qBAAqB,IAAI,CAACI,KAAK,QAAQ;EAC/D;;AAGF;;;AAAAb,OAAA,CAAAY,qBAAA,GAAAA,qBAAA;AAGM,MAAOE,cAAe,sBAAQhB,YAAI,CAACC,WAAW,CAAC,gBAAgB,CAEnE;EACA,IAAIG,OAAOA,CAAA;IACT,OAAO,qBAAqB,IAAI,CAACG,KAAK,CAACH,OAAO,EAAE;EAClD;;AAGF;;;AAAAF,OAAA,CAAAc,cAAA,GAAAA,cAAA;AAGM,MAAOC,iBAAkB,sBAAQjB,YAAI,CAACC,WAAW,CAAC,mBAAmB,CAEzE;EACA,IAAIG,OAAOA,CAAA;IACT,OAAO,2BAA2B,IAAI,CAACc,KAAK,EAAE;EAChD;;AAGF;;;AAAAhB,OAAA,CAAAe,iBAAA,GAAAA,iBAAA;AAGM,MAAOE,kBAAmB,sBAAQnB,YAAI,CAACC,WAAW,CAAC,oBAAoB,CAE3E;EACA,IAAIG,OAAOA,CAAA;IACT,OAAO,iCAAiC,IAAI,CAACgB,IAAI,EAAE;EACrD","ignoreList":[]}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ Platform: true,
8
+ PlatformLive: true,
9
+ TestPlatform: true,
10
+ TestPlatformDarwin: true,
11
+ TestPlatformLinux: true,
12
+ TestPlatformWindows: true,
13
+ withEnv: true,
14
+ withoutEnv: true
15
+ };
16
+ Object.defineProperty(exports, "Platform", {
17
+ enumerable: true,
18
+ get: function () {
19
+ return _index2.Platform;
20
+ }
21
+ });
22
+ Object.defineProperty(exports, "PlatformLive", {
23
+ enumerable: true,
24
+ get: function () {
25
+ return _index2.PlatformLive;
26
+ }
27
+ });
28
+ Object.defineProperty(exports, "TestPlatform", {
29
+ enumerable: true,
30
+ get: function () {
31
+ return _index2.TestPlatform;
32
+ }
33
+ });
34
+ Object.defineProperty(exports, "TestPlatformDarwin", {
35
+ enumerable: true,
36
+ get: function () {
37
+ return _index2.TestPlatformDarwin;
38
+ }
39
+ });
40
+ Object.defineProperty(exports, "TestPlatformLinux", {
41
+ enumerable: true,
42
+ get: function () {
43
+ return _index2.TestPlatformLinux;
44
+ }
45
+ });
46
+ Object.defineProperty(exports, "TestPlatformWindows", {
47
+ enumerable: true,
48
+ get: function () {
49
+ return _index2.TestPlatformWindows;
50
+ }
51
+ });
52
+ Object.defineProperty(exports, "withEnv", {
53
+ enumerable: true,
54
+ get: function () {
55
+ return _index2.withEnv;
56
+ }
57
+ });
58
+ Object.defineProperty(exports, "withoutEnv", {
59
+ enumerable: true,
60
+ get: function () {
61
+ return _index2.withoutEnv;
62
+ }
63
+ });
64
+ var _index = require("./types/index.js");
65
+ Object.keys(_index).forEach(function (key) {
66
+ if (key === "default" || key === "__esModule") return;
67
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
68
+ if (key in exports && exports[key] === _index[key]) return;
69
+ Object.defineProperty(exports, key, {
70
+ enumerable: true,
71
+ get: function () {
72
+ return _index[key];
73
+ }
74
+ });
75
+ });
76
+ var _errors = require("./errors.js");
77
+ Object.keys(_errors).forEach(function (key) {
78
+ if (key === "default" || key === "__esModule") return;
79
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
80
+ if (key in exports && exports[key] === _errors[key]) return;
81
+ Object.defineProperty(exports, key, {
82
+ enumerable: true,
83
+ get: function () {
84
+ return _errors[key];
85
+ }
86
+ });
87
+ });
88
+ var _index2 = require("./platform/index.js");
89
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_index","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_errors","_index2"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AAGA,IAAAS,OAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,OAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,OAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,OAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AAGA,IAAAU,OAAA,GAAAd,OAAA","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Platform = void 0;
7
+ var _effect = require("effect");
8
+ /**
9
+ * Platform service tag.
10
+ */
11
+ class Platform extends /*#__PURE__*/_effect.Context.Tag("Platform")() {}
12
+ exports.Platform = Platform;
13
+ //# sourceMappingURL=Platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Platform.js","names":["_effect","require","Platform","Context","Tag","exports"],"sources":["../../../src/platform/Platform.ts"],"sourcesContent":[null],"mappings":";;;;;;AAMA,IAAAA,OAAA,GAAAC,OAAA;AAsDA;;;AAGM,MAAOC,QAAS,sBAAQC,eAAO,CAACC,GAAG,CAAC,UAAU,CAAC,EAA6B;AAAAC,OAAA,CAAAH,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TestPlatformWindows = exports.TestPlatformLinux = exports.TestPlatformDarwin = exports.TestPlatform = void 0;
7
+ var _effect = require("effect");
8
+ var _Platform = require("./Platform.js");
9
+ /**
10
+ * Test platform layer for mocking in tests.
11
+ *
12
+ * @module
13
+ */
14
+
15
+ /**
16
+ * Creates a test platform layer with the given configuration.
17
+ *
18
+ * Useful for testing platform-dependent code without relying on
19
+ * the actual filesystem or environment.
20
+ */
21
+ const TestPlatform = (config = {}) => {
22
+ const service = {
23
+ os: config.os ?? "darwin",
24
+ homeDir: _effect.Effect.succeed(config.home ?? "/home/testuser"),
25
+ configDir: _effect.Effect.succeed(config.config ?? "/home/testuser/.config"),
26
+ dataDir: _effect.Effect.succeed(config.data ?? "/home/testuser/.local/share"),
27
+ cacheDir: _effect.Effect.succeed(config.cache ?? "/home/testuser/.cache")
28
+ };
29
+ return _effect.Layer.succeed(_Platform.Platform, service);
30
+ };
31
+ /**
32
+ * Creates a macOS test platform.
33
+ */
34
+ exports.TestPlatform = TestPlatform;
35
+ const TestPlatformDarwin = (home = "/Users/testuser") => TestPlatform({
36
+ os: "darwin",
37
+ home,
38
+ config: `${home}/.config`,
39
+ data: `${home}/Library/Application Support`,
40
+ cache: `${home}/Library/Application Support`
41
+ });
42
+ /**
43
+ * Creates a Linux test platform.
44
+ */
45
+ exports.TestPlatformDarwin = TestPlatformDarwin;
46
+ const TestPlatformLinux = (home = "/home/testuser") => TestPlatform({
47
+ os: "linux",
48
+ home,
49
+ config: `${home}/.config`,
50
+ data: `${home}/.local/share`,
51
+ cache: `${home}/.cache`
52
+ });
53
+ /**
54
+ * Creates a Windows test platform.
55
+ */
56
+ exports.TestPlatformLinux = TestPlatformLinux;
57
+ const TestPlatformWindows = (home = "C:\\Users\\testuser") => TestPlatform({
58
+ os: "win32",
59
+ home,
60
+ config: `${home}\\AppData\\Roaming`,
61
+ data: `${home}\\AppData\\Local`,
62
+ cache: `${home}\\AppData\\Local`
63
+ });
64
+ exports.TestPlatformWindows = TestPlatformWindows;
65
+ //# sourceMappingURL=TestPlatform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestPlatform.js","names":["_effect","require","_Platform","TestPlatform","config","service","os","homeDir","Effect","succeed","home","configDir","dataDir","data","cacheDir","cache","Layer","Platform","exports","TestPlatformDarwin","TestPlatformLinux","TestPlatformWindows"],"sources":["../../../src/platform/TestPlatform.ts"],"sourcesContent":[null],"mappings":";;;;;;AAKA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AANA;;;;;;AAsCA;;;;;;AAMO,MAAME,YAAY,GAAGA,CAACC,MAAA,GAA6B,EAAE,KAA2B;EACrF,MAAMC,OAAO,GAAoB;IAC/BC,EAAE,EAAEF,MAAM,CAACE,EAAE,IAAI,QAAQ;IACzBC,OAAO,EAAEC,cAAM,CAACC,OAAO,CAACL,MAAM,CAACM,IAAI,IAAI,gBAAgB,CAAC;IACxDC,SAAS,EAAEH,cAAM,CAACC,OAAO,CAACL,MAAM,CAACA,MAAM,IAAI,wBAAwB,CAAC;IACpEQ,OAAO,EAAEJ,cAAM,CAACC,OAAO,CAACL,MAAM,CAACS,IAAI,IAAI,6BAA6B,CAAC;IACrEC,QAAQ,EAAEN,cAAM,CAACC,OAAO,CAACL,MAAM,CAACW,KAAK,IAAI,uBAAuB;GACjE;EAED,OAAOC,aAAK,CAACP,OAAO,CAACQ,kBAAQ,EAAEZ,OAAO,CAAC;AACzC,CAAC;AAED;;;AAAAa,OAAA,CAAAf,YAAA,GAAAA,YAAA;AAGO,MAAMgB,kBAAkB,GAAGA,CAACT,IAAI,GAAG,iBAAiB,KACzDP,YAAY,CAAC;EACXG,EAAE,EAAE,QAAQ;EACZI,IAAI;EACJN,MAAM,EAAE,GAAGM,IAAI,UAAU;EACzBG,IAAI,EAAE,GAAGH,IAAI,8BAA8B;EAC3CK,KAAK,EAAE,GAAGL,IAAI;CACf,CAAC;AAEJ;;;AAAAQ,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAGO,MAAMC,iBAAiB,GAAGA,CAACV,IAAI,GAAG,gBAAgB,KACvDP,YAAY,CAAC;EACXG,EAAE,EAAE,OAAO;EACXI,IAAI;EACJN,MAAM,EAAE,GAAGM,IAAI,UAAU;EACzBG,IAAI,EAAE,GAAGH,IAAI,eAAe;EAC5BK,KAAK,EAAE,GAAGL,IAAI;CACf,CAAC;AAEJ;;;AAAAQ,OAAA,CAAAE,iBAAA,GAAAA,iBAAA;AAGO,MAAMC,mBAAmB,GAAGA,CACjCX,IAAI,GAAG,qBAAqB,KAE5BP,YAAY,CAAC;EACXG,EAAE,EAAE,OAAO;EACXI,IAAI;EACJN,MAAM,EAAE,GAAGM,IAAI,oBAAoB;EACnCG,IAAI,EAAE,GAAGH,IAAI,kBAAkB;EAC/BK,KAAK,EAAE,GAAGL,IAAI;CACf,CAAC;AAAAQ,OAAA,CAAAG,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Platform", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _Platform.Platform;
10
+ }
11
+ });
12
+ exports.PlatformLive = void 0;
13
+ Object.defineProperty(exports, "TestPlatform", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _TestPlatform.TestPlatform;
17
+ }
18
+ });
19
+ Object.defineProperty(exports, "TestPlatformDarwin", {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _TestPlatform.TestPlatformDarwin;
23
+ }
24
+ });
25
+ Object.defineProperty(exports, "TestPlatformLinux", {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _TestPlatform.TestPlatformLinux;
29
+ }
30
+ });
31
+ Object.defineProperty(exports, "TestPlatformWindows", {
32
+ enumerable: true,
33
+ get: function () {
34
+ return _TestPlatform.TestPlatformWindows;
35
+ }
36
+ });
37
+ Object.defineProperty(exports, "withEnv", {
38
+ enumerable: true,
39
+ get: function () {
40
+ return _testUtils.withEnv;
41
+ }
42
+ });
43
+ Object.defineProperty(exports, "withoutEnv", {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _testUtils.withoutEnv;
47
+ }
48
+ });
49
+ var _effect = require("effect");
50
+ var _errors = require("../errors.js");
51
+ var _common = require("./internal/common.js");
52
+ var darwin = _interopRequireWildcard(require("./internal/darwin.js"));
53
+ var linux = _interopRequireWildcard(require("./internal/linux.js"));
54
+ var windows = _interopRequireWildcard(require("./internal/windows.js"));
55
+ var _Platform = require("./Platform.js");
56
+ var _testUtils = require("./internal/testUtils.js");
57
+ var _TestPlatform = require("./TestPlatform.js");
58
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
59
+ /**
60
+ * Platform-specific path resolution.
61
+ *
62
+ * This module provides the Platform service for resolving base configuration
63
+ * directories on each supported platform (macOS, Linux, Windows).
64
+ *
65
+ * @module
66
+ */
67
+
68
+ // Re-export types and service
69
+
70
+ /**
71
+ * Detects the current operating system.
72
+ */
73
+ const detectOS = () => {
74
+ const platform = process.platform;
75
+ if (platform === "darwin" || platform === "linux" || platform === "win32") {
76
+ return platform;
77
+ }
78
+ throw new _errors.UnsupportedPlatformError();
79
+ };
80
+ /**
81
+ * Creates a platform service for the current OS.
82
+ */
83
+ const createPlatformService = () => {
84
+ const os = detectOS();
85
+ switch (os) {
86
+ case "darwin":
87
+ return {
88
+ os,
89
+ homeDir: _common.homeDir,
90
+ configDir: darwin.configDir,
91
+ dataDir: darwin.dataDir,
92
+ cacheDir: darwin.cacheDir
93
+ };
94
+ case "linux":
95
+ return {
96
+ os,
97
+ homeDir: _common.homeDir,
98
+ configDir: linux.configDir,
99
+ dataDir: linux.dataDir,
100
+ cacheDir: linux.cacheDir
101
+ };
102
+ case "win32":
103
+ return {
104
+ os,
105
+ homeDir: _common.homeDir,
106
+ configDir: windows.configDir,
107
+ dataDir: windows.dataDir,
108
+ cacheDir: windows.cacheDir
109
+ };
110
+ }
111
+ };
112
+ /**
113
+ * Live platform layer that uses the actual system paths.
114
+ *
115
+ * Uses runtime platform detection to select the appropriate implementation.
116
+ */
117
+ const PlatformLive = exports.PlatformLive = /*#__PURE__*/_effect.Layer.sync(_Platform.Platform, createPlatformService);
118
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_effect","require","_errors","_common","darwin","_interopRequireWildcard","linux","windows","_Platform","_testUtils","_TestPlatform","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","detectOS","platform","process","UnsupportedPlatformError","createPlatformService","os","homeDir","configDir","dataDir","cacheDir","PlatformLive","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AI,CAACC,kBAAQ,EAAEV,qBAAqB,CAAC","ignoreList":[]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.joinPath = exports.isAbsolute = exports.homeDir = void 0;
7
+ var _effect = require("effect");
8
+ var os = _interopRequireWildcard(require("node:os"));
9
+ var path = _interopRequireWildcard(require("node:path"));
10
+ var _errors = require("../../errors.js");
11
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
+ /**
13
+ * Common platform utilities.
14
+ *
15
+ * @module
16
+ */
17
+
18
+ /**
19
+ * Returns the user's home directory.
20
+ */
21
+ const homeDir = exports.homeDir = /*#__PURE__*/_effect.Effect.sync(() => {
22
+ const home = os.homedir();
23
+ if (!home) {
24
+ return _effect.Effect.fail(new _errors.NotFoundError({
25
+ message: "home directory"
26
+ }));
27
+ }
28
+ return _effect.Effect.succeed(home);
29
+ }).pipe(_effect.Effect.flatten);
30
+ /**
31
+ * Joins path segments.
32
+ */
33
+ const joinPath = (...segments) => path.join(...segments);
34
+ /**
35
+ * Checks if a path is absolute.
36
+ */
37
+ exports.joinPath = joinPath;
38
+ const isAbsolute = p => path.isAbsolute(p);
39
+ exports.isAbsolute = isAbsolute;
40
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","names":["_effect","require","os","_interopRequireWildcard","path","_errors","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","homeDir","exports","Effect","sync","home","homedir","fail","NotFoundError","message","succeed","pipe","flatten","joinPath","segments","join","isAbsolute","p"],"sources":["../../../../src/platform/internal/common.ts"],"sourcesContent":[null],"mappings":";;;;;;AAKA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,EAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,IAAA,GAAAD,uBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAA+C,SAAAE,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAR/C;;;;;;AAUA;;;AAGO,MAAMkB,OAAO,GAAAC,OAAA,CAAAD,OAAA,gBAAGE,cAAM,CAACC,IAAI,CAAC,MAAK;EACtC,MAAMC,IAAI,GAAG3B,EAAE,CAAC4B,OAAO,EAAE;EACzB,IAAI,CAACD,IAAI,EAAE;IACT,OAAOF,cAAM,CAACI,IAAI,CAAC,IAAIC,qBAAa,CAAC;MAAEC,OAAO,EAAE;IAAgB,CAAE,CAAC,CAAC;EACtE;EACA,OAAON,cAAM,CAACO,OAAO,CAACL,IAAI,CAAC;AAC7B,CAAC,CAAC,CAACM,IAAI,CAACR,cAAM,CAACS,OAAO,CAAC;AAEvB;;;AAGO,MAAMC,QAAQ,GAAGA,CAAC,GAAGC,QAAuB,KAAalC,IAAI,CAACmC,IAAI,CAAC,GAAGD,QAAQ,CAAC;AAEtF;;;AAAAZ,OAAA,CAAAW,QAAA,GAAAA,QAAA;AAGO,MAAMG,UAAU,GAAIC,CAAS,IAAcrC,IAAI,CAACoC,UAAU,CAACC,CAAC,CAAC;AAAAf,OAAA,CAAAc,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.dataDir = exports.configDir = exports.cacheDir = exports.applicationSupportDir = void 0;
7
+ var _effect = require("effect");
8
+ var _common = require("./common.js");
9
+ /**
10
+ * macOS-specific path resolution.
11
+ *
12
+ * @module
13
+ */
14
+
15
+ /**
16
+ * Returns the user's config directory on macOS.
17
+ *
18
+ * Most CLI tools use `~/.config/` following XDG conventions,
19
+ * though native macOS apps prefer `~/Library/Application Support/`.
20
+ */
21
+ const configDir = exports.configDir = /*#__PURE__*/_effect.Effect.map(_common.homeDir, home => (0, _common.joinPath)(home, ".config"));
22
+ /**
23
+ * Returns the user's data directory on macOS.
24
+ *
25
+ * Returns `~/Library/Application Support/` for native macOS conventions.
26
+ */
27
+ const dataDir = exports.dataDir = /*#__PURE__*/_effect.Effect.map(_common.homeDir, home => (0, _common.joinPath)(home, "Library", "Application Support"));
28
+ /**
29
+ * Returns the Application Support directory on macOS.
30
+ *
31
+ * This is `~/Library/Application Support/`, used by native macOS applications.
32
+ */
33
+ const applicationSupportDir = exports.applicationSupportDir = dataDir;
34
+ /**
35
+ * Returns the cache directory on macOS.
36
+ *
37
+ * On macOS, we use the data directory as there's no standard XDG cache.
38
+ */
39
+ const cacheDir = exports.cacheDir = dataDir;
40
+ //# sourceMappingURL=darwin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"darwin.js","names":["_effect","require","_common","configDir","exports","Effect","map","homeDir","home","joinPath","dataDir","applicationSupportDir","cacheDir"],"sources":["../../../../src/platform/internal/darwin.ts"],"sourcesContent":[null],"mappings":";;;;;;AAKA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAPA;;;;;;AASA;;;;;;AAMO,MAAME,SAAS,GAAAC,OAAA,CAAAD,SAAA,gBAAyCE,cAAM,CAACC,GAAG,CACvEC,eAAO,EACNC,IAAI,IAAK,IAAAC,gBAAQ,EAACD,IAAI,EAAE,SAAS,CAAC,CACpC;AAED;;;;;AAKO,MAAME,OAAO,GAAAN,OAAA,CAAAM,OAAA,gBAAyCL,cAAM,CAACC,GAAG,CACrEC,eAAO,EACNC,IAAI,IAAK,IAAAC,gBAAQ,EAACD,IAAI,EAAE,SAAS,EAAE,qBAAqB,CAAC,CAC3D;AAED;;;;;AAKO,MAAMG,qBAAqB,GAAAP,OAAA,CAAAO,qBAAA,GAAyCD,OAAO;AAElF;;;;;AAKO,MAAME,QAAQ,GAAAR,OAAA,CAAAQ,QAAA,GAAyCF,OAAO","ignoreList":[]}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.dataDir = exports.configDir = exports.cacheDir = void 0;
7
+ var _effect = require("effect");
8
+ var _common = require("./common.js");
9
+ /**
10
+ * Linux-specific path resolution with XDG Base Directory support.
11
+ *
12
+ * @module
13
+ */
14
+
15
+ /**
16
+ * Gets an XDG path if the environment variable is set and valid.
17
+ *
18
+ * Returns None if:
19
+ * - The environment variable is not set
20
+ * - The value is empty
21
+ * - The path is not absolute
22
+ */
23
+ const xdgPathIfValid = varName => {
24
+ const value = process.env[varName];
25
+ if (value && value.length > 0 && (0, _common.isAbsolute)(value)) {
26
+ return _effect.Option.some(value);
27
+ }
28
+ return _effect.Option.none();
29
+ };
30
+ /**
31
+ * Returns the user's config directory on Linux.
32
+ *
33
+ * Respects `XDG_CONFIG_HOME` if set to an absolute path,
34
+ * otherwise defaults to `~/.config/`.
35
+ */
36
+ const configDir = exports.configDir = /*#__PURE__*/_effect.Effect.suspend(() => {
37
+ const xdgPath = xdgPathIfValid("XDG_CONFIG_HOME");
38
+ if (_effect.Option.isSome(xdgPath)) {
39
+ return _effect.Effect.succeed(xdgPath.value);
40
+ }
41
+ return _effect.Effect.map(_common.homeDir, home => (0, _common.joinPath)(home, ".config"));
42
+ });
43
+ /**
44
+ * Returns the user's data directory on Linux.
45
+ *
46
+ * Respects `XDG_DATA_HOME` if set to an absolute path,
47
+ * otherwise defaults to `~/.local/share/`.
48
+ */
49
+ const dataDir = exports.dataDir = /*#__PURE__*/_effect.Effect.suspend(() => {
50
+ const xdgPath = xdgPathIfValid("XDG_DATA_HOME");
51
+ if (_effect.Option.isSome(xdgPath)) {
52
+ return _effect.Effect.succeed(xdgPath.value);
53
+ }
54
+ return _effect.Effect.map(_common.homeDir, home => (0, _common.joinPath)(home, ".local", "share"));
55
+ });
56
+ /**
57
+ * Returns the user's cache directory on Linux.
58
+ *
59
+ * Respects `XDG_CACHE_HOME` if set to an absolute path,
60
+ * otherwise defaults to `~/.cache/`.
61
+ */
62
+ const cacheDir = exports.cacheDir = /*#__PURE__*/_effect.Effect.suspend(() => {
63
+ const xdgPath = xdgPathIfValid("XDG_CACHE_HOME");
64
+ if (_effect.Option.isSome(xdgPath)) {
65
+ return _effect.Effect.succeed(xdgPath.value);
66
+ }
67
+ return _effect.Effect.map(_common.homeDir, home => (0, _common.joinPath)(home, ".cache"));
68
+ });
69
+ //# sourceMappingURL=linux.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linux.js","names":["_effect","require","_common","xdgPathIfValid","varName","value","process","env","length","isAbsolute","Option","some","none","configDir","exports","Effect","suspend","xdgPath","isSome","succeed","map","homeDir","home","joinPath","dataDir","cacheDir"],"sources":["../../../../src/platform/internal/linux.ts"],"sourcesContent":[null],"mappings":";;;;;;AAKA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAPA;;;;;;AASA;;;;;;;;AAQA,MAAME,cAAc,GAAIC,OAAe,IAA2B;EAChE,MAAMC,KAAK,GAAGC,OAAO,CAACC,GAAG,CAACH,OAAO,CAAC;EAClC,IAAIC,KAAK,IAAIA,KAAK,CAACG,MAAM,GAAG,CAAC,IAAI,IAAAC,kBAAU,EAACJ,KAAK,CAAC,EAAE;IAClD,OAAOK,cAAM,CAACC,IAAI,CAACN,KAAK,CAAC;EAC3B;EACA,OAAOK,cAAM,CAACE,IAAI,EAAE;AACtB,CAAC;AAED;;;;;;AAMO,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,gBAAyCE,cAAM,CAACC,OAAO,CAAC,MAAK;EACjF,MAAMC,OAAO,GAAGd,cAAc,CAAC,iBAAiB,CAAC;EACjD,IAAIO,cAAM,CAACQ,MAAM,CAACD,OAAO,CAAC,EAAE;IAC1B,OAAOF,cAAM,CAACI,OAAO,CAACF,OAAO,CAACZ,KAAK,CAAC;EACtC;EACA,OAAOU,cAAM,CAACK,GAAG,CAACC,eAAO,EAAGC,IAAI,IAAK,IAAAC,gBAAQ,EAACD,IAAI,EAAE,SAAS,CAAC,CAAC;AACjE,CAAC,CAAC;AAEF;;;;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