skyloom 1.4.0 → 1.4.1

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/cli/main.ts +18 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skyloom",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "天空织机 Skyloom — 6 weather-themed AI agents: Fog, Rain, Frost, Snow, Dew, Fair",
5
5
  "preferGlobal": true,
6
6
  "type": "commonjs",
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
- // If no args or just "chat", start interactive chat
381
- if (args.length === 0 || args[0] === 'chat' || (args.length === 1 && !args[0].startsWith('-') && !['task', 'web', 'config', 'init', 'version'].includes(args[0]))) {
382
- // Check if first arg is an agent name
383
- const knownAgents = new Set(['fog', 'rain', 'frost', 'snow', 'dew', 'fair']);
384
- let agent = 'fog';
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
- for (let i = 0; i < args.length; i++) {
388
- if (knownAgents.has(args[i])) {
389
- agent = args[i];
390
- } else if (args[i] === '-m' || args[i] === '--model') {
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
- await interactiveChat(agent, model);
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