ionbase-ui 0.73.0 → 0.76.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.
Files changed (36) hide show
  1. package/dist/components/Chart.d.ts +95 -0
  2. package/dist/components/Chart.d.ts.map +1 -0
  3. package/dist/components/Chart.js +60 -0
  4. package/dist/components/Chart.js.map +1 -0
  5. package/dist/components/NavItem.d.ts +7 -0
  6. package/dist/components/NavItem.d.ts.map +1 -1
  7. package/dist/components/NavItem.js +3 -1
  8. package/dist/components/NavItem.js.map +1 -1
  9. package/dist/components/agent-run.d.ts +147 -0
  10. package/dist/components/agent-run.d.ts.map +1 -0
  11. package/dist/components/agent-run.js +250 -0
  12. package/dist/components/agent-run.js.map +1 -0
  13. package/dist/components/index.d.ts +6 -0
  14. package/dist/components/index.d.ts.map +1 -1
  15. package/dist/components/index.js +14 -0
  16. package/dist/components/index.js.map +1 -1
  17. package/dist/components/use-agent-run.d.ts +65 -0
  18. package/dist/components/use-agent-run.d.ts.map +1 -0
  19. package/dist/components/use-agent-run.js +127 -0
  20. package/dist/components/use-agent-run.js.map +1 -0
  21. package/dist/figma-descriptions.json +76 -66
  22. package/dist/figma-map.json +98 -4
  23. package/dist/meta/ChartLegend.json +125 -0
  24. package/dist/meta/ChartTooltip.json +126 -0
  25. package/dist/meta/NavItem.json +17 -3
  26. package/dist/meta/components.json +282 -4
  27. package/dist/meta/contrast.json +528 -0
  28. package/dist/meta/index.json +33 -1
  29. package/dist/meta/patterns/AgentRun.json +14 -0
  30. package/dist/meta/patterns/HumanApproval.json +4 -0
  31. package/dist/meta/patterns/index.json +3 -1
  32. package/dist/styles/chart.css +275 -0
  33. package/dist/styles/index.css +1 -0
  34. package/dist/styles/nav-item.css +37 -2
  35. package/llms.txt +11 -3
  36. package/package.json +1 -1
@@ -0,0 +1,95 @@
1
+ import React from 'react';
2
+ /**
3
+ * Chart parts for charts drawn with visx.
4
+ *
5
+ * IonBase does not draw charts, and does not depend on visx. visx owns scales,
6
+ * shapes and layout; these own what a chart looks like and the two pieces
7
+ * every chart needs and no charting library supplies — a tooltip panel and a
8
+ * legend. See `styles/chart.css` for the classes, and why they are classes.
9
+ */
10
+ /** Which of `--chart-1…8` a series takes. Series are coloured in order. */
11
+ export type ChartSeries = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
12
+ /** The class that colours a series: its line, bar, area, points and swatch. */
13
+ export declare const chartSeriesClass: (series: ChartSeries) => string;
14
+ /**
15
+ * Spread onto visx `AxisLeft` / `AxisBottom` / `Axis`. Themes the axis line,
16
+ * tick marks and tick labels through `chart.css`, overriding the `#222` visx
17
+ * writes as attributes.
18
+ *
19
+ * <AxisBottom scale={x} top={h} {...chartAxisProps} />
20
+ *
21
+ * Passing your own `tickLabelProps` replaces this one — keep
22
+ * `className: 'ion-chart__tick'` in it.
23
+ */
24
+ export declare const chartAxisProps: {
25
+ axisLineClassName: string;
26
+ tickClassName: string;
27
+ labelClassName: string;
28
+ tickLabelProps: {
29
+ className: string;
30
+ };
31
+ };
32
+ /**
33
+ * Spread onto visx `GridRows` / `GridColumns`. Gridlines take `border/subtle`,
34
+ * the quietest rule, so they sit behind the data rather than competing with it.
35
+ */
36
+ export declare const chartGridProps: {
37
+ className: string;
38
+ };
39
+ /**
40
+ * Spread onto visx `Tooltip` / `TooltipWithBounds` / `TooltipInPortal`, with a
41
+ * `ChartTooltip` inside. visx then only positions it; the panel is ours.
42
+ */
43
+ export declare const chartTooltipProps: {
44
+ unstyled: boolean;
45
+ applyPositionStyle: boolean;
46
+ };
47
+ export interface ChartTooltipRow {
48
+ /** The series or measure, e.g. "Success rate". */
49
+ label: React.ReactNode;
50
+ /** Already formatted — the tooltip cannot know the unit or precision. */
51
+ value: React.ReactNode;
52
+ /** Shows the series' swatch beside the label, matching the legend. */
53
+ series?: ChartSeries;
54
+ }
55
+ export interface ChartTooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
56
+ /** What the pointer is over — usually the x value, e.g. a date. */
57
+ title?: React.ReactNode;
58
+ /** One row per series at that point. */
59
+ rows?: ChartTooltipRow[];
60
+ /** Free content after the rows, for anything that is not label/value. */
61
+ children?: React.ReactNode;
62
+ }
63
+ /**
64
+ * ChartTooltip — the panel that shows the values under the pointer.
65
+ *
66
+ * Put it inside visx's Tooltip with `chartTooltipProps`, so visx places it and
67
+ * this draws it: raised, rimmed and shadowed like Popover and Toast.
68
+ *
69
+ * IT IS NOT THE ACCESSIBLE WAY TO THE DATA. It appears on hover, so a keyboard
70
+ * or screen-reader user never sees it. Every chart still needs a text summary
71
+ * and the values in a table (visually hidden is fine) — the tooltip is a
72
+ * convenience for pointer users, never the only route to a number.
73
+ */
74
+ export declare const ChartTooltip: React.ForwardRefExoticComponent<ChartTooltipProps & React.RefAttributes<HTMLDivElement>>;
75
+ export type ChartLegendShape = 'square' | 'line';
76
+ export interface ChartLegendItem {
77
+ label: React.ReactNode;
78
+ series: ChartSeries;
79
+ }
80
+ export interface ChartLegendProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'children'> {
81
+ /** One per series, in the order the series are drawn. */
82
+ items: ChartLegendItem[];
83
+ /** `square` for bars and areas, `line` for line charts. */
84
+ shape?: ChartLegendShape;
85
+ }
86
+ /**
87
+ * ChartLegend — which colour is which series.
88
+ *
89
+ * Colour alone never identifies a series (SC 1.4.1), so any chart with more
90
+ * than one series needs this, or direct labels on the lines. The swatch reads
91
+ * the same `--chart-<n>` as the series itself, through `chartSeriesClass`, so
92
+ * the two cannot drift apart.
93
+ */
94
+ export declare const ChartLegend: React.ForwardRefExoticComponent<ChartLegendProps & React.RefAttributes<HTMLUListElement>>;
95
+ //# sourceMappingURL=Chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../src/components/Chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C;;;;;;;GAOG;AAEH,2EAA2E;AAC3E,MAAM,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C3D,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,2FAuBvB,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ /** The class that colours a series: its line, bar, area, points and swatch. */
4
+ export const chartSeriesClass = (series) => `ion-chart-series-${series}`;
5
+ /**
6
+ * Spread onto visx `AxisLeft` / `AxisBottom` / `Axis`. Themes the axis line,
7
+ * tick marks and tick labels through `chart.css`, overriding the `#222` visx
8
+ * writes as attributes.
9
+ *
10
+ * <AxisBottom scale={x} top={h} {...chartAxisProps} />
11
+ *
12
+ * Passing your own `tickLabelProps` replaces this one — keep
13
+ * `className: 'ion-chart__tick'` in it.
14
+ */
15
+ export const chartAxisProps = {
16
+ axisLineClassName: 'ion-chart__axis-line',
17
+ tickClassName: 'ion-chart__axis-tick',
18
+ labelClassName: 'ion-chart__axis-label',
19
+ tickLabelProps: { className: 'ion-chart__tick' },
20
+ };
21
+ /**
22
+ * Spread onto visx `GridRows` / `GridColumns`. Gridlines take `border/subtle`,
23
+ * the quietest rule, so they sit behind the data rather than competing with it.
24
+ */
25
+ export const chartGridProps = {
26
+ className: 'ion-chart__grid',
27
+ };
28
+ /**
29
+ * Spread onto visx `Tooltip` / `TooltipWithBounds` / `TooltipInPortal`, with a
30
+ * `ChartTooltip` inside. visx then only positions it; the panel is ours.
31
+ */
32
+ export const chartTooltipProps = {
33
+ unstyled: true,
34
+ applyPositionStyle: true,
35
+ };
36
+ const cx = (...c) => c.filter(Boolean).join(' ');
37
+ /**
38
+ * ChartTooltip — the panel that shows the values under the pointer.
39
+ *
40
+ * Put it inside visx's Tooltip with `chartTooltipProps`, so visx places it and
41
+ * this draws it: raised, rimmed and shadowed like Popover and Toast.
42
+ *
43
+ * IT IS NOT THE ACCESSIBLE WAY TO THE DATA. It appears on hover, so a keyboard
44
+ * or screen-reader user never sees it. Every chart still needs a text summary
45
+ * and the values in a table (visually hidden is fine) — the tooltip is a
46
+ * convenience for pointer users, never the only route to a number.
47
+ */
48
+ export const ChartTooltip = forwardRef(({ title, rows, children, className, ...rest }, ref) => (_jsxs("div", { ...rest, ref: ref, className: cx('ion-chart-tooltip', className), children: [title != null && _jsx("div", { className: "ion-chart-tooltip__title", children: title }), rows && rows.length > 0 && (_jsx("dl", { className: "ion-chart-tooltip__rows", children: rows.map((row, i) => (_jsxs("div", { className: "ion-chart-tooltip__row", children: [_jsxs("dt", { className: cx('ion-chart-tooltip__label', row.series && chartSeriesClass(row.series)), children: [row.series && (_jsx("span", { className: "ion-chart-swatch", "aria-hidden": "true" })), row.label] }), _jsx("dd", { className: "ion-chart-tooltip__value", children: row.value })] }, i))) })), children] })));
49
+ ChartTooltip.displayName = 'ChartTooltip';
50
+ /**
51
+ * ChartLegend — which colour is which series.
52
+ *
53
+ * Colour alone never identifies a series (SC 1.4.1), so any chart with more
54
+ * than one series needs this, or direct labels on the lines. The swatch reads
55
+ * the same `--chart-<n>` as the series itself, through `chartSeriesClass`, so
56
+ * the two cannot drift apart.
57
+ */
58
+ export const ChartLegend = forwardRef(({ items, shape = 'square', className, ...rest }, ref) => (_jsx("ul", { ...rest, ref: ref, className: cx('ion-chart-legend', className), children: items.map((item, i) => (_jsxs("li", { className: cx('ion-chart-legend__item', chartSeriesClass(item.series)), children: [_jsx("span", { className: cx('ion-chart-swatch', shape === 'line' && 'ion-chart-swatch--line'), "aria-hidden": "true" }), item.label] }, i))) })));
59
+ ChartLegend.displayName = 'ChartLegend';
60
+ //# sourceMappingURL=Chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chart.js","sourceRoot":"","sources":["../../src/components/Chart.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAc1C,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAmB,EAAE,EAAE,CACtD,o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3C,aAEA,GAAG,CAAC,MAAM,IAAI,CACb,eAAM,SAAS,EAAC,kBAAkB,iBAAa,MAAM,GAAG,CACzD,EACA,GAAG,CAAC,KAAK,IACP,EACL,aAAI,SAAS,EAAC,0BAA0B,YAAE,GAAG,CAAC,KAAK,GAAM,KAZjD,CAAC,CAaL,CACP,CAAC,GACC,CACN,EACA,QAAQ,IACL,CACP,CACF,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAqB1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACxD,gBAAQ,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,YACjE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,cAEE,SAAS,EAAE,EAAE,CACX,wBAAwB,EACxB,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAC9B,aAED,eACE,SAAS,EAAE,EAAE,CACX,kBAAkB,EAClB,KAAK,KAAK,MAAM,IAAI,wBAAwB,CAC7C,iBACW,MAAM,GAClB,EACD,IAAI,CAAC,KAAK,KAbN,CAAC,CAcH,CACN,CAAC,GACC,CACN,CACF,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC"}
@@ -4,6 +4,13 @@ interface NavItemOwnProps {
4
4
  icon?: React.ReactNode;
5
5
  /** Figma's `Show Chevron`. Set on a nav item that opens a menu, not a plain link. */
6
6
  showChevron?: boolean;
7
+ /**
8
+ * The page the user is on. Marks the item `aria-current="page"` and draws
9
+ * the same indicator Tabs' underline does — so a section switcher built from
10
+ * NavItems says where you are, in words for a screen reader and in more than
11
+ * colour for everyone else.
12
+ */
13
+ isCurrent?: boolean;
7
14
  isDisabled?: boolean;
8
15
  /**
9
16
  * @deprecated Use `isDisabled`. Accepted as an alias for one minor version.
@@ -1 +1 @@
1
- {"version":3,"file":"NavItem.d.ts","sourceRoot":"","sources":["../../src/components/NavItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAmBvE,UAAU,eAAe;IACvB,sDAAsD;IACtD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,qFAAqF;IACrF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,YAAY,GAAG,eAAe,GACxC,CACI,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CACtB,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,MAAM,eAAe,CACtB,CAAC,GACF,CAAC;IAAE,IAAI,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,IAAI,CAC1B,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,MAAM,eAAe,GAAG,MAAM,CAC/B,CAAC,CACL,CAAC;AAEJ;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,4GA+GlB,CAAC"}
1
+ {"version":3,"file":"NavItem.d.ts","sourceRoot":"","sources":["../../src/components/NavItem.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAmBvE,UAAU,eAAe;IACvB,sDAAsD;IACtD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,qFAAqF;IACrF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,YAAY,GAAG,eAAe,GACxC,CACI,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CACtB,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,MAAM,eAAe,CACtB,CAAC,GACF,CAAC;IAAE,IAAI,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,IAAI,CAC1B,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,MAAM,eAAe,GAAG,MAAM,CAC/B,CAAC,CACL,CAAC;AAEJ;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,4GAkHlB,CAAC"}
@@ -20,7 +20,7 @@ const Chevron = () => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", "aria-h
20
20
  * `:focus-visible` rules so the stylesheet still works without React.
21
21
  */
22
22
  export const NavItem = forwardRef((props, forwardedRef) => {
23
- const { icon, showChevron, isDisabled: isDisabledProp, disabled, children, className, href, ...rest } = props;
23
+ const { icon, showChevron, isCurrent, isDisabled: isDisabledProp, disabled, children, className, href, ...rest } = props;
24
24
  const isDisabled = resolveDisabled(isDisabledProp, disabled);
25
25
  const domRef = useRef(null);
26
26
  useImperativeHandle(forwardedRef, () => domRef.current);
@@ -28,6 +28,7 @@ export const NavItem = forwardRef((props, forwardedRef) => {
28
28
  const { focusProps, isFocusVisible } = useFocusRing();
29
29
  const classNames = [
30
30
  'ion-nav-item',
31
+ isCurrent ? 'ion-nav-item--current' : '',
31
32
  isDisabled ? 'ion-nav-item--disabled' : '',
32
33
  className || '',
33
34
  ]
@@ -37,6 +38,7 @@ export const NavItem = forwardRef((props, forwardedRef) => {
37
38
  'data-hovered': isHovered || undefined,
38
39
  'data-focused': isFocusVisible || undefined,
39
40
  'data-disabled': isDisabled || undefined,
41
+ 'aria-current': isCurrent ? 'page' : undefined,
40
42
  };
41
43
  const content = (_jsxs(_Fragment, { children: [icon && (_jsx("span", { className: "ion-nav-item__icon", "aria-hidden": "true", children: icon })), children, showChevron && (_jsx("span", { className: "ion-nav-item__chevron", "aria-hidden": "true", children: _jsx(Chevron, {}) }))] }));
42
44
  if (href !== undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"NavItem.js","sourceRoot":"","sources":["../../src/components/NavItem.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,UAAU,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;iDAEiD;AACjD,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CACpB,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,iBAAa,MAAM,EAAC,SAAS,EAAC,OAAO,YACvE,eACE,CAAC,EAAC,cAAc,EAChB,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,GACE,CACP,CAAC;AA4BF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAG/B,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE;IACxB,MAAM,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EAAE,cAAc,EAC1B,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,GAAG,IAAI,EACR,GAAG,KAA4C,CAAC;IAEjD,MAAM,UAAU,GAAG,eAAe,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IAE7D,MAAM,MAAM,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AAuB,iBAAa,MAAM,YACxD,KAAC,OAAO,KAAG,GACN,CACR,IACA,CACJ,CAAC;IAEF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB;;;;;WAKG;QACH,MAAM,EACJ,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,WAAW,EACX,SAAS,EACT,OAAO,EACP,GAAG,UAAU,EACd,GAAG,IAAqD,CAAC;QAE1D,OAAO,CACL,eACM,UAAU,KACV,CAAC,UAAU;gBACb,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACE,OAAO;oBACP,WAAW;oBACX,SAAS;oBACT,aAAa;oBACb,WAAW;oBACX,SAAS;oBACT,OAAO;iBACR,CAAC,KACF,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,KAClC,eAAe,EACnB,GAAG,EAAE,MAAsC,EAC3C,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,mBACpB,UAAU,IAAI,SAAS,EACtC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EACrC,SAAS,EAAE,UAAU,YAEpB,OAAO,GACN,CACL,CAAC;IACJ,CAAC;IAED,OAAO,CACL,oBACO,IAAsD,KACvD,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,KAClC,eAAe,EACnB,GAAG,EAAE,MAAsC,EAC3C,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,UAAU,YAEpB,OAAO,GACD,CACV,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC"}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Agent run state, as a reducer over events.
3
+ *
4
+ * AgentActivity, ApprovalGate, StreamingText and AgentStop each render one
5
+ * state well, and none of them knows about the others. What turns "the agent
6
+ * started step 3" into the right props on all four — one step active at a
7
+ * time, a stopped run keeping what it did, an unanswered approval never
8
+ * counting as a yes — was left to every product, and every product got a
9
+ * different edge wrong. This file is that logic, once.
10
+ *
11
+ * It is plain data in, plain data out: no React, no timers. The same events
12
+ * drive a live run (from a stream, a socket, a poll) and a recorded one
13
+ * (`replayAgentRun`), and `agentRunFrom` rebuilds a finished run for a history
14
+ * page without playing it. `useAgentRun` wraps it for components.
15
+ *
16
+ * Events are JSON-serialisable on purpose, so a recording can be stored as a
17
+ * run log and a backend can emit them as-is.
18
+ */
19
+ /** Where a run is. The last four are ends; nothing changes a run after one. */
20
+ export type AgentRunPhase = 'idle' | 'running' | 'awaiting' | 'finished' | 'failed' | 'stopped' | 'expired';
21
+ /** The same five statuses AgentActivityStep and ToolCall take. */
22
+ export type AgentRunStepStatus = 'pending' | 'active' | 'done' | 'failed' | 'skipped';
23
+ export interface AgentRunStep {
24
+ id: string;
25
+ status: AgentRunStepStatus;
26
+ label?: string;
27
+ /** Why it failed, from `step-failed`. */
28
+ error?: string;
29
+ /** Whether it ever began. A planned step the run never reached is not in `log`. */
30
+ started: boolean;
31
+ }
32
+ export interface AgentRunApproval {
33
+ /** The step the approval belongs to. */
34
+ stepId: string;
35
+ status: 'pending' | 'approved' | 'rejected' | 'expired';
36
+ /** What happened, in words — ApprovalGate's `resolution`. */
37
+ resolution?: string;
38
+ /** A decision is on its way to the server. */
39
+ isSubmitting: boolean;
40
+ /** The decision did not arrive. The approval is still pending. */
41
+ error?: string;
42
+ }
43
+ export interface AgentRunState {
44
+ phase: AgentRunPhase;
45
+ /** Every step known so far, in the order it was planned or started. */
46
+ steps: AgentRunStep[];
47
+ /** The latest approval, or null if the run has not asked for one. */
48
+ approval: AgentRunApproval | null;
49
+ output: string;
50
+ isStreaming: boolean;
51
+ /** Stop was requested and the run has not confirmed it yet. */
52
+ isStopping: boolean;
53
+ /** From `run-failed`, when the failure is the run's and not one step's. */
54
+ error?: string;
55
+ }
56
+ /**
57
+ * What a run reports. A producer — a backend stream, a script, a recording —
58
+ * emits these; it never computes a status itself.
59
+ */
60
+ export type AgentRunEvent =
61
+ /** Optionally with the plan, so later steps can be listed as not done. */
62
+ {
63
+ type: 'run-started';
64
+ steps?: {
65
+ id: string;
66
+ label?: string;
67
+ }[];
68
+ } | {
69
+ type: 'step-started';
70
+ id: string;
71
+ label?: string;
72
+ } | {
73
+ type: 'step-done';
74
+ id: string;
75
+ } | {
76
+ type: 'step-failed';
77
+ id: string;
78
+ error?: string;
79
+ } | {
80
+ type: 'step-skipped';
81
+ id: string;
82
+ } | {
83
+ type: 'approval-requested';
84
+ id: string;
85
+ } | {
86
+ type: 'approval-resolved';
87
+ id: string;
88
+ decision: 'approved' | 'rejected' | 'expired';
89
+ resolution?: string;
90
+ }
91
+ /** A chunk of output, appended. */
92
+ | {
93
+ type: 'output';
94
+ text: string;
95
+ } | {
96
+ type: 'output-done';
97
+ } | {
98
+ type: 'run-finished';
99
+ } | {
100
+ type: 'run-failed';
101
+ error?: string;
102
+ }
103
+ /** `resolution` explains an approval the stop left undecided. */
104
+ | {
105
+ type: 'run-stopped';
106
+ resolution?: string;
107
+ } | {
108
+ type: 'stop-requested';
109
+ } | {
110
+ type: 'stop-failed';
111
+ } | {
112
+ type: 'reset';
113
+ } | {
114
+ type: 'decision-submitted';
115
+ id: string;
116
+ } | {
117
+ type: 'decision-failed';
118
+ id: string;
119
+ error: string;
120
+ };
121
+ export declare const initialAgentRunState: AgentRunState;
122
+ /** Whether the run has reached an end — finished, failed, stopped or expired. */
123
+ export declare const agentRunHasEnded: (state: AgentRunState) => boolean;
124
+ /**
125
+ * The whole policy. Every rule here is one the AgentRun or HumanApproval
126
+ * pattern states; the comment says which.
127
+ */
128
+ export declare function agentRunReducer(state: AgentRunState, event: AgentRunEvent): AgentRunState;
129
+ /** A finished run rebuilt from its events, without playing it — for a history page. */
130
+ export declare const agentRunFrom: (events: AgentRunEvent[]) => AgentRunState;
131
+ /** Steps that began, in order — what AgentActivity lists. Never planned-but-unreached ones. */
132
+ export declare const agentRunLog: (state: AgentRunState) => AgentRunStep[];
133
+ /** A recording: each event with the milliseconds to wait before it. */
134
+ export type AgentRunRecording = {
135
+ delay: number;
136
+ event: AgentRunEvent;
137
+ }[];
138
+ export interface ReplayAgentRunOptions {
139
+ /** 2 plays twice as fast. Default 1. */
140
+ speed?: number;
141
+ }
142
+ /**
143
+ * Plays a recording into `dispatch` on timers. Returns a function that cancels
144
+ * the rest — call it on unmount, or on stop before dispatching `run-stopped`.
145
+ */
146
+ export declare function replayAgentRun(recording: AgentRunRecording, dispatch: (event: AgentRunEvent) => void, { speed }?: ReplayAgentRunOptions): () => void;
147
+ //# sourceMappingURL=agent-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-run.d.ts","sourceRoot":"","sources":["../../src/components/agent-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,+EAA+E;AAC/E,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,SAAS,GACT,UAAU,GACV,UAAU,GACV,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAEd,kEAAkE;AAClE,MAAM,MAAM,kBAAkB,GAC5B,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;IACxD,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,YAAY,EAAE,OAAO,CAAC;IACtB,kEAAkE;IACl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AiB,EAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,EACxC,EAAE,KAAS,EAAE,GAAE,qBAA0B,GACxC,MAAM,IAAI,CAsBZ"}
@@ -0,0 +1,250 @@
1
+ /**
2
+ * Agent run state, as a reducer over events.
3
+ *
4
+ * AgentActivity, ApprovalGate, StreamingText and AgentStop each render one
5
+ * state well, and none of them knows about the others. What turns "the agent
6
+ * started step 3" into the right props on all four — one step active at a
7
+ * time, a stopped run keeping what it did, an unanswered approval never
8
+ * counting as a yes — was left to every product, and every product got a
9
+ * different edge wrong. This file is that logic, once.
10
+ *
11
+ * It is plain data in, plain data out: no React, no timers. The same events
12
+ * drive a live run (from a stream, a socket, a poll) and a recorded one
13
+ * (`replayAgentRun`), and `agentRunFrom` rebuilds a finished run for a history
14
+ * page without playing it. `useAgentRun` wraps it for components.
15
+ *
16
+ * Events are JSON-serialisable on purpose, so a recording can be stored as a
17
+ * run log and a backend can emit them as-is.
18
+ */
19
+ export const initialAgentRunState = {
20
+ phase: 'idle',
21
+ steps: [],
22
+ approval: null,
23
+ output: '',
24
+ isStreaming: false,
25
+ isStopping: false,
26
+ };
27
+ const ENDED = ['finished', 'failed', 'stopped', 'expired'];
28
+ /** Whether the run has reached an end — finished, failed, stopped or expired. */
29
+ export const agentRunHasEnded = (state) => ENDED.includes(state.phase);
30
+ const upsert = (steps, id, patch) => steps.some((s) => s.id === id)
31
+ ? steps.map((s) => (s.id === id ? { ...s, ...patch } : s))
32
+ : [...steps, { id, status: 'pending', started: false, ...patch }];
33
+ /** Exactly one step is active: starting `id` finishes whichever else was. */
34
+ const closeActive = (steps, id) => steps.map((s) => s.status === 'active' && s.id !== id
35
+ ? { ...s, status: 'done' }
36
+ : s);
37
+ /** Anything still pending or active becomes skipped — nothing looks queued after an end. */
38
+ const skipUnfinished = (steps) => steps.map((s) => s.status === 'pending' || s.status === 'active'
39
+ ? { ...s, status: 'skipped' }
40
+ : s);
41
+ /**
42
+ * The whole policy. Every rule here is one the AgentRun or HumanApproval
43
+ * pattern states; the comment says which.
44
+ */
45
+ export function agentRunReducer(state, event) {
46
+ if (event.type === 'reset')
47
+ return initialAgentRunState;
48
+ // An ended run is a record. A late event from a slow stream must not
49
+ // reopen it — a "finished" run whose step flips back to active is a lie.
50
+ if (agentRunHasEnded(state))
51
+ return state;
52
+ switch (event.type) {
53
+ case 'run-started':
54
+ return {
55
+ ...initialAgentRunState,
56
+ phase: 'running',
57
+ steps: (event.steps ?? []).map((s) => ({
58
+ id: s.id,
59
+ label: s.label,
60
+ status: 'pending',
61
+ started: false,
62
+ })),
63
+ };
64
+ case 'step-started': {
65
+ // Exactly one step is active at a time (AgentRun). A producer that
66
+ // starts the next step without closing the last has finished it.
67
+ return {
68
+ ...state,
69
+ phase: state.phase === 'idle' ? 'running' : state.phase,
70
+ steps: upsert(closeActive(state.steps, event.id), event.id, {
71
+ status: 'active',
72
+ started: true,
73
+ ...(event.label !== undefined ? { label: event.label } : {}),
74
+ }),
75
+ };
76
+ }
77
+ case 'step-done':
78
+ return {
79
+ ...state,
80
+ steps: upsert(state.steps, event.id, { status: 'done' }),
81
+ };
82
+ case 'step-skipped':
83
+ return {
84
+ ...state,
85
+ steps: upsert(state.steps, event.id, { status: 'skipped' }),
86
+ };
87
+ case 'step-failed':
88
+ return {
89
+ ...state,
90
+ steps: upsert(state.steps, event.id, {
91
+ status: 'failed',
92
+ started: true,
93
+ error: event.error,
94
+ }),
95
+ };
96
+ case 'approval-requested':
97
+ return {
98
+ ...state,
99
+ phase: 'awaiting',
100
+ steps: upsert(closeActive(state.steps, event.id), event.id, {
101
+ status: 'active',
102
+ started: true,
103
+ }),
104
+ approval: { stepId: event.id, status: 'pending', isSubmitting: false },
105
+ };
106
+ case 'decision-submitted':
107
+ return state.approval?.stepId === event.id
108
+ ? {
109
+ ...state,
110
+ approval: {
111
+ ...state.approval,
112
+ isSubmitting: true,
113
+ error: undefined,
114
+ },
115
+ }
116
+ : state;
117
+ case 'decision-failed':
118
+ // The decision did not arrive, so nothing happened: the approval stays
119
+ // pending and the buttons come back (HumanApproval, error).
120
+ return state.approval?.stepId === event.id
121
+ ? {
122
+ ...state,
123
+ approval: {
124
+ ...state.approval,
125
+ isSubmitting: false,
126
+ error: event.error,
127
+ },
128
+ }
129
+ : state;
130
+ case 'approval-resolved': {
131
+ const approval = {
132
+ stepId: event.id,
133
+ status: event.decision,
134
+ resolution: event.resolution,
135
+ isSubmitting: false,
136
+ };
137
+ if (event.decision === 'expired') {
138
+ // Silence is not consent: an approval nobody answered ends the run
139
+ // without doing the thing (HumanApproval).
140
+ return {
141
+ ...state,
142
+ phase: 'expired',
143
+ approval,
144
+ isStreaming: false,
145
+ isStopping: false,
146
+ steps: skipUnfinished(state.steps),
147
+ };
148
+ }
149
+ return {
150
+ ...state,
151
+ phase: 'running',
152
+ approval,
153
+ steps: upsert(state.steps, event.id, {
154
+ status: event.decision === 'approved' ? 'done' : 'skipped',
155
+ }),
156
+ };
157
+ }
158
+ case 'output':
159
+ return {
160
+ ...state,
161
+ output: state.output + event.text,
162
+ isStreaming: true,
163
+ };
164
+ case 'output-done':
165
+ return { ...state, isStreaming: false };
166
+ case 'run-finished':
167
+ return {
168
+ ...state,
169
+ phase: 'finished',
170
+ isStreaming: false,
171
+ isStopping: false,
172
+ steps: state.steps.map((s) => s.status === 'active'
173
+ ? { ...s, status: 'done' }
174
+ : s.status === 'pending'
175
+ ? { ...s, status: 'skipped' }
176
+ : s),
177
+ };
178
+ case 'run-failed': {
179
+ // Mark the step that was running as the one that failed, keep every
180
+ // earlier step, and skip the rest (AgentRun, error).
181
+ const hasFailed = state.steps.some((s) => s.status === 'failed');
182
+ const steps = hasFailed
183
+ ? state.steps
184
+ : state.steps.map((s) => s.status === 'active' ? { ...s, status: 'failed' } : s);
185
+ return {
186
+ ...state,
187
+ phase: 'failed',
188
+ error: event.error,
189
+ isStreaming: false,
190
+ isStopping: false,
191
+ steps: skipUnfinished(steps),
192
+ };
193
+ }
194
+ case 'stop-requested':
195
+ return { ...state, isStopping: true };
196
+ case 'stop-failed':
197
+ // The run is still going, so the stop control must work again.
198
+ return { ...state, isStopping: false };
199
+ case 'run-stopped':
200
+ // Keep what was done, mark the interrupted step skipped (AgentRun,
201
+ // partial). An approval nobody answered did not happen.
202
+ return {
203
+ ...state,
204
+ phase: 'stopped',
205
+ isStreaming: false,
206
+ isStopping: false,
207
+ steps: skipUnfinished(state.steps),
208
+ approval: state.approval?.status === 'pending'
209
+ ? {
210
+ ...state.approval,
211
+ status: 'expired',
212
+ isSubmitting: false,
213
+ resolution: event.resolution ?? state.approval.resolution,
214
+ }
215
+ : state.approval,
216
+ };
217
+ }
218
+ }
219
+ /** A finished run rebuilt from its events, without playing it — for a history page. */
220
+ export const agentRunFrom = (events) => events.reduce(agentRunReducer, initialAgentRunState);
221
+ /** Steps that began, in order — what AgentActivity lists. Never planned-but-unreached ones. */
222
+ export const agentRunLog = (state) => state.steps.filter((s) => s.started);
223
+ /**
224
+ * Plays a recording into `dispatch` on timers. Returns a function that cancels
225
+ * the rest — call it on unmount, or on stop before dispatching `run-stopped`.
226
+ */
227
+ export function replayAgentRun(recording, dispatch, { speed = 1 } = {}) {
228
+ let cancelled = false;
229
+ let timer;
230
+ let i = 0;
231
+ const next = () => {
232
+ if (cancelled || i >= recording.length)
233
+ return;
234
+ const { delay, event } = recording[i];
235
+ timer = setTimeout(() => {
236
+ if (cancelled)
237
+ return;
238
+ i++;
239
+ dispatch(event);
240
+ next();
241
+ }, Math.max(0, delay / speed));
242
+ };
243
+ next();
244
+ return () => {
245
+ cancelled = true;
246
+ if (timer !== undefined)
247
+ clearTimeout(timer);
248
+ };
249
+ }
250
+ //# sourceMappingURL=agent-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-run.js","sourceRoot":"","sources":["../../src/components/agent-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAoFH,MAAM,CAAC,MAAM,oBAAoB,GAAkB;IACjD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