@bastani/atomic 0.8.14 → 0.8.15-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 (50) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +0 -8
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/CHANGELOG.md +3 -0
  5. package/dist/builtin/mcp/index.ts +4 -8
  6. package/dist/builtin/mcp/package.json +1 -1
  7. package/dist/builtin/subagents/package.json +1 -1
  8. package/dist/builtin/subagents/skills/tmux/SKILL.md +220 -0
  9. package/dist/builtin/subagents/skills/tmux/scripts/find-sessions.sh +112 -0
  10. package/dist/builtin/subagents/skills/tmux/scripts/wait-for-text.sh +83 -0
  11. package/dist/builtin/web-access/package.json +1 -1
  12. package/dist/builtin/workflows/CHANGELOG.md +10 -1
  13. package/dist/builtin/workflows/README.md +3 -1
  14. package/dist/builtin/workflows/builtin/ralph.ts +222 -295
  15. package/dist/builtin/workflows/package.json +1 -1
  16. package/dist/builtin/workflows/src/extension/background-ui-adapter.ts +20 -11
  17. package/dist/builtin/workflows/src/extension/index.ts +1 -0
  18. package/dist/builtin/workflows/src/extension/status-writer.ts +18 -3
  19. package/dist/builtin/workflows/src/runs/background/runner.ts +8 -10
  20. package/dist/builtin/workflows/src/runs/foreground/executor.ts +484 -91
  21. package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +13 -2
  22. package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +41 -15
  23. package/dist/builtin/workflows/src/runs/shared/graph-inference.ts +31 -0
  24. package/dist/builtin/workflows/src/runs/shared/prompt-callsite.ts +98 -0
  25. package/dist/builtin/workflows/src/shared/persistence-restore.ts +3 -1
  26. package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +4 -0
  27. package/dist/builtin/workflows/src/shared/store-types.ts +12 -1
  28. package/dist/builtin/workflows/src/shared/store.ts +77 -3
  29. package/dist/builtin/workflows/src/tui/graph-view.ts +17 -1
  30. package/dist/builtin/workflows/src/tui/prompt-card.ts +185 -30
  31. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +386 -21
  32. package/docs/changelog.mdx +41 -14
  33. package/docs/docs.json +1 -0
  34. package/docs/extensions.md +19 -19
  35. package/docs/images/workflow-input-picker.png +0 -0
  36. package/docs/images/workflow-list.png +0 -0
  37. package/docs/index.md +33 -27
  38. package/docs/providers.md +2 -2
  39. package/docs/quickstart.md +15 -15
  40. package/docs/sdk.md +8 -8
  41. package/docs/sessions.md +5 -5
  42. package/docs/settings.md +27 -1
  43. package/docs/skills.md +2 -2
  44. package/docs/subagents.md +157 -0
  45. package/docs/usage.md +7 -7
  46. package/docs/windows.md +8 -0
  47. package/docs/workflows.md +62 -9
  48. package/package.json +2 -1
  49. package/docs/images/doom-extension.png +0 -0
  50. package/docs/images/exy.png +0 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.8.15-0] - 2026-05-25
6
+
7
+ ### Breaking Changes
8
+
9
+ - Changed workflow `ctx.ui.*` prompts to render as synthetic graph stage nodes with `awaiting_input` status, including new `StageSnapshot.promptAnswerState` metadata.
10
+ - Changed `ctx.ui.select(..., [])` to throw before creating a prompt node instead of returning an empty string.
11
+
12
+ ### Added
13
+
14
+ - Added live-memory prompt answer replay for workflow continuations.
15
+ - Added workflow control and subagents documentation updates, plus bundled docs link validation.
16
+
17
+ ### Changed
18
+
19
+ - Updated Ralph around an autonomous goal contract so stages infer verifiable criteria, require receipts, and judge completion against the verification oracle.
20
+ - Updated Ralph to discover project initialization needs from repository evidence before implementation work proceeds.
21
+
22
+ ### Fixed
23
+
24
+ - Returned the workflow overlay to the graph orchestrator after answering or skipping a `ctx.ui` prompt node.
25
+ - Stopped eagerly starting MCP OAuth callback handling during session startup.
26
+ - Carried forward bundled subagent fixes for nested fanout state, child allowlists, async runner config permissions, fallback models, read-only guard overrides, Windows child process spawning, stable running glyphs, and recovered intermediate child errors.
27
+
5
28
  ## [0.8.14] - 2026-05-25
6
29
 
7
30
  ### Changed
package/README.md CHANGED
@@ -9,12 +9,6 @@
9
9
  <a href="https://discord.com/invite/3cU7Bz4UPx"><img alt="Discord" src="https://img.shields.io/badge/discord-community-5865F2?style=flat-square&logo=discord&logoColor=white" /></a>
10
10
  <a href="https://www.npmjs.com/package/@bastani/atomic"><img alt="npm" src="https://img.shields.io/npm/v/@bastani/atomic?style=flat-square" /></a>
11
11
  </p>
12
- <p align="center">
13
- <a href="https://pi.dev">pi.dev</a> domain graciously donated by
14
- <br /><br />
15
- <a href="https://exe.dev"><img src="docs/images/exy.png" alt="Exy mascot" width="48" /><br />exe.dev</a>
16
- </p>
17
-
18
12
  > New issues and PRs from new contributors are auto-closed by default. Maintainers review auto-closed issues daily. See [CONTRIBUTING.md](../../CONTRIBUTING.md).
19
13
 
20
14
  ---
@@ -344,8 +338,6 @@ Place in `~/.pi/agent/skills/`, `~/.agents/skills/`, `.pi/skills/`, or `.agents/
344
338
 
345
339
  ### Extensions
346
340
 
347
- <p align="center"><img src="docs/images/doom-extension.png" alt="Doom Extension" width="600"></p>
348
-
349
341
  TypeScript modules that extend pi with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
350
342
 
351
343
  ```typescript
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.8.14",
3
+ "version": "0.8.15-0",
4
4
  "private": true,
5
5
  "description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
6
6
  "contributors": [
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Fixed
11
+ - Stopped eagerly starting MCP OAuth callback handling during session startup, preventing non-blocking OAuth initialization failures from surfacing as workflow/orchestrator errors.
12
+
10
13
  ## [2.6.1] - 2026-05-13
11
14
 
12
15
  ### Added
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI, ToolInfo } from "@bastani/atomic";
1
+ import type { AgentToolUpdateCallback, ExtensionAPI, ExtensionContext, ToolInfo } from "@bastani/atomic";
2
2
  import type { McpExtensionState } from "./state.ts";
3
3
  import { Type } from "typebox";
4
4
  import { showStatus, showTools, reconnectServers, authenticateServer, logoutServer, openMcpAuthPanel, openMcpPanel, openMcpSetup } from "./commands.ts";
@@ -8,7 +8,7 @@ import { flushMetadataCache, initializeMcp, updateStatusBar } from "./init.ts";
8
8
  import { loadMetadataCache } from "./metadata-cache.ts";
9
9
  import { executeCall, executeConnect, executeDescribe, executeList, executeSearch, executeStatus, executeUiMessages } from "./proxy-modes.ts";
10
10
  import { getConfigPathFromArgv, truncateAtWord } from "./utils.ts";
11
- import { initializeOAuth, shutdownOAuth } from "./mcp-auth-flow.ts";
11
+ import { shutdownOAuth } from "./mcp-auth-flow.ts";
12
12
  import { renderMcpToolResult } from "./tool-result-renderer.ts";
13
13
 
14
14
  export default function mcpAdapter(pi: ExtensionAPI) {
@@ -104,10 +104,6 @@ export default function mcpAdapter(pi: ExtensionAPI) {
104
104
  return;
105
105
  }
106
106
 
107
- await initializeOAuth().catch(() => {
108
- console.error("MCP OAuth initialization failed");
109
- });
110
-
111
107
  const promise = initializeMcp(pi, ctx);
112
108
  initPromise = promise;
113
109
 
@@ -264,7 +260,7 @@ export default function mcpAdapter(pi: ExtensionAPI) {
264
260
  action: Type.Optional(Type.String({ description: "Action: 'ui-messages' to retrieve prompts/intents from UI sessions" })),
265
261
  }),
266
262
  renderResult: renderMcpToolResult,
267
- async execute(_toolCallId, params: {
263
+ async execute(_toolCallId: string, params: {
268
264
  tool?: string;
269
265
  args?: string;
270
266
  connect?: string;
@@ -274,7 +270,7 @@ export default function mcpAdapter(pi: ExtensionAPI) {
274
270
  includeSchemas?: boolean;
275
271
  server?: string;
276
272
  action?: string;
277
- }, _signal, _onUpdate, _ctx) {
273
+ }, _signal: AbortSignal | undefined, _onUpdate: AgentToolUpdateCallback<Record<string, unknown>> | undefined, _ctx: ExtensionContext) {
278
274
  let parsedArgs: Record<string, unknown> | undefined;
279
275
  if (params.args) {
280
276
  try {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.8.14",
3
+ "version": "0.8.15-0",
4
4
  "private": true,
5
5
  "description": "Atomic extension that adapts MCP (Model Context Protocol) servers into the coding agent. Fork of: https://github.com/nicobailon/pi-mcp-adapter",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.8.14",
3
+ "version": "0.8.15-0",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with chains, parallel execution, and TUI clarification. Fork of: https://github.com/nicobailon/pi-subagents",
6
6
  "contributors": [
@@ -0,0 +1,220 @@
1
+ ---
2
+ name: tmux
3
+ description: "Control tmux-compatible sessions/windows/panes for interactive CLIs: list, capture output, send keys, paste text, monitor prompts."
4
+ metadata:
5
+ {
6
+ "atomic":
7
+ {
8
+ "os": ["darwin", "linux", "windows"],
9
+ "requires": { "bins": ["tmux", "psmux"] },
10
+ "install":
11
+ [
12
+ {
13
+ "id": "brew",
14
+ "kind": "brew",
15
+ "formula": "tmux",
16
+ "bins": ["tmux"],
17
+ "label": "Install tmux (brew)",
18
+ },
19
+ {
20
+ "id": "winget-psmux",
21
+ "kind": "winget",
22
+ "package": "psmux",
23
+ "bins": ["tmux"],
24
+ "label": "Install psmux (WinGet)",
25
+ },
26
+ {
27
+ "id": "cargo-psmux",
28
+ "kind": "cargo",
29
+ "crate": "psmux",
30
+ "bins": ["tmux"],
31
+ "label": "Install psmux (Cargo)",
32
+ },
33
+ {
34
+ "id": "scoop-psmux",
35
+ "kind": "scoop",
36
+ "bucket": "https://github.com/psmux/scoop-psmux",
37
+ "package": "psmux",
38
+ "bins": ["tmux"],
39
+ "label": "Install psmux (Scoop)",
40
+ },
41
+ {
42
+ "id": "choco-psmux",
43
+ "kind": "choco",
44
+ "package": "psmux",
45
+ "bins": ["tmux"],
46
+ "label": "Install psmux (Chocolatey)",
47
+ },
48
+ ],
49
+ },
50
+ }
51
+ ---
52
+
53
+ # tmux
54
+
55
+ Use for existing interactive tmux sessions. For one-shot commands, use normal shell. For new non-interactive background jobs, use background execution.
56
+
57
+ On Windows, use [psmux](https://github.com/psmux/psmux), the native Windows tmux-compatible multiplexer. psmux automatically provides the `tmux` alias, so keep using the `tmux` commands below; no command changes are needed.
58
+
59
+ When this skill is invoked, first confirm `tmux` is available before running tmux commands (`command -v tmux` or `tmux -V`; on Windows PowerShell, `Get-Command tmux`). If `tmux` is not found, tell the user to install tmux on macOS/Linux or psmux on Windows, depending on their OS, using one of the options below.
60
+
61
+ ## Installation
62
+
63
+ Choose the install path that matches the host OS and package manager.
64
+
65
+ ### macOS/Linux tmux
66
+
67
+ Package managers are preferred when available:
68
+
69
+ ```bash
70
+ brew install tmux
71
+ ```
72
+
73
+ To build official tmux from a release tarball, install `libevent` 2.x, `ncurses`, a C compiler, `make`, `pkg-config`, and `yacc` or `bison`, then run:
74
+
75
+ ```bash
76
+ ./configure && make
77
+ sudo make install
78
+ ```
79
+
80
+ To build the latest tmux from version control, also install `autoconf` and `automake`:
81
+
82
+ ```bash
83
+ git clone https://github.com/tmux/tmux.git
84
+ cd tmux
85
+ sh autogen.sh
86
+ ./configure && make
87
+ sudo make install
88
+ ```
89
+
90
+ ### Windows psmux
91
+
92
+ psmux installs `psmux`, `pmux`, and `tmux`; this skill should continue to use `tmux` in examples and scripts.
93
+
94
+ ```powershell
95
+ winget install psmux
96
+ cargo install psmux
97
+ scoop bucket add psmux https://github.com/psmux/scoop-psmux
98
+ scoop install psmux
99
+ choco install psmux
100
+ ```
101
+
102
+ Alternatively, download the latest `.zip` from GitHub Releases and add it to `PATH`, or build from source with Cargo:
103
+
104
+ ```powershell
105
+ git clone https://github.com/psmux/psmux.git
106
+ cd psmux
107
+ cargo build --release
108
+ ```
109
+
110
+ ## Basics
111
+
112
+ ```bash
113
+ tmux ls
114
+ tmux list-windows -t shared
115
+ tmux list-panes -t shared:0
116
+ tmux capture-pane -t shared:0.0 -p
117
+ tmux capture-pane -t shared:0.0 -p -S -
118
+ ```
119
+
120
+ Target format: `session:window.pane`, e.g. `shared:0.0`.
121
+
122
+ ## Send input
123
+
124
+ Literal text, then Enter:
125
+
126
+ ```bash
127
+ tmux send-keys -t shared:0.0 -l -- "Please continue"
128
+ tmux send-keys -t shared:0.0 Enter
129
+ ```
130
+
131
+ Special keys:
132
+
133
+ ```bash
134
+ tmux send-keys -t shared:0.0 C-c
135
+ tmux send-keys -t shared:0.0 C-d
136
+ tmux send-keys -t shared:0.0 Escape
137
+ ```
138
+
139
+ Use `-l --` for arbitrary text. Split text and Enter to avoid paste/newline surprises.
140
+
141
+ ## Sessions
142
+
143
+ ```bash
144
+ tmux new-session -d -s worker
145
+ tmux rename-session -t old new
146
+ tmux kill-session -t worker
147
+ ```
148
+
149
+ ## Prompt checks
150
+
151
+ ```bash
152
+ tmux capture-pane -t worker-3 -p | tail -20
153
+ tmux capture-pane -t worker-3 -p | rg "proceed|permission|Yes|No|❯"
154
+ ```
155
+
156
+ Approve/select only when the prompt is understood:
157
+
158
+ ```bash
159
+ tmux send-keys -t worker-3 -l -- "y"
160
+ tmux send-keys -t worker-3 Enter
161
+ ```
162
+
163
+ ## QA/testing and analysis
164
+
165
+ Prefer read-only inspection before sending input. These commands are especially useful for diagnosing interactive tests, stuck agents, TUI apps, and long-running CLI workflows.
166
+
167
+ Discover every pane with useful state:
168
+
169
+ ```bash
170
+ tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index} #{pane_current_command} #{pane_current_path} active=#{pane_active} dead=#{pane_dead}'
171
+ ```
172
+
173
+ Capture output for assertions or log review:
174
+
175
+ ```bash
176
+ tmux capture-pane -t shared:0.0 -p -S - # full scrollback
177
+ tmux capture-pane -t shared:0.0 -p -S - -J # join wrapped lines
178
+ tmux capture-pane -t shared:0.0 -p -S -1000 # recent output only
179
+ tmux capture-pane -t shared:0.0 -p -e -S -1000 # include escape/color codes for TUI debugging
180
+ ```
181
+
182
+ Inspect what a pane is running:
183
+
184
+ ```bash
185
+ tmux display-message -p -t shared:0.0 '#{pane_current_command} #{pane_current_path} pid=#{pane_pid}'
186
+ tmux show-messages
187
+ ```
188
+
189
+ Stream pane output to a file for later analysis without interrupting the process:
190
+
191
+ ```bash
192
+ tmux pipe-pane -t shared:0.0 -o 'cat >> /tmp/tmux-pane-shared-0-0.log'
193
+ ```
194
+
195
+ Coordinate tests or scripts with tmux signals:
196
+
197
+ ```bash
198
+ tmux wait-for qa-ready # wait
199
+ tmux wait-for -S qa-ready # signal
200
+ ```
201
+
202
+ Keep failed commands visible and label panes for easier reports:
203
+
204
+ ```bash
205
+ tmux set-option -t shared remain-on-exit on
206
+ tmux select-pane -t shared:0.0 -T "api-tests"
207
+ ```
208
+
209
+ If a tmux-compatible implementation does not support a specific format variable or option, fall back to the simpler `list-panes`, `capture-pane`, and `send-keys` forms above.
210
+
211
+ ## Helpers
212
+
213
+ - `scripts/find-sessions.sh`: discover sessions.
214
+ - `scripts/wait-for-text.sh`: wait until pane output contains text.
215
+
216
+ ## Notes
217
+
218
+ - `capture-pane -p` prints to stdout for scripts.
219
+ - `-S -` captures full scrollback.
220
+ - tmux sessions persist across SSH disconnects.
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ usage() {
5
+ cat <<'USAGE'
6
+ Usage: find-sessions.sh [-L socket-name|-S socket-path|-A] [-q pattern]
7
+
8
+ List tmux sessions on a socket (default tmux socket if none provided).
9
+
10
+ Options:
11
+ -L, --socket tmux socket name (passed to tmux -L)
12
+ -S, --socket-path tmux socket path (passed to tmux -S)
13
+ -A, --all scan all sockets under ATOMIC_TMUX_SOCKET_DIR
14
+ -q, --query case-insensitive substring to filter session names
15
+ -h, --help show this help
16
+ USAGE
17
+ }
18
+
19
+ socket_name=""
20
+ socket_path=""
21
+ query=""
22
+ scan_all=false
23
+ socket_dir="${ATOMIC_TMUX_SOCKET_DIR:-${TMPDIR:-/tmp}/atomic-tmux-sockets}"
24
+
25
+ while [[ $# -gt 0 ]]; do
26
+ case "$1" in
27
+ -L|--socket) socket_name="${2-}"; shift 2 ;;
28
+ -S|--socket-path) socket_path="${2-}"; shift 2 ;;
29
+ -A|--all) scan_all=true; shift ;;
30
+ -q|--query) query="${2-}"; shift 2 ;;
31
+ -h|--help) usage; exit 0 ;;
32
+ *) echo "Unknown option: $1" >&2; usage; exit 1 ;;
33
+ esac
34
+ done
35
+
36
+ if [[ "$scan_all" == true && ( -n "$socket_name" || -n "$socket_path" ) ]]; then
37
+ echo "Cannot combine --all with -L or -S" >&2
38
+ exit 1
39
+ fi
40
+
41
+ if [[ -n "$socket_name" && -n "$socket_path" ]]; then
42
+ echo "Use either -L or -S, not both" >&2
43
+ exit 1
44
+ fi
45
+
46
+ if ! command -v tmux >/dev/null 2>&1; then
47
+ echo "tmux not found in PATH" >&2
48
+ exit 1
49
+ fi
50
+
51
+ list_sessions() {
52
+ local label="$1"; shift
53
+ local tmux_cmd=(tmux "$@")
54
+
55
+ if ! sessions="$("${tmux_cmd[@]}" list-sessions -F '#{session_name}\t#{session_attached}\t#{session_created_string}' 2>/dev/null)"; then
56
+ echo "No tmux server found on $label" >&2
57
+ return 1
58
+ fi
59
+
60
+ if [[ -n "$query" ]]; then
61
+ sessions="$(printf '%s\n' "$sessions" | grep -i -- "$query" || true)"
62
+ fi
63
+
64
+ if [[ -z "$sessions" ]]; then
65
+ echo "No sessions found on $label"
66
+ return 0
67
+ fi
68
+
69
+ echo "Sessions on $label:"
70
+ printf '%s\n' "$sessions" | while IFS=$'\t' read -r name attached created; do
71
+ attached_label=$([[ "$attached" == "1" ]] && echo "attached" || echo "detached")
72
+ printf ' - %s (%s, started %s)\n' "$name" "$attached_label" "$created"
73
+ done
74
+ }
75
+
76
+ if [[ "$scan_all" == true ]]; then
77
+ if [[ ! -d "$socket_dir" ]]; then
78
+ echo "Socket directory not found: $socket_dir" >&2
79
+ exit 1
80
+ fi
81
+
82
+ shopt -s nullglob
83
+ sockets=("$socket_dir"/*)
84
+ shopt -u nullglob
85
+
86
+ if [[ "${#sockets[@]}" -eq 0 ]]; then
87
+ echo "No sockets found under $socket_dir" >&2
88
+ exit 1
89
+ fi
90
+
91
+ exit_code=0
92
+ for sock in "${sockets[@]}"; do
93
+ if [[ ! -S "$sock" ]]; then
94
+ continue
95
+ fi
96
+ list_sessions "socket path '$sock'" -S "$sock" || exit_code=$?
97
+ done
98
+ exit "$exit_code"
99
+ fi
100
+
101
+ tmux_cmd=(tmux)
102
+ socket_label="default socket"
103
+
104
+ if [[ -n "$socket_name" ]]; then
105
+ tmux_cmd+=(-L "$socket_name")
106
+ socket_label="socket name '$socket_name'"
107
+ elif [[ -n "$socket_path" ]]; then
108
+ tmux_cmd+=(-S "$socket_path")
109
+ socket_label="socket path '$socket_path'"
110
+ fi
111
+
112
+ list_sessions "$socket_label" "${tmux_cmd[@]:1}"
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ usage() {
5
+ cat <<'USAGE'
6
+ Usage: wait-for-text.sh -t target -p pattern [options]
7
+
8
+ Poll a tmux pane for text and exit when found.
9
+
10
+ Options:
11
+ -t, --target tmux target (session:window.pane), required
12
+ -p, --pattern regex pattern to look for, required
13
+ -F, --fixed treat pattern as a fixed string (grep -F)
14
+ -T, --timeout seconds to wait (integer, default: 15)
15
+ -i, --interval poll interval in seconds (default: 0.5)
16
+ -l, --lines number of history lines to inspect (integer, default: 1000)
17
+ -h, --help show this help
18
+ USAGE
19
+ }
20
+
21
+ target=""
22
+ pattern=""
23
+ grep_flag="-E"
24
+ timeout=15
25
+ interval=0.5
26
+ lines=1000
27
+
28
+ while [[ $# -gt 0 ]]; do
29
+ case "$1" in
30
+ -t|--target) target="${2-}"; shift 2 ;;
31
+ -p|--pattern) pattern="${2-}"; shift 2 ;;
32
+ -F|--fixed) grep_flag="-F"; shift ;;
33
+ -T|--timeout) timeout="${2-}"; shift 2 ;;
34
+ -i|--interval) interval="${2-}"; shift 2 ;;
35
+ -l|--lines) lines="${2-}"; shift 2 ;;
36
+ -h|--help) usage; exit 0 ;;
37
+ *) echo "Unknown option: $1" >&2; usage; exit 1 ;;
38
+ esac
39
+ done
40
+
41
+ if [[ -z "$target" || -z "$pattern" ]]; then
42
+ echo "target and pattern are required" >&2
43
+ usage
44
+ exit 1
45
+ fi
46
+
47
+ if ! [[ "$timeout" =~ ^[0-9]+$ ]]; then
48
+ echo "timeout must be an integer number of seconds" >&2
49
+ exit 1
50
+ fi
51
+
52
+ if ! [[ "$lines" =~ ^[0-9]+$ ]]; then
53
+ echo "lines must be an integer" >&2
54
+ exit 1
55
+ fi
56
+
57
+ if ! command -v tmux >/dev/null 2>&1; then
58
+ echo "tmux not found in PATH" >&2
59
+ exit 1
60
+ fi
61
+
62
+ # End time in epoch seconds (integer, good enough for polling)
63
+ start_epoch=$(date +%s)
64
+ deadline=$((start_epoch + timeout))
65
+
66
+ while true; do
67
+ # -J joins wrapped lines, -S uses negative index to read last N lines
68
+ pane_text="$(tmux capture-pane -p -J -t "$target" -S "-${lines}" 2>/dev/null || true)"
69
+
70
+ if printf '%s\n' "$pane_text" | grep $grep_flag -- "$pattern" >/dev/null 2>&1; then
71
+ exit 0
72
+ fi
73
+
74
+ now=$(date +%s)
75
+ if (( now >= deadline )); then
76
+ echo "Timed out after ${timeout}s waiting for pattern: $pattern" >&2
77
+ echo "Last ${lines} lines from $target:" >&2
78
+ printf '%s\n' "$pane_text" >&2
79
+ exit 1
80
+ fi
81
+
82
+ sleep "$interval"
83
+ done
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.8.14",
3
+ "version": "0.8.15-0",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@@ -6,18 +6,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ### Breaking Changes
10
+
11
+ - Changed workflow human-in-the-loop prompts (`ctx.ui.input`, `ctx.ui.confirm`, `ctx.ui.select`, and `ctx.ui.editor`) to render as synthetic graph stages with `awaiting_input` status; consumers should handle the new `StageSnapshot.promptAnswerState` metadata and avoid caching `StageSnapshot.parentIds` references across store updates ([#1046](https://github.com/flora131/atomic/issues/1046)).
12
+ - Changed `ctx.ui.select(..., [])` to throw `pi-workflows: ctx.ui.select requires at least one option` before creating a prompt node instead of returning an empty string ([#1046](https://github.com/flora131/atomic/issues/1046)).
13
+
9
14
  ### Added
10
15
 
11
16
  - Added workflow tool stage introspection and control actions (`stages`, `stage`, `transcript`, `send`, `pause`, and `reload`) for inspecting stage state, reading transcripts, answering prompts, controlling live stages, pausing runs, and reloading workflow resources ([#1023](https://github.com/flora131/atomic/issues/1023)).
17
+ - Added live-memory prompt answer replay for workflow continuations using snapshot-safe `promptAnswerState` markers and a private `PromptAnswerRecord` ledger that is excluded from snapshots and persistence ([#1046](https://github.com/flora131/atomic/issues/1046)).
12
18
 
13
19
  ### Changed
14
20
 
21
+ - Updated Ralph around an autonomous goal contract so planner, implementation, and reviewer/auditor stages infer verifiable criteria, require receipts, and judge completion against the verification oracle instead of document completeness alone ([#1053](https://github.com/flora131/atomic/issues/1053)).
22
+ - Updated Ralph's orchestrator prompt to discover project initialization needs from repository evidence before implementation work proceeds ([#1048](https://github.com/flora131/atomic/issues/1048)).
15
23
  - Added a final Ralph PR-preparation phase that reviews changes against the configured base branch, tries available GitHub credentials using local git identity as a hint, posts implementation notes as a PR comment, and creates a pull request when possible.
16
- - Updated Ralph to persist planner RFCs under `specs/`, keep OS-temp implementation notes during orchestration, and pass file paths rather than the full plan text to later stages ([#1037](https://github.com/flora131/atomic/issues/1037)).
24
+ - Updated Ralph to persist planner goal contracts and implementation notes as OS-temp workflow artifacts, and pass file paths rather than full plan text to later stages ([#1037](https://github.com/flora131/atomic/issues/1037)).
17
25
  - Updated `deep-research-codebase` output layout to write public reports under `research/` and hidden per-run handoff artifacts under `research/.deep-research-<run-id>/`.
18
26
 
19
27
  ### Fixed
20
28
 
29
+ - Returned the workflow overlay to the graph orchestrator after answering or skipping a `ctx.ui` prompt node, and preserved the prompt's question footprint for read-only prompt-node views.
21
30
  - Removed biasing stage-output and iteration-count context from Ralph reviewer prompts while making the comparison base branch explicit ([#1037](https://github.com/flora131/atomic/issues/1037)).
22
31
  - Ordered snapshot transcript fallback entries chronologically before applying `tail`/`limit`, preserving terminal result/error entries after tools for missing or tied timestamps ([#1023](https://github.com/flora131/atomic/issues/1023)).
23
32
  - Reloaded workflow resources directly for `workflow({ action: "reload" })` instead of queuing a literal `/workflow reload` follow-up ([#1023](https://github.com/flora131/atomic/issues/1023)).
@@ -197,7 +197,9 @@ registry.get("alpha"); // compiled workflow definition | undefined
197
197
 
198
198
  Input overrides are bare `key=value` tokens (no leading `--`). Values are JSON-parsed when possible, so numbers, booleans, and quoted strings work as expected (e.g. `count=3`, `flag=true`, `prompt="multi word value"`). A whole-object override can be passed as a single JSON token (e.g. `{"prompt":"...","count":3}`).
199
199
 
200
- Workflows always run as **background tasks** — the chat editor stays free while a run executes. Press **F2** (or `/workflow connect <run-id>`) to attach to the live graph viewer; HIL prompts (`ctx.ui.input/confirm/select/editor`) surface there, never as modal dialogs over the chat.
200
+ Workflows always run as **background tasks** — the chat editor stays free while a run executes. Press **F2** (or `/workflow connect <run-id>`) to attach to the live graph viewer; HIL prompts (`ctx.ui.input/confirm/select/editor`) appear as awaiting-input graph nodes. Press Enter on the node to answer locally, never as a modal dialog over the chat.
201
+
202
+ Prompt answer replay is live-memory only. `StageSnapshot.promptAnswerState` reports whether continuation can replay a prompt answer (`available`), must ask again because the private ledger entry is gone (`unavailable`), or must ask again because multiple matching prompt nodes are ambiguous (`ambiguous`). Raw answers stay in a private `PromptAnswerRecord` ledger, are never serialized to snapshots or persistence, and remain resident in memory until the answer is cleared, the run is removed, or the store is cleared. Replay keys include prompt kind, message text, select choices, input/editor initial value, and hashed author callsite, so changing any of those inputs may intentionally re-ask on continuation. Empty `ctx.ui.select(..., [])` calls throw before creating a prompt node.
201
203
 
202
204
  ### `workflow` tool (LLM-callable)
203
205