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
@@ -0,0 +1,36 @@
1
+ /**
2
+ * A configuration file resource location.
3
+ *
4
+ * Represents a single configuration file that may contain
5
+ * multiple configuration entries, accessed via a key path.
6
+ *
7
+ * @module
8
+ */
9
+ import { Option, Schema } from "effect";
10
+ import { FileFormat } from "./FileFormat.js";
11
+ /**
12
+ * Config resource schema.
13
+ */
14
+ export const ConfigResource = /*#__PURE__*/Schema.Struct({
15
+ /** Path to the configuration file. */
16
+ file: Schema.String,
17
+ /** Whether the file currently exists on the filesystem. */
18
+ fileExists: Schema.Boolean,
19
+ /** JSON pointer path to the relevant section (e.g., `"/mcpServers"`). */
20
+ keyPath: Schema.String,
21
+ /** Format of the configuration file. */
22
+ format: FileFormat,
23
+ /** Optional JSON Schema URL for validation. */
24
+ schemaUrl: /*#__PURE__*/Schema.OptionFromNullOr(Schema.String)
25
+ });
26
+ /**
27
+ * Creates a config resource.
28
+ */
29
+ export const makeConfigResource = (file, fileExists, keyPath, format, schemaUrl) => ({
30
+ file,
31
+ fileExists,
32
+ keyPath,
33
+ format,
34
+ schemaUrl: schemaUrl !== undefined ? Option.some(schemaUrl) : Option.none()
35
+ });
36
+ //# sourceMappingURL=ConfigResource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigResource.js","names":["Option","Schema","FileFormat","ConfigResource","Struct","file","String","fileExists","Boolean","keyPath","format","schemaUrl","OptionFromNullOr","makeConfigResource","undefined","some","none"],"sources":["../../../src/types/ConfigResource.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;AAQA,SAASA,MAAM,EAAEC,MAAM,QAAQ,QAAQ;AACvC,SAASC,UAAU,QAA2C,iBAAiB;AAE/E;;;AAGA,OAAO,MAAMC,cAAc,gBAAGF,MAAM,CAACG,MAAM,CAAC;EAC1C;EACAC,IAAI,EAAEJ,MAAM,CAACK,MAAM;EACnB;EACAC,UAAU,EAAEN,MAAM,CAACO,OAAO;EAC1B;EACAC,OAAO,EAAER,MAAM,CAACK,MAAM;EACtB;EACAI,MAAM,EAAER,UAAU;EAClB;EACAS,SAAS,eAAEV,MAAM,CAACW,gBAAgB,CAACX,MAAM,CAACK,MAAM;CACjD,CAAC;AAOF;;;AAGA,OAAO,MAAMO,kBAAkB,GAAGA,CAChCR,IAAY,EACZE,UAAmB,EACnBE,OAAe,EACfC,MAAsB,EACtBC,SAAkB,MACE;EACpBN,IAAI;EACJE,UAAU;EACVE,OAAO;EACPC,MAAM;EACNC,SAAS,EAAEA,SAAS,KAAKG,SAAS,GAAGd,MAAM,CAACe,IAAI,CAACJ,SAAS,CAAC,GAAGX,MAAM,CAACgB,IAAI;CAC1E,CAAC","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * A directory-based resource location.
3
+ *
4
+ * Represents a directory that contains multiple resource files,
5
+ * such as commands or skills directories.
6
+ *
7
+ * @module
8
+ */
9
+ import { Schema } from "effect";
10
+ import { DirectoryStructure } from "./DirectoryStructure.js";
11
+ import { FileFormat } from "./FileFormat.js";
12
+ /**
13
+ * Directory resource schema.
14
+ */
15
+ export const DirectoryResource = /*#__PURE__*/Schema.Struct({
16
+ /** Path to the directory. */
17
+ path: Schema.String,
18
+ /** Whether the directory currently exists on the filesystem. */
19
+ exists: Schema.Boolean,
20
+ /** How resources are organized within the directory. */
21
+ structure: DirectoryStructure,
22
+ /** Format of files within the directory. */
23
+ fileFormat: FileFormat
24
+ });
25
+ /**
26
+ * Creates a directory resource.
27
+ */
28
+ export const makeDirectoryResource = (path, exists, structure, fileFormat) => ({
29
+ path,
30
+ exists,
31
+ structure,
32
+ fileFormat
33
+ });
34
+ //# sourceMappingURL=DirectoryResource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DirectoryResource.js","names":["Schema","DirectoryStructure","FileFormat","DirectoryResource","Struct","path","String","exists","Boolean","structure","fileFormat","makeDirectoryResource"],"sources":["../../../src/types/DirectoryResource.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;AAQA,SAASA,MAAM,QAAQ,QAAQ;AAC/B,SAASC,kBAAkB,QAA2D,yBAAyB;AAC/G,SAASC,UAAU,QAA2C,iBAAiB;AAE/E;;;AAGA,OAAO,MAAMC,iBAAiB,gBAAGH,MAAM,CAACI,MAAM,CAAC;EAC7C;EACAC,IAAI,EAAEL,MAAM,CAACM,MAAM;EACnB;EACAC,MAAM,EAAEP,MAAM,CAACQ,OAAO;EACtB;EACAC,SAAS,EAAER,kBAAkB;EAC7B;EACAS,UAAU,EAAER;CACb,CAAC;AAOF;;;AAGA,OAAO,MAAMS,qBAAqB,GAAGA,CACnCN,IAAY,EACZE,MAAe,EACfE,SAAiC,EACjCC,UAA0B,MACH;EACvBL,IAAI;EACJE,MAAM;EACNE,SAAS;EACTC;CACD,CAAC","ignoreList":[]}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Directory layout structure for resource directories.
3
+ *
4
+ * Harnesses organize their resources in different ways:
5
+ * - Flat: Files directly in the directory (e.g., `commands/foo.md`)
6
+ * - Nested: Subdirectory per resource (e.g., `skills/foo/SKILL.md`)
7
+ *
8
+ * @module
9
+ */
10
+ import { Data, Schema } from "effect";
11
+ /**
12
+ * Files directly in the directory.
13
+ *
14
+ * Example: `commands/foo.md`, `commands/bar.md`
15
+ */
16
+ export class Flat extends /*#__PURE__*/Data.TaggedClass("Flat") {}
17
+ /**
18
+ * Subdirectory per resource with a fixed filename inside.
19
+ *
20
+ * Example: `skills/foo/SKILL.md`, `skills/bar/SKILL.md`
21
+ */
22
+ export class Nested extends /*#__PURE__*/Data.TaggedClass("Nested") {}
23
+ /**
24
+ * Directory structure schema for serialization.
25
+ */
26
+ export const DirectoryStructure = /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.TaggedStruct("Flat", {
27
+ filePattern: Schema.String
28
+ }), /*#__PURE__*/Schema.TaggedStruct("Nested", {
29
+ subdirPattern: Schema.String,
30
+ fileName: Schema.String
31
+ }));
32
+ /**
33
+ * Creates a flat directory structure.
34
+ */
35
+ export const flat = filePattern => new Flat({
36
+ filePattern
37
+ });
38
+ /**
39
+ * Creates a nested directory structure.
40
+ */
41
+ export const nested = (subdirPattern, fileName) => new Nested({
42
+ subdirPattern,
43
+ fileName
44
+ });
45
+ //# sourceMappingURL=DirectoryStructure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DirectoryStructure.js","names":["Data","Schema","Flat","TaggedClass","Nested","DirectoryStructure","Union","TaggedStruct","filePattern","String","subdirPattern","fileName","flat","nested"],"sources":["../../../src/types/DirectoryStructure.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;AASA,SAASA,IAAI,EAAEC,MAAM,QAAQ,QAAQ;AAErC;;;;;AAKA,OAAM,MAAOC,IAAK,sBAAQF,IAAI,CAACG,WAAW,CAAC,MAAM,CAG/C;AAEF;;;;;AAKA,OAAM,MAAOC,MAAO,sBAAQJ,IAAI,CAACG,WAAW,CAAC,QAAQ,CAUnD;AAOF;;;AAGA,OAAO,MAAME,kBAAkB,gBAAsCJ,MAAM,CAACK,KAAK,cAC/EL,MAAM,CAACM,YAAY,CAAC,MAAM,EAAE;EAAEC,WAAW,EAAEP,MAAM,CAACQ;AAAM,CAAE,CAAC,eAC3DR,MAAM,CAACM,YAAY,CAAC,QAAQ,EAAE;EAC5BG,aAAa,EAAET,MAAM,CAACQ,MAAM;EAC5BE,QAAQ,EAAEV,MAAM,CAACQ;CAClB,CAAC,CACkC;AAEtC;;;AAGA,OAAO,MAAMG,IAAI,GAAIJ,WAAmB,IAAyB,IAAIN,IAAI,CAAC;EAAEM;AAAW,CAAE,CAAC;AAE1F;;;AAGA,OAAO,MAAMK,MAAM,GAAGA,CAACH,aAAqB,EAAEC,QAAgB,KAC5D,IAAIP,MAAM,CAAC;EAAEM,aAAa;EAAEC;AAAQ,CAAE,CAAC","ignoreList":[]}
@@ -0,0 +1,182 @@
1
+ /**
2
+ * A value that may be a plain string or a reference to an environment variable.
3
+ *
4
+ * This type handles the different syntax each harness uses for environment
5
+ * variable references:
6
+ * - Claude Code: `${VAR}`
7
+ * - OpenCode: `{env:VAR}`
8
+ * - Goose: Uses `env_keys` array, values resolved at runtime
9
+ *
10
+ * @module
11
+ */
12
+ import { Data, Effect, Option, Schema } from "effect";
13
+ import { MissingEnvVarError } from "../errors.js";
14
+ /**
15
+ * A plain string value.
16
+ */
17
+ export class Plain extends /*#__PURE__*/Data.TaggedClass("Plain") {}
18
+ /**
19
+ * A reference to an environment variable.
20
+ */
21
+ export class EnvRef extends /*#__PURE__*/Data.TaggedClass("EnvRef") {}
22
+ /**
23
+ * EnvValue schema for JSON serialization.
24
+ * Uses untagged representation:
25
+ * - Plain string: `"hello"` deserializes to `Plain("hello")`
26
+ * - Object with env key: `{"env": "VAR"}` deserializes to `EnvRef { env: "VAR" }`
27
+ */
28
+ export const EnvValue = /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.transform(Schema.String, /*#__PURE__*/Schema.instanceOf(Plain), {
29
+ strict: true,
30
+ decode: value => new Plain({
31
+ value
32
+ }),
33
+ encode: plain => plain.value
34
+ }), /*#__PURE__*/Schema.transform(/*#__PURE__*/Schema.Struct({
35
+ env: Schema.String
36
+ }), /*#__PURE__*/Schema.instanceOf(EnvRef), {
37
+ strict: true,
38
+ decode: ({
39
+ env
40
+ }) => new EnvRef({
41
+ env
42
+ }),
43
+ encode: envRef => ({
44
+ env: envRef.env
45
+ })
46
+ }));
47
+ /**
48
+ * Creates a plain string value.
49
+ */
50
+ export const plain = value => new Plain({
51
+ value
52
+ });
53
+ /**
54
+ * Creates an environment variable reference.
55
+ */
56
+ export const env = varName => new EnvRef({
57
+ env: varName
58
+ });
59
+ /**
60
+ * Returns `true` if this is a plain string value.
61
+ */
62
+ export const isPlain = value => value._tag === "Plain";
63
+ /**
64
+ * Returns `true` if this is an environment variable reference.
65
+ */
66
+ export const isEnvRef = value => value._tag === "EnvRef";
67
+ /**
68
+ * Converts to the harness-specific native string format.
69
+ *
70
+ * - For `Plain`: Returns the string as-is
71
+ * - For `EnvRef` with Claude Code/AmpCode/CopilotCli: Returns `${VAR}`
72
+ * - For `EnvRef` with OpenCode: Returns `{env:VAR}`
73
+ * - For `EnvRef` with Goose: Resolves the env var immediately (returns empty string if not set)
74
+ */
75
+ export const toNative = (value, kind) => {
76
+ if (value._tag === "Plain") {
77
+ return value.value;
78
+ }
79
+ switch (kind) {
80
+ case "ClaudeCode":
81
+ case "AmpCode":
82
+ case "CopilotCli":
83
+ return `\${${value.env}}`;
84
+ case "OpenCode":
85
+ return `{env:${value.env}}`;
86
+ case "Goose":
87
+ return process.env[value.env] ?? "";
88
+ }
89
+ };
90
+ /**
91
+ * Fallible version of `toNative` that returns an error when an environment
92
+ * variable reference cannot be resolved.
93
+ *
94
+ * For Goose harness, this validates that the referenced environment variable
95
+ * is actually set, returning an error if not.
96
+ *
97
+ * For other harnesses that use template syntax (Claude Code, OpenCode, AmpCode),
98
+ * this behaves identically to `toNative` since the variable is not resolved
99
+ * at conversion time.
100
+ */
101
+ export const tryToNative = (value, kind) => {
102
+ if (value._tag === "Plain") {
103
+ return Effect.succeed(value.value);
104
+ }
105
+ switch (kind) {
106
+ case "ClaudeCode":
107
+ case "AmpCode":
108
+ case "CopilotCli":
109
+ return Effect.succeed(`\${${value.env}}`);
110
+ case "OpenCode":
111
+ return Effect.succeed(`{env:${value.env}}`);
112
+ case "Goose":
113
+ {
114
+ const envVal = process.env[value.env];
115
+ if (envVal === undefined) {
116
+ return Effect.fail(new MissingEnvVarError({
117
+ name: value.env
118
+ }));
119
+ }
120
+ return Effect.succeed(envVal);
121
+ }
122
+ }
123
+ };
124
+ /**
125
+ * Parses a harness-specific native string format into an `EnvValue`.
126
+ *
127
+ * - For Claude Code/AmpCode/CopilotCli: Parses `${VAR}` pattern
128
+ * - For OpenCode: Parses `{env:VAR}` pattern
129
+ * - For Goose: Always returns `Plain` (Goose doesn't use inline syntax)
130
+ * - If no pattern matches, returns `Plain`
131
+ */
132
+ export const fromNative = (s, kind) => {
133
+ switch (kind) {
134
+ case "ClaudeCode":
135
+ case "AmpCode":
136
+ case "CopilotCli":
137
+ {
138
+ // Parse ${VAR} pattern
139
+ if (s.startsWith("${") && s.endsWith("}")) {
140
+ const varName = s.slice(2, -1);
141
+ return new EnvRef({
142
+ env: varName
143
+ });
144
+ }
145
+ return new Plain({
146
+ value: s
147
+ });
148
+ }
149
+ case "OpenCode":
150
+ {
151
+ // Parse {env:VAR} pattern
152
+ if (s.startsWith("{env:") && s.endsWith("}")) {
153
+ const varName = s.slice(5, -1);
154
+ return new EnvRef({
155
+ env: varName
156
+ });
157
+ }
158
+ return new Plain({
159
+ value: s
160
+ });
161
+ }
162
+ case "Goose":
163
+ // Goose doesn't use inline env var syntax; values are always plain
164
+ return new Plain({
165
+ value: s
166
+ });
167
+ }
168
+ };
169
+ /**
170
+ * Resolves the value, looking up environment variables if needed.
171
+ *
172
+ * - For `Plain`: Returns `Some(value)`
173
+ * - For `EnvRef`: Returns `Some(value)` if the env var is set, `None` otherwise
174
+ */
175
+ export const resolve = value => {
176
+ if (value._tag === "Plain") {
177
+ return Option.some(value.value);
178
+ }
179
+ const envVal = process.env[value.env];
180
+ return envVal !== undefined ? Option.some(envVal) : Option.none();
181
+ };
182
+ //# sourceMappingURL=EnvValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvValue.js","names":["Data","Effect","Option","Schema","MissingEnvVarError","Plain","TaggedClass","EnvRef","EnvValue","Union","transform","String","instanceOf","strict","decode","value","encode","plain","Struct","env","envRef","varName","isPlain","_tag","isEnvRef","toNative","kind","process","tryToNative","succeed","envVal","undefined","fail","name","fromNative","s","startsWith","endsWith","slice","resolve","some","none"],"sources":["../../../src/types/EnvValue.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,SAASA,IAAI,EAAEC,MAAM,EAAEC,MAAM,EAAEC,MAAM,QAAQ,QAAQ;AACrD,SAASC,kBAAkB,QAAQ,cAAc;AAGjD;;;AAGA,OAAM,MAAOC,KAAM,sBAAQL,IAAI,CAACM,WAAW,CAAC,OAAO,CAEjD;AAEF;;;AAGA,OAAM,MAAOC,MAAO,sBAAQP,IAAI,CAACM,WAAW,CAAC,QAAQ,CAEnD;AAOF;;;;;;AAMA,OAAO,MAAME,QAAQ,gBAA+DL,MAAM,CAACM,KAAK,cAC9FN,MAAM,CAACO,SAAS,CACdP,MAAM,CAACQ,MAAM,eACbR,MAAM,CAACS,UAAU,CAACP,KAAK,CAAC,EACxB;EACEQ,MAAM,EAAE,IAAI;EACZC,MAAM,EAAGC,KAAK,IAAK,IAAIV,KAAK,CAAC;IAAEU;EAAK,CAAE,CAAC;EACvCC,MAAM,EAAGC,KAAK,IAAKA,KAAK,CAACF;CAC1B,CACF,eACDZ,MAAM,CAACO,SAAS,cACdP,MAAM,CAACe,MAAM,CAAC;EAAEC,GAAG,EAAEhB,MAAM,CAACQ;AAAM,CAAE,CAAC,eACrCR,MAAM,CAACS,UAAU,CAACL,MAAM,CAAC,EACzB;EACEM,MAAM,EAAE,IAAI;EACZC,MAAM,EAAEA,CAAC;IAAEK;EAAG,CAAE,KAAK,IAAIZ,MAAM,CAAC;IAAEY;EAAG,CAAE,CAAC;EACxCH,MAAM,EAAGI,MAAM,KAAM;IAAED,GAAG,EAAEC,MAAM,CAACD;EAAG,CAAE;CACzC,CACF,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AEoB;QAAC,CAAE,CAAC;MAChC;IACA,KAAK,OAAO;MACV;MACA,OAAO,IAAI9B,KAAK,CAAC;QAAEU,KAAK,EAAEoB;MAAC,CAAE,CAAC;EAClC;AACF,CAAC;AAED;;;;;;AAMA,OAAO,MAAMI,OAAO,GAAIxB,KAAe,IAA2B;EAChE,IAAIA,KAAK,CAACQ,IAAI,KAAK,OAAO,EAAE;IAC1B,OAAOrB,MAAM,CAACsC,IAAI,CAACzB,KAAK,CAACA,KAAK,CAAC;EACjC;EACA,MAAMe,MAAM,GAAGH,OAAO,CAACR,GAAG,CAACJ,KAAK,CAACI,GAAG,CAAC;EACrC,OAAOW,MAAM,KAAKC,SAAS,GAAG7B,MAAM,CAACsC,IAAI,CAACV,MAAM,CAAC,GAAG5B,MAAM,CAACuC,IAAI,EAAE;AACnE,CAAC","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * File formats used by harness configuration files.
3
+ *
4
+ * Different harnesses use different formats for their configuration,
5
+ * commands, and other resources.
6
+ *
7
+ * @module
8
+ */
9
+ import { Schema } from "effect";
10
+ /**
11
+ * File format schema.
12
+ */
13
+ export const FileFormat = /*#__PURE__*/Schema.Literal("Json", "Jsonc", "Yaml", "Markdown", "MarkdownWithFrontmatter");
14
+ /**
15
+ * All supported file formats.
16
+ */
17
+ export const FileFormatAll = ["Json", "Jsonc", "Yaml", "Markdown", "MarkdownWithFrontmatter"];
18
+ //# sourceMappingURL=FileFormat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileFormat.js","names":["Schema","FileFormat","Literal","FileFormatAll"],"sources":["../../../src/types/FileFormat.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;AAQA,SAASA,MAAM,QAAQ,QAAQ;AAE/B;;;AAGA,OAAO,MAAMC,UAAU,gBAAGD,MAAM,CAACE,OAAO,CACtC,MAAM,EACN,OAAO,EACP,MAAM,EACN,UAAU,EACV,yBAAyB,CAC1B;AAOD;;;AAGA,OAAO,MAAMC,aAAa,GAAG,CAC3B,MAAM,EACN,OAAO,EACP,MAAM,EACN,UAAU,EACV,yBAAyB,CACmB","ignoreList":[]}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Supported AI coding harnesses.
3
+ *
4
+ * This module provides the HarnessKind type representing the different
5
+ * AI coding assistants whose configuration paths can be discovered.
6
+ *
7
+ * @module
8
+ */
9
+ import { Schema } from "effect";
10
+ /**
11
+ * Harness kind schema - represents the different AI coding assistants.
12
+ */
13
+ export const HarnessKind = /*#__PURE__*/Schema.Literal("ClaudeCode", "OpenCode", "Goose", "AmpCode", "CopilotCli");
14
+ /**
15
+ * All supported harness kinds.
16
+ */
17
+ export const HarnessKindAll = ["ClaudeCode", "OpenCode", "Goose", "AmpCode", "CopilotCli"];
18
+ /**
19
+ * Returns the display name of this harness kind.
20
+ */
21
+ export const asStr = kind => {
22
+ switch (kind) {
23
+ case "ClaudeCode":
24
+ return "Claude Code";
25
+ case "OpenCode":
26
+ return "OpenCode";
27
+ case "Goose":
28
+ return "Goose";
29
+ case "AmpCode":
30
+ return "AMP Code";
31
+ case "CopilotCli":
32
+ return "Copilot CLI";
33
+ }
34
+ };
35
+ /**
36
+ * Returns the known CLI binary names for this harness.
37
+ *
38
+ * These are the executable names that indicate the harness is installed
39
+ * and available in PATH.
40
+ */
41
+ export const binaryNames = kind => {
42
+ switch (kind) {
43
+ case "ClaudeCode":
44
+ return ["claude"];
45
+ case "OpenCode":
46
+ return ["opencode"];
47
+ case "Goose":
48
+ return ["goose"];
49
+ case "AmpCode":
50
+ return ["amp"];
51
+ case "CopilotCli":
52
+ return ["copilot"];
53
+ }
54
+ };
55
+ /**
56
+ * Returns the expected directory name(s) for a resource kind.
57
+ *
58
+ * Different harnesses use different naming conventions:
59
+ * - OpenCode uses singular names (`skill`, `command`)
60
+ * - Other harnesses use plural names (`skills`, `commands`)
61
+ *
62
+ * Returns `undefined` if the harness doesn't support that resource type.
63
+ * When multiple names are returned, index 0 is the canonical name.
64
+ */
65
+ export const directoryNames = (kind, resource) => {
66
+ switch (kind) {
67
+ case "OpenCode":
68
+ switch (resource) {
69
+ case "Skills":
70
+ return ["skill"];
71
+ case "Commands":
72
+ return ["command"];
73
+ case "Agents":
74
+ return ["agent"];
75
+ case "Plugins":
76
+ return ["plugin"];
77
+ }
78
+ break;
79
+ case "ClaudeCode":
80
+ switch (resource) {
81
+ case "Skills":
82
+ return ["skills"];
83
+ case "Commands":
84
+ return ["commands"];
85
+ case "Agents":
86
+ return ["agents"];
87
+ case "Plugins":
88
+ return ["plugins"];
89
+ }
90
+ break;
91
+ case "Goose":
92
+ switch (resource) {
93
+ case "Skills":
94
+ return ["skills"];
95
+ default:
96
+ return undefined;
97
+ }
98
+ case "AmpCode":
99
+ switch (resource) {
100
+ case "Skills":
101
+ return ["skills"];
102
+ case "Commands":
103
+ return ["commands"];
104
+ default:
105
+ return undefined;
106
+ }
107
+ case "CopilotCli":
108
+ switch (resource) {
109
+ case "Skills":
110
+ return ["skills"];
111
+ case "Agents":
112
+ return ["agents"];
113
+ default:
114
+ return undefined;
115
+ }
116
+ default:
117
+ return undefined;
118
+ }
119
+ };
120
+ //# sourceMappingURL=HarnessKind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HarnessKind.js","names":["Schema","HarnessKind","Literal","HarnessKindAll","asStr","kind","binaryNames","directoryNames","resource","undefined"],"sources":["../../../src/types/HarnessKind.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;AAQA,SAASA,MAAM,QAAQ,QAAQ;AAG/B;;;AAGA,OAAO,MAAMC,WAAW,gBAAGD,MAAM,CAACE,OAAO,CACvC,YAAY,EACZ,UAAU,EACV,OAAO,EACP,SAAS,EACT,YAAY,CACb;AAOD;;;AAGA,OAAO,MAAMC,cAAc,GAAG,CAC5B,YAAY,EACZ,UAAU,EACV,OAAO,EACP,SAAS,EACT,YAAY,CACiC;AAE/C;;;AAGA,OAAO,MAAMC,KAAK,GAAIC,IAAiB,IAAY;EACjD,QAAQA,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,SAAS;MACZ,QAAQD,QAAQ;QACd,KAAK,QAAQ;UACX,OAAO,CAAC,QAAQ,CAAC;QACnB,KAAK,UAAU;UACb,OAAO,CAAC,UAAU,CAAC;QACrB;UACE,OAAOC,SAAS;MACpB;IAEF,KAAK,YAAY;MACf,QAAQD,QAAQ;QACd,KAAK,QAAQ;UACX,OAAO,CAAC,QAAQ,CAAC;QACnB,KAAK,QAAQ;UACX,OAAO,CAAC,QAAQ,CAAC;QACnB;UACE,OAAOC,SAAS;MACpB;IAEF;MACE,OAAOA,SAAS;EACpB;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Installation status of a harness on the current system.
3
+ *
4
+ * Represents the different states a harness can be in, from not installed
5
+ * to fully configured with both binary and configuration present.
6
+ *
7
+ * @module
8
+ */
9
+ import { Data, Option, Schema } from "effect";
10
+ /**
11
+ * Harness is not installed (no binary or config found).
12
+ */
13
+ export class NotInstalled extends /*#__PURE__*/Data.TaggedClass("NotInstalled") {}
14
+ /**
15
+ * Only configuration directory exists (no binary in PATH).
16
+ */
17
+ export class ConfigOnly extends /*#__PURE__*/Data.TaggedClass("ConfigOnly") {}
18
+ /**
19
+ * Only the binary exists in PATH (no configuration found).
20
+ */
21
+ export class BinaryOnly extends /*#__PURE__*/Data.TaggedClass("BinaryOnly") {}
22
+ /**
23
+ * Fully installed with both binary and configuration.
24
+ */
25
+ export class FullyInstalled extends /*#__PURE__*/Data.TaggedClass("FullyInstalled") {}
26
+ /**
27
+ * Installation status schema for serialization.
28
+ */
29
+ export const InstallationStatus = /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.TaggedStruct("NotInstalled", {}), /*#__PURE__*/Schema.TaggedStruct("ConfigOnly", {
30
+ configPath: Schema.String
31
+ }), /*#__PURE__*/Schema.TaggedStruct("BinaryOnly", {
32
+ binaryPath: Schema.String
33
+ }), /*#__PURE__*/Schema.TaggedStruct("FullyInstalled", {
34
+ binaryPath: Schema.String,
35
+ configPath: Schema.String
36
+ }));
37
+ /**
38
+ * Returns `true` if the harness CLI can be invoked.
39
+ *
40
+ * A harness is runnable if its binary is available in PATH,
41
+ * regardless of whether configuration exists.
42
+ */
43
+ export const isRunnable = status => {
44
+ switch (status._tag) {
45
+ case "BinaryOnly":
46
+ case "FullyInstalled":
47
+ return true;
48
+ default:
49
+ return false;
50
+ }
51
+ };
52
+ /**
53
+ * Returns the binary path if available.
54
+ */
55
+ export const binaryPath = status => {
56
+ switch (status._tag) {
57
+ case "BinaryOnly":
58
+ return Option.some(status.binaryPath);
59
+ case "FullyInstalled":
60
+ return Option.some(status.binaryPath);
61
+ default:
62
+ return Option.none();
63
+ }
64
+ };
65
+ /**
66
+ * Returns the config path if available.
67
+ */
68
+ export const configPath = status => {
69
+ switch (status._tag) {
70
+ case "ConfigOnly":
71
+ return Option.some(status.configPath);
72
+ case "FullyInstalled":
73
+ return Option.some(status.configPath);
74
+ default:
75
+ return Option.none();
76
+ }
77
+ };
78
+ /**
79
+ * Creates a NotInstalled status.
80
+ */
81
+ export const notInstalled = () => new NotInstalled();
82
+ /**
83
+ * Creates a ConfigOnly status.
84
+ */
85
+ export const configOnly = configPath => new ConfigOnly({
86
+ configPath
87
+ });
88
+ /**
89
+ * Creates a BinaryOnly status.
90
+ */
91
+ export const binaryOnly = binaryPath => new BinaryOnly({
92
+ binaryPath
93
+ });
94
+ /**
95
+ * Creates a FullyInstalled status.
96
+ */
97
+ export const fullyInstalled = (binaryPath, configPath) => new FullyInstalled({
98
+ binaryPath,
99
+ configPath
100
+ });
101
+ //# sourceMappingURL=InstallationStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstallationStatus.js","names":["Data","Option","Schema","NotInstalled","TaggedClass","ConfigOnly","BinaryOnly","FullyInstalled","InstallationStatus","Union","TaggedStruct","configPath","String","binaryPath","isRunnable","status","_tag","some","none","notInstalled","configOnly","binaryOnly","fullyInstalled"],"sources":["../../../src/types/InstallationStatus.ts"],"sourcesContent":[null],"mappings":"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AACgB,IAAI,CAACF,MAAM,CAACF,UAAU,CAAC;IACvC;MACE,OAAOZ,MAAM,CAACiB,IAAI,EAAE;EACxB;AACF,CAAC;AAED;;;AAGA,OAAO,MAAMP,UAAU,GAAII,MAA0B,IAA2B;EAC9E,QAAQA,MAAM,CAACC,IAAI;IACjB,KAAK,YAAY;MACf,OAAOf,MAAM,CAACgB,IAAI,CAACF,MAAM,CAACJ,UAAU,CAAC;IACvC,KAAK,gBAAgB;MACnB,OAAOV,MAAM,CAACgB,IAAI,CAACF,MAAM,CAACJ,UAAU,CAAC;IACvC;MACE,OAAOV,MAAM,CAACiB,IAAI,EAAE;EACxB;AACF,CAAC;AAED;;;AAGA,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAA0B,IAAIhB,YAAY,EAAE;AAExE;;;AAGA,OAAO,MAAMiB,UAAU,GAAIT,UAAkB,IAAyB,IAAIN,UAAU,CAAC;EAAEM;AAAU,CAAE,CAAC;AAEpG;;;AAGA,OAAO,MAAMU,UAAU,GAAIR,UAAkB,IAAyB,IAAIP,UAAU,CAAC;EAAEO;AAAU,CAAE,CAAC;AAEpG;;;AAGA,OAAO,MAAMS,cAAc,GAAGA,CAACT,UAAkB,EAAEF,UAAkB,KACnE,IAAIJ,cAAc,CAAC;EAAEM,UAAU;EAAEF;AAAU,CAAE,CAAC","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Types of paths a harness may provide.
3
+ *
4
+ * Each harness can have different configuration directories
5
+ * for different purposes.
6
+ *
7
+ * @module
8
+ */
9
+ import { Schema } from "effect";
10
+ /**
11
+ * Path type schema.
12
+ */
13
+ export const PathType = /*#__PURE__*/Schema.Literal("Config", "Skills", "Commands", "Mcp", "Rules");
14
+ /**
15
+ * All supported path types.
16
+ */
17
+ export const PathTypeAll = ["Config", "Skills", "Commands", "Mcp", "Rules"];
18
+ //# sourceMappingURL=PathType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PathType.js","names":["Schema","PathType","Literal","PathTypeAll"],"sources":["../../../src/types/PathType.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;AAQA,SAASA,MAAM,QAAQ,QAAQ;AAE/B;;;AAGA,OAAO,MAAMC,QAAQ,gBAAGD,MAAM,CAACE,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC;AAOtF;;;AAGA,OAAO,MAAMC,WAAW,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAA4C","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Categories of resources that harnesses manage in named directories.
3
+ *
4
+ * Used with `HarnessKind.directoryNames` to query expected
5
+ * directory naming conventions.
6
+ *
7
+ * @module
8
+ */
9
+ import { Schema } from "effect";
10
+ /**
11
+ * Resource kind schema - represents the different types of resources
12
+ * that harnesses can manage.
13
+ */
14
+ export const ResourceKind = /*#__PURE__*/Schema.Literal("Skills", "Commands", "Agents", "Plugins");
15
+ /**
16
+ * All supported resource kinds.
17
+ */
18
+ export const ResourceKindAll = ["Skills", "Commands", "Agents", "Plugins"];
19
+ //# sourceMappingURL=ResourceKind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResourceKind.js","names":["Schema","ResourceKind","Literal","ResourceKindAll"],"sources":["../../../src/types/ResourceKind.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;AAQA,SAASA,MAAM,QAAQ,QAAQ;AAE/B;;;;AAIA,OAAO,MAAMC,YAAY,gBAAGD,MAAM,CAACE,OAAO,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC;AAOrF;;;AAGA,OAAO,MAAMC,eAAe,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,CAExE","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Scope for path resolution.
3
+ *
4
+ * Determines whether to look up global (user-level) or
5
+ * project-local configuration paths.
6
+ *
7
+ * @module
8
+ */
9
+ import { Data, Schema } from "effect";
10
+ /**
11
+ * User-level global configuration (e.g., `~/.config/...`).
12
+ */
13
+ export class Global extends /*#__PURE__*/Data.TaggedClass("Global") {}
14
+ /**
15
+ * Project-local configuration (e.g., `.claude/` in project root).
16
+ */
17
+ export class Project extends /*#__PURE__*/Data.TaggedClass("Project") {}
18
+ /**
19
+ * Custom path for profile-scoped resources (inherits harness directory structure).
20
+ */
21
+ export class Custom extends /*#__PURE__*/Data.TaggedClass("Custom") {}
22
+ /**
23
+ * Scope schema for serialization.
24
+ */
25
+ export const Scope = /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.TaggedStruct("Global", {}), /*#__PURE__*/Schema.TaggedStruct("Project", {
26
+ path: Schema.String
27
+ }), /*#__PURE__*/Schema.TaggedStruct("Custom", {
28
+ path: Schema.String
29
+ }));
30
+ /**
31
+ * Creates a global scope.
32
+ */
33
+ export const global = () => new Global();
34
+ /**
35
+ * Creates a project scope with the given path.
36
+ */
37
+ export const project = path => new Project({
38
+ path
39
+ });
40
+ /**
41
+ * Creates a custom scope with the given path.
42
+ */
43
+ export const custom = path => new Custom({
44
+ path
45
+ });
46
+ //# sourceMappingURL=Scope.js.map