instar 0.7.10 → 0.7.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.
@@ -585,23 +585,57 @@ Append if not present:
585
585
  .instar/logs/
586
586
  ```
587
587
 
588
- ## Phase 5: Summary & Launch
588
+ ## Phase 5: Launch & Handoff
589
589
 
590
- Show what was created briefly, then get the user to their agent.
590
+ **Do NOT ask "want me to start the server?" — just start it.** There is no reason not to. The whole point of setup is to get the agent running.
591
591
 
592
- **If Telegram was configured — this is the moment:**
592
+ ### Step 5a: Start the Server
593
593
 
594
- > "That's everything. Let me start the server, and then open Telegram and say hello to your agent. That's your primary channel from here on — no terminal needed."
594
+ Run the server in the background:
595
+ ```bash
596
+ cd <project_dir> && npx instar server start &
597
+ ```
598
+
599
+ Wait a few seconds, then verify it's running:
600
+ ```bash
601
+ curl -s http://localhost:<port>/health
602
+ ```
595
603
 
596
- Start the server, then direct them to Telegram. The setup is complete when the user is talking to their agent in Telegram, not when config files are written.
604
+ If the health check fails, retry once. If still failing, tell the user what happened and suggest `instar server start` manually.
597
605
 
598
- **If Telegram was NOT configured:**
606
+ ### Step 5b: Agent Greets the User via Telegram
599
607
 
600
- > "Start the server with `instar server start`. You can talk to your agent through Claude Code sessions. When you're ready for a richer experience, just ask your agent to help set up Telegram."
608
+ **If Telegram was configured, the new agent should reach out to the user.** This is the magic moment the agent comes alive.
609
+
610
+ Send a greeting message from the bot to the Telegram group using the Bot API:
611
+
612
+ ```bash
613
+ curl -s -X POST "https://api.telegram.org/bot${TOKEN}/sendMessage" \
614
+ -H 'Content-Type: application/json' \
615
+ -d '{"chat_id": "<CHAT_ID>", "text": "<GREETING>"}'
616
+ ```
617
+
618
+ The greeting should be **in the agent's voice** — using the name, personality, and tone defined in Step 2. For example, if the agent is named "Scout" and is casual:
619
+
620
+ > "Hey! I'm Scout, your new project agent. I'm up and running — talk to me here anytime. I'll be watching over the codebase and reaching out when something matters. What should we tackle first?"
621
+
622
+ Keep it short (2-3 sentences), in character, and inviting.
623
+
624
+ ### Step 5c: Tell the User
625
+
626
+ After the server is running and the greeting is sent:
627
+
628
+ > "All done! [Agent name] just messaged you in Telegram. From here on, that's your primary channel — just talk to your agent there."
629
+ >
630
+ > "As long as your computer is running the Instar server, your agent is available."
631
+
632
+ **Do NOT present a list of CLI commands or next steps.** The setup wizard's job is done. The user's next action is opening Telegram and replying to their agent.
633
+
634
+ **If Telegram was NOT configured:**
601
635
 
602
- Offer to start the server.
636
+ Start the server, then:
603
637
 
604
- **Important:** Do NOT present a list of CLI commands. The setup's job is to get the user FROM the terminal TO their agent. After starting the server, the user talks to their agent (through Telegram), not to the CLI. The terminal was just the on-ramp.
638
+ > "Server is running. You can talk to your agent through Claude Code sessions. When you're ready for a richer experience, just ask your agent to help set up Telegram."
605
639
 
606
640
  ## Phase 6: Post-Setup Feedback (Optional)
607
641
 
@@ -444,34 +444,35 @@ async function runClassicSetup() {
444
444
  }
445
445
  console.log();
446
446
  }
447
- // Offer to start server
448
- const startNow = await confirm({
449
- message: 'Start the agent server now?',
450
- default: true,
451
- });
452
- if (startNow) {
453
- console.log();
454
- const { startServer } = await import('./server.js');
455
- await startServer({ foreground: false });
456
- if (telegramConfig?.chatId) {
457
- console.log();
458
- console.log(pc.bold(' Now open Telegram and say hello to your agent.'));
459
- console.log(pc.dim(' That\'s your primary channel from here on — no terminal needed.'));
447
+ // Auto-start server — no reason to ask
448
+ console.log();
449
+ console.log(pc.dim(' Starting server...'));
450
+ const { startServer } = await import('./server.js');
451
+ await startServer({ foreground: false });
452
+ if (telegramConfig?.chatId) {
453
+ // Send a greeting from the new agent via Telegram
454
+ try {
455
+ const greeting = `Hey! I'm ${projectName}, your new agent. I'm up and running — talk to me here anytime. What should we work on first?`;
456
+ execFileSync('curl', [
457
+ '-s', '-X', 'POST',
458
+ `https://api.telegram.org/bot${telegramConfig.token}/sendMessage`,
459
+ '-H', 'Content-Type: application/json',
460
+ '-d', JSON.stringify({ chat_id: telegramConfig.chatId, text: greeting }),
461
+ ], { stdio: ['pipe', 'pipe', 'pipe'], timeout: 10000 });
460
462
  }
463
+ catch {
464
+ // Non-fatal — the agent will greet on first session
465
+ }
466
+ console.log();
467
+ console.log(pc.bold(` All done! ${projectName} just messaged you in Telegram.`));
468
+ console.log(pc.dim(' That\'s your primary channel from here on — no terminal needed.'));
469
+ console.log(pc.dim(' As long as your computer is running the Instar server, your agent is available.'));
461
470
  }
462
471
  else {
463
472
  console.log();
464
- console.log(' To start the server:');
465
- console.log(` ${pc.cyan('instar server start')}`);
466
- console.log();
467
- if (telegramConfig?.chatId) {
468
- console.log(' Then open Telegram and say hello to your agent.');
469
- console.log(' That\'s your primary channel — no terminal needed.');
470
- }
471
- else {
472
- console.log(' Once running, just talk to your agent through Claude Code sessions.');
473
- console.log(' For a richer experience, set up Telegram later with your agent\'s help.');
474
- }
473
+ console.log(pc.bold(' Server is running.'));
474
+ console.log(pc.dim(' Talk to your agent through Claude Code sessions.'));
475
+ console.log(pc.dim(' For a richer experience, ask your agent to help set up Telegram.'));
475
476
  }
476
477
  // ── Post-setup feedback ──────────────────────────────────────────
477
478
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "0.7.10",
3
+ "version": "0.7.12",
4
4
  "description": "Persistent autonomy infrastructure for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",