@saadnvd1/agent-os 0.3.723 → 0.3.731
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 +1 -0
- package/app/api/bus/ports/route.test.ts +43 -0
- package/app/api/bus/ports/route.ts +35 -0
- package/app/api/loops/route.ts +17 -0
- package/app/api/sessions/[id]/export/turn/route.test.ts +65 -0
- package/app/api/sessions/[id]/export/turn/route.ts +33 -0
- package/app/api/tasks/[id]/loop/cycles/[n]/log/route.ts +29 -0
- package/app/api/tasks/[id]/loop/draft-criteria/route.ts +17 -0
- package/app/api/tasks/[id]/loop/next/route.ts +25 -0
- package/app/api/tasks/[id]/loop/route.ts +72 -0
- package/app/api/tasks/[id]/loop/run/route.ts +12 -0
- package/app/api/tasks/[id]/loop/stop/route.ts +12 -0
- package/app/api/tasks/[id]/mode/route.ts +29 -0
- package/app/api/tasks/[id]/report/draft/route.ts +54 -0
- package/app/api/tasks/[id]/report/evidence/[evId]/route.ts +18 -0
- package/app/api/tasks/[id]/report/route.ts +39 -0
- package/app/api/workspaces/[id]/mode/route.ts +23 -0
- package/app/api/workspaces/[id]/reports/route.ts +17 -0
- package/app/page.tsx +8 -0
- package/components/Analyst/PairChip.tsx +131 -0
- package/components/Analyst/PairSwitch.tsx +76 -0
- package/components/Analyst/ReviewCard.tsx +272 -0
- package/components/Analyst/SignalChips.tsx +39 -0
- package/components/Analyst/StartAnalystSheet.tsx +109 -0
- package/components/Analyst/cardState.test.ts +109 -0
- package/components/Analyst/cardState.ts +95 -0
- package/components/Analyst/pair.ts +81 -0
- package/components/Chat/Code.tsx +3 -0
- package/components/Chat/Messages.tsx +8 -1
- package/components/Chat/TurnCopy.tsx +84 -0
- package/components/Chat/itemContext.ts +14 -0
- package/components/Draft/DraftChips.tsx +10 -0
- package/components/Draft/DraftPanel.tsx +7 -0
- package/components/Pane/DesktopTabBar.tsx +6 -0
- package/components/Pane/MobileTabBar.tsx +17 -0
- package/components/Pane/MobileViewPicker.tsx +4 -0
- package/components/Pane/PaneMenu.test.ts +21 -0
- package/components/Pane/PaneMenu.tsx +16 -0
- package/components/Pane/PaneViewToggle.tsx +12 -0
- package/components/Pane/index.tsx +19 -0
- package/components/Report/DraftCard.tsx +89 -0
- package/components/Report/EstimateBar.tsx +51 -0
- package/components/Report/EvidenceSheet.tsx +98 -0
- package/components/Report/ModeChooser.tsx +43 -0
- package/components/Report/ReportView.tsx +289 -0
- package/components/SessionList/GroupShelves.tsx +57 -22
- package/components/SessionList/MoveToGroupMenu.test.ts +77 -0
- package/components/SessionList/SessionRow.tsx +12 -1
- package/components/SessionList/SessionRowMenu.tsx +6 -0
- package/components/SessionList/SidebarContextMenu.test.ts +21 -1
- package/components/SessionList/SidebarContextMenu.tsx +33 -9
- package/components/SessionList/index.tsx +11 -2
- package/components/SessionList/useGroupDrag.ts +83 -0
- package/components/Sessions/RolePill.tsx +7 -0
- package/components/Tasks/Loop/LoopButton.tsx +74 -0
- package/components/Tasks/Loop/LoopSetup.tsx +146 -0
- package/components/Tasks/Loop/LoopView.tsx +350 -0
- package/components/Tasks/Loop/labels.ts +17 -0
- package/components/Tasks/TaskRow.tsx +2 -0
- package/components/Workspaces/WorkspaceModeForm.tsx +22 -0
- package/components/Workspaces/WorkspaceSettings.tsx +2 -0
- package/components/ui/segmented.tsx +55 -0
- package/components/ui/status-pill.tsx +3 -0
- package/contexts/PaneContext.tsx +21 -1
- package/data/exports/queries.ts +11 -0
- package/data/loops/index.ts +3 -0
- package/data/loops/keys.ts +4 -0
- package/data/loops/mutations.ts +68 -0
- package/data/loops/queries.ts +40 -0
- package/data/push/topics.ts +6 -0
- package/data/reports/index.ts +115 -0
- package/lib/agents/brief.ts +1 -1
- package/lib/analyst/forward.ts +1 -1
- package/lib/db/changes.ts +7 -0
- package/lib/db/migrations/20261021T1600_task_loops.ts +81 -0
- package/lib/db/migrations/20261021T1800_health_reports.ts +38 -0
- package/lib/done/index.ts +2 -0
- package/lib/drafts.ts +2 -0
- package/lib/export/markdown.ts +7 -1
- package/lib/export/turn.ts +48 -0
- package/lib/health/config.ts +2 -0
- package/lib/health/env/classes.ts +14 -1
- package/lib/health/port-wait-tick.ts +222 -0
- package/lib/health/port-wait.ts +160 -0
- package/lib/health/tick.ts +9 -2
- package/lib/health/types.ts +2 -0
- package/lib/loops/analyse.ts +46 -0
- package/lib/loops/analyst-prompt.ts +203 -0
- package/lib/loops/checkCriteria.ts +114 -0
- package/lib/loops/compactEvidence.ts +140 -0
- package/lib/loops/controls.ts +317 -0
- package/lib/loops/decideStop.ts +113 -0
- package/lib/loops/deps.ts +128 -0
- package/lib/loops/diffMap.ts +39 -0
- package/lib/loops/draftCriteria.ts +71 -0
- package/lib/loops/gatherEvidence.ts +265 -0
- package/lib/loops/hooks.ts +40 -0
- package/lib/loops/index.ts +7 -0
- package/lib/loops/route.ts +83 -0
- package/lib/loops/runCycle.ts +323 -0
- package/lib/loops/screenInstruction.ts +59 -0
- package/lib/loops/sendInstruction.ts +83 -0
- package/lib/loops/snapshot.ts +38 -0
- package/lib/loops/stopLoop.ts +86 -0
- package/lib/loops/store.ts +481 -0
- package/lib/loops/summary.ts +27 -0
- package/lib/loops/tickLoops.ts +141 -0
- package/lib/loops/types.ts +223 -0
- package/lib/loops/world.test-helpers.ts +223 -0
- package/lib/models/plan-step.ts +4 -1
- package/lib/orchestrator/digest.ts +2 -1
- package/lib/orchestrator/loop-guard.ts +5 -2
- package/lib/orchestrator/pr-wake.ts +4 -0
- package/lib/orchestrator/watcher.ts +8 -1
- package/lib/panes.ts +52 -0
- package/lib/plans/acceptance.ts +23 -0
- package/lib/{ports.ts → ports/allocatePorts.ts} +30 -7
- package/lib/ports/ensurePorts.ts +138 -0
- package/lib/ports/findHardcodedPorts.ts +116 -0
- package/lib/ports/index.ts +15 -0
- package/lib/ports/listListeners.ts +134 -0
- package/lib/ports/reassignPort.ts +45 -0
- package/lib/ports/types.ts +62 -0
- package/lib/ports/whoHolds.ts +155 -0
- package/lib/project-config/brief.ts +4 -2
- package/lib/project-config/session.ts +19 -3
- package/lib/reports/drafts.ts +87 -0
- package/lib/reports/end-hook.ts +17 -0
- package/lib/reports/estimate.ts +107 -0
- package/lib/reports/evidence/build.ts +193 -0
- package/lib/reports/evidence/gather.ts +229 -0
- package/lib/reports/fixtures.ts +17 -0
- package/lib/reports/generate.ts +159 -0
- package/lib/reports/hooks.ts +30 -0
- package/lib/reports/mode.ts +65 -0
- package/lib/reports/model.ts +115 -0
- package/lib/reports/read.ts +26 -0
- package/lib/reports/store.ts +180 -0
- package/lib/reports/template.ts +117 -0
- package/lib/reports/types.ts +135 -0
- package/lib/reports/validate.ts +142 -0
- package/lib/sidebar/groupDrop.ts +36 -0
- package/lib/sidebar/row-menu.ts +9 -0
- package/lib/tasks/contract/routes.ts +5 -0
- package/lib/tasks/contract/types.ts +3 -0
- package/lib/tasks/finish.ts +2 -0
- package/lib/tasks/move-carry.ts +1 -0
- package/lib/windows-ports.ts +36 -18
- package/package.json +2 -2
- package/stores/analystUi.ts +19 -0
package/lib/windows-ports.ts
CHANGED
|
@@ -16,45 +16,55 @@ const execFileAsync = promisify(execFile);
|
|
|
16
16
|
const TTL_MS = 3000;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Listening ports in `netstat.exe -ano -p TCP` output
|
|
20
|
-
* wildcard peer (0.0.0.0:0 or [::]:0), which
|
|
21
|
-
* the state column ("LISTENING") is
|
|
19
|
+
* Listening ports in `netstat.exe -ano -p TCP` output, each with the pid
|
|
20
|
+
* that holds it. A listener has a wildcard peer (0.0.0.0:0 or [::]:0), which
|
|
21
|
+
* holds in every Windows locale; the state column ("LISTENING") is
|
|
22
|
+
* translated.
|
|
22
23
|
*/
|
|
23
|
-
export function
|
|
24
|
-
const
|
|
24
|
+
export function parseNetstatOwners(out: string): Map<number, number | null> {
|
|
25
|
+
const owners = new Map<number, number | null>();
|
|
25
26
|
for (const line of out.split(/\r?\n/)) {
|
|
26
27
|
const cols = line.trim().split(/\s+/);
|
|
27
28
|
if (cols.length < 4 || cols[0].toUpperCase() !== "TCP") continue;
|
|
28
29
|
const [, local, peer] = cols;
|
|
29
30
|
if (!/^(0\.0\.0\.0|\[::\]):0$/.test(peer)) continue;
|
|
30
31
|
const port = Number(local.slice(local.lastIndexOf(":") + 1));
|
|
31
|
-
|
|
32
|
+
const pid = Number(cols[cols.length - 1]);
|
|
33
|
+
if (Number.isInteger(port) && port > 0 && !owners.has(port))
|
|
34
|
+
owners.set(port, Number.isInteger(pid) && pid > 0 ? pid : null);
|
|
32
35
|
}
|
|
33
|
-
return
|
|
36
|
+
return owners;
|
|
34
37
|
}
|
|
35
38
|
|
|
39
|
+
export const parseNetstatListeners = (out: string): Set<number> =>
|
|
40
|
+
new Set(parseNetstatOwners(out).keys());
|
|
41
|
+
|
|
36
42
|
type Run = (file: string, args: string[]) => Promise<string>;
|
|
37
43
|
|
|
38
44
|
const defaultRun: Run = async (file, args) =>
|
|
39
45
|
(await execFileAsync(file, args, { timeout: 4000, maxBuffer: 8 << 20 }))
|
|
40
46
|
.stdout;
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
let inflight: Promise<Set<number> | null> | undefined;
|
|
48
|
+
type Owners = Map<number, number | null>;
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
let cache: { at: number; owners: Owners | null } | undefined;
|
|
51
|
+
let inflight: Promise<Owners | null> | undefined;
|
|
52
|
+
|
|
53
|
+
type Opts = { wsl?: number; run?: Run; now?: number };
|
|
54
|
+
|
|
55
|
+
/** Windows' listening ports and their pids, or null when unknown (not WSL 2, or it failed). */
|
|
56
|
+
export async function windowsListeners(
|
|
57
|
+
opts: Opts = {}
|
|
58
|
+
): Promise<Owners | null> {
|
|
49
59
|
if ((opts.wsl ?? wslVersion()) !== 2) return null;
|
|
50
60
|
const now = opts.now ?? Date.now();
|
|
51
|
-
if (cache && now - cache.at < TTL_MS) return cache.
|
|
61
|
+
if (cache && now - cache.at < TTL_MS) return cache.owners;
|
|
52
62
|
inflight ??= (opts.run ?? defaultRun)("netstat.exe", ["-ano", "-p", "TCP"])
|
|
53
|
-
.then((out) =>
|
|
63
|
+
.then((out) => parseNetstatOwners(out))
|
|
54
64
|
.catch(() => null)
|
|
55
|
-
.then((
|
|
56
|
-
cache = { at: now,
|
|
57
|
-
return
|
|
65
|
+
.then((owners) => {
|
|
66
|
+
cache = { at: now, owners };
|
|
67
|
+
return owners;
|
|
58
68
|
})
|
|
59
69
|
.finally(() => {
|
|
60
70
|
inflight = undefined;
|
|
@@ -62,6 +72,14 @@ export async function windowsListeningPorts(
|
|
|
62
72
|
return inflight;
|
|
63
73
|
}
|
|
64
74
|
|
|
75
|
+
/** The ports Windows listens on, or null when unknown (not WSL 2, or it failed). */
|
|
76
|
+
export async function windowsListeningPorts(
|
|
77
|
+
opts: Opts = {}
|
|
78
|
+
): Promise<Set<number> | null> {
|
|
79
|
+
const owners = await windowsListeners(opts);
|
|
80
|
+
return owners ? new Set(owners.keys()) : null;
|
|
81
|
+
}
|
|
82
|
+
|
|
65
83
|
export function resetWindowsPortsCache() {
|
|
66
84
|
cache = undefined;
|
|
67
85
|
inflight = undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saadnvd1/agent-os",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.731",
|
|
4
4
|
"description": "Self-hosted web UI for managing Claude Code sessions",
|
|
5
5
|
"bin": {
|
|
6
6
|
"agent-os": "scripts/agent-os"
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"mdast-util-from-markdown": "^2.1.0",
|
|
134
134
|
"mdast-util-gfm": "^3.1.0",
|
|
135
135
|
"mdast-util-to-markdown": "^2.2.0",
|
|
136
|
-
"mermaid": "^
|
|
136
|
+
"mermaid": "^12.2.0",
|
|
137
137
|
"micromark-extension-gfm": "^3.0.0",
|
|
138
138
|
"monaco-editor": "^0.57.0",
|
|
139
139
|
"next": "^16.3.8",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { proxy } from "valtio";
|
|
2
|
+
|
|
3
|
+
// The Add analyst sheet: the chat it pairs with, and the pane to open the
|
|
4
|
+
// analyst beside.
|
|
5
|
+
export const analystUi = proxy<{
|
|
6
|
+
open: boolean;
|
|
7
|
+
sessionId: string | null;
|
|
8
|
+
name: string;
|
|
9
|
+
paneId: string | null;
|
|
10
|
+
}>({ open: false, sessionId: null, name: "", paneId: null });
|
|
11
|
+
|
|
12
|
+
export const analystUiActions = {
|
|
13
|
+
open(sessionId: string, name: string, paneId: string | null = null) {
|
|
14
|
+
Object.assign(analystUi, { open: true, sessionId, name, paneId });
|
|
15
|
+
},
|
|
16
|
+
close() {
|
|
17
|
+
analystUi.open = false;
|
|
18
|
+
},
|
|
19
|
+
};
|