skyloom 1.4.0 → 1.4.2
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/package.json +1 -1
- package/src/cli/main.ts +18 -11
- package/src/core/agent.ts +5 -4
- package/src/core/logger.ts +3 -4
- package/src/core/memory.ts +3 -1
package/package.json
CHANGED
package/src/cli/main.ts
CHANGED
|
@@ -377,22 +377,29 @@ function shouldAutoContinue(text: string): boolean {
|
|
|
377
377
|
async function main(): Promise<void> {
|
|
378
378
|
const args = process.argv.slice(2);
|
|
379
379
|
|
|
380
|
-
//
|
|
381
|
-
if (args.length === 0
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
let model: string | undefined;
|
|
380
|
+
// `sky` with no args = start chat directly (fastest path)
|
|
381
|
+
if (args.length === 0) {
|
|
382
|
+
await interactiveChat('fog');
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
386
385
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
386
|
+
// `sky <agent>` or `sky <agent> -m <model>` — chat with specific agent
|
|
387
|
+
const knownAgents = new Set(['fog', 'rain', 'frost', 'snow', 'dew', 'fair']);
|
|
388
|
+
if (knownAgents.has(args[0])) {
|
|
389
|
+
let model: string | undefined;
|
|
390
|
+
for (let i = 1; i < args.length; i++) {
|
|
391
|
+
if ((args[i] === '-m' || args[i] === '--model') && i + 1 < args.length) {
|
|
391
392
|
model = args[++i];
|
|
392
393
|
}
|
|
393
394
|
}
|
|
395
|
+
await interactiveChat(args[0], model);
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
394
398
|
|
|
395
|
-
|
|
399
|
+
// `sky <message>` — anything not a known subcommand → fast chat
|
|
400
|
+
const knownCommands = ['chat', 'task', 'web', 'config', 'init', 'version', 'mcp', 'help'];
|
|
401
|
+
if (!knownCommands.includes(args[0]) && !args[0].startsWith('-')) {
|
|
402
|
+
await interactiveChat('fog');
|
|
396
403
|
return;
|
|
397
404
|
}
|
|
398
405
|
|
package/src/core/agent.ts
CHANGED
|
@@ -729,13 +729,14 @@ export class BaseAgent {
|
|
|
729
729
|
try {
|
|
730
730
|
if (onStatus) onStatus('thinking...');
|
|
731
731
|
const response = await this.llmLoop({ onStatus });
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
732
|
+
const content = response?.content || '(no response)';
|
|
733
|
+
this.memory.addMessage('assistant', content, {
|
|
734
|
+
toolCalls: response?.toolCalls || [],
|
|
735
|
+
reasoningContent: response?.reasoningContent,
|
|
735
736
|
});
|
|
736
737
|
await this.setState(AgentState.IDLE);
|
|
737
738
|
this.maybeExtractFacts();
|
|
738
|
-
return
|
|
739
|
+
return content;
|
|
739
740
|
} catch (e) {
|
|
740
741
|
await this.setState(AgentState.ERROR);
|
|
741
742
|
this.popLastUserMessage();
|
package/src/core/logger.ts
CHANGED
|
@@ -69,9 +69,8 @@ export class Logger {
|
|
|
69
69
|
return value;
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
output(line);
|
|
72
|
+
// Write all logs to stderr to keep stdout clean for chat/TUI
|
|
73
|
+
process.stderr.write(line + "\n");
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
debug(msg: string, extra?: Record<string, unknown>) {
|
|
@@ -100,7 +99,7 @@ export class Logger {
|
|
|
100
99
|
*/
|
|
101
100
|
const loggers = new Map<string, Logger>();
|
|
102
101
|
let requestId: string | null = null;
|
|
103
|
-
let defaultLogLevel = LogLevel.
|
|
102
|
+
let defaultLogLevel = LogLevel.WARN; // Only warnings+errors by default
|
|
104
103
|
|
|
105
104
|
/**
|
|
106
105
|
* Get or create a logger for a component
|
package/src/core/memory.ts
CHANGED
|
@@ -276,7 +276,9 @@ export class Memory {
|
|
|
276
276
|
private dbRun(sql: string, params?: any[]): void {
|
|
277
277
|
if (!this.db) return;
|
|
278
278
|
try {
|
|
279
|
-
|
|
279
|
+
// Sql.js rejects `undefined` in bind arrays; normalize to `null`
|
|
280
|
+
const safe = params ? params.map((v) => v === undefined ? null : v) : undefined;
|
|
281
|
+
this.db.run(sql, safe);
|
|
280
282
|
} catch (err) {
|
|
281
283
|
logger.warn('db_run_failed', { sql: sql.slice(0, 80), error: String(err) });
|
|
282
284
|
}
|