API reference
components/activity-line
Import
Section titled “Import”import * as api from "@fungi.computer/caps/components/activity-line";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | ActivityState | Where a piece of agent work stands. |
| type alias | ActivityLineProps | Props accepted by ActivityLine. |
| function | formatElapsed() | Short elapsed time: 0.4s, 4.2s, 42s, 3m 05s. |
| function | useElapsed() | A clock that ticks while running and holds still otherwise. Times are epoch
milliseconds (Date.now()), owned by the caller. |
| function | ActivityLine() | One line of agent activity. While running it says what is happening with a live clock and shows its trace; when done it settles into “Thought for 4.2s” and folds the trace away, one click from reopening. |
ActivityStatetype alias
Section titled “ActivityState”type ActivityState = "running" | "done" | "failed";Where a piece of agent work stands.
ActivityLinePropstype alias
Section titled “ActivityLineProps”type ActivityLineProps = Readonly<{ state: ActivityState; startedAt: number; finishedAt?: number; label: string; doneLabel: string; failedLabel?: string; children?: ReactNode; className?: string;}>;Props accepted by ActivityLine.
formatElapsed()function
Section titled “formatElapsed()”function formatElapsed(milliseconds): string;Short elapsed time: 0.4s, 4.2s, 42s, 3m 05s.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
milliseconds |
number |
Returns
Section titled “Returns”string
useElapsed()function
Section titled “useElapsed()”function useElapsed(startedAt, finishedAt, running): number;A clock that ticks while running and holds still otherwise. Times are epoch
milliseconds (Date.now()), owned by the caller.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
startedAt |
number |
finishedAt |
number | undefined |
running |
boolean |
Returns
Section titled “Returns”number
ActivityLine()function
Section titled “ActivityLine()”function ActivityLine(__namedParameters): Element;One line of agent activity. While running it says what is happening with a live clock and shows its trace; when done it settles into “Thought for 4.2s” and folds the trace away, one click from reopening.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
ActivityLineProps |
Returns
Section titled “Returns”Element