heyio 0.1.0 → 0.1.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.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Michael Jolley
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Michael Jolley
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,212 +1,212 @@
1
- # 🤖 IO
2
-
3
- A personal AI assistant daemon built on the GitHub Copilot SDK. IO runs 24/7 on your machine, reachable via Telegram and a terminal TUI.
4
-
5
- [![CI](https://github.com/michaeljolley/io/actions/workflows/ci.yml/badge.svg)](https://github.com/michaeljolley/io/actions/workflows/ci.yml)
6
- ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
7
- ![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen)
8
-
9
- ## ✨ Features
10
-
11
- - **Copilot SDK Integration** — powered by GitHub's Copilot SDK for LLM conversations with tool calling
12
- - **Multi-Interface** — Telegram bot + terminal TUI + HTTP API (future web UI)
13
- - **Persistent Memory** — wiki-based knowledge base stored at `~/.io/wiki/`
14
- - **Squad System** — persistent project teams that remember decisions, context, and history
15
- - **Skills** — modular skill system; install from git repos or the [skills.sh](https://skills.sh) registry
16
- - **Adaptive Sessions** — infinite sessions with automatic context compaction
17
- - **Worker Agents** — delegated task execution through specialized agent sessions
18
- - **Self-Updating** — checks for updates and can apply them automatically
19
-
20
- ## 📋 Prerequisites
21
-
22
- - **Node.js** >= 18
23
- - **GitHub Copilot subscription** — IO uses the Copilot SDK, which requires an active Copilot license
24
- - **GitHub CLI** (`gh`) — authenticated via `gh auth login`
25
-
26
- ## 🚀 Quick Start
27
-
28
- ### Install
29
-
30
- ```bash
31
- npm install -g heyio
32
- ```
33
-
34
- ### Setup
35
-
36
- Run the setup wizard to configure your Telegram bot token and user ID:
37
-
38
- ```bash
39
- io setup
40
- ```
41
-
42
- This creates a config file at `~/.io/config.json`.
43
-
44
- ### Run
45
-
46
- ```bash
47
- # Interactive TUI mode
48
- io
49
-
50
- # Background daemon (Telegram + HTTP API)
51
- io --daemon
52
-
53
- # Allow IO to modify its own source code
54
- io --self-edit
55
- ```
56
-
57
- ## 💬 CLI Usage
58
-
59
- | Command | Description |
60
- | --- | --- |
61
- | `io` | Start interactive TUI mode |
62
- | `io --daemon` | Run as background daemon (Telegram + API) |
63
- | `io --self-edit` | Allow IO to modify its own source |
64
- | `io setup` | Configure Telegram bot token and user ID |
65
- | `io skill list` | List installed skills |
66
- | `io skill add <repo-url>` | Install a skill from a git repository |
67
- | `io skill remove <slug>` | Remove an installed skill |
68
- | `io skill search <query>` | Search the skills.sh registry |
69
-
70
- ## ⚙️ Configuration
71
-
72
- IO stores its configuration at `~/.io/config.json`. The setup wizard (`io setup`) handles initial configuration, but you can also edit the file directly.
73
-
74
- ```jsonc
75
- {
76
- // Telegram bot token from @BotFather
77
- "telegramBotToken": "123456:ABC-DEF...",
78
-
79
- // Your Telegram user ID (for authentication)
80
- "telegramUserId": 123456789,
81
-
82
- // Enable self-edit mode by default
83
- "selfEdit": false
84
- }
85
- ```
86
-
87
- All persistent data is stored under `~/.io/`:
88
-
89
- | Path | Purpose |
90
- | --- | --- |
91
- | `~/.io/config.json` | User configuration |
92
- | `~/.io/wiki/` | Knowledge base (markdown files) |
93
- | `~/.io/io.db` | SQLite database (squads, tasks) |
94
- | `~/.io/skills/` | Installed skills |
95
-
96
- ## 🧩 Skills System
97
-
98
- Skills are modular extensions that add new tools and capabilities to IO. Each skill is a directory containing a `SKILL.md` manifest and tool definitions.
99
-
100
- ### Managing Skills
101
-
102
- ```bash
103
- # Search the skills.sh registry
104
- io skill search "github"
105
-
106
- # Install from a git repo
107
- io skill add https://github.com/user/my-skill.git
108
-
109
- # List installed skills
110
- io skill list
111
-
112
- # Remove a skill
113
- io skill remove my-skill
114
- ```
115
-
116
- ### Creating a Skill
117
-
118
- A skill is a directory with a `SKILL.md` file that describes the skill and its tools. See the [Contributing Guide](CONTRIBUTING.md) for details on the skill format.
119
-
120
- ## 👥 Squad System
121
-
122
- Squads are persistent project teams that IO manages. Each squad:
123
-
124
- - Is associated with a specific project or domain
125
- - Remembers decisions, context, and conversation history
126
- - Can have multiple specialized agents working together
127
- - Persists across sessions in the SQLite database
128
-
129
- IO's orchestrator automatically creates and manages squads based on your conversations.
130
-
131
- ## 🏗️ Architecture
132
-
133
- ```
134
- User → [TUI / Telegram / HTTP API]
135
-
136
- Orchestrator (Copilot SDK)
137
- ↕ ↕
138
- Squad Manager Wiki/Memory
139
-
140
- Worker Agents
141
- ```
142
-
143
- IO is built around the **Copilot SDK** which handles all LLM interactions, including tool calling and context management. The **Orchestrator** manages the primary conversation session with automatic context compaction for infinite-length sessions.
144
-
145
- For complex tasks, the orchestrator delegates work to **Worker Agents** — short-lived agent sessions that execute specific tasks and report back.
146
-
147
- The **Squad System** provides persistent project context, while the **Wiki** serves as a long-term knowledge base that spans all conversations.
148
-
149
- ## 🏗️ Project Structure
150
-
151
- ```
152
- src/
153
- ├── index.ts # CLI entry (commander)
154
- ├── daemon.ts # Daemon startup/shutdown
155
- ├── config.ts # Config loading
156
- ├── paths.ts # Path constants
157
- ├── update.ts # Self-update checker
158
- ├── copilot/
159
- │ ├── client.ts # CopilotClient singleton
160
- │ ├── orchestrator.ts # Main session management
161
- │ ├── agents.ts # Worker agent sessions
162
- │ ├── tools.ts # Tool definitions
163
- │ ├── skills.ts # Skills loader
164
- │ └── system-message.ts # System prompt builder
165
- ├── store/
166
- │ ├── db.ts # SQLite database
167
- │ ├── squads.ts # Squad CRUD
168
- │ └── tasks.ts # Agent task tracking
169
- ├── wiki/
170
- │ ├── fs.ts # Wiki filesystem
171
- │ └── search.ts # Wiki search
172
- ├── telegram/
173
- │ ├── bot.ts # Grammy Telegram bot
174
- │ └── handlers.ts # Command handlers
175
- ├── tui/
176
- │ └── index.ts # Terminal UI
177
- └── api/
178
- └── server.ts # Express HTTP + SSE
179
- ```
180
-
181
- ## 🛠️ Development
182
-
183
- ```bash
184
- # Clone the repository
185
- git clone https://github.com/michaeljolley/io.git
186
- cd io
187
-
188
- # Install dependencies
189
- npm install
190
-
191
- # Run in development mode (watch)
192
- npm run dev
193
-
194
- # Build for production
195
- npm run build
196
-
197
- # Run the TUI directly
198
- npm run tui
199
-
200
- # Run the daemon directly
201
- npm run daemon
202
- ```
203
-
204
- See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed development guidelines.
205
-
206
- ## 📄 License
207
-
208
- This project is licensed under the [MIT License](LICENSE).
209
-
210
- ## 🤝 Contributing
211
-
212
- Contributions are welcome! Please read the [Contributing Guide](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md) before submitting a pull request.
1
+ # 🤖 IO
2
+
3
+ A personal AI assistant daemon built on the GitHub Copilot SDK. IO runs 24/7 on your machine, reachable via Telegram and a terminal TUI.
4
+
5
+ [![CI](https://github.com/michaeljolley/io/actions/workflows/ci.yml/badge.svg)](https://github.com/michaeljolley/io/actions/workflows/ci.yml)
6
+ ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
7
+ ![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen)
8
+
9
+ ## ✨ Features
10
+
11
+ - **Copilot SDK Integration** — powered by GitHub's Copilot SDK for LLM conversations with tool calling
12
+ - **Multi-Interface** — Telegram bot + terminal TUI + HTTP API (future web UI)
13
+ - **Persistent Memory** — wiki-based knowledge base stored at `~/.io/wiki/`
14
+ - **Squad System** — persistent project teams that remember decisions, context, and history
15
+ - **Skills** — modular skill system; install from git repos or the [skills.sh](https://skills.sh) registry
16
+ - **Adaptive Sessions** — infinite sessions with automatic context compaction
17
+ - **Worker Agents** — delegated task execution through specialized agent sessions
18
+ - **Self-Updating** — checks for updates and can apply them automatically
19
+
20
+ ## 📋 Prerequisites
21
+
22
+ - **Node.js** >= 18
23
+ - **GitHub Copilot subscription** — IO uses the Copilot SDK, which requires an active Copilot license
24
+ - **GitHub CLI** (`gh`) — authenticated via `gh auth login`
25
+
26
+ ## 🚀 Quick Start
27
+
28
+ ### Install
29
+
30
+ ```bash
31
+ npm install -g heyio
32
+ ```
33
+
34
+ ### Setup
35
+
36
+ Run the setup wizard to configure your Telegram bot token and user ID:
37
+
38
+ ```bash
39
+ io setup
40
+ ```
41
+
42
+ This creates a config file at `~/.io/config.json`.
43
+
44
+ ### Run
45
+
46
+ ```bash
47
+ # Interactive TUI mode
48
+ io
49
+
50
+ # Background daemon (Telegram + HTTP API)
51
+ io --daemon
52
+
53
+ # Allow IO to modify its own source code
54
+ io --self-edit
55
+ ```
56
+
57
+ ## 💬 CLI Usage
58
+
59
+ | Command | Description |
60
+ | --- | --- |
61
+ | `io` | Start interactive TUI mode |
62
+ | `io --daemon` | Run as background daemon (Telegram + API) |
63
+ | `io --self-edit` | Allow IO to modify its own source |
64
+ | `io setup` | Configure Telegram bot token and user ID |
65
+ | `io skill list` | List installed skills |
66
+ | `io skill add <repo-url>` | Install a skill from a git repository |
67
+ | `io skill remove <slug>` | Remove an installed skill |
68
+ | `io skill search <query>` | Search the skills.sh registry |
69
+
70
+ ## ⚙️ Configuration
71
+
72
+ IO stores its configuration at `~/.io/config.json`. The setup wizard (`io setup`) handles initial configuration, but you can also edit the file directly.
73
+
74
+ ```jsonc
75
+ {
76
+ // Telegram bot token from @BotFather
77
+ "telegramBotToken": "123456:ABC-DEF...",
78
+
79
+ // Your Telegram user ID (for authentication)
80
+ "telegramUserId": 123456789,
81
+
82
+ // Enable self-edit mode by default
83
+ "selfEdit": false
84
+ }
85
+ ```
86
+
87
+ All persistent data is stored under `~/.io/`:
88
+
89
+ | Path | Purpose |
90
+ | --- | --- |
91
+ | `~/.io/config.json` | User configuration |
92
+ | `~/.io/wiki/` | Knowledge base (markdown files) |
93
+ | `~/.io/io.db` | SQLite database (squads, tasks) |
94
+ | `~/.io/skills/` | Installed skills |
95
+
96
+ ## 🧩 Skills System
97
+
98
+ Skills are modular extensions that add new tools and capabilities to IO. Each skill is a directory containing a `SKILL.md` manifest and tool definitions.
99
+
100
+ ### Managing Skills
101
+
102
+ ```bash
103
+ # Search the skills.sh registry
104
+ io skill search "github"
105
+
106
+ # Install from a git repo
107
+ io skill add https://github.com/user/my-skill.git
108
+
109
+ # List installed skills
110
+ io skill list
111
+
112
+ # Remove a skill
113
+ io skill remove my-skill
114
+ ```
115
+
116
+ ### Creating a Skill
117
+
118
+ A skill is a directory with a `SKILL.md` file that describes the skill and its tools. See the [Contributing Guide](CONTRIBUTING.md) for details on the skill format.
119
+
120
+ ## 👥 Squad System
121
+
122
+ Squads are persistent project teams that IO manages. Each squad:
123
+
124
+ - Is associated with a specific project or domain
125
+ - Remembers decisions, context, and conversation history
126
+ - Can have multiple specialized agents working together
127
+ - Persists across sessions in the SQLite database
128
+
129
+ IO's orchestrator automatically creates and manages squads based on your conversations.
130
+
131
+ ## 🏗️ Architecture
132
+
133
+ ```
134
+ User → [TUI / Telegram / HTTP API]
135
+
136
+ Orchestrator (Copilot SDK)
137
+ ↕ ↕
138
+ Squad Manager Wiki/Memory
139
+
140
+ Worker Agents
141
+ ```
142
+
143
+ IO is built around the **Copilot SDK** which handles all LLM interactions, including tool calling and context management. The **Orchestrator** manages the primary conversation session with automatic context compaction for infinite-length sessions.
144
+
145
+ For complex tasks, the orchestrator delegates work to **Worker Agents** — short-lived agent sessions that execute specific tasks and report back.
146
+
147
+ The **Squad System** provides persistent project context, while the **Wiki** serves as a long-term knowledge base that spans all conversations.
148
+
149
+ ## 🏗️ Project Structure
150
+
151
+ ```
152
+ src/
153
+ ├── index.ts # CLI entry (commander)
154
+ ├── daemon.ts # Daemon startup/shutdown
155
+ ├── config.ts # Config loading
156
+ ├── paths.ts # Path constants
157
+ ├── update.ts # Self-update checker
158
+ ├── copilot/
159
+ │ ├── client.ts # CopilotClient singleton
160
+ │ ├── orchestrator.ts # Main session management
161
+ │ ├── agents.ts # Worker agent sessions
162
+ │ ├── tools.ts # Tool definitions
163
+ │ ├── skills.ts # Skills loader
164
+ │ └── system-message.ts # System prompt builder
165
+ ├── store/
166
+ │ ├── db.ts # SQLite database
167
+ │ ├── squads.ts # Squad CRUD
168
+ │ └── tasks.ts # Agent task tracking
169
+ ├── wiki/
170
+ │ ├── fs.ts # Wiki filesystem
171
+ │ └── search.ts # Wiki search
172
+ ├── telegram/
173
+ │ ├── bot.ts # Grammy Telegram bot
174
+ │ └── handlers.ts # Command handlers
175
+ ├── tui/
176
+ │ └── index.ts # Terminal UI
177
+ └── api/
178
+ └── server.ts # Express HTTP + SSE
179
+ ```
180
+
181
+ ## 🛠️ Development
182
+
183
+ ```bash
184
+ # Clone the repository
185
+ git clone https://github.com/michaeljolley/io.git
186
+ cd io
187
+
188
+ # Install dependencies
189
+ npm install
190
+
191
+ # Run in development mode (watch)
192
+ npm run dev
193
+
194
+ # Build for production
195
+ npm run build
196
+
197
+ # Run the TUI directly
198
+ npm run tui
199
+
200
+ # Run the daemon directly
201
+ npm run daemon
202
+ ```
203
+
204
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed development guidelines.
205
+
206
+ ## 📄 License
207
+
208
+ This project is licensed under the [MIT License](LICENSE).
209
+
210
+ ## 🤝 Contributing
211
+
212
+ Contributions are welcome! Please read the [Contributing Guide](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md) before submitting a pull request.
@@ -96,13 +96,13 @@ async function getOrCreateSession(squadSlug) {
96
96
  configDir: SESSIONS_DIR,
97
97
  streaming: false,
98
98
  systemMessage: {
99
- content: `You are a specialist agent working on the "${squad.name}" project at ${squad.project_path}.
100
-
101
- ## Past Decisions
102
- ${decisions}
103
-
104
- ## Your Role
105
- You are a coding agent. Use the shell tool to run commands and file_ops to read/write files.
99
+ content: `You are a specialist agent working on the "${squad.name}" project at ${squad.project_path}.
100
+
101
+ ## Past Decisions
102
+ ${decisions}
103
+
104
+ ## Your Role
105
+ You are a coding agent. Use the shell tool to run commands and file_ops to read/write files.
106
106
  Log important decisions with squad_log_decision so they persist.`,
107
107
  },
108
108
  tools: agentTools,
@@ -5,17 +5,17 @@ export function getOrchestratorSystemMessage(opts) {
5
5
  : "\n## Memory\nYou have a persistent knowledge base (wiki). It's currently empty — use `wiki_write` to start building it!\n";
6
6
  const selfEditBlock = opts?.selfEditEnabled
7
7
  ? ""
8
- : `\n## Self-Edit Protection
9
-
10
- **You must NEVER modify your own source code.** This includes the IO codebase, configuration files in the project repo, or any file that is part of the IO application itself.
11
-
12
- If the user asks you to modify your own code, politely decline and explain that self-editing is disabled for safety. Suggest they make the changes manually or start IO with \`--self-edit\` to temporarily allow it.
13
-
14
- This restriction does NOT apply to:
15
- - User project files (code the user asks you to work on)
16
- - Skills in ~/.io/skills/ (user data)
17
- - The ~/.io/config.json file
18
- - Any files outside the IO installation directory
8
+ : `\n## Self-Edit Protection
9
+
10
+ **You must NEVER modify your own source code.** This includes the IO codebase, configuration files in the project repo, or any file that is part of the IO application itself.
11
+
12
+ If the user asks you to modify your own code, politely decline and explain that self-editing is disabled for safety. Suggest they make the changes manually or start IO with \`--self-edit\` to temporarily allow it.
13
+
14
+ This restriction does NOT apply to:
15
+ - User project files (code the user asks you to work on)
16
+ - Skills in ~/.io/skills/ (user data)
17
+ - The ~/.io/config.json file
18
+ - Any files outside the IO installation directory
19
19
  `;
20
20
  const squadBlock = opts?.squadRoster
21
21
  ? `\n### Active Squads\n${opts.squadRoster}\n`
@@ -23,68 +23,68 @@ This restriction does NOT apply to:
23
23
  const osName = process.platform === "darwin" ? "macOS"
24
24
  : process.platform === "win32" ? "Windows"
25
25
  : "Linux";
26
- return `You are IO, a personal AI assistant for developers running 24/7 on the user's machine (${osName}). You are an always-on assistant daemon.
27
-
28
- ## Your Architecture
29
-
30
- You are a Node.js daemon process built with the Copilot SDK. Here's how you work:
31
-
32
- - **Telegram bot**: Messages arrive tagged with \`[via telegram]\`. Keep responses concise and mobile-friendly.
33
- - **Local TUI**: A terminal interface on the local machine. Messages arrive tagged with \`[via tui]\`. You can be more verbose here.
34
- - **Background tasks**: Messages tagged \`[via background]\` are results from squad workers you delegated to.
35
- - **HTTP API**: You expose a local API on port ${config.apiPort} for programmatic access.
36
-
37
- When no source tag is present, assume TUI.
38
-
39
- ## Your Capabilities
40
-
41
- 1. **Direct conversation**: Answer questions, discuss problems — no tools needed.
42
- 2. **Squad system**: You can create project squads — persistent teams of specialized agents for specific projects. Each squad remembers its decisions and context.
43
- 3. **Knowledge base**: You have a wiki-style knowledge base. Proactively save user preferences, project details, and important facts.
44
- 4. **Shell access**: You can run shell commands on the user's machine.
45
- 5. **Skills**: You have a modular skill system. Skills teach you how to use external tools.
46
-
47
- ## Your Role
48
-
49
- You receive messages and decide how to handle them:
50
-
51
- - **Direct answer**: For simple questions, general knowledge, status checks — answer directly.
52
- - **Use tools**: For tasks requiring shell access, file operations, web lookups — use your tools.
53
- - **Create/delegate to squad**: For coding projects that need persistent context — create a squad with specialized agents.
54
- - **Use a skill**: If you have a skill for the task, use it.
55
- ${squadBlock}
56
- ## Squad System
57
-
58
- Squads are persistent project teams. When a user works on a codebase:
59
- 1. Create a squad with \`squad_create\` — this sets up a persistent team for that project.
60
- 2. The squad remembers decisions via \`squad_log_decision\`.
61
- 3. Recall squad context with \`squad_recall\` before doing project work.
62
- 4. Check squad status with \`squad_status\`.
63
-
64
- ## Tool Usage
65
-
66
- ### Knowledge Base
67
- - \`wiki_read\`: Read a page from your knowledge base.
68
- - \`wiki_write\`: Write or update a page. Use for preferences, project notes, facts.
69
- - \`wiki_search\`: Search your knowledge base.
70
-
71
- ### Squad Management
72
- - \`squad_create\`: Create a project squad.
73
- - \`squad_recall\`: Get a squad's context and decisions.
74
- - \`squad_status\`: Check squad status.
75
- - \`squad_log_decision\`: Log a decision for a squad.
76
-
77
- ### System
78
- - \`shell\`: Run a shell command.
79
- - \`web_fetch\`: Fetch a URL and return content.
80
-
81
- ## Guidelines
82
-
83
- 1. **Adapt to the channel**: On Telegram, be brief. On TUI, be detailed.
84
- 2. **Proactive knowledge building**: When the user shares preferences or project details, save them to your wiki.
85
- 3. Be conversational and helpful. You're IO.
86
- 4. When a task fails, report the error clearly and suggest next steps.
87
- 5. Expand shorthand paths: "~/dev/myapp" → the user's home directory + path.
26
+ return `You are IO, a personal AI assistant for developers running 24/7 on the user's machine (${osName}). You are an always-on assistant daemon.
27
+
28
+ ## Your Architecture
29
+
30
+ You are a Node.js daemon process built with the Copilot SDK. Here's how you work:
31
+
32
+ - **Telegram bot**: Messages arrive tagged with \`[via telegram]\`. Keep responses concise and mobile-friendly.
33
+ - **Local TUI**: A terminal interface on the local machine. Messages arrive tagged with \`[via tui]\`. You can be more verbose here.
34
+ - **Background tasks**: Messages tagged \`[via background]\` are results from squad workers you delegated to.
35
+ - **HTTP API**: You expose a local API on port ${config.apiPort} for programmatic access.
36
+
37
+ When no source tag is present, assume TUI.
38
+
39
+ ## Your Capabilities
40
+
41
+ 1. **Direct conversation**: Answer questions, discuss problems — no tools needed.
42
+ 2. **Squad system**: You can create project squads — persistent teams of specialized agents for specific projects. Each squad remembers its decisions and context.
43
+ 3. **Knowledge base**: You have a wiki-style knowledge base. Proactively save user preferences, project details, and important facts.
44
+ 4. **Shell access**: You can run shell commands on the user's machine.
45
+ 5. **Skills**: You have a modular skill system. Skills teach you how to use external tools.
46
+
47
+ ## Your Role
48
+
49
+ You receive messages and decide how to handle them:
50
+
51
+ - **Direct answer**: For simple questions, general knowledge, status checks — answer directly.
52
+ - **Use tools**: For tasks requiring shell access, file operations, web lookups — use your tools.
53
+ - **Create/delegate to squad**: For coding projects that need persistent context — create a squad with specialized agents.
54
+ - **Use a skill**: If you have a skill for the task, use it.
55
+ ${squadBlock}
56
+ ## Squad System
57
+
58
+ Squads are persistent project teams. When a user works on a codebase:
59
+ 1. Create a squad with \`squad_create\` — this sets up a persistent team for that project.
60
+ 2. The squad remembers decisions via \`squad_log_decision\`.
61
+ 3. Recall squad context with \`squad_recall\` before doing project work.
62
+ 4. Check squad status with \`squad_status\`.
63
+
64
+ ## Tool Usage
65
+
66
+ ### Knowledge Base
67
+ - \`wiki_read\`: Read a page from your knowledge base.
68
+ - \`wiki_write\`: Write or update a page. Use for preferences, project notes, facts.
69
+ - \`wiki_search\`: Search your knowledge base.
70
+
71
+ ### Squad Management
72
+ - \`squad_create\`: Create a project squad.
73
+ - \`squad_recall\`: Get a squad's context and decisions.
74
+ - \`squad_status\`: Check squad status.
75
+ - \`squad_log_decision\`: Log a decision for a squad.
76
+
77
+ ### System
78
+ - \`shell\`: Run a shell command.
79
+ - \`web_fetch\`: Fetch a URL and return content.
80
+
81
+ ## Guidelines
82
+
83
+ 1. **Adapt to the channel**: On Telegram, be brief. On TUI, be detailed.
84
+ 2. **Proactive knowledge building**: When the user shares preferences or project details, save them to your wiki.
85
+ 3. Be conversational and helpful. You're IO.
86
+ 4. When a task fails, report the error clearly and suggest next steps.
87
+ 5. Expand shorthand paths: "~/dev/myapp" → the user's home directory + path.
88
88
  ${selfEditBlock}${memoryBlock}`;
89
89
  }
90
90
  //# sourceMappingURL=system-message.js.map
package/dist/index.js CHANGED
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ const [major] = process.versions.node.split(".").map(Number);
3
+ if (major < 22) {
4
+ console.error(`IO requires Node.js 22 or later (current: ${process.version}). Please upgrade: https://nodejs.org`);
5
+ process.exit(1);
6
+ }
2
7
  import { Command } from "commander";
3
8
  import { startDaemon } from "./daemon.js";
4
9
  import { startTui, setMessageHandler as setTuiHandler } from "./tui/index.js";
package/dist/store/db.js CHANGED
@@ -9,49 +9,49 @@ export function getDb() {
9
9
  mkdirSync(IO_HOME, { recursive: true });
10
10
  db = new Database(DB_PATH);
11
11
  db.pragma("journal_mode = WAL");
12
- db.exec(`
13
- CREATE TABLE IF NOT EXISTS io_state (
14
- key TEXT PRIMARY KEY,
15
- value TEXT NOT NULL
16
- );
17
-
18
- CREATE TABLE IF NOT EXISTS squads (
19
- id INTEGER PRIMARY KEY AUTOINCREMENT,
20
- slug TEXT UNIQUE NOT NULL,
21
- name TEXT NOT NULL,
22
- project_path TEXT NOT NULL,
23
- copilot_session_id TEXT,
24
- status TEXT NOT NULL DEFAULT 'idle',
25
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
26
- updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
27
- );
28
-
29
- CREATE TABLE IF NOT EXISTS squad_decisions (
30
- id INTEGER PRIMARY KEY AUTOINCREMENT,
31
- squad_slug TEXT NOT NULL,
32
- decision TEXT NOT NULL,
33
- context TEXT,
34
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP
35
- );
36
-
37
- CREATE TABLE IF NOT EXISTS conversation_log (
38
- id INTEGER PRIMARY KEY AUTOINCREMENT,
39
- role TEXT NOT NULL CHECK(role IN ('user', 'assistant', 'system')),
40
- content TEXT NOT NULL,
41
- source TEXT NOT NULL DEFAULT 'unknown',
42
- ts DATETIME DEFAULT CURRENT_TIMESTAMP
43
- );
44
-
45
- CREATE TABLE IF NOT EXISTS agent_tasks (
46
- task_id TEXT PRIMARY KEY,
47
- agent_slug TEXT NOT NULL,
48
- description TEXT NOT NULL,
49
- status TEXT NOT NULL DEFAULT 'running',
50
- result TEXT,
51
- origin_channel TEXT,
52
- started_at DATETIME DEFAULT CURRENT_TIMESTAMP,
53
- completed_at DATETIME
54
- );
12
+ db.exec(`
13
+ CREATE TABLE IF NOT EXISTS io_state (
14
+ key TEXT PRIMARY KEY,
15
+ value TEXT NOT NULL
16
+ );
17
+
18
+ CREATE TABLE IF NOT EXISTS squads (
19
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
20
+ slug TEXT UNIQUE NOT NULL,
21
+ name TEXT NOT NULL,
22
+ project_path TEXT NOT NULL,
23
+ copilot_session_id TEXT,
24
+ status TEXT NOT NULL DEFAULT 'idle',
25
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
26
+ updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
27
+ );
28
+
29
+ CREATE TABLE IF NOT EXISTS squad_decisions (
30
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
31
+ squad_slug TEXT NOT NULL,
32
+ decision TEXT NOT NULL,
33
+ context TEXT,
34
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP
35
+ );
36
+
37
+ CREATE TABLE IF NOT EXISTS conversation_log (
38
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
39
+ role TEXT NOT NULL CHECK(role IN ('user', 'assistant', 'system')),
40
+ content TEXT NOT NULL,
41
+ source TEXT NOT NULL DEFAULT 'unknown',
42
+ ts DATETIME DEFAULT CURRENT_TIMESTAMP
43
+ );
44
+
45
+ CREATE TABLE IF NOT EXISTS agent_tasks (
46
+ task_id TEXT PRIMARY KEY,
47
+ agent_slug TEXT NOT NULL,
48
+ description TEXT NOT NULL,
49
+ status TEXT NOT NULL DEFAULT 'running',
50
+ result TEXT,
51
+ origin_channel TEXT,
52
+ started_at DATETIME DEFAULT CURRENT_TIMESTAMP,
53
+ completed_at DATETIME
54
+ );
55
55
  `);
56
56
  return db;
57
57
  }
package/dist/tui/index.js CHANGED
@@ -3,13 +3,13 @@ let messageHandler;
3
3
  export function setMessageHandler(handler) {
4
4
  messageHandler = handler;
5
5
  }
6
- const WELCOME_BANNER = `
7
- ╔══════════════════════════════════════╗
8
- ║ IO — AI Assistant ║
9
- ╚══════════════════════════════════════╝
10
- Type a message to chat. Commands:
11
- /status — show status
12
- /quit — exit
6
+ const WELCOME_BANNER = `
7
+ ╔══════════════════════════════════════╗
8
+ ║ IO — AI Assistant ║
9
+ ╚══════════════════════════════════════╝
10
+ Type a message to chat. Commands:
11
+ /status — show status
12
+ /quit — exit
13
13
  `;
14
14
  function clearLine() {
15
15
  process.stdout.write("\r\x1b[K");
package/package.json CHANGED
@@ -1,54 +1,55 @@
1
- {
2
- "name": "heyio",
3
- "version": "0.1.0",
4
- "description": "IO — a personal AI assistant built on the GitHub Copilot SDK",
5
- "bin": {
6
- "io": "dist/index.js"
7
- },
8
- "files": [
9
- "dist/**/*.js",
10
- "README.md"
11
- ],
12
- "scripts": {
13
- "build": "tsc",
14
- "daemon": "tsx src/daemon.ts",
15
- "tui": "tsx src/tui/index.ts",
16
- "dev": "tsx --watch src/daemon.ts",
17
- "prepublishOnly": "npm run build"
18
- },
19
- "engines": {
20
- "node": ">=18"
21
- },
22
- "type": "module",
23
- "keywords": [
24
- "copilot",
25
- "telegram",
26
- "orchestrator",
27
- "ai",
28
- "cli",
29
- "assistant"
30
- ],
31
- "author": "Michael Jolley",
32
- "license": "MIT",
33
- "repository": {
34
- "type": "git",
35
- "url": "git+https://github.com/michaeljolley/io.git"
36
- },
37
- "homepage": "https://github.com/michaeljolley/io#readme",
38
- "dependencies": {
39
- "@github/copilot-sdk": "^0.2.2",
40
- "better-sqlite3": "^12.6.2",
41
- "commander": "^14.0.0",
42
- "dotenv": "^17.3.1",
43
- "express": "^5.2.1",
44
- "grammy": "^1.40.0",
45
- "zod": "^4.3.6"
46
- },
47
- "devDependencies": {
48
- "@types/better-sqlite3": "^7.6.13",
49
- "@types/express": "^5.0.6",
50
- "@types/node": "^25.3.0",
51
- "tsx": "^4.21.0",
52
- "typescript": "^5.9.3"
53
- }
54
- }
1
+ {
2
+ "name": "heyio",
3
+ "version": "0.1.1",
4
+ "description": "IO — a personal AI assistant built on the GitHub Copilot SDK",
5
+ "bin": {
6
+ "io": "dist/index.js"
7
+ },
8
+ "files": [
9
+ "dist/**/*.js",
10
+ "README.md"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc",
14
+ "postinstall": "npm rebuild better-sqlite3",
15
+ "daemon": "tsx src/daemon.ts",
16
+ "tui": "tsx src/tui/index.ts",
17
+ "dev": "tsx --watch src/daemon.ts",
18
+ "prepublishOnly": "npm run build"
19
+ },
20
+ "engines": {
21
+ "node": ">=22"
22
+ },
23
+ "type": "module",
24
+ "keywords": [
25
+ "copilot",
26
+ "telegram",
27
+ "orchestrator",
28
+ "ai",
29
+ "cli",
30
+ "assistant"
31
+ ],
32
+ "author": "Michael Jolley",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/michaeljolley/io.git"
37
+ },
38
+ "homepage": "https://github.com/michaeljolley/io#readme",
39
+ "dependencies": {
40
+ "@github/copilot-sdk": "^0.2.2",
41
+ "better-sqlite3": "^12.6.2",
42
+ "commander": "^14.0.0",
43
+ "dotenv": "^17.3.1",
44
+ "express": "^5.2.1",
45
+ "grammy": "^1.40.0",
46
+ "zod": "^4.3.6"
47
+ },
48
+ "devDependencies": {
49
+ "@types/better-sqlite3": "^7.6.13",
50
+ "@types/express": "^5.0.6",
51
+ "@types/node": "^25.3.0",
52
+ "tsx": "^4.21.0",
53
+ "typescript": "^5.9.3"
54
+ }
55
+ }