u-foo 2.5.6 → 2.5.8
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/bin/ucode.js +9 -0
- package/package.json +1 -1
- package/src/agents/launch/notifier.js +6 -0
- package/src/agents/prompts/native/index.js +1 -1
- package/src/agents/prompts/native/toolDescriptions/edit.js +1 -0
- package/src/code/agent.js +53 -1076
- package/src/code/busConsumer.js +504 -0
- package/src/code/dispatch.js +1 -6
- package/src/code/launcher/ucode.js +3 -251
- package/src/code/launcher/ucodeBootstrap.js +18 -1
- package/src/code/launcher/ucodeBuild.js +0 -3
- package/src/code/launcher/ucodeDoctor.js +24 -9
- package/src/code/launcher/ucodeRuntimeConfig.js +12 -3
- package/src/code/nativeRunner.js +490 -580
- package/src/code/repl.js +610 -0
- package/src/code/sessionStore.js +5 -1
- package/src/code/skills/injection.js +17 -1
- package/src/code/taskDecomposer.js +36 -29
- package/src/code/tools/common.js +34 -0
- package/src/code/tools/edit.js +11 -3
- package/src/coordination/bus/inject.js +52 -7
- package/src/coordination/bus/subscriber.js +33 -6
- package/src/runtime/daemon/deliveryScheduler.js +102 -2
- package/src/runtime/daemon/index.js +8 -1
- package/src/runtime/daemon/ops.js +23 -0
package/bin/ucode.js
CHANGED
|
@@ -106,6 +106,11 @@ const resolved = resolveUcodeLaunch({
|
|
|
106
106
|
cwd: process.cwd(),
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
+
// Capture before resolved.env (which may carry project-config values) is
|
|
110
|
+
// merged into process.env — the user's own env var is trusted, a path from
|
|
111
|
+
// the project config must stay inside the project root.
|
|
112
|
+
const userBootstrapFile = String(process.env.UFOO_UCODE_BOOTSTRAP_FILE || "").trim();
|
|
113
|
+
|
|
109
114
|
if (resolved && resolved.env && typeof resolved.env === "object") {
|
|
110
115
|
for (const [key, value] of Object.entries(resolved.env)) {
|
|
111
116
|
if (!key) continue;
|
|
@@ -133,6 +138,10 @@ try {
|
|
|
133
138
|
projectRoot: process.cwd(),
|
|
134
139
|
promptFile: process.env.UFOO_UCODE_PROMPT_FILE || "",
|
|
135
140
|
targetFile: process.env.UFOO_UCODE_BOOTSTRAP_FILE || "",
|
|
141
|
+
allowOutsideProjectRoot: Boolean(userBootstrapFile),
|
|
142
|
+
// The native core already injects the ufoo protocol via its modular
|
|
143
|
+
// prompt; inlining it here would append the same text a second time.
|
|
144
|
+
includeDefaultProtocol: false,
|
|
136
145
|
});
|
|
137
146
|
} catch (err) {
|
|
138
147
|
const mode = String(process.env.UFOO_UCODE_APPEND_SYSTEM_PROMPT_MODE || "auto").trim().toLowerCase();
|
package/package.json
CHANGED
|
@@ -114,6 +114,12 @@ class AgentNotifier {
|
|
|
114
114
|
* 更新心跳时间戳(last_seen)
|
|
115
115
|
*/
|
|
116
116
|
updateHeartbeat() {
|
|
117
|
+
// TODO(race, needs evidence): this read-modify-write of all-agents.json
|
|
118
|
+
// has no file lock and races with the daemon, the launcher, and other
|
|
119
|
+
// agents' notifiers writing the same file — a lost update could roll
|
|
120
|
+
// back activity_state/last_seen (suspected amplifier of delivery
|
|
121
|
+
// stalls, not yet confirmed). If evidence shows lost updates, serialize
|
|
122
|
+
// writes (lockfile or single-writer daemon IPC) instead of JSON RMW.
|
|
117
123
|
try {
|
|
118
124
|
if (!this.agentsFile || !fs.existsSync(this.agentsFile)) return;
|
|
119
125
|
const data = readJSON(this.agentsFile, null);
|
|
@@ -54,7 +54,7 @@ function getSystemPrompt({
|
|
|
54
54
|
return [overrideSystemPrompt];
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
// --- Static sections (
|
|
57
|
+
// --- Static sections (session-independent content, recomputed on every call) ---
|
|
58
58
|
const staticSections = [
|
|
59
59
|
getIdentitySection(),
|
|
60
60
|
getSystemSection(),
|
|
@@ -9,6 +9,7 @@ Usage notes:
|
|
|
9
9
|
- You must read the file first before editing. This tool will produce incorrect results if you guess at file contents.
|
|
10
10
|
- The find string must match exactly — including whitespace and indentation. Copy it precisely from the read output.
|
|
11
11
|
- The find string should be unique in the file. If it's not unique, provide more surrounding context to make it unique, or use all: true to replace every occurrence.
|
|
12
|
+
- If the find string does not match anything, the tool fails with a "not found" error — no partial edit is applied. Re-read the file and adjust the find string instead of assuming the edit succeeded.
|
|
12
13
|
- Use all: true for bulk replacements like renaming a variable across the file.
|
|
13
14
|
- Preserve the exact indentation of the original code when specifying the replacement.`;
|
|
14
15
|
}
|