kernelbot 1.0.18 → 1.0.20

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/src/coder.js +23 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kernelbot",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "KernelBot — AI engineering agent with full OS control",
5
5
  "type": "module",
6
6
  "author": "Abdullah Al-Taheri <abdullah@altaheri.me>",
package/src/coder.js CHANGED
@@ -146,23 +146,26 @@ export class ClaudeCodeSpawner {
146
146
 
147
147
  ensureClaudeCodeSetup();
148
148
 
149
- logger.info(`Spawning Claude Code in ${workingDirectory}${this.model ? ` (model: ${this.model})` : ''}`);
150
- if (onOutput) onOutput(`⏳ Starting Claude Code...`).catch(() => {});
149
+ const args = [
150
+ '-p', prompt,
151
+ '--max-turns', String(turns),
152
+ '--output-format', 'stream-json',
153
+ '--verbose',
154
+ '--dangerously-skip-permissions',
155
+ ];
156
+ if (this.model) {
157
+ args.push('--model', this.model);
158
+ }
151
159
 
152
- return new Promise((resolve, reject) => {
153
- const args = [
154
- '-p', prompt,
155
- '--max-turns', String(turns),
156
- '--output-format', 'stream-json',
157
- '--dangerously-skip-permissions',
158
- ];
159
- if (this.model) {
160
- args.push('--model', this.model);
161
- }
160
+ const cmd = `claude ${args.map((a) => a.includes(' ') ? `"${a}"` : a).join(' ')}`;
161
+ logger.info(`Spawning: ${cmd.slice(0, 300)}`);
162
+ logger.info(`CWD: ${workingDirectory}`);
163
+ if (onOutput) onOutput(`⏳ Starting Claude Code...\n\`${cmd.slice(0, 200)}\``).catch(() => {});
162
164
 
165
+ return new Promise((resolve, reject) => {
163
166
  const child = spawn('claude', args, {
164
167
  cwd: workingDirectory,
165
- env: { ...process.env },
168
+ env: { ...process.env, IS_SANDBOX: '1' },
166
169
  stdio: ['ignore', 'pipe', 'pipe'],
167
170
  });
168
171
 
@@ -183,7 +186,6 @@ export class ClaudeCodeSpawner {
183
186
 
184
187
  fullOutput += trimmed + '\n';
185
188
 
186
- // Try to extract result text
187
189
  try {
188
190
  const event = JSON.parse(trimmed);
189
191
  if (event.type === 'result') {
@@ -196,10 +198,13 @@ export class ClaudeCodeSpawner {
196
198
  });
197
199
 
198
200
  child.stderr.on('data', (data) => {
199
- const chunk = data.toString();
200
- stderr += chunk;
201
- // Forward stderr too — might contain useful info
202
- logger.warn(`Claude Code stderr: ${chunk.trim().slice(0, 200)}`);
201
+ const chunk = data.toString().trim();
202
+ stderr += chunk + '\n';
203
+ logger.warn(`Claude Code stderr: ${chunk.slice(0, 300)}`);
204
+ // Forward ALL stderr to Telegram immediately
205
+ if (onOutput && chunk) {
206
+ onOutput(`⚠️ Claude Code: ${chunk.slice(0, 400)}`).catch(() => {});
207
+ }
203
208
  });
204
209
 
205
210
  const timer = setTimeout(() => {