ftown-bridge 0.11.2 → 0.13.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.
Files changed (45) hide show
  1. package/dist/centrifugo-client.d.ts +4 -1
  2. package/dist/centrifugo-client.js +27 -0
  3. package/dist/centrifugo-client.js.map +1 -1
  4. package/dist/codex-installer.js +8 -2
  5. package/dist/codex-installer.js.map +1 -1
  6. package/dist/create-ftown-session.d.ts +1 -0
  7. package/dist/create-ftown-session.js +4 -3
  8. package/dist/create-ftown-session.js.map +1 -1
  9. package/dist/ftown-sessions-cli.js +334 -0
  10. package/dist/ftown-sessions-cli.js.map +1 -1
  11. package/dist/index.js +167 -11
  12. package/dist/index.js.map +1 -1
  13. package/dist/install-ftown-skill.d.ts +2 -0
  14. package/dist/install-ftown-skill.js +39 -0
  15. package/dist/install-ftown-skill.js.map +1 -1
  16. package/dist/local-api-server.d.ts +10 -0
  17. package/dist/local-api-server.js +147 -0
  18. package/dist/local-api-server.js.map +1 -1
  19. package/dist/loop-run-store.d.ts +9 -0
  20. package/dist/loop-run-store.js +159 -0
  21. package/dist/loop-run-store.js.map +1 -0
  22. package/dist/loop-schedule.d.ts +18 -0
  23. package/dist/loop-schedule.js +35 -0
  24. package/dist/loop-schedule.js.map +1 -0
  25. package/dist/loop-scheduler.d.ts +148 -0
  26. package/dist/loop-scheduler.js +534 -0
  27. package/dist/loop-scheduler.js.map +1 -0
  28. package/dist/loop-store.d.ts +36 -0
  29. package/dist/loop-store.js +128 -0
  30. package/dist/loop-store.js.map +1 -0
  31. package/dist/loop-validation.d.ts +14 -0
  32. package/dist/loop-validation.js +95 -0
  33. package/dist/loop-validation.js.map +1 -0
  34. package/dist/types.d.ts +107 -2
  35. package/package.json +2 -1
  36. package/skills/ftown/SKILL.md +48 -0
  37. package/skills/ftown/agents/openai.yaml +4 -0
  38. package/skills/ftown/references/loops.md +88 -0
  39. package/skills/{ftown-orchestrator/SKILL.md → ftown/references/orchestrator.md} +22 -13
  40. package/skills/{ftown-sessions/SKILL.md → ftown/references/sessions.md} +22 -16
  41. package/skills/{ftown-workflows/SKILL.md → ftown/references/workflows.md} +13 -20
  42. package/skills/ftown/scripts/ftown +4 -0
  43. package/skills/ftown-sessions/scripts/ftown-sessions +0 -4
  44. package/skills/ftown-workflows/scripts/ftown-workflows +0 -4
  45. /package/skills/{ftown-workflows → ftown}/scripts/example.flow.mjs +0 -0
@@ -1,20 +1,10 @@
1
- ---
2
- name: ftown-orchestrator
3
- description: >-
4
- Spawn and coordinate worker ftown agent sessions on this machine. Activates when
5
- the session env has FTOWN_ORCHESTRATOR=1, the first input contains an [ftown]
6
- orchestrator briefing, or the user asks to orchestrate, coordinate, or spawn
7
- worker agent sessions. Teaches spawning and coordinating sibling ftown agent
8
- sessions via ~/.ftown/ftown-sessions CLI.
9
- ---
10
-
11
1
  # ftown orchestrator playbook
12
2
 
13
3
  You are running inside an ftown session (your id is in `$FTOWN_SESSION_ID`) and
14
4
  can coordinate worker agent sessions on this machine using the
15
5
  `~/.ftown/ftown-sessions` CLI.
16
6
 
17
- See the **ftown-sessions** skill for the full CLI reference.
7
+ See `references/sessions.md` for the full session CLI reference.
18
8
 
19
9
  ## Spawning workers
20
10
 
@@ -92,6 +82,25 @@ prefer mail, which arrives at the next turn boundary.
92
82
 
93
83
  Clean up workers you no longer need to keep the session list tidy.
94
84
 
85
+ ## Recurring work
86
+
87
+ For unattended recurring work, create a scheduled loop instead of keeping an
88
+ orchestrator alive to poll or sleep. See `references/loops.md` for the full loop
89
+ workflow:
90
+
91
+ ```bash
92
+ ~/.ftown/ftown-sessions loop create \
93
+ --name repo-watch \
94
+ --every 30m \
95
+ --shell codex \
96
+ --workdir /path/to/repo \
97
+ --task "Inspect recent changes, run the focused checks, and report issues"
98
+ ```
99
+
100
+ Loop runs show as normal ftown sessions grouped under their loop in the
101
+ dashboard. Use `~/.ftown/ftown-sessions loop runs <loop-id>` to inspect run
102
+ sessions from the CLI.
103
+
95
104
  ## Practical guidance
96
105
 
97
106
  - **Parallelize** independent tasks: spawn multiple workers before waiting for any.
@@ -104,5 +113,5 @@ Clean up workers you no longer need to keep the session list tidy.
104
113
  ## If the CLI is missing
105
114
 
106
115
  Start or restart **ftown-bridge** on this machine. It installs
107
- `~/.ftown/ftown-sessions` and updates this skill under
108
- `~/.ftown/skills/ftown-orchestrator/` (linked into ~/.agents/skills and ~/.claude/skills).
116
+ `~/.ftown/ftown-sessions` and updates the unified skill under
117
+ `~/.ftown/skills/ftown/` (linked into ~/.agents/skills and ~/.claude/skills).
@@ -1,12 +1,3 @@
1
- ---
2
- name: ftown-sessions
3
- description: >-
4
- Observe and control other ftown CLI agent sessions on the same machine. Use the
5
- ftown-sessions CLI (~/.ftown/ftown-sessions) to list, create, read, and drive
6
- sibling sessions while running inside a ftown-managed Claude Code or Cursor Agent
7
- session.
8
- ---
9
-
10
1
  # ftown cross-session CLI
11
2
 
12
3
  **Prefer the CLI** — installed to `~/.ftown/ftown-sessions` whenever `ftown-bridge` is running. It reads `~/.ftown/bridge.json` automatically.
@@ -15,7 +6,8 @@ description: >-
15
6
  ~/.ftown/ftown-sessions --help
16
7
  ```
17
8
 
18
- Skill copy (same binary via wrapper): `scripts/ftown-sessions` in this skill directory.
9
+ Unified skill wrapper: `scripts/ftown` in this skill directory delegates to the
10
+ top-level `~/.ftown/ftown` dispatcher.
19
11
 
20
12
  **Trust model:** anyone who can read `bridge.json` can control **every** ftown session on that bridge.
21
13
 
@@ -60,6 +52,12 @@ Skill copy (same binary via wrapper): `scripts/ftown-sessions` in this skill dir
60
52
  ~/.ftown/ftown-sessions revive <session-id>
61
53
  ```
62
54
 
55
+ ## Scheduled loops
56
+
57
+ Loop runs are normal sessions tagged with `loopId`. For loop creation,
58
+ schedule syntax, manual runs, pause/resume, and run history, read
59
+ `references/loops.md`.
60
+
63
61
  ## Messaging (mail)
64
62
 
65
63
  `tell` posts to the target session's **inbox**. Mail is delivered into the
@@ -135,11 +133,11 @@ name/id and parent name/id, and how to mail the parent via
135
133
  `ftown-harness mail send --parent`. The creator's `--prompt` follows after a `Task:` line.
136
134
 
137
135
  An agent session created with `--orchestrator` additionally gets `FTOWN_ORCHESTRATOR=1`
138
- in its environment and a compact pointer briefing directing it to the **ftown-orchestrator**
139
- skill (installed at `~/.ftown/skills/ftown-orchestrator`, linked from ~/.agents/skills and
140
- ~/.claude/skills), which contains the full orchestrator playbook for spawning workers,
141
- monitoring them, and cleaning up. When both apply, the child paragraph
142
- comes first, then the orchestrator pointer, separated by a blank line.
136
+ in its environment and a compact pointer briefing directing it to the unified
137
+ **ftown** skill, whose `references/orchestrator.md` contains the full
138
+ orchestrator playbook for spawning workers, monitoring them, and cleaning up.
139
+ When both apply, the child paragraph comes first, then the orchestrator pointer,
140
+ separated by a blank line.
143
141
 
144
142
  ## HTTP API (optional)
145
143
 
@@ -159,7 +157,15 @@ The CLI wraps the loopback API. Raw access if needed:
159
157
  | DELETE | `/api/sessions/:id` | Remove (tombstone-archived) |
160
158
  | GET | `/api/archive` | List removed-session tombstones |
161
159
  | POST | `/api/sessions/:id/revive` | Recreate a removed session (new id) |
160
+ | GET | `/api/loops` | List scheduled loops |
161
+ | POST | `/api/loops` | Create a scheduled loop on this bridge |
162
+ | GET/PATCH/DELETE | `/api/loops/:id` | Inspect, update, or delete a loop |
163
+ | POST | `/api/loops/:id/run-now` | Request an immediate loop run |
164
+ | GET | `/api/loops/:id/runs` | List run sessions for a loop |
162
165
 
163
166
  ## If the CLI is missing
164
167
 
165
- Start or restart **ftown-bridge** on this machine. It installs `~/.ftown/ftown-sessions`, `~/.ftown/notify.sh`, and updates this skill under `~/.ftown/skills/ftown-sessions/` (linked into ~/.agents/skills and ~/.claude/skills).
168
+ Start or restart **ftown-bridge** on this machine. It installs
169
+ `~/.ftown/ftown-sessions`, `~/.ftown/notify.sh`, and updates the unified skill
170
+ under `~/.ftown/skills/ftown/` (linked into ~/.agents/skills and
171
+ ~/.claude/skills).
@@ -1,14 +1,3 @@
1
- ---
2
- name: ftown-workflows
3
- description: >-
4
- Run deterministic, scripted, resumable multi-session workflows across real
5
- ftown agent sessions. Activates when the user wants to fan out ftown worker
6
- sessions over a work list, run a pipeline or parallel batch across ftown
7
- sessions, perform adversarial-verify (majority-vote) across sessions,
8
- loop-until-dry over a dataset, or write a repeatable orchestration script
9
- instead of doing it by hand.
10
- ---
11
-
12
1
  # ftown-workflows
13
2
 
14
3
  `ftown-workflows` is a **scripted orchestration engine** for real ftown sessions.
@@ -17,10 +6,14 @@ You write a `.mjs` script using a small API (`agent`, `parallel`, `pipeline`,
17
6
  cursor / codex), waits for each to write a result file, cleans up, and returns the
18
7
  value — all deterministically and repeatably.
19
8
 
20
- This complements the by-hand **ftown-orchestrator** skill (which is the ad-hoc,
21
- human-in-the-loop playbook). Use ftown-workflows when the work is scripted and
22
- repeatable; use ftown-orchestrator when you need to improvise or keep a human in
23
- the loop.
9
+ This complements the by-hand orchestrator playbook in
10
+ `references/orchestrator.md`. Use ftown-workflows when the work is scripted and
11
+ repeatable; use orchestrator guidance when you need to improvise or keep a
12
+ human in the loop.
13
+
14
+ This is separate from **scheduled loops** managed by `~/.ftown/ftown-sessions
15
+ loop ...`. Scheduled loops create recurring ftown sessions over time. A workflow
16
+ loop is control flow inside one deterministic workflow run.
24
17
 
25
18
  ## Operating Contract
26
19
 
@@ -204,7 +197,7 @@ For long runs, launch in the background and tail the run dir:
204
197
  tail -f ~/.ftown/workflows/<run-id>/*.json
205
198
  ```
206
199
 
207
- See the runnable template at `skills/ftown-workflows/scripts/example.flow.mjs`.
200
+ See the runnable template at `scripts/example.flow.mjs` in this skill directory.
208
201
 
209
202
  ## Script API
210
203
 
@@ -462,9 +455,9 @@ session. To resume a partial run:
462
455
 
463
456
  The run id and run directory are printed at startup.
464
457
 
465
- ## When to use this vs ftown-orchestrator
458
+ ## When to use this vs orchestrator guidance
466
459
 
467
- | | ftown-orchestrator | ftown-workflows |
460
+ | | orchestrator guidance | ftown-workflows |
468
461
  |---|---|---|
469
462
  | **style** | ad-hoc, by hand | scripted, deterministic |
470
463
  | **human in loop** | yes — you direct workers via mail | no — script drives everything |
@@ -475,5 +468,5 @@ The run id and run directory are printed at startup.
475
468
  ## If the CLI is missing
476
469
 
477
470
  Start or restart **ftown-bridge** on this machine. It installs
478
- `~/.ftown/ftown-workflows` and updates this skill under
479
- `~/.ftown/skills/ftown-workflows/` (linked into ~/.agents/skills and ~/.claude/skills).
471
+ `~/.ftown/ftown-workflows` and updates the unified skill under
472
+ `~/.ftown/skills/ftown/` (linked into ~/.agents/skills and ~/.claude/skills).
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+ # Delegates to the bridge-installed top-level ftown dispatcher.
3
+ set -euo pipefail
4
+ exec "${HOME}/.ftown/ftown" "$@"
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Delegates to the bridge-installed CLI (~/.ftown/ftown-sessions).
3
- set -euo pipefail
4
- exec "${HOME}/.ftown/ftown-sessions" "$@"
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Delegates to the bridge-installed CLI (~/.ftown/ftown-workflows).
3
- set -euo pipefail
4
- exec "${HOME}/.ftown/ftown-workflows" "$@"