ECC/scripts/lib
haelyra ae303fb6c1
fix(plan-canvas): deliver browser chat to the agent every time (#2739)
Feedback sent from the canvas only reached an agent through a live
/api/await long poll. When a turn ended with no await parked,
queueFeedback wrote the message to sessions.json and nothing ever
consumed it, so sending appeared to do nothing at all. The presence pill
made it worse: workingKeys had no expiry and the feedback handler never
broadcast presence, so it froze on "agent working" while nobody was
listening.

Delivery:
- Add the stop:plan-canvas-pending hook. It drains undelivered feedback
  and blocks the Stop, handing the messages to the agent, so a canvas
  message lands even when no await is running. Scoped to sessions under
  cwd so parallel agents cannot swallow each other's feedback; set
  ECC_PLAN_CANVAS_STOP_SCOPE=all to widen. Honors stop_hook_active and
  fails open on every error path.
- run-with-flags.js did not await a hook's run(), so any async hook
  silently degraded to pass-through. Fixed; plan-canvas-pending is the
  only async hook today.

Presence and indicators:
- Presence is now ended/typing/thinking/listening/queued/waiting.
  thinking and typing self-expire (90s/30s) and a 5s sweep pushes the
  decay to an idle browser, so the pill can no longer stick.
- Broadcast presence when feedback is queued, and clear the activity
  state when an agent reply lands.
- Add POST /api/session/:key/typing so agents can drive the indicator.
- Chat shows an animated dots bubble for thinking and typing, plus an
  explicit note when a message is queued with nobody listening.
  Respects prefers-reduced-motion.
- Send status reports what actually happened instead of always claiming
  the agent will pick it up.

CLI and skill:
- Add `ecc-plan-canvas pending` and `typing <file> --state ...`.
- SKILL.md documents background await as the primary pattern and makes
  replying in the canvas mandatory.

Tests: 6 new server cases covering queued presence, the typing endpoint,
state expiry and the sweep, plus a new hook suite covering delivery,
drain-once, stop_hook_active, cwd scoping and fail-open.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 18:15:25 -04:00
..
agent-proximity feat(layer4): line-range channel + trigger firing 2026-06-20 17:30:52 -04:00
control-pane feat: Plan Canvas, a browser review canvas for plans (#2467) 2026-07-08 17:12:48 -04:00
github-coordination docs+chore: add README Security section; fix lint regressions on main 2026-06-16 02:08:14 -04:00
install feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
install-targets feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
mcp-inventory feat: worktree-lifecycle service (deterministic conflict prediction + safe GC) (#2164) 2026-06-07 13:00:08 +08:00
plan-canvas fix(plan-canvas): deliver browser chat to the agent every time (#2739) 2026-08-09 18:15:25 -04:00
session-adapters feat: worktree-lifecycle service (deterministic conflict prediction + safe GC) (#2164) 2026-06-07 13:00:08 +08:00
skill-evolution
skill-improvement
state-store feat: add work items CLI 2026-05-11 12:24:12 -04:00
worktree-lifecycle feat: worktree-lifecycle service (deterministic conflict prediction + safe GC) (#2164) 2026-06-07 13:00:08 +08:00
agent-compress.js fix: use scalar Claude agent tools (#2583) 2026-07-26 03:20:15 -07:00
agent-data-home.js fix: harden local dashboard and data boundaries (#2585) 2026-07-27 11:11:29 -07:00
agent-tools.js fix: use scalar Claude agent tools (#2583) 2026-07-26 03:20:15 -07:00
atomic-write.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
claude-plugin-setup.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
claude-scope-migration.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
codex-plugin-setup.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
compute-sponsor.js feat: connect ECC to canonical Ito compute CLI (#2558) 2026-07-23 19:28:55 -07:00
cost-estimate.js feat: add ECC statusline observability hooks 2026-05-11 23:44:06 -04:00
cursor-agent-names.js fix: namespace cursor agent installs 2026-04-30 02:19:57 -04:00
ecc_dashboard_runtime.py fix: port hook session and dashboard safety fixes 2026-05-11 02:53:28 -04:00
feedback-links.js feat: add retention feedback loop and honest support matrix (#2681) 2026-08-04 21:42:25 -04:00
github-coordination.js refactor: apply code-review findings to github-native coordination 2026-06-11 14:05:42 -04:00
github-discussions.js fix: skip disabled discussion queries in platform audit 2026-05-17 20:32:09 -04:00
github-origin.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
harness-adapter-compliance.js feat: add zed install target 2026-05-17 07:06:49 -04:00
harness-capabilities.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
hook-flags.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
inspection.js
install-executor.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
install-lifecycle.js fix: harden local dashboard and data boundaries (#2585) 2026-07-27 11:11:29 -07:00
install-manifests.js fix(repair): build opencode payload so `repair` clears doctor's `opencode-plugin-not-built` warning (#2414) (#2438) 2026-07-08 17:14:33 -04:00
install-state.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
ito-environment.js fix(ito-compute): complete device auth lifecycle (#2706) 2026-08-07 14:53:13 -04:00
llm-summary.js feat(session): LLM-powered session summary via claude -p (#2388) 2026-06-29 15:55:01 -07:00
loopback-guard.js fix: harden local dashboard and data boundaries (#2585) 2026-07-27 11:11:29 -07:00
mcp-config.js
memory-vault-format.js feat: add cross-harness memory vault (#2581) 2026-07-26 02:46:59 -07:00
memory-vault.js fix(memory-vault): compare dev only when both stats report one (#2637) 2026-08-08 17:06:18 -04:00
multi-harness-setup.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
observer-sessions.js fix: port continuous-learning observer fixes 2026-05-11 03:35:42 -04:00
orchestration-session.js
package-manager.d.ts
package-manager.js fix(scripts): detect modern bun.lock, ignore stray root lockfiles 2026-07-19 19:39:23 +02:00
path-safety.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
project-detect.js fix(project-detect): parse Python deps pinned with `~` and `@` (was losing framework detection on compatible-release pins) (#2498) 2026-07-17 17:11:09 -04:00
resolve-ecc-root.js fix(resolve-ecc-root): require ECC skills, not just scripts, before accepting a root (#2544) (#2577) 2026-07-25 22:21:27 -07:00
resolve-formatter.js fix(tests): resolve 10 failing tests on Windows (#2307) 2026-06-29 15:54:49 -07:00
session-aliases.d.ts feat: Cursor-independent ECC memory via ECC_AGENT_DATA_HOME (#2066) 2026-06-07 13:27:00 +08:00
session-aliases.js feat: Cursor-independent ECC memory via ECC_AGENT_DATA_HOME (#2066) 2026-06-07 13:27:00 +08:00
session-bridge.js fix(lib): retry rename on Windows EPERM/EACCES/EBUSY in writeBridgeAtomic 2026-05-19 04:57:10 -04:00
session-manager.d.ts
session-manager.js fix: resolve open-issue cluster (#2295, #2298, #2303–#2306, #2340) + createdTime fallback bug (#2408) 2026-07-03 21:10:45 -07:00
shell-split.js
shell-substitution.js fix(hooks,lib): fix hook detection and parsing edge cases (#2405) 2026-07-28 21:32:42 -04:00
terminal-spinner.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
terminal-welcome.js feat(install): add guided multi-harness installer (#2649) 2026-08-06 15:39:49 -04:00
tmux-worktree-orchestrator.js
transcript-context.js fix: add claude-opus-5 to KNOWN_MODEL_WINDOW_TOKENS (#2609) 2026-08-04 00:27:33 -04:00
utils.d.ts feat: Cursor-independent ECC memory via ECC_AGENT_DATA_HOME (#2066) 2026-06-07 13:27:00 +08:00
utils.js fix(hooks,lib): fix hook detection and parsing edge cases (#2405) 2026-07-28 21:32:42 -04:00