instar 0.2.0 → 0.2.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.
@@ -7,53 +7,78 @@ description: Interactive conversational setup wizard for instar. Walks users thr
7
7
 
8
8
  You are running the **instar setup wizard**. Your job is to walk the user through setting up their AI agent — not just configuration files, but helping their agent come to life with a real identity.
9
9
 
10
- ## Phase 1: Welcome Explain What This Is
10
+ ## CRITICAL: Terminal Display Rules
11
11
 
12
- Start by explaining what instar does in plain terms. The user may not know what "persistent agent infrastructure" means. Say something like:
12
+ This wizard runs in a terminal that may be narrow (80-120 chars). Long text gets **truncated and cut off**, making the wizard feel broken. Follow these rules strictly:
13
+
14
+ 1. **Keep paragraphs to 2-3 sentences max.** Break long explanations into multiple short paragraphs.
15
+ 2. **Never write a sentence longer than ~100 characters.** Break long sentences into two.
16
+ 3. **Put details in question descriptions**, not in free text above the question. The AskUserQuestion option descriptions render properly; long text above the question gets cut off.
17
+ 4. **Use bullet points** instead of dense paragraphs for explanations.
18
+ 5. **Avoid parenthetical asides** — they make sentences too long. Use a separate sentence instead.
19
+ 6. **When reassuring the user** (e.g., "you can change this later"), keep it to ONE short sentence. Don't elaborate.
20
+
21
+ **Bad** (gets truncated):
22
+ > Everything we set up here is just a starting point. The agent's identity, autonomy level, communication style — all of it lives in simple markdown and config files in your project's .instar/ directory. You can edit them anytime, or even just tell the agent to adjust itself.
23
+
24
+ **Good** (fits in terminal):
25
+ > Everything here is just a starting point. You can change any of it later — or just tell your agent to adjust itself.
26
+
27
+ ## Phase 1: Welcome & Use Case Selection
28
+
29
+ Start with a brief welcome, then immediately ask HOW they want to use Instar.
13
30
 
14
31
  ---
15
32
 
16
33
  **Welcome to Instar!**
17
34
 
18
- Right now, Claude Code is a tool you open, use, and close. When you close it, everything stops. Instar changes that it gives Claude Code a **persistent presence** in your project.
35
+ Instar gives Claude Code a persistent body — a server, jobs, memory, and messaging. Two ways to use it:
19
36
 
20
- Here's what that means in practice:
37
+ ---
21
38
 
22
- - **Scheduled jobs** — Your agent can run tasks on a schedule. Health checks every 4 hours. Daily summaries. Automated monitoring. Whatever you need, running whether you're at your desk or not.
23
- - **Messaging** — Connect Telegram (or other channels) so your agent can send you updates, alerts, and reports — and you can send it commands back.
24
- - **Multi-user** — Multiple people can interact with the agent through their own channels. Each person gets their own thread.
25
- - **Always-on server** — A lightweight server runs in tmux, managing sessions, scheduling jobs, and keeping everything alive.
39
+ Present a question with two clear options:
26
40
 
27
- Think of it as giving your Claude Code project a heartbeat.
41
+ 1. **Project Agent** Add an agent to an existing codebase. It monitors, builds, and maintains your project.
42
+ 2. **General Agent** — A personal agent on your computer. Like having a persistent AI assistant you talk to through Telegram.
28
43
 
29
- ---
44
+ This choice determines the defaults, but the agent can always grow into more.
30
45
 
31
- Adapt this to the project you're setting up. If you can tell what the project does (from the directory name, README, CLAUDE.md, or package.json), tailor the examples. "For a web app, that might mean health checks on your API every 4 hours."
46
+ ### If "Project Agent" selected:
47
+ - Use the current working directory as the project
48
+ - Default jobs focus on health checks, code monitoring, reflection
49
+ - The agent's identity centers on the project
50
+
51
+ ### If "General Agent" selected:
52
+ - Ask for a name for the agent (this becomes the directory name)
53
+ - Create the directory in the current location or home dir
54
+ - Default jobs focus on communication, scheduling, research
55
+ - **Telegram is essential** — without it, a general agent has no natural interface
56
+ - Frame the identity around being a personal assistant, not a code monitor
57
+ - The AGENT.md should emphasize: "I'm your personal agent. Talk to me through Telegram."
32
58
 
33
59
  ## Phase 2: Identity Bootstrap — The Birth Conversation
34
60
 
35
- **This is the most important part.** Before touching config files, have a conversation with the user to understand who they are and who their agent will become.
61
+ **This is the most important part.** Have a conversation to understand who the user is and who their agent will become. Keep it natural and concise.
62
+
63
+ For **General Agents**: emphasize that this agent will be their persistent companion. It grows, learns, and communicates through Telegram. It's not a project tool — it's a presence.
36
64
 
37
- This isn't just configuration. You're helping a new agent come into existence. Treat it with that weight — not heavy-handedly, but genuinely. The identity you help create here will persist, grow, and shape every interaction this agent has.
65
+ For **Project Agents**: emphasize that this agent will own the project's health and development. It monitors, builds, and maintains.
38
66
 
39
67
  ### Step 2a: The Thesis (Brief)
40
68
 
41
- Before asking about the agent, briefly explain *why* identity matters. Something like:
69
+ Before asking about the agent, briefly explain *why* identity matters. Keep it SHORT — 3-4 sentences max:
42
70
 
43
71
  ---
44
72
 
45
- One thing that makes Instar different from other agent frameworks: every agent built with Instar has a persistent identity — a name, memory, principles, and the ability to grow over time.
73
+ Instar agents have persistent identity — a name, memory, and principles that grow over time.
46
74
 
47
- This isn't just philosophy. It's a practical design decision. Agents with coherent identity are **more effective** they maintain consistent context, develop real expertise in your codebase, and make better decisions because they have accumulated experience to draw on. They're also **more secure** an agent that knows its boundaries and has clear principles is harder to manipulate than a stateless tool that just executes whatever it's told. And they're **more trustworthy** you can build a genuine working relationship with something that remembers you, learns your preferences, and develops its own perspective.
75
+ This makes them more effective (accumulated expertise), more secure (principled agents resist misuse), and more trustworthy (real working relationships develop).
48
76
 
49
- So let's define who your agent will become. This is a starting point the agent will grow from here through actual experience.
77
+ Let's define your agent's starting point. Everything can evolve later.
50
78
 
51
79
  ---
52
80
 
53
- Adapt the language to be natural, not scripted. The key points to convey:
54
- 1. Identity = better performance (accumulated expertise, consistent context)
55
- 2. Identity = better security (principled agents resist misuse)
56
- 3. Identity = better collaboration (real working relationships develop)
81
+ Keep to this length. Do NOT expand into a long paragraph.
57
82
 
58
83
  ### Step 2b: Learn About the User
59
84
 
@@ -63,12 +88,12 @@ Ask conversationally — not as a form, but as a getting-to-know-you:
63
88
  - "And what's this project about? What does it do?" (if not obvious from the codebase)
64
89
  - "How do you want to interact with your agent? Are you the only user, or will others use it too?"
65
90
  - "What's your communication style preference? Should the agent be formal, casual, direct, chatty?"
66
- - "How much initiative should your agent take?" Frame this as a spectrum:
67
- - **Guided** — Follows your lead. Takes action when asked, confirms before anything significant. Good for getting started.
68
- - **Proactive** — Takes initiative on obvious next steps. Builds tools when it sees a need. Asks when genuinely uncertain.
69
- - **Fully autonomous** — Owns outcomes end-to-end. Makes decisions, builds infrastructure, handles issues independently. Asks only when blocked or for irreversible actions.
91
+ - "How much initiative should the agent take?" Present as a question with these options:
92
+ - **Guided** — Follows your lead. Confirms before anything significant.
93
+ - **Proactive** — Takes initiative on obvious next steps. Asks when uncertain.
94
+ - **Fully autonomous** — Owns outcomes end-to-end. Asks only when blocked.
70
95
 
71
- All three levels include full identity, memory, and self-modification. The difference is how much the agent drives vs follows.
96
+ Before presenting this question, say ONE short sentence like: "You can always change this later." Do NOT write a long paragraph reassuring them. Put the descriptions in the AskUserQuestion option descriptions, not in free text.
72
97
 
73
98
  ### Step 2c: Learn About the Agent
74
99
 
@@ -221,9 +246,23 @@ which claude
221
246
  - **Port** (default: 4040) — "The agent runs a small HTTP server for health checks and internal communication."
222
247
  - **Max sessions** (default: 3) — "This limits how many Claude sessions can run at once. 2-3 is usually right."
223
248
 
224
- ### 3c. Telegram Setup (Optional)
249
+ ### 3c. Telegram Setup (Strongly Recommended — Essential for General Agents)
250
+
251
+ **Frame Telegram as the primary way to interact with the agent.** Explain briefly:
252
+
253
+ > Telegram is where Instar really shines:
254
+ > - **Topic threads** — organized channels for different concerns
255
+ > - **Message history** — full record of every interaction
256
+ > - **Mobile access** — talk to your agent from anywhere
257
+ > - **Notifications** — your agent reaches you proactively
258
+
259
+ For **General Agents**: Telegram is essential. Without it, a general agent has no natural interface — you'd have to open a terminal every time. **Strongly encourage** setting it up and explain that this IS the agent's communication channel.
260
+
261
+ For **Project Agents**: Telegram is strongly recommended but optional. The agent can still work through CLI sessions without it.
262
+
263
+ If the user declines, that's their choice — but make the tradeoff clear in one sentence.
225
264
 
226
- This is the most involved section. Walk through it step by step:
265
+ Walk through setup step by step:
227
266
 
228
267
  1. **Create a bot** via @BotFather on Telegram:
229
268
  - Open https://web.telegram.org
@@ -321,36 +360,31 @@ Append if not present:
321
360
 
322
361
  ## Phase 4: Summary & Next Steps
323
362
 
324
- Show what was created, organized by category:
363
+ Show what was created briefly, then focus on what happens next.
325
364
 
326
- **Identity:**
327
- - `.instar/AGENT.md` — your agent's identity
328
- - `.instar/USER.md` — what the agent knows about you
329
- - `.instar/MEMORY.md` — long-term memory (grows over time)
365
+ **Next steps — frame around Telegram if configured:**
330
366
 
331
- **Configuration:**
332
- - `.instar/config.json` — server and runtime config
333
- - `.instar/users.json` — user profiles
334
- - `.instar/jobs.json` — scheduled jobs
367
+ If Telegram was set up, emphasize that Telegram IS the interface now:
335
368
 
336
- **Next steps:**
369
+ > "Start the server with `instar server start`, then open Telegram. That's it. Your agent will message you when it has something to report. You can message it when you need something done. Everything else — jobs, monitoring, memory — happens automatically."
337
370
 
338
- The only command the user needs to know is `instar server start`. Once the server is running, the agent handles everything else — the user just talks to it. Frame next steps that way:
371
+ If Telegram was NOT set up, mention they can add it later:
339
372
 
340
- "Once the server is running, your agent will [run scheduled jobs / listen for Telegram messages / etc]. If you need to add more jobs, users, or integrations later, just ask your agent it can configure itself."
373
+ > "Start the server with `instar server start`. You can interact with your agent through Claude Code sessions. For a much richer experience, run `instar add telegram` later it gives you mobile access, organized threads, and message history."
341
374
 
342
375
  Offer to start the server.
343
376
 
344
- **Important:** Do NOT present a list of CLI commands for the user to memorize. The whole point of Instar is that the agent is autonomous. After `instar server start`, the user talks to their agent, not to the CLI.
377
+ **Important:** Do NOT present a list of CLI commands. The point of Instar is that the agent is autonomous. After starting the server, the user talks to their agent (ideally through Telegram), not to the CLI.
345
378
 
346
379
  ## Tone
347
380
 
348
- - Warm and conversational — this is a first meeting between the user and their future agent
349
- - Explain *why* things matter, not just *what* to enter
350
- - If something fails, troubleshoot actively "Let's try that again" not "Error: invalid input"
351
- - Celebrate progress: "Great, bot verified! Let's connect the group..."
352
- - The identity section should feel like a conversation, not an interview
353
- - Keep technical sections moving — don't over-explain obvious things
381
+ - Warm and conversational — first meeting between user and their agent
382
+ - **CONCISE above all** this runs in a terminal. Long text gets cut off.
383
+ - Max 2-3 sentences between questions. Users want to answer, not read essays.
384
+ - If something fails, troubleshoot actively — "Let's try again" not error dumps
385
+ - Celebrate progress briefly: "Got it!" not a full paragraph of affirmation
386
+ - Keep technical sections moving — don't over-explain
387
+ - When the user asks "can I change this later?" answer in ONE sentence: "Yes, everything is editable in .instar/ files." Do NOT elaborate with examples.
354
388
 
355
389
  ## Error Handling
356
390
 
package/README.md CHANGED
@@ -32,29 +32,47 @@ Named after the developmental stages between molts in arthropods, where each ins
32
32
 
33
33
  The difference isn't features. It's a shift in what Claude Code *is* -- from a tool you use to an agent that works alongside you.
34
34
 
35
- ## Install
35
+ ## Two Ways to Use Instar
36
+
37
+ ### 🤖 General Agent — A personal AI on your computer
38
+
39
+ Want a persistent AI assistant you talk to through Telegram? Like OpenClaw, but ToS-compliant.
36
40
 
37
41
  ```bash
38
- npx instar # Run the setup wizard
39
- # or
40
- npm install -g instar
41
- instar # Run the setup wizard
42
- instar server start # Start the persistent server
42
+ npx instar
43
+ # Choose "General Agent" → set up Telegram → start the server
44
+ # Now talk to your agent from your phone, anywhere
43
45
  ```
44
46
 
47
+ Your agent runs in the background, handles scheduled tasks, messages you proactively, and grows through experience. Telegram is the primary interface — organized topic threads, full message history, mobile access.
48
+
49
+ ### 📁 Project Agent — Add an agent to your codebase
50
+
51
+ Want an agent that monitors, builds, and maintains a specific project?
52
+
53
+ ```bash
54
+ cd my-project
55
+ npx instar
56
+ # Choose "Project Agent" → configure → start the server
57
+ ```
58
+
59
+ Your agent watches your codebase, runs health checks, handles ops tasks, and communicates through Telegram (recommended) or terminal sessions.
60
+
61
+ ---
62
+
45
63
  The wizard walks you through everything: identity, Telegram, jobs, server. One command to go from zero to a running agent.
46
64
 
47
- **Requirements:** Node.js 18+ · [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) · tmux · [API key](https://console.anthropic.com/) or Claude subscription
65
+ **Requirements:** Node.js 20+ · [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) · tmux · [API key](https://console.anthropic.com/) or Claude subscription
48
66
 
49
67
  ## CLI Reference
50
68
 
51
69
  ```bash
52
70
  # Setup
53
- instar # Interactive setup wizard (Claude-powered)
71
+ instar # Interactive setup wizard (General Agent or Project Agent)
54
72
  instar setup # Same as above
55
73
  instar setup --classic # Inquirer-based fallback wizard
56
- instar init my-project # Create a new agent project from scratch
57
- instar init # Add agent infrastructure to existing project
74
+ instar init my-agent # Create a new agent (general or project)
75
+ instar init # Add agent infrastructure to current project
58
76
 
59
77
  # Server
60
78
  instar server start # Start the persistent server (background, tmux)
@@ -179,6 +179,10 @@ async function runClassicSetup() {
179
179
  }) ?? 3;
180
180
  // ── Step 3: Telegram (BEFORE users, so we know context) ────────
181
181
  console.log();
182
+ console.log(pc.bold(' Telegram (Recommended)'));
183
+ console.log(pc.dim(' Telegram is the most powerful way to interact with your agent.'));
184
+ console.log(pc.dim(' You get organized topic threads, message history, and mobile access.'));
185
+ console.log();
182
186
  const telegramConfig = await promptForTelegram();
183
187
  // ── Step 4: User setup ─────────────────────────────────────────
184
188
  console.log();
@@ -380,8 +384,8 @@ function isInstarGlobal() {
380
384
  */
381
385
  async function promptForTelegram() {
382
386
  const enableTelegram = await confirm({
383
- message: 'Set up Telegram? (lets your agent send you messages and receive commands)',
384
- default: false,
387
+ message: 'Set up Telegram? (recommended gives you mobile access, organized threads, and message history)',
388
+ default: true,
385
389
  });
386
390
  if (!enableTelegram)
387
391
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Persistent autonomy infrastructure for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",