@factiii/runner 0.10.0 → 0.10.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/dist/cli.js +526 -225
- package/index/index.js +8 -2
- package/package.json +2 -1
- package/plugin/.claude-plugin/marketplace.json +12 -0
- package/plugin/factiii/.claude-plugin/plugin.json +7 -0
- package/plugin/factiii/bin/report-state.sh +43 -0
- package/plugin/factiii/hooks/hooks.json +59 -0
- package/plugin/factiii/skills/share-a-port/SKILL.md +41 -0
package/index/index.js
CHANGED
|
@@ -92495,14 +92495,20 @@ function text(value) {
|
|
|
92495
92495
|
return { content: [{ type: "text", text: value }] };
|
|
92496
92496
|
}
|
|
92497
92497
|
function makeTool(t) {
|
|
92498
|
+
const args = t.args.strict();
|
|
92498
92499
|
return {
|
|
92499
92500
|
name: t.name,
|
|
92500
92501
|
description: t.description,
|
|
92501
92502
|
inputSchema: t.inputSchema,
|
|
92502
|
-
handle: (raw) => t.run(
|
|
92503
|
+
handle: (raw) => t.run(args.parse(raw))
|
|
92503
92504
|
};
|
|
92504
92505
|
}
|
|
92505
|
-
var objectSchema = (properties, required2) => ({
|
|
92506
|
+
var objectSchema = (properties, required2) => ({
|
|
92507
|
+
type: "object",
|
|
92508
|
+
properties,
|
|
92509
|
+
required: required2,
|
|
92510
|
+
additionalProperties: false
|
|
92511
|
+
});
|
|
92506
92512
|
function buildTools(store2, spaceSlug, fileBaseUrl) {
|
|
92507
92513
|
return [
|
|
92508
92514
|
makeTool({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@factiii/runner",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "Factiii Runner, run Board AI agents on a machine you control. Pairs with the Factiii web/mobile clients over WebRTC.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"keywords": [
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"dist/cli.js",
|
|
26
|
+
"plugin/",
|
|
26
27
|
"index/index.js",
|
|
27
28
|
"index/image-package.json",
|
|
28
29
|
"vendor/frpc-linux-amd64",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "factiii-runner",
|
|
3
|
+
"description": "Everything a factiii runner hands its CLIs: session status hooks and workspace skills.",
|
|
4
|
+
"owner": { "name": "Factiii" },
|
|
5
|
+
"plugins": [
|
|
6
|
+
{
|
|
7
|
+
"name": "factiii",
|
|
8
|
+
"source": "./factiii",
|
|
9
|
+
"description": "Board terminal integration for claude and codex."
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "factiii",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Board terminal integration: reports what the agent is doing to the session's status dot, and ships the skills a factiii workspace provides.",
|
|
5
|
+
"author": { "name": "Factiii" },
|
|
6
|
+
"homepage": "https://factiii.com"
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Tell the runner what the agent is doing, so the board's status dot reflects
|
|
3
|
+
# it. Called from hooks.json on the events both CLIs share.
|
|
4
|
+
#
|
|
5
|
+
# Everything is derived, nothing is injected. The runner sets a tmux session's
|
|
6
|
+
# environment only when it CREATES the session (`new-session -A -e`), so a var
|
|
7
|
+
# added by a runner upgrade never reaches a session that is already running —
|
|
8
|
+
# which on any real host is most of them. TMUX_PANE is set by tmux itself at
|
|
9
|
+
# pane creation, so it is already there in every session ever started.
|
|
10
|
+
#
|
|
11
|
+
# It doubles as the gate. This plugin installs globally, so its hooks fire on
|
|
12
|
+
# every claude and codex run on this machine; outside a factiii workspace there
|
|
13
|
+
# is no pane and no space redis to find, and this exits having done nothing.
|
|
14
|
+
#
|
|
15
|
+
# Never fails the CLI. A hook that exits non-zero can block the turn it fired
|
|
16
|
+
# on, and a status dot is not worth interrupting someone's work for.
|
|
17
|
+
set -u
|
|
18
|
+
[ -n "${TMUX_PANE:-}" ] || exit 0
|
|
19
|
+
|
|
20
|
+
# The space's redis sits at <spaceDir>/state/redis.sock and the CLI runs inside
|
|
21
|
+
# that space's tree, so walk up for it. Bounded by reaching the root.
|
|
22
|
+
dir="$PWD"
|
|
23
|
+
sock=""
|
|
24
|
+
while [ -n "$dir" ] && [ "$dir" != "/" ]; do
|
|
25
|
+
if [ -S "$dir/state/redis.sock" ]; then
|
|
26
|
+
sock="$dir/state/redis.sock"
|
|
27
|
+
break
|
|
28
|
+
fi
|
|
29
|
+
dir="$(dirname "$dir")"
|
|
30
|
+
done
|
|
31
|
+
[ -n "$sock" ] || exit 0
|
|
32
|
+
|
|
33
|
+
state="${1:-idle}"
|
|
34
|
+
# The pane is the identity; the runner resolves it to a session. Keeping that
|
|
35
|
+
# mapping on the runner is what stops this script from having to know how tmux
|
|
36
|
+
# sessions are named.
|
|
37
|
+
#
|
|
38
|
+
# SET then PUBLISH: the publish drives live dots, the key lets a subscriber
|
|
39
|
+
# that starts mid-session read where things stand without waiting for a hook.
|
|
40
|
+
# -t 2 so a dead socket costs milliseconds rather than hanging the turn.
|
|
41
|
+
redis-cli -t 2 -s "$sock" set "agent-state:$TMUX_PANE" "$state" >/dev/null 2>&1
|
|
42
|
+
redis-cli -t 2 -s "$sock" publish agent-state "$TMUX_PANE $state" >/dev/null 2>&1
|
|
43
|
+
exit 0
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"UserPromptSubmit": [
|
|
4
|
+
{
|
|
5
|
+
"hooks": [
|
|
6
|
+
{
|
|
7
|
+
"type": "command",
|
|
8
|
+
"command": "\"${CLAUDE_PLUGIN_ROOT}/bin/report-state.sh\" working",
|
|
9
|
+
"timeout": 5
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"Stop": [
|
|
15
|
+
{
|
|
16
|
+
"hooks": [
|
|
17
|
+
{
|
|
18
|
+
"type": "command",
|
|
19
|
+
"command": "\"${CLAUDE_PLUGIN_ROOT}/bin/report-state.sh\" idle",
|
|
20
|
+
"timeout": 5
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"PermissionRequest": [
|
|
26
|
+
{
|
|
27
|
+
"hooks": [
|
|
28
|
+
{
|
|
29
|
+
"type": "command",
|
|
30
|
+
"command": "\"${CLAUDE_PLUGIN_ROOT}/bin/report-state.sh\" blocked",
|
|
31
|
+
"timeout": 5
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"Notification": [
|
|
37
|
+
{
|
|
38
|
+
"hooks": [
|
|
39
|
+
{
|
|
40
|
+
"type": "command",
|
|
41
|
+
"command": "\"${CLAUDE_PLUGIN_ROOT}/bin/report-state.sh\" blocked",
|
|
42
|
+
"timeout": 5
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"SessionEnd": [
|
|
48
|
+
{
|
|
49
|
+
"hooks": [
|
|
50
|
+
{
|
|
51
|
+
"type": "command",
|
|
52
|
+
"command": "\"${CLAUDE_PLUGIN_ROOT}/bin/report-state.sh\" idle",
|
|
53
|
+
"timeout": 5
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: share-a-port
|
|
3
|
+
description: Give a port running in this workspace a public HTTPS URL, with factiii-expose. TRIGGER when the user asks to share, expose, preview or publish a local server, wants a link to something running on localhost, or needs an external service to reach a local port.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# share-a-port
|
|
7
|
+
|
|
8
|
+
This workspace can put a local port on the public internet. Both commands are
|
|
9
|
+
already on your PATH; nothing needs installing.
|
|
10
|
+
|
|
11
|
+
## Share a port
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
factiii-expose <port> <name> # e.g. factiii-expose 3000 app
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
It prints the public URL and returns straight away - the tunnel runs in the
|
|
18
|
+
background and lives until the session ends or you stop it.
|
|
19
|
+
|
|
20
|
+
- `<name>` may hold letters, numbers and dashes only.
|
|
21
|
+
- Re-running it with the same name replaces that tunnel rather than opening a
|
|
22
|
+
second one, so it is safe to repeat.
|
|
23
|
+
- Start the server FIRST. A URL for a port nothing is listening on answers
|
|
24
|
+
with an error, which reads to the user like a broken tunnel.
|
|
25
|
+
|
|
26
|
+
## Stop sharing
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
factiii-unexpose <name>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Before you share
|
|
33
|
+
|
|
34
|
+
The URL is public and unauthenticated: anyone holding the link reaches
|
|
35
|
+
whatever that port serves. Do not expose a service that fronts real
|
|
36
|
+
credentials, customer data, or a database. If you are unsure whether the user
|
|
37
|
+
wants something reachable from outside, ask first.
|
|
38
|
+
|
|
39
|
+
Always tell the user the URL you got back. They can also see every live
|
|
40
|
+
tunnel, and stop any of them, in the card's Task Manager panel.
|
|
41
|
+
|