u-foo 2.3.32 → 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 +5 -5
- package/scripts/chat-app-smoke.js +1 -1
- package/scripts/global-chat-switch-benchmark.js +5 -5
- package/scripts/ink-demo.js +1 -1
- package/scripts/ink-smoke.js +1 -1
- package/scripts/ucode-app-smoke.js +1 -1
- 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 +50 -26
- 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 +45 -3
- package/src/{chat → app/chat}/dashboardView.js +2 -1
- package/src/app/chat/index.js +6 -0
- package/src/{chat → app/chat}/inputSubmitHandler.js +4 -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}/transport.js +1 -1
- 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} +59 -57
- 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/tui.js +3 -1454
- 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/{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 +105 -53
- package/src/{daemon → runtime/daemon}/ipcServer.js +1 -1
- 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 +7 -7
- package/src/runtime/daemon/providerSessions.js +230 -0
- package/src/{daemon → runtime/daemon}/reporting.js +4 -4
- package/src/{daemon → runtime/daemon}/run.js +4 -4
- 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/{projects → runtime/projects}/registry.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 +42 -88
- package/src/ui/format/index.js +5 -28
- package/src/ui/index.js +1 -1
- package/src/ui/{components → ink}/ChatApp.js +812 -88
- package/src/ui/ink/DashboardBar.js +685 -0
- package/src/ui/{components → ink}/MultilineInput.js +230 -5
- package/src/ui/{components → ink}/UcodeApp.js +16 -7
- package/src/ui/{components → ink}/agentMirror.js +24 -19
- package/src/ui/{components → ink}/chatReducer.js +29 -7
- 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 -533
- package/src/chat/index.js +0 -2222
- 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/ui/components/DashboardBar.js +0 -417
- /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}/daemonTransport.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}/projectCloseController.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}/shellCommand.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}/agentRegistryDiagnostics.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/{utils → runtime/process}/nodeExecutable.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/{projects → runtime/projects}/runtimes.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
- /package/src/ui/{components → ink}/InkDemo.js +0 -0
|
@@ -3,21 +3,21 @@ const os = require("os");
|
|
|
3
3
|
const { spawnSync } = require("child_process");
|
|
4
4
|
const net = require("net");
|
|
5
5
|
const fs = require("fs");
|
|
6
|
-
const { socketPath, isRunning } = require("
|
|
7
|
-
const { runBusCoreCommand } = require("./
|
|
8
|
-
const { runCtxCommand } = require("./
|
|
9
|
-
const { runOnlineCommand } = require("./
|
|
10
|
-
const { runGroupCoreCommand } = require("./
|
|
11
|
-
const { loadConfig } = require("
|
|
12
|
-
const { loadPromptProfileRegistry } = require("
|
|
13
|
-
const { resolveSoloAgentType } = require("
|
|
14
|
-
const { listProjectRuntimes, getCurrentProjectRuntime } = require("
|
|
15
|
-
const { canonicalProjectRoot, buildProjectId } = require("
|
|
16
|
-
const { getUfooPaths } = require("
|
|
17
|
-
const { resolveNodeExecutable } = require("
|
|
6
|
+
const { socketPath, isRunning } = require("../../runtime/daemon");
|
|
7
|
+
const { runBusCoreCommand } = require("./busCoreCommands");
|
|
8
|
+
const { runCtxCommand } = require("./ctxCoreCommands");
|
|
9
|
+
const { runOnlineCommand } = require("./onlineCoreCommands");
|
|
10
|
+
const { runGroupCoreCommand } = require("./groupCoreCommands");
|
|
11
|
+
const { loadConfig } = require("../../config");
|
|
12
|
+
const { loadPromptProfileRegistry } = require("../../orchestration/groups/promptProfiles");
|
|
13
|
+
const { resolveSoloAgentType } = require("../../orchestration/solo/commands");
|
|
14
|
+
const { listProjectRuntimes, getCurrentProjectRuntime } = require("../../runtime/projects/registry");
|
|
15
|
+
const { canonicalProjectRoot, buildProjectId } = require("../../runtime/projects/projectId");
|
|
16
|
+
const { getUfooPaths } = require("../../coordination/state/paths");
|
|
17
|
+
const { resolveNodeExecutable } = require("../../runtime/process/nodeExecutable");
|
|
18
18
|
|
|
19
19
|
function getPackageRoot() {
|
|
20
|
-
return path.resolve(__dirname, "..");
|
|
20
|
+
return path.resolve(__dirname, "..", "..", "..");
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function run(cmd, args, options = {}) {
|
|
@@ -286,7 +286,7 @@ function runMemoryCommand({
|
|
|
286
286
|
write = (line) => console.log(line),
|
|
287
287
|
writeError = (line) => console.error(line),
|
|
288
288
|
} = {}) {
|
|
289
|
-
const MemoryManager = require("
|
|
289
|
+
const MemoryManager = require("../../coordination/memory");
|
|
290
290
|
const manager = new MemoryManager(cwd);
|
|
291
291
|
const sub = String(subcommand || "list").trim().toLowerCase();
|
|
292
292
|
const outputJson = opts.json === true;
|
|
@@ -475,7 +475,7 @@ function resolveOnlineAuthToken(opts) {
|
|
|
475
475
|
let tokens = null;
|
|
476
476
|
try {
|
|
477
477
|
// eslint-disable-next-line global-require
|
|
478
|
-
tokens = require("
|
|
478
|
+
tokens = require("../../online/tokens");
|
|
479
479
|
} catch {
|
|
480
480
|
return "";
|
|
481
481
|
}
|
|
@@ -513,7 +513,7 @@ async function runCli(argv) {
|
|
|
513
513
|
.description("Run repo doctor checks")
|
|
514
514
|
.action(() => {
|
|
515
515
|
const repoRoot = getPackageRoot();
|
|
516
|
-
const RepoDoctor = require("./doctor");
|
|
516
|
+
const RepoDoctor = require("./features/doctor");
|
|
517
517
|
const doctor = new RepoDoctor(repoRoot);
|
|
518
518
|
const ok = doctor.run();
|
|
519
519
|
if (!ok) process.exitCode = 1;
|
|
@@ -522,7 +522,7 @@ async function runCli(argv) {
|
|
|
522
522
|
.command("status")
|
|
523
523
|
.description("Show project status (banner, unread bus, open decisions)")
|
|
524
524
|
.action(async () => {
|
|
525
|
-
const StatusDisplay = require("
|
|
525
|
+
const StatusDisplay = require("../../coordination/status");
|
|
526
526
|
const status = new StatusDisplay(process.cwd());
|
|
527
527
|
await status.show();
|
|
528
528
|
});
|
|
@@ -688,8 +688,8 @@ async function runCli(argv) {
|
|
|
688
688
|
|
|
689
689
|
program
|
|
690
690
|
.command("launch")
|
|
691
|
-
.description("Launch an agent (
|
|
692
|
-
.argument("<agent>", "Agent type:
|
|
691
|
+
.description("Launch an agent (uclaude, ucodex, uagy, ucode)")
|
|
692
|
+
.argument("<agent>", "Agent type: uclaude|ucodex|uagy|ucode|claude|codex|agy")
|
|
693
693
|
.argument("[nickname]", "Optional nickname for the agent")
|
|
694
694
|
.option("--profile <id>", "Prompt profile to assign after launch")
|
|
695
695
|
.action(async (agent, nickname, opts) => {
|
|
@@ -700,15 +700,17 @@ async function runCli(argv) {
|
|
|
700
700
|
// Normalize agent type
|
|
701
701
|
const agentLower = agent.toLowerCase();
|
|
702
702
|
let normalizedAgent = "";
|
|
703
|
-
if (agentLower === "
|
|
704
|
-
normalizedAgent = "ucode";
|
|
705
|
-
} else if (agentLower === "uclaude" || agentLower === "claude-code" || agentLower === "claude") {
|
|
703
|
+
if (agentLower === "uclaude" || agentLower === "claude-code" || agentLower === "claude") {
|
|
706
704
|
normalizedAgent = "claude";
|
|
707
705
|
} else if (agentLower === "ucodex" || agentLower === "codex" || agentLower === "openai") {
|
|
708
706
|
normalizedAgent = "codex";
|
|
707
|
+
} else if (agentLower === "uagy" || agentLower === "agy" || agentLower === "antigravity") {
|
|
708
|
+
normalizedAgent = "agy";
|
|
709
|
+
} else if (agentLower === "ucode" || agentLower === "ufoo-code" || agentLower === "ufoo") {
|
|
710
|
+
normalizedAgent = "ucode";
|
|
709
711
|
} else {
|
|
710
712
|
console.error(`Unknown agent type: ${agent}`);
|
|
711
|
-
console.error("Valid types:
|
|
713
|
+
console.error("Valid types: uclaude, ucodex, uagy, ucode, claude, codex, agy");
|
|
712
714
|
process.exitCode = 1;
|
|
713
715
|
return;
|
|
714
716
|
}
|
|
@@ -733,7 +735,7 @@ async function runCli(argv) {
|
|
|
733
735
|
.description("Solo role agent operations")
|
|
734
736
|
.argument("<action>", "run|list")
|
|
735
737
|
.argument("[profile]", "Prompt profile id or alias")
|
|
736
|
-
.option("--agent <type>", "Agent type: codex|claude|ucode")
|
|
738
|
+
.option("--agent <type>", "Agent type: codex|claude|ucode|agy")
|
|
737
739
|
.option("--nickname <name>", "Optional nickname")
|
|
738
740
|
.option("--scope <scope>", "Launch scope: inplace|window", "inplace")
|
|
739
741
|
.option("--json", "Output role list as JSON")
|
|
@@ -915,7 +917,7 @@ async function runCli(argv) {
|
|
|
915
917
|
const normalized = normalizeReportPhase(action);
|
|
916
918
|
const text = Array.isArray(messageParts) ? messageParts.join(" ").trim() : String(messageParts || "").trim();
|
|
917
919
|
const projectRoot = process.cwd();
|
|
918
|
-
const { listReports } = require("
|
|
920
|
+
const { listReports } = require("../../coordination/report/store");
|
|
919
921
|
|
|
920
922
|
if ((action || "").toLowerCase() === "list") {
|
|
921
923
|
try {
|
|
@@ -1002,8 +1004,8 @@ async function runCli(argv) {
|
|
|
1002
1004
|
.argument("[action]", "doctor|prepare|build", "doctor")
|
|
1003
1005
|
.option("--skip-install", "Skip npm install even if node_modules is missing")
|
|
1004
1006
|
.action((action, opts) => {
|
|
1005
|
-
const { inspectUcodeSetup, formatUcodeDoctor, prepareAndInspectUcode } = require("
|
|
1006
|
-
const { buildUcodeCore } = require("
|
|
1007
|
+
const { inspectUcodeSetup, formatUcodeDoctor, prepareAndInspectUcode } = require("../../code/launcher/ucodeDoctor");
|
|
1008
|
+
const { buildUcodeCore } = require("../../code/launcher/ucodeBuild");
|
|
1007
1009
|
const normalized = String(action || "doctor").trim().toLowerCase();
|
|
1008
1010
|
if (normalized !== "doctor" && normalized !== "prepare" && normalized !== "build") {
|
|
1009
1011
|
console.error("ucode action must be doctor|prepare|build");
|
|
@@ -1044,7 +1046,7 @@ async function runCli(argv) {
|
|
|
1044
1046
|
.option("--modules <list>", "Comma-separated modules (context,bus,resources)", "context")
|
|
1045
1047
|
.option("--project <dir>", "Target project directory", process.cwd())
|
|
1046
1048
|
.action(async (opts) => {
|
|
1047
|
-
const UfooInit = require("./init");
|
|
1049
|
+
const UfooInit = require("./features/init");
|
|
1048
1050
|
const repoRoot = getPackageRoot();
|
|
1049
1051
|
const init = new UfooInit(repoRoot);
|
|
1050
1052
|
try {
|
|
@@ -1060,7 +1062,7 @@ async function runCli(argv) {
|
|
|
1060
1062
|
.command("list")
|
|
1061
1063
|
.description("List available skills")
|
|
1062
1064
|
.action(() => {
|
|
1063
|
-
const SkillsManager = require("./skills");
|
|
1065
|
+
const SkillsManager = require("./features/skills");
|
|
1064
1066
|
const repoRoot = getPackageRoot();
|
|
1065
1067
|
const manager = new SkillsManager(repoRoot);
|
|
1066
1068
|
const skillsList = manager.list();
|
|
@@ -1074,7 +1076,7 @@ async function runCli(argv) {
|
|
|
1074
1076
|
.option("--codex", "Install into ~/.codex/skills")
|
|
1075
1077
|
.option("--agents", "Install into ~/.agents/skills")
|
|
1076
1078
|
.action(async (name, opts) => {
|
|
1077
|
-
const SkillsManager = require("./skills");
|
|
1079
|
+
const SkillsManager = require("./features/skills");
|
|
1078
1080
|
const repoRoot = getPackageRoot();
|
|
1079
1081
|
const manager = new SkillsManager(repoRoot);
|
|
1080
1082
|
try {
|
|
@@ -1446,7 +1448,7 @@ async function runCli(argv) {
|
|
|
1446
1448
|
.option("--no-bell", "Disable terminal bell")
|
|
1447
1449
|
.allowUnknownOption(true)
|
|
1448
1450
|
.action((subscriber, interval, opts) => {
|
|
1449
|
-
const EventBus = require("
|
|
1451
|
+
const EventBus = require("../../coordination/bus");
|
|
1450
1452
|
const eventBus = new EventBus(process.cwd());
|
|
1451
1453
|
const parsedInterval = parseInt(interval, 10);
|
|
1452
1454
|
eventBus
|
|
@@ -1470,7 +1472,7 @@ async function runCli(argv) {
|
|
|
1470
1472
|
.option("--reset", "Truncate pending queue before listening")
|
|
1471
1473
|
.option("--auto-join", "Auto-join bus to get subscriber ID")
|
|
1472
1474
|
.action((subscriber, opts) => {
|
|
1473
|
-
const EventBus = require("
|
|
1475
|
+
const EventBus = require("../../coordination/bus");
|
|
1474
1476
|
const eventBus = new EventBus(process.cwd());
|
|
1475
1477
|
eventBus
|
|
1476
1478
|
.listen(subscriber, {
|
|
@@ -1491,7 +1493,7 @@ async function runCli(argv) {
|
|
|
1491
1493
|
.option("--stop", "Stop running daemon")
|
|
1492
1494
|
.option("--status", "Check daemon status")
|
|
1493
1495
|
.action((opts) => {
|
|
1494
|
-
const EventBus = require("
|
|
1496
|
+
const EventBus = require("../../coordination/bus");
|
|
1495
1497
|
const eventBus = new EventBus(process.cwd());
|
|
1496
1498
|
(async () => {
|
|
1497
1499
|
try {
|
|
@@ -1514,7 +1516,7 @@ async function runCli(argv) {
|
|
|
1514
1516
|
.description("Inject /bus into a Terminal.app tab by subscriber ID")
|
|
1515
1517
|
.argument("<subscriber>", "Subscriber ID to inject into")
|
|
1516
1518
|
.action((subscriber) => {
|
|
1517
|
-
const EventBus = require("
|
|
1519
|
+
const EventBus = require("../../coordination/bus");
|
|
1518
1520
|
const eventBus = new EventBus(process.cwd());
|
|
1519
1521
|
(async () => {
|
|
1520
1522
|
try {
|
|
@@ -1532,7 +1534,7 @@ async function runCli(argv) {
|
|
|
1532
1534
|
.option("--reason <reason>", "Wake reason")
|
|
1533
1535
|
.option("--no-shake", "Disable window shake")
|
|
1534
1536
|
.action((target, opts) => {
|
|
1535
|
-
const EventBus = require("
|
|
1537
|
+
const EventBus = require("../../coordination/bus");
|
|
1536
1538
|
const eventBus = new EventBus(process.cwd());
|
|
1537
1539
|
(async () => {
|
|
1538
1540
|
try {
|
|
@@ -1548,7 +1550,7 @@ async function runCli(argv) {
|
|
|
1548
1550
|
.description("Activate (focus) the terminal/tmux window of an agent")
|
|
1549
1551
|
.argument("<agent-id>", "Agent ID or nickname to activate")
|
|
1550
1552
|
.action((agentId) => {
|
|
1551
|
-
const AgentActivator = require("
|
|
1553
|
+
const AgentActivator = require("../../coordination/bus/activate");
|
|
1552
1554
|
const activator = new AgentActivator(process.cwd());
|
|
1553
1555
|
(async () => {
|
|
1554
1556
|
try {
|
|
@@ -1565,7 +1567,7 @@ async function runCli(argv) {
|
|
|
1565
1567
|
.allowUnknownOption(true)
|
|
1566
1568
|
.argument("<args...>", "Arguments passed to bus module")
|
|
1567
1569
|
.action(async (args) => {
|
|
1568
|
-
const EventBus = require("
|
|
1570
|
+
const EventBus = require("../../coordination/bus");
|
|
1569
1571
|
const eventBus = new EventBus(process.cwd());
|
|
1570
1572
|
const cmd = args[0];
|
|
1571
1573
|
const cmdArgs = args.slice(1);
|
|
@@ -1610,7 +1612,7 @@ async function runCli(argv) {
|
|
|
1610
1612
|
.description("Build unified input timeline (incremental by default)")
|
|
1611
1613
|
.option("--force", "Full rebuild (ignore watermark)")
|
|
1612
1614
|
.action((opts) => {
|
|
1613
|
-
const { buildTimeline } = require("
|
|
1615
|
+
const { buildTimeline } = require("../../coordination/history/inputTimeline");
|
|
1614
1616
|
const result = buildTimeline(process.cwd(), { force: opts.force === true });
|
|
1615
1617
|
console.log(`Timeline: ${result.count} total, ${result.newCount} new → ${result.file}`);
|
|
1616
1618
|
});
|
|
@@ -1619,7 +1621,7 @@ async function runCli(argv) {
|
|
|
1619
1621
|
.description("Show recent timeline entries")
|
|
1620
1622
|
.argument("[limit]", "Number of entries to show", "50")
|
|
1621
1623
|
.action((limit) => {
|
|
1622
|
-
const { showTimeline } = require("
|
|
1624
|
+
const { showTimeline } = require("../../coordination/history/inputTimeline");
|
|
1623
1625
|
showTimeline(process.cwd(), parseInt(limit, 10) || 50);
|
|
1624
1626
|
});
|
|
1625
1627
|
history
|
|
@@ -1627,7 +1629,7 @@ async function runCli(argv) {
|
|
|
1627
1629
|
.description("Render timeline as injectable prompt context")
|
|
1628
1630
|
.argument("[limit]", "Number of entries to include", "30")
|
|
1629
1631
|
.action((limit) => {
|
|
1630
|
-
const { renderTimelineForPrompt } = require("
|
|
1632
|
+
const { renderTimelineForPrompt } = require("../../coordination/history/inputTimeline");
|
|
1631
1633
|
const text = renderTimelineForPrompt(process.cwd(), parseInt(limit, 10) || 30);
|
|
1632
1634
|
if (text) {
|
|
1633
1635
|
console.log(text);
|
|
@@ -1647,7 +1649,7 @@ async function runCli(argv) {
|
|
|
1647
1649
|
|
|
1648
1650
|
// 检查是否是 --version 或 -V 参数
|
|
1649
1651
|
if (argv.includes("--version") || argv.includes("-V")) {
|
|
1650
|
-
const { showUfooBanner } = require("
|
|
1652
|
+
const { showUfooBanner } = require("../../ui/format/banner");
|
|
1651
1653
|
showUfooBanner({ version: pkg.version });
|
|
1652
1654
|
return;
|
|
1653
1655
|
}
|
|
@@ -1687,7 +1689,7 @@ async function runCli(argv) {
|
|
|
1687
1689
|
console.log(" ufoo group diagram <alias|groupId> [--ascii|--mermaid] [--json]");
|
|
1688
1690
|
console.log(" ufoo group stop <groupId> [--json]");
|
|
1689
1691
|
console.log(" ufoo solo list [--json]");
|
|
1690
|
-
console.log(" ufoo solo run <profile> [--agent <codex|claude|ucode>] [--nickname <name>] [--scope <inplace|window>]");
|
|
1692
|
+
console.log(" ufoo solo run <profile> [--agent <codex|claude|ucode|agy>] [--nickname <name>] [--scope <inplace|window>]");
|
|
1691
1693
|
console.log(" ufoo online server [--port 8787] [--host 127.0.0.1] [--token-file <path>]");
|
|
1692
1694
|
console.log(" ufoo online token <subscriber> [--nickname <name>] [--server <url>] [--file <path>]");
|
|
1693
1695
|
console.log(" ufoo online room create [--name <room>] --type public|private [--password <pwd>] [--created-by <name>] [--server <url>]");
|
|
@@ -1712,20 +1714,20 @@ async function runCli(argv) {
|
|
|
1712
1714
|
}
|
|
1713
1715
|
|
|
1714
1716
|
if (cmd === "--version" || cmd === "-V") {
|
|
1715
|
-
const { showUfooBanner } = require("
|
|
1717
|
+
const { showUfooBanner } = require("../../ui/format/banner");
|
|
1716
1718
|
showUfooBanner({ version: pkg.version });
|
|
1717
1719
|
return;
|
|
1718
1720
|
}
|
|
1719
1721
|
|
|
1720
1722
|
if (cmd === "doctor") {
|
|
1721
|
-
const RepoDoctor = require("./doctor");
|
|
1723
|
+
const RepoDoctor = require("./features/doctor");
|
|
1722
1724
|
const doctor = new RepoDoctor(repoRoot);
|
|
1723
1725
|
const ok = doctor.run();
|
|
1724
1726
|
if (!ok) process.exitCode = 1;
|
|
1725
1727
|
return;
|
|
1726
1728
|
}
|
|
1727
1729
|
if (cmd === "status") {
|
|
1728
|
-
const StatusDisplay = require("
|
|
1730
|
+
const StatusDisplay = require("../../coordination/status");
|
|
1729
1731
|
const status = new StatusDisplay(process.cwd());
|
|
1730
1732
|
status.show().catch((err) => {
|
|
1731
1733
|
console.error(err.message);
|
|
@@ -1832,7 +1834,7 @@ async function runCli(argv) {
|
|
|
1832
1834
|
if (cmd === "report") {
|
|
1833
1835
|
const action = String(rest[0] || "").toLowerCase();
|
|
1834
1836
|
const normalized = normalizeReportPhase(action);
|
|
1835
|
-
const { listReports } = require("
|
|
1837
|
+
const { listReports } = require("../../coordination/report/store");
|
|
1836
1838
|
|
|
1837
1839
|
if (action === "list") {
|
|
1838
1840
|
const agentIdx = rest.indexOf("--agent");
|
|
@@ -1947,8 +1949,8 @@ async function runCli(argv) {
|
|
|
1947
1949
|
}
|
|
1948
1950
|
if (cmd === "ucode") {
|
|
1949
1951
|
const action = String(rest[0] || "doctor").trim().toLowerCase();
|
|
1950
|
-
const { inspectUcodeSetup, formatUcodeDoctor, prepareAndInspectUcode } = require("
|
|
1951
|
-
const { buildUcodeCore } = require("
|
|
1952
|
+
const { inspectUcodeSetup, formatUcodeDoctor, prepareAndInspectUcode } = require("../../code/launcher/ucodeDoctor");
|
|
1953
|
+
const { buildUcodeCore } = require("../../code/launcher/ucodeBuild");
|
|
1952
1954
|
const skipInstall = rest.includes("--skip-install");
|
|
1953
1955
|
if (action !== "doctor" && action !== "prepare" && action !== "build") {
|
|
1954
1956
|
console.error("ucode action must be doctor|prepare|build");
|
|
@@ -2016,7 +2018,7 @@ async function runCli(argv) {
|
|
|
2016
2018
|
return;
|
|
2017
2019
|
}
|
|
2018
2020
|
if (cmd === "init") {
|
|
2019
|
-
const UfooInit = require("./init");
|
|
2021
|
+
const UfooInit = require("./features/init");
|
|
2020
2022
|
const init = new UfooInit(repoRoot);
|
|
2021
2023
|
|
|
2022
2024
|
const getOpt = (name, def) => {
|
|
@@ -2038,7 +2040,7 @@ async function runCli(argv) {
|
|
|
2038
2040
|
return;
|
|
2039
2041
|
}
|
|
2040
2042
|
if (cmd === "skills") {
|
|
2041
|
-
const SkillsManager = require("./skills");
|
|
2043
|
+
const SkillsManager = require("./features/skills");
|
|
2042
2044
|
const manager = new SkillsManager(repoRoot);
|
|
2043
2045
|
const sub = rest[0] || "";
|
|
2044
2046
|
|
|
@@ -2298,7 +2300,7 @@ async function runCli(argv) {
|
|
|
2298
2300
|
if (cmd === "bus") {
|
|
2299
2301
|
const sub = rest[0] || "";
|
|
2300
2302
|
if (sub === "alert") {
|
|
2301
|
-
const EventBus = require("
|
|
2303
|
+
const EventBus = require("../../coordination/bus");
|
|
2302
2304
|
const eventBus = new EventBus(process.cwd());
|
|
2303
2305
|
const args = rest.slice(1);
|
|
2304
2306
|
const subscriber = args[0];
|
|
@@ -2324,7 +2326,7 @@ async function runCli(argv) {
|
|
|
2324
2326
|
return;
|
|
2325
2327
|
}
|
|
2326
2328
|
if (sub === "listen") {
|
|
2327
|
-
const EventBus = require("
|
|
2329
|
+
const EventBus = require("../../coordination/bus");
|
|
2328
2330
|
const eventBus = new EventBus(process.cwd());
|
|
2329
2331
|
const args = rest.slice(1);
|
|
2330
2332
|
const subscriber = args.find((arg) => !arg.startsWith("--"));
|
|
@@ -2343,7 +2345,7 @@ async function runCli(argv) {
|
|
|
2343
2345
|
}
|
|
2344
2346
|
if (sub === "daemon") {
|
|
2345
2347
|
// 使用 JavaScript daemon
|
|
2346
|
-
const EventBus = require("
|
|
2348
|
+
const EventBus = require("../../coordination/bus");
|
|
2347
2349
|
const eventBus = new EventBus(process.cwd());
|
|
2348
2350
|
|
|
2349
2351
|
(async () => {
|
|
@@ -2370,7 +2372,7 @@ async function runCli(argv) {
|
|
|
2370
2372
|
}
|
|
2371
2373
|
if (sub === "inject") {
|
|
2372
2374
|
// 使用 JavaScript inject
|
|
2373
|
-
const EventBus = require("
|
|
2375
|
+
const EventBus = require("../../coordination/bus");
|
|
2374
2376
|
const eventBus = new EventBus(process.cwd());
|
|
2375
2377
|
|
|
2376
2378
|
(async () => {
|
|
@@ -2388,7 +2390,7 @@ async function runCli(argv) {
|
|
|
2388
2390
|
return;
|
|
2389
2391
|
}
|
|
2390
2392
|
if (sub === "wake") {
|
|
2391
|
-
const EventBus = require("
|
|
2393
|
+
const EventBus = require("../../coordination/bus");
|
|
2392
2394
|
const eventBus = new EventBus(process.cwd());
|
|
2393
2395
|
(async () => {
|
|
2394
2396
|
try {
|
|
@@ -2407,7 +2409,7 @@ async function runCli(argv) {
|
|
|
2407
2409
|
}
|
|
2408
2410
|
|
|
2409
2411
|
// Use JavaScript EventBus module for core commands
|
|
2410
|
-
const EventBus = require("
|
|
2412
|
+
const EventBus = require("../../coordination/bus");
|
|
2411
2413
|
const eventBus = new EventBus(process.cwd());
|
|
2412
2414
|
|
|
2413
2415
|
(async () => {
|
|
@@ -2445,7 +2447,7 @@ async function runCli(argv) {
|
|
|
2445
2447
|
if (cmd === "history") {
|
|
2446
2448
|
const sub = rest[0] || "show";
|
|
2447
2449
|
const cwd = process.cwd();
|
|
2448
|
-
const { buildTimeline, showTimeline, renderTimelineForPrompt } = require("
|
|
2450
|
+
const { buildTimeline, showTimeline, renderTimelineForPrompt } = require("../../coordination/history/inputTimeline");
|
|
2449
2451
|
|
|
2450
2452
|
if (sub === "build") {
|
|
2451
2453
|
const force = rest.includes("--force");
|
package/src/app/index.js
ADDED
package/src/code/agent.js
CHANGED
|
@@ -16,7 +16,7 @@ const {
|
|
|
16
16
|
createEscapeTagStripper,
|
|
17
17
|
stripLeakedEscapeTags,
|
|
18
18
|
} = require("./tui");
|
|
19
|
-
const { stripBlessedTags } = require("../chat/text");
|
|
19
|
+
const { stripBlessedTags } = require("../app/chat/text");
|
|
20
20
|
const { loadConfig, defaultAgentModelForProvider, sameModelProvider } = require("../config");
|
|
21
21
|
const {
|
|
22
22
|
resolveSessionId,
|
|
@@ -24,7 +24,7 @@ const {
|
|
|
24
24
|
saveSessionSnapshot,
|
|
25
25
|
loadSessionSnapshot,
|
|
26
26
|
} = require("./sessionStore");
|
|
27
|
-
const { buildPromptContext } = require("
|
|
27
|
+
const { buildPromptContext } = require("../agents/prompts/native");
|
|
28
28
|
const {
|
|
29
29
|
buildSkillInjections,
|
|
30
30
|
formatSkillsList,
|
|
@@ -50,10 +50,11 @@ function normalizeLine(input = "") {
|
|
|
50
50
|
return String(input || "").trim();
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
function
|
|
53
|
+
function parseLegacyUfooMarkerCommand(input = "") {
|
|
54
54
|
const text = String(input || "").trim();
|
|
55
55
|
if (!text) return "";
|
|
56
|
-
//
|
|
56
|
+
// Old daemons injected strict "<prefix> <single-token>" commands for
|
|
57
|
+
// session discovery. Keep ignoring those inputs after removing injection.
|
|
57
58
|
const match = text.match(/^(?:\$ufoo|\/ufoo|ufoo)\s+([A-Za-z0-9][A-Za-z0-9._:-]{0,63})$/);
|
|
58
59
|
return match ? String(match[1] || "").trim() : "";
|
|
59
60
|
}
|
|
@@ -1321,11 +1322,11 @@ function runSingleCommand(line = "", workspaceRoot = process.cwd()) {
|
|
|
1321
1322
|
].join("\n"),
|
|
1322
1323
|
};
|
|
1323
1324
|
}
|
|
1324
|
-
const
|
|
1325
|
-
if (
|
|
1325
|
+
const legacyUfooMarker = parseLegacyUfooMarkerCommand(text);
|
|
1326
|
+
if (legacyUfooMarker) {
|
|
1326
1327
|
return {
|
|
1327
|
-
kind: "
|
|
1328
|
-
marker:
|
|
1328
|
+
kind: "legacy_ufoo_marker",
|
|
1329
|
+
marker: legacyUfooMarker,
|
|
1329
1330
|
};
|
|
1330
1331
|
}
|
|
1331
1332
|
if (text === "ubus" || text === "/ubus") {
|
|
@@ -1613,7 +1614,7 @@ async function runUcodeCoreAgent({
|
|
|
1613
1614
|
rl.close();
|
|
1614
1615
|
return;
|
|
1615
1616
|
}
|
|
1616
|
-
if (result.kind === "
|
|
1617
|
+
if (result.kind === "legacy_ufoo_marker") {
|
|
1617
1618
|
return;
|
|
1618
1619
|
}
|
|
1619
1620
|
if (result.kind === "help" || result.kind === "tool" || result.kind === "skills" || result.kind === "error") {
|
package/src/code/index.js
CHANGED
|
@@ -32,6 +32,7 @@ const {
|
|
|
32
32
|
saveSessionSnapshot,
|
|
33
33
|
loadSessionSnapshot,
|
|
34
34
|
} = require("./sessionStore");
|
|
35
|
+
const launcher = require("./launcher");
|
|
35
36
|
|
|
36
37
|
module.exports = {
|
|
37
38
|
TOOL_NAMES,
|
|
@@ -67,4 +68,5 @@ module.exports = {
|
|
|
67
68
|
getSessionFilePath,
|
|
68
69
|
saveSessionSnapshot,
|
|
69
70
|
loadSessionSnapshot,
|
|
71
|
+
...launcher,
|
|
70
72
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
const { loadConfig } = require("
|
|
1
|
+
const { loadConfig } = require("../../config");
|
|
2
2
|
const path = require("path");
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
|
|
5
5
|
function bundledModuleRoots() {
|
|
6
|
-
const repoRoot = path.join(__dirname, "..", "..");
|
|
7
6
|
return [
|
|
8
|
-
path.join(
|
|
7
|
+
path.join(__dirname, ".."),
|
|
9
8
|
];
|
|
10
9
|
}
|
|
11
10
|
|
|
@@ -22,7 +21,7 @@ function resolveFirstExisting(paths = []) {
|
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
function defaultBundledCoreRoot() {
|
|
25
|
-
const root = path.join(__dirname, ".."
|
|
24
|
+
const root = path.join(__dirname, "..");
|
|
26
25
|
const agentEntry = path.join(root, "agent.js");
|
|
27
26
|
if (resolveFirstExisting([agentEntry])) return root;
|
|
28
27
|
return root;
|
|
@@ -289,8 +288,8 @@ function resolveCandidateCoreRoot({
|
|
|
289
288
|
|
|
290
289
|
function resolveNativeFallbackCommand({ env = process.env } = {}) {
|
|
291
290
|
const candidates = [
|
|
292
|
-
path.resolve(__dirname, "..", "
|
|
293
|
-
path.resolve(__dirname, "..", "..", "bin", "ucode-core.js"),
|
|
291
|
+
path.resolve(__dirname, "..", "agent.js"),
|
|
292
|
+
path.resolve(__dirname, "..", "..", "..", "bin", "ucode-core.js"),
|
|
294
293
|
];
|
|
295
294
|
for (const entry of candidates) {
|
|
296
295
|
try {
|
|
@@ -299,7 +298,7 @@ function resolveNativeFallbackCommand({ env = process.env } = {}) {
|
|
|
299
298
|
return {
|
|
300
299
|
command: process.execPath,
|
|
301
300
|
args: [entry],
|
|
302
|
-
root: path.resolve(__dirname, ".."
|
|
301
|
+
root: path.resolve(__dirname, ".."),
|
|
303
302
|
kind: "native",
|
|
304
303
|
available: true,
|
|
305
304
|
resolvedPath: entry,
|
|
@@ -308,7 +307,7 @@ function resolveNativeFallbackCommand({ env = process.env } = {}) {
|
|
|
308
307
|
return {
|
|
309
308
|
command: process.execPath,
|
|
310
309
|
args: [entry, "agent"],
|
|
311
|
-
root: path.resolve(__dirname, ".."
|
|
310
|
+
root: path.resolve(__dirname, ".."),
|
|
312
311
|
kind: "native",
|
|
313
312
|
available: true,
|
|
314
313
|
resolvedPath: entry,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
2
|
const path = require("path");
|
|
3
|
-
const { getUfooPaths } = require("
|
|
4
|
-
const { buildDefaultStartupBootstrapPrompt } = require("
|
|
3
|
+
const { getUfooPaths } = require("../../coordination/state/paths");
|
|
4
|
+
const { buildDefaultStartupBootstrapPrompt } = require("../../agents/prompts/defaultBootstrap");
|
|
5
5
|
|
|
6
6
|
function readFileSafe(filePath = "") {
|
|
7
7
|
if (!filePath) return "";
|
|
@@ -77,7 +77,7 @@ function buildBootstrapContent({
|
|
|
77
77
|
|
|
78
78
|
function hasUfooProtocolPrompt(promptText = "") {
|
|
79
79
|
const text = String(promptText || "");
|
|
80
|
-
return text.includes("
|
|
80
|
+
return text.includes("Session harness: ufoo") && text.includes("ufoo ctx decisions -l");
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
function mergeDefaultUfooProtocolPrompt(projectRoot = "", promptText = "") {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
2
|
const path = require("path");
|
|
3
|
-
const { loadConfig } = require("
|
|
3
|
+
const { loadConfig } = require("../../config");
|
|
4
4
|
const {
|
|
5
5
|
resolveNativeFallbackCommand,
|
|
6
6
|
} = require("./ucode");
|
|
@@ -12,7 +12,7 @@ function resolveCoreRoot({
|
|
|
12
12
|
void env;
|
|
13
13
|
void config;
|
|
14
14
|
const native = resolveNativeFallbackCommand();
|
|
15
|
-
return native.root || path.resolve(__dirname, ".."
|
|
15
|
+
return native.root || path.resolve(__dirname, "..");
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function inspectUcodeBuildSetup({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
2
|
const path = require("path");
|
|
3
|
-
const { loadConfig } = require("
|
|
3
|
+
const { loadConfig } = require("../../config");
|
|
4
4
|
const {
|
|
5
5
|
resolveNativeFallbackCommand,
|
|
6
6
|
defaultBundledPromptFile,
|
|
@@ -20,7 +20,7 @@ function inspectUcodeSetup({
|
|
|
20
20
|
const native = resolveNativeImpl({ env, config, cwd: root });
|
|
21
21
|
const coreAvailable = Boolean(native && native.available !== false && native.command);
|
|
22
22
|
const core = native ? {
|
|
23
|
-
root: native.root || path.resolve(__dirname, ".."
|
|
23
|
+
root: native.root || path.resolve(__dirname, ".."),
|
|
24
24
|
command: native.command,
|
|
25
25
|
args: native.args || [],
|
|
26
26
|
available: coreAvailable,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
2
|
const path = require("path");
|
|
3
|
-
const { loadGlobalUcodeConfig } = require("
|
|
3
|
+
const { loadGlobalUcodeConfig } = require("../../config");
|
|
4
4
|
|
|
5
5
|
function readJson(filePath = "", fallback = {}) {
|
|
6
6
|
if (!filePath) return fallback;
|
|
@@ -134,4 +134,3 @@ module.exports = {
|
|
|
134
134
|
inspectUcodeRuntimeConfig,
|
|
135
135
|
prepareUcodeRuntimeConfig,
|
|
136
136
|
};
|
|
137
|
-
|
package/src/code/nativeRunner.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const { randomUUID } = require("crypto");
|
|
2
2
|
const { loadConfig, defaultAgentModelForProvider, sameModelProvider } = require("../config");
|
|
3
3
|
const { runToolCall } = require("./dispatch");
|
|
4
|
-
const { getReadToolDescription } = require("
|
|
5
|
-
const { getWriteToolDescription } = require("
|
|
6
|
-
const { getEditToolDescription } = require("
|
|
7
|
-
const { getBashToolDescription } = require("
|
|
4
|
+
const { getReadToolDescription } = require("../agents/prompts/native/toolDescriptions/read");
|
|
5
|
+
const { getWriteToolDescription } = require("../agents/prompts/native/toolDescriptions/write");
|
|
6
|
+
const { getEditToolDescription } = require("../agents/prompts/native/toolDescriptions/edit");
|
|
7
|
+
const { getBashToolDescription } = require("../agents/prompts/native/toolDescriptions/bash");
|
|
8
8
|
|
|
9
9
|
const CORE_TOOL_NAMES = new Set(["read", "write", "edit", "bash"]);
|
|
10
10
|
const DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
|