pum-agent 0.2.0-beta.4 → 0.2.2-beta.1
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 +43 -8
- package/package.json +3 -2
- package/src/app.tsx +49 -8
- package/src/check-mode.ts +4 -1
- package/src/check-mutation.ts +28 -16
- package/src/check-paths.ts +16 -12
- package/src/check-policy.ts +423 -28
- package/src/main.tsx +16 -0
- package/src/platform.ts +39 -0
- package/src/sandbox/index.ts +207 -0
- package/src/sandbox/linux.ts +362 -0
- package/src/sandbox/types.ts +62 -0
- package/src/sandbox/windows.ts +327 -0
- package/src/sandbox-policy.ts +204 -0
- package/src/settings-popup.tsx +2 -0
- package/src/settings.ts +10 -0
- package/src/terminal-title.ts +41 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type TerminalTitleState = {
|
|
2
|
+
working: boolean;
|
|
3
|
+
activeSubagentCount: number;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export type TerminalTitleSink = (title: string) => void;
|
|
7
|
+
|
|
8
|
+
export function formatTerminalTitle(state: TerminalTitleState): string {
|
|
9
|
+
const count = Math.max(0, Math.floor(state.activeSubagentCount));
|
|
10
|
+
const parts = ["Pum", state.working ? "working" : "idle"];
|
|
11
|
+
if (count > 0) parts.push(`${count} ${count === 1 ? "subagent" : "subagents"}`);
|
|
12
|
+
return parts.join(" · ");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Best-effort title writer with exact-value deduplication. */
|
|
16
|
+
export class TerminalTitleController {
|
|
17
|
+
private lastTitle: string | null = null;
|
|
18
|
+
|
|
19
|
+
constructor(private readonly write: TerminalTitleSink) {}
|
|
20
|
+
|
|
21
|
+
update(state: TerminalTitleState): boolean {
|
|
22
|
+
return this.set(formatTerminalTitle(state));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
clear(): boolean {
|
|
26
|
+
if (this.lastTitle === null || this.lastTitle === "") return false;
|
|
27
|
+
return this.set("");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private set(title: string): boolean {
|
|
31
|
+
if (title === this.lastTitle) return false;
|
|
32
|
+
try {
|
|
33
|
+
this.write(title);
|
|
34
|
+
this.lastTitle = title;
|
|
35
|
+
return true;
|
|
36
|
+
} catch {
|
|
37
|
+
// A title update must not interrupt the TUI or shutdown.
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|