expandai 0.0.1 → 0.0.3

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 (271) hide show
  1. package/README.md +42 -5
  2. package/build/dts/ApiClient.d.ts +128 -185
  3. package/build/dts/ApiClient.d.ts.map +1 -1
  4. package/build/dts/Auth/Domain.d.ts +95 -0
  5. package/build/dts/Auth/Domain.d.ts.map +1 -0
  6. package/build/dts/Auth/ManualAuthorization.d.ts +107 -0
  7. package/build/dts/Auth/ManualAuthorization.d.ts.map +1 -0
  8. package/build/dts/Auth/PendingInit.d.ts +35 -0
  9. package/build/dts/Auth/PendingInit.d.ts.map +1 -0
  10. package/build/dts/Auth/Pkce.d.ts +10 -0
  11. package/build/dts/Auth/Pkce.d.ts.map +1 -0
  12. package/build/dts/Auth/SetupGrantAuthorization.d.ts +34 -0
  13. package/build/dts/Auth/SetupGrantAuthorization.d.ts.map +1 -0
  14. package/build/dts/Authentication.d.ts +10 -9
  15. package/build/dts/Authentication.d.ts.map +1 -1
  16. package/build/dts/BrowserOAuth.d.ts +8 -8
  17. package/build/dts/BrowserOAuth.d.ts.map +1 -1
  18. package/build/dts/CommandPath.d.ts +2 -0
  19. package/build/dts/CommandPath.d.ts.map +1 -0
  20. package/build/dts/Commands/Fetch.d.ts.map +1 -1
  21. package/build/dts/Commands/Hook.d.ts +5 -5
  22. package/build/dts/Commands/Init.d.ts +55 -0
  23. package/build/dts/Commands/Init.d.ts.map +1 -0
  24. package/build/dts/Commands/Mcp.d.ts +6 -6
  25. package/build/dts/Commands/Search.d.ts.map +1 -1
  26. package/build/dts/Commands/Skill.d.ts +4 -4
  27. package/build/dts/Commands/Status.d.ts +27 -0
  28. package/build/dts/Commands/Status.d.ts.map +1 -0
  29. package/build/dts/Commands/Telemetry.d.ts +7 -0
  30. package/build/dts/Commands/Telemetry.d.ts.map +1 -0
  31. package/build/dts/Commands/Uninstall.d.ts +4 -4
  32. package/build/dts/Config.d.ts +106 -15
  33. package/build/dts/Config.d.ts.map +1 -1
  34. package/build/dts/Hook/SnapshotNote.d.ts +8 -4
  35. package/build/dts/Hook/SnapshotNote.d.ts.map +1 -1
  36. package/build/dts/Init/ClaudeAdapter.d.ts +61 -0
  37. package/build/dts/Init/ClaudeAdapter.d.ts.map +1 -0
  38. package/build/dts/Init/ClaudeProfile.d.ts +78 -0
  39. package/build/dts/Init/ClaudeProfile.d.ts.map +1 -0
  40. package/build/dts/Init/Domain.d.ts +139 -0
  41. package/build/dts/Init/Domain.d.ts.map +1 -0
  42. package/build/dts/Init/HarnessAdapter.d.ts +33 -0
  43. package/build/dts/Init/HarnessAdapter.d.ts.map +1 -0
  44. package/build/dts/Init/HarnessDetector.d.ts +19 -0
  45. package/build/dts/Init/HarnessDetector.d.ts.map +1 -0
  46. package/build/dts/Init/HarnessRegistry.d.ts +50 -0
  47. package/build/dts/Init/HarnessRegistry.d.ts.map +1 -0
  48. package/build/dts/Init/MutationTransaction.d.ts +96 -0
  49. package/build/dts/Init/MutationTransaction.d.ts.map +1 -0
  50. package/build/dts/Init/Service.d.ts +72 -0
  51. package/build/dts/Init/Service.d.ts.map +1 -0
  52. package/build/dts/Init/StandardAdapters.d.ts +42 -0
  53. package/build/dts/Init/StandardAdapters.d.ts.map +1 -0
  54. package/build/dts/Init/Status.d.ts +149 -0
  55. package/build/dts/Init/Status.d.ts.map +1 -0
  56. package/build/dts/Install/Claude/Hook.d.ts +85 -25
  57. package/build/dts/Install/Claude/Hook.d.ts.map +1 -1
  58. package/build/dts/Install/Claude/Mcp.d.ts +21 -18
  59. package/build/dts/Install/Claude/Mcp.d.ts.map +1 -1
  60. package/build/dts/Install/Claude/Skill.d.ts +14 -15
  61. package/build/dts/Install/Claude/Skill.d.ts.map +1 -1
  62. package/build/dts/Install/Codex/Mcp.d.ts +14 -8
  63. package/build/dts/Install/Codex/Mcp.d.ts.map +1 -1
  64. package/build/dts/Install/Codex/Skill.d.ts +4 -2
  65. package/build/dts/Install/Codex/Skill.d.ts.map +1 -1
  66. package/build/dts/Install/Cursor/Mcp.d.ts +13 -13
  67. package/build/dts/Install/Cursor/Mcp.d.ts.map +1 -1
  68. package/build/dts/Install/Cursor/Skill.d.ts +4 -2
  69. package/build/dts/Install/Cursor/Skill.d.ts.map +1 -1
  70. package/build/dts/Install/Domain.d.ts +35 -5
  71. package/build/dts/Install/Domain.d.ts.map +1 -1
  72. package/build/dts/Install/Hook.d.ts +4 -4
  73. package/build/dts/Install/Hook.d.ts.map +1 -1
  74. package/build/dts/Install/Mcp.d.ts +5 -5
  75. package/build/dts/Install/Mcp.d.ts.map +1 -1
  76. package/build/dts/Install/Opencode/Hook.d.ts +4 -3
  77. package/build/dts/Install/Opencode/Hook.d.ts.map +1 -1
  78. package/build/dts/Install/Opencode/Mcp.d.ts +11 -11
  79. package/build/dts/Install/Opencode/Mcp.d.ts.map +1 -1
  80. package/build/dts/Install/Opencode/Skill.d.ts +4 -2
  81. package/build/dts/Install/Opencode/Skill.d.ts.map +1 -1
  82. package/build/dts/Install/Skill.d.ts +3 -3
  83. package/build/dts/Install/Uninstall.d.ts +6 -6
  84. package/build/dts/Install/Uninstall.d.ts.map +1 -1
  85. package/build/dts/MarkdownAnsi.d.ts +29 -0
  86. package/build/dts/MarkdownAnsi.d.ts.map +1 -0
  87. package/build/dts/Mcp/ExpandDocs.d.ts +17 -5
  88. package/build/dts/Mcp/ExpandDocs.d.ts.map +1 -1
  89. package/build/dts/Mcp/Server.d.ts +1 -1
  90. package/build/dts/Mcp/Server.d.ts.map +1 -1
  91. package/build/dts/Mcp/tools/Citations.d.ts +105 -77
  92. package/build/dts/Mcp/tools/Citations.d.ts.map +1 -1
  93. package/build/dts/Mcp/tools/Fetch.d.ts +16 -15
  94. package/build/dts/Mcp/tools/Fetch.d.ts.map +1 -1
  95. package/build/dts/SecureFile.d.ts +23 -0
  96. package/build/dts/SecureFile.d.ts.map +1 -0
  97. package/build/dts/Snippets.d.ts +11 -12
  98. package/build/dts/Snippets.d.ts.map +1 -1
  99. package/build/dts/Telemetry.d.ts +30 -0
  100. package/build/dts/Telemetry.d.ts.map +1 -0
  101. package/build/dts/Version.d.ts +2 -0
  102. package/build/dts/Version.d.ts.map +1 -0
  103. package/build/dts/Xdg.d.ts +11 -0
  104. package/build/dts/Xdg.d.ts.map +1 -0
  105. package/build/esm/ApiClient.js +133 -10
  106. package/build/esm/ApiClient.js.map +1 -1
  107. package/build/esm/Auth/Domain.js +56 -0
  108. package/build/esm/Auth/Domain.js.map +1 -0
  109. package/build/esm/Auth/ManualAuthorization.js +253 -0
  110. package/build/esm/Auth/ManualAuthorization.js.map +1 -0
  111. package/build/esm/Auth/PendingInit.js +267 -0
  112. package/build/esm/Auth/PendingInit.js.map +1 -0
  113. package/build/esm/Auth/Pkce.js +23 -0
  114. package/build/esm/Auth/Pkce.js.map +1 -0
  115. package/build/esm/Auth/SetupGrantAuthorization.js +91 -0
  116. package/build/esm/Auth/SetupGrantAuthorization.js.map +1 -0
  117. package/build/esm/Authentication.js +38 -7
  118. package/build/esm/Authentication.js.map +1 -1
  119. package/build/esm/BrowserOAuth.js +7 -10
  120. package/build/esm/BrowserOAuth.js.map +1 -1
  121. package/build/esm/CommandPath.js +31 -0
  122. package/build/esm/CommandPath.js.map +1 -0
  123. package/build/esm/Commands/Fetch.js +30 -6
  124. package/build/esm/Commands/Fetch.js.map +1 -1
  125. package/build/esm/Commands/Init.js +371 -0
  126. package/build/esm/Commands/Init.js.map +1 -0
  127. package/build/esm/Commands/Search.js +6 -3
  128. package/build/esm/Commands/Search.js.map +1 -1
  129. package/build/esm/Commands/Status.js +186 -0
  130. package/build/esm/Commands/Status.js.map +1 -0
  131. package/build/esm/Commands/Telemetry.js +23 -0
  132. package/build/esm/Commands/Telemetry.js.map +1 -0
  133. package/build/esm/Config.js +502 -28
  134. package/build/esm/Config.js.map +1 -1
  135. package/build/esm/Hook/Claude.js +1 -1
  136. package/build/esm/Hook/Claude.js.map +1 -1
  137. package/build/esm/Hook/SnapshotNote.js +54 -7
  138. package/build/esm/Hook/SnapshotNote.js.map +1 -1
  139. package/build/esm/Init/ClaudeAdapter.js +137 -0
  140. package/build/esm/Init/ClaudeAdapter.js.map +1 -0
  141. package/build/esm/Init/ClaudeProfile.js +380 -0
  142. package/build/esm/Init/ClaudeProfile.js.map +1 -0
  143. package/build/esm/Init/Domain.js +118 -0
  144. package/build/esm/Init/Domain.js.map +1 -0
  145. package/build/esm/Init/HarnessAdapter.js +21 -0
  146. package/build/esm/Init/HarnessAdapter.js.map +1 -0
  147. package/build/esm/Init/HarnessDetector.js +65 -0
  148. package/build/esm/Init/HarnessDetector.js.map +1 -0
  149. package/build/esm/Init/HarnessRegistry.js +58 -0
  150. package/build/esm/Init/HarnessRegistry.js.map +1 -0
  151. package/build/esm/Init/MutationTransaction.js +494 -0
  152. package/build/esm/Init/MutationTransaction.js.map +1 -0
  153. package/build/esm/Init/Service.js +319 -0
  154. package/build/esm/Init/Service.js.map +1 -0
  155. package/build/esm/Init/StandardAdapters.js +116 -0
  156. package/build/esm/Init/StandardAdapters.js.map +1 -0
  157. package/build/esm/Init/Status.js +215 -0
  158. package/build/esm/Init/Status.js.map +1 -0
  159. package/build/esm/Install/Claude/Hook.js +182 -50
  160. package/build/esm/Install/Claude/Hook.js.map +1 -1
  161. package/build/esm/Install/Claude/Mcp.js +56 -26
  162. package/build/esm/Install/Claude/Mcp.js.map +1 -1
  163. package/build/esm/Install/Claude/Skill.js +49 -27
  164. package/build/esm/Install/Claude/Skill.js.map +1 -1
  165. package/build/esm/Install/Codex/Mcp.js +9 -4
  166. package/build/esm/Install/Codex/Mcp.js.map +1 -1
  167. package/build/esm/Install/Codex/Skill.js +4 -1
  168. package/build/esm/Install/Codex/Skill.js.map +1 -1
  169. package/build/esm/Install/Cursor/Mcp.js +7 -4
  170. package/build/esm/Install/Cursor/Mcp.js.map +1 -1
  171. package/build/esm/Install/Cursor/Skill.js +4 -1
  172. package/build/esm/Install/Cursor/Skill.js.map +1 -1
  173. package/build/esm/Install/Domain.js +60 -3
  174. package/build/esm/Install/Domain.js.map +1 -1
  175. package/build/esm/Install/Hook.js.map +1 -1
  176. package/build/esm/Install/Mcp.js +1 -1
  177. package/build/esm/Install/Mcp.js.map +1 -1
  178. package/build/esm/Install/Opencode/Hook.js +1 -1
  179. package/build/esm/Install/Opencode/Hook.js.map +1 -1
  180. package/build/esm/Install/Opencode/Mcp.js +6 -3
  181. package/build/esm/Install/Opencode/Mcp.js.map +1 -1
  182. package/build/esm/Install/Opencode/Skill.js +4 -1
  183. package/build/esm/Install/Opencode/Skill.js.map +1 -1
  184. package/build/esm/Install/Opencode/expandai-webfetch.js +27 -9
  185. package/build/esm/Install/Skill.js.map +1 -1
  186. package/build/esm/Install/Uninstall.js +2 -2
  187. package/build/esm/Install/Uninstall.js.map +1 -1
  188. package/build/esm/MarkdownAnsi.js +142 -0
  189. package/build/esm/MarkdownAnsi.js.map +1 -0
  190. package/build/esm/Mcp/ExpandDocs.js +44 -52
  191. package/build/esm/Mcp/ExpandDocs.js.map +1 -1
  192. package/build/esm/Mcp/RequestHeaders.js.map +1 -1
  193. package/build/esm/Mcp/Server.js +2 -1
  194. package/build/esm/Mcp/Server.js.map +1 -1
  195. package/build/esm/Mcp/tools/Citations.js +109 -8
  196. package/build/esm/Mcp/tools/Citations.js.map +1 -1
  197. package/build/esm/Mcp/tools/Fetch.js +36 -12
  198. package/build/esm/Mcp/tools/Fetch.js.map +1 -1
  199. package/build/esm/SecureFile.js +36 -0
  200. package/build/esm/SecureFile.js.map +1 -0
  201. package/build/esm/Snippets.js +12 -1
  202. package/build/esm/Snippets.js.map +1 -1
  203. package/build/esm/Telemetry.js +157 -0
  204. package/build/esm/Telemetry.js.map +1 -0
  205. package/build/esm/Version.js +4 -0
  206. package/build/esm/Version.js.map +1 -0
  207. package/build/esm/Xdg.js +15 -0
  208. package/build/esm/Xdg.js.map +1 -0
  209. package/build/esm/main.js +122 -14
  210. package/build/esm/main.js.map +1 -1
  211. package/build/skills/expandai/SKILL.md +26 -3
  212. package/package.json +7 -4
  213. package/src/ApiClient.ts +206 -13
  214. package/src/Auth/Domain.ts +63 -0
  215. package/src/Auth/ManualAuthorization.ts +296 -0
  216. package/src/Auth/PendingInit.ts +338 -0
  217. package/src/Auth/Pkce.ts +26 -0
  218. package/src/Auth/SetupGrantAuthorization.ts +116 -0
  219. package/src/Authentication.ts +49 -11
  220. package/src/BrowserOAuth.ts +10 -12
  221. package/src/CommandPath.ts +30 -0
  222. package/src/Commands/Fetch.ts +42 -11
  223. package/src/Commands/Init.ts +489 -0
  224. package/src/Commands/Search.ts +8 -3
  225. package/src/Commands/Status.ts +228 -0
  226. package/src/Commands/Telemetry.ts +42 -0
  227. package/src/Config.ts +695 -50
  228. package/src/Hook/Claude.ts +1 -1
  229. package/src/Hook/SnapshotNote.ts +55 -7
  230. package/src/Init/ClaudeAdapter.ts +191 -0
  231. package/src/Init/ClaudeProfile.ts +496 -0
  232. package/src/Init/Domain.ts +153 -0
  233. package/src/Init/HarnessAdapter.ts +35 -0
  234. package/src/Init/HarnessDetector.ts +77 -0
  235. package/src/Init/HarnessRegistry.ts +87 -0
  236. package/src/Init/MutationTransaction.ts +747 -0
  237. package/src/Init/Service.ts +385 -0
  238. package/src/Init/StandardAdapters.ts +141 -0
  239. package/src/Init/Status.ts +253 -0
  240. package/src/Install/Claude/Hook.ts +234 -81
  241. package/src/Install/Claude/Mcp.ts +80 -33
  242. package/src/Install/Claude/Skill.ts +70 -37
  243. package/src/Install/Codex/Mcp.ts +14 -9
  244. package/src/Install/Codex/Skill.ts +9 -5
  245. package/src/Install/Cursor/Mcp.ts +12 -9
  246. package/src/Install/Cursor/Skill.ts +9 -5
  247. package/src/Install/Domain.ts +77 -4
  248. package/src/Install/Hook.ts +3 -3
  249. package/src/Install/Mcp.ts +6 -6
  250. package/src/Install/Opencode/Hook.ts +5 -5
  251. package/src/Install/Opencode/Mcp.ts +11 -8
  252. package/src/Install/Opencode/Skill.ts +9 -5
  253. package/src/Install/Opencode/expandai-webfetch.js +27 -9
  254. package/src/Install/Skill.ts +3 -3
  255. package/src/Install/Uninstall.ts +3 -3
  256. package/src/MarkdownAnsi.ts +162 -0
  257. package/src/Mcp/ExpandDocs.ts +46 -55
  258. package/src/Mcp/Server.ts +2 -1
  259. package/src/Mcp/tools/Citations.ts +117 -8
  260. package/src/Mcp/tools/Fetch.ts +40 -14
  261. package/src/SecureFile.ts +70 -0
  262. package/src/Snippets.ts +19 -12
  263. package/src/Telemetry.ts +186 -0
  264. package/src/Version.ts +3 -0
  265. package/src/Xdg.ts +18 -0
  266. package/src/main.ts +171 -12
  267. package/build/dts/DeviceAuth.d.ts +0 -87
  268. package/build/dts/DeviceAuth.d.ts.map +0 -1
  269. package/build/esm/DeviceAuth.js +0 -127
  270. package/build/esm/DeviceAuth.js.map +0 -1
  271. package/src/DeviceAuth.ts +0 -193
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManualAuthorization.d.ts","sourceRoot":"","sources":["../../../src/Auth/ManualAuthorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAY,MAAM,EAAkB,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAA;AAC3F,OAAO,EAAE,aAAa,EAAe,MAAM,cAAc,CAAA;AAIzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEnD,OAAO,EACN,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,GAC9B,MAAM,mBAAmB,CAAA;;;;;;;;;;;;;;;;;;;;AAO1B,qBAAa,wBAAyB,SAAQ,6BAK5C;CAAG;;;;;;;;;;;;;;;;AAEL,2EAA2E;AAC3E,qBAAa,2BAA4B,SAAQ,gCAM/C;CAAG;;;;AAEL;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,gBAAoD;CAAG;;;;;;AAExF,qBAAa,oBAAqB,SAAQ,yBAExC;CAAG;AAEL,eAAO,MAAM,0BAA0B,iEAAkD,CAAA;AACzF,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAC,IAAI,CAAA;;;;;;AAE/E,qBAAa,yBAA0B,SAAQ,8BAK9C;IACA,IAAI,OAAO,WAEV;CACD;;;;;;;;AAED;;;;;;GAMG;AACH,qBAAa,0BAA2B,SAAQ,+BAO/C;IACA,IAAI,OAAO,WAGV;CACD;;;;;;AAED,qBAAa,uCAAwC,SAAQ,4CAK5D;IACA,IAAI,OAAO,WAEV;CACD;;;;;;;;AAcD,qBAAa,mBAAoB,SAAQ,wBA8LxC;CAAG"}
@@ -0,0 +1,35 @@
1
+ import { FileSystem, Path } from '@effect/platform';
2
+ import { NodeContext } from '@effect/platform-node';
3
+ import { Effect, Option } from 'effect';
4
+ import { PendingInitCorrupt, type PendingInitKey, PendingInitRecord, PendingInitStorageError } from './Domain.js';
5
+ /** Canonical, collision-free serialization of all pending authorization key fields. */
6
+ export declare function serializePendingInitKey(key: PendingInitKey): string;
7
+ declare const PendingInitStore_base: Effect.Service.Class<PendingInitStore, "@expandai/cli/Auth/PendingInitStore", {
8
+ readonly dependencies: readonly [import("effect/Layer").Layer<NodeContext.NodeContext, never, never>];
9
+ readonly effect: Effect.Effect<{
10
+ readonly pendingPath: string;
11
+ readonly get: (key: {
12
+ readonly apiOrigin: string;
13
+ readonly clientId: "expandai-cli-browser";
14
+ readonly harness: "agent-harnesses";
15
+ readonly scope: "global" | "project";
16
+ readonly canonicalScopeRoot: string;
17
+ }) => Effect.Effect<Option.Option<PendingInitRecord>, PendingInitCorrupt | PendingInitStorageError, never>;
18
+ readonly peek: (key: {
19
+ readonly apiOrigin: string;
20
+ readonly clientId: "expandai-cli-browser";
21
+ readonly harness: "agent-harnesses";
22
+ readonly scope: "global" | "project";
23
+ readonly canonicalScopeRoot: string;
24
+ }) => Effect.Effect<Option.Option<PendingInitRecord>, PendingInitCorrupt | PendingInitStorageError, never>;
25
+ readonly putIfAbsent: (record: PendingInitRecord) => Effect.Effect<PendingInitRecord, PendingInitCorrupt | PendingInitStorageError, never>;
26
+ readonly replaceIfMatch: (previous: PendingInitRecord, next: PendingInitRecord) => Effect.Effect<boolean, PendingInitCorrupt | PendingInitStorageError, never>;
27
+ readonly removeIfMatch: (record: PendingInitRecord) => Effect.Effect<boolean, PendingInitCorrupt | PendingInitStorageError, never>;
28
+ readonly pruneExpired: () => Effect.Effect<number, PendingInitStorageError, never>;
29
+ readonly canonicalScopeRoot: (scope: "global" | "project", cwd?: any) => Effect.Effect<string, PendingInitStorageError, never>;
30
+ }, import("effect/ConfigError").ConfigError, FileSystem.FileSystem | Path.Path>;
31
+ }>;
32
+ export declare class PendingInitStore extends PendingInitStore_base {
33
+ }
34
+ export {};
35
+ //# sourceMappingURL=PendingInit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PendingInit.d.ts","sourceRoot":"","sources":["../../../src/Auth/PendingInit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAA0B,MAAM,kBAAkB,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAY,MAAM,EAAU,MAAM,EAAU,MAAM,QAAQ,CAAA;AAEjE,OAAO,EAEN,kBAAkB,EAClB,KAAK,cAAc,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,MAAM,aAAa,CAAA;AA0BpB,uFAAuF;AACvF,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAQnE;;;;;;;;;;;;;;;;;;;;;;;;;;AAOD,qBAAa,gBAAiB,SAAQ,qBA4RpC;CAAG"}
@@ -0,0 +1,10 @@
1
+ import { Redacted } from 'effect';
2
+ /** PKCE code verifier. Redacted so it cannot reach a log or a JSON result. */
3
+ export declare function createCodeVerifier(): Redacted.Redacted<string>;
4
+ export declare function codeChallengeFor(verifier: Redacted.Redacted<string>): string;
5
+ /**
6
+ * Opaque high-entropy value for non-PKCE uses such as the OAuth `state`
7
+ * parameter. Same entropy and encoding, different purpose.
8
+ */
9
+ export declare function createHighEntropySecret(): string;
10
+ //# sourceMappingURL=Pkce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pkce.d.ts","sourceRoot":"","sources":["../../../src/Auth/Pkce.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AASjC,8EAA8E;AAC9E,wBAAgB,kBAAkB,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAE9D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,CAE5E;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD"}
@@ -0,0 +1,34 @@
1
+ import { Effect, Redacted, Schema } from 'effect';
2
+ import { ConfigManager } from '../Config.js';
3
+ import { ManualAuthorization } from './ManualAuthorization.js';
4
+ interface SetupGrantAuthorizationInput {
5
+ readonly setupToken: Redacted.Redacted<string>;
6
+ readonly harness: 'agent-harnesses';
7
+ readonly scope: 'project' | 'global';
8
+ }
9
+ declare const SetupGrantAuthorizationError_base: Schema.TaggedErrorClass<SetupGrantAuthorizationError, "SetupGrantAuthorizationError", {
10
+ readonly _tag: Schema.tag<"SetupGrantAuthorizationError">;
11
+ } & {
12
+ code: Schema.Literal<["invalid_or_expired", "stored_credential_conflict", "request_failed", "denied", "credential_save_failed", "refused", "config_unreadable"]>;
13
+ recoverable: typeof Schema.Boolean;
14
+ }>;
15
+ export declare class SetupGrantAuthorizationError extends SetupGrantAuthorizationError_base {
16
+ get message(): "An Expand API key is already stored on this machine, and completing this setup would replace it with no way to recover it. Nothing was changed and your setup prompt is still valid. Run `expandai logout` to clear the stored key, then run this setup command again." | "Could not reach Expand to redeem the setup token. Nothing was sent, so the same token is still good — check the network and try again." | "Expand refused to redeem this setup token for a reason a fresh prompt cannot fix — most likely an OAuth client, resource, or scope misconfiguration on the server. Do not request another prompt; report this." | "The Expand config file on this machine could not be read, so setup cannot tell whether completing it would overwrite an existing API key. Nothing was redeemed and your setup prompt is still valid. Run `expandai whoami` to see which file it is, fix or delete it, then run this setup command again." | "The setup token is invalid, expired, or already used. Copy a fresh setup prompt from the Expand dashboard." | "The setup token was redeemed, but the credentials could not be saved on this machine. Fix credential storage — run `expandai whoami` to see the path it uses, and check its permissions — then copy a fresh setup prompt from the Expand dashboard." | "This setup authorization was denied. Copy a fresh setup prompt from the Expand dashboard.";
17
+ }
18
+ declare const SetupGrantAuthorization_base: Effect.Service.Class<SetupGrantAuthorization, "@expandai/cli/Auth/SetupGrantAuthorization", {
19
+ readonly dependencies: readonly [import("effect/Layer").Layer<ConfigManager, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<ManualAuthorization, import("effect/ConfigError").ConfigError, never>];
20
+ readonly effect: Effect.Effect<{
21
+ readonly authorize: (input: SetupGrantAuthorizationInput) => Effect.Effect<undefined, SetupGrantAuthorizationError, never>;
22
+ }, never, ConfigManager | ManualAuthorization>;
23
+ }>;
24
+ /**
25
+ * Dashboard-minted setup: the "token" in the prompt is a pre-approved RFC 8628
26
+ * device code, already bound to the minting user and pinned to their
27
+ * organization server-side. Redeeming is a single poll of the OAuth token
28
+ * endpoint — better-auth owns generation, expiry and the single-use burn, so
29
+ * there is no redemption protocol of ours left to get wrong.
30
+ */
31
+ export declare class SetupGrantAuthorization extends SetupGrantAuthorization_base {
32
+ }
33
+ export {};
34
+ //# sourceMappingURL=SetupGrantAuthorization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetupGrantAuthorization.d.ts","sourceRoot":"","sources":["../../../src/Auth/SetupGrantAuthorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EACN,mBAAmB,EAInB,MAAM,0BAA0B,CAAA;AAEjC,UAAU,4BAA4B;IACrC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC9C,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,QAAQ,CAAA;CACpC;;;;;;;AAED,qBAAa,4BAA6B,SAAQ,iCAcjD;IACA,IAAI,OAAO,61CAyBV;CACD;;;;;;;AASD;;;;;;GAMG;AACH,qBAAa,uBAAwB,SAAQ,4BA2C5C;CAAG"}
@@ -1,23 +1,24 @@
1
1
  import { Command } from '@effect/cli';
2
2
  import { Effect } from 'effect';
3
3
  import { BrowserOAuthService } from './BrowserOAuth.js';
4
- import { ApiKeyConfig, ConfigManager, OAuthConfig } from './Config.js';
4
+ import { type AuthMethod, ConfigManager } from './Config.js';
5
+ export { type AuthMethodState, authMethodState, isAuthMethodLocallyUsable } from './Config.js';
5
6
  import { Uninstall } from './Install/Uninstall.js';
6
- type AuthMethod = typeof ApiKeyConfig.Type | typeof OAuthConfig.Type;
7
7
  /** Render a user-facing description of the current auth state. Pure given DateTime.now. */
8
8
  export declare const formatAuthStatus: (authMethod: AuthMethod) => Effect.Effect<string, never, never>;
9
9
  declare const Authentication_base: Effect.Service.Class<Authentication, "@expandai/cli/Authentication", {
10
- readonly dependencies: readonly [import("effect/Layer").Layer<ConfigManager, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<BrowserOAuthService, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<Uninstall, import("effect/ConfigError").ConfigError | import("@effect/platform/Error").BadArgument, never>];
10
+ readonly dependencies: readonly [import("effect/Layer").Layer<ConfigManager, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<BrowserOAuthService, import("effect/ConfigError").ConfigError, never>, import("effect/Layer").Layer<Uninstall, import("@effect/platform/Error").BadArgument | import("effect/ConfigError").ConfigError, never>];
11
11
  readonly effect: Effect.Effect<{
12
+ readonly hasLocallyUsableCredentials: () => Effect.Effect<boolean, import("./Config.js").ConfigParseError | import("./Config.js").CredentialStoreInsecure | import("effect/ConfigError").ConfigError | import("@effect/platform/Error").PlatformError, never>;
13
+ readonly loginWithBrowser: () => Effect.Effect<void, unknown, never>;
12
14
  readonly login: () => Effect.Effect<void, unknown, import("@effect/platform/Terminal").Terminal>;
13
- readonly whoami: () => Effect.Effect<void, import("./Config.js").ConfigParseError | import("./Config.js").NotAuthenticated | import("effect/ConfigError").ConfigError | import("@effect/platform/Error").PlatformError, never>;
14
- readonly logout: () => Effect.Effect<void, import("effect/ParseResult").ParseError | import("./Config.js").ConfigNotWritable | import("@effect/platform/Error").PlatformError | import("./Install/Domain.js").McpParseError | import("./Install/Domain.js").McpWriteError | import("@effect/platform/Terminal").QuitException, import("@effect/platform/Terminal").Terminal>;
15
- }, never, ConfigManager | BrowserOAuthService | Uninstall>;
15
+ readonly whoami: () => Effect.Effect<void, import("./Config.js").ConfigParseError | import("./Config.js").CredentialStoreInsecure | import("./Config.js").NotAuthenticated | import("effect/ConfigError").ConfigError | import("@effect/platform/Error").PlatformError, never>;
16
+ readonly logout: () => Effect.Effect<void, import("./Config.js").ConfigCleanupError | import("./Config.js").ConfigNotWritable | import("./Config.js").CredentialStoreInsecure | import("./Install/Domain.js").McpParseError | import("./Install/Domain.js").McpWriteError | import("effect/ParseResult").ParseError | import("@effect/platform/Terminal").QuitException | import("@effect/platform/Error").PlatformError, import("@effect/platform/Terminal").Terminal>;
17
+ }, never, BrowserOAuthService | ConfigManager | Uninstall>;
16
18
  }>;
17
19
  export declare class Authentication extends Authentication_base {
18
20
  }
19
21
  export declare const LoginCommand: Command.Command<"login", Authentication | import("@effect/platform/Terminal").Terminal, unknown, {}>;
20
- export declare const WhoamiCommand: Command.Command<"whoami", Authentication, import("./Config.js").ConfigParseError | import("./Config.js").NotAuthenticated | import("effect/ConfigError").ConfigError | import("@effect/platform/Error").PlatformError, {}>;
21
- export declare const LogoutCommand: Command.Command<"logout", Authentication | import("@effect/platform/Terminal").Terminal, import("effect/ParseResult").ParseError | import("./Config.js").ConfigNotWritable | import("@effect/platform/Error").PlatformError | import("./Install/Domain.js").McpParseError | import("./Install/Domain.js").McpWriteError | import("@effect/platform/Terminal").QuitException, {}>;
22
- export {};
22
+ export declare const WhoamiCommand: Command.Command<"whoami", Authentication, import("./Config.js").ConfigParseError | import("./Config.js").CredentialStoreInsecure | import("./Config.js").NotAuthenticated | import("effect/ConfigError").ConfigError | import("@effect/platform/Error").PlatformError, {}>;
23
+ export declare const LogoutCommand: Command.Command<"logout", Authentication | import("@effect/platform/Terminal").Terminal, import("./Config.js").ConfigCleanupError | import("./Config.js").ConfigNotWritable | import("./Config.js").CredentialStoreInsecure | import("./Install/Domain.js").McpParseError | import("./Install/Domain.js").McpWriteError | import("effect/ParseResult").ParseError | import("@effect/platform/Terminal").QuitException | import("@effect/platform/Error").PlatformError, {}>;
23
24
  //# sourceMappingURL=Authentication.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Authentication.d.ts","sourceRoot":"","sources":["../../src/Authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,aAAa,CAAA;AAC7C,OAAO,EAA+B,MAAM,EAAiC,MAAM,QAAQ,CAAA;AAE3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAU,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,KAAK,UAAU,GAAG,OAAO,YAAY,CAAC,IAAI,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEpE,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,iEAe3B,CAAA;;;;;;;;;AAEF,qBAAa,cAAe,SAAQ,mBAyHlC;CAAG;AAEL,eAAO,MAAM,YAAY,sGAGxB,CAAA;AAED,eAAO,MAAM,aAAa,4NAGzB,CAAA;AAED,eAAO,MAAM,aAAa,kXAGzB,CAAA"}
1
+ {"version":3,"file":"Authentication.d.ts","sourceRoot":"","sources":["../../src/Authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,aAAa,CAAA;AAC7C,OAAO,EAA+B,MAAM,EAAiC,MAAM,QAAQ,CAAA;AAE3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EAAwB,KAAK,UAAU,EAAE,aAAa,EAA6B,MAAM,aAAa,CAAA;AAI7G,OAAO,EAAE,KAAK,eAAe,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE9F,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAElD,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,iEAe3B,CAAA;;;;;;;;;;;AAEF,qBAAa,cAAe,SAAQ,mBA4JlC;CAAG;AAEL,eAAO,MAAM,YAAY,sGAGxB,CAAA;AAED,eAAO,MAAM,aAAa,4QAGzB,CAAA;AAED,eAAO,MAAM,aAAa,6cAGzB,CAAA"}
@@ -14,15 +14,15 @@ declare const TokenResponse_base: Schema.Class<TokenResponse, {
14
14
  token_type: typeof Schema.String;
15
15
  scope: Schema.optional<typeof Schema.String>;
16
16
  }>, never, {
17
+ readonly refresh_token?: string | undefined;
18
+ } & {
19
+ readonly scope?: string | undefined;
20
+ } & {
17
21
  readonly access_token: string;
18
22
  } & {
19
23
  readonly expires_in: Duration.Duration;
20
24
  } & {
21
25
  readonly token_type: string;
22
- } & {
23
- readonly refresh_token?: string | undefined;
24
- } & {
25
- readonly scope?: string | undefined;
26
26
  }, {}, {}>;
27
27
  export declare class TokenResponse extends TokenResponse_base {
28
28
  }
@@ -87,11 +87,11 @@ export declare const buildAuthorizeUrl: (args_0: AuthorizeUrlInput) => Effect.Ef
87
87
  declare const BrowserOAuthService_base: Effect.Service.Class<BrowserOAuthService, "@expandai/cli/BrowserOAuthService", {
88
88
  readonly dependencies: readonly [import("effect/Layer").Layer<HttpClient.HttpClient, never, never>, import("effect/Layer").Layer<ConfigManager, import("effect/ConfigError").ConfigError, never>];
89
89
  readonly effect: Effect.Effect<{
90
- readonly exchangeCode: (args_0: ExchangeCodeInput) => Effect.Effect<TokenResponse, import("./Config.js").ConfigParseError | import("effect/ConfigError").ConfigError | import("@effect/platform/Error").PlatformError | BrowserOAuthRequestFailed, never>;
91
- readonly refreshToken: (refreshToken: string) => Effect.Effect<TokenResponse, import("./Config.js").ConfigParseError | import("effect/ConfigError").ConfigError | import("@effect/platform/Error").PlatformError | BrowserOAuthRequestFailed, never>;
92
- readonly saveToken: (tokenResponse: TokenResponse) => Effect.Effect<void, import("effect/ParseResult").ParseError | import("./Config.js").ConfigNotWritable, never>;
90
+ readonly exchangeCode: (args_0: ExchangeCodeInput) => Effect.Effect<TokenResponse, BrowserOAuthRequestFailed | import("./Config.js").ConfigParseError | import("./Config.js").CredentialStoreInsecure | import("effect/ConfigError").ConfigError | import("@effect/platform/Error").PlatformError, never>;
91
+ readonly refreshToken: (refreshToken: string, clientId?: string | undefined) => Effect.Effect<TokenResponse, BrowserOAuthRequestFailed | import("./Config.js").ConfigParseError | import("./Config.js").CredentialStoreInsecure | import("effect/ConfigError").ConfigError | import("@effect/platform/Error").PlatformError, never>;
92
+ readonly saveToken: (tokenResponse: TokenResponse) => Effect.Effect<void, import("./Config.js").ConfigCleanupError | import("./Config.js").ConfigNotWritable | import("./Config.js").ConfigParseError | import("./Config.js").CredentialStoreInsecure | import("effect/ParseResult").ParseError | import("@effect/platform/Error").PlatformError, never>;
93
93
  readonly login: <R>(openAuthorizeUrl: (authorizeUrl: URL) => Effect.Effect<void, unknown, R>) => Effect.Effect<undefined, unknown, R>;
94
- }, never, HttpClient.HttpClient | ConfigManager>;
94
+ }, never, ConfigManager | HttpClient.HttpClient>;
95
95
  }>;
96
96
  export declare class BrowserOAuthService extends BrowserOAuthService_base {
97
97
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BrowserOAuth.d.ts","sourceRoot":"","sources":["../../src/BrowserOAuth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAyC,MAAM,kBAAkB,CAAA;AAEpF,OAAO,EAAY,QAAQ,EAAE,MAAM,EAAyB,MAAM,EAAE,MAAM,QAAQ,CAAA;AAClF,OAAO,EAAE,aAAa,EAAe,MAAM,aAAa,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AAexD,qBAAa,aAAc,SAAQ,kBAMjC;CAAG;;;;;;;;AAEL,qBAAa,yBAA0B,SAAQ,8BAO9C;IACA,IAAI,OAAO,WAEV;CACD;;;;;;;AAED,qBAAa,yBAA0B,SAAQ,8BAM9C;IACA,IAAI,OAAO,WAEV;CACD;;;;AAED,qBAAa,uBAAwB,SAAQ,4BAG5C;IACA,IAAI,OAAO,WAEV;CACD;;;;AAED,qBAAa,yBAA0B,SAAQ,8BAG9C;IACA,IAAI,OAAO,WAEV;CACD;;;;;;AAED,qBAAa,0BAA2B,SAAQ,+BAK/C;IACA,IAAI,OAAO,WAEV;CACD;;;;AAED,qBAAa,oBAAqB,SAAQ,yBAAsE;IAC/G,IAAI,OAAO,WAEV;CACD;AAID,UAAU,iBAAiB;IAC1B,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAA;IACpB,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC9B;AAED,UAAU,iBAAiB;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAA;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC7B;AAgBD,eAAO,MAAM,mBAAmB,+DAE9B,CAAA;AAEF,eAAO,MAAM,iBAAiB,iEAe5B,CAAA;;;;;;;yBA6LgE,CAAC,mCAC/B,GAAG,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;;;AAhF3E,qBAAa,mBAAoB,SAAQ,wBAkHvC;CAAG"}
1
+ {"version":3,"file":"BrowserOAuth.d.ts","sourceRoot":"","sources":["../../src/BrowserOAuth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAyC,MAAM,kBAAkB,CAAA;AAEpF,OAAO,EAAY,QAAQ,EAAE,MAAM,EAAyB,MAAM,EAAE,MAAM,QAAQ,CAAA;AAElF,OAAO,EAAE,aAAa,EAAe,MAAM,aAAa,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AAexD,qBAAa,aAAc,SAAQ,kBAMjC;CAAG;;;;;;;;AAEL,qBAAa,yBAA0B,SAAQ,8BAO9C;IACA,IAAI,OAAO,WAEV;CACD;;;;;;;AAED,qBAAa,yBAA0B,SAAQ,8BAM9C;IACA,IAAI,OAAO,WAEV;CACD;;;;AAED,qBAAa,uBAAwB,SAAQ,4BAG5C;IACA,IAAI,OAAO,WAEV;CACD;;;;AAED,qBAAa,yBAA0B,SAAQ,8BAG9C;IACA,IAAI,OAAO,WAEV;CACD;;;;;;AAED,qBAAa,0BAA2B,SAAQ,+BAK/C;IACA,IAAI,OAAO,WAEV;CACD;;;;AAED,qBAAa,oBAAqB,SAAQ,yBAAsE;IAC/G,IAAI,OAAO,WAEV;CACD;AAID,UAAU,iBAAiB;IAC1B,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAA;IACpB,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC9B;AAED,UAAU,iBAAiB;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAA;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC7B;AAQD,eAAO,MAAM,mBAAmB,+DAE9B,CAAA;AAEF,eAAO,MAAM,iBAAiB,iEAe5B,CAAA;;;;;;;yBAkMgE,CAAC,mCAC/B,GAAG,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;;;AArF3E,qBAAa,mBAAoB,SAAQ,wBAwHvC;CAAG"}
@@ -0,0 +1,2 @@
1
+ export declare function commandFromArgv(argv: readonly string[]): string;
2
+ //# sourceMappingURL=CommandPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPath.d.ts","sourceRoot":"","sources":["../../src/CommandPath.ts"],"names":[],"mappings":"AAwBA,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAK/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"Fetch.d.ts","sourceRoot":"","sources":["../../../src/Commands/Fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,OAAO,EAAW,MAAM,aAAa,CAAA;AAE7D,OAAO,EAAW,MAAM,EAAS,MAAM,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;;;;;;AAIvE,qBAAa,mBAAoB,SAAQ,wBAEvC;IACD,IAAI,OAAO,WAEV;CACD;;;;;;;AAED,qBAAa,mBAAoB,SAAQ,wBAGvC;IACD,IAAI,OAAO,WAEV;CACD;AAaD,eAAO,MAAM,WAAW,6DAatB,CAAA;AAmCF,UAAU,kBAAkB;IAC3B,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;IACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CACzB;AAED,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,CAkErF,CAAA"}
1
+ {"version":3,"file":"Fetch.d.ts","sourceRoot":"","sources":["../../../src/Commands/Fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,OAAO,EAAW,MAAM,aAAa,CAAA;AAE7D,OAAO,EAAW,MAAM,EAAS,MAAM,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;;;;;;AAMvE,qBAAa,mBAAoB,SAAQ,wBAEvC;IACD,IAAI,OAAO,WAEV;CACD;;;;;;;AAED,qBAAa,mBAAoB,SAAQ,wBAGvC;IACD,IAAI,OAAO,WAEV;CACD;AAaD,eAAO,MAAM,WAAW,6DAatB,CAAA;AAmCF,UAAU,kBAAkB;IAC3B,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;IACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CACzB;AAED,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,CA+FrF,CAAA"}
@@ -2,14 +2,14 @@ import { Command } from '@effect/cli';
2
2
  import { ClaudeHook } from '../Hook/Claude.js';
3
3
  import { OpencodeHook } from '../Hook/Opencode.js';
4
4
  import { HookInstaller } from '../Install/Hook.js';
5
- export declare const HumanHookCommand: Command.Command<"hook", HookInstaller | ClaudeHook | OpencodeHook, import("effect/ParseResult").ParseError | import("@effect/platform/Error").PlatformError | import("../Install/Domain.js").McpParseError | import("../Install/Domain.js").McpWriteError | import("../Hook/Errors.js").HookProtocolFailed, {
6
- readonly subcommand: import("effect/Option").Option<{} | {
5
+ export declare const HumanHookCommand: Command.Command<"hook", ClaudeHook | HookInstaller | OpencodeHook, import("../Hook/Errors.js").HookProtocolFailed | import("../Install/Domain.js").McpParseError | import("../Install/Domain.js").McpWriteError | import("effect/ParseResult").ParseError | import("@effect/platform/Error").PlatformError, {
6
+ readonly subcommand: import("effect/Option").Option<{
7
7
  readonly host: "claude-code" | "opencode";
8
- readonly scope: "project" | "global";
8
+ readonly scope: "global" | "project";
9
9
  } | {
10
10
  readonly host: "claude-code" | "opencode";
11
- readonly scope: "project" | "global";
12
- }>;
11
+ readonly scope: "global" | "project";
12
+ } | {}>;
13
13
  }>;
14
14
  export declare const AgentHookCommand: Command.Command<"hook", ClaudeHook | OpencodeHook, import("../Hook/Errors.js").HookProtocolFailed, {
15
15
  readonly subcommand: import("effect/Option").Option<{}>;
@@ -0,0 +1,55 @@
1
+ import { Command } from '@effect/cli';
2
+ import { Terminal } from '@effect/platform';
3
+ import { Effect, Option } from 'effect';
4
+ import { Authentication } from '../Authentication.js';
5
+ import { type InitHarnesses } from '../Init/Domain.js';
6
+ import { HarnessDetector } from '../Init/HarnessDetector.js';
7
+ import { InitService } from '../Init/Service.js';
8
+ export declare const SUPPORTED_HARNESS_LIST = "claude-code, cursor, opencode, codex";
9
+ /**
10
+ * Says that the *harness itself* is unsupported, rather than that the flag was
11
+ * malformed. An agent told only "invalid arguments" alongside a list of four
12
+ * valid names will pick one of them and misreport the user's environment.
13
+ */
14
+ export declare const UNSUPPORTED_HARNESS_MESSAGE = "Expand does not support that agent harness. Supported harnesses are claude-code, cursor, opencode, codex. Do not substitute a different harness: tell the user their agent is not supported yet.";
15
+ export interface InitCommandOptions {
16
+ readonly detect: boolean;
17
+ readonly harness: Option.Option<string>;
18
+ readonly harnesses: Option.Option<string>;
19
+ readonly json: boolean;
20
+ readonly scope: Option.Option<string>;
21
+ readonly setupToken: Option.Option<string>;
22
+ }
23
+ /**
24
+ * Decodes `--harnesses claude-code,cursor`. Returns `undefined` for any
25
+ * unknown or empty entry: silently dropping one would configure less than the
26
+ * user asked for, which is the failure mode this flag exists to prevent.
27
+ */
28
+ export declare function parseHarnessSelection(value: string): InitHarnesses | undefined;
29
+ export interface OnboardingExecutionModeInput {
30
+ readonly argv: readonly string[];
31
+ readonly environment: Readonly<Record<string, string | undefined>>;
32
+ readonly stdinIsTty: boolean;
33
+ readonly stdoutIsTty: boolean;
34
+ }
35
+ export interface InitExecutionModeInput extends OnboardingExecutionModeInput {
36
+ }
37
+ /** Selects a safe onboarding surface before either CLI tree parses the command. */
38
+ export declare function resolveOnboardingExecutionMode(input: OnboardingExecutionModeInput, command: 'init' | 'status'): 'human' | 'machine' | undefined;
39
+ /** Selects the safe init surface before either CLI tree parses the command. */
40
+ export declare function resolveInitExecutionMode(input: InitExecutionModeInput): 'human' | 'machine' | undefined;
41
+ /** Returns a safe JSON error before Effect CLI can render ordinary parser help. */
42
+ export declare function preflightAgentInitArgv(argv: readonly string[]): string | undefined;
43
+ declare const InitTerminalInteraction_base: Effect.Service.Class<InitTerminalInteraction, "@expandai/cli/Commands/InitTerminalInteraction", {
44
+ readonly effect: Effect.Effect<{
45
+ readonly chooseScope: () => Effect.Effect<"global" | "project", Terminal.QuitException, never>;
46
+ readonly chooseHarnesses: (detected: readonly ("claude-code" | "codex" | "cursor" | "opencode")[]) => Effect.Effect<("claude-code" | "codex" | "cursor" | "opencode")[], Terminal.QuitException, never>;
47
+ }, never, Terminal.Terminal>;
48
+ }>;
49
+ export declare class InitTerminalInteraction extends InitTerminalInteraction_base {
50
+ }
51
+ export declare const runHumanInit: (options: InitCommandOptions) => Effect.Effect<void, Terminal.QuitException, Authentication | HarnessDetector | InitService | InitTerminalInteraction>;
52
+ export declare const HumanInitCommand: Command.Command<"init", Authentication | HarnessDetector | InitService | InitTerminalInteraction, Terminal.QuitException, InitCommandOptions>;
53
+ export declare const AgentInitCommand: Command.Command<"init", HarnessDetector | InitService, never, InitCommandOptions>;
54
+ export {};
55
+ //# sourceMappingURL=Init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Init.d.ts","sourceRoot":"","sources":["../../../src/Commands/Init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAmB,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAkB,MAAM,EAAU,MAAM,EAAU,MAAM,QAAQ,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAKN,KAAK,aAAa,EAKlB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAoB,MAAM,oBAAoB,CAAA;AAkClE,eAAO,MAAM,sBAAsB,yCAAyC,CAAA;AAE5E;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,qMAA0L,CAAA;AAiClO,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACzC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;CAC1C;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAS9E;AAED,MAAM,WAAW,4BAA4B;IAC5C,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAA;IAClE,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;CAC7B;AAED,MAAM,WAAW,sBAAuB,SAAQ,4BAA4B;CAAG;AAM/E,mFAAmF;AACnF,wBAAgB,8BAA8B,CAC7C,KAAK,EAAE,4BAA4B,EACnC,OAAO,EAAE,MAAM,GAAG,QAAQ,GACxB,OAAO,GAAG,SAAS,GAAG,SAAS,CAUjC;AAED,+EAA+E;AAC/E,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAEvG;AAyCD,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAsBlF;;;;;;;AA0HD,qBAAa,uBAAwB,SAAQ,4BA+B5C;CAAG;AA0BJ,eAAO,MAAM,YAAY,wJAsFvB,CAAA;AAIF,eAAO,MAAM,gBAAgB,+IAG5B,CAAA;AAED,eAAO,MAAM,gBAAgB,mFAG5B,CAAA"}
@@ -1,11 +1,11 @@
1
1
  import { Command } from '@effect/cli';
2
2
  import { Mcp } from '../Install/Mcp.js';
3
- export declare const InstallSubCommand: Command.Command<"install", Mcp, import("@effect/platform/Error").PlatformError | import("../Install/Domain.js").McpParseError | import("../Install/Domain.js").McpWriteError, {
4
- readonly host: "claude-code" | "cursor" | "opencode" | "codex";
5
- readonly scope: "project" | "global";
3
+ export declare const InstallSubCommand: Command.Command<"install", Mcp, import("../Install/Domain.js").McpParseError | import("../Install/Domain.js").McpWriteError | import("@effect/platform/Error").PlatformError, {
4
+ readonly host: "claude-code" | "codex" | "cursor" | "opencode";
5
+ readonly scope: "global" | "project";
6
6
  }>;
7
- export declare const UninstallSubCommand: Command.Command<"uninstall", Mcp, import("@effect/platform/Error").PlatformError | import("../Install/Domain.js").McpParseError | import("../Install/Domain.js").McpWriteError, {
8
- readonly host: "claude-code" | "cursor" | "opencode" | "codex";
9
- readonly scope: "project" | "global";
7
+ export declare const UninstallSubCommand: Command.Command<"uninstall", Mcp, import("../Install/Domain.js").McpParseError | import("../Install/Domain.js").McpWriteError | import("@effect/platform/Error").PlatformError, {
8
+ readonly host: "claude-code" | "codex" | "cursor" | "opencode";
9
+ readonly scope: "global" | "project";
10
10
  }>;
11
11
  //# sourceMappingURL=Mcp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../src/Commands/Search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAW,MAAM,aAAa,CAAA;AACpD,OAAO,EAAiC,MAAM,EAAE,MAAM,QAAQ,CAAA;;;;;;;AAK9D,qBAAa,2BAA4B,SAAQ,gCAMhD;IACA,IAAI,OAAO,WAEV;CACD;AAkCD,UAAU,mBAAmB;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CACzB;AAED,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,mBAAmB,CAiCxF,CAAA"}
1
+ {"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../../src/Commands/Search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAW,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAiC,MAAM,EAAE,MAAM,QAAQ,CAAA;;;;;;;AAM9D,qBAAa,2BAA4B,SAAQ,gCAMhD;IACA,IAAI,OAAO,WAEV;CACD;AAkCD,UAAU,mBAAmB;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CACzB;AAED,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,mBAAmB,CAoCxF,CAAA"}
@@ -2,11 +2,11 @@ import { Command } from '@effect/cli';
2
2
  import { Skill } from '../Install/Skill.js';
3
3
  export declare const SkillCommand: Command.Command<"skill", Skill, import("@effect/platform/Error").PlatformError, {
4
4
  readonly subcommand: import("effect/Option").Option<{
5
- readonly host: "claude-code" | "cursor" | "opencode" | "codex";
6
- readonly scope: "project" | "global";
5
+ readonly host: "claude-code" | "codex" | "cursor" | "opencode";
6
+ readonly scope: "global" | "project";
7
7
  } | {
8
- readonly host: "claude-code" | "cursor" | "opencode" | "codex";
9
- readonly scope: "project" | "global";
8
+ readonly host: "claude-code" | "codex" | "cursor" | "opencode";
9
+ readonly scope: "global" | "project";
10
10
  }>;
11
11
  }>;
12
12
  //# sourceMappingURL=Skill.d.ts.map
@@ -0,0 +1,27 @@
1
+ import { Command } from '@effect/cli';
2
+ import { Terminal } from '@effect/platform';
3
+ import { Effect, Option } from 'effect';
4
+ import { StatusService } from '../Init/Status.js';
5
+ import { type OnboardingExecutionModeInput } from './Init.js';
6
+ export interface StatusCommandOptions {
7
+ readonly harness: Option.Option<string>;
8
+ readonly json: boolean;
9
+ readonly scope: Option.Option<string>;
10
+ }
11
+ /** Selects the status surface using the same machine-safety precedence as init. */
12
+ export declare function resolveStatusExecutionMode(input: OnboardingExecutionModeInput): 'human' | 'machine' | undefined;
13
+ /** Returns safe JSON before Effect CLI can render parser help or acquire services. */
14
+ export declare function preflightAgentStatusArgv(argv: readonly string[]): string | undefined;
15
+ declare const StatusTerminalInteraction_base: Effect.Service.Class<StatusTerminalInteraction, "@expandai/cli/Commands/StatusTerminalInteraction", {
16
+ readonly effect: Effect.Effect<{
17
+ readonly chooseHarness: () => Effect.Effect<"claude-code" | "codex" | "cursor" | "opencode", Terminal.QuitException, never>;
18
+ readonly chooseScope: () => Effect.Effect<"global" | "project", Terminal.QuitException, never>;
19
+ }, never, Terminal.Terminal>;
20
+ }>;
21
+ export declare class StatusTerminalInteraction extends StatusTerminalInteraction_base {
22
+ }
23
+ export declare const runHumanStatus: (options: StatusCommandOptions) => Effect.Effect<void, Terminal.QuitException, StatusService | StatusTerminalInteraction>;
24
+ export declare const HumanStatusCommand: Command.Command<"status", StatusService | StatusTerminalInteraction, Terminal.QuitException, StatusCommandOptions>;
25
+ export declare const AgentStatusCommand: Command.Command<"status", StatusService, never, StatusCommandOptions>;
26
+ export {};
27
+ //# sourceMappingURL=Status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../../src/Commands/Status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAmB,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAW,MAAM,EAA4B,MAAM,EAAU,MAAM,QAAQ,CAAA;AAElF,OAAO,EAA+B,aAAa,EAAsB,MAAM,mBAAmB,CAAA;AAClG,OAAO,EAAE,KAAK,4BAA4B,EAAkC,MAAM,WAAW,CAAA;AA4B7F,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACvC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;CACrC;AAED,mFAAmF;AACnF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,4BAA4B,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAE/G;AAsBD,sFAAsF;AACtF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAapF;;;;;;;AAuFD,qBAAa,yBAA0B,SAAQ,8BA6B9C;CAAG;AAEJ,eAAO,MAAM,cAAc,2HAmBzB,CAAA;AAIF,eAAO,MAAM,kBAAkB,oHAG9B,CAAA;AAED,eAAO,MAAM,kBAAkB,uEAG9B,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { Command } from '@effect/cli';
2
+ import { ConfigManager } from '../Config.js';
3
+ import { Telemetry } from '../Telemetry.js';
4
+ export declare const TelemetryCommand: Command.Command<"telemetry", ConfigManager | Telemetry, import("../Config.js").ConfigCleanupError | import("../Config.js").ConfigNotWritable | import("../Config.js").ConfigParseError | import("../Config.js").CredentialStoreInsecure | import("effect/ParseResult").ParseError | import("@effect/platform/Error").PlatformError, {
5
+ readonly subcommand: import("effect/Option").Option<{}>;
6
+ }>;
7
+ //# sourceMappingURL=Telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Telemetry.d.ts","sourceRoot":"","sources":["../../../src/Commands/Telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAmC3C,eAAO,MAAM,gBAAgB;;EAG5B,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import { Command } from '@effect/cli';
2
2
  import { Option } from 'effect';
3
3
  import { Uninstall } from '../Install/Uninstall.js';
4
- export declare const UninstallCommand: Command.Command<"uninstall", Uninstall, import("effect/ParseResult").ParseError | import("@effect/platform/Error").PlatformError | import("../Install/Domain.js").McpParseError | import("../Install/Domain.js").McpWriteError, {
5
- readonly target: Option.Option<"mcp" | "all" | "hook" | "skill">;
6
- readonly host: Option.Option<"claude-code" | "cursor" | "opencode" | "codex">;
7
- readonly scope: Option.Option<"project" | "global">;
4
+ export declare const UninstallCommand: Command.Command<"uninstall", Uninstall, import("../Install/Domain.js").McpParseError | import("../Install/Domain.js").McpWriteError | import("effect/ParseResult").ParseError | import("@effect/platform/Error").PlatformError, {
5
+ readonly target: Option.Option<"all" | "hook" | "mcp" | "skill">;
6
+ readonly host: Option.Option<"claude-code" | "codex" | "cursor" | "opencode">;
7
+ readonly scope: Option.Option<"global" | "project">;
8
8
  }>;
9
9
  //# sourceMappingURL=Uninstall.d.ts.map
@@ -1,7 +1,28 @@
1
- import { FileSystem, Path } from '@effect/platform';
2
- import { DateTime, Effect, Schema } from 'effect';
1
+ /**
2
+ * CLI configuration. Persisted at `$XDG_CONFIG_HOME/expandai/config.json`
3
+ * (default `~/.config/expandai/config.json`). `EXPAND_API_URL` overrides the
4
+ * file. `EXPAND_API_KEY` overrides an API key stored in the file, but not
5
+ * credentials established by `expandai login` or agent setup — signing in is a
6
+ * deliberate act, and an exported API key usually is not. `EXPAND_APP_URL`
7
+ * points guide links at the web app serving them.
8
+ */
9
+ import { CommandExecutor, FileSystem, Path, Error as PlatformError } from '@effect/platform';
10
+ import { NodeContext } from '@effect/platform-node';
11
+ import { Config, DateTime, Effect, Option, Redacted, Schema } from 'effect';
3
12
  /** Production API endpoint used when neither `EXPAND_API_URL` nor the config file overrides it. */
4
13
  export declare const DEFAULT_API_URL = "https://api.expand.ai";
14
+ /** Production web app used when `EXPAND_APP_URL` does not override it. */
15
+ export declare const DEFAULT_APP_URL = "https://expand.ai";
16
+ /**
17
+ * Lenient env readers. `Config.option` / `Config.withDefault` only absorb
18
+ * missing data — a present-but-malformed value (`CLAUDECODE=banana`,
19
+ * `EXPANDAI_HARNESS=bogus`) fails as InvalidData and would crash the CLI at
20
+ * layer construction. These read the raw string and degrade gracefully:
21
+ * flags follow the DO_NOT_TRACK convention (set unless an explicit off),
22
+ * literals decode to None instead of failing.
23
+ */
24
+ export declare const envFlag: (name: string) => Config.Config<boolean>;
25
+ export declare const envLiteral: <A extends string>(name: string, schema: Schema.Schema<A, A>) => Config.Config<Option.Option<A>>;
5
26
  export declare const ApiKey: Schema.Redacted<Schema.brand<typeof Schema.NonEmptyTrimmedString, "ApiKey">>;
6
27
  export declare const ApiKeyConfig: Schema.TaggedStruct<"ApiKey", {
7
28
  apiKey: Schema.Redacted<Schema.brand<typeof Schema.NonEmptyTrimmedString, "ApiKey">>;
@@ -10,6 +31,12 @@ export declare const OAuthConfig: Schema.TaggedStruct<"OAuth", {
10
31
  accessToken: Schema.Redacted<typeof Schema.String>;
11
32
  refreshToken: Schema.optional<Schema.Redacted<typeof Schema.String>>;
12
33
  expiresAt: typeof Schema.DateTimeUtc;
34
+ clientId: Schema.optional<typeof Schema.String>;
35
+ }>;
36
+ export declare const TelemetrySettings: Schema.Struct<{
37
+ enabled: Schema.optional<typeof Schema.Boolean>;
38
+ distinctId: Schema.optional<typeof Schema.String>;
39
+ noticeShown: Schema.optional<typeof Schema.Boolean>;
13
40
  }>;
14
41
  declare const ExpandCliConfig_base: Schema.Class<ExpandCliConfig, {
15
42
  apiUrl: Schema.optional<typeof Schema.URL>;
@@ -19,7 +46,13 @@ declare const ExpandCliConfig_base: Schema.Class<ExpandCliConfig, {
19
46
  accessToken: Schema.Redacted<typeof Schema.String>;
20
47
  refreshToken: Schema.optional<Schema.Redacted<typeof Schema.String>>;
21
48
  expiresAt: typeof Schema.DateTimeUtc;
49
+ clientId: Schema.optional<typeof Schema.String>;
22
50
  }>]>>;
51
+ telemetry: Schema.optional<Schema.Struct<{
52
+ enabled: Schema.optional<typeof Schema.Boolean>;
53
+ distinctId: Schema.optional<typeof Schema.String>;
54
+ noticeShown: Schema.optional<typeof Schema.Boolean>;
55
+ }>>;
23
56
  }, Schema.Struct.Encoded<{
24
57
  apiUrl: Schema.optional<typeof Schema.URL>;
25
58
  authMethod: Schema.optional<Schema.Union<[Schema.TaggedStruct<"ApiKey", {
@@ -28,23 +61,49 @@ declare const ExpandCliConfig_base: Schema.Class<ExpandCliConfig, {
28
61
  accessToken: Schema.Redacted<typeof Schema.String>;
29
62
  refreshToken: Schema.optional<Schema.Redacted<typeof Schema.String>>;
30
63
  expiresAt: typeof Schema.DateTimeUtc;
64
+ clientId: Schema.optional<typeof Schema.String>;
31
65
  }>]>>;
66
+ telemetry: Schema.optional<Schema.Struct<{
67
+ enabled: Schema.optional<typeof Schema.Boolean>;
68
+ distinctId: Schema.optional<typeof Schema.String>;
69
+ noticeShown: Schema.optional<typeof Schema.Boolean>;
70
+ }>>;
32
71
  }>, never, {
33
72
  readonly apiUrl?: URL | undefined;
34
73
  } & {
35
74
  readonly authMethod?: {
36
75
  readonly _tag: "ApiKey";
37
- readonly apiKey: import("effect/Redacted").Redacted<string & import("effect/Brand").Brand<"ApiKey">>;
76
+ readonly apiKey: Redacted.Redacted<string & import("effect/Brand").Brand<"ApiKey">>;
38
77
  } | {
39
78
  readonly _tag: "OAuth";
40
- readonly accessToken: import("effect/Redacted").Redacted<string>;
41
- readonly refreshToken?: import("effect/Redacted").Redacted<string> | undefined;
79
+ readonly accessToken: Redacted.Redacted<string>;
80
+ readonly refreshToken?: Redacted.Redacted<string> | undefined;
42
81
  readonly expiresAt: DateTime.Utc;
82
+ readonly clientId?: string | undefined;
83
+ } | undefined;
84
+ } & {
85
+ readonly telemetry?: {
86
+ readonly enabled?: boolean | undefined;
87
+ readonly distinctId?: string | undefined;
88
+ readonly noticeShown?: boolean | undefined;
43
89
  } | undefined;
44
90
  }, {}, {}>;
45
91
  export declare class ExpandCliConfig extends ExpandCliConfig_base {
46
92
  static readonly Json: Schema.transform<Schema.SchemaClass<unknown, string, never>, typeof ExpandCliConfig>;
47
93
  }
94
+ export type AuthMethod = typeof ApiKeyConfig.Type | typeof OAuthConfig.Type;
95
+ /**
96
+ * How a stored credential stands right now.
97
+ *
98
+ * `refresh_required` is deliberately distinct from `healthy`: an expired access
99
+ * token with a refresh token on disk is only a credential we *could* renew, and
100
+ * renewal can fail. Reporting it as healthy told agents a machine was authorized
101
+ * when the next call would fail.
102
+ */
103
+ export type AuthMethodState = 'healthy' | 'refresh_required' | 'unusable';
104
+ export declare function authMethodState(authMethod: AuthMethod, now: DateTime.Utc): AuthMethodState;
105
+ /** Returns whether a local credential can be used now or renewed on first API use. */
106
+ export declare function isAuthMethodLocallyUsable(authMethod: AuthMethod, now: DateTime.Utc): boolean;
48
107
  declare const ConfigNotWritable_base: Schema.TaggedErrorClass<ConfigNotWritable, "ConfigNotWritable", {
49
108
  readonly _tag: Schema.tag<"ConfigNotWritable">;
50
109
  } & {
@@ -53,6 +112,17 @@ declare const ConfigNotWritable_base: Schema.TaggedErrorClass<ConfigNotWritable,
53
112
  export declare class ConfigNotWritable extends ConfigNotWritable_base {
54
113
  get message(): string;
55
114
  }
115
+ declare const ConfigCleanupError_base: Schema.TaggedErrorClass<ConfigCleanupError, "ConfigCleanupError", {
116
+ readonly _tag: Schema.tag<"ConfigCleanupError">;
117
+ } & {
118
+ path: typeof Schema.String;
119
+ temporaryPath: typeof Schema.String;
120
+ error: typeof Schema.Defect;
121
+ operationError: typeof Schema.Defect;
122
+ }>;
123
+ export declare class ConfigCleanupError extends ConfigCleanupError_base {
124
+ get message(): string;
125
+ }
56
126
  declare const ConfigParseError_base: Schema.TaggedErrorClass<ConfigParseError, "ConfigParseError", {
57
127
  readonly _tag: Schema.tag<"ConfigParseError">;
58
128
  } & {
@@ -62,6 +132,16 @@ declare const ConfigParseError_base: Schema.TaggedErrorClass<ConfigParseError, "
62
132
  export declare class ConfigParseError extends ConfigParseError_base {
63
133
  get message(): string;
64
134
  }
135
+ declare const CredentialStoreInsecure_base: Schema.TaggedErrorClass<CredentialStoreInsecure, "CredentialStoreInsecure", {
136
+ readonly _tag: Schema.tag<"CredentialStoreInsecure">;
137
+ } & {
138
+ path: typeof Schema.String;
139
+ reason: typeof Schema.String;
140
+ error: typeof Schema.Defect;
141
+ }>;
142
+ export declare class CredentialStoreInsecure extends CredentialStoreInsecure_base {
143
+ get message(): string;
144
+ }
65
145
  declare const NotAuthenticated_base: Schema.TaggedErrorClass<NotAuthenticated, "NotAuthenticated", {
66
146
  readonly _tag: Schema.tag<"NotAuthenticated">;
67
147
  }>;
@@ -77,27 +157,38 @@ export declare class OAuthTokenExpired extends OAuthTokenExpired_base {
77
157
  get message(): string;
78
158
  }
79
159
  declare const ConfigManager_base: Effect.Service.Class<ConfigManager, "@expandai/cli/Config/ConfigManager", {
80
- readonly dependencies: readonly [import("effect/Layer").Layer<FileSystem.FileSystem, never, never>, import("effect/Layer").Layer<Path.Path, never, never>];
160
+ readonly dependencies: readonly [import("effect/Layer").Layer<NodeContext.NodeContext, never, never>];
81
161
  readonly effect: Effect.Effect<{
82
162
  readonly configPath: string;
163
+ readonly inspectSecureStorage: () => Effect.Effect<void, CredentialStoreInsecure, never>;
164
+ readonly ensureSecureStorage: () => Effect.Effect<void, CredentialStoreInsecure, never>;
83
165
  readonly loadConfig: () => Effect.Effect<{
84
166
  apiUrl: URL;
85
167
  authMethod: NonNullable<{
86
168
  readonly _tag: "ApiKey";
87
- readonly apiKey: import("effect/Redacted").Redacted<string & import("effect/Brand").Brand<"ApiKey">>;
169
+ readonly apiKey: Redacted.Redacted<string & import("effect/Brand").Brand<"ApiKey">>;
88
170
  } | {
89
171
  readonly _tag: "OAuth";
90
- readonly accessToken: import("effect/Redacted").Redacted<string>;
91
- readonly refreshToken?: import("effect/Redacted").Redacted<string> | undefined;
172
+ readonly accessToken: Redacted.Redacted<string>;
173
+ readonly refreshToken?: Redacted.Redacted<string> | undefined;
92
174
  readonly expiresAt: DateTime.Utc;
175
+ readonly clientId?: string | undefined;
93
176
  } | undefined>;
94
- }, ConfigParseError | NotAuthenticated | import("effect/ConfigError").ConfigError | import("@effect/platform/Error").PlatformError, never>;
95
- readonly saveConfig: (config: ExpandCliConfig) => Effect.Effect<void, import("effect/ParseResult").ParseError | ConfigNotWritable, never>;
96
- readonly updateConfig: (patch: Partial<ExpandCliConfig>) => Effect.Effect<void, import("effect/ParseResult").ParseError | ConfigNotWritable, never>;
97
- readonly clearConfig: () => Effect.Effect<void, import("effect/ParseResult").ParseError | ConfigNotWritable, never>;
98
- readonly getApiUrl: () => Effect.Effect<URL, ConfigParseError | import("effect/ConfigError").ConfigError | import("@effect/platform/Error").PlatformError, never>;
177
+ }, ConfigParseError | CredentialStoreInsecure | NotAuthenticated | import("effect/ConfigError").ConfigError | PlatformError.PlatformError, never>;
178
+ readonly saveConfig: (config: ExpandCliConfig) => Effect.Effect<void, ConfigCleanupError | ConfigNotWritable | CredentialStoreInsecure | import("effect/ParseResult").ParseError, never>;
179
+ readonly updateConfig: (patch: Partial<ExpandCliConfig>) => Effect.Effect<void, ConfigCleanupError | ConfigNotWritable | ConfigParseError | CredentialStoreInsecure | import("effect/ParseResult").ParseError | PlatformError.PlatformError, never>;
180
+ readonly clearConfig: () => Effect.Effect<undefined, PlatformError.BadArgument | ConfigCleanupError | ConfigNotWritable | CredentialStoreInsecure | import("effect/ParseResult").ParseError | PlatformError.SystemError, never>;
181
+ readonly readConfigFile: () => Effect.Effect<{
182
+ config: ExpandCliConfig;
183
+ parseFailed: boolean;
184
+ } | {
185
+ config: ExpandCliConfig;
186
+ parseFailed: boolean;
187
+ }, never, never>;
188
+ readonly getApiUrl: () => Effect.Effect<URL, ConfigParseError | CredentialStoreInsecure | import("effect/ConfigError").ConfigError | PlatformError.PlatformError, never>;
189
+ readonly getAppUrl: () => Effect.Effect<string, import("effect/ConfigError").ConfigError, never>;
99
190
  readonly getPlaygroundHost: () => Effect.Effect<string, import("effect/ConfigError").ConfigError, never>;
100
- }, import("effect/ConfigError").ConfigError, FileSystem.FileSystem | Path.Path>;
191
+ }, import("effect/ConfigError").ConfigError, CommandExecutor.CommandExecutor | FileSystem.FileSystem | Path.Path>;
101
192
  }>;
102
193
  export declare class ConfigManager extends ConfigManager_base {
103
194
  }