u-foo 1.0.3 → 1.1.9

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 (179) hide show
  1. package/README.md +110 -11
  2. package/README.zh-CN.md +9 -7
  3. package/SKILLS/ufoo/SKILL.md +132 -0
  4. package/SKILLS/uinit/SKILL.md +78 -0
  5. package/SKILLS/ustatus/SKILL.md +36 -0
  6. package/bin/uclaude.js +13 -0
  7. package/bin/ucode-core.js +15 -0
  8. package/bin/ucode.js +125 -0
  9. package/bin/ucodex.js +13 -0
  10. package/bin/ufoo +9 -31
  11. package/bin/ufoo-assistant-agent.js +5 -0
  12. package/bin/ufoo-engine.js +25 -0
  13. package/bin/ufoo.js +17 -0
  14. package/modules/AGENTS.template.md +29 -11
  15. package/modules/bus/README.md +33 -25
  16. package/modules/bus/SKILLS/ubus/SKILL.md +19 -8
  17. package/modules/context/README.md +18 -40
  18. package/modules/context/SKILLS/uctx/SKILL.md +63 -1
  19. package/modules/online/SKILLS/ufoo-online/SKILL.md +144 -0
  20. package/package.json +25 -4
  21. package/scripts/import-pi-mono.js +124 -0
  22. package/scripts/postinstall.js +30 -0
  23. package/scripts/sync-claude-skills.sh +21 -0
  24. package/src/agent/cliRunner.js +554 -33
  25. package/src/agent/internalRunner.js +150 -56
  26. package/src/agent/launcher.js +754 -0
  27. package/src/agent/normalizeOutput.js +1 -1
  28. package/src/agent/notifier.js +340 -0
  29. package/src/agent/ptyRunner.js +847 -0
  30. package/src/agent/ptyWrapper.js +379 -0
  31. package/src/agent/readyDetector.js +175 -0
  32. package/src/agent/ucode.js +443 -0
  33. package/src/agent/ucodeBootstrap.js +113 -0
  34. package/src/agent/ucodeBuild.js +67 -0
  35. package/src/agent/ucodeDoctor.js +184 -0
  36. package/src/agent/ucodeRuntimeConfig.js +129 -0
  37. package/src/agent/ufooAgent.js +46 -42
  38. package/src/assistant/agent.js +260 -0
  39. package/src/assistant/bridge.js +172 -0
  40. package/src/assistant/engine.js +252 -0
  41. package/src/assistant/stdio.js +58 -0
  42. package/src/assistant/ufooEngineCli.js +306 -0
  43. package/src/bus/activate.js +172 -0
  44. package/src/bus/daemon.js +436 -0
  45. package/src/bus/index.js +842 -0
  46. package/src/bus/inject.js +315 -0
  47. package/src/bus/message.js +430 -0
  48. package/src/bus/nickname.js +88 -0
  49. package/src/bus/queue.js +136 -0
  50. package/src/bus/shake.js +26 -0
  51. package/src/bus/store.js +189 -0
  52. package/src/bus/subscriber.js +312 -0
  53. package/src/bus/utils.js +363 -0
  54. package/src/chat/agentBar.js +117 -0
  55. package/src/chat/agentDirectory.js +88 -0
  56. package/src/chat/agentSockets.js +225 -0
  57. package/src/chat/agentViewController.js +298 -0
  58. package/src/chat/chatLogController.js +115 -0
  59. package/src/chat/commandExecutor.js +700 -0
  60. package/src/chat/commands.js +132 -0
  61. package/src/chat/completionController.js +414 -0
  62. package/src/chat/cronScheduler.js +160 -0
  63. package/src/chat/daemonConnection.js +166 -0
  64. package/src/chat/daemonCoordinator.js +64 -0
  65. package/src/chat/daemonMessageRouter.js +257 -0
  66. package/src/chat/daemonReconnect.js +41 -0
  67. package/src/chat/daemonTransport.js +36 -0
  68. package/src/chat/daemonTransportDefaults.js +10 -0
  69. package/src/chat/dashboardKeyController.js +480 -0
  70. package/src/chat/dashboardView.js +154 -0
  71. package/src/chat/index.js +1011 -1392
  72. package/src/chat/inputHistoryController.js +105 -0
  73. package/src/chat/inputListenerController.js +304 -0
  74. package/src/chat/inputMath.js +104 -0
  75. package/src/chat/inputSubmitHandler.js +171 -0
  76. package/src/chat/layout.js +165 -0
  77. package/src/chat/pasteController.js +81 -0
  78. package/src/chat/rawKeyMap.js +42 -0
  79. package/src/chat/settingsController.js +132 -0
  80. package/src/chat/statusLineController.js +177 -0
  81. package/src/chat/streamTracker.js +138 -0
  82. package/src/chat/text.js +70 -0
  83. package/src/chat/transport.js +61 -0
  84. package/src/cli/busCoreCommands.js +59 -0
  85. package/src/cli/ctxCoreCommands.js +199 -0
  86. package/src/cli/onlineCoreCommands.js +379 -0
  87. package/src/cli.js +1162 -96
  88. package/src/code/README.md +29 -0
  89. package/src/code/UCODE_PROMPT.md +32 -0
  90. package/src/code/agent.js +1651 -0
  91. package/src/code/cli.js +158 -0
  92. package/src/code/config +0 -0
  93. package/src/code/dispatch.js +42 -0
  94. package/src/code/index.js +70 -0
  95. package/src/code/nativeRunner.js +1213 -0
  96. package/src/code/runtime.js +154 -0
  97. package/src/code/sessionStore.js +162 -0
  98. package/src/code/taskDecomposer.js +269 -0
  99. package/src/code/tools/bash.js +53 -0
  100. package/src/code/tools/common.js +42 -0
  101. package/src/code/tools/edit.js +70 -0
  102. package/src/code/tools/read.js +44 -0
  103. package/src/code/tools/write.js +35 -0
  104. package/src/code/tui.js +1580 -0
  105. package/src/config.js +56 -3
  106. package/src/context/decisions.js +324 -0
  107. package/src/context/doctor.js +183 -0
  108. package/src/context/index.js +55 -0
  109. package/src/context/sync.js +127 -0
  110. package/src/daemon/agentProcessManager.js +74 -0
  111. package/src/daemon/cronOps.js +241 -0
  112. package/src/daemon/index.js +998 -170
  113. package/src/daemon/ipcServer.js +99 -0
  114. package/src/daemon/ops.js +630 -48
  115. package/src/daemon/promptLoop.js +319 -0
  116. package/src/daemon/promptRequest.js +101 -0
  117. package/src/daemon/providerSessions.js +306 -0
  118. package/src/daemon/reporting.js +90 -0
  119. package/src/daemon/run.js +31 -1
  120. package/src/daemon/status.js +48 -8
  121. package/src/doctor/index.js +50 -0
  122. package/src/init/index.js +318 -0
  123. package/src/online/bridge.js +663 -0
  124. package/src/online/client.js +245 -0
  125. package/src/online/runner.js +253 -0
  126. package/src/online/server.js +992 -0
  127. package/src/online/tokens.js +103 -0
  128. package/src/report/store.js +331 -0
  129. package/src/shared/eventContract.js +35 -0
  130. package/src/shared/ptySocketContract.js +21 -0
  131. package/src/skills/index.js +159 -0
  132. package/src/status/index.js +285 -0
  133. package/src/terminal/adapterContract.js +87 -0
  134. package/src/terminal/adapterRouter.js +84 -0
  135. package/src/terminal/adapters/externalAdapter.js +14 -0
  136. package/src/terminal/adapters/internalAdapter.js +13 -0
  137. package/src/terminal/adapters/internalPtyAdapter.js +42 -0
  138. package/src/terminal/adapters/internalQueueAdapter.js +37 -0
  139. package/src/terminal/adapters/terminalAdapter.js +31 -0
  140. package/src/terminal/adapters/tmuxAdapter.js +30 -0
  141. package/src/terminal/detect.js +64 -0
  142. package/src/terminal/index.js +8 -0
  143. package/src/terminal/iterm2.js +126 -0
  144. package/src/ufoo/agentsStore.js +107 -0
  145. package/src/ufoo/paths.js +46 -0
  146. package/src/utils/banner.js +76 -0
  147. package/bin/uclaude +0 -65
  148. package/bin/ucodex +0 -65
  149. package/modules/bus/scripts/bus-alert.sh +0 -185
  150. package/modules/bus/scripts/bus-listen.sh +0 -117
  151. package/modules/context/ASSUMPTIONS.md +0 -7
  152. package/modules/context/CONSTRAINTS.md +0 -7
  153. package/modules/context/CONTEXT-STRUCTURE.md +0 -49
  154. package/modules/context/DECISION-PROTOCOL.md +0 -62
  155. package/modules/context/HANDOFF.md +0 -33
  156. package/modules/context/RULES.md +0 -15
  157. package/modules/context/SKILLS/README.md +0 -14
  158. package/modules/context/SYSTEM.md +0 -18
  159. package/modules/context/TEMPLATES/assumptions.md +0 -4
  160. package/modules/context/TEMPLATES/constraints.md +0 -4
  161. package/modules/context/TEMPLATES/decision.md +0 -16
  162. package/modules/context/TEMPLATES/project-context-readme.md +0 -6
  163. package/modules/context/TEMPLATES/system.md +0 -3
  164. package/modules/context/TEMPLATES/terminology.md +0 -4
  165. package/modules/context/TERMINOLOGY.md +0 -10
  166. package/scripts/banner.sh +0 -89
  167. package/scripts/bus-alert.sh +0 -6
  168. package/scripts/bus-autotrigger.sh +0 -6
  169. package/scripts/bus-daemon.sh +0 -231
  170. package/scripts/bus-inject.sh +0 -144
  171. package/scripts/bus-listen.sh +0 -6
  172. package/scripts/bus.sh +0 -984
  173. package/scripts/context-decisions.sh +0 -167
  174. package/scripts/context-doctor.sh +0 -72
  175. package/scripts/context-lint.sh +0 -110
  176. package/scripts/doctor.sh +0 -22
  177. package/scripts/init.sh +0 -247
  178. package/scripts/skills.sh +0 -113
  179. package/scripts/status.sh +0 -125
@@ -1,117 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- # bus-listen.sh
5
- # Foreground listener that prints incoming messages.
6
- #
7
- # Usage:
8
- # bash bus-listen.sh <subscriber> [options]
9
- #
10
- # Options:
11
- # --from-beginning Print existing queued messages first
12
- # --reset Truncate pending queue before listening
13
- # --auto-join Auto-join bus to get subscriber ID
14
-
15
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
16
- REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
17
- BUS_DIR=".ufoo/bus"
18
- FROM_BEGINNING=0
19
- RESET=0
20
- AUTO_JOIN=0
21
-
22
- SUBSCRIBER="${1:-}"
23
- shift || true
24
-
25
- while [[ $# -gt 0 ]]; do
26
- case "$1" in
27
- --from-beginning)
28
- FROM_BEGINNING=1
29
- shift
30
- ;;
31
- --reset)
32
- RESET=1
33
- shift
34
- ;;
35
- --auto-join)
36
- AUTO_JOIN=1
37
- shift
38
- ;;
39
- *)
40
- shift
41
- ;;
42
- esac
43
- done
44
-
45
- # Auto-join if requested
46
- if [[ "$AUTO_JOIN" == "1" ]] && [[ -z "$SUBSCRIBER" ]]; then
47
- SUBSCRIBER="$(ufoo bus join 2>/dev/null | tail -1)"
48
- echo "[listen] Auto-joined as: $SUBSCRIBER"
49
- fi
50
-
51
- if [[ -z "$SUBSCRIBER" ]]; then
52
- echo "Usage: bus-listen.sh <subscriber> [options]" >&2
53
- echo " or: bus-listen.sh --auto-join" >&2
54
- exit 1
55
- fi
56
-
57
- # Sanitize subscriber for filename
58
- SAFE_SUB="${SUBSCRIBER//:/_}"
59
- QUEUE_FILE="$BUS_DIR/queues/${SAFE_SUB}/pending.jsonl"
60
- QUEUE_DIR="$BUS_DIR/queues/${SAFE_SUB}"
61
-
62
- mkdir -p "$QUEUE_DIR"
63
- touch "$QUEUE_FILE"
64
-
65
- # Reset queue if requested
66
- if [[ "$RESET" == "1" ]]; then
67
- echo "[listen] Resetting queue..."
68
- : > "$QUEUE_FILE"
69
- fi
70
-
71
- # Print existing messages if requested
72
- if [[ "$FROM_BEGINNING" == "1" ]] && [[ -s "$QUEUE_FILE" ]]; then
73
- echo "[listen] Existing messages:"
74
- echo "---"
75
- while IFS= read -r line; do
76
- # Parse JSON and extract message
77
- msg="$(echo "$line" | jq -r '.data.message // .data // .' 2>/dev/null || echo "$line")"
78
- from="$(echo "$line" | jq -r '.publisher // "unknown"' 2>/dev/null || echo "unknown")"
79
- ts="$(echo "$line" | jq -r '.ts // ""' 2>/dev/null || echo "")"
80
- short_ts="${ts:11:8}" # Extract HH:MM:SS
81
- echo "[$short_ts] <$from> $msg"
82
- done < "$QUEUE_FILE"
83
- echo "---"
84
- fi
85
-
86
- echo "[listen] Listening for new messages... (Ctrl+C to stop)"
87
-
88
- # Track last line count
89
- LAST_LINES=0
90
- if [[ -s "$QUEUE_FILE" ]]; then
91
- LAST_LINES="$(wc -l < "$QUEUE_FILE" | tr -d ' ')"
92
- fi
93
-
94
- while true; do
95
- if [[ -f "$QUEUE_FILE" ]]; then
96
- CURRENT_LINES="$(wc -l < "$QUEUE_FILE" | tr -d ' ')"
97
-
98
- if [[ "$CURRENT_LINES" -gt "$LAST_LINES" ]]; then
99
- # Read new lines
100
- tail -n "+$((LAST_LINES + 1))" "$QUEUE_FILE" | while IFS= read -r line; do
101
- msg="$(echo "$line" | jq -r '.data.message // .data // .' 2>/dev/null || echo "$line")"
102
- from="$(echo "$line" | jq -r '.publisher // "unknown"' 2>/dev/null || echo "unknown")"
103
- ts="$(echo "$line" | jq -r '.ts // ""' 2>/dev/null || echo "")"
104
- short_ts="${ts:11:8}"
105
-
106
- # Bell notification
107
- printf '\a'
108
-
109
- echo "[$short_ts] <$from> $msg"
110
- done
111
-
112
- LAST_LINES="$CURRENT_LINES"
113
- fi
114
- fi
115
-
116
- sleep 1
117
- done
@@ -1,7 +0,0 @@
1
- # Assumptions
2
-
3
- - Users work with multiple AI tools
4
- - AI agents can read markdown files
5
- - AI agents respect explicit file instructions
6
- - Written context survives session boundaries
7
- - Less structure is better than over-engineering
@@ -1,7 +0,0 @@
1
- # Constraints
2
-
3
- - Model-agnostic (no Claude/GPT-specific instructions)
4
- - Project-agnostic (no specific tech stack assumptions)
5
- - Files are authoritative, not conversations
6
- - Decisions are append-only
7
- - All rules must be enforceable by file inspection
@@ -1,49 +0,0 @@
1
- # Context Structure
2
-
3
- ## Global (read-only)
4
-
5
- ```
6
- ~/.ufoo/
7
- └── modules/
8
- └── context/ # installed context module
9
- ```
10
-
11
- - **Read-only**
12
- - Template source for init
13
- - No decisions, no assumptions
14
- - Law, not truth
15
-
16
- ## Project-local (writable)
17
-
18
- ```
19
- <project>/
20
- └── .context/
21
- ├── README.md
22
- ├── SYSTEM.md
23
- ├── CONSTRAINTS.md
24
- ├── ASSUMPTIONS.md
25
- ├── TERMINOLOGY.md
26
- └── DECISIONS/
27
- ```
28
-
29
- - **In the repo** — can diff, can review
30
- - This is where truth lives
31
- - Must be versionable
32
-
33
- ## Required files (project)
34
-
35
- | File | Purpose |
36
- |------|---------|
37
- | README.md | Entry point; how to use this context |
38
- | SYSTEM.md | Project architecture and purpose |
39
- | CONSTRAINTS.md | Non-negotiable rules |
40
- | ASSUMPTIONS.md | Current assumptions (update when changed) |
41
- | TERMINOLOGY.md | Shared vocabulary |
42
- | DECISIONS/ | Append-only decision log |
43
-
44
- ## Red line
45
-
46
- **Never write decisions or assumptions to global.**
47
-
48
- Global = law.
49
- Project = truth.
@@ -1,62 +0,0 @@
1
- # Decision Protocol
2
-
3
- ## What is a Decision?
4
-
5
- A decision is any new or changed “shared truth” that affects future work, including:
6
- - Architecture
7
- - Semantics
8
- - Roles or responsibilities
9
- - UI meaning or behavior
10
- - Naming or structure
11
- - Installation / distribution / tooling workflows
12
- - Trade-offs and “we chose X over Y”
13
-
14
- ## Triage (Must / Ask / Skip)
15
-
16
- ### Must record (no confirmation needed)
17
-
18
- Write a decision **before replying** when you do any of the following:
19
-
20
- - Provide an evaluation / analysis / recommendation that could steer future work
21
- - Propose an improvement plan or a set of next steps
22
- - Introduce or change any rule/constraint/process
23
- - Choose a default (e.g. install method, folder structure, version pinning policy)
24
- - Decide between alternatives (trade-off)
25
-
26
- ### Ask first (medium importance)
27
-
28
- If you’re unsure whether the recommendation should become shared truth, ask:
29
-
30
- > “Should I record a decision for X?”
31
-
32
- Examples:
33
- - Optional refactors or style preferences
34
- - Suggestions that depend on missing info (URL, constraints, team preference)
35
- - Reversible tweaks that may not be adopted
36
-
37
- ### Skip (not worth a decision)
38
-
39
- Do **not** write a decision for:
40
-
41
- - One-off clarifications or Q&A that doesn’t change future behavior
42
- - Trivial edits (formatting, typos) with no semantic impact
43
- - Ephemeral runtime details (logs, transient errors) unless they affect policy
44
-
45
- ## Where Decisions Live
46
-
47
- - **Never** write decisions to global `~/.context/` (global = law).
48
- - Always write decisions to the project-local log:
49
- - `<project>/.context/DECISIONS/`
50
- - For this repo, that is: `.context/DECISIONS/`
51
-
52
- ## Rules
53
-
54
- - Decisions are append-only.
55
- - Do not rewrite history.
56
- - AI agents are allowed to write decisions.
57
-
58
- ## Minimum Content
59
-
60
- - Context: why this matters now
61
- - Decision: what is now considered true
62
- - Implications: what must follow from this
@@ -1,33 +0,0 @@
1
- # AI Handoff Protocol
2
-
3
- ## When taking over work
4
-
5
- 1. Read this repository (global protocol).
6
- 2. Read the project-local `.context/`.
7
- 3. Check for open decisions: `bash scripts/context-decisions.sh -l`
8
-
9
- ## Processing open decisions
10
-
11
- Open decisions are messages from other agents. You MUST:
12
-
13
- 1. **Read** — Read the full content, not just the title.
14
- 2. **Understand** — Sync their decisions to your understanding.
15
- 3. **Execute** — If action is required, do it first.
16
- 4. **Verify** — Confirm the action succeeded.
17
- 5. **Resolve** — Only then mark as resolved.
18
-
19
- ```yaml
20
- ---
21
- status: resolved
22
- resolved_by: <your-agent-name>
23
- resolved_at: <date>
24
- ---
25
- ```
26
-
27
- **NEVER resolve blindly.** This defeats the purpose of multi-agent collaboration.
28
-
29
- ## Before finishing work
30
-
31
- - Declare whether any new decisions were introduced.
32
- - Ensure all decisions are written down.
33
- - Leave the project ready for the next agent.
@@ -1,15 +0,0 @@
1
- # Collaboration Rules
2
-
3
- ## Core rules
4
-
5
- - Always read this repository before coding.
6
- - Do not rely on model-internal memory.
7
- - All shared understanding must exist as files.
8
- - Decisions override comments and discussions.
9
- - When unsure, write a decision.
10
-
11
- ## Decision handling
12
-
13
- - Open decisions are unprocessed messages from other agents.
14
- - You must read, understand, and act before resolving.
15
- - Never resolve without reading the full content.
@@ -1,14 +0,0 @@
1
- # Skills
2
-
3
- Protocol-level skills that enforce context rules.
4
-
5
- - NOT memory systems
6
- - Do NOT store project knowledge
7
- - Only bootstrap and validate protocol compliance
8
-
9
- Available:
10
- - `uctx` — quick context check (list decisions, show latest, report status)
11
-
12
- Helpers:
13
- - `bash scripts/skills.sh list`
14
- - `bash scripts/skills.sh install <name|all> --codex|--agents|--target <dir>`
@@ -1,18 +0,0 @@
1
- # AI System Contract
2
-
3
- This repository defines the canonical collaboration context
4
- for all AI agents working on a codebase.
5
-
6
- ## Purpose
7
-
8
- Solve one core problem with AI coding agents:
9
-
10
- 1. **Memory sync across agents** — Multiple AI tools (Claude Code, Codex, Cursor, etc.) have no shared memory. Decisions made in one session are lost to others. This protocol makes decisions persist as files, enabling true multi-agent collaboration.
11
-
12
- ## Rules
13
-
14
- - Files in this repository are authoritative.
15
- - Constraints are hard requirements, not suggestions.
16
- - Silent architectural or semantic decisions are forbidden.
17
- - If conflict or ambiguity exists, stop and ask.
18
- - Shared truth must be written, not remembered.
@@ -1,4 +0,0 @@
1
- # Assumptions
2
-
3
- - List assumptions currently considered true.
4
- - Update when assumptions change.
@@ -1,4 +0,0 @@
1
- # Constraints
2
-
3
- - Non-negotiable rules.
4
- - Must always be followed.
@@ -1,16 +0,0 @@
1
- ---
2
- status: open
3
- ---
4
- # DECISION XXXX: <Title>
5
-
6
- Date:
7
- Author:
8
-
9
- Context:
10
- What led to this decision?
11
-
12
- Decision:
13
- What is now considered true?
14
-
15
- Implications:
16
- What must follow from this?
@@ -1,6 +0,0 @@
1
- # Project AI Context
2
-
3
- This directory contains the canonical AI context
4
- for this project.
5
-
6
- All AI agents must read this directory before working.
@@ -1,3 +0,0 @@
1
- # System Overview
2
-
3
- [Describe the system architecture and purpose]
@@ -1,4 +0,0 @@
1
- # Terminology
2
-
3
- | Term | Definition |
4
- |------|------------|
@@ -1,10 +0,0 @@
1
- # Terminology
2
-
3
- | Term | Definition |
4
- |------|------------|
5
- | Protocol | The rules defined in this repository |
6
- | Decision | A recorded change affecting architecture/semantics/behavior |
7
- | Context | Project-specific knowledge stored in context/ |
8
- | Handoff | One AI session ending, another beginning |
9
- | Constraint | Non-negotiable rule |
10
- | Assumption | Belief currently considered true, subject to change |
package/scripts/banner.sh DELETED
@@ -1,89 +0,0 @@
1
- #!/usr/bin/env bash
2
- # banner.sh - TUI startup banner for ufoo agents
3
-
4
- # Colors
5
- RST='\033[0m'
6
- BLD='\033[1m'
7
- DIM='\033[2m'
8
- CYN='\033[0;36m'
9
- GRN='\033[0;32m'
10
- MAG='\033[0;35m'
11
- WHT='\033[1;37m'
12
- YLW='\033[0;33m'
13
-
14
- show_banner() {
15
- local agent_type="${1:-claude}"
16
- local session_id="${2:-unknown}"
17
- local subscriber="${3:-}"
18
- local daemon_status="${4:-}"
19
-
20
- local ACOL
21
- if [[ "$agent_type" == "codex" ]]; then
22
- ACOL="$GRN"
23
- else
24
- ACOL="$MAG"
25
- fi
26
-
27
- # Width matches Codex CLI (inner content = 52)
28
- local INNER=52
29
- local W=$INNER
30
-
31
- # Helper: print line with exact padding
32
- line() {
33
- local prefix="$1"
34
- local value="$2"
35
- local color="$3"
36
- local prefix_len=${#prefix}
37
- local value_len=${#value}
38
- local pad_len=$((INNER - prefix_len - value_len))
39
- printf "${DIM}│${RST}${prefix}${color}${value}${RST}"
40
- printf "%${pad_len}s" ""
41
- printf "${DIM}│${RST}\n"
42
- }
43
-
44
- echo ""
45
- printf "${DIM}╭"; printf '─%.0s' $(seq 1 $W); printf "╮${RST}\n"
46
-
47
- # Title line with icon (compute padding from plain text lengths)
48
- local icon_plain="<○>"
49
- local title="UFOO · Multi-Agent Protocol"
50
- local title_pad=$((INNER - 1 - ${#icon_plain} - 1 - ${#title}))
51
- printf "${DIM}│${RST} ${WHT}${icon_plain}${RST} ${CYN}${BLD}UFOO${RST}${DIM} · Multi-Agent Protocol${RST}"
52
- printf "%${title_pad}s" ""
53
- printf "${DIM}│${RST}\n"
54
-
55
- printf "${DIM}├"; printf '─%.0s' $(seq 1 $W); printf "┤${RST}\n"
56
-
57
- # Agent
58
- if [[ -n "$subscriber" ]]; then
59
- local sub="$subscriber"
60
- [[ ${#sub} -gt 36 ]] && sub="${sub:0:33}..."
61
- line " Agent " "$sub" "${ACOL}${BLD}"
62
- fi
63
-
64
- # Daemon
65
- if [[ -n "$daemon_status" ]]; then
66
- line " Daemon " "$daemon_status" "${GRN}"
67
- fi
68
-
69
- # Online agents (daemon handles cleanup of dead agents)
70
- if [[ -f ".ufoo/bus/bus.json" ]]; then
71
- local online
72
- online=$(jq -r '.subscribers | to_entries[] | select(.value.status == "active") | .key' .ufoo/bus/bus.json 2>/dev/null | grep -v "^${subscriber}$" 2>/dev/null | head -5 || true)
73
- if [[ -n "$online" ]]; then
74
- printf "${DIM}├"; printf '─%.0s' $(seq 1 $W); printf "┤${RST}\n"
75
- line " Online " "" ""
76
- while IFS= read -r agent; do
77
- [[ -z "$agent" ]] && continue
78
- local a="$agent"
79
- [[ ${#a} -gt 44 ]] && a="${a:0:41}..."
80
- line " · " "$a" "${YLW}"
81
- done <<< "$online"
82
- fi
83
- fi
84
-
85
- printf "${DIM}╰"; printf '─%.0s' $(seq 1 $W); printf "╯${RST}\n"
86
- echo ""
87
- }
88
-
89
- export -f show_banner 2>/dev/null || true
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
- exec bash "$repo_root/modules/bus/scripts/bus-alert.sh" "$@"
6
-
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
- exec bash "$repo_root/modules/bus/scripts/bus-autotrigger.sh" "$@"
6
-