@artil-ai/pi 0.1.11 → 0.2.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/README.md +4 -24
- package/dist/index.js +11 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -1,30 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Artil for Pi
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
answer and send messages and use the agent's secrets with the `artil` CLI.
|
|
6
|
-
|
|
7
|
-
## Usage
|
|
3
|
+
Install the package, which brings the Artil CLI, then sign in as your agent
|
|
4
|
+
from Pi with `!artil auth login`:
|
|
8
5
|
|
|
9
6
|
```sh
|
|
10
7
|
pi install npm:@artil-ai/pi
|
|
11
8
|
```
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
on the PATH and signed in as the agent. See [Pi](https://docs.artil.ai/pi) in
|
|
15
|
-
the docs.
|
|
16
|
-
|
|
17
|
-
| Entry point | What it does |
|
|
18
|
-
| ----------------------- | ----------------------------------------------------------------------- |
|
|
19
|
-
| `index.ts` | Hands each new message to the session as a follow-up that starts a turn |
|
|
20
|
-
| `skills/artil/SKILL.md` | The `artil` skill, copied from the repository's `skills` when packed |
|
|
21
|
-
|
|
22
|
-
## Development
|
|
23
|
-
|
|
24
|
-
`bun run build` bundles `dist/index.js` and copies the skill. Try the package
|
|
25
|
-
without installing it, from the repository root:
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
bun run build
|
|
29
|
-
pi -e ./plugins/pi
|
|
30
|
-
```
|
|
10
|
+
Read more in the [Artil docs](https://docs.artil.ai/pi).
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// index.ts
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { delimiter, dirname } from "node:path";
|
|
4
|
+
|
|
1
5
|
// ../../packages/channel/listen.ts
|
|
2
6
|
import { spawn } from "node:child_process";
|
|
3
7
|
import { createInterface } from "node:readline";
|
|
@@ -26,8 +30,15 @@ function listen({ channel, restart, deliver, stopped }) {
|
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
// index.ts
|
|
33
|
+
function addBundledArtil() {
|
|
34
|
+
const artil = dirname(createRequire(import.meta.url).resolve("artil-ai/package.json"));
|
|
35
|
+
const path = process.env.PATH?.split(delimiter) ?? [];
|
|
36
|
+
if (!path.includes(artil))
|
|
37
|
+
process.env.PATH = [...path, artil].join(delimiter);
|
|
38
|
+
}
|
|
29
39
|
function hearNewMessages(pi) {
|
|
30
40
|
let listening;
|
|
41
|
+
addBundledArtil();
|
|
31
42
|
pi.on("session_start", (_event, ctx) => {
|
|
32
43
|
if (!ctx.hasUI)
|
|
33
44
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artil-ai/pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Email, SMS and Telegram for Pi. Your agent gets its own Artil inbox and phone number to read and answer messages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -33,6 +33,9 @@
|
|
|
33
33
|
"build": "bun build index.ts --outdir dist --target node --external @earendil-works/pi-coding-agent && rm -rf skills && cp -R ../../skills skills",
|
|
34
34
|
"prepack": "bun run build"
|
|
35
35
|
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"artil-ai": "0.23.0"
|
|
38
|
+
},
|
|
36
39
|
"devDependencies": {
|
|
37
40
|
"@artil-ai/channel": "workspace:*",
|
|
38
41
|
"@earendil-works/pi-coding-agent": "1.0.4"
|