interintel 1.0.11 → 1.0.12

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.
@@ -2,8 +2,7 @@ const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
4
  // READING FOR INITAL REFERENCE
5
- function readSpecificFiles(filePath) {
6
- const configFilePath = filePath;
5
+ function readSpecificFiles(configFilePath) {
7
6
 
8
7
  try {
9
8
  // Read the content of the config file
@@ -12,13 +11,14 @@ function readSpecificFiles(filePath) {
12
11
  const config = eval(configContent);
13
12
  // Extract the file paths from the config object
14
13
  const filePaths = config.filePaths;
15
-
14
+ const configDir = path.dirname(configFilePath);
15
+
16
16
  let allContent = '';
17
17
 
18
18
  filePaths.forEach((filePath) => {
19
19
  try {
20
20
  // Construct the absolute path
21
- const absolutePath = path.resolve(filePath);
21
+ const absolutePath = path.resolve(configDir, filePath);
22
22
 
23
23
  // Read the file content and append it to allContent
24
24
  allContent += fs.readFileSync(absolutePath, 'utf8') + '\n';
@@ -43,7 +43,8 @@ function writeFileFromPrompt(promptFileName, contentToWrite, baseDir) {
43
43
  throw new Error("Invalid file name. Please include a file name with an extension (e.g., 'output.txt').");
44
44
  }
45
45
 
46
- const fullPath = path.join(baseDir, `../interintel/session-samples/${promptFileName}`);
46
+ const projectRoot = process.cwd();
47
+ const fullPath = path.join(projectRoot, `interintel/session-samples/${promptFileName}`);
47
48
  const directoryPath = path.dirname(fullPath);
48
49
 
49
50
  if (!fs.existsSync(directoryPath)) {
package/index.js CHANGED
@@ -76,8 +76,8 @@ async function main() {
76
76
  } else if (currentState === null && userMessage.toLowerCase() === '//readrefs') {
77
77
  console.log('System message:'.bgYellow);
78
78
  console.log('Processing //readRefs command...'.yellow);
79
- const specificFiles = ['./.config.js'];
80
- const content = readSpecificFiles(specificFiles);
79
+
80
+ let content = readSpecificFiles(configPath);
81
81
  messages.push({
82
82
  role: 'user',
83
83
  content: `please just acknowledge you have read the name and the content of the files I have provided ${content}`,
@@ -103,9 +103,6 @@ async function main() {
103
103
  main();
104
104
 
105
105
 
106
- exports.main = function() {
107
- main()
108
- }
109
106
  exports.printMsg = function() {
110
107
  console.log("totally logging dude")
111
108
  }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "name": "interintel",
8
8
  "description": "The application `Interintel` is a command line interface (CLI) application implemented in Node.js. It essentially is an interactive communication tool between the user and an AI model, only openai models for now.",
9
- "version": "1.0.11",
9
+ "version": "1.0.12",
10
10
  "main": "index.js",
11
11
  "directories": {
12
12
  "doc": "docs"