Line

ui/server/src/devActivity

Is an agent or model working on Construct itself on this machine right now?

Cockpit server, v0.9. Source: ui/server/src/devActivity.mjs.

Variables#

ACTIVE_WINDOW_MS#

const ACTIVE_WINDOW_MS: 60000 = 60_000

Defined in: ui/server/src/devActivity.mjs:17

How recently a transcript must have been written to count as "working".

Functions#

createDevActivity()#

createDevActivity(__namedParameters): () => { active: boolean; available: boolean; newestAgeMs?: undefined; ok: boolean; sessions?: undefined; } | { active: any; available: any; newestAgeMs: any; ok: boolean; sessions: any; }

Defined in: ui/server/src/devActivity.mjs:77

The route's handler: answers from a 2 s cache so a few open tabs cost one directory scan, and available: false where it is off.

Parameters#

__namedParameters
enabled

any

now?

() => number = Date.now

projectsDir

any

repoRoot

any

Returns#

() => { active: boolean; available: boolean; newestAgeMs?: undefined; ok: boolean; sessions?: undefined; } | { active: any; available: any; newestAgeMs: any; ok: boolean; sessions: any; }


createDevStatusRouter()#

createDevStatusRouter(o): any

Defined in: ui/server/src/devActivity.mjs:97

The public status API: GET /api/dev-status -> { ok, available, active }, and nothing else (no counts, no ages, no paths). Read-only and answerable to anyone, because the docs site's logo reads it from a visitor's browser, so it carries CORS * (no credentials, no cookies) and is mounted BEFORE the session gate. It says available: false unless the server is on the machine where the framework is built and has been told so (enabled). Mutating verbs are not routed at all.

Parameters#

o
read

() => object

the handler from createDevActivity

Returns#

any


projectSlug()#

projectSlug(dir): any

Defined in: ui/server/src/devActivity.mjs:23

Claude Code names a project's folder after its path with separators and dots turned into dashes.

Parameters#

dir

any

Returns#

any


readDevActivity()#

readDevActivity(o): object

Defined in: ui/server/src/devActivity.mjs:33

Parameters#

o
now?

number = ...

a test seam

projectsDir?

string = ...

where the agent transcripts live (a test seam; default ~/.claude/projects)

repoRoot

string

the framework's own checkout (its slug picks which sessions count)

windowMs?

number = ACTIVE_WINDOW_MS

Returns#

object

active

active: boolean

available

available: boolean

newestAgeMs

newestAgeMs: number

sessions

sessions: number