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.
- package/README.md +157 -213
- package/README.zh-CN.md +151 -197
- package/SKILLS/ufoo/SKILL.md +8 -8
- package/bin/uagy.js +69 -0
- package/bin/uclaude.js +2 -2
- package/bin/ucode.js +4 -4
- package/bin/ucodex.js +2 -2
- package/bin/ufoo.js +5 -23
- package/modules/AGENTS.template.md +1 -1
- package/modules/bus/SKILLS/ubus/SKILL.md +35 -10
- package/package.json +9 -5
- package/scripts/chat-app-smoke.js +30 -0
- package/scripts/global-chat-switch-benchmark.js +5 -5
- package/scripts/ink-demo.js +23 -0
- package/scripts/ink-smoke.js +30 -0
- package/scripts/ucode-app-smoke.js +36 -0
- package/src/{agent → agents/activity}/activityDetector.js +39 -2
- package/src/{agent → agents/activity}/activityStatePublisher.js +1 -1
- package/src/{agent → agents/activity}/activityStateWriter.js +2 -2
- package/src/{agent → agents/activity}/activityTracker.js +1 -1
- package/src/agents/activity/index.js +8 -0
- package/src/{agent → agents/controller}/controllerToolExecutor.js +4 -4
- package/src/agents/controller/index.js +8 -0
- package/src/{agent → agents/controller}/loopObservability.js +2 -2
- package/src/{agent → agents/controller}/loopRuntime.js +1 -1
- package/src/{agent → agents/controller}/ufooAgent.js +9 -9
- package/src/agents/index.js +10 -0
- package/src/agents/internal/index.js +3 -0
- package/src/{agent → agents/internal}/internalRunner.js +45 -22
- package/src/agents/launch/agyConversation.js +159 -0
- package/src/agents/launch/index.js +12 -0
- package/src/{agent → agents/launch}/launchEnvironment.js +2 -3
- package/src/{agent → agents/launch}/launcher.js +64 -21
- package/src/{agent → agents/launch}/notifier.js +23 -12
- package/src/{agent → agents/launch}/ptyRunner.js +44 -12
- package/src/{agent → agents/launch}/ptyWrapper.js +2 -2
- package/src/{agent → agents/launch}/publisherRouting.js +1 -1
- package/src/{agent → agents/launch}/readyDetector.js +23 -0
- package/src/{agent → agents/prompts}/defaultBootstrap.js +63 -4
- package/src/{group/bootstrap.js → agents/prompts/groupBootstrap.js} +41 -6
- package/src/agents/prompts/index.js +8 -0
- package/src/{code/prompts → agents/prompts/native}/index.js +1 -1
- package/src/{agent → agents/providers}/claudeThreadProvider.js +1 -1
- package/src/{agent → agents/providers}/codexThreadProvider.js +1 -1
- package/src/{agent → agents/providers}/directAuthStatus.js +184 -1
- package/src/agents/providers/index.js +13 -0
- package/src/{agent → agents/providers}/upstreamTransport.js +2 -2
- package/src/{chat → app/chat}/agentSockets.js +1 -1
- package/src/{chat → app/chat}/commandExecutor.js +56 -28
- package/src/{chat → app/chat}/commands.js +119 -5
- package/src/{chat → app/chat}/daemonConnection.js +1 -1
- package/src/{chat → app/chat}/daemonMessageRouter.js +54 -4
- package/src/{chat → app/chat}/daemonTransport.js +2 -1
- package/src/{chat → app/chat}/dashboardView.js +2 -21
- package/src/app/chat/index.js +6 -0
- package/src/{chat → app/chat}/inputSubmitHandler.js +38 -13
- package/src/{chat → app/chat}/internalAgentLogHistory.js +1 -1
- package/src/app/chat/multiWindow/index.js +268 -0
- package/src/app/chat/multiWindow/paneLayout.js +84 -0
- package/src/app/chat/multiWindow/paneManager.js +299 -0
- package/src/app/chat/multiWindow/renderer.js +384 -0
- package/src/app/chat/multiWindow/virtualTerminal.js +327 -0
- package/src/{chat → app/chat}/projectCloseController.js +1 -1
- package/src/app/chat/shellCommand.js +42 -0
- package/src/{chat → app/chat}/transport.js +16 -3
- package/src/{cli → app/cli}/ctxCoreCommands.js +3 -3
- package/src/{doctor/index.js → app/cli/features/doctor.js} +1 -1
- package/src/{init/index.js → app/cli/features/init.js} +14 -32
- package/src/{cli → app/cli}/groupCoreCommands.js +2 -2
- package/src/app/cli/index.js +9 -0
- package/src/{cli → app/cli}/onlineCoreCommands.js +5 -5
- package/src/{cli.js → app/cli/run.js} +62 -59
- package/src/app/index.js +6 -0
- package/src/code/agent.js +10 -9
- package/src/code/index.js +2 -0
- package/src/code/launcher/index.js +9 -0
- package/src/{agent → code/launcher}/ucode.js +7 -8
- package/src/{agent → code/launcher}/ucodeBootstrap.js +3 -3
- package/src/{agent → code/launcher}/ucodeBuild.js +2 -2
- package/src/{agent → code/launcher}/ucodeDoctor.js +2 -2
- package/src/{agent → code/launcher}/ucodeRuntimeConfig.js +1 -2
- package/src/code/nativeRunner.js +4 -4
- package/src/code/taskDecomposer.js +5 -4
- package/src/code/tui.js +39 -1997
- package/src/config.js +15 -2
- package/src/{bus → coordination/bus}/activate.js +2 -2
- package/src/{bus → coordination/bus}/daemon.js +15 -5
- package/src/coordination/bus/envelope.js +173 -0
- package/src/{bus → coordination/bus}/index.js +7 -3
- package/src/{bus → coordination/bus}/inject.js +11 -3
- package/src/{bus → coordination/bus}/message.js +1 -1
- package/src/coordination/bus/messageMeta.js +130 -0
- package/src/coordination/bus/promptEnvelope.js +65 -0
- package/src/{bus → coordination/bus}/shake.js +1 -1
- package/src/{bus → coordination/bus}/store.js +3 -3
- package/src/{bus → coordination/bus}/subscriber.js +2 -2
- package/src/{bus → coordination/bus}/utils.js +2 -2
- package/src/{history → coordination/history}/inputTimeline.js +5 -5
- package/src/coordination/index.js +10 -0
- package/src/{memory → coordination/memory}/historySearch.js +1 -1
- package/src/{memory → coordination/memory}/index.js +3 -3
- package/src/{report → coordination/report}/store.js +2 -2
- package/src/{ufoo → coordination/state}/agentRegistryDiagnostics.js +43 -0
- package/src/{status → coordination/status}/index.js +3 -3
- package/src/online/bridge.js +2 -2
- package/src/{controller → orchestration/controller}/flags.js +1 -1
- package/src/{controller → orchestration/controller}/gateRouter.js +1 -1
- package/src/orchestration/controller/index.js +10 -0
- package/src/{controller → orchestration/controller}/shadowGuard.js +1 -1
- package/src/orchestration/groups/bootstrap.js +3 -0
- package/src/orchestration/groups/index.js +10 -0
- package/src/orchestration/groups/promptProfiles.js +3 -0
- package/src/{group → orchestration/groups}/templates.js +1 -1
- package/src/{group → orchestration/groups}/validateTemplate.js +1 -1
- package/src/orchestration/index.js +7 -0
- package/src/orchestration/solo/index.js +3 -0
- package/src/{daemon → runtime/daemon}/agentProcessManager.js +1 -1
- package/src/{daemon → runtime/daemon}/cronOps.js +3 -2
- package/src/{daemon → runtime/daemon}/groupOrchestrator.js +26 -9
- package/src/{daemon → runtime/daemon}/index.js +273 -79
- package/src/{daemon → runtime/daemon}/ipcServer.js +24 -2
- package/src/{daemon → runtime/daemon}/nicknameScope.js +6 -3
- package/src/{daemon → runtime/daemon}/ops.js +48 -61
- package/src/{daemon → runtime/daemon}/promptLoop.js +1 -1
- package/src/{daemon → runtime/daemon}/promptRequest.js +13 -8
- package/src/runtime/daemon/providerSessions.js +230 -0
- package/src/{daemon → runtime/daemon}/reporting.js +4 -4
- package/src/{daemon → runtime/daemon}/run.js +12 -5
- package/src/{daemon → runtime/daemon}/soloBootstrap.js +7 -7
- package/src/{daemon → runtime/daemon}/status.js +5 -5
- package/src/runtime/index.js +10 -0
- package/src/runtime/process/nodeExecutable.js +26 -0
- package/src/{projects → runtime/projects}/registry.js +1 -1
- package/src/{projects → runtime/projects}/runtimes.js +1 -1
- package/src/{terminal → runtime/terminal}/adapterRouter.js +0 -10
- package/src/{terminal → runtime/terminal}/adapters/internalAdapter.js +0 -4
- package/src/tools/handlers/common.js +1 -1
- package/src/tools/handlers/listAgents.js +1 -1
- package/src/tools/handlers/memory.js +3 -3
- package/src/tools/handlers/readBusSummary.js +1 -1
- package/src/tools/handlers/readOpenDecisions.js +1 -1
- package/src/tools/handlers/readProjectRegistry.js +1 -1
- package/src/tools/handlers/readPromptHistory.js +2 -2
- package/src/tools/schemaFixtures.js +1 -1
- package/src/ui/MIGRATION.md +336 -0
- package/src/ui/format/index.js +974 -0
- package/src/ui/index.js +9 -0
- package/src/ui/ink/ChatApp.js +3674 -0
- package/src/ui/ink/DashboardBar.js +685 -0
- package/src/ui/ink/InkDemo.js +96 -0
- package/src/ui/ink/MultilineInput.js +612 -0
- package/src/ui/ink/UcodeApp.js +822 -0
- package/src/ui/ink/agentMirror.js +730 -0
- package/src/ui/ink/chatReducer.js +359 -0
- package/src/ui/runInk.js +57 -0
- package/src/bus/messageMeta.js +0 -52
- package/src/chat/agentViewController.js +0 -1072
- package/src/chat/chatLogController.js +0 -138
- package/src/chat/completionController.js +0 -533
- package/src/chat/dashboardKeyController.js +0 -573
- package/src/chat/index.js +0 -2214
- package/src/chat/inputHistoryController.js +0 -135
- package/src/chat/inputListenerController.js +0 -470
- package/src/chat/layout.js +0 -186
- package/src/chat/pasteController.js +0 -81
- package/src/chat/statusLineController.js +0 -223
- package/src/chat/streamTracker.js +0 -156
- package/src/code/config +0 -0
- package/src/daemon/providerSessions.js +0 -488
- package/src/terminal/adapters/internalPtyAdapter.js +0 -42
- /package/src/{code/prompts → agents/prompts/native}/actions.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/efficiency.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/environment.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/identity.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/safety.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/sections.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/system.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/tasks.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/bash.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/edit.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/read.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/toolDescriptions/write.js +0 -0
- /package/src/{code/prompts → agents/prompts/native}/ufoo.js +0 -0
- /package/src/{group → agents/prompts}/promptProfiles.js +0 -0
- /package/src/{agent → agents/providers}/claudeEventTranslator.js +0 -0
- /package/src/{agent → agents/providers}/claudeOauthTokenReader.js +0 -0
- /package/src/{agent → agents/providers}/claudeSessionFiles.js +0 -0
- /package/src/{agent → agents/providers}/codexEventTranslator.js +0 -0
- /package/src/{agent → agents/providers}/credentials/claude.js +0 -0
- /package/src/{agent → agents/providers}/credentials/codex.js +0 -0
- /package/src/{agent → agents/providers}/credentials/index.js +0 -0
- /package/src/{chat → app/chat}/agentBar.js +0 -0
- /package/src/{chat → app/chat}/agentDirectory.js +0 -0
- /package/src/{chat → app/chat}/cronScheduler.js +0 -0
- /package/src/{chat → app/chat}/daemonCoordinator.js +0 -0
- /package/src/{chat → app/chat}/daemonReconnect.js +0 -0
- /package/src/{chat → app/chat}/daemonTransportDefaults.js +0 -0
- /package/src/{chat → app/chat}/inputMath.js +0 -0
- /package/src/{chat → app/chat}/rawKeyMap.js +0 -0
- /package/src/{chat → app/chat}/settingsController.js +0 -0
- /package/src/{chat → app/chat}/text.js +0 -0
- /package/src/{chat → app/chat}/transientAgentState.js +0 -0
- /package/src/{cli → app/cli}/busCoreCommands.js +0 -0
- /package/src/{skills/index.js → app/cli/features/skills.js} +0 -0
- /package/src/{bus → coordination/bus}/nickname.js +0 -0
- /package/src/{bus → coordination/bus}/queue.js +0 -0
- /package/src/{context → coordination/context}/decisions.js +0 -0
- /package/src/{context → coordination/context}/doctor.js +0 -0
- /package/src/{context → coordination/context}/index.js +0 -0
- /package/src/{context → coordination/context}/sync.js +0 -0
- /package/src/{ufoo → coordination/state}/agentsStore.js +0 -0
- /package/src/{ufoo → coordination/state}/paths.js +0 -0
- /package/src/{controller → orchestration/controller}/launchRouting.js +0 -0
- /package/src/{controller → orchestration/controller}/routerFastPath.js +0 -0
- /package/src/{controller → orchestration/controller}/routerFinalize.js +0 -0
- /package/src/{group → orchestration/groups}/diagram.js +0 -0
- /package/src/{group → orchestration/groups}/templateValidation.js +0 -0
- /package/src/{solo → orchestration/solo}/commands.js +0 -0
- /package/src/{shared → runtime/contracts}/eventContract.js +0 -0
- /package/src/{shared → runtime/contracts}/ptySocketContract.js +0 -0
- /package/src/{providerapi → runtime/privacy}/redactor.js +0 -0
- /package/src/{providerapi → runtime/privacy}/shadowDiff.js +0 -0
- /package/src/{projects → runtime/projects}/identity.js +0 -0
- /package/src/{projects → runtime/projects}/index.js +0 -0
- /package/src/{projects → runtime/projects}/projectId.js +0 -0
- /package/src/{terminal → runtime/terminal}/adapterContract.js +0 -0
- /package/src/{terminal → runtime/terminal}/adapters/externalAdapter.js +0 -0
- /package/src/{terminal → runtime/terminal}/adapters/hostAdapter.js +0 -0
- /package/src/{terminal → runtime/terminal}/adapters/internalQueueAdapter.js +0 -0
- /package/src/{terminal → runtime/terminal}/adapters/terminalAdapter.js +0 -0
- /package/src/{terminal → runtime/terminal}/adapters/tmuxAdapter.js +0 -0
- /package/src/{terminal → runtime/terminal}/detect.js +0 -0
- /package/src/{terminal → runtime/terminal}/index.js +0 -0
- /package/src/{terminal → runtime/terminal}/iterm2.js +0 -0
- /package/src/{utils → ui/format}/banner.js +0 -0
- /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("
|
|
12
|
-
const { canonicalProjectRoot } = require("
|
|
13
|
-
const { getUfooPaths } = require("../
|
|
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("../
|
|
4
|
-
const { redactSecrets } = require("
|
|
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("../
|
|
6
|
-
const { resolveDisplayNickname } = require("
|
|
5
|
+
const { getUfooPaths } = require("../state/paths");
|
|
6
|
+
const { resolveDisplayNickname } = require("../../runtime/daemon/nicknameScope");
|
|
7
7
|
const {
|
|
8
8
|
inspectDirectAuthStatus,
|
|
9
9
|
formatDirectAuthStatus,
|
|
10
|
-
} = require("
|
|
10
|
+
} = require("../../agents/providers/directAuthStatus");
|
|
11
11
|
|
|
12
12
|
function normalizeTty(ttyPath) {
|
|
13
13
|
if (!ttyPath) return "";
|
package/src/online/bridge.js
CHANGED
|
@@ -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("
|
|
3
|
+
const { loadConfig, normalizeControllerMode } = require("../../config");
|
|
4
4
|
|
|
5
5
|
const CONTROLLER_MODES = Object.freeze({
|
|
6
6
|
LEGACY: "legacy",
|
|
@@ -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("
|
|
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;
|
|
@@ -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) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
2
|
const path = require("path");
|
|
3
|
-
const { getUfooPaths } = require("
|
|
3
|
+
const { getUfooPaths } = require("../../coordination/state/paths");
|
|
4
4
|
const {
|
|
5
5
|
parseIntervalMs,
|
|
6
6
|
formatIntervalMs,
|
|
7
|
-
} = require("
|
|
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("
|
|
6
|
-
const { prepareUcodeBootstrap } = require("
|
|
7
|
-
const { loadConfig } = require("
|
|
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("
|
|
14
|
-
const { validateTemplateTarget: validateGroupTemplateTarget } = require("
|
|
15
|
-
const { getUfooPaths } = require("
|
|
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"
|
|
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 =
|
|
931
|
+
extraArgs = item.type === "agy"
|
|
932
|
+
? ["-i", promptText]
|
|
933
|
+
: [promptText];
|
|
917
934
|
bootstrapInjected = true;
|
|
918
935
|
}
|
|
919
936
|
}
|