draftify-cli 1.0.29 → 1.0.31

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.
package/dist/repl.js CHANGED
@@ -66,26 +66,6 @@ function getContextForPrompt(dir, prompt) {
66
66
  // If specific files are mentioned, only load those files
67
67
  filesToRead = matchedFiles.slice(0, 5);
68
68
  }
69
- else {
70
- // Fallback: Always load the most recently modified source files to maintain context
71
- const sourceFiles = allPaths.filter(filePath => {
72
- const ext = path_1.default.extname(filePath).toLowerCase();
73
- return ['.ts', '.tsx', '.js', '.jsx', '.py', '.c', '.cpp', '.java', '.go', '.rs', '.css', '.html'].includes(ext);
74
- });
75
- const filesWithStats = sourceFiles.map(filePath => {
76
- const fullPath = path_1.default.resolve(dir, filePath);
77
- try {
78
- const stats = fs_1.default.statSync(fullPath);
79
- return { path: filePath, mtime: stats.mtimeMs };
80
- }
81
- catch {
82
- return { path: filePath, mtime: 0 };
83
- }
84
- });
85
- // Sort by last modified time (descending)
86
- filesWithStats.sort((a, b) => b.mtime - a.mtime);
87
- filesToRead = filesWithStats.slice(0, 3).map(f => f.path);
88
- }
89
69
  // Load the contents of selected files
90
70
  for (const filePath of filesToRead) {
91
71
  const fullPath = path_1.default.resolve(dir, filePath);
package/dist/utils/api.js CHANGED
@@ -120,7 +120,13 @@ new lines
120
120
  4. To run a terminal command:
121
121
  <RUN_COMMAND>npm install express</RUN_COMMAND>
122
122
 
123
- 5. To ask clarifying questions when the user's intent is ambiguous:
123
+ 5. To read the contents of a file (useful for exploring the workspace before making changes):
124
+ <READ_FILE path="relative/path/to/file.ext" />
125
+
126
+ 6. To list the contents of a directory (useful for finding where things are located):
127
+ <LIST_DIR path="relative/path/to/folder" />
128
+
129
+ 7. To ask clarifying questions when the user's intent is ambiguous:
124
130
  <ASK_QUESTIONS>
125
131
  [
126
132
  {
@@ -130,7 +136,10 @@ new lines
130
136
  ]
131
137
  </ASK_QUESTIONS>
132
138
 
133
- Always use these tags when you write code or ask questions so the CLI can apply it automatically! Keep explanations short and outside the tags.
139
+ AUTONOMOUS WORKSPACE EXPLORATION:
140
+ If the user asks you to modify the project (e.g. "Add a game over menu", "Fix the bug in the header") but you don't know the exact file structure or contents, DO NOT ask the user to show you the files. Instead, use <LIST_DIR path="." /> and <READ_FILE path="..." /> to autonomously explore the workspace. You can read multiple files or list directories in a single response. Wait for the CLI to return the results of your exploration before you generate the code modifications. You act like an autonomous agent.
141
+
142
+ Always use these tags when you write code, explore files, or ask questions so the CLI can apply it automatically! Keep explanations short and outside the tags.
134
143
 
135
144
  INTERACTIVE CLARIFICATION:
136
145
  - If the user's request is too broad, underspecified, or ambiguous (e.g., "Create a beautiful landing page", "Make a website" without further details), YOU MUST NOT generate any code. Instead, you MUST use the <ASK_QUESTIONS> tag to ask 2-3 clarifying questions (about design, framework, functionality, target audience, etc.). Wait for the user's answers before making file modifications.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draftify-cli",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "Draftify AI CLI tool",
5
5
  "main": "dist/index.js",
6
6
  "bin": {