u-foo 1.0.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/LICENSE +35 -0
- package/README.md +163 -0
- package/README.zh-CN.md +163 -0
- package/bin/uclaude +65 -0
- package/bin/ucodex +65 -0
- package/bin/ufoo +93 -0
- package/bin/ufoo.js +35 -0
- package/modules/AGENTS.template.md +87 -0
- package/modules/bus/README.md +132 -0
- package/modules/bus/SKILLS/ubus/SKILL.md +209 -0
- package/modules/bus/scripts/bus-alert.sh +185 -0
- package/modules/bus/scripts/bus-listen.sh +117 -0
- package/modules/context/ASSUMPTIONS.md +7 -0
- package/modules/context/CONSTRAINTS.md +7 -0
- package/modules/context/CONTEXT-STRUCTURE.md +49 -0
- package/modules/context/DECISION-PROTOCOL.md +62 -0
- package/modules/context/HANDOFF.md +33 -0
- package/modules/context/README.md +82 -0
- package/modules/context/RULES.md +15 -0
- package/modules/context/SKILLS/README.md +14 -0
- package/modules/context/SKILLS/uctx/SKILL.md +91 -0
- package/modules/context/SYSTEM.md +18 -0
- package/modules/context/TEMPLATES/assumptions.md +4 -0
- package/modules/context/TEMPLATES/constraints.md +4 -0
- package/modules/context/TEMPLATES/decision.md +16 -0
- package/modules/context/TEMPLATES/project-context-readme.md +6 -0
- package/modules/context/TEMPLATES/system.md +3 -0
- package/modules/context/TEMPLATES/terminology.md +4 -0
- package/modules/context/TERMINOLOGY.md +10 -0
- package/modules/resources/ICONS/README.md +12 -0
- package/modules/resources/ICONS/libraries/README.md +17 -0
- package/modules/resources/ICONS/libraries/heroicons/LICENSE +22 -0
- package/modules/resources/ICONS/libraries/heroicons/README.md +15 -0
- package/modules/resources/ICONS/libraries/heroicons/arrow-right.svg +4 -0
- package/modules/resources/ICONS/libraries/heroicons/check.svg +4 -0
- package/modules/resources/ICONS/libraries/heroicons/chevron-down.svg +4 -0
- package/modules/resources/ICONS/libraries/heroicons/cog-6-tooth.svg +5 -0
- package/modules/resources/ICONS/libraries/heroicons/magnifying-glass.svg +4 -0
- package/modules/resources/ICONS/libraries/heroicons/x-mark.svg +4 -0
- package/modules/resources/ICONS/libraries/lucide/LICENSE +40 -0
- package/modules/resources/ICONS/libraries/lucide/README.md +15 -0
- package/modules/resources/ICONS/libraries/lucide/arrow-right.svg +15 -0
- package/modules/resources/ICONS/libraries/lucide/check.svg +14 -0
- package/modules/resources/ICONS/libraries/lucide/chevron-down.svg +14 -0
- package/modules/resources/ICONS/libraries/lucide/search.svg +15 -0
- package/modules/resources/ICONS/libraries/lucide/settings.svg +15 -0
- package/modules/resources/ICONS/libraries/lucide/x.svg +15 -0
- package/modules/resources/ICONS/rules.md +7 -0
- package/modules/resources/README.md +9 -0
- package/modules/resources/UI/ANTI-PATTERNS.md +6 -0
- package/modules/resources/UI/TONE.md +6 -0
- package/package.json +40 -0
- package/scripts/banner.sh +89 -0
- package/scripts/bus-alert.sh +6 -0
- package/scripts/bus-autotrigger.sh +6 -0
- package/scripts/bus-daemon.sh +231 -0
- package/scripts/bus-inject.sh +144 -0
- package/scripts/bus-listen.sh +6 -0
- package/scripts/bus.sh +984 -0
- package/scripts/context-decisions.sh +167 -0
- package/scripts/context-doctor.sh +72 -0
- package/scripts/context-lint.sh +110 -0
- package/scripts/doctor.sh +22 -0
- package/scripts/init.sh +247 -0
- package/scripts/skills.sh +113 -0
- package/scripts/status.sh +125 -0
- package/src/agent/cliRunner.js +190 -0
- package/src/agent/internalRunner.js +212 -0
- package/src/agent/normalizeOutput.js +41 -0
- package/src/agent/ufooAgent.js +222 -0
- package/src/chat/index.js +1603 -0
- package/src/cli.js +349 -0
- package/src/config.js +37 -0
- package/src/daemon/index.js +501 -0
- package/src/daemon/ops.js +120 -0
- package/src/daemon/run.js +41 -0
- package/src/daemon/status.js +78 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
function readBus(projectRoot) {
|
|
5
|
+
const busPath = path.join(projectRoot, ".ufoo", "bus", "bus.json");
|
|
6
|
+
try {
|
|
7
|
+
return JSON.parse(fs.readFileSync(busPath, "utf8"));
|
|
8
|
+
} catch {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function readDecisions(projectRoot) {
|
|
14
|
+
const dir = path.join(projectRoot, ".ufoo", "context", "DECISIONS");
|
|
15
|
+
let open = 0;
|
|
16
|
+
try {
|
|
17
|
+
const files = fs.readdirSync(dir).filter((f) => f.endsWith(".md"));
|
|
18
|
+
for (const f of files) {
|
|
19
|
+
const content = fs.readFileSync(path.join(dir, f), "utf8");
|
|
20
|
+
const match = content.match(/---[\s\S]*?status:\s*([^\n]+)[\s\S]*?---/);
|
|
21
|
+
const status = match ? match[1].trim() : "open";
|
|
22
|
+
if (status === "open") open += 1;
|
|
23
|
+
}
|
|
24
|
+
} catch {
|
|
25
|
+
open = 0;
|
|
26
|
+
}
|
|
27
|
+
return { open };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function readUnread(projectRoot) {
|
|
31
|
+
const queuesDir = path.join(projectRoot, ".ufoo", "bus", "queues");
|
|
32
|
+
let total = 0;
|
|
33
|
+
const perSubscriber = {};
|
|
34
|
+
try {
|
|
35
|
+
const dirs = fs.readdirSync(queuesDir);
|
|
36
|
+
for (const d of dirs) {
|
|
37
|
+
const file = path.join(queuesDir, d, "pending.jsonl");
|
|
38
|
+
if (!fs.existsSync(file)) continue;
|
|
39
|
+
const lines = fs.readFileSync(file, "utf8").trim().split(/\r?\n/).filter(Boolean);
|
|
40
|
+
if (lines.length > 0) {
|
|
41
|
+
total += lines.length;
|
|
42
|
+
perSubscriber[d] = lines.length;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
} catch {
|
|
46
|
+
return { total: 0, perSubscriber: {} };
|
|
47
|
+
}
|
|
48
|
+
return { total, perSubscriber };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function buildStatus(projectRoot) {
|
|
52
|
+
const bus = readBus(projectRoot);
|
|
53
|
+
const decisions = readDecisions(projectRoot);
|
|
54
|
+
const unread = readUnread(projectRoot);
|
|
55
|
+
const subscribers = bus ? Object.keys(bus.subscribers || {}) : [];
|
|
56
|
+
const activeEntries = bus
|
|
57
|
+
? Object.entries(bus.subscribers || {})
|
|
58
|
+
.filter(([, meta]) => meta.status === "active")
|
|
59
|
+
.map(([id, meta]) => ({ id, meta }))
|
|
60
|
+
: [];
|
|
61
|
+
const active = activeEntries.map(({ id }) => id);
|
|
62
|
+
const activeMeta = activeEntries.map(({ id, meta }) => {
|
|
63
|
+
const nickname = meta?.nickname || "";
|
|
64
|
+
const display = nickname ? nickname : id;
|
|
65
|
+
return { id, nickname, display };
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
projectRoot,
|
|
70
|
+
subscribers,
|
|
71
|
+
active,
|
|
72
|
+
active_meta: activeMeta,
|
|
73
|
+
unread,
|
|
74
|
+
decisions,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
module.exports = { buildStatus };
|