procsi 0.2.6

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 (296) hide show
  1. package/LICENSE +665 -0
  2. package/README.md +587 -0
  3. package/dist/cli/commands/clear.d.ts +3 -0
  4. package/dist/cli/commands/clear.d.ts.map +1 -0
  5. package/dist/cli/commands/clear.js +30 -0
  6. package/dist/cli/commands/clear.js.map +1 -0
  7. package/dist/cli/commands/daemon.d.ts +3 -0
  8. package/dist/cli/commands/daemon.d.ts.map +1 -0
  9. package/dist/cli/commands/daemon.js +59 -0
  10. package/dist/cli/commands/daemon.js.map +1 -0
  11. package/dist/cli/commands/debug-dump.d.ts +27 -0
  12. package/dist/cli/commands/debug-dump.d.ts.map +1 -0
  13. package/dist/cli/commands/debug-dump.js +102 -0
  14. package/dist/cli/commands/debug-dump.js.map +1 -0
  15. package/dist/cli/commands/helpers.d.ts +18 -0
  16. package/dist/cli/commands/helpers.d.ts.map +1 -0
  17. package/dist/cli/commands/helpers.js +34 -0
  18. package/dist/cli/commands/helpers.js.map +1 -0
  19. package/dist/cli/commands/init.d.ts +9 -0
  20. package/dist/cli/commands/init.d.ts.map +1 -0
  21. package/dist/cli/commands/init.js +28 -0
  22. package/dist/cli/commands/init.js.map +1 -0
  23. package/dist/cli/commands/intercept.d.ts +9 -0
  24. package/dist/cli/commands/intercept.d.ts.map +1 -0
  25. package/dist/cli/commands/intercept.js +121 -0
  26. package/dist/cli/commands/intercept.js.map +1 -0
  27. package/dist/cli/commands/interceptors.d.ts +3 -0
  28. package/dist/cli/commands/interceptors.d.ts.map +1 -0
  29. package/dist/cli/commands/interceptors.js +163 -0
  30. package/dist/cli/commands/interceptors.js.map +1 -0
  31. package/dist/cli/commands/mcp.d.ts +3 -0
  32. package/dist/cli/commands/mcp.d.ts.map +1 -0
  33. package/dist/cli/commands/mcp.js +24 -0
  34. package/dist/cli/commands/mcp.js.map +1 -0
  35. package/dist/cli/commands/off.d.ts +8 -0
  36. package/dist/cli/commands/off.d.ts.map +1 -0
  37. package/dist/cli/commands/off.js +34 -0
  38. package/dist/cli/commands/off.js.map +1 -0
  39. package/dist/cli/commands/on.d.ts +9 -0
  40. package/dist/cli/commands/on.d.ts.map +1 -0
  41. package/dist/cli/commands/on.js +121 -0
  42. package/dist/cli/commands/on.js.map +1 -0
  43. package/dist/cli/commands/project.d.ts +3 -0
  44. package/dist/cli/commands/project.d.ts.map +1 -0
  45. package/dist/cli/commands/project.js +15 -0
  46. package/dist/cli/commands/project.js.map +1 -0
  47. package/dist/cli/commands/restart.d.ts +3 -0
  48. package/dist/cli/commands/restart.d.ts.map +1 -0
  49. package/dist/cli/commands/restart.js +35 -0
  50. package/dist/cli/commands/restart.js.map +1 -0
  51. package/dist/cli/commands/status.d.ts +3 -0
  52. package/dist/cli/commands/status.d.ts.map +1 -0
  53. package/dist/cli/commands/status.js +66 -0
  54. package/dist/cli/commands/status.js.map +1 -0
  55. package/dist/cli/commands/stop.d.ts +3 -0
  56. package/dist/cli/commands/stop.d.ts.map +1 -0
  57. package/dist/cli/commands/stop.js +24 -0
  58. package/dist/cli/commands/stop.js.map +1 -0
  59. package/dist/cli/commands/tui.d.ts +3 -0
  60. package/dist/cli/commands/tui.d.ts.map +1 -0
  61. package/dist/cli/commands/tui.js +36 -0
  62. package/dist/cli/commands/tui.js.map +1 -0
  63. package/dist/cli/commands/vars.d.ts +36 -0
  64. package/dist/cli/commands/vars.d.ts.map +1 -0
  65. package/dist/cli/commands/vars.js +207 -0
  66. package/dist/cli/commands/vars.js.map +1 -0
  67. package/dist/cli/index.d.ts +3 -0
  68. package/dist/cli/index.d.ts.map +1 -0
  69. package/dist/cli/index.js +37 -0
  70. package/dist/cli/index.js.map +1 -0
  71. package/dist/cli/tui/App.d.ts +15 -0
  72. package/dist/cli/tui/App.d.ts.map +1 -0
  73. package/dist/cli/tui/App.js +544 -0
  74. package/dist/cli/tui/App.js.map +1 -0
  75. package/dist/cli/tui/components/AccordionContent.d.ts +28 -0
  76. package/dist/cli/tui/components/AccordionContent.d.ts.map +1 -0
  77. package/dist/cli/tui/components/AccordionContent.js +87 -0
  78. package/dist/cli/tui/components/AccordionContent.js.map +1 -0
  79. package/dist/cli/tui/components/AccordionPanel.d.ts +38 -0
  80. package/dist/cli/tui/components/AccordionPanel.d.ts.map +1 -0
  81. package/dist/cli/tui/components/AccordionPanel.js +110 -0
  82. package/dist/cli/tui/components/AccordionPanel.js.map +1 -0
  83. package/dist/cli/tui/components/AccordionSection.d.ts +32 -0
  84. package/dist/cli/tui/components/AccordionSection.d.ts.map +1 -0
  85. package/dist/cli/tui/components/AccordionSection.js +41 -0
  86. package/dist/cli/tui/components/AccordionSection.js.map +1 -0
  87. package/dist/cli/tui/components/BodyView.d.ts +14 -0
  88. package/dist/cli/tui/components/BodyView.d.ts.map +1 -0
  89. package/dist/cli/tui/components/BodyView.js +39 -0
  90. package/dist/cli/tui/components/BodyView.js.map +1 -0
  91. package/dist/cli/tui/components/ExportModal.d.ts +34 -0
  92. package/dist/cli/tui/components/ExportModal.d.ts.map +1 -0
  93. package/dist/cli/tui/components/ExportModal.js +109 -0
  94. package/dist/cli/tui/components/ExportModal.js.map +1 -0
  95. package/dist/cli/tui/components/FilterBar.d.ts +21 -0
  96. package/dist/cli/tui/components/FilterBar.d.ts.map +1 -0
  97. package/dist/cli/tui/components/FilterBar.js +155 -0
  98. package/dist/cli/tui/components/FilterBar.js.map +1 -0
  99. package/dist/cli/tui/components/HeadersView.d.ts +13 -0
  100. package/dist/cli/tui/components/HeadersView.d.ts.map +1 -0
  101. package/dist/cli/tui/components/HeadersView.js +8 -0
  102. package/dist/cli/tui/components/HeadersView.js.map +1 -0
  103. package/dist/cli/tui/components/HelpModal.d.ts +13 -0
  104. package/dist/cli/tui/components/HelpModal.d.ts.map +1 -0
  105. package/dist/cli/tui/components/HelpModal.js +78 -0
  106. package/dist/cli/tui/components/HelpModal.js.map +1 -0
  107. package/dist/cli/tui/components/HintContent.d.ts +25 -0
  108. package/dist/cli/tui/components/HintContent.d.ts.map +1 -0
  109. package/dist/cli/tui/components/HintContent.js +44 -0
  110. package/dist/cli/tui/components/HintContent.js.map +1 -0
  111. package/dist/cli/tui/components/InfoModal.d.ts +15 -0
  112. package/dist/cli/tui/components/InfoModal.d.ts.map +1 -0
  113. package/dist/cli/tui/components/InfoModal.js +17 -0
  114. package/dist/cli/tui/components/InfoModal.js.map +1 -0
  115. package/dist/cli/tui/components/JsonExplorerModal.d.ts +24 -0
  116. package/dist/cli/tui/components/JsonExplorerModal.d.ts.map +1 -0
  117. package/dist/cli/tui/components/JsonExplorerModal.js +311 -0
  118. package/dist/cli/tui/components/JsonExplorerModal.js.map +1 -0
  119. package/dist/cli/tui/components/Modal.d.ts +26 -0
  120. package/dist/cli/tui/components/Modal.d.ts.map +1 -0
  121. package/dist/cli/tui/components/Modal.js +15 -0
  122. package/dist/cli/tui/components/Modal.js.map +1 -0
  123. package/dist/cli/tui/components/Panel.d.ts +19 -0
  124. package/dist/cli/tui/components/Panel.d.ts.map +1 -0
  125. package/dist/cli/tui/components/Panel.js +37 -0
  126. package/dist/cli/tui/components/Panel.js.map +1 -0
  127. package/dist/cli/tui/components/RequestDetails.d.ts +16 -0
  128. package/dist/cli/tui/components/RequestDetails.d.ts.map +1 -0
  129. package/dist/cli/tui/components/RequestDetails.js +23 -0
  130. package/dist/cli/tui/components/RequestDetails.js.map +1 -0
  131. package/dist/cli/tui/components/RequestList.d.ts +21 -0
  132. package/dist/cli/tui/components/RequestList.d.ts.map +1 -0
  133. package/dist/cli/tui/components/RequestList.js +30 -0
  134. package/dist/cli/tui/components/RequestList.js.map +1 -0
  135. package/dist/cli/tui/components/RequestListItem.d.ts +36 -0
  136. package/dist/cli/tui/components/RequestListItem.d.ts.map +1 -0
  137. package/dist/cli/tui/components/RequestListItem.js +130 -0
  138. package/dist/cli/tui/components/RequestListItem.js.map +1 -0
  139. package/dist/cli/tui/components/SaveModal.d.ts +30 -0
  140. package/dist/cli/tui/components/SaveModal.d.ts.map +1 -0
  141. package/dist/cli/tui/components/SaveModal.js +95 -0
  142. package/dist/cli/tui/components/SaveModal.js.map +1 -0
  143. package/dist/cli/tui/components/StatusBar.d.ts +39 -0
  144. package/dist/cli/tui/components/StatusBar.d.ts.map +1 -0
  145. package/dist/cli/tui/components/StatusBar.js +53 -0
  146. package/dist/cli/tui/components/StatusBar.js.map +1 -0
  147. package/dist/cli/tui/components/TextViewerModal.d.ts +19 -0
  148. package/dist/cli/tui/components/TextViewerModal.d.ts.map +1 -0
  149. package/dist/cli/tui/components/TextViewerModal.js +227 -0
  150. package/dist/cli/tui/components/TextViewerModal.js.map +1 -0
  151. package/dist/cli/tui/hooks/useBodyExport.d.ts +26 -0
  152. package/dist/cli/tui/hooks/useBodyExport.d.ts.map +1 -0
  153. package/dist/cli/tui/hooks/useBodyExport.js +173 -0
  154. package/dist/cli/tui/hooks/useBodyExport.js.map +1 -0
  155. package/dist/cli/tui/hooks/useExport.d.ts +29 -0
  156. package/dist/cli/tui/hooks/useExport.d.ts.map +1 -0
  157. package/dist/cli/tui/hooks/useExport.js +64 -0
  158. package/dist/cli/tui/hooks/useExport.js.map +1 -0
  159. package/dist/cli/tui/hooks/useRequests.d.ts +26 -0
  160. package/dist/cli/tui/hooks/useRequests.d.ts.map +1 -0
  161. package/dist/cli/tui/hooks/useRequests.js +131 -0
  162. package/dist/cli/tui/hooks/useRequests.js.map +1 -0
  163. package/dist/cli/tui/hooks/useSaveBinary.d.ts +26 -0
  164. package/dist/cli/tui/hooks/useSaveBinary.d.ts.map +1 -0
  165. package/dist/cli/tui/hooks/useSaveBinary.js +165 -0
  166. package/dist/cli/tui/hooks/useSaveBinary.js.map +1 -0
  167. package/dist/cli/tui/hooks/useSpinner.d.ts +5 -0
  168. package/dist/cli/tui/hooks/useSpinner.d.ts.map +1 -0
  169. package/dist/cli/tui/hooks/useSpinner.js +25 -0
  170. package/dist/cli/tui/hooks/useSpinner.js.map +1 -0
  171. package/dist/cli/tui/hooks/useStdoutDimensions.d.ts +11 -0
  172. package/dist/cli/tui/hooks/useStdoutDimensions.d.ts.map +1 -0
  173. package/dist/cli/tui/hooks/useStdoutDimensions.js +29 -0
  174. package/dist/cli/tui/hooks/useStdoutDimensions.js.map +1 -0
  175. package/dist/cli/tui/utils/binary.d.ts +24 -0
  176. package/dist/cli/tui/utils/binary.d.ts.map +1 -0
  177. package/dist/cli/tui/utils/binary.js +152 -0
  178. package/dist/cli/tui/utils/binary.js.map +1 -0
  179. package/dist/cli/tui/utils/clipboard.d.ts +9 -0
  180. package/dist/cli/tui/utils/clipboard.d.ts.map +1 -0
  181. package/dist/cli/tui/utils/clipboard.js +58 -0
  182. package/dist/cli/tui/utils/clipboard.js.map +1 -0
  183. package/dist/cli/tui/utils/content-type.d.ts +8 -0
  184. package/dist/cli/tui/utils/content-type.d.ts.map +1 -0
  185. package/dist/cli/tui/utils/content-type.js +10 -0
  186. package/dist/cli/tui/utils/content-type.js.map +1 -0
  187. package/dist/cli/tui/utils/curl.d.ts +9 -0
  188. package/dist/cli/tui/utils/curl.d.ts.map +1 -0
  189. package/dist/cli/tui/utils/curl.js +54 -0
  190. package/dist/cli/tui/utils/curl.js.map +1 -0
  191. package/dist/cli/tui/utils/filters.d.ts +6 -0
  192. package/dist/cli/tui/utils/filters.d.ts.map +1 -0
  193. package/dist/cli/tui/utils/filters.js +13 -0
  194. package/dist/cli/tui/utils/filters.js.map +1 -0
  195. package/dist/cli/tui/utils/formatters.d.ts +49 -0
  196. package/dist/cli/tui/utils/formatters.d.ts.map +1 -0
  197. package/dist/cli/tui/utils/formatters.js +200 -0
  198. package/dist/cli/tui/utils/formatters.js.map +1 -0
  199. package/dist/cli/tui/utils/har.d.ts +75 -0
  200. package/dist/cli/tui/utils/har.d.ts.map +1 -0
  201. package/dist/cli/tui/utils/har.js +117 -0
  202. package/dist/cli/tui/utils/har.js.map +1 -0
  203. package/dist/cli/tui/utils/json-tree.d.ts +69 -0
  204. package/dist/cli/tui/utils/json-tree.d.ts.map +1 -0
  205. package/dist/cli/tui/utils/json-tree.js +339 -0
  206. package/dist/cli/tui/utils/json-tree.js.map +1 -0
  207. package/dist/cli/tui/utils/open-external.d.ts +17 -0
  208. package/dist/cli/tui/utils/open-external.d.ts.map +1 -0
  209. package/dist/cli/tui/utils/open-external.js +57 -0
  210. package/dist/cli/tui/utils/open-external.js.map +1 -0
  211. package/dist/cli/tui/utils/syntax-highlight.d.ts +16 -0
  212. package/dist/cli/tui/utils/syntax-highlight.d.ts.map +1 -0
  213. package/dist/cli/tui/utils/syntax-highlight.js +64 -0
  214. package/dist/cli/tui/utils/syntax-highlight.js.map +1 -0
  215. package/dist/daemon/control.d.ts +21 -0
  216. package/dist/daemon/control.d.ts.map +1 -0
  217. package/dist/daemon/control.js +311 -0
  218. package/dist/daemon/control.js.map +1 -0
  219. package/dist/daemon/htpx-client.d.ts +8 -0
  220. package/dist/daemon/htpx-client.d.ts.map +1 -0
  221. package/dist/daemon/htpx-client.js +25 -0
  222. package/dist/daemon/htpx-client.js.map +1 -0
  223. package/dist/daemon/index.d.ts +3 -0
  224. package/dist/daemon/index.d.ts.map +1 -0
  225. package/dist/daemon/index.js +178 -0
  226. package/dist/daemon/index.js.map +1 -0
  227. package/dist/daemon/interceptor-loader.d.ts +30 -0
  228. package/dist/daemon/interceptor-loader.d.ts.map +1 -0
  229. package/dist/daemon/interceptor-loader.js +249 -0
  230. package/dist/daemon/interceptor-loader.js.map +1 -0
  231. package/dist/daemon/interceptor-runner.d.ts +39 -0
  232. package/dist/daemon/interceptor-runner.d.ts.map +1 -0
  233. package/dist/daemon/interceptor-runner.js +312 -0
  234. package/dist/daemon/interceptor-runner.js.map +1 -0
  235. package/dist/daemon/procsi-client.d.ts +8 -0
  236. package/dist/daemon/procsi-client.d.ts.map +1 -0
  237. package/dist/daemon/procsi-client.js +25 -0
  238. package/dist/daemon/procsi-client.js.map +1 -0
  239. package/dist/daemon/proxy.d.ts +34 -0
  240. package/dist/daemon/proxy.d.ts.map +1 -0
  241. package/dist/daemon/proxy.js +213 -0
  242. package/dist/daemon/proxy.js.map +1 -0
  243. package/dist/daemon/storage.d.ts +130 -0
  244. package/dist/daemon/storage.d.ts.map +1 -0
  245. package/dist/daemon/storage.js +761 -0
  246. package/dist/daemon/storage.js.map +1 -0
  247. package/dist/interceptors.d.ts +2 -0
  248. package/dist/interceptors.d.ts.map +1 -0
  249. package/dist/interceptors.js +2 -0
  250. package/dist/interceptors.js.map +1 -0
  251. package/dist/mcp/server.d.ts +110 -0
  252. package/dist/mcp/server.d.ts.map +1 -0
  253. package/dist/mcp/server.js +806 -0
  254. package/dist/mcp/server.js.map +1 -0
  255. package/dist/overrides/node.d.ts +30 -0
  256. package/dist/overrides/node.d.ts.map +1 -0
  257. package/dist/overrides/node.js +66 -0
  258. package/dist/overrides/node.js.map +1 -0
  259. package/dist/shared/config.d.ts +21 -0
  260. package/dist/shared/config.d.ts.map +1 -0
  261. package/dist/shared/config.js +83 -0
  262. package/dist/shared/config.js.map +1 -0
  263. package/dist/shared/content-type.d.ts +64 -0
  264. package/dist/shared/content-type.d.ts.map +1 -0
  265. package/dist/shared/content-type.js +145 -0
  266. package/dist/shared/content-type.js.map +1 -0
  267. package/dist/shared/control-client.d.ts +144 -0
  268. package/dist/shared/control-client.d.ts.map +1 -0
  269. package/dist/shared/control-client.js +272 -0
  270. package/dist/shared/control-client.js.map +1 -0
  271. package/dist/shared/daemon.d.ts +33 -0
  272. package/dist/shared/daemon.d.ts.map +1 -0
  273. package/dist/shared/daemon.js +231 -0
  274. package/dist/shared/daemon.js.map +1 -0
  275. package/dist/shared/logger.d.ts +47 -0
  276. package/dist/shared/logger.d.ts.map +1 -0
  277. package/dist/shared/logger.js +200 -0
  278. package/dist/shared/logger.js.map +1 -0
  279. package/dist/shared/project.d.ts +76 -0
  280. package/dist/shared/project.d.ts.map +1 -0
  281. package/dist/shared/project.js +185 -0
  282. package/dist/shared/project.js.map +1 -0
  283. package/dist/shared/proxy-info.d.ts +10 -0
  284. package/dist/shared/proxy-info.d.ts.map +1 -0
  285. package/dist/shared/proxy-info.js +15 -0
  286. package/dist/shared/proxy-info.js.map +1 -0
  287. package/dist/shared/types.d.ts +128 -0
  288. package/dist/shared/types.d.ts.map +1 -0
  289. package/dist/shared/types.js +5 -0
  290. package/dist/shared/types.js.map +1 -0
  291. package/dist/shared/version.d.ts +5 -0
  292. package/dist/shared/version.d.ts.map +1 -0
  293. package/dist/shared/version.js +21 -0
  294. package/dist/shared/version.js.map +1 -0
  295. package/package.json +113 -0
  296. package/skills/procsi/SKILL.md +228 -0
@@ -0,0 +1,59 @@
1
+ import { Command } from "commander";
2
+ import { isDaemonRunning, stopDaemon, restartDaemon, startDaemon, getDaemonVersion, } from "../../shared/daemon.js";
3
+ import { parseVerbosity } from "../../shared/logger.js";
4
+ import { getProcsiVersion } from "../../shared/version.js";
5
+ import { requireProjectRoot, getErrorMessage, getGlobalOptions } from "./helpers.js";
6
+ const stopSubCommand = new Command("stop")
7
+ .description("Stop the daemon")
8
+ .action(async (_, command) => {
9
+ const globalOpts = getGlobalOptions(command);
10
+ const projectRoot = requireProjectRoot(globalOpts.dir);
11
+ // Check if daemon is running
12
+ const running = await isDaemonRunning(projectRoot);
13
+ if (!running) {
14
+ console.log("Daemon is not running");
15
+ process.exit(0);
16
+ }
17
+ try {
18
+ await stopDaemon(projectRoot);
19
+ console.log("Daemon stopped");
20
+ }
21
+ catch (err) {
22
+ console.error(`Error stopping daemon: ${getErrorMessage(err)}`);
23
+ process.exit(1);
24
+ }
25
+ });
26
+ const restartSubCommand = new Command("restart")
27
+ .description("Restart the daemon")
28
+ .action(async (_, command) => {
29
+ const globalOpts = getGlobalOptions(command);
30
+ const verbosity = globalOpts.verbose;
31
+ const logLevel = parseVerbosity(verbosity);
32
+ const projectRoot = requireProjectRoot(globalOpts.dir);
33
+ try {
34
+ const cliVersion = getProcsiVersion();
35
+ if (await isDaemonRunning(projectRoot)) {
36
+ const daemonVersion = await getDaemonVersion(projectRoot);
37
+ const versionInfo = daemonVersion && daemonVersion !== cliVersion
38
+ ? ` (${daemonVersion} -> ${cliVersion})`
39
+ : "";
40
+ console.log(`Restarting daemon${versionInfo}...`);
41
+ const port = await restartDaemon(projectRoot, logLevel);
42
+ console.log(`Daemon restarted on port ${port}`);
43
+ }
44
+ else {
45
+ console.log("Daemon not running, starting...");
46
+ const port = await startDaemon(projectRoot, { logLevel });
47
+ console.log(`Daemon started on port ${port}`);
48
+ }
49
+ }
50
+ catch (err) {
51
+ console.error(`Failed to restart daemon: ${getErrorMessage(err)}`);
52
+ process.exit(1);
53
+ }
54
+ });
55
+ export const daemonCommand = new Command("daemon")
56
+ .description("Manage the procsi daemon")
57
+ .addCommand(stopSubCommand)
58
+ .addCommand(restartSubCommand);
59
+ //# sourceMappingURL=daemon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daemon.js","sourceRoot":"","sources":["../../../src/cli/commands/daemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACX,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErF,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KACvC,WAAW,CAAC,iBAAiB,CAAC;KAC9B,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,OAAgB,EAAE,EAAE;IACpC,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAG,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAEvD,6BAA6B;IAC7B,MAAM,OA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,oBAAoB,WAAW,KAAK,CAAC,CAAC;YAClD,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YACxD,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;QAClD,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;YAC/C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,6BAA6B,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,0BAA0B,CAAC;KACvC,UAAU,CAAC,cAAc,CAAC;KAC1B,UAAU,CAAC,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { Command } from "commander";
2
+ interface DebugDump {
3
+ timestamp: string;
4
+ procsiVersion: string;
5
+ system: {
6
+ platform: string;
7
+ release: string;
8
+ nodeVersion: string;
9
+ };
10
+ daemon: {
11
+ running: boolean;
12
+ pid?: number;
13
+ proxyPort?: number;
14
+ };
15
+ procsiDir: {
16
+ exists: boolean;
17
+ files: string[];
18
+ };
19
+ recentLogs: string[];
20
+ }
21
+ /**
22
+ * Collect debug information for a project.
23
+ */
24
+ export declare function collectDebugInfo(projectRoot: string | undefined): DebugDump;
25
+ export declare const debugDumpCommand: Command;
26
+ export {};
27
+ //# sourceMappingURL=debug-dump.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-dump.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/debug-dump.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,UAAU,SAAS;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,OAAO,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,SAAS,EAAE;QACT,MAAM,EAAE,OAAO,CAAC;QAChB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IACF,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CA6D3E;AAaD,eAAO,MAAM,gBAAgB,SAwBzB,CAAC"}
@@ -0,0 +1,102 @@
1
+ import * as fs from "node:fs";
2
+ import * as os from "node:os";
3
+ import * as path from "node:path";
4
+ import { Command } from "commander";
5
+ import { getProcsiPaths, readDaemonPid, isProcessRunning } from "../../shared/project.js";
6
+ import { readProxyPort } from "../../shared/project.js";
7
+ import { getProcsiVersion } from "../../shared/version.js";
8
+ import { requireProjectRoot, getErrorMessage, getGlobalOptions } from "./helpers.js";
9
+ const DEBUG_LOG_LINES = 200;
10
+ /**
11
+ * Collect debug information for a project.
12
+ */
13
+ export function collectDebugInfo(projectRoot) {
14
+ const procsiVersion = getProcsiVersion();
15
+ const dump = {
16
+ timestamp: new Date().toISOString(),
17
+ procsiVersion,
18
+ system: {
19
+ platform: os.platform(),
20
+ release: os.release(),
21
+ nodeVersion: process.version,
22
+ },
23
+ daemon: {
24
+ running: false,
25
+ },
26
+ procsiDir: {
27
+ exists: false,
28
+ files: [],
29
+ },
30
+ recentLogs: [],
31
+ };
32
+ if (!projectRoot) {
33
+ return dump;
34
+ }
35
+ const paths = getProcsiPaths(projectRoot);
36
+ // Check .procsi directory
37
+ if (fs.existsSync(paths.procsiDir)) {
38
+ dump.procsiDir.exists = true;
39
+ try {
40
+ dump.procsiDir.files = fs.readdirSync(paths.procsiDir);
41
+ }
42
+ catch {
43
+ // Ignore errors reading directory
44
+ }
45
+ }
46
+ // Check daemon status
47
+ const pid = readDaemonPid(projectRoot);
48
+ if (pid && isProcessRunning(pid)) {
49
+ dump.daemon.running = true;
50
+ dump.daemon.pid = pid;
51
+ const proxyPort = readProxyPort(projectRoot);
52
+ if (proxyPort) {
53
+ dump.daemon.proxyPort = proxyPort;
54
+ }
55
+ }
56
+ // Read recent logs
57
+ if (fs.existsSync(paths.logFile)) {
58
+ try {
59
+ const content = fs.readFileSync(paths.logFile, "utf-8");
60
+ const lines = content.trim().split("\n");
61
+ dump.recentLogs = lines.slice(-DEBUG_LOG_LINES);
62
+ }
63
+ catch {
64
+ // Ignore errors reading log file
65
+ }
66
+ }
67
+ return dump;
68
+ }
69
+ /**
70
+ * Generate a filename for the debug dump.
71
+ */
72
+ function generateDumpFilename() {
73
+ const timestamp = new Date()
74
+ .toISOString()
75
+ .replace(/:/g, "-")
76
+ .replace(/\.\d{3}Z$/, "");
77
+ return `debug-dump-${timestamp}.json`;
78
+ }
79
+ export const debugDumpCommand = new Command("debug-dump")
80
+ .description("Collect diagnostic information for debugging")
81
+ .action((_, command) => {
82
+ const globalOpts = getGlobalOptions(command);
83
+ const projectRoot = requireProjectRoot(globalOpts.dir);
84
+ const paths = getProcsiPaths(projectRoot);
85
+ const dump = collectDebugInfo(projectRoot);
86
+ // Write dump to file
87
+ const filename = generateDumpFilename();
88
+ const filepath = path.join(paths.procsiDir, filename);
89
+ try {
90
+ // Ensure .procsi directory exists
91
+ if (!fs.existsSync(paths.procsiDir)) {
92
+ fs.mkdirSync(paths.procsiDir, { recursive: true });
93
+ }
94
+ fs.writeFileSync(filepath, JSON.stringify(dump, null, 2), "utf-8");
95
+ console.log(`Debug dump written to: ${filepath}`);
96
+ }
97
+ catch (err) {
98
+ console.error(`Failed to write debug dump: ${getErrorMessage(err)}`);
99
+ process.exit(1);
100
+ }
101
+ });
102
+ //# sourceMappingURL=debug-dump.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-dump.js","sourceRoot":"","sources":["../../../src/cli/commands/debug-dump.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErF,MAAM,eAAe,GAAG,GAAG,CAAC;AAsB5B;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAA+B;IAC9D,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IAEzC,MAAM,IAAI,GAAc;QACtB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,aAAa;QACb,MAAM,EAAE;YACN,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE;YACvB,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE;YACrB,WAAW,EAAE,OAAO,CAAC,OAAO;SAC7B;QACD,MAAM,EAAE;YACN,OAAO,EAAE,KAAK;SACf;QACD,SAAS,EAAE;YACT,MAAM,EAA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CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACnE,OAAO,CAAC,GAAG,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,+BAA+B,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { Command } from "commander";
2
+ export interface GlobalOptions {
3
+ verbose: number;
4
+ dir?: string;
5
+ }
6
+ /**
7
+ * Validate and extract global CLI options from a Commander command.
8
+ */
9
+ export declare function getGlobalOptions(command: Command): GlobalOptions;
10
+ /**
11
+ * Find the project root or exit with a friendly error message.
12
+ */
13
+ export declare function requireProjectRoot(override?: string): string;
14
+ /**
15
+ * Extract a human-readable message from an unknown error value.
16
+ */
17
+ export declare function getErrorMessage(err: unknown): string;
18
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAMhE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAW5D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEpD"}
@@ -0,0 +1,34 @@
1
+ import { findProjectRoot } from "../../shared/project.js";
2
+ /**
3
+ * Validate and extract global CLI options from a Commander command.
4
+ */
5
+ export function getGlobalOptions(command) {
6
+ const raw = command.optsWithGlobals();
7
+ return {
8
+ verbose: typeof raw["verbose"] === "number" ? raw["verbose"] : 0,
9
+ dir: typeof raw["dir"] === "string" ? raw["dir"] : undefined,
10
+ };
11
+ }
12
+ /**
13
+ * Find the project root or exit with a friendly error message.
14
+ */
15
+ export function requireProjectRoot(override) {
16
+ const projectRoot = findProjectRoot(undefined, override);
17
+ if (!projectRoot) {
18
+ if (override) {
19
+ console.error(`No .procsi or .git found at ${override} (specified via --dir)`);
20
+ }
21
+ else {
22
+ console.error("Not in a project directory (no .procsi or .git found)");
23
+ }
24
+ process.exit(1);
25
+ }
26
+ return projectRoot;
27
+ }
28
+ /**
29
+ * Extract a human-readable message from an unknown error value.
30
+ */
31
+ export function getErrorMessage(err) {
32
+ return err instanceof Error ? err.message : "Unknown error";
33
+ }
34
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/cli/commands/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAO1D;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,eAAe,EAA6B,CAAC;IACjE,OAAO;QACL,OAAO,EAAE,OAAO,GAAG,CAAC,SAAS,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAChE,GAAG,EAAE,OAAO,GAAG,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;KAC7D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAiB;IAClD,MAAM,WAAW,GAAG,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACzD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,+BAA+B,QAAQ,wBAAwB,CAAC,CAAC;QACjF,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;QACzE,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,GAAY;IAC1C,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Command } from "commander";
2
+ /**
3
+ * Generate the shell function for procsi.
4
+ * Maps the friendly `on`/`off` aliases to the underlying `vars` command
5
+ * so that environment variables can be set in the current shell.
6
+ */
7
+ export declare function generateShellFunction(): string;
8
+ export declare const initCommand: Command;
9
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAe9C;AAED,eAAO,MAAM,WAAW,SAIpB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { Command } from "commander";
2
+ /**
3
+ * Generate the shell function for procsi.
4
+ * Maps the friendly `on`/`off` aliases to the underlying `vars` command
5
+ * so that environment variables can be set in the current shell.
6
+ */
7
+ export function generateShellFunction() {
8
+ const lines = [
9
+ "procsi() {",
10
+ ' if [[ "$1" == "on" ]]; then',
11
+ " shift",
12
+ ' eval "$(command procsi vars "$@")"',
13
+ ' elif [[ "$1" == "off" ]]; then',
14
+ " shift",
15
+ ' eval "$(command procsi vars --clear "$@")"',
16
+ " else",
17
+ ' command procsi "$@"',
18
+ " fi",
19
+ "}",
20
+ ];
21
+ return lines.join("\n");
22
+ }
23
+ export const initCommand = new Command("init")
24
+ .description("Output shell wrapper function (enables procsi on/off to set env vars)")
25
+ .action(() => {
26
+ console.log(generateShellFunction());
27
+ });
28
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,KAAK,GAAG;QACZ,YAAY;QACZ,+BAA+B;QAC/B,WAAW;QACX,wCAAwC;QACxC,kCAAkC;QAClC,WAAW;QACX,gDAAgD;QAChD,QAAQ;QACR,yBAAyB;QACzB,MAAM;QACN,GAAG;KACJ,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CAAC,uEAAuE,CAAC;KACpF,MAAM,CAAC,GAAG,EAAE;IACX,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Command } from "commander";
2
+ /**
3
+ * Format environment variable exports for shell evaluation.
4
+ * Each line is a shell export statement. Values are escaped for
5
+ * safe use in double-quoted context.
6
+ */
7
+ export declare function formatEnvVars(vars: Record<string, string>): string;
8
+ export declare const interceptCommand: Command;
9
+ //# sourceMappingURL=intercept.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intercept.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/intercept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAIlE;AAED,eAAO,MAAM,gBAAgB,SAoGzB,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { Command } from "commander";
2
+ import { findOrCreateProjectRoot, ensureHtpxDir, getHtpxPaths } from "../../shared/project.js";
3
+ import { startDaemon } from "../../shared/daemon.js";
4
+ import { ControlClient } from "../../shared/control-client.js";
5
+ import { parseVerbosity } from "../../shared/logger.js";
6
+ import { getErrorMessage, getGlobalOptions } from "./helpers.js";
7
+ /**
8
+ * Escape a string for safe use inside double-quoted shell context.
9
+ * Within double quotes, `\`, `"`, `$`, `` ` ``, and `!` are interpreted by the shell.
10
+ */
11
+ function escapeDoubleQuoted(str) {
12
+ return str
13
+ .replace(/\\/g, "\\\\")
14
+ .replace(/"/g, '\\"')
15
+ .replace(/\$/g, "\\$")
16
+ .replace(/`/g, "\\`")
17
+ .replace(/!/g, "\\!");
18
+ }
19
+ /**
20
+ * Format environment variable exports for shell evaluation.
21
+ * Each line is a shell export statement. Values are escaped for
22
+ * safe use in double-quoted context.
23
+ */
24
+ export function formatEnvVars(vars) {
25
+ return Object.entries(vars)
26
+ .map(([key, value]) => `export ${key}="${escapeDoubleQuoted(value)}"`)
27
+ .join("\n");
28
+ }
29
+ export const interceptCommand = new Command("intercept")
30
+ .description("Output environment variables to intercept HTTP traffic")
31
+ .option("-l, --label <label>", "Label for this session")
32
+ .option("--no-restart", "Do not auto-restart daemon on version mismatch")
33
+ .action(async (options, command) => {
34
+ // If stdout is a TTY, user ran directly - show instructions instead
35
+ if (process.stdout.isTTY) {
36
+ console.log("To intercept HTTP traffic, run:");
37
+ console.log("");
38
+ console.log(" eval $(htpx intercept)");
39
+ console.log("");
40
+ console.log("This sets the required environment variables in your shell.");
41
+ return;
42
+ }
43
+ const label = options.label;
44
+ const autoRestart = options.restart;
45
+ const globalOpts = getGlobalOptions(command);
46
+ const verbosity = globalOpts.verbose;
47
+ const logLevel = parseVerbosity(verbosity);
48
+ // Find project root (auto-creates .htpx if needed)
49
+ const projectRoot = findOrCreateProjectRoot(undefined, globalOpts.dir);
50
+ ensureHtpxDir(projectRoot);
51
+ const paths = getHtpxPaths(projectRoot);
52
+ try {
53
+ // Start daemon if not already running
54
+ const proxyPort = await startDaemon(projectRoot, {
55
+ logLevel,
56
+ autoRestart,
57
+ onVersionMismatch: (running, cli) => {
58
+ if (autoRestart) {
59
+ console.log(`# htpx: restarting daemon (version mismatch: ${running} -> ${cli})`);
60
+ }
61
+ else {
62
+ console.log(`# htpx warning: daemon version mismatch (running: ${running}, CLI: ${cli})`);
63
+ console.log(`# Use 'htpx restart' to update.`);
64
+ }
65
+ },
66
+ });
67
+ const proxyUrl = `http://127.0.0.1:${proxyPort}`;
68
+ // Register session with daemon
69
+ const client = new ControlClient(paths.controlSocketFile);
70
+ try {
71
+ const session = await client.registerSession(label, process.ppid);
72
+ // Build environment variables
73
+ const envVars = {
74
+ HTTP_PROXY: proxyUrl,
75
+ HTTPS_PROXY: proxyUrl,
76
+ // Python requests library
77
+ SSL_CERT_FILE: paths.caCertFile,
78
+ REQUESTS_CA_BUNDLE: paths.caCertFile,
79
+ // Node.js
80
+ NODE_EXTRA_CA_CERTS: paths.caCertFile,
81
+ // htpx session tracking
82
+ HTPX_SESSION_ID: session.id,
83
+ };
84
+ if (label) {
85
+ envVars["HTPX_LABEL"] = label;
86
+ }
87
+ // Report interceptor status
88
+ try {
89
+ const interceptors = await client.listInterceptors();
90
+ if (interceptors.length > 0) {
91
+ const errorCount = interceptors.filter((i) => i.error).length;
92
+ const loadedCount = interceptors.length - errorCount;
93
+ if (errorCount > 0) {
94
+ console.log(`# Loaded ${loadedCount} interceptors (${errorCount} failed) from .htpx/interceptors/`);
95
+ }
96
+ else {
97
+ console.log(`# Loaded ${loadedCount} interceptors from .htpx/interceptors/`);
98
+ }
99
+ }
100
+ }
101
+ catch {
102
+ // Interceptor info not available — not critical
103
+ }
104
+ // Output env vars for eval
105
+ console.log(formatEnvVars(envVars));
106
+ // Output confirmation as a comment (shown but not executed)
107
+ const labelInfo = label ? ` (label: ${label})` : "";
108
+ console.log(`# htpx: intercepting traffic${labelInfo}`);
109
+ console.log(`# Proxy: ${proxyUrl}`);
110
+ console.log(`# Session: ${session.id}`);
111
+ }
112
+ finally {
113
+ client.close();
114
+ }
115
+ }
116
+ catch (err) {
117
+ console.error(`# htpx error: ${getErrorMessage(err)}`);
118
+ process.exit(1);
119
+ }
120
+ });
121
+ //# sourceMappingURL=intercept.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intercept.js","sourceRoot":"","sources":["../../../src/cli/commands/intercept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjE;;;GAGG;AACH,SAAS,kBAAkB,CAAC,GAAW;IACrC,OAAO,GAAG;SACP,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,IAA4B;IACxD,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;SACxB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,E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version":3,"file":"interceptors.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/interceptors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2KpC,eAAO,MAAM,mBAAmB,SAQ5B,CAAC"}
@@ -0,0 +1,163 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
3
+ import { Command } from "commander";
4
+ import { ControlClient } from "../../shared/control-client.js";
5
+ import { getProcsiPaths } from "../../shared/project.js";
6
+ import { isDaemonRunning } from "../../shared/daemon.js";
7
+ import { requireProjectRoot, getErrorMessage, getGlobalOptions } from "./helpers.js";
8
+ const EXAMPLE_INTERCEPTOR_FILENAME = "example.ts";
9
+ const EXAMPLE_INTERCEPTOR_CONTENT = `// Example procsi interceptor
10
+ // Uncomment and modify one of the patterns below to get started.
11
+ //
12
+ // Run \`procsi interceptors reload\` after editing, or run \`procsi daemon restart\`.
13
+
14
+ import type { Interceptor } from "procsi/interceptors";
15
+
16
+ // --- Mock pattern: return a canned response without hitting the real server ---
17
+ //
18
+ // export default {
19
+ // name: "mock-users-api",
20
+ // match: (req) => req.path === "/api/users",
21
+ // handler: async () => ({
22
+ // status: 200,
23
+ // headers: { "content-type": "application/json" },
24
+ // body: JSON.stringify([{ id: 1, name: "Alice" }]),
25
+ // }),
26
+ // } satisfies Interceptor;
27
+
28
+ // --- Modify pattern: forward the request then alter the response ---
29
+ //
30
+ // export default {
31
+ // name: "inject-header",
32
+ // match: (req) => req.host.includes("example.com"),
33
+ // handler: async (ctx) => {
34
+ // const response = await ctx.forward();
35
+ // response.headers = { ...response.headers, "x-debug": "procsi" };
36
+ // return response;
37
+ // },
38
+ // } satisfies Interceptor;
39
+
40
+ // --- Observe pattern: log or inspect traffic without altering it ---
41
+ //
42
+ // export default {
43
+ // name: "log-api-calls",
44
+ // match: (req) => req.path.startsWith("/api/"),
45
+ // handler: async (ctx) => {
46
+ // ctx.log(\`\${ctx.request.method} \${ctx.request.url}\`);
47
+ // const response = await ctx.forward();
48
+ // ctx.log(\` -> \${response.status}\`);
49
+ // return response;
50
+ // },
51
+ // } satisfies Interceptor;
52
+ `;
53
+ /**
54
+ * Format interceptor info as a table row.
55
+ */
56
+ function formatInterceptorRow(name, sourceFile, hasMatch, error) {
57
+ const nameCol = name.padEnd(24);
58
+ const fileCol = sourceFile.padEnd(32);
59
+ const matchCol = hasMatch ? "yes" : "no ";
60
+ const errorCol = error ?? "";
61
+ return ` ${nameCol} ${fileCol} ${matchCol} ${errorCol}`;
62
+ }
63
+ /**
64
+ * Shared implementation for the list action (used by both `interceptors` and `interceptors list`).
65
+ */
66
+ async function listAction(command) {
67
+ const globalOpts = getGlobalOptions(command);
68
+ const projectRoot = requireProjectRoot(globalOpts.dir);
69
+ const paths = getProcsiPaths(projectRoot);
70
+ const running = await isDaemonRunning(projectRoot);
71
+ if (!running) {
72
+ console.log("Daemon is not running");
73
+ process.exit(0);
74
+ }
75
+ const client = new ControlClient(paths.controlSocketFile);
76
+ try {
77
+ const interceptors = await client.listInterceptors();
78
+ if (interceptors.length === 0) {
79
+ console.log("No interceptors loaded");
80
+ return;
81
+ }
82
+ console.log(` ${"Name".padEnd(24)} ${"Source".padEnd(32)} Match Error`);
83
+ console.log(` ${"─".repeat(24)} ${"─".repeat(32)} ${"─".repeat(5)} ${"─".repeat(20)}`);
84
+ for (const info of interceptors) {
85
+ const relativeSource = path.relative(projectRoot, info.sourceFile) || info.sourceFile;
86
+ console.log(formatInterceptorRow(info.name, relativeSource, info.hasMatch, info.error));
87
+ }
88
+ }
89
+ catch (err) {
90
+ console.error(`Error listing interceptors: ${getErrorMessage(err)}`);
91
+ process.exit(1);
92
+ }
93
+ finally {
94
+ client.close();
95
+ }
96
+ }
97
+ const listSubcommand = new Command("list")
98
+ .description("List loaded interceptors")
99
+ .action(async (_, command) => {
100
+ await listAction(command);
101
+ });
102
+ const reloadSubcommand = new Command("reload")
103
+ .description("Reload interceptors from disk")
104
+ .action(async (_, command) => {
105
+ const globalOpts = getGlobalOptions(command);
106
+ const projectRoot = requireProjectRoot(globalOpts.dir);
107
+ const paths = getProcsiPaths(projectRoot);
108
+ const running = await isDaemonRunning(projectRoot);
109
+ if (!running) {
110
+ console.log("Daemon is not running");
111
+ process.exit(0);
112
+ }
113
+ const client = new ControlClient(paths.controlSocketFile);
114
+ try {
115
+ const result = await client.reloadInterceptors();
116
+ if (result.success) {
117
+ console.log(`Reloaded ${result.count} interceptor${result.count === 1 ? "" : "s"}`);
118
+ }
119
+ else {
120
+ console.log(result.error ?? "Reload failed");
121
+ process.exit(1);
122
+ }
123
+ }
124
+ catch (err) {
125
+ console.error(`Error reloading interceptors: ${getErrorMessage(err)}`);
126
+ process.exit(1);
127
+ }
128
+ finally {
129
+ client.close();
130
+ }
131
+ });
132
+ const initSubcommand = new Command("init")
133
+ .description("Create example interceptor file")
134
+ .action(async (_, command) => {
135
+ const globalOpts = getGlobalOptions(command);
136
+ const projectRoot = requireProjectRoot(globalOpts.dir);
137
+ const paths = getProcsiPaths(projectRoot);
138
+ const interceptorsDir = paths.interceptorsDir;
139
+ if (!fs.existsSync(interceptorsDir)) {
140
+ fs.mkdirSync(interceptorsDir, { recursive: true });
141
+ }
142
+ const exampleFile = path.join(interceptorsDir, EXAMPLE_INTERCEPTOR_FILENAME);
143
+ if (fs.existsSync(exampleFile)) {
144
+ console.log(`Example file already exists: ${exampleFile}`);
145
+ return;
146
+ }
147
+ fs.writeFileSync(exampleFile, EXAMPLE_INTERCEPTOR_CONTENT, "utf-8");
148
+ console.log(`Created ${exampleFile}`);
149
+ console.log("");
150
+ console.log("Edit the file to define your interceptor, then either:");
151
+ console.log(" - Restart the daemon (procsi daemon restart)");
152
+ console.log(" - Run: procsi interceptors reload");
153
+ });
154
+ export const interceptorsCommand = new Command("interceptors")
155
+ .description("Manage request interceptors")
156
+ .addCommand(listSubcommand)
157
+ .addCommand(reloadSubcommand)
158
+ .addCommand(initSubcommand)
159
+ .action(async (_, command) => {
160
+ // Default action when no subcommand is specified — behaves like `list`
161
+ await listAction(command);
162
+ });
163
+ //# sourceMappingURL=interceptors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interceptors.js","sourceRoot":"","sources":["../../../src/cli/commands/interceptors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErF,MAAM,4BAA4B,GAAG,YAAY,CAAC;AAElD,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CnC,CAAC;AAEF;;GAEG;AACH,SAAS,oBAAoB,CAC3B,IAAY,EACZ,UAAkB,EAClB,QAAiB,EACjB,KAAc;IAEd,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1C,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE,CAAC;IAC7B,OAAO,KAAK,OAAO,IAAI,OAAO,IAAI,QAAQ,OAAO,QAAQ,EAAE,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,UAAU,CAAC,OAAgB;IACxC,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,WAAW,GAAG,kBAAk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