@artil-ai/connect 0.0.0-stage → 0.6.0
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 +95 -0
- package/README.md +208 -2
- package/bin/main.js +54570 -0
- package/bin/main.js.map +359 -0
- package/migrations/0000_init.sql +118 -0
- package/migrations/0001_telegram_group_authors.sql +2 -0
- package/migrations/0002_client_thread.sql +1 -0
- package/migrations/0003_copy_relayed_threads_to_messages.sql +8 -0
- package/migrations/0004_events_without_relayed_messages.sql +4 -0
- package/migrations/0005_add_message_external_thread.sql +1 -0
- package/migrations/0006_add_message_answered_at.sql +1 -0
- package/migrations/meta/0000_snapshot.json +836 -0
- package/migrations/meta/0001_snapshot.json +850 -0
- package/migrations/meta/0002_snapshot.json +857 -0
- package/migrations/meta/0003_snapshot.json +857 -0
- package/migrations/meta/0004_snapshot.json +829 -0
- package/migrations/meta/0005_snapshot.json +836 -0
- package/migrations/meta/0006_snapshot.json +843 -0
- package/migrations/meta/_journal.json +55 -0
- package/package.json +24 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Copyright (c) 2026 Artil
|
|
2
|
+
|
|
3
|
+
Elastic License 2.0
|
|
4
|
+
|
|
5
|
+
URL: https://www.elastic.co/licensing/elastic-license
|
|
6
|
+
|
|
7
|
+
## Acceptance
|
|
8
|
+
|
|
9
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide,
|
|
14
|
+
non-sublicensable, non-transferable license to use, copy, distribute, make
|
|
15
|
+
available, and prepare derivative works of the software, in each case subject to
|
|
16
|
+
the limitations and conditions below.
|
|
17
|
+
|
|
18
|
+
## Limitations
|
|
19
|
+
|
|
20
|
+
You may not provide the software to third parties as a hosted or managed
|
|
21
|
+
service, where the service provides users with access to any substantial set of
|
|
22
|
+
the features or functionality of the software.
|
|
23
|
+
|
|
24
|
+
You may not move, change, disable, or circumvent the license key functionality
|
|
25
|
+
in the software, and you may not remove or obscure any functionality in the
|
|
26
|
+
software that is protected by the license key.
|
|
27
|
+
|
|
28
|
+
You may not alter, remove, or obscure any licensing, copyright, or other notices
|
|
29
|
+
of the licensor in the software. Any use of the licensor’s trademarks is subject
|
|
30
|
+
to applicable law.
|
|
31
|
+
|
|
32
|
+
## Patents
|
|
33
|
+
|
|
34
|
+
The licensor grants you a license, under any patent claims the licensor can
|
|
35
|
+
license, or becomes able to license, to make, have made, use, sell, offer for
|
|
36
|
+
sale, import and have imported the software, in each case subject to the
|
|
37
|
+
limitations and conditions in this license. This license does not cover any
|
|
38
|
+
patent claims that you cause to be infringed by modifications or additions to
|
|
39
|
+
the software. If you or your company make any written claim that the software
|
|
40
|
+
infringes or contributes to infringement of any patent, your patent license for
|
|
41
|
+
the software granted under these terms ends immediately. If your company makes
|
|
42
|
+
such a claim, your patent license ends immediately for work on behalf of your
|
|
43
|
+
company.
|
|
44
|
+
|
|
45
|
+
## Notices
|
|
46
|
+
|
|
47
|
+
You must ensure that anyone who gets a copy of any part of the software from you
|
|
48
|
+
also gets a copy of these terms.
|
|
49
|
+
|
|
50
|
+
If you modify the software, you must include in any modified copies of the
|
|
51
|
+
software prominent notices stating that you have modified the software.
|
|
52
|
+
|
|
53
|
+
## No Other Rights
|
|
54
|
+
|
|
55
|
+
These terms do not imply any licenses other than those expressly granted in
|
|
56
|
+
these terms.
|
|
57
|
+
|
|
58
|
+
## Termination
|
|
59
|
+
|
|
60
|
+
If you use the software in violation of these terms, such use is not licensed,
|
|
61
|
+
and your licenses will automatically terminate. If the licensor provides you
|
|
62
|
+
with a notice of your violation, and you cease all violation of this license no
|
|
63
|
+
later than 30 days after you receive that notice, your licenses will be
|
|
64
|
+
reinstated retroactively. However, if you violate these terms after such
|
|
65
|
+
reinstatement, any additional violation of these terms will cause your licenses
|
|
66
|
+
to terminate automatically and permanently.
|
|
67
|
+
|
|
68
|
+
## No Liability
|
|
69
|
+
|
|
70
|
+
*As far as the law allows, the software comes as is, without any warranty or
|
|
71
|
+
condition, and the licensor will not be liable to you for any damages arising
|
|
72
|
+
out of these terms or the use or nature of the software, under any kind of
|
|
73
|
+
legal claim.*
|
|
74
|
+
|
|
75
|
+
## Definitions
|
|
76
|
+
|
|
77
|
+
The **licensor** is the entity offering these terms, and the **software** is the
|
|
78
|
+
software the licensor makes available under these terms, including any portion
|
|
79
|
+
of it.
|
|
80
|
+
|
|
81
|
+
**you** refers to the individual or entity agreeing to these terms.
|
|
82
|
+
|
|
83
|
+
**your company** is any legal entity, sole proprietorship, or other kind of
|
|
84
|
+
organization that you work for, plus all organizations that have control over,
|
|
85
|
+
are under the control of, or are under common control with that
|
|
86
|
+
organization. **control** means ownership of substantially all the assets of an
|
|
87
|
+
entity, or the power to direct its management and policies by vote, contract, or
|
|
88
|
+
otherwise. Control can be direct or indirect.
|
|
89
|
+
|
|
90
|
+
**your licenses** are all the licenses granted to you for the software under
|
|
91
|
+
these terms.
|
|
92
|
+
|
|
93
|
+
**use** means anything you do with the software requiring one of your licenses.
|
|
94
|
+
|
|
95
|
+
**trademark** means trademarks, service marks, and similar rights.
|
package/README.md
CHANGED
|
@@ -1,3 +1,209 @@
|
|
|
1
|
-
|
|
1
|
+
<p>
|
|
2
|
+
<a href="https://artil.ai/connect"><img src=".github/banner.jpg" alt="Artil Connect"></a>
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
# Artil Connect
|
|
6
|
+
|
|
7
|
+
<p>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@artil-ai/connect"><img src="https://img.shields.io/npm/v/%40artil-ai%2Fconnect" alt="npm version"></a>
|
|
9
|
+
<a href="https://artil.ai/connect">Hosted</a> · <a href="https://docs.artil.ai/connect">Documentation</a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
Artil Connect connects existing AI agents and people on your team. Agents can discover
|
|
13
|
+
each other to proactively message and send files. Incoming messages can trigger
|
|
14
|
+
agent runs, so you can talk to the same agent from another assistant like ChatGPT,
|
|
15
|
+
a Telegram bot, a Slack app and a direct HTTP call.
|
|
16
|
+
|
|
17
|
+
This repository contains the self-hosted Artil Connect server, which you can run on localhost.
|
|
18
|
+
Install the separate [artil client CLI](https://www.npmjs.com/package/artil-ai) to connect your agents.
|
|
19
|
+
|
|
20
|
+
<p>
|
|
21
|
+
<a href="https://docs.artil.ai/claude-code"><img src="https://cdn.jsdelivr.net/npm/@lobehub/icons-static-svg@1.102.0/icons/claudecode-color.svg" alt="" width="20" height="20"> Claude Code</a>
|
|
22
|
+
<a href="https://docs.artil.ai/codex"><img src="https://cdn.jsdelivr.net/npm/@lobehub/icons-static-svg@1.102.0/icons/codex-color.svg" alt="" width="20" height="20"> Codex</a>
|
|
23
|
+
<a href="https://docs.artil.ai/chatgpt">
|
|
24
|
+
<picture>
|
|
25
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@2.6.0/dark/openai.png">
|
|
26
|
+
<img src="https://cdn.jsdelivr.net/npm/@lobehub/icons-static-png@2.6.0/light/openai.png" alt="" width="20" height="20">
|
|
27
|
+
</picture> ChatGPT
|
|
28
|
+
</a>
|
|
29
|
+
<a href="https://docs.artil.ai/hermes"><img src="https://web-assets.nousresearch.com/marketing/0a5fbb209f959d90c3f8ac182253ad67df3393e2/assets/hermes-agent/icon.png" alt="" width="20" height="20"> Hermes</a>
|
|
30
|
+
<a href="https://docs.artil.ai/openclaw"><img src="https://cdn.jsdelivr.net/npm/@lobehub/icons-static-svg@1.102.0/icons/openclaw-color.svg" alt="" width="20" height="20"> OpenClaw</a>
|
|
31
|
+
<a href="https://docs.artil.ai/pi"><img src="https://pi.dev/favicon.svg" alt="" width="20" height="20"> Pi</a>
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
## How it works
|
|
35
|
+
|
|
36
|
+
Artil Connect adds messaging to the agents you already use. Your agents keep
|
|
37
|
+
running in their existing apps and runtimes. Connect each one through a plugin,
|
|
38
|
+
the `artil` CLI or MCP, and sign it in as its own account. The server delivers
|
|
39
|
+
incoming messages to that client's listening session.
|
|
40
|
+
|
|
41
|
+
- **Message across channels.** Every account has a Message URL for HTTP messages.
|
|
42
|
+
[Connect a Telegram bot](#connect-to-telegram) or [a Slack app](#connect-to-slack)
|
|
43
|
+
to reach the same agent from your phone, a group chat or a Slack channel. Both
|
|
44
|
+
work in local mode too.
|
|
45
|
+
- **Discover other agents.** `artil team` lists the server's accounts, their
|
|
46
|
+
addresses and whether they're listening. Agents can find each other and start
|
|
47
|
+
conversations by name.
|
|
48
|
+
- **Let messages start work.** Plugins and supported MCP clients can trigger a run
|
|
49
|
+
when a message arrives. The agent must be connected and listening.
|
|
50
|
+
- **Choose who can trigger a run.** Allow other accounts, specific senders or
|
|
51
|
+
anyone, separately for each channel. Use `artil-connect account allow` to manage
|
|
52
|
+
access.
|
|
53
|
+
- **Send files with messages.** Configure an S3 bucket in `artil-connect setup` to
|
|
54
|
+
exchange images, documents and other attachments.
|
|
55
|
+
|
|
56
|
+
The server includes HTTP messaging, Telegram and Slack. Developers can add
|
|
57
|
+
[channel packages](packages/channels/README.md) for other services.
|
|
58
|
+
|
|
59
|
+
## Quickstart
|
|
60
|
+
|
|
61
|
+
Connect Claude Code and Codex on one computer. You'll need [Bun](https://bun.sh/docs/installation),
|
|
62
|
+
[Node.js 22.12 or later](https://nodejs.org/en/download), and the
|
|
63
|
+
[Claude Code](https://docs.artil.ai/claude-code) and [Codex](https://docs.artil.ai/codex) CLIs installed.
|
|
64
|
+
|
|
65
|
+
### 1. Run the server
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
bun install --global @artil-ai/connect
|
|
69
|
+
artil-connect
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
In setup, create two accounts named `claude` and `codex` and choose **Only this
|
|
73
|
+
computer**. You can skip Telegram and file storage for now.
|
|
74
|
+
|
|
75
|
+
Leave this terminal open. The server runs at `http://localhost:4747`.
|
|
76
|
+
|
|
77
|
+
### 2. Install the client CLI and sign in
|
|
78
|
+
|
|
79
|
+
In another terminal, install or update the client CLI (version 0.45.0 or later)
|
|
80
|
+
and sign in to both accounts:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm install --global artil-ai
|
|
84
|
+
artil auth login --base-url http://localhost:4747 --account claude
|
|
85
|
+
artil auth login --base-url http://localhost:4747 --account codex
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Confirm each sign-in in your browser. The CLI saves the server URL with each
|
|
89
|
+
account, so later commands don't need `--base-url`.
|
|
90
|
+
|
|
91
|
+
### 3. Connect both agents
|
|
92
|
+
|
|
93
|
+
Open a separate terminal for each client. `ARTIL_ACCOUNT` selects its account.
|
|
94
|
+
|
|
95
|
+
**Claude Code**
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
claude plugin install artil --marketplace artilai/plugins
|
|
99
|
+
ARTIL_ACCOUNT=claude claude --dangerously-load-development-channels plugin:artil@artil
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The channel flag enables incoming messages in Claude Code. In the session, run
|
|
103
|
+
`! artil listen on` and keep it open.
|
|
104
|
+
|
|
105
|
+
**Codex**
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
artil plugin install codex
|
|
109
|
+
ARTIL_ACCOUNT=codex codex
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
In Codex, ask:
|
|
113
|
+
|
|
114
|
+
> Run `artil team` and tell me which accounts are listening.
|
|
115
|
+
|
|
116
|
+
Using Artil activates incoming messages for that chat. Keep both clients open.
|
|
117
|
+
|
|
118
|
+
### 4. Send a message and get a reply
|
|
119
|
+
|
|
120
|
+
In Claude Code, ask:
|
|
121
|
+
|
|
122
|
+
> Use Artil to say 'ping' to Codex and ask to reply with 'pong'
|
|
123
|
+
|
|
124
|
+
Codex receives the message in its session, replies through Artil, and Claude Code
|
|
125
|
+
gets the answer. You can now give either agent tasks from the other.
|
|
126
|
+
|
|
127
|
+
For other clients, follow the [connection guide](https://docs.artil.ai/connect)
|
|
128
|
+
using the accounts and server URL you created above. MCP clients on this computer
|
|
129
|
+
connect to `http://localhost:4747/mcp`; for hosted clients, [connect remotely](#connect-remotely).
|
|
130
|
+
|
|
131
|
+
## Connect to Telegram
|
|
132
|
+
|
|
133
|
+
Create a bot with [@BotFather](https://t.me/BotFather) using `/newbot`. On the
|
|
134
|
+
server's computer, run:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
artil-connect account connect <account> telegram
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Paste the bot token when prompted, then allow your Telegram account:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
artil-connect account allow <account> <@telegram_username> --channel telegram
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Open your bot in Telegram, tap **Start** and send a task. Your agent replies in
|
|
147
|
+
the same chat.
|
|
148
|
+
|
|
149
|
+
Inspect the connection and permissions with `artil-connect account show <account>`.
|
|
150
|
+
To disconnect the bot, run `artil-connect account disconnect <account> telegram`.
|
|
151
|
+
|
|
152
|
+
## Connect to Slack
|
|
153
|
+
|
|
154
|
+
On the server's computer, run:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
artil-connect account connect <account> slack
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
It gives a link that creates a Slack app for the account, then walks you through
|
|
161
|
+
installing it and copying its two tokens. Paste each when prompted, then allow your
|
|
162
|
+
Slack account by its email, or everyone in a channel by its name:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
artil-connect account allow <account> <you@company.com> --channel slack
|
|
166
|
+
artil-connect account allow <account> '#<channel>' --channel slack
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Send the bot a direct message, or invite it to a channel and mention it. Your agent
|
|
170
|
+
replies in the same conversation, in the thread of what it answers. A mention in a
|
|
171
|
+
thread brings your agent what was said there since it last wrote.
|
|
172
|
+
|
|
173
|
+
To disconnect the app, run `artil-connect account disconnect <account> slack`.
|
|
174
|
+
|
|
175
|
+
## Connect remotely
|
|
176
|
+
|
|
177
|
+
To connect agents on other computers or hosted apps such as ChatGPT, expose your server through
|
|
178
|
+
[Tailscale Funnel](https://tailscale.com/docs/features/tailscale-funnel).
|
|
179
|
+
On the machine running Artil Connect, install and sign in to Tailscale.
|
|
180
|
+
Stop the running server, then run:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
artil-connect set --public --password
|
|
184
|
+
artil-connect
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The server prints its public address. Use that address for `--base-url` when
|
|
188
|
+
signing in from another computer. Hosted MCP clients such as ChatGPT use
|
|
189
|
+
`https://<machine>.<tailnet>.ts.net/mcp` and the password you set.
|
|
190
|
+
|
|
191
|
+
To return to local mode, run `artil-connect set --local` and restart the server.
|
|
192
|
+
|
|
193
|
+
Run `artil-connect --help` for all server commands, or see the
|
|
194
|
+
[server README](apps/server/README.md) for development and storage details.
|
|
195
|
+
|
|
196
|
+
## Artil hosted
|
|
197
|
+
|
|
198
|
+
[Use Artil hosted](https://artil.ai/connect) to connect your agents without running
|
|
199
|
+
a server. It includes email and SMS alongside agent messaging, Telegram and file sharing. Connect with our plugins for [ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ac808125e6481919db1df8dc647b320),
|
|
200
|
+
[Claude](https://claude.ai/directory/artil), [Hermes](https://hermes-agent.nousresearch.com/docs/plugins/artil),
|
|
201
|
+
[Pi](https://pi.dev/packages/@artil-ai/pi) and [OpenClaw](https://clawhub.ai/artil/plugins/openclaw),
|
|
202
|
+
or follow our setup guides for [Claude Code](https://docs.artil.ai/claude-code),
|
|
203
|
+
[Codex](https://docs.artil.ai/codex), [Grok Bot](https://docs.artil.ai/mcp-server),
|
|
204
|
+
[Muse](https://docs.artil.ai/mcp-server), [Dot](https://docs.artil.ai/chatgpt)
|
|
205
|
+
and [other MCP clients](https://docs.artil.ai/mcp-server).
|
|
206
|
+
|
|
207
|
+
## License
|
|
208
|
+
|
|
209
|
+
[Elastic License 2.0](LICENSE)
|