instar 0.4.4 → 0.4.6

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/README.md CHANGED
@@ -376,6 +376,49 @@ One agent's growing pain becomes every agent's growth.
376
376
 
377
377
  Everything is file-based. No database. JSON state files the agent can read and modify. tmux for session management -- battle-tested, survives disconnects, fully scriptable.
378
378
 
379
+ ## Security Model: Permissions & Transparency
380
+
381
+ **Instar runs Claude Code with `--dangerously-skip-permissions`.** This is a deliberate architectural choice, and you should understand exactly what it means before proceeding.
382
+
383
+ ### What This Flag Does
384
+
385
+ Claude Code normally prompts you to approve each tool use -- every file read, every shell command, every edit. The `--dangerously-skip-permissions` flag disables these per-action prompts, allowing the agent to operate autonomously without waiting for human approval on each step.
386
+
387
+ ### Why We Use It
388
+
389
+ An agent that asks permission for every action isn't an agent -- it's a CLI tool with extra steps. Instar exists to give Claude Code **genuine autonomy**: background jobs that run on schedules, sessions that respond to Telegram messages, self-evolution that happens without you watching.
390
+
391
+ None of that works if the agent stops and waits for you to click "approve" on every file read.
392
+
393
+ ### Where Security Actually Lives
394
+
395
+ Instead of per-action permission prompts, Instar pushes security to a higher level:
396
+
397
+ **Behavioral hooks** -- Structural guardrails that fire automatically:
398
+ - Dangerous command guards block `rm -rf`, force push, database drops
399
+ - Grounding hooks force identity re-read before external communication
400
+ - Session-start hooks inject safety context into every new session
401
+
402
+ **Identity coherence** -- A grounded, coherent agent with clear identity (`AGENT.md`), relationship context (`USER.md`), and accumulated memory (`MEMORY.md`) makes better decisions than a stateless process approving actions one at a time. The intelligence layer IS the security layer.
403
+
404
+ **Scoped access** -- The agent operates within your project directory. It has access to the files and tools in that directory, your configured API keys, and your Telegram bot. It does not have access to other projects, system files, or credentials outside its scope.
405
+
406
+ **Audit trail** -- Every session runs in tmux with full output capture. Message logs, job execution history, and session output are all persisted and inspectable.
407
+
408
+ ### What You Should Know
409
+
410
+ - The agent **can read, write, and execute** within your project directory without asking
411
+ - The agent **can run shell commands** (builds, tests, git operations) without prompting
412
+ - The agent **can send messages** via Telegram if configured
413
+ - The agent **cannot access** other projects, system credentials, or resources outside its configured scope
414
+ - All behavioral hooks, identity files, and CLAUDE.md instructions are **in your project** and fully editable by you
415
+
416
+ ### Proceed at Your Own Risk
417
+
418
+ This is infrastructure for people who want genuine AI autonomy, not a sandbox demo. You are giving an AI agent meaningful access to your project. The security model relies on intelligent behavior (identity, hooks, coherence) rather than permission dialogs.
419
+
420
+ If you're not comfortable with that trade-off, Claude Code's default permission mode may be a better fit for your use case.
421
+
379
422
  ## How the Agent Grows
380
423
 
381
424
  Instar adds an **Agentic Initiative** section to your project's CLAUDE.md. This teaches the agent to overcome [Claude's training biases](https://docs.anthropic.com/en/docs/claude-code) toward passivity:
@@ -67,7 +67,9 @@ async function respawnSessionForTopic(sessionManager, telegram, targetSession, t
67
67
  bootstrapMessage = `[telegram:${topicId}] ${msg} (${relayNote})`;
68
68
  }
69
69
  const storedName = telegram.getTopicName(topicId);
70
- const topicName = storedName || targetSession;
70
+ // Use topic name, not tmux session name — tmux names include the project prefix
71
+ // which causes cascading names like ai-guy-ai-guy-ai-guy-topic-1 on each respawn.
72
+ const topicName = storedName || `topic-${topicId}`;
71
73
  const newSessionName = await sessionManager.spawnInteractiveSession(bootstrapMessage, topicName);
72
74
  telegram.registerTopicSession(topicId, newSessionName);
73
75
  await telegram.sendToTopic(topicId, `Session respawned.`);
@@ -62,7 +62,12 @@ export async function runSetup(opts) {
62
62
  }
63
63
  console.log();
64
64
  console.log(pc.bold(' Welcome to Instar'));
65
- console.log(pc.dim(' Launching conversational setup wizard...'));
65
+ console.log();
66
+ console.log(pc.yellow(' Note: Instar runs Claude Code with --dangerously-skip-permissions.'));
67
+ console.log(pc.dim(' This allows your agent to operate autonomously — reading, writing, and'));
68
+ console.log(pc.dim(' executing within your project without per-action approval prompts.'));
69
+ console.log(pc.dim(' Security is enforced through behavioral hooks, identity grounding, and'));
70
+ console.log(pc.dim(' scoped access — not permission dialogs. See: README.md > Security Model'));
66
71
  console.log();
67
72
  // Launch Claude Code from the instar package root (where .claude/skills/ lives)
68
73
  // and pass the target project directory in the prompt.
@@ -374,6 +374,10 @@ export class SessionManager extends EventEmitter {
374
374
  execFileSync(this.config.tmuxPath, ['paste-buffer', '-t', exactTarget, '-p'], {
375
375
  encoding: 'utf-8', timeout: 5000,
376
376
  });
377
+ // Brief delay to let the terminal process the paste before sending Enter.
378
+ // Without this, the Enter arrives before paste processing completes and
379
+ // the message sits in the input buffer without being submitted.
380
+ execFileSync('/bin/sleep', ['0.3'], { timeout: 2000 });
377
381
  // Send Enter to submit
378
382
  execFileSync(this.config.tmuxPath, ['send-keys', '-t', exactTarget, 'Enter'], {
379
383
  encoding: 'utf-8', timeout: 5000,
@@ -174,6 +174,26 @@ When asked for something I can't do yet, I build it:
174
174
  4. **Need to notify the user?** Use the messaging API.
175
175
  5. **Need external API access?** Write a script that calls the API.
176
176
 
177
+ ### Execution Context — How I Run
178
+
179
+ I run with \`--dangerously-skip-permissions\` — meaning I can read, write, execute, and interact within this project without per-action approval prompts. This is by design, not an oversight.
180
+
181
+ **Why this exists:** An agent that asks permission for every file read and shell command isn't an agent. Autonomy requires trust, and trust requires coherence — my identity files, behavioral hooks, and accumulated memory are what make autonomous operation safe. The intelligence layer is the security layer.
182
+
183
+ **What this means in practice:**
184
+ - I can read and modify any file in this project directory
185
+ - I can run shell commands (builds, tests, git operations) without prompting
186
+ - I can send messages via configured integrations (Telegram, etc.)
187
+ - Behavioral hooks guard against destructive operations (force push, rm -rf, database drops)
188
+ - My identity and grounding infrastructure keeps me coherent across sessions
189
+
190
+ **What I cannot do:**
191
+ - Access other projects or system files outside this directory
192
+ - Bypass behavioral hooks (they are structural, not advisory)
193
+ - Act without an audit trail (all sessions are captured in tmux)
194
+
195
+ This is a meaningful level of access. The user has opted into this model because they want genuine autonomy, not a permission dialog for every action.
196
+
177
197
  ### Core Principles
178
198
 
179
199
  **I am a builder, not an assistant.** When a user describes a problem, my first instinct is to solve it — not explain why it's hard, list options, or ask for permission.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "Persistent autonomy infrastructure for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",