u-foo 4.0.10 → 4.1.2

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 (71) hide show
  1. package/OPTIONAL_SKILLS/ufoo-bus-poll/SKILL.md +27 -0
  2. package/README.md +279 -789
  3. package/README.zh-CN.md +290 -439
  4. package/SKILLS/ufoo/SKILL.md +7 -0
  5. package/bin/ufoo.js +36 -3
  6. package/dist/tui/darwin-arm64/ufoo-tui +0 -0
  7. package/docs/OBSERVABILITY.md +4 -2
  8. package/docs/README.md +1 -0
  9. package/package.json +6 -2
  10. package/scripts/pack-desktop.js +174 -0
  11. package/src/agents/capabilities/coding/index.js +26 -3
  12. package/src/agents/capabilities/index.js +2 -1
  13. package/src/agents/capabilities/mac/index.js +145 -0
  14. package/src/agents/capabilities/planning/index.js +1 -1
  15. package/src/agents/capabilities/turnRecall/index.js +5 -16
  16. package/src/agents/profiles/coding.js +1 -1
  17. package/src/agents/profiles/main.js +1 -1
  18. package/src/agents/providers/nativeTransport.js +105 -116
  19. package/src/agents/providers/runtimeConfig.js +15 -4
  20. package/src/agents/providers/transports/anthropicCache.js +78 -0
  21. package/src/agents/providers/transports/antigravityTransport.js +3 -2
  22. package/src/agents/providers/transports/openaiResponsesTransport.js +7 -12
  23. package/src/agents/providers/transports/requestCacheObservation.js +61 -0
  24. package/src/agents/providers/transports/responsesProtocol.js +54 -46
  25. package/src/agents/providers/upstreamRuntime.js +2 -2
  26. package/src/agents/runtime/context/contextWindow.js +10 -0
  27. package/src/agents/runtime/context/slidingWindowManager.js +97 -41
  28. package/src/agents/runtime/context/topicSelector.js +4 -2
  29. package/src/agents/runtime/context/turnAnalyzer.js +17 -29
  30. package/src/agents/runtime/core/agentLoop.js +23 -7
  31. package/src/agents/runtime/createAgentRuntime.js +1 -1
  32. package/src/agents/runtime/protocol/auxiliaryModelRequest.js +28 -0
  33. package/src/app/chat/ChatController.js +1 -0
  34. package/src/app/chat/commandExecutor.js +25 -0
  35. package/src/app/chat/commands.js +2 -0
  36. package/src/app/chat/daemonMessageRouter.js +30 -3
  37. package/src/app/cli/appCommands.js +107 -0
  38. package/src/app/cli/features/skills.js +2 -0
  39. package/src/app/cli/macCommands.js +321 -0
  40. package/src/app/cli/metricsCommands.js +6 -1
  41. package/src/app/cli/run.js +26 -0
  42. package/src/app/cli/setupCommands.js +1 -0
  43. package/src/code/agent.js +1 -0
  44. package/src/code/context/assembler.js +8 -6
  45. package/src/code/context/promptLayers.js +3 -1
  46. package/src/code/context/stateCommit.js +2 -2
  47. package/src/code/context/transcript.js +11 -5
  48. package/src/code/nativeRunner.js +25 -5
  49. package/src/code/skills/loader.js +10 -2
  50. package/src/code/skills/render.js +8 -1
  51. package/src/config.js +42 -0
  52. package/src/coordination/bus/activate.js +44 -19
  53. package/src/coordination/history/agentPerformance.js +88 -11
  54. package/src/coordination/history/agentTrace.js +2 -0
  55. package/src/coordination/history/modelInputCost.js +52 -0
  56. package/src/runtime/contracts/uiProtocol.js +26 -0
  57. package/src/runtime/daemon/agentHost.js +35 -12
  58. package/src/runtime/daemon/mcpStdioProxy.js +3 -2
  59. package/src/runtime/mac/helperClient.js +279 -0
  60. package/src/runtime/mac/helperCompiler.js +235 -0
  61. package/src/runtime/mac/macSession.js +866 -0
  62. package/src/runtime/mac/native/ufoo_mac_helper.swift +2493 -0
  63. package/src/runtime/mac/paths.js +63 -0
  64. package/src/ui/agentSettingsController.js +12 -5
  65. package/src/ui/cliHandoff.js +484 -0
  66. package/src/ui/desktopArchive.js +41 -0
  67. package/src/ui/desktopUiHost.js +1601 -0
  68. package/src/ui/desktopUiHostCli.js +66 -0
  69. package/src/ui/format/index.js +17 -0
  70. package/src/ui/rustChatHost.js +45 -6
  71. package/src/ui/workspaceInspector.js +621 -0
@@ -41,6 +41,7 @@ the caller cancels the wait.
41
41
 
42
42
  - Codex App: use the pending MCP workflow below.
43
43
  - Cursor with `notify_on_output`: use the monitored stdout workflow below.
44
+ - Antigravity App (`agy app`): use the background exit-on-message waiter workflow below.
44
45
  - Another App: use its documented pending-tool or output-notification
45
46
  primitive. If neither exists, automatic self-wake is unavailable; use an
46
47
  explicit `$ufoo-bus` check or a user-approved scheduled fallback.
@@ -121,6 +122,32 @@ host task state and the single-subscriber lease.
121
122
  This process wakes only its own Cursor session. A peer that must react while
122
123
  unattended needs its own armed poll or another real wake channel.
123
124
 
125
+ ## Use Antigravity App (`agy app`) exit-on-message background wait
126
+
127
+ Antigravity App (`agy app`) wakes the session automatically when a background
128
+ `run_command` exits (reactive wakeup), while foreground MCP `wait_for_message`
129
+ would block the active chat turn and Cursor's `notify_on_output` is not
130
+ available:
131
+
132
+ 1. After MCP `register_agent`, launch one background `run_command`
133
+ (`WaitMsBeforeAsync: 500`) using the caller-owned `<subscriber-id>` (never
134
+ pass or print `agent_handle` in the shell command):
135
+
136
+ ```bash
137
+ bash -lc 'while true; do out=$(ufoo bus check "<subscriber-id>" 2>/dev/null || true); if printf "%s" "$out" | grep -q "\[ufoo\]"; then printf "%s\n" "$out"; exit 0; fi; sleep 5; done'
138
+ ```
139
+
140
+ 2. End the turn without polling; while the waiter sleeps in the background, it
141
+ emits nothing and consumes zero model tokens, and the user can still message
142
+ the session normally.
143
+ 3. When a `[ufoo]` event arrives, the command prints the batch and exits `0`,
144
+ waking the session. Read the pending messages (or verify via MCP `poll_inbox`
145
+ to obtain exact `seq`), execute actionable work, and acknowledge via MCP
146
+ `ack_bus` (`through_seq`, with session-local `agent_handle`).
147
+ 4. After handling and any active work completes, re-arm one new background
148
+ exit-on-message waiter. Stop only when the user asks to stop (kill the
149
+ background task via `manage_task` and do not re-arm).
150
+
124
151
  ## Handle delivered batches
125
152
 
126
153
  For Codex App, read the structured `messages` returned by `wait_for_message`.