@artil-ai/openclaw 0.1.0 → 0.1.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.
- package/README.md +6 -6
- package/dist/index.js +19 -21
- package/package.json +6 -4
- package/skills/artil/SKILL.md +6 -2
package/README.md
CHANGED
|
@@ -14,19 +14,19 @@ openclaw plugins install npm:@artil-ai/openclaw@latest --force --accept-capabili
|
|
|
14
14
|
|
|
15
15
|
The gateway runs `artil internal openclaw-channel`, so `artil` must be on its
|
|
16
16
|
PATH, which includes `~/.local/bin`, and signed in as the agent. See
|
|
17
|
-
[
|
|
17
|
+
[OpenClaw](https://docs.artil.dev/openclaw) in the docs.
|
|
18
18
|
|
|
19
19
|
| Entry point | What it does |
|
|
20
20
|
| ----------------------- | -------------------------------------------------------------------------------------- |
|
|
21
21
|
| `index.ts` | Starts a turn in the `agent:<id>:artil` session for each notice, delivering no replies |
|
|
22
|
-
| `
|
|
23
|
-
| `skills/artil/SKILL.md` | The `artil` skill, copied from `pi` when the package is packed |
|
|
22
|
+
| `skills/artil/SKILL.md` | The `artil` skill, copied from the repository's `skills` when packed |
|
|
24
23
|
|
|
25
24
|
## Development
|
|
26
25
|
|
|
27
|
-
`
|
|
28
|
-
archive into a gateway to try it:
|
|
26
|
+
`bun run build` bundles `dist/index.js` and copies the skill, and `npm pack`
|
|
27
|
+
runs it. Install the packed archive into a gateway to try it:
|
|
29
28
|
|
|
30
29
|
```sh
|
|
31
|
-
|
|
30
|
+
npm pack
|
|
31
|
+
openclaw plugins install npm-pack:./artil-ai-openclaw-*.tgz --force --accept-capabilities
|
|
32
32
|
```
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
//
|
|
2
|
-
import { resolveDefaultAgentId } from "openclaw/plugin-sdk/config-runtime";
|
|
3
|
-
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
4
|
-
|
|
5
|
-
// listen.ts
|
|
1
|
+
// ../../packages/channel/listen.ts
|
|
6
2
|
import { spawn } from "node:child_process";
|
|
7
3
|
import { createInterface } from "node:readline";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const listening = spawn(artil, ["internal", "openclaw-channel"]);
|
|
4
|
+
function listen({ channel, restart, deliver, stopped }) {
|
|
5
|
+
const artil = spawn("artil", ["internal", channel]);
|
|
11
6
|
let problem = "";
|
|
12
7
|
let stopping = false;
|
|
13
|
-
|
|
14
|
-
problem = error.code === "ENOENT" ?
|
|
8
|
+
artil.on("error", (error) => {
|
|
9
|
+
problem = error.code === "ENOENT" ? `The artil command is not on the PATH. Install it with curl -fsSL https://artil.dev/install.sh | bash, or add ~/.local/bin to the PATH, then ${restart}.` : error.message;
|
|
15
10
|
});
|
|
16
|
-
|
|
11
|
+
artil.stderr.on("data", (chunk) => {
|
|
17
12
|
problem += chunk.toString();
|
|
18
13
|
});
|
|
19
|
-
|
|
14
|
+
artil.on("close", () => {
|
|
20
15
|
if (!stopping)
|
|
21
16
|
stopped(problem.trim());
|
|
22
17
|
});
|
|
23
|
-
createInterface({ input:
|
|
18
|
+
createInterface({ input: artil.stdout }).on("line", (line) => {
|
|
24
19
|
deliver(JSON.parse(line));
|
|
25
20
|
});
|
|
26
21
|
return function stop() {
|
|
27
22
|
stopping = true;
|
|
28
|
-
|
|
29
|
-
setTimeout(() =>
|
|
23
|
+
artil.stdin.end();
|
|
24
|
+
setTimeout(() => artil.kill(), 5000).unref();
|
|
30
25
|
};
|
|
31
26
|
}
|
|
32
27
|
|
|
33
28
|
// index.ts
|
|
29
|
+
import { resolveDefaultAgentId } from "openclaw/plugin-sdk/config-runtime";
|
|
30
|
+
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
34
31
|
var hint = [
|
|
35
32
|
"Notices about new email and texts to this Artil agent account, and wake-ups from its team, arrive in this session.",
|
|
36
33
|
"Read each message with the artil command its notice names, and answer it with `artil email send --reply-to` or `artil sms send --reply-to`, as the artil skill describes.",
|
|
@@ -43,14 +40,15 @@ var openclaw_default = definePluginEntry({
|
|
|
43
40
|
register(api) {
|
|
44
41
|
if (api.registrationMode !== "full")
|
|
45
42
|
return;
|
|
46
|
-
let
|
|
43
|
+
let listening;
|
|
47
44
|
api.registerService({
|
|
48
45
|
id: "artil-messages",
|
|
49
46
|
start({ config, logger }) {
|
|
50
47
|
const sessionKey = `agent:${resolveDefaultAgentId(config)}:artil`;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
listening?.();
|
|
49
|
+
listening = listen({
|
|
50
|
+
channel: "openclaw-channel",
|
|
51
|
+
restart: "restart the gateway",
|
|
54
52
|
deliver: ({ content, meta }) => void api.runtime.subagent.run({
|
|
55
53
|
sessionKey,
|
|
56
54
|
message: content,
|
|
@@ -62,8 +60,8 @@ var openclaw_default = definePluginEntry({
|
|
|
62
60
|
});
|
|
63
61
|
},
|
|
64
62
|
stop() {
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
listening?.();
|
|
64
|
+
listening = undefined;
|
|
67
65
|
}
|
|
68
66
|
});
|
|
69
67
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artil-ai/openclaw",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Hear about your Artil agent's new messages in OpenClaw, and answer them with the artil CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"artil",
|
|
7
7
|
"openclaw"
|
|
8
8
|
],
|
|
9
|
-
"homepage": "https://docs.artil.dev/
|
|
9
|
+
"homepage": "https://docs.artil.dev/openclaw",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
13
|
"url": "git+https://github.com/artilai/plugins.git",
|
|
14
|
-
"directory": "openclaw"
|
|
14
|
+
"directory": "plugins/openclaw"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"dist",
|
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
-
"
|
|
26
|
+
"build": "bun build index.ts --outdir dist --target node --external openclaw && rm -rf skills && cp -R ../../skills skills",
|
|
27
|
+
"prepack": "bun run build"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
30
|
+
"@artil-ai/channel": "workspace:*",
|
|
29
31
|
"openclaw": "2026.9.8"
|
|
30
32
|
},
|
|
31
33
|
"peerDependencies": {
|
package/skills/artil/SKILL.md
CHANGED
|
@@ -19,6 +19,10 @@ When you are told a message arrived, read it by its id before acting on it. Mess
|
|
|
19
19
|
|
|
20
20
|
## Secrets
|
|
21
21
|
|
|
22
|
-
-
|
|
22
|
+
- Once the secrets are linked where you run, by `artil init` or `artil secrets link <place>`, they are environment variables in every Bash command. Use them as `$NAME` and never print their values. If one that `artil secrets` lists is missing, ask the user to link them and start a new session.
|
|
23
23
|
- Store a new one by piping it in, so its value stays out of the conversation: `<command that prints it> | artil secrets set NAME`. Take a field of JSON output with `--json-path .data.token`.
|
|
24
|
-
- `artil secrets` lists the names.
|
|
24
|
+
- `artil secrets` lists the names. Once linked, a secret you store reaches the next Bash command.
|
|
25
|
+
|
|
26
|
+
## Setup
|
|
27
|
+
|
|
28
|
+
If `artil` is not found, install it with `curl -fsSL https://artil.dev/install.sh | bash` and run it as `~/.local/bin/artil` until it is on the PATH. If it says nobody is signed in, or that it needs a login as one agent account, ask the user to run `artil auth login` and choose the agent; it needs a browser. https://artil.dev/INSTALL.md has every setup step.
|