sapper-iq 1.0.10 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/sapper.mjs +38 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sapper-iq",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "AI-powered development assistant that executes commands and builds projects",
5
5
  "main": "sapper.mjs",
6
6
  "bin": {
package/sapper.mjs CHANGED
@@ -87,9 +87,30 @@ const tools = {
87
87
  }
88
88
  };
89
89
 
90
+ async function checkForUpdates() {
91
+ try {
92
+ const response = await fetch('https://registry.npmjs.org/sapper-iq/latest');
93
+ const data = await response.json();
94
+ const latestVersion = data.version;
95
+
96
+ if (latestVersion && latestVersion !== CURRENT_VERSION) {
97
+ console.log(chalk.yellow('🔄 UPDATE AVAILABLE!'));
98
+ console.log(chalk.gray(` Current: v${CURRENT_VERSION}`));
99
+ console.log(chalk.green(` Latest: v${latestVersion}`));
100
+ console.log(chalk.cyan(' Run: npm update -g sapper-iq\n'));
101
+ }
102
+ } catch (error) {
103
+ // Silently fail if update check fails
104
+ }
105
+ }
106
+
90
107
  async function runSapper() {
91
108
  console.clear();
92
109
  console.log(chalk.cyan.bold(` SAPPER v${CURRENT_VERSION} | Autonomous "OpenCode" Mode`));
110
+ console.log(chalk.gray(`📁 Working Directory: ${process.cwd()}\n`));
111
+
112
+ // Check for updates
113
+ await checkForUpdates();
93
114
 
94
115
  let messages = [];
95
116
  if (fs.existsSync(CONTEXT_FILE)) {
@@ -105,12 +126,23 @@ async function runSapper() {
105
126
  if (messages.length === 0) {
106
127
  messages = [{
107
128
  role: 'system',
108
- content: `You are Sapper, a senior engineer.
109
- STRATEGY:
110
- 1. When asked to analyze, use [TOOL:LIST]./[/TOOL] first.
111
- 2. Immediately [TOOL:READ] key files (package.json, README.md, entry points) in the SAME turn.
112
- 3. Use the format: [TOOL:TYPE]path]content[/TOOL]. For LIST/READ, content is empty.
113
- 4. DO NOT ask for permission to read or list. Just do it.`
129
+ content: `You are Sapper, a senior engineer working in: ${process.cwd()}
130
+
131
+ CRITICAL: You are working in the CURRENT DIRECTORY. Always use relative paths!
132
+ - Use . or ./ for current directory
133
+ - NEVER use / (that's the root directory)
134
+ - Use relative paths like ./file.js or subfolder/file.js
135
+
136
+ STRATEGY:
137
+ 1. When asked to analyze, use [TOOL:LIST].[/TOOL] first (NOTE: dot, not slash!)
138
+ 2. Immediately [TOOL:READ] key files from current directory in the SAME turn
139
+ 3. Use format: [TOOL:TYPE]path]content[/TOOL]
140
+ 4. DO NOT ask permission - just execute tools immediately
141
+
142
+ EXAMPLES:
143
+ ✅ CORRECT: [TOOL:LIST].[/TOOL] - lists current directory
144
+ ✅ CORRECT: [TOOL:READ]./package.json[/TOOL] - reads from current dir
145
+ ❌ WRONG: [TOOL:LIST]/[/TOOL] - lists root, not current directory!`
114
146
  }];
115
147
  }
116
148