← Commit history

AI Flow 0.2.81: dock click opens the start page, installs nothing (hydrogen#193)

Colby Knox ·9b88bc617b · ·parent ab067ac
Co-Authored-By: Claude Opus 5.5 <[email protected]>
11 files changed +96−22
Cargo.lock+10−10
@@ -4,7 +4,7 @@ version = 4  [[package]] name = "adom-aiflow"-version = "0.2.80"+version = "0.2.81" dependencies = [  "aiflow-analyze",  "aiflow-board",@@ -25,7 +25,7 @@ dependencies = [  [[package]] name = "aiflow-analyze"-version = "0.2.80"+version = "0.2.81" dependencies = [  "aiflow-board",  "serde",@@ -35,7 +35,7 @@ dependencies = [  [[package]] name = "aiflow-board"-version = "0.2.80"+version = "0.2.81" dependencies = [  "roxmltree",  "serde",@@ -44,7 +44,7 @@ dependencies = [  [[package]] name = "aiflow-bridge"-version = "0.2.80"+version = "0.2.81" dependencies = [  "aiflow-board",  "serde",@@ -53,7 +53,7 @@ dependencies = [  [[package]] name = "aiflow-copper"-version = "0.2.80"+version = "0.2.81" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -63,7 +63,7 @@ dependencies = [  [[package]] name = "aiflow-grid"-version = "0.2.80"+version = "0.2.81" dependencies = [  "aiflow-board",  "serde",@@ -72,7 +72,7 @@ dependencies = [  [[package]] name = "aiflow-place"-version = "0.2.80"+version = "0.2.81" dependencies = [  "aiflow-board",  "serde",@@ -81,7 +81,7 @@ dependencies = [  [[package]] name = "aiflow-pours"-version = "0.2.80"+version = "0.2.81" dependencies = [  "aiflow-board",  "aiflow-copper",@@ -91,7 +91,7 @@ dependencies = [  [[package]] name = "aiflow-router"-version = "0.2.80"+version = "0.2.81" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -101,7 +101,7 @@ dependencies = [  [[package]] name = "aiflow-run"-version = "0.2.80"+version = "0.2.81" dependencies = [  "serde",  "serde_json",
Cargo.toml+1−1
@@ -14,7 +14,7 @@ members = [ ]  [workspace.package]-version = "0.2.80"+version = "0.2.81" edition = "2021" license = "MIT" repository = "https://wiki.adom.inc/adom/adom-aiflow"
README.md+10
@@ -1,5 +1,15 @@ # AI Flow +## Start a run++Paste this prompt into your AI (Claude, Codex, or any AI thread in Hydrogen). The AI installs AI Flow, asks which board you want, and then opens the live timeline beside the chat.++```text+Start an AI Flow run with me. First install or update AI Flow: if adom-aiflow is on your PATH, run `adom-wiki pkg update adom/adom-aiflow`, otherwise run `adom-wiki pkg install adom/adom-aiflow`. Then read the adom-aiflow skill and ask me which board to build or continue (a KiCad, Fusion or Altium project, or a new design from a brief) and which of my machines runs the EDA tool. As soon as you know, open the run (`adom-aiflow intake` for a new design, or continue my existing run) so the live AI Flow timeline opens in the AI Flow tab.+```++Clicking AI Flow in the Hydrogen dock opens this section and puts the same prompt in your AI chat, ready to send. Nothing installs until your AI does it.+ ## AI Flow is a dynamic skill  A **dynamic skill** is a small Rust binary that holds the AI's hand through a long job. It says which step comes next, hands over ready-made code for the routine parts, checks the AI's work with deterministic linters, and answers every command with hints. AI Flow and every `adom-aiflow-<stage>` app (ordering, probing, video, ...) are dynamic skills, and they all follow the same rules:
bin/adom-aiflow
⋯ 1 unchanged line ⋯
crates/adom-aiflow/src/dashboard.rs+11−1
@@ -18,6 +18,9 @@ use std::{  /// Every AI Flow tab name starts with this. pub const PREFIX: &str = "AI Flow \u{b7} ";+/// The tab Hydrogen's dock opens when the human clicks AI Flow (dockbar.json webview.title): it shows the+/// page's "Start a run" section until a run's timeline takes it over in place (adom/hydrogen#193).+pub const DOCK_TAB: &str = "AI Flow"; /// A run whose server is gone and that has been idle this long gives its tab up for reuse. const IDLE_REUSE_SECS: u64 = 12 * 3600; @@ -485,7 +488,7 @@ pub fn ensure(dir: &Path, ai_thread: &str, requested_port: Option<u16>, force_sh     if owned.is_none() {         if let Some(name) = &opts.reuse_tab {             let t = tabs.iter().find(|t| &t.name == name).ok_or_else(|| format!("no tab named \"{name}\" in Hydrogen; `adom-aiflow timeline list` shows the AI Flow tabs"))?;-            if !t.name.starts_with(PREFIX) {+            if !t.name.starts_with(PREFIX) && t.name != DOCK_TAB {                 return Err(format!("\"{name}\" is not an AI Flow tab; --reuse-tab takes only a tab named \"{PREFIX}...\" (`timeline list`)"));             }             replace = Some(t.clone());@@ -533,6 +536,13 @@ pub fn ensure(dir: &Path, ai_thread: &str, requested_port: Option<u16>, force_sh                     replace = Some(t.clone());                 }             }+            // the dock's own tab (the start page from a dock click) becomes this run's timeline, in place+            if replace.is_none() {+                if let Some(t) = tabs.iter().find(|t| t.name == DOCK_TAB && !other_run(&t.name, &reg)) {+                    shown.notes.push(format!("took over the dock's \"{DOCK_TAB}\" tab (the start page) for this run's timeline, renamed in place."));+                    replace = Some(t.clone());+                }+            }         }     } 
dockbar.json+2−7
@@ -8,21 +8,16 @@     "mode": "container_command",     "console": "show",     "steps": [-      {-        "label": "Installing or updating AI Flow (the first install downloads about 150 MB and can take a few minutes)",-        "run": "sh -c 'PATH=\"$HOME/.local/bin:$PATH\"; if command -v adom-aiflow >/dev/null 2>&1; then adom-wiki pkg update adom/adom-aiflow; else adom-wiki pkg install adom/adom-aiflow; fi'",-        "timeout_seconds": 900-      },       {         "label": "Opening AI Flow",-        "run": "echo https://wiki.adom.inc/adom/adom-aiflow",+        "run": "echo https://wiki.adom.inc/adom/adom-aiflow#start-a-run",         "await": "url",         "timeout_seconds": 30       }     ],     "on_ready": "navigate_placeholder",     "ai": {-      "prompt": "I opened AI Flow from the dock. AI Flow (adom/adom-aiflow) is the measured board loop: it walks you through a board from intake and placement through routing, copper pours, current and thermal analysis to a delivered video, with a ledger and a live timeline dashboard. First make sure it is current: if `adom-aiflow` is on PATH run `adom-wiki pkg update adom/adom-aiflow`, otherwise `adom-wiki pkg install adom/adom-aiflow`. Then read the adom-aiflow skill and ask me which board to build or continue (a KiCad, Fusion or Altium project, or a new design from a brief) and which of my machines runs the EDA tool.",+      "prompt": "Start an AI Flow run with me. First install or update AI Flow: if adom-aiflow is on your PATH, run `adom-wiki pkg update adom/adom-aiflow`, otherwise run `adom-wiki pkg install adom/adom-aiflow`. Then read the adom-aiflow skill and ask me which board to build or continue (a KiCad, Fusion or Altium project, or a new design from a brief) and which of my machines runs the EDA tool. As soon as you know, open the run (`adom-aiflow intake` for a new design, or continue my existing run) so the live AI Flow timeline opens in the AI Flow tab.",       "thread": "existing",       "thread_fallback": "new",       "submit": "staged"
docs/release-0.2.81.mdadded+9
@@ -0,0 +1,9 @@+# AI Flow 0.2.81++- **The dock click opens at once and installs nothing** (adom/hydrogen#193, ejhollas). dockbar.json used to install+  or update the whole package (about 150 MB) before anything opened, and on a slow link the click timed out. The+  click now opens the page's new "Start a run" section and stages the same starter prompt in the AI chat; the AI+  installs or updates AI Flow, then opens the run.+- **The run's timeline takes over the dock's tab.** The first run command (`intake`, `start`, ...) turns the dock's+  "AI Flow" tab into the run's timeline in the same pane; `timeline open --reuse-tab "AI Flow"` does it too.+  Test added (tests/dock-tab-workflow.py).
package.json+1−1
@@ -1,7 +1,7 @@ {   "slug": "adom-aiflow",   "type": "app",-  "version": "0.2.80",+  "version": "0.2.81",   "title": "AI Flow",   "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad, Fusion 360 and Altium Designer today (the same steps and gates through each tool's bridge); Adom's own web apps next.",   "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",
page.json+1−1
@@ -1,7 +1,7 @@ {   "slug": "adom-aiflow",   "type": "app",-  "version": "0.2.80",+  "version": "0.2.81",   "title": "AI Flow",   "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad, Fusion 360 and Altium Designer today (the same steps and gates through each tool's bridge); Adom's own web apps next.",   "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",
skills/adom-aiflow/SKILL.md+1−1
@@ -166,7 +166,7 @@ offer, never a step: a no is a fine answer, and the board is finished either way  ### Automatic dashboard (all AI engines) -The CLI opens or reuses the run's Hydrogen webview automatically on `intake`, `start`, and subsequent run commands. `prompt` surfaces it when resuming work. No separate `timeline open` instruction is needed. Keep the dashboard in a work pane beside the chat; do not move the editor or change pane sizes. Each run has its own verified server identity and stable tab name, so concurrent projects cannot silently share the wrong timeline. A closed tab or stopped server is recovered on the next run command. Every completed command refreshes the timeline; long-running work should use real stage/step events, never fabricated progress or idle heartbeats.+The CLI opens or reuses the run's Hydrogen webview automatically on `intake`, `start`, and subsequent run commands. `prompt` surfaces it when resuming work. No separate `timeline open` instruction is needed. Keep the dashboard in a work pane beside the chat; do not move the editor or change pane sizes. Each run has its own verified server identity and stable tab name, so concurrent projects cannot silently share the wrong timeline. A closed tab or stopped server is recovered on the next run command. When the human opened AI Flow from the Hydrogen dock, its tab (named "AI Flow", showing this page's Start a run section) becomes the run's timeline in place on the first run command (0.2.81, adom/hydrogen#193); the dock click itself installs nothing, so install or update the package yourself first. Every completed command refreshes the timeline; long-running work should use real stage/step events, never fabricated progress or idle heartbeats.  `timeline open` remains the explicit show/recovery command. Dashboard failures print `Dashboard unavailable` with recovery guidance and do not change board-gate outcomes. In genuinely headless automation, `AIFLOW_DASHBOARD=off` explicitly suppresses automatic display; this is not the default for Adom users. `--help`, commands without an existing run, and `timeline serve/write` do not create a dashboard recursively. Server lifetime is not charged as an engineering turn. Displayed steps are recorded workflow state, not a substitute for the finish checks. 
tests/dock-tab-workflow.pyadded+50
@@ -0,0 +1,50 @@+"""adom/hydrogen#193 with a fake Hydrogen API (a test-owned adom-cli on PATH): a dock click opens a tab named+"AI Flow" on the page's start section; the run's first command turns that tab into its timeline in the same+pane, and the human's own tabs are never touched."""+import json,os,pathlib,subprocess,sys,tempfile+binary=str(pathlib.Path(sys.argv[1]).resolve())+DOT='AI Flow \u00b7 '+with tempfile.TemporaryDirectory(prefix='aiflow-dock-tab-test-') as root:+ p=pathlib.Path(root);bindir=p/'bin';bindir.mkdir();state=p/'hydrogen.json';calls=p/'calls.jsonl';home=p/'home'+ state.write_text(json.dumps({'panes':{'left':[{'name':'Visual Studio Code','url':None}],'right':[{'name':'Human notes','url':'http://human/'},{'name':'AI Flow','url':'https://wiki.adom.inc/adom/adom-aiflow#start-a-run'}]}}))+ mock=bindir/'adom-cli';mock.write_text('''#!/usr/bin/env python3+import sys,json,os,pathlib+args=sys.argv[1:];p=pathlib.Path(os.environ['TEST_HYDROGEN']);d=json.loads(p.read_text())+with open(os.environ['TEST_CALLS'],'a')as f:f.write(json.dumps(args)+'\\n')+def opt(k):return args[args.index(k)+1] if k in args else None+def find(name):+ for pane,tabs in d['panes'].items():+  for t in tabs:+   if t['name']==name:return pane,t+ return None,None+def save():p.write_text(json.dumps(d))+if args[:3]==['hydrogen','workspace','tabs']:print(json.dumps({'tabs':[{'name':t['name'],'panelId':pane,'url':t['url']} for pane,tabs in d['panes'].items() for t in tabs]}))+elif args[:3]==['hydrogen','workspace','get']:print(json.dumps({'root':{'type':'split','children':[{'type':'leaf','id':pane,'tabs':[{'panelState':{'displayName':t['name'],'url':t['url']}} for t in tabs]} for pane,tabs in d['panes'].items()]}}))+elif args[:3]==['hydrogen','webview','open-or-refresh']:+ name=opt('--name');url=opt('--url');pane,t=find(name)+ if t:t['url']=url;save();print(json.dumps({'ok':True,'action':'refreshed'}))+ else:d['panes'].setdefault(opt('--panel-id') or 'right',[]).append({'name':name,'url':url});save();print(json.dumps({'ok':True,'action':'created'}))+elif args[:3]==['hydrogen','webview','navigate']:+ pane,t=find(opt('--name'))+ if t:t['url']=args[3]+ save();print(json.dumps({'ok':True}))+elif args[:3]==['hydrogen','workspace','remove-tab']:+ pane,t=find(opt('--name'))+ if not t:print(json.dumps({'ok':False}));sys.exit(1)+ d['panes'][pane].remove(t);save();print(json.dumps({'ok':True}))+else:print('{}')+''');mock.chmod(0o755)+ env=dict(os.environ,PATH=str(bindir)+os.pathsep+os.environ['PATH'],TEST_HYDROGEN=str(state),TEST_CALLS=str(calls),AIFLOW_HOME=str(home));env.pop('AIFLOW_DASHBOARD',None);env.pop('VSCODE_PROXY_URI',None)+ def tabs():return {t['name']:(pane,t['url']) for pane,ts in json.loads(state.read_text())['panes'].items() for t in ts}+ run=p/'board'+ try:+  r=subprocess.run([binary,'--run',str(run),'--ai-thread','dock-test','intake','--prompt-time','2026-11-17T10:00:00Z','--engine','claude'],env=env,capture_output=True,text=True,timeout=35)+  assert r.returncode==0,r.stdout+r.stderr+  t=tabs()+  assert 'AI Flow' not in t,('the dock tab became the timeline',t)+  assert t.get(DOT+'board',(None,))[0]=='right',('the timeline sits in the dock tab\'s pane',t)+  assert t['Human notes']==('right','http://human/') and 'Visual Studio Code' in t,t+  assert "took over the dock" in r.stdout+r.stderr,r.stdout+r.stderr+ finally:+  subprocess.run([binary,'--run',str(run),'--ai-thread','dock-test','timeline','close','--run',str(run)],env=env,capture_output=True,text=True,timeout=35)+print('ok dock-tab-workflow')