u-foo 2.3.31 → 2.4.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 (236) hide show
  1. package/README.md +157 -213
  2. package/README.zh-CN.md +151 -197
  3. package/SKILLS/ufoo/SKILL.md +8 -8
  4. package/bin/uagy.js +69 -0
  5. package/bin/uclaude.js +2 -2
  6. package/bin/ucode.js +4 -4
  7. package/bin/ucodex.js +2 -2
  8. package/bin/ufoo.js +5 -23
  9. package/modules/AGENTS.template.md +1 -1
  10. package/modules/bus/SKILLS/ubus/SKILL.md +35 -10
  11. package/package.json +9 -5
  12. package/scripts/chat-app-smoke.js +30 -0
  13. package/scripts/global-chat-switch-benchmark.js +5 -5
  14. package/scripts/ink-demo.js +23 -0
  15. package/scripts/ink-smoke.js +30 -0
  16. package/scripts/ucode-app-smoke.js +36 -0
  17. package/src/{agent → agents/activity}/activityDetector.js +39 -2
  18. package/src/{agent → agents/activity}/activityStatePublisher.js +1 -1
  19. package/src/{agent → agents/activity}/activityStateWriter.js +2 -2
  20. package/src/{agent → agents/activity}/activityTracker.js +1 -1
  21. package/src/agents/activity/index.js +8 -0
  22. package/src/{agent → agents/controller}/controllerToolExecutor.js +4 -4
  23. package/src/agents/controller/index.js +8 -0
  24. package/src/{agent → agents/controller}/loopObservability.js +2 -2
  25. package/src/{agent → agents/controller}/loopRuntime.js +1 -1
  26. package/src/{agent → agents/controller}/ufooAgent.js +9 -9
  27. package/src/agents/index.js +10 -0
  28. package/src/agents/internal/index.js +3 -0
  29. package/src/{agent → agents/internal}/internalRunner.js +45 -22
  30. package/src/agents/launch/agyConversation.js +159 -0
  31. package/src/agents/launch/index.js +12 -0
  32. package/src/{agent → agents/launch}/launchEnvironment.js +2 -3
  33. package/src/{agent → agents/launch}/launcher.js +64 -21
  34. package/src/{agent → agents/launch}/notifier.js +23 -12
  35. package/src/{agent → agents/launch}/ptyRunner.js +44 -12
  36. package/src/{agent → agents/launch}/ptyWrapper.js +2 -2
  37. package/src/{agent → agents/launch}/publisherRouting.js +1 -1
  38. package/src/{agent → agents/launch}/readyDetector.js +23 -0
  39. package/src/{agent → agents/prompts}/defaultBootstrap.js +63 -4
  40. package/src/{group/bootstrap.js → agents/prompts/groupBootstrap.js} +41 -6
  41. package/src/agents/prompts/index.js +8 -0
  42. package/src/{code/prompts → agents/prompts/native}/index.js +1 -1
  43. package/src/{agent → agents/providers}/claudeThreadProvider.js +1 -1
  44. package/src/{agent → agents/providers}/codexThreadProvider.js +1 -1
  45. package/src/{agent → agents/providers}/directAuthStatus.js +184 -1
  46. package/src/agents/providers/index.js +13 -0
  47. package/src/{agent → agents/providers}/upstreamTransport.js +2 -2
  48. package/src/{chat → app/chat}/agentSockets.js +1 -1
  49. package/src/{chat → app/chat}/commandExecutor.js +56 -28
  50. package/src/{chat → app/chat}/commands.js +119 -5
  51. package/src/{chat → app/chat}/daemonConnection.js +1 -1
  52. package/src/{chat → app/chat}/daemonMessageRouter.js +54 -4
  53. package/src/{chat → app/chat}/daemonTransport.js +2 -1
  54. package/src/{chat → app/chat}/dashboardView.js +2 -21
  55. package/src/app/chat/index.js +6 -0
  56. package/src/{chat → app/chat}/inputSubmitHandler.js +38 -13
  57. package/src/{chat → app/chat}/internalAgentLogHistory.js +1 -1
  58. package/src/app/chat/multiWindow/index.js +268 -0
  59. package/src/app/chat/multiWindow/paneLayout.js +84 -0
  60. package/src/app/chat/multiWindow/paneManager.js +299 -0
  61. package/src/app/chat/multiWindow/renderer.js +384 -0
  62. package/src/app/chat/multiWindow/virtualTerminal.js +327 -0
  63. package/src/{chat → app/chat}/projectCloseController.js +1 -1
  64. package/src/app/chat/shellCommand.js +42 -0
  65. package/src/{chat → app/chat}/transport.js +16 -3
  66. package/src/{cli → app/cli}/ctxCoreCommands.js +3 -3
  67. package/src/{doctor/index.js → app/cli/features/doctor.js} +1 -1
  68. package/src/{init/index.js → app/cli/features/init.js} +14 -32
  69. package/src/{cli → app/cli}/groupCoreCommands.js +2 -2
  70. package/src/app/cli/index.js +9 -0
  71. package/src/{cli → app/cli}/onlineCoreCommands.js +5 -5
  72. package/src/{cli.js → app/cli/run.js} +62 -59
  73. package/src/app/index.js +6 -0
  74. package/src/code/agent.js +10 -9
  75. package/src/code/index.js +2 -0
  76. package/src/code/launcher/index.js +9 -0
  77. package/src/{agent → code/launcher}/ucode.js +7 -8
  78. package/src/{agent → code/launcher}/ucodeBootstrap.js +3 -3
  79. package/src/{agent → code/launcher}/ucodeBuild.js +2 -2
  80. package/src/{agent → code/launcher}/ucodeDoctor.js +2 -2
  81. package/src/{agent → code/launcher}/ucodeRuntimeConfig.js +1 -2
  82. package/src/code/nativeRunner.js +4 -4
  83. package/src/code/taskDecomposer.js +5 -4
  84. package/src/code/tui.js +39 -1997
  85. package/src/config.js +15 -2
  86. package/src/{bus → coordination/bus}/activate.js +2 -2
  87. package/src/{bus → coordination/bus}/daemon.js +15 -5
  88. package/src/coordination/bus/envelope.js +173 -0
  89. package/src/{bus → coordination/bus}/index.js +7 -3
  90. package/src/{bus → coordination/bus}/inject.js +11 -3
  91. package/src/{bus → coordination/bus}/message.js +1 -1
  92. package/src/coordination/bus/messageMeta.js +130 -0
  93. package/src/coordination/bus/promptEnvelope.js +65 -0
  94. package/src/{bus → coordination/bus}/shake.js +1 -1
  95. package/src/{bus → coordination/bus}/store.js +3 -3
  96. package/src/{bus → coordination/bus}/subscriber.js +2 -2
  97. package/src/{bus → coordination/bus}/utils.js +2 -2
  98. package/src/{history → coordination/history}/inputTimeline.js +5 -5
  99. package/src/coordination/index.js +10 -0
  100. package/src/{memory → coordination/memory}/historySearch.js +1 -1
  101. package/src/{memory → coordination/memory}/index.js +3 -3
  102. package/src/{report → coordination/report}/store.js +2 -2
  103. package/src/{ufoo → coordination/state}/agentRegistryDiagnostics.js +43 -0
  104. package/src/{status → coordination/status}/index.js +3 -3
  105. package/src/online/bridge.js +2 -2
  106. package/src/{controller → orchestration/controller}/flags.js +1 -1
  107. package/src/{controller → orchestration/controller}/gateRouter.js +1 -1
  108. package/src/orchestration/controller/index.js +10 -0
  109. package/src/{controller → orchestration/controller}/shadowGuard.js +1 -1
  110. package/src/orchestration/groups/bootstrap.js +3 -0
  111. package/src/orchestration/groups/index.js +10 -0
  112. package/src/orchestration/groups/promptProfiles.js +3 -0
  113. package/src/{group → orchestration/groups}/templates.js +1 -1
  114. package/src/{group → orchestration/groups}/validateTemplate.js +1 -1
  115. package/src/orchestration/index.js +7 -0
  116. package/src/orchestration/solo/index.js +3 -0
  117. package/src/{daemon → runtime/daemon}/agentProcessManager.js +1 -1
  118. package/src/{daemon → runtime/daemon}/cronOps.js +3 -2
  119. package/src/{daemon → runtime/daemon}/groupOrchestrator.js +26 -9
  120. package/src/{daemon → runtime/daemon}/index.js +273 -79
  121. package/src/{daemon → runtime/daemon}/ipcServer.js +24 -2
  122. package/src/{daemon → runtime/daemon}/nicknameScope.js +6 -3
  123. package/src/{daemon → runtime/daemon}/ops.js +48 -61
  124. package/src/{daemon → runtime/daemon}/promptLoop.js +1 -1
  125. package/src/{daemon → runtime/daemon}/promptRequest.js +13 -8
  126. package/src/runtime/daemon/providerSessions.js +230 -0
  127. package/src/{daemon → runtime/daemon}/reporting.js +4 -4
  128. package/src/{daemon → runtime/daemon}/run.js +12 -5
  129. package/src/{daemon → runtime/daemon}/soloBootstrap.js +7 -7
  130. package/src/{daemon → runtime/daemon}/status.js +5 -5
  131. package/src/runtime/index.js +10 -0
  132. package/src/runtime/process/nodeExecutable.js +26 -0
  133. package/src/{projects → runtime/projects}/registry.js +1 -1
  134. package/src/{projects → runtime/projects}/runtimes.js +1 -1
  135. package/src/{terminal → runtime/terminal}/adapterRouter.js +0 -10
  136. package/src/{terminal → runtime/terminal}/adapters/internalAdapter.js +0 -4
  137. package/src/tools/handlers/common.js +1 -1
  138. package/src/tools/handlers/listAgents.js +1 -1
  139. package/src/tools/handlers/memory.js +3 -3
  140. package/src/tools/handlers/readBusSummary.js +1 -1
  141. package/src/tools/handlers/readOpenDecisions.js +1 -1
  142. package/src/tools/handlers/readProjectRegistry.js +1 -1
  143. package/src/tools/handlers/readPromptHistory.js +2 -2
  144. package/src/tools/schemaFixtures.js +1 -1
  145. package/src/ui/MIGRATION.md +336 -0
  146. package/src/ui/format/index.js +974 -0
  147. package/src/ui/index.js +9 -0
  148. package/src/ui/ink/ChatApp.js +3674 -0
  149. package/src/ui/ink/DashboardBar.js +685 -0
  150. package/src/ui/ink/InkDemo.js +96 -0
  151. package/src/ui/ink/MultilineInput.js +612 -0
  152. package/src/ui/ink/UcodeApp.js +822 -0
  153. package/src/ui/ink/agentMirror.js +730 -0
  154. package/src/ui/ink/chatReducer.js +359 -0
  155. package/src/ui/runInk.js +57 -0
  156. package/src/bus/messageMeta.js +0 -52
  157. package/src/chat/agentViewController.js +0 -1072
  158. package/src/chat/chatLogController.js +0 -138
  159. package/src/chat/completionController.js +0 -533
  160. package/src/chat/dashboardKeyController.js +0 -573
  161. package/src/chat/index.js +0 -2214
  162. package/src/chat/inputHistoryController.js +0 -135
  163. package/src/chat/inputListenerController.js +0 -470
  164. package/src/chat/layout.js +0 -186
  165. package/src/chat/pasteController.js +0 -81
  166. package/src/chat/statusLineController.js +0 -223
  167. package/src/chat/streamTracker.js +0 -156
  168. package/src/code/config +0 -0
  169. package/src/daemon/providerSessions.js +0 -488
  170. package/src/terminal/adapters/internalPtyAdapter.js +0 -42
  171. /package/src/{code/prompts → agents/prompts/native}/actions.js +0 -0
  172. /package/src/{code/prompts → agents/prompts/native}/efficiency.js +0 -0
  173. /package/src/{code/prompts → agents/prompts/native}/environment.js +0 -0
  174. /package/src/{code/prompts → agents/prompts/native}/identity.js +0 -0
  175. /package/src/{code/prompts → agents/prompts/native}/safety.js +0 -0
  176. /package/src/{code/prompts → agents/prompts/native}/sections.js +0 -0
  177. /package/src/{code/prompts → agents/prompts/native}/system.js +0 -0
  178. /package/src/{code/prompts → agents/prompts/native}/tasks.js +0 -0
  179. /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/bash.js +0 -0
  180. /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/edit.js +0 -0
  181. /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/read.js +0 -0
  182. /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/write.js +0 -0
  183. /package/src/{code/prompts → agents/prompts/native}/ufoo.js +0 -0
  184. /package/src/{group → agents/prompts}/promptProfiles.js +0 -0
  185. /package/src/{agent → agents/providers}/claudeEventTranslator.js +0 -0
  186. /package/src/{agent → agents/providers}/claudeOauthTokenReader.js +0 -0
  187. /package/src/{agent → agents/providers}/claudeSessionFiles.js +0 -0
  188. /package/src/{agent → agents/providers}/codexEventTranslator.js +0 -0
  189. /package/src/{agent → agents/providers}/credentials/claude.js +0 -0
  190. /package/src/{agent → agents/providers}/credentials/codex.js +0 -0
  191. /package/src/{agent → agents/providers}/credentials/index.js +0 -0
  192. /package/src/{chat → app/chat}/agentBar.js +0 -0
  193. /package/src/{chat → app/chat}/agentDirectory.js +0 -0
  194. /package/src/{chat → app/chat}/cronScheduler.js +0 -0
  195. /package/src/{chat → app/chat}/daemonCoordinator.js +0 -0
  196. /package/src/{chat → app/chat}/daemonReconnect.js +0 -0
  197. /package/src/{chat → app/chat}/daemonTransportDefaults.js +0 -0
  198. /package/src/{chat → app/chat}/inputMath.js +0 -0
  199. /package/src/{chat → app/chat}/rawKeyMap.js +0 -0
  200. /package/src/{chat → app/chat}/settingsController.js +0 -0
  201. /package/src/{chat → app/chat}/text.js +0 -0
  202. /package/src/{chat → app/chat}/transientAgentState.js +0 -0
  203. /package/src/{cli → app/cli}/busCoreCommands.js +0 -0
  204. /package/src/{skills/index.js → app/cli/features/skills.js} +0 -0
  205. /package/src/{bus → coordination/bus}/nickname.js +0 -0
  206. /package/src/{bus → coordination/bus}/queue.js +0 -0
  207. /package/src/{context → coordination/context}/decisions.js +0 -0
  208. /package/src/{context → coordination/context}/doctor.js +0 -0
  209. /package/src/{context → coordination/context}/index.js +0 -0
  210. /package/src/{context → coordination/context}/sync.js +0 -0
  211. /package/src/{ufoo → coordination/state}/agentsStore.js +0 -0
  212. /package/src/{ufoo → coordination/state}/paths.js +0 -0
  213. /package/src/{controller → orchestration/controller}/launchRouting.js +0 -0
  214. /package/src/{controller → orchestration/controller}/routerFastPath.js +0 -0
  215. /package/src/{controller → orchestration/controller}/routerFinalize.js +0 -0
  216. /package/src/{group → orchestration/groups}/diagram.js +0 -0
  217. /package/src/{group → orchestration/groups}/templateValidation.js +0 -0
  218. /package/src/{solo → orchestration/solo}/commands.js +0 -0
  219. /package/src/{shared → runtime/contracts}/eventContract.js +0 -0
  220. /package/src/{shared → runtime/contracts}/ptySocketContract.js +0 -0
  221. /package/src/{providerapi → runtime/privacy}/redactor.js +0 -0
  222. /package/src/{providerapi → runtime/privacy}/shadowDiff.js +0 -0
  223. /package/src/{projects → runtime/projects}/identity.js +0 -0
  224. /package/src/{projects → runtime/projects}/index.js +0 -0
  225. /package/src/{projects → runtime/projects}/projectId.js +0 -0
  226. /package/src/{terminal → runtime/terminal}/adapterContract.js +0 -0
  227. /package/src/{terminal → runtime/terminal}/adapters/externalAdapter.js +0 -0
  228. /package/src/{terminal → runtime/terminal}/adapters/hostAdapter.js +0 -0
  229. /package/src/{terminal → runtime/terminal}/adapters/internalQueueAdapter.js +0 -0
  230. /package/src/{terminal → runtime/terminal}/adapters/terminalAdapter.js +0 -0
  231. /package/src/{terminal → runtime/terminal}/adapters/tmuxAdapter.js +0 -0
  232. /package/src/{terminal → runtime/terminal}/detect.js +0 -0
  233. /package/src/{terminal → runtime/terminal}/index.js +0 -0
  234. /package/src/{terminal → runtime/terminal}/iterm2.js +0 -0
  235. /package/src/{utils → ui/format}/banner.js +0 -0
  236. /package/src/{shared → ui/format}/markdownRenderer.js +0 -0
@@ -8,9 +8,9 @@ const {
8
8
  getTimestamp,
9
9
  writeFileAtomic,
10
10
  } = require("../bus/utils");
11
- const { redactSecrets } = require("../providerapi/redactor");
12
- const { canonicalProjectRoot } = require("../projects/projectId");
13
- const { getUfooPaths } = require("../ufoo/paths");
11
+ const { redactSecrets } = require("../../runtime/privacy/redactor");
12
+ const { canonicalProjectRoot } = require("../../runtime/projects/projectId");
13
+ const { getUfooPaths } = require("../state/paths");
14
14
 
15
15
  const SCHEMA_VERSION = "1.0";
16
16
  const ID_PREFIX = "mem-";
@@ -1,7 +1,7 @@
1
1
  const fs = require("fs");
2
2
  const path = require("path");
3
- const { getUfooPaths } = require("../ufoo/paths");
4
- const { redactSecrets } = require("../providerapi/redactor");
3
+ const { getUfooPaths } = require("../state/paths");
4
+ const { redactSecrets } = require("../../runtime/privacy/redactor");
5
5
 
6
6
  const REPORT_PHASES = {
7
7
  START: "start",
@@ -1,6 +1,9 @@
1
1
  const fs = require("fs");
2
2
  const path = require("path");
3
3
 
4
+ const MAX_DIAGNOSTIC_LOG_BYTES = 5 * 1024 * 1024;
5
+ const emittedDiagnostics = new Set();
6
+
4
7
  function isAgentsFile(filePath) {
5
8
  return path.basename(filePath || "") === "all-agents.json"
6
9
  && path.basename(path.dirname(filePath || "")) === "agent";
@@ -62,11 +65,50 @@ function safePayload(payload = {}) {
62
65
  return out;
63
66
  }
64
67
 
68
+ function diagnosticKey(agentsFilePath, event, payload = {}) {
69
+ if (event === "queue_entry_not_recovered") {
70
+ return [
71
+ agentsFilePath,
72
+ event,
73
+ payload.subscriber || "",
74
+ payload.reason || "",
75
+ ].join("\0");
76
+ }
77
+ return "";
78
+ }
79
+
80
+ function shouldSuppressDiagnostic(agentsFilePath, event, payload = {}) {
81
+ const key = diagnosticKey(agentsFilePath, event, payload);
82
+ if (!key) return false;
83
+ if (emittedDiagnostics.has(key)) return true;
84
+ emittedDiagnostics.add(key);
85
+ return false;
86
+ }
87
+
88
+ function enforceLogLimit(logPath) {
89
+ try {
90
+ const stat = fs.statSync(logPath);
91
+ if (stat.size <= MAX_DIAGNOSTIC_LOG_BYTES) return;
92
+ const line = JSON.stringify({
93
+ ts: new Date().toISOString(),
94
+ pid: process.pid,
95
+ ppid: process.ppid,
96
+ event: "diagnostics_log_truncated",
97
+ previous_size: stat.size,
98
+ });
99
+ fs.writeFileSync(logPath, `${line}\n`, "utf8");
100
+ } catch {
101
+ // Missing/unreadable log files are handled by the append path.
102
+ }
103
+ }
104
+
65
105
  function appendAgentRegistryDiagnostic(agentsFilePath, event, payload = {}) {
66
106
  if (!agentsFilePath || !isAgentsFile(agentsFilePath)) return;
107
+ if (shouldSuppressDiagnostic(agentsFilePath, event, payload)) return;
67
108
  try {
68
109
  const logPath = getRegistryLogPath(agentsFilePath);
69
110
  fs.mkdirSync(path.dirname(logPath), { recursive: true });
111
+ enforceLogLimit(logPath);
70
112
  const line = JSON.stringify({
71
113
  ts: new Date().toISOString(),
72
114
  pid: process.pid,
@@ -88,4 +130,5 @@ module.exports = {
88
130
  summarizeFile,
89
131
  isAgentsFile,
90
132
  getRegistryLogPath,
133
+ MAX_DIAGNOSTIC_LOG_BYTES,
91
134
  };
@@ -2,12 +2,12 @@ const fs = require("fs");
2
2
  const path = require("path");
3
3
  const childProcess = require("child_process");
4
4
  const { readJSON } = require("../bus/utils");
5
- const { getUfooPaths } = require("../ufoo/paths");
6
- const { resolveDisplayNickname } = require("../daemon/nicknameScope");
5
+ const { getUfooPaths } = require("../state/paths");
6
+ const { resolveDisplayNickname } = require("../../runtime/daemon/nicknameScope");
7
7
  const {
8
8
  inspectDirectAuthStatus,
9
9
  formatDirectAuthStatus,
10
- } = require("../agent/directAuthStatus");
10
+ } = require("../../agents/providers/directAuthStatus");
11
11
 
12
12
  function normalizeTty(ttyPath) {
13
13
  if (!ttyPath) return "";
@@ -233,7 +233,7 @@ class OnlineConnect {
233
233
 
234
234
  // Init local bus only when sync is enabled
235
235
  if (this.syncEnabled) {
236
- const EventBus = require("../bus");
236
+ const EventBus = require("../coordination/bus");
237
237
  this.eventBus = new EventBus(this.projectRoot);
238
238
  await this.eventBus.ensureJoined();
239
239
  }
@@ -666,7 +666,7 @@ class OnlineConnect {
666
666
  }
667
667
 
668
668
  try {
669
- const DecisionsManager = require("../context/decisions");
669
+ const DecisionsManager = require("../coordination/context/decisions");
670
670
  const manager = new DecisionsManager(this.projectRoot);
671
671
  manager.writeIndex();
672
672
  } catch {
@@ -1,6 +1,6 @@
1
1
  const fs = require("fs");
2
2
  const path = require("path");
3
- const { loadConfig, normalizeControllerMode } = require("../config");
3
+ const { loadConfig, normalizeControllerMode } = require("../../config");
4
4
 
5
5
  const CONTROLLER_MODES = Object.freeze({
6
6
  LEGACY: "legacy",
@@ -5,7 +5,7 @@ const {
5
5
  defaultRouterProviderForAgentProvider,
6
6
  defaultRouterModelForProvider,
7
7
  sameModelProvider,
8
- } = require("../config");
8
+ } = require("../../config");
9
9
 
10
10
  const DEFAULT_EXECUTION_PATH = "main";
11
11
  const DEFAULT_CONFIDENCE_THRESHOLD = 0.6;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ ...require("./flags"),
5
+ ...require("./gateRouter"),
6
+ ...require("./launchRouting"),
7
+ ...require("./routerFastPath"),
8
+ ...require("./routerFinalize"),
9
+ ...require("./shadowGuard"),
10
+ };
@@ -4,7 +4,7 @@ const crypto = require("crypto");
4
4
  const fs = require("fs");
5
5
  const path = require("path");
6
6
 
7
- const { getUfooPaths } = require("../ufoo/paths");
7
+ const { getUfooPaths } = require("../../coordination/state/paths");
8
8
 
9
9
  const DEFAULT_SHADOW_SAMPLING_RATE = 0.1;
10
10
  const DEFAULT_SHADOW_DAILY_INPUT_TOKEN_LIMIT = 50000;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ module.exports = require("../../agents/prompts/groupBootstrap");
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ ...require("./bootstrap"),
5
+ ...require("./diagram"),
6
+ ...require("./promptProfiles"),
7
+ ...require("./templateValidation"),
8
+ ...require("./templates"),
9
+ ...require("./validateTemplate"),
10
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ module.exports = require("../../agents/prompts/promptProfiles");
@@ -18,7 +18,7 @@ const SOURCE_PRIORITY = [
18
18
  ];
19
19
 
20
20
  function defaultBuiltinTemplatesDir() {
21
- return path.join(path.resolve(__dirname, "..", ".."), "templates", "groups");
21
+ return path.join(path.resolve(__dirname, "..", "..", ".."), "templates", "groups");
22
22
  }
23
23
 
24
24
  function defaultGlobalTemplatesDir() {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- const ALLOWED_AGENT_TYPES = new Set(["auto", "codex", "claude", "ucode"]);
3
+ const ALLOWED_AGENT_TYPES = new Set(["auto", "codex", "claude", "ucode", "agy"]);
4
4
  const { resolvePromptProfileReference } = require("./promptProfiles");
5
5
 
6
6
  function isPlainObject(value) {
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ module.exports = {
4
+ controller: require("./controller"),
5
+ groups: require("./groups"),
6
+ solo: require("./solo"),
7
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ module.exports = require("./commands");
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- const EventBus = require("../bus");
3
+ const EventBus = require("../../coordination/bus");
4
4
 
5
5
  class AgentProcessManager {
6
6
  constructor(projectRoot) {
@@ -1,10 +1,10 @@
1
1
  const fs = require("fs");
2
2
  const path = require("path");
3
- const { getUfooPaths } = require("../ufoo/paths");
3
+ const { getUfooPaths } = require("../../coordination/state/paths");
4
4
  const {
5
5
  parseIntervalMs,
6
6
  formatIntervalMs,
7
- } = require("../chat/cronScheduler");
7
+ } = require("../../app/chat/cronScheduler");
8
8
 
9
9
  function splitTargets(value = "") {
10
10
  return String(value || "")
@@ -342,6 +342,7 @@ function createDaemonCronController(options = {}) {
342
342
  };
343
343
 
344
344
  attachTaskTimer(task);
345
+ runTask(task);
345
346
  tasks.push(task);
346
347
  persistState();
347
348
 
@@ -2,17 +2,17 @@
2
2
 
3
3
  const fs = require("fs");
4
4
  const path = require("path");
5
- const EventBus = require("../bus");
6
- const { prepareUcodeBootstrap } = require("../agent/ucodeBootstrap");
7
- const { loadConfig } = require("../config");
5
+ const EventBus = require("../../coordination/bus");
6
+ const { prepareUcodeBootstrap } = require("../../code/launcher/ucodeBootstrap");
7
+ const { loadConfig } = require("../../config");
8
8
  const {
9
9
  buildGroupPromptMetadata,
10
10
  composeGroupBootstrapPrompt,
11
11
  computeBootstrapFingerprint,
12
12
  computeRosterVersion,
13
- } = require("../group/bootstrap");
14
- const { validateTemplateTarget: validateGroupTemplateTarget } = require("../group/templateValidation");
15
- const { getUfooPaths } = require("../ufoo/paths");
13
+ } = require("../../orchestration/groups/bootstrap");
14
+ const { validateTemplateTarget: validateGroupTemplateTarget } = require("../../orchestration/groups/templateValidation");
15
+ const { getUfooPaths } = require("../../coordination/state/paths");
16
16
  const {
17
17
  normalizeNicknameSegment,
18
18
  buildProjectNicknamePrefix,
@@ -36,12 +36,15 @@ function resolveBootstrapInjectSettleMs(agentType = "", promptText = "", options
36
36
  delayMs = 800;
37
37
  } else if (normalizedAgent === "codex") {
38
38
  delayMs = 250;
39
+ } else if (normalizedAgent === "agy") {
40
+ // Agy uses an ink-style TUI like claude — same input handler latency.
41
+ delayMs = 800;
39
42
  }
40
43
 
41
44
  const text = typeof promptText === "string" ? promptText : "";
42
45
  if (!text) return delayMs;
43
46
  if (text.includes("\n")) {
44
- delayMs += normalizedAgent === "claude" ? 200 : 100;
47
+ delayMs += (normalizedAgent === "claude" || normalizedAgent === "agy") ? 200 : 100;
45
48
  }
46
49
  if (text.length > 1024) {
47
50
  delayMs += Math.min(800, Math.ceil(text.length / 1024) * 120);
@@ -306,6 +309,7 @@ function resolveAutoAgentType(projectRoot, requestedType) {
306
309
  const provider = asTrimmedString(loadConfig(projectRoot).agentProvider);
307
310
  if (provider === "claude-cli") return "claude";
308
311
  if (provider === "ucode") return "ucode";
312
+ if (provider === "agy-cli") return "agy";
309
313
  return "codex";
310
314
  }
311
315
 
@@ -386,7 +390,14 @@ function buildExecutionPlan({
386
390
  ? "ucode-bootstrap-file"
387
391
  : (resolvedType === "claude"
388
392
  ? "system-prompt-file"
389
- : (resolvedType === "codex" ? "initial-prompt-arg" : "post-launch-inject")));
393
+ : (resolvedType === "codex"
394
+ ? "initial-prompt-arg"
395
+ // Agy takes the bootstrap as `-i <text>`, same shape as codex's
396
+ // positional initial prompt — both pass the bootstrap as a flag,
397
+ // not via post-launch injection.
398
+ : (resolvedType === "agy"
399
+ ? "initial-prompt-arg"
400
+ : "post-launch-inject"))));
390
401
  const bootstrapPrompt = bootstrapRequired
391
402
  ? composeGroupBootstrapPrompt({
392
403
  profilePrompt: resolvedProfile.prompt,
@@ -908,12 +919,18 @@ function createGroupOrchestrator(options = {}) {
908
919
  // Codex: pass bootstrap prompt as the initial [PROMPT] CLI argument.
909
920
  // Codex doesn't support --append-system-prompt, but accepts an initial
910
921
  // prompt argument that becomes the first user message at startup.
922
+ //
923
+ // Agy uses the same "send bootstrap as a launch flag" model, but its
924
+ // flag is `-i <text>` (alias for --prompt-interactive). Same strategy
925
+ // key, different arg shape.
911
926
  if (item.bootstrap_strategy === "initial-prompt-arg") {
912
927
  member.bootstrap_attempted_at = nowIso();
913
928
  member.bootstrap_error = "";
914
929
  const promptText = (item.bootstrap_prompt || "").trim();
915
930
  if (promptText) {
916
- extraArgs = [promptText];
931
+ extraArgs = item.type === "agy"
932
+ ? ["-i", promptText]
933
+ : [promptText];
917
934
  bootstrapInjected = true;
918
935
  }
919
936
  }